Closedown

This commit is contained in:
boccioli_m
2017-10-17 14:26:05 +02:00
parent 14f44ef0b1
commit 6a56c17ca3
5 changed files with 22 additions and 47 deletions
+1 -1
View File
@@ -422,7 +422,7 @@ public class TestingListDetails extends javax.swing.JPanel {
HashMap mParameterAttributes = new HashMap(); //contians value and description
for(int row=0 ; row<jTableParams.getRowCount() ; row++){
String sParam = jTableParams.getValueAt(row, 0).toString();
String sVal = "\"" + jTableParams.getValueAt(row, 1).toString().replace("\"", "").replace("&","") + "\"";
String sVal = "\"" + jTableParams.getValueAt(row, 1).toString().replace("\"", "").replace("&","").replace(";","") + "\"";
String sDescr = "\"" +jTableParams.getValueAt(row, 2).toString() + "\"";
mParameterAttributes = new HashMap();
mParameterAttributes.put("value", (Object) sVal);
+15 -7
View File
@@ -193,24 +193,31 @@ class UDPDatagram:
self.serverPort = 0xBB1B # interlock server
self.serverName = 'PROMC1' # ball server
try:
self.sock = socket.socket(socket.AF_INET, # Internet
print 'here the socket should be open'
#self.sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
except socket.error, msg:
#except socket.error, msg:
except msg:
print 'Failed to create socket. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
sys.exit()
def _sendUDP(self, message):
try:
# get the ip address and send
self.sock.sendto(message, (self.serverName, self.serverPort))
except socket.error, msg:
print 'here should sendto:', self.serverName, self.serverPort
print 'message: ', message
#self.sock.sendto(message, (self.serverName, self.serverPort))
#except socket.error, msg:
except msg:
print 'Failed to create socket. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
sys.exit()
def _listenInit(self):
try:
self.sock.bind('', self.ThisPort)
except socket.error, msg:
'here should bind to socket'
#self.sock.bind('', self.ThisPort)
#except socket.error, msg:
except msg:
print 'Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
sys.exit()
print 'Socket bind complete. '
@@ -219,7 +226,8 @@ class UDPDatagram:
# now keep talking with the client
while 1:
# receive data from client (data, addr)
data, addr = self.sock.recvfrom(1024)
print 'here should receive data'
#data, addr = self.sock.recvfrom(1024)
if not data:
print 'End of data or no data'
break
+2 -2
View File
@@ -1,5 +1,5 @@
#Mon Oct 16 14:55:50 CEST 2017
#Mon Oct 16 14:56:01 CEST 2017
name=bis-BMA1
tests=RPS Tests Betriebsmode
parameters=mode&"2,IQCOM,$BMA1,1,DIAG"&"vla";channel&"PXXF\:VAL\:31"&"ssp";expectedVal14&"0x0000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";setGetDelay&"1000"&"[ms] delay between set and get";
description=rps section till BMA1
parameters=mode&"2,IQCOM,$BMA1,1,DIAG"&"operating mode";channel&"PXXF\:VAL\:3"&"ssp";expectedVal14&"0x0000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";setGetDelay&"1000"&"[ms] delay between set and get";
+1 -1
View File
@@ -1,5 +1,5 @@
#TestingList for pshell: configuration properties
#Mon Oct 16 14:55:35 CEST 2017
#Tue Oct 17 14:23:41 CEST 2017
customPanel=
showEnabledTestsOnly=true
listFilter=rps-test
@@ -82,32 +82,11 @@ def startTest(testName, DEVICE, params):
test.sendFeedback(ret, success)
return
# loop to read channels for a while and plot the channels values.
# initialise plot tab with 2 plots: pass here the axis names:
scan = ManualScan(['sample'], ['Status (MSTA)', 'Position (VAL)'])
# set plot name(tab title):
scan.setPlotTitle(test.getPlotName())
# start plots. See further below how to add points to the plots (scan):
scan.start()
# inject a sinus into the plot, as example
from math import sin
motor_msta = 0
# take 100 samples of a sinus and a jigsaw plot them:
for sample in range(0, 100):
readback1 = sample #the x axis.
sleep(0.1) # settling time.
# get value (it is translated to a caget):
motor_msta = motor_msta + +1
if motor_msta > 50:
motor_msta = 0
# get value:
motor_val = sin(float(sample)/10.0)*10.0-10.0
# add values to plot:
scan.append([readback1], [readback1], [motor_msta, motor_val])
# now try with data from real device: this part will most probably fail: correct the PV names with existing ones.
try:
ilk = Interlock()
ilk.masterReset()
ilk.setInterlockMode(mode)
# set up connection to channels. "type" of data can be "d" (= double), "l" (= long).
rpsChannel = Channel(channel , type='d')
except:
@@ -119,18 +98,6 @@ def startTest(testName, DEVICE, params):
# send return information:
test.sendFeedback(ret, success)
return
# send a command to a channel (it is translated to a caput): uncomment this line below to try it
#pv_motor_com.put(1.0, timeout=None) # optionally, a timeout can be given.
# take 100 samples of the channels and plot them:
for sample in range(0, 100):
readback1 = sample #the x axis.
sleep(0.1) # settling time.
# get value (it is translated to a caget):
motor_msta = pv_motor_msta.get()
# get value:
motor_val = pv_motor_val.get()
# add values to plot:
scan.append([readback1], [readback1], [motor_msta, motor_val])
# Closing channels: all channels that were opened with Channel() must be closed before exit:
rpsChannel.close()