Unverified Commit e418fc8d authored by Andrea Orlati's avatar Andrea Orlati Committed by GitHub
Browse files

Merge pull request #671 from discos/master

Merging master branch into stable before releasing DISCOS 1.0.6
parents 430cdbb4 aa608bd9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ Common/Libraries/SlaLibrary
Common/Clients/CaltoolClient/src/calibrationtool_ui.py
Common/Clients/CaltoolClient/src/calibrationtool_ui.pye
Common/Errors/AntennaErrors/idl/AntennaErrors.idl
Common/Errors/ActiveSurfaceErrors/idl/ASErrors.idl
Common/Errors/BackendsErrors/idl/BackendsErrors.idl
Common/Errors/ClientErrors/idl/ClientErrors.idl
Common/Errors/ComponentErrors/idl/ComponentErrors.idl
@@ -31,6 +32,7 @@ Common/Interfaces/AntennaInterface/idl/Mount.idl
Common/Interfaces/AntennaInterface/idl/OTF.idl
Common/Interfaces/AntennaInterface/idl/Observatory.idl
Common/Interfaces/AntennaInterface/idl/SkySource.idl
Common/Interfaces/ActiveSurfaceInterface/idl/ActiveSurfaceCommon.idl
Common/Interfaces/CommonInterface/idl/AntennaDefinitions.idl
Common/Interfaces/CommonInterface/idl/BackendsDefinitions.idl
Common/Interfaces/CommonInterface/idl/ManagmentDefinitions.idl
@@ -45,5 +47,4 @@ Noto/Interfaces/NotoActiveSurfaceInterface/idl/NotoActiveSurfaceBoss.idl
SRT/Clients/SRTActiveSurfaceGUIClient/include/SRTActiveSurfaceGUI.h
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceCore.cpp
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceGUIui.cpp
SRT/Errors/SRTActiveSurfaceErrors/idl/ASErrors.idl
SRT/Interfaces/SRTActiveSurfaceInterface/idl/SRTActiveSurfaceBoss.idl
+19 −5
Original line number Diff line number Diff line
@@ -85,10 +85,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/
## [discos1.0.5] - 
## Added
    issue #504 - added credits clause (regarding INAF data ownership) to fits files headers
    issue #518 - KBand receivers cryo temperature read wrongly with connection problems. More information:
    https://github.com/discos/discos/issues/518#issuecomment-590838480

    issue #518 - KBand receivers cryo temperature read wrongly with connection problems. More information: https://github.com/discos/discos/issues/518#issuecomment-590838480
    issue #533 - New Fitszilla version 1.21 online. The user offsets related keywords added to the primary header.
    issue #556 - Added API to send emails to local system administrators. This feature is now exploted when a servo system oscillation is detected at Noto and Medicina
    issue #595 - Added ifdist command to use IF Distributor (for Nt telescope) from operator input.
## Fixed
    issue #518 - In case of communication error we set a dummy value (100000) for the temperature properties, and the related timestamp keeps the value of the last communication timestamp.
    issue #525 - When in LOCAL mode the receivers can turn on/off the noise mark and LNAs. There is no more MNG_FAILURE logging in case of LOCAL mode: only the LOCAL/REMOTE status (during component activation) and the change of status (LOCAL to REMOTE and viceversa) are written to the logfile.
## Changed  
    issue #545 - Oscillation checks enabled for Mc and Nt telescopes, this setting is now under control of a CDB argument

## [next release]
## Added
    issue #653 - added a couple of scriptsto ease vnc conection from remote a file copying. The scripts support 
                 linux and macos
## Fixed
    issue #448 - Added Sky Offsets to calibration tool client
    issue #585 - Fixed misshandled schedule with NULL as backend (Dry Run)
## Changed
    issues #481, #484, #486, #487, #491, #493, #497. SRT Active Surface module has been improved in order to speed up its booting time and optimize its overall behavior
	 issue #604 - The control software will not allow anymore that a schedule, belonging to another project, could be run. In that case a warning message is sent to user console
	              and the execution aborted. 
+2 −2
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ lllll_OBJECTS =
#
# Scripts (public and local)
# ----------------------------
SCRIPTS         =
SCRIPTS         = calibrationtoolclient
SCRIPTS_L       =

#
@@ -78,7 +78,7 @@ TCL_SCRIPTS_L =
#
# Python stuff (public and local)
# ----------------------------
PY_SCRIPTS         =  calibrationtoolclient
PY_SCRIPTS         =  _ctc
PY_SCRIPTS_L       =  

PY_MODULES         = customwidgets calibrationtool_ui 
+190 −147
Original line number Diff line number Diff line
@@ -12,9 +12,10 @@ import ACS, ACS__POA # Import the Python CORBA
from PyQt4 import Qt
from PyQt4.QtCore import pyqtSlot,QThread,QMutex,QTimer
import PyQt4.Qwt5 as Qwt
import sys,getopt
import sys,getopt,os
from time import sleep
import math 
from IRAPy import logger,userLogger



@@ -28,6 +29,7 @@ __version__ = '$Id'
@version $Id$
'''

DEFAULT_COMPONENT="MANAGEMENT/CalibrationTool"

class MyWorker(QThread):
	def __init__(self,component,parent=None):
@@ -66,7 +68,8 @@ class MyWorker(QThread):
                self.newsubscan=0L
                self.oldrecordingstatus=False
                self.newrecordingstatus=False
                
                self.azimuthOffset=self.boss._get_azimuthOffset()
                self.elevationOffset=self.boss._get_elevationOffset()
                
                
        def run (self):
@@ -123,6 +126,12 @@ class MyWorker(QThread):
                        (device,compl13)=self.device.get_sync()
                        self.emit(Qt.SIGNAL("device"),str(device))
                        self.emit(Qt.SIGNAL("scanAxis"),scanaxis)
                        (azOffset,_)=self.azimuthOffset.get_sync()
                        (elOffset,_)=self.elevationOffset.get_sync()

                        self.emit(Qt.SIGNAL("azoffset"),str(azOffset/math.pi*180))
                        self.emit(Qt.SIGNAL("eloffset"),str(elOffset/math.pi*180))


                        rec= self.caltool.isRecording()
                        if rec==True:  
@@ -166,42 +175,83 @@ class MyWorker(QThread):
                pass
 




class Application(Qt.QDialog,calibrationtool_ui.Ui_CalibrationToolDialog):
 
	def __init__(self,compname,parent=None):
		Qt.QDialog.__init__(self)
		
		self.scheduler=None
		self.antennaBoss=None
		self.component=None
		self.componentName=DEFAULT_COMPONENT
		self.managerConnected=False
		self.thread=None
		
		try:
			self.simpleClient = PySimpleClient()
			self.managerConnected=True
		except Exception,ex:
			newEx = ClientErrorsImpl.CouldntLogManagerExImpl(exception=ex, create=1)
			logger.logException(newEx)
			print "Please check the system is up and running......"
			sys.exit(-1)
							
		try:
                        scheduler= self.simpleClient.getDefaultComponent("IDL:alma/Management/Scheduler:1.0")
                        antennaBoss =self.simpleClient.getDefaultComponent("IDL:alma/Antenna/AntennaBoss:1.0")
			self.scheduler= self.simpleClient.getDefaultComponent("IDL:alma/Management/Scheduler:1.0")
		except Exception,ex:
			newEx = ClientErrorsImpl.CouldntAccessComponentExImpl(exception=ex, create=1)
			newEx.setComponentName("IDL:alma/Management/Scheduler:1.0")
			logger.logException(newEx)
			print "Please check the system is up and running and scheduler component is alive!"
			sys.exit(-1)

		try:
			self.antennaBoss =self.simpleClient.getDefaultComponent("IDL:alma/Antenna/AntennaBoss:1.0")
		except Exception,ex:
			newEx = ClientErrorsImpl.CouldntAccessComponentExImpl(exception=ex, create=1)
			newEx.setComponentName("IDL:alma/Antenna/AntennaBoss:1.0")
			logger.logException(newEx)
			print "Please check the system is up and running and antenna boss is alive!"
			sys.exit(-1)

		#choose default recorder
		if compname=='default':
                              
                              recorder=scheduler._get_currentRecorder()
			try:
				recorder=self.scheduler._get_currentRecorder()
				(recordername,compl)=recorder.get_sync()
                              self.componentname=recordername
                              print recordername
			except  Exception,ex:
				newEx = ClientErrorsImpl.CouldntAccessPropertyExImpl(exception=ex, create=1)
				logger.logException(newEx)
				print "Please check scheduler component is alive and responsive|" 
				sys.exit(-1)
					
			print "Starting with default component: " + DEFAULT_COMPONENT	
			if recordername!=DEFAULT_COMPONENT:
				print "Be aware that the in-use recorder is currently " + recordername

			self.componentName=DEFAULT_COMPONENT
				
		else:
                              self.componentname=compname
                        print self.componentname
                        component= self.simpleClient.getComponent(self.componentname)
     			self.thread=MyWorker([component,scheduler,antennaBoss,self.simpleClient])
			self.componentName=compname
			print "Starting with component: " + self.componentName
       	               
		try:
			self.component= self.simpleClient.getComponent(self.componentName)
		except Exception,ex:
			newEx = ClientErrorsImpl.CouldntAccessComponentExImpl(exception=ex, create=1)
			newEx.setComponentName(self.componentName)
			logger.logException(newEx)
			print "Please check the system is up and running and " + self.componentName + " is alive!"
			sys.exit(-1)
		
		self.thread=MyWorker([self.component,self.scheduler,self.antennaBoss,self.simpleClient])
		Qt.QDialog.__init__(self)
		self.setupUi(self)
#		self.qwtPlot_datax.setAxisScale(Qwt.QwtPlot.xBottom, 0,1000)
		self.qwtPlot_datax.setAxisAutoScale(Qwt.QwtPlot. yLeft) 
			self.setWindowTitle(self.componentname)
		self.setWindowTitle(self.componentName)
		self.qwtPlot_datax.setAxisTitle(Qwt.QwtPlot.yLeft, "Ta(K)")
		self.qwtPlot_datay.setAxisTitle(Qwt.QwtPlot.yLeft, "Ta(K)")
		




		self.connect(self.thread,Qt.SIGNAL("arrayDataX"),self.qwtPlot_datay.setX)
		self.connect(self.thread,Qt.SIGNAL("arrayDataY"),self.qwtPlot_datay.setVal)
                        
@@ -222,16 +272,13 @@ class Application(Qt.QDialog,calibrationtool_ui.Ui_CalibrationToolDialog):
		self.connect(self.thread,Qt.SIGNAL("device"),self.deviceIdLineEdit.setText)
		self.connect(self.thread,Qt.SIGNAL("isRecording"),self.isRecording)
		self.connect(self.thread,Qt.SIGNAL("scanAxis"),self.scanAxis)
                self.connect(self.thread,Qt.SIGNAL("eloffset"),self.elOffsetlineEdit.setText)
                self.connect(self.thread,Qt.SIGNAL("azoffset"),self.azOffsetlineEdit.setText)





		except  Exception,ex:
			newEx = ClientErrorsImpl.CouldntAccessComponentExImpl(exception=ex, create=1)
#        		newEx.setComponentName(self.componentname)
         #ACS_LOG_ERROR
        		newEx.log(self.simpleClient.getLogger(),ACSLog.ACS_LOG_ERROR)
        		self.simpleClient.disconnect()
        		sys.exit(-1)	
                       
	@pyqtSlot(Qt.QObject,name="isRecording")
	def isRecording(self,rec):
@@ -242,9 +289,6 @@ class Application(Qt.QDialog,calibrationtool_ui.Ui_CalibrationToolDialog):
			palette.setColor(role, Qt.QColor('gray'))
			self.recording.setPalette(palette)
			self.BScanaxis.setEnabled(False)
                
                
                
		if rec==True:
			self.recording.setText("ON")
			palette = self.recording.palette()
@@ -256,7 +300,6 @@ class Application(Qt.QDialog,calibrationtool_ui.Ui_CalibrationToolDialog):
	@pyqtSlot(Qt.QObject,name="scanAxis")  # decorator for the slot
	def scanAxis(self,scanaxis):
		self.BScanaxis.setText(str(scanaxis))           
                
		if 'SUBR' not in str(scanaxis):
			self.scanAxisLabel.setText('ScanAxis - Pointing')
			xaxis_text="Direction (Deg)"
@@ -266,47 +309,45 @@ class Application(Qt.QDialog,calibrationtool_ui.Ui_CalibrationToolDialog):
			self.scanAxisLabel.setText('ScanAxis - Focus')
			xaxis_text="Distance (mm)"
			hpbw_label_text='HPBW(mm)'

			peakOffsetLabel_text='PeakOffset(mm)'  
                
			self.qwtPlot_datax.setAxisTitle(Qwt.QwtPlot.xBottom, xaxis_text)
			self.qwtPlot_datay.setAxisTitle(Qwt.QwtPlot.xBottom, xaxis_text)
			self.hpbw_label.setText(hpbw_label_text)
			self.peakOffsetLabel.setText(peakOffsetLabel_text)

        

	@pyqtSlot(Qt.QObject,name="scalePlots")  # decorator for the slot
	def scalePlots(self,val):
		self.qwtPlot_datay.setAxisScale(QwtPlot.xBottom, min(val), max(val))
   	
	def run(self):
		self.thread.start()
					
	def __del__(self):
		self.thread.run=False  
		#__del__ apparently is called twice, I have no clue and it should be investigated 
		if self.thread:
			if self.thread.isRunning:
				self.thread.quit()

		if self.managerConnected:
			try:
 		     self.simpleClient.releaseComponent(self.componentname)
				if self.component:
					self.simpleClient.releaseComponent(self.component._get_name())
				if self.scheduler:
					self.simpleClient.releaseComponent(self.scheduler._get_name())
 		     self.simpleClient.releaseComponent(self.boss._get_name())
     


		     self.simpleClient.disconnect()
				if self.antennaBoss:
					self.simpleClient.releaseComponent(self.antennaBoss._get_name())
			except Exception,ex:
                      print "exception"
                      
		print "end app"
		

def usage(nameapp):
        print nameapp+" [component name]"
        
        
  
				print "Error in application cleanup"                      
		
		
def usage():
	print "calibrationtoolclient [component name]"
	print
	print "If no component name is provided, the default MANAGEMENT/CalibrationTool will be used" 

def main(args):
	sys.tracebacklimit=0

	try:
		opts, args = getopt.getopt(sys.argv[1:],"h",["help"])
	except getopt.GetoptError, err:
@@ -320,17 +361,19 @@ def main(args):
			sys.exit()

	if len(args)==0:
            componentname='default'
		componentname='MANAGEMENT/CalibrationTool'
	else:
		componentname=args[0]
  
        print componentname   
	app = Qt.QApplication(args)
	a=Application(componentname) #passa il nome del component al costruttore
	sleep(1)
	a.run()
	p=a.show()	
		
	sys.exit(app.exec_())
	sleep(2)
	print "Application closed!"
	

if __name__=='__main__':
	main(sys.argv)
+150 −17
Original line number Diff line number Diff line
@@ -6,8 +6,8 @@
   <rect>
    <x>0</x>
    <y>0</y>
    <width>954</width>
    <height>572</height>
    <width>998</width>
    <height>726</height>
   </rect>
  </property>
  <property name="windowTitle">
@@ -76,7 +76,7 @@
    <rect>
     <x>527</x>
     <y>40</y>
     <width>401</width>
     <width>415</width>
     <height>51</height>
    </rect>
   </property>
@@ -99,8 +99,8 @@
    <rect>
     <x>560</x>
     <y>100</y>
     <width>371</width>
     <height>371</height>
     <width>381</width>
     <height>381</height>
    </rect>
   </property>
   <property name="frameShape">
@@ -110,9 +110,9 @@
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
      <y>10</y>
      <width>408</width>
      <height>351</height>
      <height>361</height>
     </rect>
    </property>
    <layout class="QGridLayout" name="gridLayout_3">
@@ -131,7 +131,7 @@
        </size>
       </property>
       <property name="text">
        <string>Name</string>
        <string>Source</string>
       </property>
      </widget>
     </item>
@@ -297,7 +297,7 @@
        </size>
       </property>
       <property name="text">
        <string>HPBW(arcmim)</string>
        <string>HPBW (arcmin)</string>
       </property>
      </widget>
     </item>
@@ -425,7 +425,7 @@
        </size>
       </property>
       <property name="text">
        <string>Offset (K)</string>
        <string>Tsys (K)</string>
       </property>
      </widget>
     </item>
@@ -542,7 +542,7 @@
     <x>20</x>
     <y>100</y>
     <width>541</width>
     <height>431</height>
     <height>581</height>
    </rect>
   </property>
   <property name="frameShape">
@@ -554,8 +554,14 @@
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QLabel" name="label_10">
      <property name="font">
       <font>
        <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
      <property name="text">
       <string>Current Subscan</string>
       <string>Ongoing Subscan</string>
      </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
@@ -605,8 +611,14 @@
    </item>
    <item>
     <widget class="QLabel" name="label_9">
      <property name="font">
       <font>
        <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
      <property name="text">
       <string>Last Subscan</string>
       <string>Completed Subscan</string>
      </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
@@ -619,9 +631,9 @@
   <property name="geometry">
    <rect>
     <x>560</x>
     <y>470</y>
     <width>371</width>
     <height>61</height>
     <y>610</y>
     <width>381</width>
     <height>71</height>
    </rect>
   </property>
   <property name="frameShape">
@@ -634,7 +646,7 @@
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>10</y>
      <y>20</y>
      <width>401</width>
      <height>34</height>
     </rect>
@@ -665,12 +677,133 @@
    </property>
   </widget>
  </widget>
  <widget class="QFrame" name="frame_3">
   <property name="geometry">
    <rect>
     <x>560</x>
     <y>480</y>
     <width>381</width>
     <height>131</height>
    </rect>
   </property>
   <property name="frameShape">
    <enum>QFrame::Box</enum>
   </property>
   <widget class="QLabel" name="label_6">
    <property name="geometry">
     <rect>
      <x>10</x>
      <y>10</y>
      <width>121</width>
      <height>21</height>
     </rect>
    </property>
    <property name="font">
     <font>
      <weight>75</weight>
      <bold>true</bold>
     </font>
    </property>
    <property name="text">
     <string>Sky Offsets</string>
    </property>
   </widget>
   <widget class="QWidget" name="gridLayoutWidget">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>40</y>
      <width>408</width>
      <height>71</height>
     </rect>
    </property>
    <layout class="QGridLayout" name="gridLayout">
     <item row="0" column="0">
      <widget class="QLabel" name="label_4">
       <property name="sizePolicy">
        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
         <horstretch>0</horstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
       </property>
       <property name="minimumSize">
        <size>
         <width>100</width>
         <height>22</height>
        </size>
       </property>
       <property name="text">
        <string>Azimuth (Deg)</string>
       </property>
      </widget>
     </item>
     <item row="0" column="1">
      <widget class="QLineEdit" name="azOffsetlineEdit">
       <property name="minimumSize">
        <size>
         <width>94</width>
         <height>22</height>
        </size>
       </property>
       <property name="maximumSize">
        <size>
         <width>150</width>
         <height>26</height>
        </size>
       </property>
       <property name="readOnly">
        <bool>true</bool>
       </property>
      </widget>
     </item>
     <item row="1" column="0">
      <widget class="QLabel" name="label_5">
       <property name="sizePolicy">
        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
         <horstretch>0</horstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
       </property>
       <property name="minimumSize">
        <size>
         <width>100</width>
         <height>22</height>
        </size>
       </property>
       <property name="text">
        <string>Elevation (Deg)</string>
       </property>
      </widget>
     </item>
     <item row="1" column="1">
      <widget class="QLineEdit" name="elOffsetlineEdit">
       <property name="minimumSize">
        <size>
         <width>94</width>
         <height>22</height>
        </size>
       </property>
       <property name="maximumSize">
        <size>
         <width>150</width>
         <height>26</height>
        </size>
       </property>
       <property name="readOnly">
        <bool>true</bool>
       </property>
      </widget>
     </item>
    </layout>
   </widget>
  </widget>
 </widget>
 <customwidgets>
  <customwidget>
   <class>QwtPlot</class>
   <extends>QFrame</extends>
   <header>qwt_plot.h</header>
   <container>1</container>
  </customwidget>
 </customwidgets>
 <resources/>
Loading