Commit 62b4e181 authored by Jalal Mostafa's avatar Jalal Mostafa
Browse files

push multiple from file

parent 5eb227ed
......@@ -69,7 +69,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7498ce4a110646efa02ab8fc048dc905",
"model_id": "347f140ae8cf41c295881559f97a6cb4",
"version_major": 2,
"version_minor": 0
},
......@@ -83,7 +83,7 @@
{
"data": {
"text/plain": [
"<AxesSubplot:title={'center':'OPCUA'}>"
"<AxesSubplot:title={'center':'EPICS'}>"
]
},
"execution_count": 5,
......@@ -105,7 +105,7 @@
" opcua_real_rate[exp][freq] = (1.0 / get_period(freq, exp, 'opcua').div(1e9)).mean()\n",
"\n",
"pd.DataFrame(epics_real_rate).plot(ax=ax[0], kind='bar', title='EPICS')\n",
"pd.DataFrame(opcua_real_rate).plot(ax=ax[1], kind='bar', title='OPCUA')\n"
"# pd.DataFrame(opcua_real_rate).plot(ax=ax[1], kind='bar', title='OPCUA')\n"
]
},
{
......@@ -116,7 +116,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "63158f79908840938dfa371d29b85408",
"model_id": "5cf37859f1594aa194edde95bca262a7",
"version_major": 2,
"version_minor": 0
},
......@@ -130,7 +130,7 @@
{
"data": {
"text/plain": [
"<AxesSubplot:title={'center':'OPCUA'}>"
"<AxesSubplot:title={'center':'EPICS'}>"
]
},
"execution_count": 6,
......@@ -152,7 +152,7 @@
" opcua_real_rate[exp][freq] = len(dataframes[freq][exp]['opcua'])\n",
"\n",
"pd.DataFrame(epics_real_rate).plot(figsize=size, ax=ax[0], kind='bar', title='EPICS')\n",
"pd.DataFrame(opcua_real_rate).plot(figsize=size, ax=ax[1], kind='bar', title='OPCUA')\n"
"# pd.DataFrame(opcua_real_rate).plot(figsize=size, ax=ax[1], kind='bar', title='OPCUA')\n"
]
},
{
......@@ -163,7 +163,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "742ce3bddd6e483a99199e12838b2662",
"model_id": "a0c1007804f840c88a8d446692af9d71",
"version_major": 2,
"version_minor": 0
},
......@@ -177,7 +177,7 @@
{
"data": {
"text/plain": [
"<AxesSubplot:title={'center':'OPCUA'}>"
"<AxesSubplot:title={'center':'EPICS'}>"
]
},
"execution_count": 7,
......@@ -208,7 +208,7 @@
" \n",
"\n",
"pd.DataFrame(epics_real_rate).plot(figsize=size, ax=ax[0], kind='bar', title='EPICS')\n",
"pd.DataFrame(opcua_real_rate).plot(figsize=size, ax=ax[1], kind='bar', title='OPCUA')\n"
"# pd.DataFrame(opcua_real_rate).plot(figsize=size, ax=ax[1], kind='bar', title='OPCUA')\n"
]
},
{
......@@ -219,7 +219,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "03dbe5597f88422cab79a3133774293b",
"model_id": "f66203251ef34b2eb82278d04353b929",
"version_major": 2,
"version_minor": 0
},
......
process_data_read1:temperature
process_data_read2:temperature
process_data_read3:temperature
process_data_read4:temperature
process_data_read5:temperature
process_data_read6:temperature
process_data_read7:temperature
process_data_read8:temperature
process_data_read9:temperature
process_data_read10:temperature
process_data_read11:temperature
process_data_read12:temperature
process_data_read13:temperature
process_data_read14:temperature
process_data_read15:temperature
process_data_read16:temperature
process_data_read17:temperature
process_data_read18:temperature
process_data_read19:temperature
process_data_read20:temperature
process_data_read21:temperature
process_data_read22:temperature
process_data_read23:temperature
process_data_read24:temperature
process_data_read25:temperature
process_data_read26:temperature
process_data_read27:temperature
process_data_read28:temperature
process_data_read29:temperature
process_data_read30:temperature
process_data_read31:temperature
process_data_read32:temperature
process_data_read33:temperature
process_data_read34:temperature
process_data_read35:temperature
process_data_read36:temperature
process_data_read37:temperature
process_data_read38:temperature
process_data_read39:temperature
process_data_read40:temperature
process_data_read41:temperature
process_data_read42:temperature
process_data_read43:temperature
process_data_read44:temperature
process_data_read45:temperature
process_data_read46:temperature
process_data_read47:temperature
process_data_read48:temperature
process_data_read49:temperature
process_data_read50:temperature
process_data_read51:temperature
process_data_read52:temperature
process_data_read53:temperature
process_data_read54:temperature
process_data_read55:temperature
process_data_read56:temperature
process_data_read57:temperature
process_data_read58:temperature
process_data_read59:temperature
process_data_read60:temperature
process_data_read61:temperature
process_data_read62:temperature
process_data_read63:temperature
process_data_read64:temperature
process_data_read65:temperature
process_data_read66:temperature
process_data_read67:temperature
process_data_read68:temperature
process_data_read69:temperature
process_data_read70:temperature
process_data_read71:temperature
process_data_read72:temperature
process_data_read73:temperature
process_data_read74:temperature
process_data_read75:temperature
process_data_read76:temperature
process_data_read77:temperature
process_data_read78:temperature
process_data_read79:temperature
process_data_read80:temperature
process_data_read81:temperature
process_data_read82:temperature
process_data_read83:temperature
process_data_read84:temperature
process_data_read85:temperature
process_data_read86:temperature
process_data_read87:temperature
process_data_read88:temperature
process_data_read89:temperature
process_data_read90:temperature
process_data_read91:temperature
process_data_read92:temperature
process_data_read93:temperature
process_data_read94:temperature
process_data_read95:temperature
process_data_read96:temperature
process_data_read97:temperature
process_data_read98:temperature
process_data_read99:temperature
process_data_read100:temperature
process_data_read101:temperature
process_data_read102:temperature
process_data_read103:temperature
process_data_read104:temperature
process_data_read105:temperature
process_data_read106:temperature
process_data_read107:temperature
process_data_read108:temperature
process_data_read109:temperature
process_data_read110:temperature
process_data_read111:temperature
process_data_read112:temperature
process_data_read113:temperature
process_data_read114:temperature
process_data_read115:temperature
process_data_read116:temperature
process_data_read117:temperature
process_data_read118:temperature
process_data_read119:temperature
process_data_read120:temperature
process_data_read121:temperature
process_data_read122:temperature
process_data_read123:temperature
process_data_read124:temperature
process_data_read125:temperature
process_data_read126:temperature
process_data_read127:temperature
process_data_read128:temperature
process_data_read129:temperature
process_data_read130:temperature
process_data_read131:temperature
process_data_read132:temperature
process_data_read133:temperature
process_data_read134:temperature
process_data_read135:temperature
process_data_read136:temperature
process_data_read137:temperature
process_data_read138:temperature
process_data_read139:temperature
process_data_read140:temperature
process_data_read141:temperature
process_data_read142:temperature
process_data_read143:temperature
process_data_read144:temperature
process_data_read145:temperature
process_data_read146:temperature
process_data_read147:temperature
process_data_read148:temperature
process_data_read149:temperature
process_data_read150:temperature
process_data_read151:temperature
process_data_read152:temperature
process_data_read153:temperature
process_data_read154:temperature
process_data_read155:temperature
process_data_read156:temperature
process_data_read157:temperature
process_data_read158:temperature
process_data_read159:temperature
process_data_read160:temperature
process_data_read161:temperature
process_data_read162:temperature
process_data_read163:temperature
process_data_read164:temperature
process_data_read165:temperature
process_data_read166:temperature
process_data_read167:temperature
process_data_read168:temperature
process_data_read169:temperature
process_data_read170:temperature
process_data_read171:temperature
process_data_read172:temperature
process_data_read173:temperature
process_data_read174:temperature
process_data_read175:temperature
process_data_read176:temperature
process_data_read177:temperature
process_data_read178:temperature
process_data_read179:temperature
process_data_read180:temperature
process_data_read181:temperature
process_data_read182:temperature
process_data_read183:temperature
process_data_read184:temperature
process_data_read185:temperature
process_data_read186:temperature
process_data_read187:temperature
process_data_read188:temperature
process_data_read189:temperature
process_data_read190:temperature
process_data_read191:temperature
process_data_read192:temperature
process_data_read193:temperature
process_data_read194:temperature
process_data_read195:temperature
process_data_read196:temperature
process_data_read197:temperature
process_data_read198:temperature
process_data_read199:temperature
process_data_read200:temperature
process_data_read201:temperature
process_data_read202:temperature
process_data_read203:temperature
process_data_read204:temperature
process_data_read205:temperature
process_data_read206:temperature
process_data_read207:temperature
process_data_read208:temperature
process_data_read209:temperature
process_data_read210:temperature
process_data_read211:temperature
process_data_read212:temperature
process_data_read213:temperature
process_data_read214:temperature
process_data_read215:temperature
process_data_read216:temperature
process_data_read217:temperature
process_data_read218:temperature
process_data_read219:temperature
process_data_read220:temperature
process_data_read221:temperature
process_data_read222:temperature
process_data_read223:temperature
process_data_read224:temperature
process_data_read225:temperature
process_data_read226:temperature
process_data_read227:temperature
process_data_read228:temperature
process_data_read229:temperature
process_data_read230:temperature
process_data_read231:temperature
process_data_read232:temperature
process_data_read233:temperature
process_data_read234:temperature
process_data_read235:temperature
process_data_read236:temperature
process_data_read237:temperature
process_data_read238:temperature
process_data_read239:temperature
process_data_read240:temperature
process_data_read241:temperature
process_data_read242:temperature
process_data_read243:temperature
process_data_read244:temperature
process_data_read245:temperature
process_data_read246:temperature
process_data_read247:temperature
process_data_read248:temperature
process_data_read249:temperature
process_data_read250:temperature
process_data_read251:temperature
process_data_read252:temperature
process_data_read253:temperature
process_data_read254:temperature
process_data_read255:temperature
process_data_read256:temperature
process_data_read257:temperature
process_data_read258:temperature
process_data_read259:temperature
process_data_read260:temperature
process_data_read261:temperature
process_data_read262:temperature
process_data_read263:temperature
process_data_read264:temperature
process_data_read265:temperature
process_data_read266:temperature
process_data_read267:temperature
process_data_read268:temperature
process_data_read269:temperature
process_data_read270:temperature
process_data_read271:temperature
process_data_read272:temperature
process_data_read273:temperature
process_data_read274:temperature
process_data_read275:temperature
process_data_read276:temperature
process_data_read277:temperature
process_data_read278:temperature
process_data_read279:temperature
process_data_read280:temperature
process_data_read281:temperature
process_data_read282:temperature
process_data_read283:temperature
process_data_read284:temperature
process_data_read285:temperature
process_data_read286:temperature
process_data_read287:temperature
process_data_read288:temperature
process_data_read289:temperature
process_data_read290:temperature
process_data_read291:temperature
process_data_read292:temperature
process_data_read293:temperature
process_data_read294:temperature
process_data_read295:temperature
process_data_read296:temperature
process_data_read297:temperature
process_data_read298:temperature
process_data_read299:temperature
......@@ -6,15 +6,10 @@ import datetime as dt
import time
import argparse as arg
from utils import info
import threading as th
def push(pv_name, duration, nelm, loop_wait=None, publish_loop_wait=False):
if loop_wait is not None and publish_loop_wait:
caput('loop:rate', loop_wait)
elif loop_wait is None:
loop_wait = caget('loop:rate')
def push(pv_name, duration, nelm, loop_wait):
start = dt.datetime.now()
duration = dt.timedelta(seconds=duration)
......@@ -36,22 +31,34 @@ def push(pv_name, duration, nelm, loop_wait=None, publish_loop_wait=False):
if sleep_time > 0:
time.sleep(sleep_time)
info(f'[{pv_name}] [{anchor}]:'
f'computed sleep duration {sleep_time} - next {next_ts}')
f'computed sleep duration {sleep_time} - next {next_ts}')
anchor += 1
if __name__ == '__main__':
parser = arg.ArgumentParser(description='Validate EPICS Counter')
parser.add_argument('--loop-wait', '-w', action='store', default=None, type=int,
parser.add_argument('--sleep', '-w', action='store', default=None, type=int,
help='loop rate in milliseconds')
parser.add_argument('--duration', '-d', action='store', default=3600, type=int,
help='run duration in seconds (default is 3600 sec)')
parser.add_argument('--nelm', '-n', action='store', default=1, type=int,
help='Number of elements in an array (default is 1)')
parser.add_argument('pv', metavar='PVName', type=str, help='PV name')
parser.add_argument('pvs', metavar='PVName',
type=str, help='PV name')
args = parser.parse_args()
push(args.pv, args.duration, args.nelm,
loop_wait=args.loop_wait, publish_loop_wait=True)
threads = []
# push(args.pvs[0], args.duration, args.nelm, args.loop_wait)
with open(args.pvs) as f:
for pv in f:
print('Starting thread', pv)
thread = th.Thread(target=push, args=(
pv, args.duration, args.nelm, args.sleep))
thread.start()
threads.append(thread)
time.sleep(0.5)
for thread in threads:
thread.join()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment