Skip to content
Snippets Groups Projects
Unverified Commit 73b16fcc authored by Andrea Orlati's avatar Andrea Orlati Committed by GitHub
Browse files

Fix #902, added configuration for Noto (#903)


* fix issue #902: fixed an issue, related to the porting to python 3 for the Noto LocalOscillator component

* fix issue #902: changed totalpower, weather station configuration and IfDistributr python code (ported to python 3)

* fix issue #902: small fix as requested in Pull Request review

* fix issue #902: adjusted attenutaions in setup procedure for primary band recevier

---------

Co-authored-by: default avatarAndrea Orlati <a.orati@ira.inaf.it>
parent 2790826c
No related branches found
No related tags found
No related merge requests found
Showing with 31 additions and 25 deletions
......@@ -2,6 +2,7 @@
<!--
- History:
- 17 - 11 -2016 created Andrea Orlati (a.orlati@ira.inaf.it)
LocalOscillatorInstance="RECEIVERS/LocalOscillator"
-->
<NotoReceivers xmlns="urn:schemas-cosylab-com:NotoReceivers:1.0"
......@@ -10,7 +11,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
HPIBIPAddress="192.167.187.201"
HPIBPort="1234"
LocalOscillatorInstance="RECEIVERS/LocalOscillator"
LocalOscillatorInstance=""
LocalOscillatorEnabledReceivers="KKC QQC CCC MMC"
FocusSelectorInterface="IDL:alma/Backends/TotalPower:1.0"
>
......
......@@ -12,6 +12,7 @@
Code="TotalPowerImpl"
Type="IDL:alma/Backends/TotalPower:1.0"
Container="TotalPowerContainer"
Default="true"
KeepAliveTime="-1"
ImplLang="cpp"
/>
......@@ -18,7 +18,7 @@
RepetitionCacheTime="2000000"
RepetitionExpireTime="5000000"
DataPort="9001"
DataIPAddress="192.167.187.40"
DataIPAddress="192.167.187.17"
DataLatency="3000000"
SenderSleepTime="300000"
SenderResponseTime="1000000"
......
......@@ -80,7 +80,7 @@
<sections>2</sections>
<calSwitchingEnabled>FALSE</calSwitchingEnabled>
<inputPort>GREGORIAN</inputPort>
<inputPortDB>3</inputPortDB>
<inputPortDB>9</inputPortDB>
<inputPortBW>730</inputPortBW>
<beams>1</beams>
<section_boards>0 1</section_boards>
......
......@@ -88,7 +88,7 @@
ifdist=1,3,-1
ifdist=2,3,-1
ifdist=1,-1,10
ifdist=2,-1,10
ifdist=2,-1,11
</body>
</Procedure>
......@@ -121,8 +121,8 @@
calOff
ifdist=1,2,-1
ifdist=2,2,-1
ifdist=1,-1,44
ifdist=2,-1,44
ifdist=1,-1,22
ifdist=2,-1,22
</body>
</Procedure>
......@@ -138,8 +138,8 @@
calOff
ifdist=1,4,-1
ifdist=2,4,-1
ifdist=1,-1,8
ifdist=2,-1,8
ifdist=1,-1,10
ifdist=2,-1,10
</body>
</Procedure>
......@@ -155,7 +155,7 @@
calOff
ifdist=1,5,-1
ifdist=2,3,-1
ifdist=1,-1,8
ifdist=1,-1,10
ifdist=2,-1,10
</body>
</Procedure>
......
......@@ -6,7 +6,7 @@
xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
IPAddress="192.167.187.103"
IPAddress="192.167.187.244"
port="22222"
UpdatingThreadTime="10000000">
......
......@@ -31,12 +31,12 @@ def send_command(ip, port, command):
s.connect((ip,int(port)))
except socket.error:
return "Fail"
s.sendall(command)
s.sendall(command.encode())
time.sleep(0.1)
response=s.recv(1024)
s.close()
response=response.strip().split('\n')
return response
res=response.decode().strip().split('\n')
return res
def cdb(xmlstr):
root=ET.fromstring(xmlstr)
......
......@@ -32,7 +32,7 @@ class CommandLine:
def initialize(self):
#raises an error.....
self.create()
return self.create()
def configure(self,ip,port):
'''
......@@ -42,7 +42,7 @@ class CommandLine:
self.ip=ip
self.port=port
#raises an error.....
self.connect()
return self.connect()
def create(self):
try:
......@@ -63,10 +63,17 @@ class CommandLine:
def connect(self):
try:
if self.connected==False:
#print ("PRovo la connessione")
self.sock.connect((self.ip,self.port))
#print ("Conessione ok")
self.connected=True
self.sock.sendall('*CLS\n;SYST:ERR?\n++read\n')
cmd="*CLS\n;SYST:ERR?\n++read\n"
#print ("mando stringa di inizializzazione")
self.sock.sendall(cmd.encode())
#print ("mandata")
msg=self.sock.recv(1024)
#print ("ricevuta risposta :")
#print (msg)
except socket.error as msg:
self.close()
return False
......@@ -169,7 +176,7 @@ class CommandLine:
msg=""
if self.check():
try:
self.sock.sendall(cmd)
self.sock.sendall(cmd.encode())
except socket.error as msg:
self.close()
return False,msg
......@@ -181,7 +188,8 @@ class CommandLine:
msg=""
if self.check():
try:
self.sock.sendall(cmd+'\n++read\n')
buff=cmd+'\n++read\n'
self.sock.sendall(cmd.encode())
except socket.error as msg:
self.close()
return False,msg
......
......@@ -99,16 +99,12 @@ class NotoLocalOscillator(Receivers__POA.LocalOscillator, CharacteristicComponen
except Exception:
exc=ComponentErrorsImpl.CDBAccessExImpl()
raise exc
try:
self.cl.initialize()
except CommandLineError as ex:
if not self.cl.initialize():
exc=ComponentErrorsImpl.SocketErrorExImpl()
exc.setData('Reason',ex.__str__)
raise exc
try:
self.cl.configure(IP,PORT)
except CommandLineError as ex:
msg="cannot connect to synthesiser, IP %s, error message is %s" %(IP,ex.__str__)
if not self.cl.configure(IP,PORT):
msg="cannot connect to synthesiser, IP %s, PORT %s" %(IP,PORT)
exc=ComponentErrorsImpl.SocketErrorExImpl()
exc.setData('Reason',msg)
raise exc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment