Axes linked
This commit is contained in:
@@ -173,10 +173,10 @@ IOC_TEST:m0-Dom-WC-Zero
|
||||
IOC_TEST:m0-Dom-WC-Incomplete
|
||||
IOC_TEST:m0-Dom-WC-Complete
|
||||
IOC_TEST:m0-Stat-OK
|
||||
REQMOD:raspberrypi-4996:exit
|
||||
REQMOD:raspberrypi-4996:MODULES
|
||||
REQMOD:raspberrypi-4996:VERSIONS
|
||||
REQMOD:raspberrypi-4996:MOD_VER
|
||||
REQMOD:raspberrypi-10406:exit
|
||||
REQMOD:raspberrypi-10406:MODULES
|
||||
REQMOD:raspberrypi-10406:VERSIONS
|
||||
REQMOD:raspberrypi-10406:MOD_VER
|
||||
IOC_TEST:Axis1-Arr-Stat
|
||||
IOC_TEST:Axis1-PLC-Expr-RB
|
||||
IOC_TEST:Plg-Mtn0-PosAct-Arr
|
||||
@@ -246,18 +246,18 @@ IOC_TEST:m0-SlvRsp
|
||||
IOC_TEST:m0-Dom-WC
|
||||
IOC_TEST:m0s001-Enc01-LtchRst
|
||||
IOC_TEST:Axis1-Cmd_
|
||||
REQMOD:raspberrypi-4996:BaseVersion
|
||||
REQMOD:raspberrypi-4996:require_VER
|
||||
REQMOD:raspberrypi-4996:ecmccfg_VER
|
||||
REQMOD:raspberrypi-4996:asyn_VER
|
||||
REQMOD:raspberrypi-4996:exprtk_VER
|
||||
REQMOD:raspberrypi-4996:motor_VER
|
||||
REQMOD:raspberrypi-4996:ruckig_VER
|
||||
REQMOD:raspberrypi-4996:ecmc_VER
|
||||
REQMOD:raspberrypi-10406:BaseVersion
|
||||
REQMOD:raspberrypi-10406:require_VER
|
||||
REQMOD:raspberrypi-10406:ecmccfg_VER
|
||||
REQMOD:raspberrypi-10406:asyn_VER
|
||||
REQMOD:raspberrypi-10406:exprtk_VER
|
||||
REQMOD:raspberrypi-10406:motor_VER
|
||||
REQMOD:raspberrypi-10406:ruckig_VER
|
||||
REQMOD:raspberrypi-10406:ecmc_VER
|
||||
IOC_TEST:m0s001-HWType
|
||||
IOC_TEST:m0s002-HWType
|
||||
IOC_TEST:Axis1-MsgTxt
|
||||
REQMOD:raspberrypi-4996:ecmc_plugin_motion_VER
|
||||
REQMOD:raspberrypi-10406:ecmc_plugin_motion_VER
|
||||
IOC_TEST:m0s001-Drv01-Stat
|
||||
IOC_TEST:m0s001-Enc01-Stat
|
||||
IOC_TEST:m0s001-Stat_
|
||||
|
||||
@@ -39,7 +39,7 @@ $(SCRIPTEXEC) ($(ecmccfg_DIR)configureAxis.cmd, CONFIG=./cfg/el7031.ax)
|
||||
########################################################################s######
|
||||
## Load plugin: MOTION
|
||||
#
|
||||
epicsEnvSet(ECMC_PLUGIN_CONFIG,"PLUGIN_ID=1,AX=1,BUFF_SIZE=1000,DBG=0,ENA=1")
|
||||
epicsEnvSet(ECMC_PLUGIN_CONFIG,"PLUGIN_ID=1,AX=1,BUFF_SIZE=200,DBG=0,ENA=1")
|
||||
require ecmc_plugin_motion master ${ECMC_PLUGIN_CONFIG}
|
||||
# below needed at ESS but not PSI:
|
||||
${SCRIPTEXEC} ${ecmc_plugin_motion_DIR}startup.cmd "${ECMC_PLUGIN_CONFIG}"
|
||||
|
||||
@@ -180,7 +180,7 @@ class ecmcMtnMainGui(QtWidgets.QDialog):
|
||||
self.graphicsLayoutWidget = pg.GraphicsLayoutWidget()
|
||||
#self.graphicsLayout = pg.GraphicsLayout()
|
||||
self.plotItemAnalog = self.graphicsLayoutWidget.addPlot(row=0,col=0)
|
||||
self.plotitemBinary = self.graphicsLayoutWidget.addPlot(row=1,col=0)
|
||||
self.plotItemBinary = self.graphicsLayoutWidget.addPlot(row=1,col=0)
|
||||
self.pauseBtn = QPushButton(text = 'pause')
|
||||
self.pauseBtn.setFixedSize(100, 50)
|
||||
self.pauseBtn.clicked.connect(self.pauseBtnAction)
|
||||
@@ -785,7 +785,7 @@ class ecmcMtnMainGui(QtWidgets.QDialog):
|
||||
|
||||
minimum_x=0
|
||||
# plot data
|
||||
i = 1
|
||||
#i = 1
|
||||
for pv in pvAnalog:
|
||||
|
||||
if self.data[pv] is not None:
|
||||
@@ -800,6 +800,7 @@ class ecmcMtnMainGui(QtWidgets.QDialog):
|
||||
#plotpen.setColor(color)
|
||||
plotpen=pg.mkPen(self.plotColor[pv],width=2)
|
||||
self.plottedLineAnalog[pv] = self.plotItemAnalog.plot(self.x[x_len-y_len:],y,pen=plotpen)
|
||||
self.plotItemAnalog.showGrid(x=True,y=True)
|
||||
|
||||
#self.plottedLineAnalog[pv], = self.axAnalog.plot(self.x[x_len-y_len:],y,self.plotColor[pv])
|
||||
self.plottedLineAnalog[pv].setData(self.x[x_len-y_len:],y)
|
||||
@@ -810,7 +811,7 @@ class ecmcMtnMainGui(QtWidgets.QDialog):
|
||||
else:
|
||||
print("Data null for pv: " + pv)
|
||||
|
||||
i = i +1
|
||||
#i = i +1
|
||||
|
||||
#self.axAnalog.grid(True)
|
||||
#self.axAnalog.set_xlabel('Time [s]')
|
||||
@@ -847,42 +848,34 @@ class ecmcMtnMainGui(QtWidgets.QDialog):
|
||||
#self.axAnalog.autoscale(enable=False)
|
||||
|
||||
def plotBinary(self, autozoom=False):
|
||||
return
|
||||
|
||||
if self.data['Time-Arr'] is None:
|
||||
return
|
||||
|
||||
#if self.data['PosAct-Arr'] is None:
|
||||
# return
|
||||
|
||||
# create an axis
|
||||
if self.axBinary is None:
|
||||
self.axBinary = self.figure.add_subplot(212)
|
||||
self.axBinary.set_xlim(-10,0)
|
||||
|
||||
|
||||
|
||||
# plot data
|
||||
minimum_x = 0
|
||||
for pv in pvBinary:
|
||||
if self.plottedLineBinary[pv] is not None:
|
||||
self.plottedLineBinary[pv].remove()
|
||||
if self.data[pv] is not None:
|
||||
x_len=len(self.x)
|
||||
y = self.data[pv]
|
||||
y_len=len(y)
|
||||
x_len=len(self.x)
|
||||
self.plottedLineBinary[pv], = self.axBinary.plot(self.x[x_len-y_len:],y,self.plotColor[pv])
|
||||
|
||||
if self.plottedLineBinary[pv] is None:
|
||||
plotpen=pg.mkPen(self.plotColor[pv],width=2)
|
||||
self.plottedLineBinary[pv] = self.plotItemBinary.plot(self.x[x_len-y_len:],y,pen=plotpen)
|
||||
self.plotItemBinary.showGrid(x=True,y=True)
|
||||
self.plotItemBinary.setXLink(self.plotItemAnalog)
|
||||
|
||||
self.plottedLineBinary[pv].setData(self.x[x_len-y_len:],y)
|
||||
minimum_x_temp=-y_len/self.sampleRate
|
||||
if minimum_x_temp < minimum_x:
|
||||
minimum_x = minimum_x_temp
|
||||
|
||||
else:
|
||||
print("Data null for pv: " + pv)
|
||||
|
||||
|
||||
self.axBinary.grid(True)
|
||||
self.axBinary.set_xlabel('Time [s]')
|
||||
self.axBinary.set_ylabel(self.labelBinaryY + ' ' + self.unitBinaryY)
|
||||
self.axBinary.set_title(self.title)
|
||||
#self.axBinary.grid(True)
|
||||
#self.axBinary.set_xlabel('Time [s]')
|
||||
#self.axBinary.set_ylabel(self.labelBinaryY + ' ' + self.unitBinaryY)
|
||||
#self.axBinary.set_title(self.title)
|
||||
|
||||
if autozoom:
|
||||
ymin = -0.1
|
||||
@@ -904,14 +897,14 @@ class ecmcMtnMainGui(QtWidgets.QDialog):
|
||||
range = xmax - xmin
|
||||
xmax += range * 0.02
|
||||
xmin -= range * 0.02
|
||||
self.axBinary.set_ylim(ymin,ymax)
|
||||
self.axBinary.set_xlim(xmin,xmax)
|
||||
#self.axBinary.set_ylim(ymin,ymax)
|
||||
#self.axBinary.set_xlim(xmin,xmax)
|
||||
|
||||
# refresh canvas
|
||||
self.canvas.draw()
|
||||
#self.canvas.draw()
|
||||
self.allowSave = True
|
||||
self.saveBtn.setEnabled(True)
|
||||
self.axBinary.autoscale(enable=False)
|
||||
#self.axBinary.autoscale(enable=False)
|
||||
|
||||
def printOutHelp():
|
||||
print("ecmcMtnMainGui: Plots waveforms of Mtn data (updates on Y data callback). ")
|
||||
|
||||
Reference in New Issue
Block a user