diff --git a/.gitattributes b/.gitattributes index c813390d67f4a6597362456ff3a0be3b20fabdc0..cb6389607cec7ec700eda30eab1cf3c5be602ad6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -752,6 +752,7 @@ CEP/DP3/DPPP/include/DPPP/SourceDBUtil.h -text CEP/DP3/DPPP/include/DPPP/Stokes.h -text CEP/DP3/DPPP/include/DPPP/SubtractMixed.h -text CEP/DP3/DPPP/package.dox -text +CEP/DP3/DPPP/share/HBAdefault -text CEP/DP3/DPPP/share/LBAdefault -text CEP/DP3/DPPP/src/Apply.cc -text CEP/DP3/DPPP/src/BandpassCorrector.cc -text @@ -760,7 +761,6 @@ CEP/DP3/DPPP/src/ComplexMedianFlagger2.cc -text CEP/DP3/DPPP/src/DataBuffer.cc -text CEP/DP3/DPPP/src/DataSquasher.cc -text CEP/DP3/DPPP/src/EstimateMixed.cc -text -CEP/DP3/DPPP/src/EstimateNDPPP.cc -text CEP/DP3/DPPP/src/FrequencyFlagger.cc -text CEP/DP3/DPPP/src/GaussianSource.cc -text CEP/DP3/DPPP/src/IDPPP.cc -text @@ -786,6 +786,7 @@ CEP/DP3/DPPP/src/taqlflagger -text CEP/DP3/DPPP/test/CS1_IDPPP.log_prop -text CEP/DP3/DPPP/test/CS1_IDPPP.parset -text CEP/DP3/DPPP/test/tNDPPP.in_MS.tgz -text svneol=unset#application/x-compressed-tar +CEP/DP3/DPPP/test/testdemixfilter -text CEP/DP3/DPPP/test/tmwflagger.in_cd -text CEP/DP3/DPPP/test/tmwflagger.in_vd -text CEP/GSM/bremen/Makefile -text @@ -808,9 +809,11 @@ CEP/GSM/bremen/sql/tables/create.table.datasets.sql -text CEP/GSM/bremen/sql/tables/create.table.detections.sql -text CEP/GSM/bremen/sql/tables/create.table.extractedsources.sql -text CEP/GSM/bremen/sql/tables/create.table.frequencybands.sql -text +CEP/GSM/bremen/sql/tables/create.table.image_stats.sql -text CEP/GSM/bremen/sql/tables/create.table.images.sql -text CEP/GSM/bremen/sql/tables/create.table.runningcatalog.sql -text CEP/GSM/bremen/sql/tables/create.table.runningcatalog_fluxes.sql -text +CEP/GSM/bremen/sql/tables/create.table.runs.sql -text CEP/GSM/bremen/sql/tables/create.table.temp_associations.sql -text CEP/GSM/bremen/sql/tables/create.table.temprunningcatalog.sql -text CEP/GSM/bremen/sql/tables/freq.dat -text @@ -979,6 +982,7 @@ CEP/Imager/LofarFT/src/LofarCubeSkyEquation.cc -text CEP/Imager/LofarFT/src/LofarVisibilityResampler.cc -text CEP/Imager/LofarFT/src/LofarVisibilityResamplerBase.cc -text CEP/Imager/LofarFT/src/addImagingInfo -text +CEP/Imager/LofarFT/src/makebeamimage.cc -text CEP/LMWCommon/share/cep1_test.clusterdesc -text CEP/LMWCommon/share/cep2.clusterdesc -text CEP/LMWCommon/share/development.clusterdesc -text @@ -1046,11 +1050,11 @@ CEP/ParmDB/test/tsetupsourcedb.in_ms2.vds -text CEP/Pipeline/CMakeLists.txt eol=lf CEP/Pipeline/Doxyfile eol=lf CEP/Pipeline/InputFilter eol=lf -CEP/Pipeline/deploy/fabfile.py eol=lf -CEP/Pipeline/deploy/ipcontroller.sh eol=lf -CEP/Pipeline/deploy/ipengine.sh eol=lf -CEP/Pipeline/deploy/start_cluster.py eol=lf -CEP/Pipeline/deploy/stop_cluster.py eol=lf +CEP/Pipeline/deploy/deprecated/fabfile.py eol=lf +CEP/Pipeline/deploy/deprecated/ipcontroller.sh eol=lf +CEP/Pipeline/deploy/deprecated/ipengine.sh eol=lf +CEP/Pipeline/deploy/deprecated/start_cluster.py eol=lf +CEP/Pipeline/deploy/deprecated/stop_cluster.py eol=lf CEP/Pipeline/docs/examples/definition/dummy/pipeline.cfg eol=lf CEP/Pipeline/docs/examples/definition/dummy/pipeline.py eol=lf CEP/Pipeline/docs/examples/definition/dummy/tasks.cfg eol=lf @@ -1163,16 +1167,16 @@ CEP/Pipeline/framework/lofarpipe/cuisine/pipeline_manager_config.py eol=lf CEP/Pipeline/framework/lofarpipe/support/__init__.py eol=lf CEP/Pipeline/framework/lofarpipe/support/baserecipe.py eol=lf CEP/Pipeline/framework/lofarpipe/support/clusterdesc.py eol=lf -CEP/Pipeline/framework/lofarpipe/support/clusterhandler.py eol=lf -CEP/Pipeline/framework/lofarpipe/support/clusterlogger.py eol=lf CEP/Pipeline/framework/lofarpipe/support/control.py eol=lf +CEP/Pipeline/framework/lofarpipe/support/deprecated/clusterhandler.py eol=lf +CEP/Pipeline/framework/lofarpipe/support/deprecated/clusterlogger.py eol=lf +CEP/Pipeline/framework/lofarpipe/support/deprecated/ipython.py eol=lf +CEP/Pipeline/framework/lofarpipe/support/deprecated/lofarrecipe.py eol=lf CEP/Pipeline/framework/lofarpipe/support/group_data.py eol=lf -CEP/Pipeline/framework/lofarpipe/support/ipython.py eol=lf CEP/Pipeline/framework/lofarpipe/support/jobserver.py eol=lf CEP/Pipeline/framework/lofarpipe/support/lofarexceptions.py eol=lf CEP/Pipeline/framework/lofarpipe/support/lofaringredient.py eol=lf CEP/Pipeline/framework/lofarpipe/support/lofarnode.py eol=lf -CEP/Pipeline/framework/lofarpipe/support/lofarrecipe.py eol=lf CEP/Pipeline/framework/lofarpipe/support/mac.py eol=lf CEP/Pipeline/framework/lofarpipe/support/parset.py eol=lf CEP/Pipeline/framework/lofarpipe/support/pipelinelogging.py eol=lf @@ -1231,34 +1235,19 @@ CEP/Pipeline/recipes/sip/helpers/WritableParmDB.py -text CEP/Pipeline/recipes/sip/helpers/__init__.py eol=lf CEP/Pipeline/recipes/sip/helpers/metadata.py eol=lf CEP/Pipeline/recipes/sip/master/__init__.py eol=lf -CEP/Pipeline/recipes/sip/master/bbs.py eol=lf -CEP/Pipeline/recipes/sip/master/cep2_datamapper.py eol=lf -CEP/Pipeline/recipes/sip/master/cimager.py eol=lf -CEP/Pipeline/recipes/sip/master/compression_pipeline.py eol=lf CEP/Pipeline/recipes/sip/master/copier.py -text -CEP/Pipeline/recipes/sip/master/count_timesteps.py eol=lf -CEP/Pipeline/recipes/sip/master/datamapper.py eol=lf -CEP/Pipeline/recipes/sip/master/demixing.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/casapy.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/collector.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/colmaker.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/copier.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/dppp.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/dummy_echo_parallel.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/excluder.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/flagger.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/mwimager.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/pyraprunner.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/qcheck.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/qcheck/README eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/qcheck/__init__.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/qcheck/qcheck.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/sextractor.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/simple_se.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/trimmer.py eol=lf -CEP/Pipeline/recipes/sip/master/deprecated/vdsmaker.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/bbs.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/cep2_datamapper.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/cimager.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/compression_pipeline.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/count_timesteps.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/datamapper.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/demixing.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/flag_baseline.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/make_flaggable.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/skymodel.py eol=lf +CEP/Pipeline/recipes/sip/master/deprecated/storagemapper.py eol=lf CEP/Pipeline/recipes/sip/master/dppp.py eol=lf -CEP/Pipeline/recipes/sip/master/flag_baseline.py eol=lf CEP/Pipeline/recipes/sip/master/gainoutliercorrection.py -text CEP/Pipeline/recipes/sip/master/get_metadata.py eol=lf CEP/Pipeline/recipes/sip/master/imager_awimager.py eol=lf @@ -1267,38 +1256,27 @@ CEP/Pipeline/recipes/sip/master/imager_create_dbs.py eol=lf CEP/Pipeline/recipes/sip/master/imager_finalize.py -text CEP/Pipeline/recipes/sip/master/imager_prepare.py eol=lf CEP/Pipeline/recipes/sip/master/imager_source_finding.py eol=lf -CEP/Pipeline/recipes/sip/master/make_flaggable.py eol=lf CEP/Pipeline/recipes/sip/master/new_bbs.py eol=lf -CEP/Pipeline/recipes/sip/master/parset.test eol=lf CEP/Pipeline/recipes/sip/master/rficonsole.py eol=lf CEP/Pipeline/recipes/sip/master/setupparmdb.py eol=lf CEP/Pipeline/recipes/sip/master/setupsourcedb.py eol=lf -CEP/Pipeline/recipes/sip/master/skymodel.py eol=lf -CEP/Pipeline/recipes/sip/master/storagemapper.py eol=lf CEP/Pipeline/recipes/sip/master/vdsmaker.py eol=lf CEP/Pipeline/recipes/sip/master/vdsreader.py eol=lf CEP/Pipeline/recipes/sip/nodes/__init__.py eol=lf -CEP/Pipeline/recipes/sip/nodes/bbs.py eol=lf -CEP/Pipeline/recipes/sip/nodes/cimager.py eol=lf CEP/Pipeline/recipes/sip/nodes/copier.py -text -CEP/Pipeline/recipes/sip/nodes/count_timesteps.py eol=lf -CEP/Pipeline/recipes/sip/nodes/demix/demixing.py eol=lf CEP/Pipeline/recipes/sip/nodes/demix/find_a_team.py eol=lf -CEP/Pipeline/recipes/sip/nodes/demix/median_filter.py eol=lf -CEP/Pipeline/recipes/sip/nodes/demix/shiftphasecenter.py eol=lf -CEP/Pipeline/recipes/sip/nodes/demix/smoothdemix.py eol=lf -CEP/Pipeline/recipes/sip/nodes/demix/subtract_from_averaged.py eol=lf -CEP/Pipeline/recipes/sip/nodes/demixing.py eol=lf -CEP/Pipeline/recipes/sip/nodes/deprecated/casapy.py eol=lf -CEP/Pipeline/recipes/sip/nodes/deprecated/colmaker.py eol=lf -CEP/Pipeline/recipes/sip/nodes/deprecated/dummy_echo_parallel.py eol=lf -CEP/Pipeline/recipes/sip/nodes/deprecated/excluder.py eol=lf -CEP/Pipeline/recipes/sip/nodes/deprecated/flagger.py eol=lf -CEP/Pipeline/recipes/sip/nodes/deprecated/qcheck.py eol=lf -CEP/Pipeline/recipes/sip/nodes/deprecated/sextractor.py eol=lf -CEP/Pipeline/recipes/sip/nodes/deprecated/trimmer.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/bbs.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/cimager.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/count_timesteps.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/demix/demixing.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/demix/median_filter.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/demix/shiftphasecenter.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/demix/smoothdemix.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/demix/subtract_from_averaged.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/demixing.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/flag_baseline.py eol=lf +CEP/Pipeline/recipes/sip/nodes/deprecated/make_flaggable.py eol=lf CEP/Pipeline/recipes/sip/nodes/dppp.py eol=lf -CEP/Pipeline/recipes/sip/nodes/flag_baseline.py eol=lf CEP/Pipeline/recipes/sip/nodes/gainoutliercorrection.py -text CEP/Pipeline/recipes/sip/nodes/get_metadata.py eol=lf CEP/Pipeline/recipes/sip/nodes/imager_awimager.py eol=lf @@ -1307,7 +1285,6 @@ CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py eol=lf CEP/Pipeline/recipes/sip/nodes/imager_finalize.py -text CEP/Pipeline/recipes/sip/nodes/imager_prepare.py eol=lf CEP/Pipeline/recipes/sip/nodes/imager_source_finding.py eol=lf -CEP/Pipeline/recipes/sip/nodes/make_flaggable.py eol=lf CEP/Pipeline/recipes/sip/nodes/new_bbs.py eol=lf CEP/Pipeline/recipes/sip/nodes/rficonsole.py eol=lf CEP/Pipeline/recipes/sip/nodes/setupparmdb.py eol=lf @@ -1346,6 +1323,11 @@ CEP/Pipeline/test/recipes/nodes/imager_create_dbs_test.py eol=lf CEP/Pipeline/test/recipes/nodes/imager_prepare_test.py eol=lf CEP/Pipeline/test/regression_tests/calibrator_pipeline.py -text CEP/Pipeline/test/regression_tests/imaging_pipeline.py -text +CEP/Pipeline/test/regression_tests/jenkins_config/calibrator_regression.config.xml -text +CEP/Pipeline/test/regression_tests/jenkins_config/imaging_regression.config.xml -text +CEP/Pipeline/test/regression_tests/jenkins_config/pipeline_task_regression.config.xml -text +CEP/Pipeline/test/regression_tests/jenkins_config/target_regression.config.xml -text +CEP/Pipeline/test/regression_tests/target_pipeline.py -text CEP/Pipeline/test/support/__init__.py eol=lf CEP/Pipeline/test/support/pipelinexml_standalone.py -text CEP/Pipeline/test/support/pipelinexml_test.py -text @@ -1368,6 +1350,7 @@ CEP/Pipeline/test/test_framework/fixture/read.me eol=lf CEP/Pipeline/test/test_framework/unittest_runner.py eol=lf CEP/PyBDSM/doc/anaamika_overview.doc -text CEP/PyBDSM/doc/source/HydraA_74MHz_fit.png -text svneol=unset#image/png +CEP/PyBDSM/doc/source/_templates/searchbox.html -text CEP/PyBDSM/doc/source/algorithms.rst -text CEP/PyBDSM/doc/source/art_fit_alt.png -text svneol=unset#image/png CEP/PyBDSM/doc/source/art_fit_def.png -text svneol=unset#image/png @@ -2001,10 +1984,6 @@ CMake/variants/variants.lofar17 -text CMake/variants/variants.macdiepen -text CMake/variants/variants.mars -text CMake/variants/variants.sas099 -text -JAVA/CEP/jParmFacade/conf/Plotter-config-jparmfacade.jar -text -JAVA/CEP/jParmFacade/pom.xml -text -JAVA/GUI/MAC/jRSP/.cvsignore -text -JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/.cvsignore -text JAVA/GUI/Plotter/.cvsignore -text JAVA/GUI/Plotter/PlotterConfig/.cvsignore -text JAVA/GUI/Plotter/PlotterConfig/nbproject/.cvsignore -text @@ -2146,8 +2125,7 @@ JAVA/LofarUtils/src/nl/astron/lofar/lofarutils/validation/TimeValidator.java -te JAVA/LofarUtils/src/nl/astron/lofar/lofarutils/validation/TimeVectorValidator.java -text JAVA/LofarUtils/src/nl/astron/lofar/lofarutils/validation/Validators.java -text JAVA/LofarUtils/src/nl/astron/lofar/lofarutils/validation/WantsValidationStatus.java -text -JAVA/MAC/jRSP/.cvsignore -text -JAVA/MAC/jRSP/pom.xml -text +JAVA/pom.xml -text svneol=unset#application/xml LCS/AMC/AMCImpl/src/AMCServer.cc -text LCS/AMC/amc_main_classes.png -text LCS/AMC/amc_package.png -text @@ -2165,6 +2143,7 @@ LCS/ApplCommon/test/tObservation.in_conflict2 -text LCS/ApplCommon/test/tObservation.in_conflict3 -text LCS/ApplCommon/test/tObservation.in_conflict4 -text LCS/ApplCommon/test/tObservation.in_conflict5 -text +LCS/ApplCommon/test/tObservation.in_conflict6 -text LCS/ApplCommon/test/tObservation.in_newParset -text LCS/ApplCommon/test/tObservation.in_oldParset -text LCS/ApplCommon/test/tObservation.in_parset1 -text @@ -2173,6 +2152,7 @@ LCS/Blob/test/tBlobField.in_be -text svneol=unset#unset LCS/Blob/test/tBlobField.in_le -text svneol=unset#unset LCS/Blob/test/tBlobStream.in_be -text svneol=unset#unset LCS/Blob/test/tBlobStream.in_le -text svneol=unset#unset +LCS/Common/include/Common/LofarBitModeInfo.h -text LCS/Common/include/Common/NewHandler.h -text LCS/Common/include/Common/Thread/Cancellation.h -text LCS/Common/include/Common/Thread/Condition.h -text @@ -2181,6 +2161,7 @@ LCS/Common/src/Common-Model.cat -text LCS/Common/src/NewHandler.cc -text LCS/Common/src/Thread/Cancellation.cc -text LCS/Common/src/Thread/Thread.cc -text +LCS/Common/test/tBoostBitset.cc -text LCS/Common/test/tCancellation.cc -text LCS/Common/test/tCancellation.sh -text LCS/Common/test/tCondition.cc -text @@ -2202,6 +2183,10 @@ LCS/MSLofar/test/tBeamTables.in_af/CS001-AntennaField.conf -text LCS/MSLofar/test/tBeamTables.in_af/DE601-AntennaField.conf -text LCS/MSLofar/test/tBeamTables.in_af/RS106-AntennaField.conf -text LCS/MSLofar/test/tBeamTables.in_antset -text +LCS/MSLofar/test/tBeamTables.in_before_empty -text +LCS/MSLofar/test/tBeamTables.in_before_filled -text +LCS/MSLofar/test/tBeamTables.in_during_empty -text +LCS/MSLofar/test/tBeamTables.in_during_filled -text LCS/MSLofar/test/tBeamTables.in_hd/CS001-iHBADeltas.conf -text LCS/MSLofar/test/tBeamTables.in_hd/DE601-iHBADeltas.conf -text LCS/MSLofar/test/tBeamTables.in_hd/RS106-iHBADeltas.conf -text @@ -2313,6 +2298,7 @@ LCU/StationTest/tc/empty.py eol=lf LCU/StationTest/tc/hba_client.py eol=lf LCU/StationTest/tc/hba_line_level.py eol=lf LCU/StationTest/tc/hba_server.py eol=lf +LCU/StationTest/tc/no_dc.py -text LCU/StationTest/tc/prsg.py eol=lf LCU/StationTest/tc/rad_lanemode.py eol=lf LCU/StationTest/tc/rad_latency.py eol=lf @@ -2406,10 +2392,22 @@ MAC/APL/CASATools/include/CASATools/CasaConverter.h -text MAC/APL/CASATools/src/CasaConverter.cc -text MAC/APL/CASATools/test/tCasaConverter.cc -text MAC/APL/CASATools/test/tCasaConverter.log_prop -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.h -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHWMonitor.dpl -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitor.conf -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/CMakeLists.txt -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.h -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/PVSSDatapointDefs.h -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/README -text +MAC/APL/CEPCU/src/CEPHardwareMonitor/zabbix_get -text MAC/APL/CEPCU/src/CEPlogProcessor/CEPDatapoints.dpl -text MAC/APL/CEPCU/src/CEPlogProcessor/CEPDatapointtypes.dpl -text MAC/APL/CEPCU/src/CEPlogProcessor/CircularBuffer.h -text MAC/APL/CEPCU/src/CEPlogProcessor/rtlogsender.py -text +MAC/APL/CEPCU/src/OnlineControl/tPVSSMapping.cc -text MAC/APL/CEPCU/src/PythonControl/PythonControl.conf -text MAC/APL/CEPCU/src/PythonControl/tMDparser.cc -text MAC/APL/CR_Protocol/CMakeLists.txt -text @@ -2510,17 +2508,27 @@ MAC/APL/PAC/SHMInfo_Server/test/mis.btsw -text svneol=native#application/octet-s MAC/APL/PAC/SHMInfo_Server/test/mis.io -text svneol=native#application/octet-stream MAC/APL/PAC/SHMInfo_Server/test/mis.pol -text svneol=native#application/octet-stream MAC/APL/PAC/SHMInfo_Server/test/test.sh -text svneol=native#application/octet-stream +MAC/APL/PIC/RSP_Driver/src/BMRead.cc -text +MAC/APL/PIC/RSP_Driver/src/BMRead.h -text +MAC/APL/PIC/RSP_Driver/src/BMWrite.cc -text +MAC/APL/PIC/RSP_Driver/src/BMWrite.h -text MAC/APL/PIC/RSP_Driver/src/CRSyncWrite.cc -text MAC/APL/PIC/RSP_Driver/src/CRSyncWrite.h -text +MAC/APL/PIC/RSP_Driver/src/GetBitModeCmd.cc -text +MAC/APL/PIC/RSP_Driver/src/GetBitModeCmd.h -text MAC/APL/PIC/RSP_Driver/src/GetDatastreamCmd.cc -text MAC/APL/PIC/RSP_Driver/src/GetDatastreamCmd.h -text MAC/APL/PIC/RSP_Driver/src/GetSwapxyCmd.cc -text MAC/APL/PIC/RSP_Driver/src/GetSwapxyCmd.h -text MAC/APL/PIC/RSP_Driver/src/RSPCommands.xls -text +MAC/APL/PIC/RSP_Driver/src/SetBitModeCmd.cc -text +MAC/APL/PIC/RSP_Driver/src/SetBitModeCmd.h -text MAC/APL/PIC/RSP_Driver/src/SetDatastreamCmd.cc -text MAC/APL/PIC/RSP_Driver/src/SetDatastreamCmd.h -text MAC/APL/PIC/RSP_Driver/src/SetSwapxyCmd.cc -text MAC/APL/PIC/RSP_Driver/src/SetSwapxyCmd.h -text +MAC/APL/PIC/RSP_Driver/src/UpdBitModeCmd.cc -text +MAC/APL/PIC/RSP_Driver/src/UpdBitModeCmd.h -text MAC/APL/PIC/RSP_Driver/test/tCableAttenuation.in_1 -text MAC/APL/PIC/RSP_Driver/test/tCableAttenuation.in_2 -text MAC/APL/PIC/RSP_Driver/test/tCableAttenuation.in_3 -text @@ -2534,6 +2542,8 @@ MAC/APL/PIC/RSP_Driver/test/tRCUCables.in_4 -text MAC/APL/PIC/RSP_Driver/test/tRCUCables.in_5 -text MAC/APL/PIC/RSP_Driver/test/tRCUCables.in_6 -text MAC/APL/PIC/RSP_Driver/test/tRCUCables.in_CableAtts -text +MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Bitmode.h -text +MAC/APL/PIC/RSP_Protocol/src/Bitmode.cc -text MAC/APL/PIC/RSP_Protocol/test/tRCUSettings.cc -text MAC/APL/PIC/RSP_Protocol/test/tRCUSettings.stdout -text MAC/APL/PIC/TBB_Driver/test/StubRawEvent.cc -text @@ -2695,6 +2705,7 @@ MAC/Deployment/data/Coordinates/vectors-and-matrices/DE604/de604-lba-solution.li MAC/Deployment/data/Coordinates/vectors-and-matrices/DE605/de605-hba-solution.lisp -text MAC/Deployment/data/Coordinates/vectors-and-matrices/DE605/de605-lba-solution.lisp -text MAC/Deployment/data/Coordinates/vectors-and-matrices/FI609/FI609-hba-solution.lisp -text +MAC/Deployment/data/Coordinates/vectors-and-matrices/FI609/FI609-lba-solution.lisp -text MAC/Deployment/data/Coordinates/vectors-and-matrices/FR606/fr606-hba-solution.lisp -text MAC/Deployment/data/Coordinates/vectors-and-matrices/FR606/fr606-lba-solution.lisp -text MAC/Deployment/data/Coordinates/vectors-and-matrices/RS106/rs106-core-solution-hba.lisp -text @@ -2738,6 +2749,7 @@ MAC/Deployment/data/OTDB/genArrayC++.py -text MAC/Deployment/data/OTDB/genArrayJava.py -text MAC/Deployment/data/OTDB/genArrayTable.py -text MAC/Deployment/data/OTDB/genArrayTest.py -text +MAC/Deployment/data/PVSS/License/471_3031_2_Astron_Gen_II_2_311.log -text MAC/Deployment/data/PVSS/License/CCU099_option.txt -text MAC/Deployment/data/PVSS/License/CS001C_option_lcu037.txt -text MAC/Deployment/data/PVSS/License/CS002_option.txt -text @@ -2783,6 +2795,7 @@ MAC/Deployment/data/PVSS/License/PVSStoolLicense.exe -text MAC/Deployment/data/PVSS/License/RS106C_option.txt -text MAC/Deployment/data/PVSS/License/RS205C_option.txt -text MAC/Deployment/data/PVSS/License/RS208C_option.txt -text +MAC/Deployment/data/PVSS/License/RS305C_option.txt -text MAC/Deployment/data/PVSS/License/RS306C_option.txt -text MAC/Deployment/data/PVSS/License/RS307C_option.lcu013.txt -text MAC/Deployment/data/PVSS/License/RS307C_option.lcu045.txt -text @@ -2832,6 +2845,7 @@ MAC/Deployment/data/PVSS/License/shield.MCU099.txt -text MAC/Deployment/data/PVSS/License/shield.RS106C.txt -text MAC/Deployment/data/PVSS/License/shield.RS205C.txt -text MAC/Deployment/data/PVSS/License/shield.RS208C.txt -text +MAC/Deployment/data/PVSS/License/shield.RS305C.txt -text MAC/Deployment/data/PVSS/License/shield.RS306C.txt -text MAC/Deployment/data/PVSS/License/shield.RS307C.txt -text MAC/Deployment/data/PVSS/License/shield.RS307C_lcu045.txt -text @@ -2841,13 +2855,11 @@ MAC/Deployment/data/PVSS/License/shield.RS508C.txt -text MAC/Deployment/data/PVSS/License/shield.RS509C.txt -text MAC/Deployment/data/PVSS/License/shield.SE607C.txt -text MAC/Deployment/data/PVSS/License/shield.UK608C.txt -text -MAC/Deployment/data/PVSS/License/shield_471_3031_1_Astron_Gen_I_2_311.txt -text -MAC/Deployment/data/PVSS/License/shield_471_3031_2_Astron_Gen_II_2_311.txt -text MAC/Deployment/data/PVSS/License/shield_developdongles.txt -text -MAC/Deployment/data/PVSS/License/test_shield.txt -text MAC/Deployment/data/PVSS/data/Adder.dpdef -text MAC/Deployment/data/PVSS/data/BGPAppl.dpdef -text MAC/Deployment/data/PVSS/data/BGPRack.dpdef -text +MAC/Deployment/data/PVSS/data/CEPHardwareMonitor.dpdef -text MAC/Deployment/data/PVSS/data/CEPObservation.dpdef -text MAC/Deployment/data/PVSS/data/CEPbase.dpdef -text MAC/Deployment/data/PVSS/data/HBAAntenna.dpdef -text @@ -2860,6 +2872,7 @@ MAC/Deployment/data/PVSS/data/Observation.dpdef -text MAC/Deployment/data/PVSS/data/ObservationControl.dpdef -text MAC/Deployment/data/PVSS/data/PVSSbase.dpdef -text MAC/Deployment/data/PVSS/data/RTDBPort.dpdef -text +MAC/Deployment/data/PVSS/data/SoftwareMonitor.dpdef -text MAC/Deployment/data/PVSS/data/StationControl.dpdef -text MAC/Deployment/data/PVSS/data/StationInfo.dpdef -text MAC/Deployment/data/PVSS/data/Stationbase.dpdef -text @@ -2899,12 +2912,12 @@ MAC/Deployment/data/StaticMetaData/AntennaFields/CS301-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS302-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS401-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS501-AntennaField.conf -text -MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/DE604-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/FR606-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS106-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS205-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS208-AntennaField.conf -text +MAC/Deployment/data/StaticMetaData/AntennaFields/RS305-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS306-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS307-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS503-AntennaField.conf -text @@ -2962,13 +2975,14 @@ MAC/Deployment/data/StaticMetaData/iHBADeltas/CS103-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS301-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS302-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS401-iHBADeltas.conf -text -MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/DE603-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/DE604-iHBADeltas.conf -text +MAC/Deployment/data/StaticMetaData/iHBADeltas/FI609-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/FR606-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS106-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS205-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS208-iHBADeltas.conf -text +MAC/Deployment/data/StaticMetaData/iHBADeltas/RS305-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS306-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS307-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS503-iHBADeltas.conf -text @@ -3020,6 +3034,7 @@ MAC/GCF/_PALlight/PMLlight/src/gcf-pmllight.conf.in -text svneol=native#applicat MAC/GCF/_PALlight/PMLlight/src/genTypeInfo -text svneol=native#application/octet-stream MAC/MACIO/include/MACIO/DoubleVector.h -text MAC/MACIO/include/MACIO/KVTLogger.h -text +MAC/MACIO/include/MACIO/Marshalling.tcc -text MAC/MACIO/src/KVTLogger.cc -text MAC/MACIO/src/KVT_Protocol.prot -text MAC/MACIO/src/LOG_Protocol.prot -text @@ -3028,6 +3043,7 @@ MAC/MACIO/test/Clone_Protocol.prot -text MAC/MACIO/test/Echo_Protocol.prot -text MAC/MACIO/test/tClone.stdout -text MAC/MACIO/test/tKVTLogger.cc -text +MAC/MACIO/test/tMarshalling.h -text MAC/Navigator2/Lofar[!!-~]stations.kml -text MAC/Navigator2/Lofar2002.vsd -text MAC/Navigator2/colorDB/Lofar[!!-~]colors -text @@ -3059,6 +3075,7 @@ MAC/Navigator2/panels/FRENKM/TEST.pnl -text MAC/Navigator2/panels/FRENKMnavigator.pnl -text MAC/Navigator2/panels/Hardware/CEP.pnl -text MAC/Navigator2/panels/Hardware/CEP_BGPRack_detailed.pnl -text +MAC/Navigator2/panels/Hardware/CEP_IONode.pnl -text MAC/Navigator2/panels/Hardware/CEP_Midplane.pnl -text MAC/Navigator2/panels/Hardware/CEP_OSRack_detailed.pnl -text MAC/Navigator2/panels/Hardware/HBAAntenna.pnl -text @@ -3077,11 +3094,13 @@ MAC/Navigator2/panels/Observations/Observation_overview.pnl -text MAC/Navigator2/panels/Observations/Observations.pnl -text MAC/Navigator2/panels/Processes/AMCServer.pnl -text MAC/Navigator2/panels/Processes/BGPAppl.pnl -text -MAC/Navigator2/panels/Processes/BGPProc_mainloader.pnl -text +MAC/Navigator2/panels/Processes/BGPProc.pnl -text MAC/Navigator2/panels/Processes/BeamControl.pnl -text MAC/Navigator2/panels/Processes/BeamServer.pnl -text MAC/Navigator2/panels/Processes/CEPHardwareMonitor.pnl -text +MAC/Navigator2/panels/Processes/CEP_IONodeProcesses.pnl -text MAC/Navigator2/panels/Processes/CEP_Processes.pnl -text +MAC/Navigator2/panels/Processes/CEPlogProcessor.pnl -text MAC/Navigator2/panels/Processes/CTStartDaemon.pnl -text MAC/Navigator2/panels/Processes/CalServer.pnl -text MAC/Navigator2/panels/Processes/CalibrationControl.pnl -text @@ -3093,6 +3112,7 @@ MAC/Navigator2/panels/Processes/LogProcessor.pnl -text MAC/Navigator2/panels/Processes/MACScheduler.pnl -text MAC/Navigator2/panels/Processes/MainCU_Processes.pnl -text MAC/Navigator2/panels/Processes/ObservationControl.pnl -text +MAC/Navigator2/panels/Processes/PythonControl.pnl -text MAC/Navigator2/panels/Processes/RSPDriver.pnl -text MAC/Navigator2/panels/Processes/SASGateway.pnl -text MAC/Navigator2/panels/Processes/SHMInfoServer.pnl -text @@ -3177,7 +3197,6 @@ MAC/Navigator2/panels/objects/Hardware/lofar_HW_state.pnl -text MAC/Navigator2/panels/objects/Hardware/midplane_small.pnl -text MAC/Navigator2/panels/objects/Observations/Observation_small.pnl -text MAC/Navigator2/panels/objects/Observations/lofar_Obs_state.pnl -text -MAC/Navigator2/panels/objects/Processes/BGPProc.pnl -text MAC/Navigator2/panels/objects/Processes/ObsSW_CEP.pnl -text MAC/Navigator2/panels/objects/Processes/ObsSW_Main.pnl -text MAC/Navigator2/panels/objects/Processes/ObsSW_Station.pnl -text @@ -3554,6 +3573,21 @@ RTCP/IONProc/src/StreamMultiplexer.h -text RTCP/IONProc/src/generateDelays.cc -text RTCP/IONProc/test/CMakeLists.txt -text RTCP/IONProc/test/RTCP.parset -text +RTCP/IONProc/test/newInputSection/CMakeLists.txt -text +RTCP/IONProc/test/newInputSection/OMPThread.h -text +RTCP/IONProc/test/newInputSection/Poll.h -text +RTCP/IONProc/test/newInputSection/Ranges.h -text +RTCP/IONProc/test/newInputSection/SampleBuffer.h -text +RTCP/IONProc/test/newInputSection/SharedMemory.h -text +RTCP/IONProc/test/newInputSection/StationData.h -text +RTCP/IONProc/test/newInputSection/StationID.h -text +RTCP/IONProc/test/newInputSection/StationSettings.h -text +RTCP/IONProc/test/newInputSection/TimeSync.h -text +RTCP/IONProc/test/newInputSection/foo.cc -text +RTCP/IONProc/test/newInputSection/newInputSection.cc -text +RTCP/IONProc/test/newInputSection/newInputSection_old.cc -text +RTCP/IONProc/test/newInputSection/shmtest.cc -text +RTCP/IONProc/test/newInputSection/tRSPTimeStamp.cc -text RTCP/IONProc/test/tDelayCompensation.cc -text RTCP/IONProc/test/tDelayCompensation.parset -text RTCP/IONProc/test/tDelayCompensation.sh -text @@ -3775,6 +3809,9 @@ SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/icons/navigation/Down16.gi SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/icons/navigation/Up16.gif -text SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ImagerPanel.form -text SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.form -text +SAS/OTB/RSP/.cvsignore -text +SAS/OTB/RSP/pom.xml -text svneol=unset#application/xml +SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/.cvsignore -text SAS/OTB/jOTDB3/CMakeLists.txt -text SAS/OTB/jOTDB3/assembly.xml -text SAS/OTB/jOTDB3/build.xml -text @@ -3848,6 +3885,14 @@ SAS/OTB/jOTDB3/test/tTreeMaintenance.in -text SAS/OTB/jOTDB3/test/tTreeMaintenance.java -text SAS/OTB/jOTDB3/test/tTreeMaintenance.log_prop -text SAS/OTB/jOTDB3/test/testStates.java -text +SAS/OTB/jParmFacade/conf/Plotter-config-jparmfacade.jar -text +SAS/OTB/jParmFacade/include/jParmFacade/nl_astron_lofar_sas_otb_jparmfacade_jParmFacade.h -text +SAS/OTB/jParmFacade/pom.xml -text +SAS/OTB/jParmFacade/src/nl_astron_lofar_otb_jparmfacade_jParmFacade.cc -text +SAS/OTB/jRSP/.cvsignore -text +SAS/OTB/jRSP/include/jRSP/nl_astron_lofar_sas_otb_jrsp_Board.h -text +SAS/OTB/jRSP/pom.xml -text +SAS/OTB/pom.xml -text svneol=unset#application/xml SAS/OTB/scripts/CMakeLists.txt -text SAS/OTB/scripts/src/CMakeLists.txt -text SAS/OTB/scripts/src/checkOTDBServer -text @@ -3855,6 +3900,7 @@ SAS/OTB/scripts/src/startOTB -text SAS/OTB/scripts/src/startOTBServer -text SAS/OTB/scripts/src/startOTBTest -text SAS/OTB/scripts/src/stopOTBServer -text +SAS/OTDB/SPRINT_1.8 -text SAS/OTDB/bin/copyTree.py -text SAS/OTDB/bin/revertDefaultTemplates.py -text SAS/OTDB/include/OTDB/DefaultTemplate.h -text @@ -3874,6 +3920,7 @@ SAS/OTDB/sql/getVTitem_func.sql -text SAS/OTDB/sql/saveSchedulerInfo_func.sql -text SAS/OTDB/sql/upgradeOTDB.sql -text SAS/OTDB/src/DefaultTemplate.cc -text +SAS/OTDB/test/tBrokenHardware.cc -text SAS/OTDB/test/tQueryPIC.cc -text SDP/SPP/DSP[!!-~]BUILDER/myfilterbank.mdl -text SDP/SPP/MATLAB/gui2/gui_qt.fig -text svneol=unset#unset diff --git a/.gitignore b/.gitignore index 0c4db2f3c8632a917e1985c7243b109af0f55754..eb2ea92ad29aaf27a5dd9f9165ee319579c1cf49 100644 --- a/.gitignore +++ b/.gitignore @@ -26,18 +26,6 @@ CEP/pyparmdb/Makefile.common CEP/pyparmdb/autoconf_share CEP/pyparmdb/lofarconf CEP/pyparmdb/py-compile -JAVA/CEP/jParmFacade/Makefile.common -JAVA/CEP/jParmFacade/autoconf_share -JAVA/CEP/jParmFacade/build -JAVA/CEP/jParmFacade/dist -JAVA/CEP/jParmFacade/lofarconf -JAVA/CEP/jParmFacade/nbproject -JAVA/CEP/jParmFacade/target -JAVA/GUI/MAC/jRSP/build -JAVA/GUI/MAC/jRSP/dist -JAVA/GUI/MAC/jRSP/nbproject -JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsListPanel.form -JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsListPanel.java JAVA/GUI/Plotter/PlotterConfig/build JAVA/GUI/Plotter/PlotterConfig/dist JAVA/GUI/Plotter/PlotterConfig/nbproject/private @@ -51,11 +39,6 @@ JAVA/LofarUtils/build JAVA/LofarUtils/dist JAVA/LofarUtils/nbproject JAVA/LofarUtils/target -JAVA/MAC/jRSP/Makefile.am -JAVA/MAC/jRSP/autoconf_share -JAVA/MAC/jRSP/bootstrap -JAVA/MAC/jRSP/configure.in -JAVA/MAC/jRSP/nbproject LCS/ACC/ALC/Makefile.common LCS/ACC/ALC/autoconf_share LCS/ACC/ALC/lofarconf @@ -261,9 +244,28 @@ SAS/OTB/OTB/build SAS/OTB/OTB/dist SAS/OTB/OTB/nbproject SAS/OTB/OTB/target +SAS/OTB/RSP/build +SAS/OTB/RSP/dist +SAS/OTB/RSP/nbproject +SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsListPanel.form +SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsListPanel.java +SAS/OTB/RSP/target SAS/OTB/jOTDB3/build SAS/OTB/jOTDB3/dist SAS/OTB/jOTDB3/target +SAS/OTB/jParmFacade/Makefile.common +SAS/OTB/jParmFacade/autoconf_share +SAS/OTB/jParmFacade/build +SAS/OTB/jParmFacade/dist +SAS/OTB/jParmFacade/lofarconf +SAS/OTB/jParmFacade/nbproject +SAS/OTB/jParmFacade/target +SAS/OTB/jRSP/Makefile.am +SAS/OTB/jRSP/autoconf_share +SAS/OTB/jRSP/bootstrap +SAS/OTB/jRSP/configure.in +SAS/OTB/jRSP/nbproject +SAS/OTB/jRSP/target SAS/OTB/nbproject SAS/OTB/scripts/Makefile.common SAS/OTB/scripts/autoconf_share diff --git a/CEP/Calibration/BBSControl/scripts/plotwindow.py b/CEP/Calibration/BBSControl/scripts/plotwindow.py index 8749503af9a8cbd36e2e3b4d96f7f751c4fb5bdf..e9185c946cf318d2c5f21806f4844a337a22b727 100755 --- a/CEP/Calibration/BBSControl/scripts/plotwindow.py +++ b/CEP/Calibration/BBSControl/scripts/plotwindow.py @@ -228,13 +228,13 @@ class PlotWindow(QFrame): self.show() # show the plotWindow widget self.parent.setXLabel() self.parent.setYLabel() - + # Matplotlib event connections #if self.showMarker==True: # cid = self.fig.canvas.mpl_connect('motion_notify_event', self.update_marker) # cid = self.fig.canvas.mpl_connect('button_press_event', onclick) - cid = self.fig.canvas.mpl_connect('motion_notify_event', self.on_solverMessage) + cid = self.fig.canvas.mpl_connect('motion_notify_event', self.on_solverMessage) # TODO: this doesn work self.cursorId = self.fig.canvas.mpl_connect('button_press_event', self.on_click) self.plot() @@ -400,10 +400,14 @@ class PlotWindow(QFrame): #self.solverMessageText.setText(self.messages[resultType][index]) self.solverMessageText.setReadOnly(False) # make it writable + + #print "resultType =", resultType # DEBUG if resultType=="last": - self.solverMessageText.setText(self.messages[resultType][index]) + #self.solverMessageText.setText(self.messages[resultType][index]) + self.solverMessageText.setText(self.messages[index]) elif resultType=="all": - self.solverMessageText.setText(self.messages[resultType][index]) + #self.solverMessageText.setText(self.messages[resultType][index]) + self.solverMessageText.setText(self.messages[index]) elif resultType==None: print "on_solverMessage() None messages" return diff --git a/CEP/Calibration/BBSControl/scripts/solverdialog.py b/CEP/Calibration/BBSControl/scripts/solverdialog.py index 1a9396b556d4fbbd802453258d824dd5edf8bc29..6e69bb61a1913924aa570d89d614cf7aee3d42d6 100755 --- a/CEP/Calibration/BBSControl/scripts/solverdialog.py +++ b/CEP/Calibration/BBSControl/scripts/solverdialog.py @@ -5,7 +5,7 @@ # File: solverdialog.py # Author: Sven Duscha (duscha@astron.nl) # Date: 2010-08-05 -# Last change; 2011-12-11 +# Last change; 2012-09-27 # # @@ -13,6 +13,8 @@ import sys, os, random import lofar.bbs.solverquery as sq import lofar.bbs.plotwindow +#import solverquery as sq # DEBUG!!! +#import plotwindow # DEBUG!!! import lofar.parmdb as parmdb @@ -870,7 +872,8 @@ class SolverAppForm(QMainWindow): self.getMessages() # get dictionary with solver messages # TODO: get current PlotWindow - self.plots.append(lofar.bbs.plotwindow.PlotWindow(self)) # call PlotWindow class with this class as parent + self.plots.append(lofar.bbs.plotwindow.PlotWindow(self)) # call PlotWindow class with this class as parent + #self.plots.append(plotwindow.PlotWindow(self)) # DEBUG print "on_plot() finished drawing" @@ -1127,7 +1130,6 @@ class SolverAppForm(QMainWindow): # This solverQuery functions fetches the parameter along with the corresponding time stamps y, x=self.solverQuery.readParameter(parameter, start_time, end_time, start_freq, end_freq) - return x, y["last"] # If we plot a single solution per iteration @@ -1152,9 +1154,6 @@ class SolverAppForm(QMainWindow): print "getSolutions() start_time = ", start_time, " end_time = ", end_time # DEBUG y, x=self.solverQuery.getSolution(start_time, end_time, start_freq, end_freq) - - # This then calls Joris' plot function - #self.plot(self.fig, y["last"], x, sub=parsub, scatter=scatter, clf=self.clf) return y, x elif parameter == "CORRMATRIX": @@ -1171,7 +1170,9 @@ class SolverAppForm(QMainWindow): #y=self.solverQuery.readParameter(parameter, start_time, end_time, start_freq, end_freq) #x=self.solverQuery.getMidTimes(start_time, end_time) - #self.plot(self.fig, y['last'], x, sub=111, scatter=scatter, clf=self.clf) # OLD + print "x=",x # DEBUG + print "y=",y # DEBUG + return x, y['last'] else: diff --git a/CEP/Calibration/BBSControl/scripts/solverquery.py b/CEP/Calibration/BBSControl/scripts/solverquery.py index 9405499dba5cabb81a5fd33eaa58d38c043e9fed..188eb7dcba9c46073bcd3a099af2bf69d1a0df56 100644 --- a/CEP/Calibration/BBSControl/scripts/solverquery.py +++ b/CEP/Calibration/BBSControl/scripts/solverquery.py @@ -140,7 +140,7 @@ class SolverQuery: if iteration is "last": #print "readParameter(): last" # DEBUG # Fetch requested parameter for time and freq where LASTITER=TRUE - taqlcmd = "SELECT * FROM " + self.tablename + " WHERE STARTTIME >= "+ str(start_time) + " AND ENDTIME <= " + str(end_time) + " AND STARTFREQ >= "+ str(start_freq) + " AND ENDFREQ <= " + str(end_freq) + " AND LASTITER=TRUE" + taqlcmd = "SELECT * FROM " + self.tablename + " WHERE STARTTIME >= "+ str(start_time) + " AND ENDTIME <= " + str(end_time) + " AND STARTFREQ >= "+ str(start_freq) + " AND ENDFREQ <= " + str(end_freq) + " AND LASTITER=TRUE ORDER BY STARTTIME" result=pt.taql(taqlcmd) parameter=result.getcol(parameter_name) @@ -151,6 +151,9 @@ class SolverQuery: else: starttimes = result.getcol('STARTTIME') + #print "sq::starttimes =", starttimes # DEBUG + #print "sq::starttimes.sort() =", starttimes.sort() # DEBUG + #print "readParameter(): len(parameter): ", len(parameter) # DEBUG #print "readParameter() result.nrows() = ", result.nrows() @@ -168,7 +171,7 @@ class SolverQuery: parameter=result.getcol(parameter_name) if self.convertTime == True: - taqlcmd= "SELECT STARTTIME FROM " + self.tablename + " WHERE STARTTIME >= "+ str(start_time) + " AND ENDTIME <= " + str(end_time) + " AND STARTFREQ >= "+ str(start_freq) + " AND ENDFREQ <= " + str(end_freq) + " AND LASTITER=TRUE" + taqlcmd= "SELECT STARTTIME FROM " + self.tablename + " WHERE STARTTIME >= "+ str(start_time) + " AND ENDTIME <= " + str(end_time) + " AND STARTFREQ >= "+ str(start_freq) + " AND ENDFREQ <= " + str(end_freq) + " AND LASTITER=TRUE ORDER BY STARTTIME" resultTime=pt.taql(taqlcmd) starttimes = resultTime.getcol('STARTTIME') else: @@ -190,7 +193,7 @@ class SolverQuery: if self.convertTime == False: starttimes = result.getcol('STARTTIME') else: - taqlcmd="SELECT CTOD(STARTTIME s) FROM " + self.tablename + taqlcmd="SELECT CTOD(STARTTIME s) FROM " + self.tablename + " ORDER BY STARTTIME" resultTime=pt.taql(timecmd) starttimes = resultTime.getcol('STARTTIME') @@ -985,7 +988,7 @@ class SolverQuery: # Measurementset # def getStartTimes(self): - taqlcmd="SELECT UNIQUE STARTTIME FROM " + self.tablename + taqlcmd="SELECT UNIQUE STARTTIME FROM " + self.tablename + " ORDER BY STARTTIME" self.startTimes=pt.taql(taqlcmd) @@ -1073,7 +1076,7 @@ class SolverQuery: # Measurementset # def setStartFreqs(self): - taqlcmd="SELECT UNIQUE STARTFREQ FROM " + self.tablename + taqlcmd="SELECT UNIQUE STARTFREQ FROM " + self.tablename + " ORDER BY STARTTIME" self.startFreqs=pt.taql(taqlcmd) diff --git a/CEP/Calibration/BBSControl/src/bbs-reducer.cc b/CEP/Calibration/BBSControl/src/bbs-reducer.cc index 4a621d6e120a8b33b4c508fe61610bf77b35f9c9..c5c1d5dc73066a29780715f48a47ec4c63de0762 100644 --- a/CEP/Calibration/BBSControl/src/bbs-reducer.cc +++ b/CEP/Calibration/BBSControl/src/bbs-reducer.cc @@ -235,7 +235,13 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args) // Fake intialization. InitializeCommand initCmd(strategy); - initCmd.accept(handler); + CommandResult initResult = initCmd.accept(handler); + if(!initResult) + { + LOG_ERROR_STR("Error executing " << initCmd.type() << " command: " + << initResult.message()); + return 1; + } // Fake session control. StrategyIterator it; @@ -243,9 +249,19 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args) { if(!it.atEnd()) { + // Execute the current command. LOG_DEBUG_STR("Executing a " << (*it)->type() << " command:" << endl << **it); - (*it)->accept(handler); + CommandResult result = (*it)->accept(handler); + + if(!result) + { + LOG_ERROR_STR("Error executing " << (*it)->type() << " command: " + << result.message()); + return 1; + } + + // Move to the next command in the strategy. ++it; } else @@ -255,7 +271,17 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args) { // Fake finalization. FinalizeCommand finCmd; - finCmd.accept(handler); + + LOG_DEBUG_STR("Executing a " << finCmd.type() << " command:" << endl + << finCmd); + CommandResult result = finCmd.accept(handler); + + if(!result) + { + LOG_ERROR_STR("Error executing " << finCmd.type() << " command: " + << result.message()); + return 1; + } } else { @@ -270,9 +296,17 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args) // Fake next chunk. NextChunkCommand nextCmd(msFreqRange.first, msFreqRange.second, start, end); + LOG_DEBUG_STR("Executing a " << nextCmd.type() << " command:" << endl << nextCmd); - nextCmd.accept(handler); + CommandResult result = nextCmd.accept(handler); + + if(!result) + { + LOG_ERROR_STR("Error executing " << nextCmd.type() << " command: " + << result.message()); + return 1; + } // Re-initialize strategy iterator. it = StrategyIterator(strategy); @@ -368,7 +402,7 @@ int runDistributed(const ParameterSet &options, session.postResult(command.first, result); // If an error occurred, log a descriptive message and exit. - if(result.is(CommandResult::ERROR)) + if(!result) { LOG_ERROR_STR("Error executing " << command.second->type() << " command: " << result.message()); diff --git a/CEP/Calibration/BBSControl/src/bbs-shared-estimator.cc b/CEP/Calibration/BBSControl/src/bbs-shared-estimator.cc index e26c8834d688643029ece18f863eb052c12547e3..37fd65d7363c124b82a9cbe35fea1d7267968a7f 100644 --- a/CEP/Calibration/BBSControl/src/bbs-shared-estimator.cc +++ b/CEP/Calibration/BBSControl/src/bbs-shared-estimator.cc @@ -188,7 +188,7 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList&) session.postResult(command.first, result); // If an error occurred, log a descriptive message and exit. - if(result.is(CommandResult::ERROR)) + if(!result) { LOG_ERROR_STR("Error executing " << command.second->type() << " command: " << result.message()); diff --git a/CEP/DP3/AOFlagger/CMakeLists.txt b/CEP/DP3/AOFlagger/CMakeLists.txt index 23510fec8c06318a79c918e620f0daad3e103651..7a1ea970a3e01a2bf5e9e82cfe62707d111746df 100644 --- a/CEP/DP3/AOFlagger/CMakeLists.txt +++ b/CEP/DP3/AOFlagger/CMakeLists.txt @@ -3,7 +3,7 @@ lofar_package(AOFlagger 1.0 DEPENDS LofarStMan Common LMWCommon) find_package(PkgConfig) -pkg_check_modules(GTKMM gtkmm-2.4) +pkg_check_modules(GTKMM gtkmm-2.4>=2.18) pkg_check_modules(SIGCXX sigc++-2.0) include(LofarFindPackage) diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotpropertieswindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotpropertieswindow.h index c37e9384de10493922be00b9f21ae144577fc4f9..75e5a089017bfa8613585bc4c12db378af2b59d5 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotpropertieswindow.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotpropertieswindow.h @@ -27,6 +27,7 @@ #include <gtkmm/buttonbox.h> #include <gtkmm/checkbutton.h> #include <gtkmm/entry.h> +#include <gtkmm/image.h> #include <gtkmm/label.h> #include <gtkmm/frame.h> #include <gtkmm/radiobutton.h> diff --git a/CEP/DP3/AOFlagger/src/aoquality.cpp b/CEP/DP3/AOFlagger/src/aoquality.cpp index f469c2728412ae0563b72ec2f029181a60b2ab86..2e851b4b6e5707377abcdfc6b179f90ada67a56e 100644 --- a/CEP/DP3/AOFlagger/src/aoquality.cpp +++ b/CEP/DP3/AOFlagger/src/aoquality.cpp @@ -60,7 +60,7 @@ enum CollectingMode CollectHistograms }; -void actionCollect(const std::string &filename, enum CollectingMode mode, StatisticsCollection &statisticsCollection, HistogramCollection &histogramCollection) +void actionCollect(const std::string &filename, enum CollectingMode mode, StatisticsCollection &statisticsCollection, HistogramCollection &histogramCollection, bool mwaChannels, size_t flaggedTimesteps, const std::set<size_t> &flaggedAntennae) { MeasurementSet *ms = new MeasurementSet(filename); const unsigned polarizationCount = ms->GetPolarizationCount(); @@ -85,8 +85,7 @@ void actionCollect(const std::string &filename, enum CollectingMode mode, Statis std::cout << "Polarizations: " << polarizationCount << '\n' << "Bands: " << bandCount << '\n' - << "Channels/band: " << (totalChannels / bandCount) << '\n' - << "Name of observatory: " << stationName << '\n'; + << "Channels/band: " << (totalChannels / bandCount) << '\n'; if(ignoreChannelZero) std::cout << "Channel zero will be ignored, as this looks like a LOFAR data set with bad channel 0.\n"; else @@ -119,7 +118,32 @@ void actionCollect(const std::string &filename, enum CollectingMode mode, Statis std::cout << "Collecting statistics..." << std::endl; + size_t channelCount = bands[0].channels.size(); + bool correlatorFlags[channelCount], correlatorFlagsForBadAntenna[channelCount]; + for(size_t ch=0; ch!=channelCount; ++ch) + { + correlatorFlags[ch] = false; + correlatorFlagsForBadAntenna[ch] = true; + } + + if(mwaChannels) + { + if(channelCount%24 != 0) + std::cout << "MWA channels requested, but nr of channels not a multiply of 24. Ignoring.\n"; + else { + size_t chanPerSb = channelCount/24; + for(size_t x=0;x!=24;++x) + { + correlatorFlags[x*chanPerSb] = true; + correlatorFlags[x*chanPerSb + chanPerSb/2] = true; + correlatorFlags[x*chanPerSb + chanPerSb-1] = true; + } + } + } + const unsigned nrow = table.nrow(); + size_t timestepIndex = (size_t) -1; + double prevtime = -1.0; for(unsigned row = 0; row!=nrow; ++row) { const double time = timeColumn(row); @@ -127,6 +151,12 @@ void actionCollect(const std::string &filename, enum CollectingMode mode, Statis const unsigned antenna2Index = antenna2Column(row); const unsigned bandIndex = windowColumn(row); + if(time != prevtime) + { + ++timestepIndex; + prevtime = time; + } + const BandInfo &band = bands[bandIndex]; const casa::Array<casa::Complex> dataArray = dataColumn(row); @@ -139,6 +169,9 @@ void actionCollect(const std::string &filename, enum CollectingMode mode, Statis isRFI[p] = new bool[band.channels.size()]; samples[p] = new std::complex<float>[band.channels.size()]; } + const bool antennaIsFlagged = + flaggedAntennae.find(antenna1Index) != flaggedAntennae.end() || + flaggedAntennae.find(antenna2Index) != flaggedAntennae.end(); casa::Array<casa::Complex>::const_iterator dataIter = dataArray.begin(); casa::Array<bool>::const_iterator flagIter = flagArray.begin(); @@ -168,10 +201,10 @@ void actionCollect(const std::string &filename, enum CollectingMode mode, Statis switch(mode) { case CollectDefault: - { - const bool origFlags = false; - statisticsCollection.Add(antenna1Index, antenna2Index, time, bandIndex, p, &samples[p]->real(), &samples[p]->imag(), isRFI[p], &origFlags, band.channels.size() - startChannel, 2, 1, 0); - } + if(antennaIsFlagged || timestepIndex < flaggedTimesteps) + statisticsCollection.Add(antenna1Index, antenna2Index, time, bandIndex, p, &samples[p]->real(), &samples[p]->imag(), isRFI[p], correlatorFlagsForBadAntenna, band.channels.size() - startChannel, 2, 1, 1); + else + statisticsCollection.Add(antenna1Index, antenna2Index, time, bandIndex, p, &samples[p]->real(), &samples[p]->imag(), isRFI[p], correlatorFlags, band.channels.size() - startChannel, 2, 1, 1); break; case CollectHistograms: histogramCollection.Add(antenna1Index, antenna2Index, p, samples[p], isRFI[p], band.channels.size() - startChannel); @@ -195,12 +228,12 @@ void actionCollect(const std::string &filename, enum CollectingMode mode, Statis std::cout << "100\n"; } -void actionCollect(const std::string &filename, enum CollectingMode mode) +void actionCollect(const std::string &filename, enum CollectingMode mode, bool mwaChannels, size_t flaggedTimesteps, const std::set<size_t> &flaggedAntennae) { StatisticsCollection statisticsCollection; HistogramCollection histogramCollection; - actionCollect(filename, mode, statisticsCollection, histogramCollection); + actionCollect(filename, mode, statisticsCollection, histogramCollection, mwaChannels, flaggedTimesteps, flaggedAntennae); switch(mode) { @@ -225,10 +258,10 @@ void actionCollect(const std::string &filename, enum CollectingMode mode) std::cout << "Done.\n"; } -void actionCollectHistogram(const std::string &filename, HistogramCollection &histogramCollection) +void actionCollectHistogram(const std::string &filename, HistogramCollection &histogramCollection, bool mwaChannels, size_t flaggedTimesteps, const std::set<size_t> &flaggedAntennae) { StatisticsCollection tempCollection; - actionCollect(filename, CollectHistograms, tempCollection, histogramCollection); + actionCollect(filename, CollectHistograms, tempCollection, histogramCollection, mwaChannels, flaggedTimesteps, flaggedAntennae); } void printStatistics(std::complex<long double> *complexStat, unsigned count) @@ -495,7 +528,7 @@ void printRFISlopeForHistogram(const std::map<HistogramCollection::AntennaPair, } } -void actionHistogram(const std::string &filename, const std::string &query) +void actionHistogram(const std::string &filename, const std::string &query, bool mwaChannels) { HistogramTablesFormatter histogramFormatter(filename); const unsigned polarizationCount = MeasurementSet::GetPolarizationCount(filename); @@ -515,7 +548,7 @@ void actionHistogram(const std::string &filename, const std::string &query) } else if(query == "rfislope-per-baseline") { HistogramCollection collection; - actionCollectHistogram(filename, collection); + actionCollectHistogram(filename, collection, mwaChannels, 0, std::set<size_t>()); MeasurementSet set(filename); size_t antennaCount = set.AntennaCount(); AntennaInfo antennae[antennaCount]; @@ -642,16 +675,30 @@ int main(int argc, char *argv[]) } } } - else if(action == "collect") + else if(action == "collect" || action == "mwacollect") { - if(argc != 3 && !(argc == 4 && std::string(argv[2]) == "-h") ) + bool mwacollect = (action == "mwacollect"); + if(argc < 3) { std::cerr << "collect actions needs one or two parameters (the measurement set)\n"; return -1; } else { - std::string filename = (argc==3) ? argv[2] : argv[3]; - actionCollect(filename, argc==4 ? CollectHistograms : CollectDefault); + bool histograms = (std::string(argv[2]) == "-h"); + int argi = histograms ? 3 : 2; + std::string filename = argv[argi]; + size_t flaggedTimesteps = 0; + ++argi; + std::set<size_t> flaggedAntennae; + if(argi != argc) { + flaggedTimesteps = atoi(argv[argi]); + ++argi; + while(argi != argc) { + flaggedAntennae.insert(atoi(argv[argi])); + ++argi; + } + } + actionCollect(filename, histograms ? CollectHistograms : CollectDefault, mwacollect, flaggedTimesteps, flaggedAntennae); } } else if(action == "combine") @@ -677,7 +724,7 @@ int main(int argc, char *argv[]) return -1; } else { - actionHistogram(argv[3], argv[2]); + actionHistogram(argv[3], argv[2], false); } } else if(action == "summarize") diff --git a/CEP/DP3/AOFlagger/src/msio/memorybaselinereader.cpp b/CEP/DP3/AOFlagger/src/msio/memorybaselinereader.cpp index c3339da62f3d9df112efa02f506f9be1704989a5..dfb02f44645f71ee4308ae1de5a77aafd763a9b5 100644 --- a/CEP/DP3/AOFlagger/src/msio/memorybaselinereader.cpp +++ b/CEP/DP3/AOFlagger/src/msio/memorybaselinereader.cpp @@ -91,20 +91,8 @@ void MemoryBaselineReader::readSet() for(size_t a1=0;a1!=antennaCount;++a1) { matrix[a1].resize(antennaCount); - for(size_t a2=0;a2!=a1;++a2) + for(size_t a2=0;a2!=antennaCount;++a2) matrix[a1][a2] = 0; - for(size_t a2=a1;a2!=antennaCount;++a2) - { - Result *result = new Result(); - for(size_t p=0;p!=polarizationCount;++p) { - result->_realImages.push_back(Image2D::CreateZeroImagePtr(timeStepCount, frequencyCount)); - result->_imaginaryImages.push_back(Image2D::CreateZeroImagePtr(timeStepCount, frequencyCount)); - result->_flags.push_back(Mask2D::CreateSetMaskPtr<true>(timeStepCount, frequencyCount)); - } - result->_bandInfo = band; - result->_uvw.resize(timeStepCount); - matrix[a1][a2] = result; - } } // The actual reading of the data @@ -141,6 +129,18 @@ void MemoryBaselineReader::readSet() if(ant1 > ant2) std::swap(ant1, ant2); Result *result = matrix[ant1][ant2]; + if(result == 0) + { + result = new Result(); + for(size_t p=0;p!=polarizationCount;++p) { + result->_realImages.push_back(Image2D::CreateZeroImagePtr(timeStepCount, frequencyCount)); + result->_imaginaryImages.push_back(Image2D::CreateZeroImagePtr(timeStepCount, frequencyCount)); + result->_flags.push_back(Mask2D::CreateSetMaskPtr<true>(timeStepCount, frequencyCount)); + } + result->_bandInfo = band; + result->_uvw.resize(timeStepCount); + matrix[ant1][ant2] = result; + } dataColumn.get(rowIndex, dataArray); flagColumn.get(rowIndex, flagArray); @@ -195,12 +195,15 @@ void MemoryBaselineReader::readSet() { for(size_t a2=a1;a2!=antennaCount;++a2) { - BaselineID id; - id.antenna1 = a1; - id.antenna2 = a2; - id.spw = 0; - _baselines.insert(std::pair<BaselineID, Result>(id, *matrix[a1][a2])); - delete matrix[a1][a2]; + if(matrix[a1][a2] != 0) + { + BaselineID id; + id.antenna1 = a1; + id.antenna2 = a2; + id.spw = 0; + _baselines.insert(std::pair<BaselineID, Result>(id, *matrix[a1][a2])); + delete matrix[a1][a2]; + } } } _areFlagsChanged = false; diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/imageraction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/imageraction.cpp index a760f35bd81a1c2386ec81029b9f039acb16c0d6..ed6bcdda17c9c185cc800116063085d824fcccd2 100644 --- a/CEP/DP3/AOFlagger/src/strategy/actions/imageraction.cpp +++ b/CEP/DP3/AOFlagger/src/strategy/actions/imageraction.cpp @@ -42,10 +42,10 @@ namespace rfiStrategy { delete tmp; } - bool btPlaneImager = false; + bool btPlaneImager = true; if(btPlaneImager) { - typedef float ImagerNumeric; + typedef double ImagerNumeric; BaselineTimePlaneImager<ImagerNumeric> btImager; BandInfo band = metaData->Band(); Image2DCPtr diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/baselinetimeplaneimager.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/baselinetimeplaneimager.cpp index 60e39de0e36b6766823d9b0d3b88f2b80672485c..05371c6df0118e31020f8a6a10eec036c04b9b19 100644 --- a/CEP/DP3/AOFlagger/src/strategy/algorithms/baselinetimeplaneimager.cpp +++ b/CEP/DP3/AOFlagger/src/strategy/algorithms/baselinetimeplaneimager.cpp @@ -4,14 +4,15 @@ #include <cmath> #include <fftw3.h> +#include <boost/iterator/iterator_concepts.hpp> template<typename NumType> void BaselineTimePlaneImager<NumType>::Image(NumType uTimesLambda, NumType vTimesLambda, NumType wTimesLambda, NumType lowestFrequency, NumType frequencyStep, size_t channelCount, const std::complex<NumType> *data, Image2D &output) { - AOLogger::Debug << "BTImager...\n"; NumType phi = atan2(vTimesLambda, uTimesLambda); size_t imgSize = output.Width(); NumType minLambda = frequencyToWavelength(lowestFrequency + frequencyStep*(NumType) channelCount); + NumType uvDist = sqrt(uTimesLambda*uTimesLambda + vTimesLambda*vTimesLambda) / minLambda; NumType scale = 1.0; // scale down from all sky to ... // Steps to be taken: @@ -30,56 +31,66 @@ void BaselineTimePlaneImager<NumType>::Image(NumType uTimesLambda, NumType vTime // 4. Add to output size_t sampleDist = 2*((size_t) round(lowestFrequency/frequencyStep) + channelCount); - size_t fftSize = std::max(imgSize*2, 2*sampleDist) * 4; - fftw_complex - *fftInp = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * fftSize), - *fftOut = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * fftSize); - fftw_plan plan = fftw_plan_dft_1d(fftSize, fftInp, fftOut, FFTW_FORWARD, FFTW_ESTIMATE); - size_t fftCentre = fftSize / 2; + size_t fftSize = std::max((size_t) (imgSize*sampleDist/(scale * (2.0*uvDist))), 2*sampleDist); + fftw_complex *fftInp = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * (fftSize/2+1)); + double *fftOut = (double*) fftw_malloc(sizeof(double) * fftSize); + fftw_plan plan = fftw_plan_dft_c2r_1d(fftSize, fftInp, fftOut, FFTW_ESTIMATE); size_t startChannel = (lowestFrequency/frequencyStep); - for(size_t i=0;i!=fftSize;++i) { + for(size_t i=0;i!=(fftSize/2+1);++i) { fftInp[i][0] = 0.0; fftInp[i][1] = 0.0; } for(size_t ch=0;ch!=channelCount;++ch) { - fftInp[fftSize - (startChannel + ch)][0] = data->real(); - fftInp[fftSize - (startChannel + ch)][1] = data->imag(); + //fftInp[fftSize - (startChannel + ch)][0] = data->real(); + //fftInp[fftSize - (startChannel + ch)][1] = data->imag(); + //fftInp[(startChannel + ch)][0] = data->real(); + //fftInp[(startChannel + ch)][1] = -data->imag(); fftInp[(startChannel + ch)][0] = data->real(); - fftInp[(startChannel + ch)][1] = -data->imag(); + fftInp[(startChannel + ch)][1] = data->imag(); ++data; } - AOLogger::Debug << "FFT...\n"; - fftw_execute_dft(plan, fftInp, fftOut); - //std::swap(fftInp, fftOut); + //AOLogger::Debug << "FFT...\n"; + fftw_execute(plan); fftw_free(fftInp); - NumType uvwDist = sqrt(uTimesLambda*uTimesLambda + vTimesLambda*vTimesLambda + wTimesLambda*wTimesLambda) / minLambda; - AOLogger::Debug << "phi=" << phi << ",imgSize=" << imgSize << ",minLambda=" << minLambda << ",fftSize=" << fftSize << ",uvwDist=" << uvwDist << ",sampleDist=" << sampleDist << '\n'; + // fftw gives unnormalized results; have to divide by sqrt fftSize. + NumType fftFactor = 1.0 / sqrt(fftSize); + for(size_t i=0;i!=fftSize;++i) + { + fftOut[i] *= fftFactor; + } + AOLogger::Debug << "phi=" << phi << ",imgSize=" << imgSize << ",minLambda=" << minLambda << ",fftSize=" << fftSize << ",uvOnlyDist=" << uvDist << ",sampleDist=" << sampleDist << '\n'; + + size_t fftCentre = fftSize / 2; NumType cosPhi = cos(phi), sinPhi = sin(phi); NumType mid = (NumType) imgSize / 2.0; - NumType transformGen = scale * (2.0*uvwDist / sampleDist) * (fftSize / imgSize); + NumType transformGen = scale * (2.0*uvDist / sampleDist) * (fftSize / imgSize); NumType transformX = cosPhi * transformGen; // Negative rotation (thus positive sin sign) NumType transformY = sinPhi * transformGen; + NumType tanZsinChi = 1.0, tanZcosChi = 1.0; // TODO testing! for(size_t y=0;y!=imgSize;++y) { num_t *destPtr = output.ValuePtr(0, y); - NumType yr = (NumType) y - mid; - NumType yrTransformed = yr * transformY; + NumType m = (NumType) y - mid; for(size_t x=0;x!=imgSize;++x) { - NumType xr = (NumType) x - mid; - NumType srcX = xr * transformX + yrTransformed; + NumType l = (NumType) x - mid; + // We need lookup table for ''(sqrt(1-l*l-m*m)-1)'' + NumType mSeen = m - (sqrt(1-l*l-m*m)-1) * tanZsinChi; + NumType lSeen = l + (sqrt(1-l*l-m*m)-1) * tanZcosChi; + NumType yrTransformed = mSeen * transformY; + NumType srcX = lSeen * transformX + yrTransformed; size_t srcXIndex = (size_t) round(srcX) + fftCentre; if(srcXIndex < fftSize) { if(srcXIndex < fftCentre) - *destPtr += fftOut[srcXIndex+fftCentre][0]; + *destPtr += fftOut[srcXIndex+fftCentre]; else - *destPtr += fftOut[srcXIndex-fftCentre][0]; + *destPtr += fftOut[srcXIndex-fftCentre]; } ++destPtr; //else diff --git a/CEP/DP3/DPPP/include/DPPP/BaselineSelection.h b/CEP/DP3/DPPP/include/DPPP/BaselineSelection.h index de02f2b113341986d7fb8fa434015d534573bf6d..7f83ace2753098399f3f912ccfaf8c97aa3d1b0a 100644 --- a/CEP/DP3/DPPP/include/DPPP/BaselineSelection.h +++ b/CEP/DP3/DPPP/include/DPPP/BaselineSelection.h @@ -54,7 +54,8 @@ namespace LOFAR { // <li> maxbl: maximum baseline length (in m); only if minmax=true // </ul> BaselineSelection (const ParSet&, const string& prefix, - bool minmax=false); + bool minmax=false, + const string& defaultCorrType=string()); // Is there any selection? bool hasSelection() const; diff --git a/CEP/DP3/DPPP/include/DPPP/DPInfo.h b/CEP/DP3/DPPP/include/DPPP/DPInfo.h index cc3efd17f87b93cda0f5c351907bdc55b097f998..f14b5ac0c51b86ecd35eda861b178636b4aaef6d 100644 --- a/CEP/DP3/DPPP/include/DPPP/DPInfo.h +++ b/CEP/DP3/DPPP/include/DPPP/DPInfo.h @@ -82,10 +82,6 @@ namespace LOFAR { const casa::Vector<casa::Int>& ant1, const casa::Vector<casa::Int>& ant2); - // Set the info for the given baselines. - void set (const casa::Vector<casa::Int>& ant1, - const casa::Vector<casa::Int>& ant2); - // Update the info for the given average factors. // If chanAvg is higher than the actual nr of channels, it is reset. // The same is true for timeAvg. @@ -153,6 +149,17 @@ namespace LOFAR { double refFreq() const { return itsRefFreq; } + // Get the antenna numbers actually used in the (selected) baselines. + // E.g. [0,2,5,6] + const vector<int>& antennaUsed() const + { return itsAntUsed; } + + // Get the indices of all antennae in the used antenna vector above. + // -1 means that the antenna is not used. + // E.g. [0,-1,1,-1,-1,2,3] for the example above. + const vector<int>& antennaMap() const + { return itsAntMap; } + // Are the visibility data needed? bool needVisData() const { return itsNeedVisData; } @@ -175,6 +182,10 @@ namespace LOFAR { const vector<double>& getBaselineLengths() const; private: + // Set which antennae are actually used. + void setAntUsed(); + + //# Data members. bool itsNeedVisData; //# Are the visibility data needed? bool itsNeedWrite; //# Does the last step need to write? string itsMSName; @@ -200,6 +211,8 @@ namespace LOFAR { double itsRefFreq; casa::Vector<casa::String> itsAntNames; vector<casa::MPosition> itsAntPos; + vector<int> itsAntUsed; + vector<int> itsAntMap; casa::Vector<casa::Int> itsAnt1; //# ant1 of all baselines casa::Vector<casa::Int> itsAnt2; //# ant2 of all baselines mutable vector<double> itsBLength; //# baseline lengths diff --git a/CEP/DP3/DPPP/include/DPPP/DPStep.h b/CEP/DP3/DPPP/include/DPPP/DPStep.h index 6c6b1d900bc1bda8f2f598cabd6c6d58201fbd7e..fc56fadc0fdec33917b9b981462b959f27906e8d 100644 --- a/CEP/DP3/DPPP/include/DPPP/DPStep.h +++ b/CEP/DP3/DPPP/include/DPPP/DPStep.h @@ -118,7 +118,7 @@ namespace LOFAR { // The default implementation copies the info. virtual void updateInfo (const DPInfo&); - //# Data mamabers. + //# Data members. DPStep::ShPtr itsNextStep; DPInfo itsInfo; }; diff --git a/CEP/DP3/DPPP/include/DPPP/Demixer.h b/CEP/DP3/DPPP/include/DPPP/Demixer.h index 857a089bcf6ec00f100952487c55140fba1a77fc..25b8258a8d695b16cbd46553d4fd2de653c07650 100644 --- a/CEP/DP3/DPPP/include/DPPP/Demixer.h +++ b/CEP/DP3/DPPP/include/DPPP/Demixer.h @@ -32,6 +32,7 @@ #include <DPPP/DPBuffer.h> #include <DPPP/Patch.h> #include <DPPP/PhaseShift.h> +#include <DPPP/Filter.h> #include <casa/Arrays/Cube.h> #include <casa/Quanta/Quantum.h> @@ -102,6 +103,9 @@ namespace LOFAR { uint nChanOut, uint nChanAvg); + // Do the demixing. + void handleDemix(); + // Deproject the sources without a model. void deproject (casa::Array<casa::DComplex>& factors, vector<MultiResultStep*> avgResults, @@ -113,18 +117,27 @@ namespace LOFAR { // Export the solutions to a ParmDB. void dumpSolutions(); + // Merge the data of the selected baselines from the subtract buffer + // into the full buffer. + void mergeSubtractResult(); + //# Data members. DPInput* itsInput; string itsName; string itsSkyName; string itsInstrumentName; + BaselineSelection itsSelBL; + Filter itsFilter; vector<PhaseShift*> itsPhaseShifts; - //# Phase shift and average steps. + //# Phase shift and average steps for demix. vector<DPStep::ShPtr> itsFirstSteps; //# Result of phase shifting and averaging the directions of interest //# at the demix resolution. vector<MultiResultStep*> itsAvgResults; + DPStep::ShPtr itsAvgStepSubtr; + Filter* itsFilterSubtr; //# Result of averaging the target at the subtract resolution. + MultiResultStep* itsAvgResultFull; MultiResultStep* itsAvgResultSubtr; //# Ignore target in demixing? bool itsIgnoreTarget; @@ -180,7 +193,7 @@ namespace LOFAR { casa::Vector<double> itsFreqDemix; casa::Vector<double> itsFreqSubtr; vector<double> itsUnknowns; - vector<double> itsLastKnowns; + vector<double> itsPrevSolution; uint itsTimeIndex; uint itsNConverged; diff --git a/CEP/DP3/DPPP/include/DPPP/Filter.h b/CEP/DP3/DPPP/include/DPPP/Filter.h index 9b0acb82bc5cba0fbb390e0862b5bf32d2c087bc..ee63f38274933208b913bcfcabb5ad47766a4634 100644 --- a/CEP/DP3/DPPP/include/DPPP/Filter.h +++ b/CEP/DP3/DPPP/include/DPPP/Filter.h @@ -130,6 +130,9 @@ namespace LOFAR { // Parameters are obtained from the parset using the given prefix. Filter (DPInput* input, const ParSet&, const string& prefix); + // Construct the object for the given MS and baseline selection. + Filter (DPInput* input, const BaselineSelection&); + virtual ~Filter(); // Process the next data chunk. @@ -148,6 +151,18 @@ namespace LOFAR { // Show the timings. virtual void showTimings (std::ostream&, double duration) const; + // Does the filter step has an actual selection? + bool hasSelection() const + { return itsDoSelect; } + + // Get the indices of the selected baselines. + const vector<uint>& getIndicesBL() const + { return itsSelBL; } + + // Get the buffer. + const DPBuffer& getBuffer() const + { return itsBuf; } + private: //# Data members. DPInput* itsInput; @@ -158,6 +173,7 @@ namespace LOFAR { BaselineSelection itsBaselines; uint itsStartChan; vector<uint> itsSelBL; //# Index of baselines to select + bool itsDoSelect; //# Any selection? NSTimer itsTimer; }; diff --git a/CEP/DP3/DPPP/include/DPPP/MSReader.h b/CEP/DP3/DPPP/include/DPPP/MSReader.h index b50f16d485885d2fe9754dbed183f8b4dfd3b84b..62ba12d5494b726e9871a30e6f068ed07aa6bc81 100644 --- a/CEP/DP3/DPPP/include/DPPP/MSReader.h +++ b/CEP/DP3/DPPP/include/DPPP/MSReader.h @@ -31,7 +31,6 @@ #include <DPPP/DPBuffer.h> #include <DPPP/UVWCalculator.h> #include <DPPP/FlagCounter.h> -#include <DPPP/BaselineSelection.h> #include <tables/Tables/TableIter.h> #include <tables/Tables/RefRows.h> #include <casa/Arrays/Slicer.h> diff --git a/CEP/DP3/DPPP/share/CMakeLists.txt b/CEP/DP3/DPPP/share/CMakeLists.txt index be25d40163202acd3b44af80392a324916baa639..75e8809b010017d9ebc42db2874d8a08be3703c2 100644 --- a/CEP/DP3/DPPP/share/CMakeLists.txt +++ b/CEP/DP3/DPPP/share/CMakeLists.txt @@ -3,4 +3,5 @@ # Data files install(FILES LBAdefault + HBAdefault DESTINATION share/rfistrategies) diff --git a/CEP/DP3/DPPP/share/HBAdefault b/CEP/DP3/DPPP/share/HBAdefault new file mode 100644 index 0000000000000000000000000000000000000000..1f46b4e4ac94497d4d8e41eb071328e5462deb97 --- /dev/null +++ b/CEP/DP3/DPPP/share/HBAdefault @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a Strategy configuration file for the +rfi detector by André Offringa (offringa@astro.rug.nl). +--> +<rfi-strategy format-version="3.7" reader-version-required="3.4"> + <action type="Strategy"> + <children> + <action type="SetFlaggingAction"> + <new-flagging>0</new-flagging> + </action> + <action type="ForEachPolarisationBlock"> + <on-xx>0</on-xx> + <on-xy>1</on-xy> + <on-yx>1</on-yx> + <on-yy>0</on-yy> + <on-stokes-i>0</on-stokes-i> + <on-stokes-q>0</on-stokes-q> + <on-stokes-u>0</on-stokes-u> + <on-stokes-v>0</on-stokes-v> + <children> + <action type="ForEachComplexComponentAction"> + <on-amplitude>1</on-amplitude> + <on-phase>0</on-phase> + <on-real>0</on-real> + <on-imaginary>0</on-imaginary> + <restore-from-amplitude>0</restore-from-amplitude> + <children> + <action type="IterationBlock"> + <iteration-count>2</iteration-count> + <sensitivity-start>4</sensitivity-start> + <children> + <action type="SumThresholdAction"> + <base-sensitivity>1</base-sensitivity> + <time-direction-flagging>1</time-direction-flagging> + <frequency-direction-flagging>1</frequency-direction-flagging> + </action> + <action type="CombineFlagResults"> + <children> + <action type="FrequencySelectionAction"> + <threshold>3</threshold> + </action> + <action type="TimeSelectionAction"> + <threshold>3.5</threshold> + </action> + </children> + </action> + <action type="SetImageAction"> + <new-image>1</new-image> + </action> + <action type="ChangeResolutionAction"> + <time-decrease-factor>3</time-decrease-factor> + <frequency-decrease-factor>3</frequency-decrease-factor> + <restore-revised>1</restore-revised> + <restore-masks>0</restore-masks> + <children> + <action type="HighPassFilterAction"> + <horizontal-kernel-sigma-sq>2.5</horizontal-kernel-sigma-sq> + <vertical-kernel-sigma-sq>5</vertical-kernel-sigma-sq> + <window-width>21</window-width> + <window-height>31</window-height> + <mode>1</mode> + </action> + </children> + </action> + </children> + </action> + <action type="SumThresholdAction"> + <base-sensitivity>1</base-sensitivity> + <time-direction-flagging>1</time-direction-flagging> + <frequency-direction-flagging>1</frequency-direction-flagging> + </action> + </children> + </action> + </children> + </action> + <action type="SetFlaggingAction"> + <new-flagging>4</new-flagging> + </action> + <action type="StatisticalFlagAction"> + <enlarge-frequency-size>0</enlarge-frequency-size> + <enlarge-time-size>0</enlarge-time-size> + <max-contaminated-frequencies-ratio>0.5</max-contaminated-frequencies-ratio> + <max-contaminated-times-ratio>0.5</max-contaminated-times-ratio> + <minimum-good-frequency-ratio>0.2</minimum-good-frequency-ratio> + <minimum-good-time-ratio>0.2</minimum-good-time-ratio> + </action> + </children> + </action> +</rfi-strategy> diff --git a/CEP/DP3/DPPP/share/LBAdefault b/CEP/DP3/DPPP/share/LBAdefault index 200dc2f961748cd3b7ea90b75ae4afc4a5f3c0c5..0a7ba38f0f5848c66cf7930e464b68c4128f75ed 100644 --- a/CEP/DP3/DPPP/share/LBAdefault +++ b/CEP/DP3/DPPP/share/LBAdefault @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- This is a Strategy configuration file for the rfi detector by André Offringa (offringa@astro.rug.nl). -It is the default strategy for LBA observations. --> <rfi-strategy format-version="3.7" reader-version-required="3.4"> <action type="Strategy"> @@ -32,8 +31,8 @@ It is the default strategy for LBA observations. <children> <action type="SumThresholdAction"> <base-sensitivity>1</base-sensitivity> - <time-direction-flagging>1</time-direction-flagging> - <frequency-direction-flagging>0</frequency-direction-flagging> + <time-direction-flagging>0</time-direction-flagging> + <frequency-direction-flagging>1</frequency-direction-flagging> </action> <action type="CombineFlagResults"> <children> @@ -67,8 +66,8 @@ It is the default strategy for LBA observations. </action> <action type="SumThresholdAction"> <base-sensitivity>1</base-sensitivity> - <time-direction-flagging>1</time-direction-flagging> - <frequency-direction-flagging>0</frequency-direction-flagging> + <time-direction-flagging>0</time-direction-flagging> + <frequency-direction-flagging>1</frequency-direction-flagging> </action> </children> </action> @@ -114,4 +113,4 @@ It is the default strategy for LBA observations. </action> </children> </action> -</rfi-strategy> +</rfi-strategy> \ No newline at end of file diff --git a/CEP/DP3/DPPP/src/BaselineSelection.cc b/CEP/DP3/DPPP/src/BaselineSelection.cc index efa40f0baeaf4668585e1bf0721ab0e8f5201a03..d5d3f45f5c15a820b04775f493d6f066c8cff951 100644 --- a/CEP/DP3/DPPP/src/BaselineSelection.cc +++ b/CEP/DP3/DPPP/src/BaselineSelection.cc @@ -39,9 +39,10 @@ namespace LOFAR { BaselineSelection::BaselineSelection (const ParSet& parset, const string& prefix, - bool minmax) + bool minmax, + const string& defaultCorrType) : itsStrBL (parset.getString (prefix + "baseline", "")), - itsCorrType (parset.getString (prefix + "corrtype", "")), + itsCorrType (parset.getString (prefix + "corrtype", defaultCorrType)), itsRangeBL (parset.getDoubleVector (prefix + "blrange", vector<double>())) { @@ -69,9 +70,10 @@ namespace LOFAR { void BaselineSelection::show (ostream& os) const { - os << " baseline: " << itsStrBL << std::endl; - os << " corrtype: " << itsCorrType << std::endl; - os << " blrange: " << itsRangeBL << std::endl; + os << " Baseline selection:" << std::endl; + os << " baseline: " << itsStrBL << std::endl; + os << " corrtype: " << itsCorrType << std::endl; + os << " blrange: " << itsRangeBL << std::endl; } Matrix<bool> BaselineSelection::apply (const DPInfo& info) const diff --git a/CEP/DP3/DPPP/src/DPInfo.cc b/CEP/DP3/DPPP/src/DPInfo.cc index 43e7efa192d586a315c1ebd123ef07ed4cd965ad..d1b9496ef08586af93bba2e299d680ade867d503 100644 --- a/CEP/DP3/DPPP/src/DPInfo.cc +++ b/CEP/DP3/DPPP/src/DPInfo.cc @@ -111,13 +111,28 @@ namespace LOFAR { itsAntPos = antPos; itsAnt1.reference (ant1); itsAnt2.reference (ant2); + // Set which antennae are used. + setAntUsed(); } - void DPInfo::set (const Vector<Int>& ant1, - const Vector<Int>& ant2) + void DPInfo::setAntUsed() { - itsAnt1.reference (ant1); - itsAnt2.reference (ant2); + itsAntUsed.clear(); + itsAntMap.resize (itsAntNames.size()); + std::fill (itsAntMap.begin(), itsAntMap.end(), -1); + for (uint i=0; i<itsAnt1.size(); ++i) { + ASSERT (itsAnt1[i] >= 0 && itsAnt1[i] < int(itsAntMap.size()) && + itsAnt2[i] >= 0 && itsAnt2[i] < int(itsAntMap.size())); + itsAntMap[itsAnt1[i]] = 0; + itsAntMap[itsAnt2[i]] = 0; + } + itsAntUsed.reserve (itsAntNames.size()); + for (uint i=0; i<itsAntMap.size(); ++i) { + if (itsAntMap[i] == 0) { + itsAntMap[i] = itsAntUsed.size(); + itsAntUsed.push_back (i); + } + } } uint DPInfo::update (uint chanAvg, uint timeAvg) @@ -171,8 +186,8 @@ namespace LOFAR { Vector<Int> ant1 (baselines.size()); Vector<Int> ant2 (baselines.size()); for (uint i=0; i<baselines.size(); ++i) { - ant1 = itsAnt1[i]; - ant2 = itsAnt2[i]; + ant1[i] = itsAnt1[baselines[i]]; + ant2[i] = itsAnt2[baselines[i]]; } itsAnt1.reference (ant1); itsAnt2.reference (ant2); @@ -180,6 +195,7 @@ namespace LOFAR { itsBLength.resize (0); itsAutoCorrIndex.resize (0); } + setAntUsed(); } const vector<double>& DPInfo::getBaselineLengths() const diff --git a/CEP/DP3/DPPP/src/DPStep.cc b/CEP/DP3/DPPP/src/DPStep.cc index 19317fe0374f6e71db140e946749c8971afb65eb..aa9ab1192fb7f1d08235ddf23105f77319133c38 100644 --- a/CEP/DP3/DPPP/src/DPStep.cc +++ b/CEP/DP3/DPPP/src/DPStep.cc @@ -78,11 +78,14 @@ namespace LOFAR { bool ResultStep::process (const DPBuffer& buf) { itsBuffer = buf; + getNextStep()->process (buf); return true; } void ResultStep::finish() - {} + { + getNextStep()->finish(); + } void ResultStep::show (std::ostream&) const {} @@ -100,11 +103,14 @@ namespace LOFAR { bool MultiResultStep::process (const DPBuffer& buf) { itsBuffers.push_back (buf); + getNextStep()->process (buf); return true; } void MultiResultStep::finish() - {} + { + getNextStep()->finish(); + } void MultiResultStep::show (std::ostream&) const {} diff --git a/CEP/DP3/DPPP/src/Demixer.cc b/CEP/DP3/DPPP/src/Demixer.cc index cc04916e0ae1764713f2070a16da643515c749f4..34a33b0e0c22d9d79085a8fe58115ca898ac8487 100644 --- a/CEP/DP3/DPPP/src/Demixer.cc +++ b/CEP/DP3/DPPP/src/Demixer.cc @@ -75,7 +75,9 @@ namespace LOFAR { itsName (prefix), itsSkyName (parset.getString(prefix+"skymodel", "sky")), itsInstrumentName (parset.getString(prefix+"instrumentmodel", - "instrument")), + "instrument")), + itsSelBL (parset, prefix, false, "cross"), + itsFilter (input, itsSelBL), itsAvgResultSubtr (0), itsIgnoreTarget (parset.getBool (prefix+"ignoretarget", false)), itsTargetSource (parset.getString(prefix+"targetsource", string())), @@ -137,6 +139,9 @@ namespace LOFAR { "An empty name is given for the sky and/or instrument model"); ASSERTSTR (!itsIgnoreTarget || itsTargetSource.empty(), "Target source name cannot be given if ignoretarget=true"); + // Add a null step as last step in the filter. + DPStep::ShPtr nullStep(new NullStep()); + itsFilter.setNextStep (nullStep); // Default nr of time chunks is maximum number of threads. if (itsNTimeChunk == 0) { itsNTimeChunk = OpenMP::maxThreads(); @@ -178,18 +183,26 @@ namespace LOFAR { itsFactors.resize (itsNTimeChunk); itsFactorsSubtr.resize (itsNTimeChunkSubtr); itsPhaseShifts.reserve (itsNDir-1); // not needed for target direction - itsFirstSteps.reserve (itsNDir+1); // one extra for itsAvgSubtr + itsFirstSteps.reserve (itsNDir); itsAvgResults.reserve (itsNDir); - // Create the steps for the sources to be removed. - // Demixing consists of the following steps: - // - phaseshift data to each demix source - // - average data in each direction, also for original phasecenter. - // - determine demix factors for all directions - // - use BBS to predict and solve in each direction. It is possible to - // predict more directions than to solve (for strong sources in field). - // - use BBS to subtract the solved sources using the demix factors. - // The averaging used here can be smaller than used when solving. + // Create the solve and subtract steps for the sources to be removed. + // Solving consists of the following steps: + // - select the requested baselines (longer baselines may need no demix) + // - phaseshift selected data to each demix source + // - average selected data in each direction, also original phasecenter. + // - determine and average demix factors for all directions + // - predict and solve in each direction. It is possible to predict + // more directions than to solve (for strong sources in field). + // Subtract consists of the following steps: + // - average all data (possibly different averaging than used in solve) + // - determine and average demix factors (using select output in solve) + // - select the requested baselines + // - subtract sources for selected data + // - merge subtract result into averaged data. This is not needed if + // no selection is done. + // Note that multiple time chunks are handled jointly, so a + // MultiResultStep is used to catch the results of all time chunks. for (uint i=0; i<itsNDir-1; ++i) { // First make the phaseshift and average steps for each demix source. // The resultstep gets the result. @@ -224,12 +237,18 @@ namespace LOFAR { itsAvgResults.push_back (targetAvgRes); // Create the data average step for the subtract. - DPStep::ShPtr targetAvgSubtr(new Averager(input, prefix, - itsNChanAvgSubtr, - itsNTimeAvgSubtr)); + // The entire average result is needed for the next NDPPP step. + // Only the selected baselines need to be subtracted, so add a + // filter step as the last one. + itsAvgStepSubtr = DPStep::ShPtr(new Averager(input, prefix, + itsNChanAvgSubtr, + itsNTimeAvgSubtr)); + itsAvgResultFull = new MultiResultStep(itsNTimeChunkSubtr); + itsFilterSubtr = new Filter(input, itsSelBL); itsAvgResultSubtr = new MultiResultStep(itsNTimeChunkSubtr); - targetAvgSubtr->setNextStep (DPStep::ShPtr(itsAvgResultSubtr)); - itsFirstSteps.push_back (targetAvgSubtr); + itsAvgStepSubtr->setNextStep (DPStep::ShPtr(itsAvgResultFull)); + itsAvgResultFull->setNextStep (DPStep::ShPtr(itsFilterSubtr)); + itsFilterSubtr->setNextStep (DPStep::ShPtr(itsAvgResultSubtr)); // while(itsCutOffs.size() < itsNModel) { // itsCutOffs.push_back(0.0); @@ -242,11 +261,28 @@ namespace LOFAR { info() = infoIn; // Get size info. - itsNStation = infoIn.antennaNames().size(); - itsNChanIn = infoIn.nchan(); - itsNBl = infoIn.nbaselines(); - itsNCorr = infoIn.ncorr(); + itsNChanIn = infoIn.nchan(); + itsNCorr = infoIn.ncorr(); ASSERTSTR (itsNCorr==4, "Demixing requires data with 4 polarizations"); + + // Handle possible data selection. + itsFilter.setInfo (infoIn); + const DPInfo& infoSel = itsFilter.getInfo(); + // NB. The number of baselines and stations refer to the number of + // selected baselines and the number of unique stations that participate + // in the selected baselines. + itsNBl = infoSel.nbaselines(); + itsNStation = infoSel.antennaUsed().size(); + + // Re-number the station IDs in the selected baselines, removing gaps in + // the numbering due to unused stations. + const vector<int> &antennaMap = infoSel.antennaMap(); + for (uint i=0; i<itsNBl; ++i) { + itsBaselines.push_back(Baseline(antennaMap[infoSel.getAnt1()[i]], + antennaMap[infoSel.getAnt2()[i]])); + } + + // Allocate buffers used to compute the smearing factors. itsFactorBuf.resize (IPosition(4, itsNCorr, itsNChanIn, itsNBl, itsNDir*(itsNDir-1)/2)); itsFactorBufSubtr.resize (IPosition(4, itsNCorr, itsNChanIn, itsNBl, @@ -254,25 +290,22 @@ namespace LOFAR { // Adapt averaging to available nr of channels and times. // Use a copy of the DPInfo, otherwise it is updated multiple times. - DPInfo infoDemix(infoIn); - itsNTimeAvg = std::min (itsNTimeAvg, infoIn.ntime()); + DPInfo infoDemix(infoSel); + itsNTimeAvg = std::min (itsNTimeAvg, infoSel.ntime()); itsNChanAvg = infoDemix.update (itsNChanAvg, itsNTimeAvg); itsNChanOut = infoDemix.nchan(); itsTimeIntervalAvg = infoDemix.timeInterval(); itsNTimeDemix = infoDemix.ntime(); - for (size_t i=0; i<infoIn.getAnt1().size(); ++i) { - itsBaselines.push_back (Baseline(infoIn.getAnt1()[i], - infoIn.getAnt2()[i])); - } // Let the internal steps update their data. for (uint i=0; i<itsFirstSteps.size(); ++i) { - itsFirstSteps[i]->setInfo (infoIn); + itsFirstSteps[i]->setInfo (infoSel); } + itsAvgStepSubtr->setInfo (infoIn); // Update the info of this object. info().setNeedVisData(); info().setNeedWrite(); - itsNTimeAvgSubtr = std::min (itsNTimeAvgSubtr, infoIn.ntime()); + itsNTimeAvgSubtr = std::min (itsNTimeAvgSubtr, infoSel.ntime()); itsNChanAvgSubtr = info().update (itsNChanAvgSubtr, itsNTimeAvgSubtr); itsNChanOutSubtr = info().nchan(); ASSERTSTR (itsNChanAvg % itsNChanAvgSubtr == 0, @@ -296,9 +329,9 @@ namespace LOFAR { // Intialize the unknowns. itsUnknowns.resize(itsNTimeDemix * itsNModel * itsNStation * 8); - itsLastKnowns.resize(itsNModel * itsNStation * 8); - vector<double>::iterator it = itsLastKnowns.begin(); - vector<double>::iterator it_end = itsLastKnowns.end(); + itsPrevSolution.resize(itsNModel * itsNStation * 8); + vector<double>::iterator it = itsPrevSolution.begin(); + vector<double>::iterator it_end = itsPrevSolution.end(); while(it != it_end) { *it++ = 1.0; @@ -317,6 +350,14 @@ namespace LOFAR { os << "Demixer " << itsName << std::endl; os << " skymodel: " << itsSkyName << std::endl; os << " instrumentmodel: " << itsInstrumentName << std::endl; + itsSelBL.show (os); + if (itsSelBL.hasSelection()) { + os << " demixing " << itsFilter.getInfo().nbaselines() + << " out of " << getInfo().nbaselines() << " baselines (" + << itsFilter.getInfo().antennaUsed().size() + << " out of " << getInfo().antennaUsed().size() + << " stations)" << std::endl; + } os << " targetsource: " << itsTargetSource << std::endl; os << " subtractsources: " << itsSubtrSources << std::endl; os << " modelsources: " << itsModelSources << std::endl; @@ -388,16 +429,22 @@ namespace LOFAR { itsTimer)); } - // Do the initial steps (phaseshift and average). + // Do the filter step first. + itsFilter.process (newBuf); + const DPBuffer& selBuf = itsFilter.getBuffer(); + // Do the next steps (phaseshift and average) on the filter output. itsTimerPhaseShift.start(); for (int i=0; i<int(itsFirstSteps.size()); ++i) { - itsFirstSteps[i]->process(newBuf); + itsFirstSteps[i]->process(selBuf); } + // Do the average and filter step for the output for all data. + itsAvgStepSubtr->process (newBuf); itsTimerPhaseShift.stop(); - // For each itsNTimeAvg times, calculate the phase rotation per direction. + // For each itsNTimeAvg times, calculate the phase rotation per direction + // for the selected data. itsTimerDemix.start(); - addFactors (newBuf, itsFactorBuf); + addFactors (selBuf, itsFactorBuf); if (itsNTimeIn % itsNTimeAvg == 0) { makeFactors (itsFactorBuf, itsFactors[itsNTimeOut], itsAvgResults[0]->get()[itsNTimeOut].getWeights(), @@ -409,8 +456,8 @@ namespace LOFAR { itsNTimeOut++; } // Subtract is done with different averaging parameters, so calculate the - // factors for it. - addFactors (newBuf, itsFactorBufSubtr); + // factors for it (again for selected data only). + addFactors (selBuf, itsFactorBufSubtr); if (itsNTimeIn % itsNTimeAvgSubtr == 0) { makeFactors (itsFactorBufSubtr, itsFactorsSubtr[itsNTimeOutSubtr], itsAvgResultSubtr->get()[itsNTimeOutSubtr].getWeights(), @@ -424,34 +471,8 @@ namespace LOFAR { // Estimate gains and subtract source contributions when sufficient time // slots have been collected. if (itsNTimeOut == itsNTimeChunk) { - if(itsNModel > 0) { - itsTimerSolve.start(); - demix(); - itsTimerSolve.stop(); - } - - // Clear the input buffers. - for (size_t i=0; i<itsAvgResults.size(); ++i) { - itsAvgResults[i]->clear(); - } - - // Let the next step process the data. - for (uint i=0; i<itsNTimeOutSubtr; ++i) { - itsTimer.stop(); - getNextStep()->process (itsAvgResultSubtr->get()[i]); - itsTimer.start(); - } - - // Clear the output buffer. - itsAvgResultSubtr->clear(); - - // Reset counters. - itsNTimeIn = 0; - itsNTimeOut = 0; - itsNTimeOutSubtr = 0; - itsTimeIndex += itsNTimeChunk; + handleDemix(); } - itsTimer.stop(); return true; } @@ -467,6 +488,7 @@ namespace LOFAR { for (int i=0; i<int(itsFirstSteps.size()); ++i) { itsFirstSteps[i]->finish(); } + itsAvgStepSubtr->finish(); itsTimerPhaseShift.stop(); // Only average if there is some unaveraged data. itsTimerDemix.start(); @@ -492,26 +514,7 @@ namespace LOFAR { itsFactorsSubtr.resize(itsNTimeOutSubtr); // Demix the source directions. - if(itsNModel > 0) { - itsTimerSolve.start(); - demix(); - itsTimerSolve.stop(); - } - - // Clear the input buffers. - for (size_t i=0; i<itsAvgResults.size(); ++i) { - itsAvgResults[i]->clear(); - } - - // Let the next step process the data. - for (uint i=0; i<itsNTimeOutSubtr; ++i) { - itsTimer.stop(); - getNextStep()->process (itsAvgResultSubtr->get()[i]); - itsTimer.start(); - } - - // Clear the output buffer. - itsAvgResultSubtr->clear(); + handleDemix(); } // Write solutions to disk in ParmDB format. @@ -525,6 +528,62 @@ namespace LOFAR { getNextStep()->finish(); } + void Demixer::handleDemix() + { + if(itsNModel > 0) { + itsTimerSolve.start(); + demix(); + itsTimerSolve.stop(); + // If selection was done, merge the subtract results back into the + // buffer. + } + // If needed, merge in the deselected baselines. + if (itsSelBL.hasSelection()) { + mergeSubtractResult(); + } + + // Clear the input buffers. + for (size_t i=0; i<itsAvgResults.size(); ++i) { + itsAvgResults[i]->clear(); + } + // Let the next step process the data. + for (uint i=0; i<itsNTimeOutSubtr; ++i) { + itsTimer.stop(); + if (itsSelBL.hasSelection()) { + getNextStep()->process (itsAvgResultFull->get()[i]); + } else { + getNextStep()->process (itsAvgResultSubtr->get()[i]); + } + itsTimer.start(); + } + + // Clear the output buffer. + itsAvgResultFull->clear(); + itsAvgResultSubtr->clear(); + + // Reset counters. + itsNTimeIn = 0; + itsNTimeOut = 0; + itsNTimeOutSubtr = 0; + itsTimeIndex += itsNTimeChunk; + } + + void Demixer::mergeSubtractResult() + { + // Merge the selected baselines from the subtract buffer into the + // full buffer. Do it for all timestamps. + for (uint i=0; i<itsNTimeOutSubtr; ++i) { + const Array<Complex>& arr = itsAvgResultSubtr->get()[i].getData(); + size_t nr = arr.shape()[0] * arr.shape()[1]; + const Complex* in = arr.data(); + Complex* out = itsAvgResultFull->get()[i].getData().data(); + for (size_t j=0; j<itsFilter.getIndicesBL().size(); ++j) { + size_t inx = itsFilter.getIndicesBL()[j]; + memcpy (out+inx*nr, in+j*nr, nr*sizeof(Complex)); + } + } + } + void Demixer::addFactors (const DPBuffer& newBuf, Array<DComplex>& factorBuf) { @@ -781,9 +840,14 @@ namespace LOFAR { { initThreadPrivateStorage(*it, nDr, nSt, nBl, nCh, nChSubtr); - // Copy solutions from global solution array to thread private solution - // array (solution propagation between chunks). - copy(itsLastKnowns.begin(), itsLastKnowns.end(), it->unknowns.begin()); + // Copy the previous solution to the thread private vectors of unknowns. + // When solution propagation is disabled, itsPrevSolution is never + // updated. It then contains 1.0+0.0i for the diagonal terms and + // 0.0+0.0i for the off-diagonal terms. Thus, when solution propagation + // is disabled this statement effectively re-initializes the thread + // private vectors of unknowns. + copy(itsPrevSolution.begin(), itsPrevSolution.end(), + it->unknowns.begin()); } const_cursor<double> cr_freq = casa_const_cursor(itsFreqDemix); @@ -796,6 +860,14 @@ namespace LOFAR { const size_t thread = OpenMP::threadNum(); ThreadPrivateStorage &storage = threadStorage[thread]; + // If solution propagation is disabled, re-initialize the thread-private + // vector of unknowns. + if(!itsPropagateSolutions) + { + copy(itsPrevSolution.begin(), itsPrevSolution.end(), + storage.unknowns.begin()); + } + // Simulate. // // Model visibilities for each direction of interest will be computed @@ -946,7 +1018,7 @@ namespace LOFAR { { copy(&(itsUnknowns[(itsTimeIndex + nTime - 1) * nDr * nSt * 8]), &(itsUnknowns[(itsTimeIndex + nTime) * nDr * nSt * 8]), - itsLastKnowns.begin()); + itsPrevSolution.begin()); } // Update convergence count. @@ -978,42 +1050,40 @@ namespace LOFAR { resolution[1] = itsTimeIntervalAvg; parmDB.setDefaultSteps(resolution); - // Convert station names from casa::String to std::string. - ASSERT(getInfo().antennaNames().size() == itsNStation); - vector<string> stations(itsNStation); - copy(getInfo().antennaNames().begin(), getInfo().antennaNames().end(), - stations.begin()); + // Map station indices in the solution array to the corresponding antenna + // names. This is required because solutions are only produced for + // stations that participate in one or more baselines. Due to the baseline + // selection or missing baselines, solutions may be available for less + // than the total number of station available in the observation. + const DPInfo &info = itsFilter.getInfo(); + const vector<int> &antennaUsed = info.antennaUsed(); + const Vector<String> &antennaNames = info.antennaNames(); vector<BBS::Parm> parms; for(size_t dr = 0; dr < itsNModel; ++dr) { for(size_t st = 0; st < itsNStation; ++st) { + string name(antennaNames[antennaUsed[st]]); + string suffix(name + ":" + itsAllSources[dr]); + parms.push_back(BBS::Parm(parmCache, parmSet.addParm(parmDB, - "DirectionalGain:0:0:Real:" + stations[st] + ":" - + itsAllSources[dr]))); + "DirectionalGain:0:0:Real:" + suffix))); parms.push_back(BBS::Parm(parmCache, parmSet.addParm(parmDB, - "DirectionalGain:0:0:Imag:" + stations[st] + ":" - + itsAllSources[dr]))); + "DirectionalGain:0:0:Imag:" + suffix))); parms.push_back(BBS::Parm(parmCache, parmSet.addParm(parmDB, - "DirectionalGain:0:1:Real:" + stations[st] + ":" - + itsAllSources[dr]))); + "DirectionalGain:0:1:Real:" + suffix))); parms.push_back(BBS::Parm(parmCache, parmSet.addParm(parmDB, - "DirectionalGain:0:1:Imag:" + stations[st] + ":" - + itsAllSources[dr]))); + "DirectionalGain:0:1:Imag:" + suffix))); parms.push_back(BBS::Parm(parmCache, parmSet.addParm(parmDB, - "DirectionalGain:1:0:Real:" + stations[st] + ":" - + itsAllSources[dr]))); + "DirectionalGain:1:0:Real:" + suffix))); parms.push_back(BBS::Parm(parmCache, parmSet.addParm(parmDB, - "DirectionalGain:1:0:Imag:" + stations[st] + ":" - + itsAllSources[dr]))); + "DirectionalGain:1:0:Imag:" + suffix))); parms.push_back(BBS::Parm(parmCache, parmSet.addParm(parmDB, - "DirectionalGain:1:1:Real:" + stations[st] + ":" - + itsAllSources[dr]))); + "DirectionalGain:1:1:Real:" + suffix))); parms.push_back(BBS::Parm(parmCache, parmSet.addParm(parmDB, - "DirectionalGain:1:1:Imag:" + stations[st] + ":" - + itsAllSources[dr]))); + "DirectionalGain:1:1:Imag:" + suffix))); } } diff --git a/CEP/DP3/DPPP/src/EstimateNDPPP.cc b/CEP/DP3/DPPP/src/EstimateNDPPP.cc deleted file mode 100644 index a2cad2d85462ba8cbc1df02b2e797b3782248ac1..0000000000000000000000000000000000000000 --- a/CEP/DP3/DPPP/src/EstimateNDPPP.cc +++ /dev/null @@ -1,860 +0,0 @@ -//# EstimateNDPPP.cc: NDPPP specific variant of BBS estimation routines. -//# -//# Copyright (C) 2012 -//# ASTRON (Netherlands Institute for Radio Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands -//# -//# This file is part of the LOFAR software suite. -//# The LOFAR software suite is free software: you can redistribute it and/or -//# modify it under the terms of the GNU General Public License as published -//# by the Free Software Foundation, either version 3 of the License, or -//# (at your option) any later version. -//# -//# The LOFAR software suite is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License along -//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. -//# -//# $Id$ - -#include <lofar_config.h> -#include <DPPP/EstimateNDPPP.h> -#include <BBSKernel/EstimateUtil.h> - -namespace LOFAR -{ -namespace DPPP -{ -using namespace BBS; - -namespace -{ - // State kept for a single cell in the solution grid. - struct Cell - { - // LSQ solver and current estimates for the coefficients. - casa::LSQFit solver; - vector<double> coeff; - }; - - template <typename T_SAMPLE_MODIFIER> - struct SampleProcessorComplex; - - JonesMatrix mix(const vector<JonesMatrix> &in, - const vector<casa::Array<casa::DComplex> > &coeff, - unsigned int target, - unsigned int nsources, - unsigned int baseline); - - void mix(const vector<JonesMatrix> &in, vector<JonesMatrix> &out, - const vector<casa::Array<casa::DComplex> > &coeff, - const Location &start, const Location &end, unsigned int baseline); - - FlagArray mergeFlags(const vector<JonesMatrix> &in); - void mixAndMerge(const Matrix &factor, const Element &in, Element &out); - - Matrix makeMixingFactor(const vector<casa::Array<casa::DComplex> > &coeff, - const Location &start, const Location &end, unsigned int baseline, - unsigned int correlation, unsigned int row, unsigned int column); - - void subtract2(vector<DPPP::DPBuffer> &buffer, - const vector<MeasurementExpr::Ptr> &models, - const vector<casa::Array<casa::DComplex> > &coeff, - unsigned int target, - unsigned int nsources, - const vector<pair<size_t, size_t> > &baselineMap, - const vector<pair<size_t, size_t> > &correlationMap); - - template <typename T_SAMPLE_PROCESSOR> - void equate(const Location &start, const Location &end, - const vector<vector<DPPP::DPBuffer> > &buffers, - const vector<MeasurementExpr::Ptr> &models, - const vector<casa::Array<casa::DComplex> > &coeff, - const vector<pair<size_t, size_t> > &baselineMap, - const vector<pair<size_t, size_t> > &correlationMap, - const vector<Interval<size_t> > (&cellMap)[2], - const map<PValueKey, unsigned int> &coeffMap, - vector<Cell> &cells); - - template <typename T_SAMPLE_PROCESSOR> - void equate2(const Location &start, const Location &end, size_t blIndex, - const vector<DPPP::DPBuffer> &obs, const JonesMatrix &sim, - const vector<pair<size_t, size_t> > &correlationMap, - const vector<Interval<size_t> > (&cellMap)[2], - const map<PValueKey, unsigned int> &coeffMap, - vector<Cell> &cells); - - void initCells(const Location &start, const Location &end, - const ParmGroup &solvables, size_t nCoeff, - const EstimateOptions &options, - vector<Cell> &cells); - - // Perform a single iteration for all cells in the range [\p start, \p end) - // that have not yet converged or failed, updating the coefficient values - // to the new estimates found. - // \pre The range starting at \p cell should contain exactly one Cell - // instance for each cell in the range [\p start, \p end]. - bool iterate(const Location &start, const Location &end, - const ParmGroup &solvables, const EstimateOptions &options, - vector<Cell> &cells); -} // unnamed namespace - -void estimate(const vector<vector<DPPP::DPBuffer> > &buffers, - const vector<MeasurementExpr::Ptr> &models, - const vector<casa::Array<dcomplex> > &coeff, - const BaselineSeq &baselines, - const CorrelationSeq &correlations, - const BaselineMask &baselineMask, - const CorrelationMask &correlationMask, - const Grid &visGrid, - const Grid &solGrid, - const EstimateOptions &options) -{ - // ========================================================================= - // CHECK PRECONDITIONS - // ========================================================================= - const size_t nDirections = buffers.size(); - const size_t nModels = models.size(); - { - ASSERT(nDirections >= nModels && nModels > 0); - ASSERT(int(nDirections) == coeff[0].shape()[0]); - ASSERT(int(nModels) == coeff[0].shape()[1]); - - CorrelationSeq tmp; - tmp.append(Correlation::XX); - tmp.append(Correlation::XY); - tmp.append(Correlation::YX); - tmp.append(Correlation::YY); - - for(size_t i = 0; i < nModels; ++i) - { - ASSERT(models[i]->baselines() == models.front()->baselines()); - ASSERT(models[i]->correlations() == tmp); - ASSERT(models[i]->domain().contains(visGrid.getBoundingBox())); - } - } - // ========================================================================= - - // Construct a sequence of pairs of indices of matching baselines (i.e. - // baselines common to both buffer and model). - vector<pair<size_t, size_t> > blMap; - makeIndexMap(baselines, models.front()->baselines(), baselineMask, - back_inserter(blMap)); - - // Construct a sequence of pairs of indices of matching correlations - // (i.e. correlations known by both buffer and model). - vector<pair<size_t, size_t> > crMap; - makeIndexMap(correlations, models.front()->correlations(), correlationMask, - back_inserter(crMap)); - - // Compute a mapping from cells of the solution grid to cell intervals - // in the evaluation grid. - vector<Interval<size_t> > cellMap[2]; - Interval<size_t> domain[2]; - domain[FREQ] = makeAxisMap(solGrid[FREQ], visGrid[FREQ], - back_inserter(cellMap[FREQ])); - domain[TIME] = makeAxisMap(solGrid[TIME], visGrid[TIME], - back_inserter(cellMap[TIME])); - - ParmGroup solvables; - for(size_t i = 0; i < nModels; ++i) - { - ParmGroup tmp = models[i]->solvables(); - solvables.insert(tmp.begin(), tmp.end()); - } - - // Make coefficient map. - map<PValueKey, unsigned int> coeffMap; - makeCoeffMap(solvables, inserter(coeffMap, coeffMap.begin())); - LOG_DEBUG_STR("No. of coefficients to estimate: " << coeffMap.size()); - - // Assign solution grid to solvables. - ParmManager::instance().setGrid(solGrid, solvables); - - // --------------------------------------------------------------------- - // Process each chunk of cells in a loop. - // --------------------------------------------------------------------- - - // Clip chunk size to the size of the solution grid. - size_t chunkSize = options.chunkSize() == 0 ? solGrid[TIME]->size() - : std::min(options.chunkSize(), solGrid[TIME]->size()); - - // Allocate cells. - vector<Cell> cells(solGrid[FREQ]->size() * chunkSize); - - // Compute the number of cell chunks to process. - size_t nChunks = (solGrid[TIME]->size() + chunkSize - 1) / chunkSize; - - // Process the solution grid in chunks. - for(size_t chunk = 0; chunk < nChunks; ++chunk) - { - NSTimer timerChunk, timerEquate, timerIterate; - timerChunk.start(); - - // Compute cell chunk boundaries in solution grid coordinates. - Location chunkStart(0, chunk * chunkSize); - Location chunkEnd(solGrid[FREQ]->size() - 1, - std::min(chunkStart.second + chunkSize - 1, - solGrid[TIME]->size() - 1)); - - // Adjust cell chunk boundaries to exclude those cells for which no - // visibility data is available. - chunkStart = - Location(std::max(chunkStart.first, domain[FREQ].start), - std::max(chunkStart.second, domain[TIME].start)); - chunkEnd = - Location(std::min(chunkEnd.first, domain[FREQ].end), - std::min(chunkEnd.second, domain[TIME].end)); - - // If there are no cells for which visibility data is available, - // skip the chunk. - if(chunkStart.first > chunkEnd.first - || chunkStart.second > chunkEnd.second) - { - timerChunk.stop(); - continue; - } - - // Ensure a model value is computed for all the visibility samples - // within the chunk. - Location reqStart(cellMap[FREQ][chunkStart.first].start, - cellMap[TIME][chunkStart.second].start); - Location reqEnd(cellMap[FREQ][chunkEnd.first].end, - cellMap[TIME][chunkEnd.second].end); - for(size_t i = 0; i < nModels; ++i) - { - models[i]->setEvalGrid(visGrid.subset(reqStart, reqEnd)); - } - - // Initialize a cell instance for each cell in [chunkEnd, - // chunkStart]. - initCells(chunkStart, chunkEnd, solvables, coeffMap.size(), options, - cells); - - typedef SampleProcessorComplex<SampleModifierComplex> SampleProcessor; - - bool done = false; - unsigned int nIterations = 0; - while(!done) - { - // Construct normal equations from the data and an evaluation of - // the model based on the current coefficient values. - timerEquate.start(); - equate<SampleProcessor>(chunkStart, chunkEnd, buffers, models, - coeff, blMap, crMap, cellMap, coeffMap, cells); - timerEquate.stop(); - - // Perform a single iteration. - timerIterate.start(); - done = iterate(chunkStart, chunkEnd, solvables, options, cells); - timerIterate.stop(); - - // Notify model that solvables have changed. - for(size_t i = 0; i < nModels; ++i) - { - models[i]->solvablesChanged(); - } - - // Update iteration count. - ++nIterations; - } - timerChunk.stop(); - - // Output statistics and timers. - const size_t nCells = (chunkEnd.second - chunkStart.second + 1) - * (chunkEnd.first - chunkStart.first + 1); - LOG_DEBUG_STR("chunk: " << (chunk + 1) << "/" << nChunks - << " cells: " << nCells << " iterations: " << nIterations); - LOG_DEBUG_STR("\ttimers: all: " << toString(timerChunk) - << " equate: " << toString(timerEquate) << " iterate: " - << toString(timerIterate) << " total/count/average"); - - // Propagate solutions to the next chunk if required. - if(options.propagate() && (chunk + 1) < nChunks) - { - Location srcStart(0, chunk * chunkSize); - Location srcEnd(solGrid[FREQ]->size() - 1, - srcStart.second + chunkSize - 1); - - Location destStart(0, (chunk + 1) * chunkSize); - Location destEnd(solGrid[FREQ]->size() - 1, - std::min(destStart.second + chunkSize - 1, - solGrid[TIME]->size() - 1)); - - passCoeff(solvables, srcStart, srcEnd, destStart, destEnd); - } - } -} - -void subtract(vector<DPPP::DPBuffer> &buffer, - const vector<BBS::MeasurementExpr::Ptr> &models, - const vector<casa::Array<casa::DComplex> > &coeff, - const BBS::BaselineSeq &baselines, - const BBS::CorrelationSeq &correlations, - const BBS::BaselineMask &baselineMask, - const BBS::CorrelationMask &correlationMask, - const BBS::Grid &visGrid, - unsigned int target, - unsigned int nsources) -{ - // ========================================================================= - // CHECK PRECONDITIONS - // ========================================================================= - { - ASSERT(nsources <= models.size()); - ASSERT(buffer.size() > 0); - ASSERT(int(target) < coeff[0].shape()[1]); - - CorrelationSeq tmp; - tmp.append(Correlation::XX); - tmp.append(Correlation::XY); - tmp.append(Correlation::YX); - tmp.append(Correlation::YY); - - for(size_t i = 0; i < nsources; ++i) - { - ASSERT(models[i]->baselines() == models.front()->baselines()); - ASSERT(models[i]->correlations() == tmp); - ASSERT(models[i]->domain().contains(visGrid.getBoundingBox())); - } - } - // ========================================================================= - - // Construct a sequence of pairs of indices of matching baselines (i.e. - // baselines common to both buffer and model). - vector<pair<size_t, size_t> > blMap; - makeIndexMap(baselines, models.front()->baselines(), baselineMask, - back_inserter(blMap)); - - // Construct a sequence of pairs of indices of matching correlations - // (i.e. correlations known by both buffer and model). - vector<pair<size_t, size_t> > crMap; - makeIndexMap(correlations, models.front()->correlations(), correlationMask, - back_inserter(crMap)); - - for(size_t i = 0; i < nsources; ++i) - { - models[i]->setEvalGrid(visGrid); - } - - subtract2(buffer, models, coeff, target, nsources, blMap, crMap); -} - - -namespace -{ - -template <typename T_SAMPLE_PROCESSOR> -void equate(const Location &start, const Location &end, - const vector<vector<DPPP::DPBuffer> > &buffers, - const vector<MeasurementExpr::Ptr> &models, - const vector<casa::Array<casa::DComplex> > &coeff, - const vector<pair<size_t, size_t> > &baselineMap, - const vector<pair<size_t, size_t> > &correlationMap, - const vector<Interval<size_t> > (&cellMap)[2], - const map<PValueKey, unsigned int> &coeffMap, - vector<Cell> &cells) - -{ - ASSERT(buffers.size() >= models.size()); - - const size_t nDirections = buffers.size(); - const size_t nModels = models.size(); - - vector<JonesMatrix> sim(nModels); - vector<JonesMatrix> mixed(nDirections); - - typedef vector<pair<size_t, size_t> >::const_iterator bl_iterator; - for(bl_iterator it = baselineMap.begin(), it_end = baselineMap.end(); - it != it_end; ++it) - { - // Evaluate models. - for(size_t i = 0; i < nModels; ++i) - { - sim[i] = models[i]->evaluate(it->second); - } - - // Mix - Location visStart(cellMap[FREQ][start.first].start, - cellMap[TIME][start.second].start); - Location visEnd(cellMap[FREQ][end.first].end, - cellMap[TIME][end.second].end); - mix(sim, mixed, coeff, visStart, visEnd, it->first); - - // Flags will be equal for all mixed simulations. Skip baseline if all - // grid points are flagged. - if(sim.front().hasFlags()) - { - FlagArray flags(sim.front().flags()); - if(flags.rank() == 0 && (*flags.begin() != 0)) - { - continue; - } - } - - // Equate. - for(size_t i = 0; i < nDirections; ++i) - { - equate2<T_SAMPLE_PROCESSOR>(start, end, it->first, buffers[i], mixed[i], correlationMap, - cellMap, coeffMap, cells); - } - } // baselines -} - -template <typename T_SAMPLE_PROCESSOR> -void equate2(const Location &start, const Location &end, size_t blIndex, - const vector<DPPP::DPBuffer> &obs, const JonesMatrix &sim, - const vector<pair<size_t, size_t> > &correlationMap, - const vector<Interval<size_t> > (&cellMap)[2], - const map<PValueKey, unsigned int> &coeffMap, - vector<Cell> &cells) -{ -// // can we somehow properly clear() if nUnkowns does not change? -// // instead of using set() which reallocates? - - const unsigned int nFreq = cellMap[FREQ][end.first].end - - cellMap[FREQ][start.first].start + 1; - const unsigned int nTime = cellMap[TIME][end.second].end - - cellMap[TIME][start.second].start + 1; - - double *reSim = 0, *imSim = 0; - vector<unsigned int> coeffIndex(coeffMap.size()); - vector<double> reDerivative(coeffMap.size()); - vector<double> imDerivative(coeffMap.size()); - vector<double*> reSimDerivative(coeffMap.size(), 0); - vector<double*> imSimDerivative(coeffMap.size(), 0); - - typedef vector<pair<size_t, size_t> >::const_iterator cr_iterator; - for(cr_iterator cr_it = correlationMap.begin(), cr_end = correlationMap.end(); - cr_it != cr_end; ++cr_it) - { - const Element element = sim.element(cr_it->second); - if(element.size() <= 1) - { - continue; - } - - const size_t nCoeff = element.size() - 1; - - // ----------------------------------------------------------------- - // Setup pointers and strides to access the model value and - // derivatives. - // ----------------------------------------------------------------- - Matrix sim(element.value()); - ASSERT(sim.isComplex() && sim.isArray() - && static_cast<unsigned int>(sim.nx()) == nFreq - && static_cast<unsigned int>(sim.ny()) == nTime); - sim.dcomplexStorage(reSim, imSim); - - size_t i = 0; - for(Element::const_iterator el_it = element.begin(), - el_end = element.end(); el_it != el_end; ++el_it, ++i) - { - // Look-up coefficient index for this coefficient. - map<PValueKey, unsigned int>::const_iterator coeff_it = - coeffMap.find(el_it->first); - ASSERT(coeff_it != coeffMap.end()); - coeffIndex[i] = coeff_it->second; - - // Get pointers to the real and imaginary part of the partial - // derivarive of the model with respect to this coefficient. - Matrix derivative(el_it->second); - ASSERT(derivative.isComplex() && derivative.isArray() - && static_cast<unsigned int>(derivative.nx()) == nFreq - && static_cast<unsigned int>(derivative.ny()) == nTime); - derivative.dcomplexStorage(reSimDerivative[i], imSimDerivative[i]); - } - - size_t offset[2]; - offset[FREQ] = cellMap[FREQ][start.first].start; - offset[TIME] = cellMap[TIME][start.second].start; - - vector<Cell>::iterator cell = cells.begin(); - for(CellIterator it(start, end); !it.atEnd(); ++it, ++cell) - { - if(cell->solver.isReady()) - { - // Skip cell if it is inactive (converged or failed). - continue; - } - - const Interval<size_t> &freqInterval = cellMap[FREQ][it->first]; - const Interval<size_t> &timeInterval = cellMap[TIME][it->second]; - - size_t index = (timeInterval.start - offset[TIME]) * nFreq - + (freqInterval.start - offset[FREQ]); - - for(size_t t = timeInterval.start; t <= timeInterval.end; ++t) - { - const DPPP::DPBuffer &buffer = obs[t]; - - for(size_t f = freqInterval.start; f <= freqInterval.end; ++f) - { - const bool &flagged = buffer.getFlags()(cr_it->first, f, blIndex); - if(!flagged) - { - for(size_t i = 0; i < nCoeff; ++i) - { - reDerivative[i] = reSimDerivative[i][index]; - imDerivative[i] = imSimDerivative[i][index]; - } - - const fcomplex &vis = buffer.getData()(cr_it->first, f, blIndex); - const float &weight = buffer.getWeights()(cr_it->first, f, blIndex); - - T_SAMPLE_PROCESSOR::process(*cell, weight, real(vis), - imag(vis), reSim[index], imSim[index], nCoeff, - &(reDerivative[0]), &(imDerivative[0]), - &(coeffIndex[0])); - } - - ++index; - } - - index -= (freqInterval.end - freqInterval.start + 1); - index += nFreq; - } - } - } -} - -void subtract2(vector<DPPP::DPBuffer> &buffer, - const vector<MeasurementExpr::Ptr> &models, - const vector<casa::Array<casa::DComplex> > &coeff, - unsigned int target, - unsigned int nsources, - const vector<pair<size_t, size_t> > &baselineMap, - const vector<pair<size_t, size_t> > &correlationMap) -{ - vector<JonesMatrix> sim(nsources); - - typedef vector<pair<size_t, size_t> >::const_iterator - index_map_iterator; - - for(index_map_iterator bl_it = baselineMap.begin(), - bl_end = baselineMap.end(); bl_it != bl_end; ++bl_it) - { - // Evaluate models. - for(unsigned int i = 0; i < nsources; ++i) - { - sim[i] = models[i]->evaluate(bl_it->second); - } - - // Mix - JonesMatrix mixed = mix(sim, coeff, target, nsources, bl_it->first); - - // Subtract. - for(index_map_iterator cr_it = correlationMap.begin(), - cr_end = correlationMap.end(); cr_it != cr_end; ++cr_it) - { - Matrix crMixed = mixed.element(cr_it->second).value(); - ASSERT(!crMixed.isNull()); - - const unsigned int nFreq = crMixed.nx(); - const unsigned int nTime = crMixed.ny(); - ASSERT(crMixed.isComplex() && crMixed.isArray()); - ASSERTSTR(nTime == buffer.size(), "nTime: " << nTime << " buffer size: " << buffer.size()); - - const double *mixed_re = 0, *mixed_im = 0; - crMixed.dcomplexStorage(mixed_re, mixed_im); - - for(vector<DPBuffer>::iterator buffer_it = buffer.begin(), - buffer_end = buffer.end(); buffer_it != buffer_end; - ++buffer_it) - { - casa::Cube<casa::Complex> &data = buffer_it->getData(); - ASSERT(data.shape()(1) == int(nFreq)); - - for(size_t i = 0; i < nFreq; ++i) - { - data(cr_it->first, i, bl_it->first) -= - makedcomplex(*mixed_re++, *mixed_im++); - } // frequency - } // time - } // correlations - } // baselines -} - -JonesMatrix mix(const vector<JonesMatrix> &in, - const vector<casa::Array<casa::DComplex> > &coeff, - unsigned int target, - unsigned int nsources, - unsigned int baseline) -{ - const unsigned int nFreq = coeff.front().shape()(3); - const unsigned int nTime = coeff.size(); - - ASSERT(nFreq >= 1 && nTime >= 1); - const Location start(0, 0); - const Location end(nFreq - 1, nTime - 1); - - Matrix out[4]; - for(unsigned int i = 0; i < nsources; ++i) - { - for(unsigned int correlation = 0; correlation < 4; ++correlation) - { - // Exchanged target and i, because we want the effect of - // direction i on the target direction. - Matrix weight = makeMixingFactor(coeff, start, end, baseline, - correlation, target, i); - - const Matrix sim = in[i].element(correlation).value(); - - ASSERTSTR(sim.nx() == weight.nx(), "sim: " << sim.nx() << " weight: " << weight.nx()); - ASSERTSTR(sim.ny() == weight.ny(), "sim: " << sim.ny() << " weight: " << weight.ny()); - if(out[correlation].isNull()) - { - out[correlation] = weight * sim; - } - else - { - out[correlation] += weight * sim; - } - } // correlations - } // nsources - - JonesMatrix result(out[0], out[1], out[2], out[3]); - result.setFlags(mergeFlags(in)); - return result; -} - -void mix(const vector<JonesMatrix> &in, vector<JonesMatrix> &out, - const vector<casa::Array<casa::DComplex> > &coeff, - const Location &start, const Location &end, unsigned int baseline) -{ - // dims array: ndir x nmodel x ncorr x nchan x nbl (minor -> major). - // better dims: nbl x ncorr x ndir x nmodel x nchan ??? - - const unsigned int nModels = in.size(); - const unsigned int nDirections = coeff[0].shape()[0]; - ASSERT(nDirections == out.size()); - ASSERT(int(nModels) == coeff[0].shape()[1]); - - FlagArray flags = mergeFlags(in); - - for(unsigned int i = 0; i < nDirections; ++i) - { - Element element[4]; - for(unsigned int j = 0; j < nModels; ++j) - { - for(unsigned int k = 0; k < 4; ++k) - { - Matrix factor = makeMixingFactor(coeff, start, end, - baseline, k, i, j); - - mixAndMerge(factor, in[j].element(k), element[k]); - } - } - - out[i] = JonesMatrix(element[0], element[1], element[2], - element[3]); - out[i].setFlags(flags); - } -} - -FlagArray mergeFlags(const vector<JonesMatrix> &in) -{ - vector<JonesMatrix>::const_iterator first = in.begin(); - vector<JonesMatrix>::const_iterator last = in.end(); - - for(; first != last && !first->hasFlags(); ++first) - { - } - - if(first == last) - { - return FlagArray(); - } - - FlagArray flags = first->flags().clone(); - ++first; - - for(; first != last; ++first) - { - if(first->hasFlags()) - { - flags |= first->flags(); - } - } - - return flags; -} - -void mixAndMerge(const Matrix &factor, const Element &in, Element &out) -{ - // Update value. - Matrix value = out.value(); - if(value.isNull()) - { - out.assign(factor * in.value()); - } - else - { - value += factor * in.value(); - } - - // Update partial derivatives. - Element::const_iterator inIter = in.begin(); - Element::const_iterator inEnd = in.end(); - - Element::iterator outIter = out.begin(); - Element::iterator outEnd = out.end(); - - while(inIter != inEnd && outIter != outEnd) - { - if(outIter->first == inIter->first) - { - outIter->second += factor * inIter->second; - ++inIter; - ++outIter; - } - else if(outIter->first < inIter->first) - { - ++outIter; - } - else - { - out.assign(inIter->first, factor * inIter->second); - ++inIter; - } - } - - while(inIter != inEnd) - { - out.assign(inIter->first, factor * inIter->second); - ++inIter; - } -} - -Matrix makeMixingFactor(const vector<casa::Array<casa::DComplex> > &coeff, - const Location &start, const Location &end, unsigned int baseline, - unsigned int correlation, unsigned int row, unsigned int column) -{ - const unsigned int nFreq = end.first - start.first + 1; - const unsigned int nTime = end.second - start.second + 1; - - Matrix factor(makedcomplex(0.0, 0.0), nFreq, nTime, false); - double *re = 0, *im = 0; - factor.dcomplexStorage(re, im); - - // dims coeff: ndir x nmodel x ncorr x nchan x nbl (minor -> major). - // nmodel = nr of directions with source model (thus excl. target) - casa::IPosition index(5, row, column, correlation, 0, baseline); - for(unsigned int t = start.second; t <= end.second; ++t) - { - const casa::Array<casa::DComplex> &tmp = coeff[t]; - ASSERTSTR(tmp.shape()(3) == int(nFreq), "nFreq: " - << nFreq << ' ' << tmp.shape()); - for(index(3) = start.first; index(3) <= static_cast<int>(end.first); - ++index(3)) - { - const casa::DComplex &weight = tmp(index); - *re++ = real(weight); - *im++ = imag(weight); - } - } - - return factor; -} - -template <typename T_SAMPLE_MODIFIER> -struct SampleProcessorComplex -{ - static inline void process(Cell &cell, double weight, double reObs, - double imObs, double reSim, double imSim, unsigned int nDerivative, - double *reDerivative, double *imDerivative, - const unsigned int *index) - { - // Modify the observed and simulated data depending on the solving - // mode (complex, phase only, amplitude only). - T_SAMPLE_MODIFIER::process(weight, reObs, imObs, reSim, imSim, - reDerivative, imDerivative, nDerivative); - - if(weight == 0.0) - { - return; - } - - // Compute the residual. - double reResidual = reObs - reSim; - double imResidual = imObs - imSim; - - // Update the normal equations. - cell.solver.makeNorm(nDerivative, index, reDerivative, weight, - reResidual); - cell.solver.makeNorm(nDerivative, index, imDerivative, weight, - imResidual); - } -}; - -void initCells(const Location &start, const Location &end, - const ParmGroup &solvables, size_t nCoeff, - const EstimateOptions &options, - vector<Cell> &cells) -{ - vector<Cell>::iterator cell = cells.begin(); - for(CellIterator it(start, end); !it.atEnd(); ++it, ++cell) - { - // Initalize LSQ solver. - cell->solver = casa::LSQFit(static_cast<casa::uInt>(nCoeff)); - configLSQSolver(cell->solver, options.lsqOptions()); - - // Initialize coefficients. - cell->coeff.resize(nCoeff); - loadCoeff(*it, solvables, cell->coeff.begin()); - } -} - -bool iterate(const Location &start, const Location &end, - const ParmGroup &solvables, const EstimateOptions &options, - vector<Cell> &cells) -{ - const size_t nCellFreq = end.first - start.first + 1; - const size_t nCellTime = end.second - start.second + 1; - const size_t nCell = nCellFreq * nCellTime; - - bool done = true; -#pragma omp parallel for - for(size_t i = 0; i < nCell; ++i) - { - Cell &cell = cells[i]; - - // If processing on the cell is already done, only update the status - // counts and continue to the next cell. - if(cell.solver.isReady()) - { - continue; - } - - // Perform a single iteration if the cell has not yet converged or - // failed. - // - // LSQFit::solveLoop() only returns false if the normal - // equations are singular. This can also be seen from the result - // of LSQFit::isReady(), so we don't update the iteration status - // here but do skip the update of the solvables. - casa::uInt rank; - if(cell.solver.solveLoop(rank, &(cell.coeff[0]), - options.lsqOptions().useSVD)) - { - // Store the updated coefficient values. - storeCoeff(Location(start.first + i % nCellFreq, start.second + i - / nCellFreq), solvables, cell.coeff.begin()); - } - - if(!cell.solver.isReady()) - { - done = false; - } - } - - return done; -} - -} // unnamed namespace - -} //# namespace BBS -} //# namespace LOFAR diff --git a/CEP/DP3/DPPP/src/Filter.cc b/CEP/DP3/DPPP/src/Filter.cc index 1021a26fd94e4efc086c936da8e56653cd1ee9f5..9b4bb455897a5cd11f483f02ef27d8ac38481ae4 100644 --- a/CEP/DP3/DPPP/src/Filter.cc +++ b/CEP/DP3/DPPP/src/Filter.cc @@ -43,7 +43,16 @@ namespace LOFAR { itsName (prefix), itsStartChanStr (parset.getString(prefix+"startchan", "0")), itsNrChanStr (parset.getString(prefix+"nchan", "0")), - itsBaselines (parset, prefix) + itsBaselines (parset, prefix), + itsDoSelect (false) + {} + + Filter::Filter (DPInput* input, const BaselineSelection& baselines) + : itsInput (input), + itsStartChanStr ("0"), + itsNrChanStr ("0"), + itsBaselines (baselines), + itsDoSelect (false) {} Filter::~Filter() @@ -76,6 +85,7 @@ namespace LOFAR { } else { nrChan = std::min (nrChan, maxNrChan); } + itsDoSelect = itsStartChan>0 || nrChan<maxNrChan; // Handle possible baseline selection. if (itsBaselines.hasSelection()) { Matrix<bool> selbl(itsBaselines.apply (infoIn)); @@ -87,14 +97,19 @@ namespace LOFAR { itsSelBL.push_back (i); } } + if (itsSelBL.size() < ant1.size()) { + itsDoSelect = true; + } + } + if (itsDoSelect) { + // Update the DPInfo object. + info().update (itsStartChan, nrChan, itsSelBL); + // Shape the arrays in the buffer. + IPosition shape (3, infoIn.ncorr(), nrChan, getInfo().nbaselines()); + itsBuf.getData().resize (shape); + itsBuf.getFlags().resize (shape); + itsBuf.getWeights().resize (shape); } - // Update the DPInfo object. - info().update (itsStartChan, nrChan, itsSelBL); - // Shape the arrays in the buffer. - IPosition shape (3, infoIn.ncorr(), nrChan, getInfo().nbaselines()); - itsBuf.getData().resize (shape); - itsBuf.getFlags().resize (shape); - itsBuf.getWeights().resize (shape); } void Filter::show (std::ostream& os) const @@ -117,6 +132,17 @@ namespace LOFAR { bool Filter::process (const DPBuffer& buf) { itsTimer.start(); + if (!itsDoSelect) { + itsBuf = buf; // uses reference semantics + itsTimer.stop(); + getNextStep()->process (itsBuf); + return true; + } + // Make sure no other object references the DATA and UVW arrays. + itsBuf.getData().unique(); + itsBuf.getFlags().unique(); + itsBuf.getWeights().unique(); + itsBuf.getFullResFlags().unique(); // Get the various data arrays. RefRows rowNrs(buf.getRowNrs()); const Array<Complex>& data = buf.getData(); @@ -154,6 +180,7 @@ namespace LOFAR { } else { // Copy the data of the selected baselines and channels. itsBuf.getUVW().resize (IPosition(2, 3, getInfo().nbaselines())); + itsBuf.getUVW().unique(); Complex* toData = itsBuf.getData().data(); Bool* toFlag = itsBuf.getFlags().data(); Float* toWeight = itsBuf.getWeights().data(); diff --git a/CEP/DP3/DPPP/test/testdemixfilter b/CEP/DP3/DPPP/test/testdemixfilter new file mode 100755 index 0000000000000000000000000000000000000000..19532daaec31a76902f9be848dfbe2d0b0d96bd4 --- /dev/null +++ b/CEP/DP3/DPPP/test/testdemixfilter @@ -0,0 +1,87 @@ +#!/bin/sh + +# This script tests if selection in a demix gives the same result as demixing +# a selection. + +# Make a selection of the MS (core stations only) +msselect in=L29067_SAP000_SB069_uv.MS out=demix.sel.ms baseline='CS*&' + +# Do simple averaging of the rest of the MS. +cat > demix.avg.ps <<EOF +msin = L29067_SAP000_SB069_uv.MS +msin.startchan = 2 +msin.nchan=60 +msin.baseline=!CS*& +msout=demix.avg.ms +msout.overwrite=true +steps=[avg] +avg.type=averager +avg.freqstep=30 +avg.timestep=5 +EOF +NDPPP demix.avg.ps + +# Do the demixing of the MS selection. +# Create an empty instrument model. +parmdbm <<EOF +create table='demix.inst.pdb1' +adddef gain values=1 +EOF + +cat > demix.sel.demix.ps <<EOF +msin = demix.sel.ms +msin.startchan = 2 +msin.nchan=60 +msout=demix.sel.demix.ms +msout.overwrite=true +steps=[demix] +demix.type=demixer +demix.subtractsources=[CasA,CygA] +#demix.targetsource=3C196 +demix.skymodel=sky.pdb +demix.instrumentmodel=demix.inst.pdb1 +demix.demixfreqstep=60 +demix.demixtimestep=10 +demix.freqstep=30 +demix.timestep=5 +demix.ntimechunk=4 +EOF +NDPPP demix.sel.demix.ps + +# Do the demixing of the entire MS using a selection. +# Create an empty instrument model. +parmdbm <<EOF +create table='demix.inst.pdb2' +adddef gain values=1 +EOF + +cat > demix.demixsel.ps <<EOF +msin = L29067_SAP000_SB069_uv.MS +msin.startchan = 2 +msin.nchan=60 +msout=demix.demixsel.ms +msout.overwrite=true +steps=[demix] +demix.type=demixer +demix.subtractsources=[CasA,CygA] +demix.skymodel=sky.pdb +demix.instrumentmodel=demix.inst.pdb2 +demix.baseline=CS*& +demix.demixfreqstep=60 +demix.demixtimestep=10 +demix.freqstep=30 +demix.timestep=5 +demix.ntimechunk=2 +EOF +NDPPP demix.demixsel.ps + +# Select the baselines from the last demix result and check if equal to first demix. +msselect in=demix.demixsel.ms out=demix.demixsel.sel.ms baseline='CS*&' +taql 'select t1.DATA,t2.DATA as td from demix.sel.demix.ms t1, demix.demixsel.sel.ms t2 where !all((isnan(t1.DATA) && isnan(t2.DATA)) or t1.DATA=t2.DATA) limit 10' +taql 'select t1.DATA,t2.DATA as td from demix.sel.demix.ms t1, demix.demixsel.sel.ms t2 where t1.ANTENNA1 != t2.ANTENNA1 or t1.ANTENNA2 != t2.ANTENNA2' + +# Select the non-demixed baselines from the last demix result and check if equal +# to the averaged selection. +msselect in=demix.demixsel.ms out=demix.demixsel.rest.ms baseline='!CS*&' +taql 'select t1.DATA,t2.DATA as td from demix.avg.ms t1, demix.demixsel.rest.ms t2 where !all((isnan(t1.DATA) && isnan(t2.DATA)) or t1.DATA=t2.DATA) limit 10' +taql 'select t1.DATA,t2.DATA as td from demix.avg.ms t1, demix.demixsel.rest.ms t2 where t1.ANTENNA1 != t2.ANTENNA1 or t1.ANTENNA2 != t2.ANTENNA2' diff --git a/CEP/GSM/bremen/cleanup.py b/CEP/GSM/bremen/cleanup.py index 693ea4d9b21c6f5fa9ea16e6e1edad84a55e8aa7..16473e3ef21c1b8b6be402f39bd0485922272ad0 100755 --- a/CEP/GSM/bremen/cleanup.py +++ b/CEP/GSM/bremen/cleanup.py @@ -23,3 +23,7 @@ args = parser.parse_args() cm = GSMConnectionManager(use_monet=args.monetdb, database=args.database) cleanup_db(cm.get_connection()) +if args.monetdb: + print "MonetDB database %s cleaned" % args.database +else: + print "PostgreSQL database %s cleaned" % args.database diff --git a/CEP/GSM/bremen/recreate_tables.py b/CEP/GSM/bremen/recreate_tables.py index 8297d523ef0a9875aef0c0cbfb93d0db044656e0..7534f00cc2b6947e15ec3c4bfc6fd77d56ae6e4d 100755 --- a/CEP/GSM/bremen/recreate_tables.py +++ b/CEP/GSM/bremen/recreate_tables.py @@ -1,33 +1,52 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +""" +Tool to recreate all tables/procedures in the database. +""" import argparse import copy import re -import sys from os import path -import monetdb.sql as db -import monetdb.monetdb_exceptions as me -import psycopg2 -from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT +try: + import monetdb.sql as db + import monetdb.monetdb_exceptions as me + HAS_MONET = True +except ImportError: + HAS_MONET =False + +try: + import psycopg2 + from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT + HAS_POSTGRESQL = True +except ImportError: + HAS_POSTGRESQL = False import subprocess -""" -Tool to recreate all tables/procedures in the database. -""" +def re_sub(regexp, sub_to, sub_from, flags=0): + prog = re.compile(regexp, flags) + return prog.sub(sub_to, sub_from) class Recreator(object): + """ + Tool to recreate all tables/procedures in the database. + """ + + # all procedures to be recreated + PROCEDURES = ['fill_temp_assoc_kind'] + + # list of views to be recreated + VIEWS = ['v_catalog_info'] - PROCEDURES = ['fill_temp_assoc_kind'] # all procedures to be recreated - VIEWS = ['v_catalog_info'] # list of views - TABLES = [ 'frequencybands', 'datasets', 'images', 'extractedsources', - 'assocxtrsources', 'detections', + # list of tables to be recreated + TABLES = ['frequencybands', 'datasets', 'runs', 'images', + 'extractedsources', 'assocxtrsources', 'detections', 'runningcatalog', 'runningcatalog_fluxes', - 'temp_associations'] # list of tables to be recreated + 'temp_associations', 'image_stats'] def __init__(self, database="test", use_monet=True): self.monet = use_monet if use_monet: - db_port = 50000 + db_port = 52000 db_autocommit = True db_host = "localhost" db_dbase = database @@ -37,7 +56,8 @@ class Recreator(object): if use_monet: self.conn = db.connect(hostname=db_host, database=db_dbase, username=db_user, password=db_passwd, - port=db_port, autocommit=db_autocommit) + port=db_port, + autocommit=db_autocommit) else: connect = psycopg2.connect(host=db_host, user=db_user, database=db_dbase) @@ -50,11 +70,13 @@ class Recreator(object): """ if self.monet: cur = self.conn.cursor() - cur.execute("select count(*) from sys.tables where name = '%s';" + cur.execute( + "select count(*) from sys.tables where name = '%s';" % tab_name) else: cur = self.conn - cur.execute("select count(*) from pg_tables where tablename ='%s';" + cur.execute( + "select count(*) from pg_tables where tablename ='%s';" % tab_name) data = cur.fetchone() return data[0] == 1 @@ -68,12 +90,14 @@ class Recreator(object): self.conn.execute("drop table %s;" % tab_name) else: self.conn.execute("drop table %s cascade;" % tab_name) + self.conn.execute( + "drop sequence if exists seq_%s cascade;" % tab_name) print 'Table %s dropped' % tab_name # For MonetDB-PostgreSQL convertion. PG_SUBSTITUTOR = [ (r'next value for "(.*?)"', r"nextval('\1'::regclass)"), - (r'^create sequence .*?$', ''), + #(r'^create sequence (.*?)$', ''), (r'as integer', ''), (r' double ', ' double precision '), (r'current_timestamp\(\)', 'current_timestamp'), @@ -84,12 +108,12 @@ class Recreator(object): Prepare SQL code for MonetDB/PostgreSQL. Remove all comments, make necessary substitutions. """ - sql_lines = re.sub(r'/\*.*?\*/', '', sql_lines, flags=re.DOTALL) - sql_lines = re.sub(r'--.*$', '', sql_lines, flags=re.MULTILINE) + sql_lines = re_sub(r'/\*.*?\*/', '', sql_lines, flags=re.DOTALL) + sql_lines = re_sub(r'--.*$', '', sql_lines, flags=re.MULTILINE) if not self.monet: # Has to apply substitutions for PostgreSQL. for from_, to_ in self.PG_SUBSTITUTOR: - sql_lines = re.sub(from_, to_, sql_lines, + sql_lines = re_sub(from_, to_, sql_lines, flags=re.MULTILINE | re.IGNORECASE) return sql_lines @@ -101,11 +125,19 @@ class Recreator(object): print "Table %s recreated" % tab_name def create_view(self, view_name): + """ + Create a view with a given name. + """ self.run_sql_file("sql/create.view.%s.sql" % view_name) print "View %s recreated" % view_name - def create_procedure(self, tab_name): + """ + Create a procedure with a given name. + Procedure SQL is located in the project files: + sql/pg/create.procedure.NAME.sql (PostrgeSQL) or + sql/create.procedure.NAME.sql (MonetDB). + """ if self.monet: sql_file = open("sql/create.procedure.%s.sql" % tab_name, 'r') else: @@ -117,6 +149,9 @@ class Recreator(object): print "Procedure %s recreated" % tab_name def run_sql_file(self, filename): + """ + Execute SQL from file (with proper substitutions for psql. + """ sql_file = open(filename, 'r') sql_lines = ''.join(sql_file.readlines()) sql_lines = self.refactor_lines(sql_lines) @@ -124,31 +159,41 @@ class Recreator(object): def reload_frequencies(self): if self.monet: - self.conn.execute("copy into frequencybands from '%s';" % path.realpath('sql/tables/freq.dat')) + self.conn.execute("copy into frequencybands from '%s';" % + path.realpath('sql/tables/freq.dat')) else: - sp = subprocess.Popen(['psql', '-U', 'monetdb', - '-d', self.database, - '-c', "copy frequencybands from stdin delimiter '|' null 'null';"], - stdout=subprocess.PIPE, - stdin=subprocess.PIPE) + sp = subprocess.Popen(['psql', '-U', 'monetdb', + '-d', self.database, '-c', + "copy frequencybands " \ + "from stdin delimiter '|'" \ + " null 'null';"], + stdout=subprocess.PIPE, + stdin=subprocess.PIPE) for line in open('sql/tables/freq.dat', 'r').readlines(): sp.stdin.write(line) sp.communicate() print 'Frequencies loaded' def run(self): + error_set = [] + if HAS_MONET: + error_set.append(me.OperationalError) + if HAS_POSTGRESQL: + error_set.append(psycopg2.ProgrammingError) + error_set = tuple(error_set) try: for procedure in self.PROCEDURES: if self.monet: try: - self.conn.execute("drop procedure %s;" % procedure) + self.conn.execute("drop procedure %s;" % + procedure) print "drop procedure %s;" % procedure - except (psycopg2.ProgrammingError, me.OperationalError): + except error_set: pass for view in self.VIEWS: try: self.conn.execute("drop view %s;" % view) - except (psycopg2.ProgrammingError, me.OperationalError): + except error_set: pass print "drop view %s;" % view diff --git a/CEP/GSM/bremen/sql/create.procedure.fill_temp_assoc_kind.sql b/CEP/GSM/bremen/sql/create.procedure.fill_temp_assoc_kind.sql index 6310b2278b5ab4cc1193c201974cb82d36f41907..91e99be3970a2280d17d89d4d1c8222cf4525657 100644 --- a/CEP/GSM/bremen/sql/create.procedure.fill_temp_assoc_kind.sql +++ b/CEP/GSM/bremen/sql/create.procedure.fill_temp_assoc_kind.sql @@ -1,54 +1,67 @@ --drop procedure fill_temp_assoc_kind; -create procedure fill_temp_assoc_kind() +create procedure fill_temp_assoc_kind(i_image_id int) begin update temp_associations set xtr_count = (select count(xtrsrc_id2) from temp_associations as ta - where ta.xtrsrc_id2 = temp_associations.xtrsrc_id2); + where ta.xtrsrc_id2 = temp_associations.xtrsrc_id2 + and ta.image_id = i_image_id) + where image_id = i_image_id; update temp_associations set run_count = (select count(runcat_id) from temp_associations as ta - where ta.runcat_id = temp_associations.runcat_id); + where ta.runcat_id = temp_associations.runcat_id + and ta.image_id = i_image_id) + where image_id = i_image_id; update temp_associations set kind = 1 where xtr_count = 1 - and run_count = 1; + and run_count = 1 + and image_id = i_image_id; update temp_associations set kind = 2 where xtr_count > 1 - and run_count = 1; + and run_count = 1 + and image_id = i_image_id; update temp_associations set kind = 3 where xtr_count = 1 - and run_count > 1; + and run_count > 1 + and image_id = i_image_id; update temp_associations set kind = 4 where xtr_count > 1 - and run_count > 1; + and run_count > 1 + and image_id = i_image_id; --complete groups update temp_associations set kind = 4 where kind <> 4 + and image_id = i_image_id and exists (select kind from temp_associations ta where ta.runcat_id = temp_associations.runcat_id - and kind = 4); + and ta.kind = 4 + and ta.image_id = i_image_id); update temp_associations set kind = 4 where kind <> 4 + and image_id = i_image_id and exists (select kind from temp_associations ta where ta.xtrsrc_id2 = temp_associations.xtrsrc_id2 - and kind = 4); + and ta.kind = 4 + and ta.image_id = i_image_id); update temp_associations set group_head_id = runcat_id where kind = 4 + and image_id = i_image_id and group_head_id is null; --extended sources merging @@ -56,6 +69,7 @@ update temp_associations set kind = 5 where lr_method = 3 and kind = 2 + and image_id = i_image_id and not exists (select r.band from runningcatalog r, temp_associations ta, @@ -67,6 +81,16 @@ update temp_associations and r.band = r2.band and r.stokes = r2.stokes and ta.kind = 2 + and ta.image_id = i_image_id and ta.lr_method = 3 ); + +insert into image_stats(image_id, run_id, kind, lr_method, value) +select t.image_id, run_id, kind, lr_method, count(*) + from temp_associations t, + images i + where i.imageid = i_image_id + and t.image_id = i_image_id +group by image_id, run_id, kind, lr_method; + end; diff --git a/CEP/GSM/bremen/sql/pg/create.procedure.fill_temp_assoc_kind.sql b/CEP/GSM/bremen/sql/pg/create.procedure.fill_temp_assoc_kind.sql index e8ca45baf8c1f8596f0e65ee016ac359d6927ca9..e65d5b8300f4e74fe7f445a64385a7b49592c1c4 100644 --- a/CEP/GSM/bremen/sql/pg/create.procedure.fill_temp_assoc_kind.sql +++ b/CEP/GSM/bremen/sql/pg/create.procedure.fill_temp_assoc_kind.sql @@ -2,57 +2,70 @@ -- DROP FUNCTION fill_temp_assoc_kind(); -CREATE OR REPLACE FUNCTION fill_temp_assoc_kind() +CREATE OR REPLACE FUNCTION fill_temp_assoc_kind(i_image_id int) RETURNS void AS $BODY$begin update temp_associations set xtr_count = (select count(xtrsrc_id2) from temp_associations as ta - where ta.xtrsrc_id2 = temp_associations.xtrsrc_id2); + where ta.xtrsrc_id2 = temp_associations.xtrsrc_id2 + and ta.image_id = i_image_id) + where image_id = i_image_id; update temp_associations set run_count = (select count(runcat_id) from temp_associations as ta - where ta.runcat_id = temp_associations.runcat_id); + where ta.runcat_id = temp_associations.runcat_id + and ta.image_id = i_image_id) + where image_id = i_image_id; update temp_associations set kind = 1 where xtr_count = 1 - and run_count = 1; + and run_count = 1 + and image_id = i_image_id; update temp_associations set kind = 2 where xtr_count > 1 - and run_count = 1; + and run_count = 1 + and image_id = i_image_id; update temp_associations set kind = 3 where xtr_count = 1 - and run_count > 1; + and run_count > 1 + and image_id = i_image_id; update temp_associations set kind = 4 where xtr_count > 1 - and run_count > 1; + and run_count > 1 + and image_id = i_image_id; --complete groups update temp_associations set kind = 4 where kind <> 4 + and image_id = i_image_id and exists (select kind from temp_associations ta where ta.runcat_id = temp_associations.runcat_id - and kind = 4); + and ta.image_id = i_image_id + and ta.kind = 4); update temp_associations set kind = 4 where kind <> 4 + and image_id = i_image_id and exists (select kind from temp_associations ta where ta.xtrsrc_id2 = temp_associations.xtrsrc_id2 - and kind = 4); + and ta.image_id = i_image_id + and ta.kind = 4); update temp_associations set group_head_id = runcat_id where kind = 4 + and image_id = i_image_id and group_head_id is null; --extended sources merging @@ -60,6 +73,7 @@ update temp_associations set kind = 5 where lr_method = 3 and kind = 2 + and image_id = i_image_id and not exists (select r.band from runningcatalog r, temp_associations ta, @@ -72,8 +86,19 @@ update temp_associations and r.stokes = r2.stokes and ta.kind = 2 and ta.lr_method = 3 + and ta.image_id = i_image_id ); + +insert into image_stats(image_id, run_id, kind, lr_method, value) +select t.image_id, run_id, kind, lr_method, count(*) + from temp_associations t, + images i + where i.imageid = i_image_id + and t.image_id = i_image_id +group by image_id, run_id, kind, lr_method; + end; + $BODY$ LANGUAGE plpgsql VOLATILE COST 100; diff --git a/CEP/GSM/bremen/sql/pg/indices.sql b/CEP/GSM/bremen/sql/pg/indices.sql index c893af3bbf578f1956af428d2423890b863e5455..34cff3b9fb945d2fdb18125ba34697b6288f9eb2 100644 --- a/CEP/GSM/bremen/sql/pg/indices.sql +++ b/CEP/GSM/bremen/sql/pg/indices.sql @@ -1,17 +1,17 @@ CREATE INDEX i_assoc_extracted ON assocxtrsources USING btree (xtrsrc_id ); CREATE INDEX i_assoc_runcat ON assocxtrsources USING btree (runcat_id ); +CREATE INDEX i_run ON images USING btree (run_id); -CREATE INDEX i_extract_xyz ON extractedsources USING btree (x , y , z ); -CREATE INDEX i_image ON extractedsources USING btree (image_id ); -CREATE INDEX i_xtrsrc ON extractedsources USING btree (xtrsrcid ); - - -CREATE INDEX i_runcat_first ON runningcatalog USING btree (first_xtrsrc_id ); -CREATE INDEX i_runcat_xyz ON runningcatalog USING btree (x , y , z ); -CREATE INDEX i_runcat_id ON runningcatalog USING btree (runcatid, band, stokes); -CREATE INDEX i_runcat_parent ON runningcatalog USING btree (parent_runcat_id, band, stokes); -CREATE INDEX i_runcat_parent0 ON runningcatalog USING btree (parent_runcat_id) - +CREATE INDEX i_extract_xyz ON extractedsources USING btree (x , y , z ); +CREATE INDEX i_extract_image ON extractedsources USING btree (image_id ); +CREATE INDEX i_extract_xtrsrc ON extractedsources USING btree (xtrsrcid ); +CREATE INDEX i_extract_healpix ON extractedsources USING btree (healpix_zone ); +CREATE INDEX i_runcat_first ON runningcatalog USING btree (first_xtrsrc_id ); +CREATE INDEX i_runcat_xyz ON runningcatalog USING btree (x , y , z ); +CREATE INDEX i_runcat_id ON runningcatalog USING btree (runcatid, band, stokes); +CREATE INDEX i_runcat_parent ON runningcatalog USING btree (parent_runcat_id, band, stokes); +CREATE INDEX i_runcat_parent0 ON runningcatalog USING btree (parent_runcat_id); +CREATE INDEX i_runcat_healpix ON runningcatalog USING btree (healpix_zone ); diff --git a/CEP/GSM/bremen/sql/tables/create.table.detections.sql b/CEP/GSM/bremen/sql/tables/create.table.detections.sql index 949565ed58597b3910b0ea17d71b45242e9c7e2a..f972a5162098f537dfdaffe56978670d3d39d522 100644 --- a/CEP/GSM/bremen/sql/tables/create.table.detections.sql +++ b/CEP/GSM/bremen/sql/tables/create.table.detections.sql @@ -3,7 +3,8 @@ * the detections from the sources extraction. */ CREATE TABLE detections - (image_id VARCHAR(64) NOT NULL + (run_id int NULL + ,image_name CHAR(64) NOT NULL ,lra double NOT NULL ,ldecl double NOT NULL ,lra_err double NOT NULL diff --git a/CEP/GSM/bremen/sql/tables/create.table.image_stats.sql b/CEP/GSM/bremen/sql/tables/create.table.image_stats.sql new file mode 100644 index 0000000000000000000000000000000000000000..310b69bc405e8a8f6fe0ec1516efba24dcdcda79 --- /dev/null +++ b/CEP/GSM/bremen/sql/tables/create.table.image_stats.sql @@ -0,0 +1,8 @@ +--table for image statistics +CREATE TABLE image_stats( + image_id int not null, + run_id int not null, + kind int not null, + lr_method int not null, + value int not null +); diff --git a/CEP/GSM/bremen/sql/tables/create.table.images.sql b/CEP/GSM/bremen/sql/tables/create.table.images.sql index 4e9f80cdede33afccaf1ca2ee9565df221052c77..c4af850b2da0f222d576969794375c6c4b52ad46 100644 --- a/CEP/GSM/bremen/sql/tables/create.table.images.sql +++ b/CEP/GSM/bremen/sql/tables/create.table.images.sql @@ -25,24 +25,15 @@ CREATE TABLE images ,band INT NOT NULL ,stokes CHAR(1) NOT NULL DEFAULT 'I' ,imagename CHAR(64) NOT NULL --unique LOFAR image id - --,tau_time double NOT NULL - --,freq_eff double NOT NULL - --,freq_bw double NULL - --,taustart_ts TIMESTAMP NOT NULL - --,bmaj double NOT NULL - --,bmin double NOT NULL - --,bpa double NOT NULL ,centr_ra double NOT NULL ,centr_decl double NOT NULL ,fov_radius double null -- field of view size - --,x double NOT NULL - --,y double NOT NULL - --,z double NOT NULL ,url VARCHAR(120) NULL ,reprocessing INT NOT NULL DEFAULT 0 ,status int not null -- 0-created, 1-Ok, 2-removed from runningcatalog, 3-removed completely ,process_date timestamp not null default current_timestamp ,svn_version int null + ,run_id int not null ,PRIMARY KEY (imageid) --,FOREIGN KEY (ds_id) REFERENCES datasets (dsid) --,FOREIGN KEY (band) REFERENCES frequencybands (freqbandid) diff --git a/CEP/GSM/bremen/sql/tables/create.table.runs.sql b/CEP/GSM/bremen/sql/tables/create.table.runs.sql new file mode 100644 index 0000000000000000000000000000000000000000..36efcb73d659f3da6ed43530443204e0149189f5 --- /dev/null +++ b/CEP/GSM/bremen/sql/tables/create.table.runs.sql @@ -0,0 +1,10 @@ +CREATE SEQUENCE "seq_runs" AS INTEGER; + +CREATE TABLE runs ( + runid INT DEFAULT NEXT VALUE FOR "seq_runs", + start_date timestamp not null default current_timestamp, + end_date timestamp null, + status int null, --0-started, 1-finished, 2-broken + user_id char(100) not null, + process_id int not null +); diff --git a/CEP/GSM/bremen/sql/tables/create.table.temp_associations.sql b/CEP/GSM/bremen/sql/tables/create.table.temp_associations.sql index 413073875500862e6b462bc3bc097afb1437baae..26d27ede6d7b9743aea7c626c0393556bce9384c 100644 --- a/CEP/GSM/bremen/sql/tables/create.table.temp_associations.sql +++ b/CEP/GSM/bremen/sql/tables/create.table.temp_associations.sql @@ -12,6 +12,7 @@ create table temp_associations( ,kind int null -- 1: 1-1, 2: 1-n; 3: n-1; 4: n-n; 5: merge extended ,group_head_id int null ,flux_fraction double null + ,image_id int not null ,PRIMARY KEY (xtrsrc_id, runcat_id) diff --git a/CEP/GSM/bremen/src/bbsfilesource.py b/CEP/GSM/bremen/src/bbsfilesource.py index 74f44e4092fad2f16686a19156cd57e893989d1d..28461a8e8af7ca20fed54b3f65ff4722d7798f84 100644 --- a/CEP/GSM/bremen/src/bbsfilesource.py +++ b/CEP/GSM/bremen/src/bbsfilesource.py @@ -52,15 +52,16 @@ class GSMBBSFileSource(object): 3.0, ]) - def __init__(self, file_id, filename, fileformat="default"): + def __init__(self, parset_id, run_id, filename, fileformat="default"): """ - :param file_id: Unique LOFAR image identificator. + :param parset_id: Unique LOFAR image identificator. :param filename: Name of the file on disk. :param fileformat: 'default' or 'test'. Test file format allows setting default values for columns. """ self.filename = filename - self.file_id = file_id + self.parset_id = parset_id + self.run_id = run_id self.fileformat = fileformat self.defaults = copy(self.DEFAULTS) self.sources = 0 @@ -94,44 +95,65 @@ class GSMBBSFileSource(object): answer[to_index] = line[from_index] return answer + def get_header_test(self, datafile): + """ + Get header for a 'test' data-format. + No comments are supported. First line is a list + of column-names or column default values, like: + ra ra_err=0.01 decl decl_err=0.01 + In the example above two columns (ra and decl) are taken from + the data, and for ra_err and decl_err a default value is taken. + """ + try: + header = datafile.readline().split('=', + 1)[1].strip(' ').lower().split(',') + for ind, head_parts in enumerate(header): + head_part = head_parts.split('=') + if len(head_part) != 1: # Default value is given + header[ind] = (head_part[0], + head_part[1].strip("'").strip()) + except IndexError: + raise SourceException('Wrong header in the first line' \ + ' of file %s' % self.filename) + return header + + def get_header_default(self, datafile): + """ + Get header for a 'default' data-format. + Comments should start with #. + List of columns should be in the header: + # RA DECL... + """ + line = datafile.readline() + while not (line.startswith('# Gaus_id') or + line.startswith("# RA")): + line = datafile.readline() + if not line: + raise SourceException('No header in file %s' % + self.filename) + return line[2:].strip().lower().split(' ') + def read_and_store_data(self, conn): """ Read all from the BBS file. """ - line = None header = None if not os.path.isfile(self.filename): raise SourceException('no file %s' % self.filename) datafile = open(self.filename, 'r') if self.fileformat == 'test': - try: - header = datafile.readline().split('=', - 1)[1].strip(' ').lower().split(',') - for ind, head_parts in enumerate(header): - head_part = head_parts.split('=') - if len(head_part) != 1: # Default value is given - header[ind] = (head_part[0], - head_part[1].strip("'").strip()) - except IndexError: - raise SourceException('Wrong header in the first line' \ - ' of file %s' % self.filename) + header = self.get_header_test(datafile) elif self.fileformat == 'default': - line = datafile.readline() - while not (line.startswith('# Gaus_id') or line.startswith("# RA")): - line = datafile.readline() - if not line: - raise SourceException('No header in file %s' % - self.filename) - header = line[2:].strip().lower().split(' ') + header = self.get_header_default(datafile) if not header: raise SourceException('No header in file %s' % self.filename) self.process_header(header) sql_data = [] # Switch off autocommit (if it is switched on) for better performance. - sql_insert = 'insert into detections (image_id, lra, ldecl, lra_err, '\ - 'ldecl_err, lf_peak, lf_peak_err, ' \ - 'lf_int, lf_int_err, ' \ + sql_insert = 'insert into detections (run_id, image_name, '\ + 'lra, ldecl, lra_err, ldecl_err,'\ + 'lf_peak, lf_peak_err, lf_int, lf_int_err, ' \ 'g_minor, g_minor_err, g_major, g_major_err,' \ 'g_pa, g_pa_err, ldet_sigma, healpix_zone) values' while True: @@ -144,10 +166,11 @@ class GSMBBSFileSource(object): continue self.sources = self.sources + 1 dhash = self.process_line(data_line.split()) - pix = hp.ang2pix(64, radians(90.-float(dhash[1])), + pix = hp.ang2pix(16, radians(90. - float(dhash[1])), radians(float(dhash[0])), nest=True) - sql_data.append("('%s', %s, %s )" % - (self.file_id, ','.join(dhash), pix)) + sql_data.append("(%s, '%s', %s, %s )" % + (self.run_id, self.parset_id, + ','.join(dhash), pix)) sql = "%s %s;" % (sql_insert, ',\n'.join(sql_data)) conn.execute(sql) self.log.info('%s sources loaded from %s' % (self.sources, diff --git a/CEP/GSM/bremen/src/gsmconnectionmanager.py b/CEP/GSM/bremen/src/gsmconnectionmanager.py index 99ec45f37acc7f8a7c62778020956125b511b0f0..7a03e24e8ff3e25da59665fe85c1820600b675e2 100644 --- a/CEP/GSM/bremen/src/gsmconnectionmanager.py +++ b/CEP/GSM/bremen/src/gsmconnectionmanager.py @@ -12,8 +12,8 @@ class GSMConnectionManager(object): """ DEFAULTS = { 'hostname': 'localhost', - 'port': 50000, - 'database': 'gsm', + 'port': 52000, + 'database': 'GSM', 'username': 'monetdb', 'password': 'monetdb', 'autocommit': True diff --git a/CEP/GSM/bremen/src/gsmlogger.py b/CEP/GSM/bremen/src/gsmlogger.py index a735bd15c1afe8ee1719dd8613f46eaa2eb50912..22ab18e779ff995d2baf7ec07d6fb6065974830f 100644 --- a/CEP/GSM/bremen/src/gsmlogger.py +++ b/CEP/GSM/bremen/src/gsmlogger.py @@ -7,7 +7,11 @@ import os LOGGERS = {} -BASE_LOG_DIR = os.path.join(os.getenv('HOME'), 'prog', 'GSM') +import platform +if platform.node() == 'ldb001': + BASE_LOG_DIR = os.path.join(os.getenv('HOME'), 'GSM') +else: + BASE_LOG_DIR = os.path.join(os.getenv('HOME'), 'prog', 'GSM') USE_CONSOLE = False diff --git a/CEP/GSM/bremen/src/gsmparset.py b/CEP/GSM/bremen/src/gsmparset.py index a98b1a2273859c041c7698bcc835b137cb207a16..1392744d9f3aeac99641714156b2ea2359b7b0fe 100644 --- a/CEP/GSM/bremen/src/gsmparset.py +++ b/CEP/GSM/bremen/src/gsmparset.py @@ -13,6 +13,7 @@ from src.errors import ParsetContentError, SourceException, GSMException from src.bbsfilesource import GSMBBSFileSource from src.sqllist import get_sql, get_svn_version from src.gsmlogger import get_gsm_logger +from src.queries import sql_insert_run class GSMParset(object): @@ -24,6 +25,7 @@ class GSMParset(object): Read parset from a given file. """ self.filename = filename + self.run_id = None self.log = get_gsm_logger('parsets', 'import.log') if not path.isfile(filename): self.log.error('Parset file does not exist: %s' % filename) @@ -36,6 +38,7 @@ class GSMParset(object): self.parset_id = self.data.get('image_id') self.image_id = None # Not yet known. self.source_count = None + self.recalculate_pointing = False self.log.info('Parset opened: %s' % filename) def process(self, conn): @@ -49,51 +52,55 @@ class GSMParset(object): elif isinstance(sources, str): sources = sources.strip(' []').replace(' ', '').split(',') elif isinstance(sources, list): - sources = ','.join(sources).strip(' []').replace(' ', '').split(',') + sources = ','.join(sources).strip(' []' + ).replace(' ', '').split(',') if not self.parset_id: raise ParsetContentError('"image_id" missing') conn.start() + conn.execute(sql_insert_run()) + self.run_id = conn.exec_return(""" + select max(runid) from runs where status=0;""", + single_column=True) for source in sources: if self.data.get('bbs_format'): - bbsfile = GSMBBSFileSource(self.parset_id, + bbsfile = GSMBBSFileSource(self.parset_id, self.run_id, "%s/%s" % (self.path, source), self.data.get('bbs_format')) else: - bbsfile = GSMBBSFileSource(self.parset_id, - "%s/%s" % (self.path, source)) + bbsfile = GSMBBSFileSource(self.parset_id, self.run_id, + "%s/%s" % (self.path, source)) bbsfile.read_and_store_data(conn) loaded_sources = loaded_sources + bbsfile.sources self.image_id = self.save_image_info(conn) conn.commit() - self.log.info('%s sources loaded from parset %s' % (loaded_sources, - self.filename)) + self.log.info('%s sources loaded from parset %s' % ( + loaded_sources, self.filename)) self.source_count = loaded_sources return loaded_sources - - def get_image_size(self, min_decl, max_decl, min_ra, max_ra, + + def get_image_size(self, min_decl, max_decl, min_ra, max_ra, avg_decl, avg_ra): """ >>> t = GSMParset('tests/image1.parset') >>> t.get_image_size(1.0, 3.0, 1.0, 3.0, 2.0, 2.0) (1.0, 2.0, 2.0) >>> t.get_image_size(-4.0, 4.0, 1.0, 359.0, 0.0, 359.8) - (4.0, 0.0, -0.19999999999998863) + (4.0, 0.0, 0.0) """ if max_ra - min_ra > 250.0: # Field across zero-ra. Has to be shifted. # E.g. min = 0.1 max = 359.7 avg = 359.9 # transfers to: # min = -0.3 max = 0.1 avg = -0.1 - min_ra, max_ra = max_ra - 360.0, min_ra - if avg_ra > 250: - avg_ra = avg_ra - 360.0 + min_ra, max_ra = max_ra - 360.0, min_ra + avg_ra = 0.5 * (max_ra + min_ra) min_ra = min_ra * cos(avg_decl) max_ra = max_ra * cos(avg_decl) - return max( [ avg_decl - min_decl, max_decl - avg_decl, - avg_ra * cos(avg_decl) - min_ra, - max_ra - avg_ra * cos(avg_decl) ]), \ - avg_decl, avg_ra + return max([avg_decl - min_decl, max_decl - avg_decl, + avg_ra * cos(avg_decl) - min_ra, + max_ra - avg_ra * cos(avg_decl)]), \ + avg_decl, avg_ra def save_image_info(self, conn): """ @@ -106,28 +113,29 @@ class GSMParset(object): self.data.get('frequency'))) if not band or band == -1: raise SourceException( - 'No matching frequency band found for frequency %s' % + 'No matching frequency band found for frequency %s' % self.data.get('frequency')) - - if not self.data.has_key('pointing_ra') or \ - not self.data.has_key('pointing_decl') or \ - not self.data.has_key('beam_size'): + + if not 'pointing_ra' in self.data or \ + not 'pointing_decl' in self.data or \ + not 'beam_size' in self.data: data = conn.exec_return( - """select min(ldecl), max(ldecl), - min(lra), max(lra), - avg(ldecl), avg(lra) - from detections;""", single_column=False) + """select min(ldecl), max(ldecl), + min(lra), max(lra), + avg(ldecl), avg(lra) + from detections + where run_id = %s;""" % self.run_id, single_column=False) size, avg_decl, avg_ra = self.get_image_size(*data) + self.recalculate_pointing = True else: size = self.data.get('beam_size') avg_decl = self.data.get('pointing_decl') avg_ra = self.data.get('pointing_ra') - + conn.execute(get_sql('insert image', self.parset_id, band, - avg_ra, avg_decl, size, - get_svn_version())) + avg_ra, avg_decl, size, + get_svn_version(), self.run_id)) image_id = conn.exec_return(get_sql('get last image_id')) self.log.info('Image %s created' % image_id) return image_id - diff --git a/CEP/GSM/bremen/src/pipeline.py b/CEP/GSM/bremen/src/pipeline.py index 6d0eb2bdf0b9ce3d2d08042d7ca2ae087e6b52f1..9106615aa221d19fdf5a98231fff7537f7c2f7ad 100644 --- a/CEP/GSM/bremen/src/pipeline.py +++ b/CEP/GSM/bremen/src/pipeline.py @@ -3,7 +3,7 @@ import monetdb.sql as db from src.errors import SourceException, ImageStateError from src.gsmconnectionmanager import GSMConnectionManager from src.gsmlogger import get_gsm_logger -from src.sqllist import get_sql, get_svn_version +from src.sqllist import get_sql, get_svn_version, GLOBALS from src.grouper import Grouper from src.updater import run_update import logging @@ -15,7 +15,8 @@ class GSMPipeline(object): """ General pipeline class. """ - def __init__(self, custom_cm=None, use_monet=None, profile=False, + def __init__(self, custom_cm=None, use_monet=None, + profile=False, **params): """ @param custom_cm: allows to pass an object to be used as connection @@ -35,6 +36,7 @@ class GSMPipeline(object): if profile: self.conn.profile = True self.conn.log.setLevel(logging.DEBUG) + self.conn.commit() except db.Error as exc: self.log.error("Failed to connect: %s" % exc) raise exc @@ -66,9 +68,9 @@ class GSMPipeline(object): Process single parset file. """ self.conn.start() - self.conn.execute("delete from detections;") parset.process(self.conn) - self.process_image(parset.image_id) + self.parset = parset + self.process_image(parset.image_id, parset.run_id) self.log.info('Parset %s done.' % parset.filename) return parset.image_id @@ -92,63 +94,70 @@ class GSMPipeline(object): """ vector = healpy.ang2vec(math.radians(90.0 - centr_decl), math.radians(centr_ra)) - pixels = healpy.query_disc(64, vector, math.radians(fov_radius), + pixels = healpy.query_disc(16, vector, math.radians(fov_radius), inclusive=True, nest=True) return str(pixels.tolist())[1:-1] - def process_image(self, image_id, sources_loaded=False): + def update_image_pointing(self, image_id): + avg_x, avg_y, avg_z, count = self.conn.exec_return( + get_sql('Image properties selector', image_id), + single_column=False) + avg_x, avg_y, avg_z = avg_x / count, avg_y / count, avg_z / count + decl = math.asin(avg_z) + ra = math.atan2(avg_x, avg_y) + self.conn.execute(get_sql('Image properties updater', + ra, decl, image_id)) + + def process_image(self, image_id, run_id=None, sources_loaded=False): """ Process single image. @sources_loaded: True if there are records in the extractedsources already. """ self.conn.start() - status, band, stokes, fov_radius, centr_ra, centr_decl = \ + status, band, stokes, fov_radius, centr_ra, centr_decl, run_loaded = \ self.conn.exec_return(""" - select status, band, stokes, fov_radius, centr_ra, centr_decl + select status, band, stokes, fov_radius, centr_ra, centr_decl, run_id from images where imageid = %s;""" % image_id, single_column=False) + if not run_id: + run_id = run_loaded if status == 1: raise ImageStateError('Image %s in state 1 (Ok). Cannot process' % image_id) - self.conn.execute("delete from temp_associations;") - pix = self.get_pixels(centr_ra, centr_decl, fov_radius) + pix = self.get_pixels(centr_ra, centr_decl, fov_radius + 0.5) + GLOBALS.update({'i': image_id, 'r': run_id, + 'b': band, 's': stokes}) if not sources_loaded: - self.conn.execute(get_sql('insert_extractedsources', image_id)) - self.conn.execute(get_sql('insert dummysources', image_id)) + self.conn.execute(get_sql('insert_extractedsources')) + self.conn.execute(get_sql('insert dummysources')) self.conn.execute(get_sql('Associate point', - image_id, math.sin(0.025), 1.0, pix)) + math.sin(0.025), 1.0, pix)) self.conn.execute_set(get_sql('Associate extended', - image_id, math.sin(0.025), 0.5, - band, stokes, pix)) - self.conn.call_procedure("fill_temp_assoc_kind();") + math.sin(0.025), 0.5, pix)) + self.conn.call_procedure("fill_temp_assoc_kind(%s);" % image_id) # Process one-to-one associations; self.conn.execute(get_sql('add 1 to 1')) #process one-to-many associations; self.conn.execute(get_sql('add 1 to N')) self.conn.execute_set(get_sql('update flux_fraction')) #process many-to-one associations; - self.conn.execute_set(get_sql('add N to 1', band)) + self.conn.execute_set(get_sql('add N to 1')) #Process many-to-many; self.run_grouper() #updating runningcatalog - run_update(self.conn, 'update runningcatalog', image_id) - run_update(self.conn, 'update runningcatalog extended', image_id) - self.conn.execute(get_sql('update runningcatalog XYZ', image_id)) + run_update(self.conn, 'update runningcatalog') + run_update(self.conn, 'update runningcatalog extended') + self.conn.execute(get_sql('update runningcatalog XYZ')) #First update, then insert new (!!!) - run_update(self.conn, 'update runningcatalog_fluxes', - image_id) - self.conn.execute(get_sql('insert new bands for point sources', - image_id, band)) + run_update(self.conn, 'update runningcatalog_fluxes') + self.conn.execute(get_sql('insert new bands for point sources')) #inserting new sources - self.conn.execute_set(get_sql('Insert new sources', image_id)) - self.conn.execute_set(get_sql('Join extended', image_id)) + self.conn.execute_set(get_sql('Insert new sources')) + self.conn.execute_set(get_sql('Join extended')) #update image status and save current svn verion. - self.conn.execute(""" -update images - set status = 1, - process_date = current_timestamp, - svn_version = %s - where imageid = %s""" % (get_svn_version(), image_id)) + self.conn.execute_set(get_sql('Cleanup', get_svn_version())) + if self.parset.recalculate_pointing: + self.update_image_pointing(image_id) self.conn.commit() diff --git a/CEP/GSM/bremen/src/queries.py b/CEP/GSM/bremen/src/queries.py index 305537af1a7f8f300f34ffb5535f60f3fac04a33..dbeb72e393c283832394befe9bef2d9bbeaf2910 100644 --- a/CEP/GSM/bremen/src/queries.py +++ b/CEP/GSM/bremen/src/queries.py @@ -4,6 +4,7 @@ General query generator for GSM. """ import math import os +import pwd try: import pysvn @@ -26,6 +27,16 @@ def get_svn_version(): else: return -1 + +def sql_insert_run(): + """ + Returns a query to insert a new run. + """ + return """ +insert into runs(status, user_id, process_id) values (0, '%s', '%s'); +""" % (pwd.getpwuid(os.getuid())[0], os.getpid()) + + def makelistable(fn): """ Allows passing a list instead of the first string parameter. @@ -84,6 +95,7 @@ DEGREES(2.0 * ASIN(0.5*SQRT(({0}.x - {1}.x) * ({0}.x - {1}.x) ({0}.wm_g_major*{0}.wm_g_major + {1}.g_major*{1}.g_major) """.format(runcat_alias, extract_alias) + @makelistable def get_column_insert(column_alias, prefix=None): """ @@ -97,6 +109,7 @@ def get_column_insert(column_alias, prefix=None): {1}wm_{0}, {1}wm_{0}_err, {1}avg_w{0},{1}avg_weight_{0}""".format(column_alias, prefix) + @makelistable def get_column_insert_values(column_alias): """ @@ -105,6 +118,7 @@ def get_column_insert_values(column_alias): return """ {0},{0}_err, {0}/({0}_err*{0}_err), 1/({0}_err*{0}_err)""".format(column_alias) + @makelistable def get_column_update_total(column_alias, fluxes=False): """ @@ -128,6 +142,7 @@ def get_column_update_total(column_alias, fluxes=False): and a.runcat_id = {1}) """.format(column_alias, suffix) + @makelistable def get_column_update_second(column_alias): """ @@ -152,6 +167,7 @@ avg_w{0} = avg_w{0} + {1}/({2}*{2}), avg_weight_{0} = avg_weight_{0} + 1/({2}*{2})""".format(column_alias, new_value, new_weight) + def get_column_deduct(column_alias, new_value, new_weight): """ Updater for error-columns for single item ipdate. @@ -161,6 +177,7 @@ avg_w{0} = avg_w{0} - {1}/({2}*{2}), avg_weight_{0} = avg_weight_{0} - 1/({2}*{2})""".format(column_alias, new_value, new_weight) + def get_column_deduct_nonzero(column_alias, new_value, new_weight): """ Updater for error-columns for single item ipdate. @@ -207,18 +224,22 @@ def get_column_from(column_alias): """ Fills "SELECT" in the subquery for multiple update. """ - return """sum({0}/({0}_err*{0}_err)) as {0}_value, sum(1/({0}_err*{0}_err)) as {0}_weight""".format(column_alias) + return """ +sum({0}/({0}_err*{0}_err)) as {0}_value, +sum(1/({0}_err*{0}_err)) as {0}_weight""".format(column_alias) -def get_field(ra, decl, radius, band, stokes='I', min_flux=None): +def get_field(ra, decl, radius, band, stokes='I', min_flux=None, + min_datapoints=None): """ Create a query to get sources for a given fov in a given band. """ - def get_field_conditions(x, y, z, r, min_flux): + def get_field_conditions(x, y, z, r, min_flux, min_datapoints): + sql = '' if min_flux: sql = "\n and f.wm_f_peak > %s" % min_flux - else: - sql = '' + if min_datapoints: + sql = '%s\n and f.datapoints > %s' % (sql, min_datapoints) return """r.x * {0} + r.y * {1} + r.z * {2} > {3} and r.x between {0} - {3} and {0} + {3} and r.y between {1} - {3} and {1} + {3} @@ -251,7 +272,8 @@ select r.wm_ra as ra, r.wm_decl as decl, f.wm_f_peak and f.runcat_id = r.runcatid and f.stokes = '{1}' and f.band = {2} -""".format(get_field_conditions(x, y, z, r, min_flux), stokes, band) +""".format(get_field_conditions(x, y, z, r, min_flux, min_datapoints), + stokes, band) return sql diff --git a/CEP/GSM/bremen/src/reprocessor.py b/CEP/GSM/bremen/src/reprocessor.py index bf075c909c151dfab4336e019065b9d4db60763b..daa55fd26d227ffaf758ada00b9c5a8780583471 100644 --- a/CEP/GSM/bremen/src/reprocessor.py +++ b/CEP/GSM/bremen/src/reprocessor.py @@ -1,5 +1,5 @@ #!/usr/bin/python -from src.sqllist import get_sql +from src.sqllist import get_sql, GLOBALS from src.updater import run_update from src.pipeline import GSMPipeline @@ -13,6 +13,7 @@ class Reprocessor(GSMPipeline): """ Remove all data from runningcatalog/runningcatalog_fluxes. """ + GLOBALS['i'] = image_id self.log.info('removing data from image %s' % image_id) self.conn.start() for sql in ['deduct runningcatalog', @@ -22,11 +23,10 @@ class Reprocessor(GSMPipeline): 'deduct runningcatalog_fluxes', 'deduct runningcatalog_fluxes non-zero']: run_update(self.conn, sql, image_id) - self.conn.execute(get_sql('deduct cleanup', image_id)) - self.conn.execute(get_sql('update runningcatalog XYZ', image_id)) + self.conn.execute(get_sql('deduct cleanup')) + self.conn.execute(get_sql('update runningcatalog XYZ')) if delete_observations: - self.conn.execute(get_sql('deduct remove extractedsources', - image_id)) + self.conn.execute(get_sql('deduct remove extractedsources')) image_status = 99 else: image_status = 2 @@ -42,12 +42,15 @@ update images Remove old and insert new data. Do not reload the data and do not touch extractedsources. """ + GLOBALS['i'] = image_id self.remove_image(image_id) self.process_image(image_id, sources_loaded=True) self.conn.execute(""" update images set reprocessing = reprocessing + 1 where imageid = %s""" % image_id) + self.conn.execute("delete from temp_associations where image_id = %s;" + % image_id) self.conn.commit() def full_reprocess_image(self, image_id, new_parset): @@ -57,6 +60,7 @@ update images New image_id will be created with the new parset, with the old image switched to status=99. """ + GLOBALS['i'] = image_id self.remove_image(image_id, delete_observations=True) self.run_parset(new_parset) self.conn.execute(""" diff --git a/CEP/GSM/bremen/src/spectra.py b/CEP/GSM/bremen/src/spectra.py index f0216d444e91f9236244466b899f4f242594cc1a..b4d01b4fcdec12e21689ba2b1f0fc85e91901136 100644 --- a/CEP/GSM/bremen/src/spectra.py +++ b/CEP/GSM/bremen/src/spectra.py @@ -1,7 +1,29 @@ #!/usr/bin/python import numpy from copy import copy -from numpy.polynomial.polynomial import polyval + + +def _verify_versions(a, b): + a = map(int, a.split('.')) + b = map(int, b.split('.')) + for i, val in enumerate(a): + if b[i] < val: + return False + return True + +if _verify_versions('1.4.0', numpy.__version__): + print 'Using 1.4 version' + from numpy.polynomial.polynomial import polyval +else: + print 'Using substitute for 1.3 version' + from numpy import polyval as polyval_numpy + def polyval(x, args): + if not isinstance(args, list): + args = args.tolist() + pargs = copy(args) + pargs.reverse() + return polyval_numpy(pargs, x) + #Unused: #from scipy.stats import chi2 diff --git a/CEP/GSM/bremen/src/sqllist.py b/CEP/GSM/bremen/src/sqllist.py index 75a357d71348808675c12334ecc8aaca1da80d19..37b7c6828ea653d30cc5d4ab024707974bc3f253 100644 --- a/CEP/GSM/bremen/src/sqllist.py +++ b/CEP/GSM/bremen/src/sqllist.py @@ -13,6 +13,11 @@ from src.queries import * SQL_LIST = {} +GLOBALS = {} + +def re_sub(regexp, sub_to, sub_from, count, flags=0): + prog = re.compile(regexp, flags) + return prog.sub(sub_to, sub_from, count=count) def _expand_value(value): """ @@ -23,7 +28,7 @@ def _expand_value(value): Expand $$..$$ by calculating value in $s. """ return str(eval(matchvalues.group(0)[2:-2])) - return re.sub(r'\$\$(.*?)\$\$', _expand_formula, value, count=0) + return re_sub(r'\$\$(.*?)\$\$', _expand_formula, value, count=0) def _load_from_sql_list(filename): @@ -49,6 +54,15 @@ def _load_from_sql_list(filename): sqls.close() +def _substitute_globals(sql): + def _substitute_global(matchvalue): + if matchvalue.group(0)[1:-1] in GLOBALS: + return str(GLOBALS[matchvalue.group(0)[1:-1]]) + else: + return '' + return re_sub(r'\[(.?)\]', _substitute_global, sql, count=0) + + def get_sql(name, *params): """ Returns an sql from the list by it's name with parameter substitution. @@ -56,9 +70,10 @@ def get_sql(name, *params): if not name in SQL_LIST: raise IndexError('Name %s not in sqllist.sql' % name) if (SQL_LIST[name].find('%') >= 0): - return SQL_LIST[name] % (params) + return_sql = SQL_LIST[name] % (params) else: - return SQL_LIST[name].format(*params) + return_sql = SQL_LIST[name].format(*params) + return _substitute_globals(return_sql) for sqlfile in ['sqllist.sql', diff --git a/CEP/GSM/bremen/src/sqllist.sql b/CEP/GSM/bremen/src/sqllist.sql index 3e4f725e4ba3d34f58665109833590b74392604d..a8bfd36284e94766fbd27ac5e175e86a1e50810a 100644 --- a/CEP/GSM/bremen/src/sqllist.sql +++ b/CEP/GSM/bremen/src/sqllist.sql @@ -8,9 +8,36 @@ select max(imageid) from images; --#insert image insert into images (ds_id, tau, band, imagename, status, - centr_ra, centr_decl, fov_radius, svn_version) + centr_ra, centr_decl, fov_radius, svn_version, run_id) select 0, 1, {1}, '{0}' as imagename, 0, - {2}, {3}, {4}, {5} + {2}, {3}, {4}, {5}, {6} + +--#Cleanup +delete from detections where run_id = [r]; +delete from temp_associations where image_id = [i]; + +update runs + set status = 1, + end_date = current_timestamp + where runid = [r]; + +update images + set status = 1, + process_date = current_timestamp, + svn_version = {0} + where imageid = [i]; + +--#Image properties selector +select sum(x), sum(y), sum(z), count(*) + from extractedsources + where image_id = [i] + and xtrsrcid2 is null; + +--#Image properties updater +update images + set centr_ra = {0}, + centr_decl = {1} + where imageid = {2}; --#insert_extractedsources @@ -20,7 +47,7 @@ insert into extractedsources (image_id, zone, ra, decl, ra_err, decl_err, source_kind, g_minor, g_minor_err, g_major, g_major_err, g_pa, g_pa_err, healpix_zone) -select {0}, cast(floor(ldecl) as integer) as zone, lra, ldecl, lra_err, ldecl_err, +select [i], cast(floor(ldecl) as integer) as zone, lra, ldecl, lra_err, ldecl_err, cos(radians(ldecl))*cos(radians(lra)), cos(radians(ldecl))*sin(radians(lra)), sin(radians(ldecl)), 3.0, lf_peak, lf_peak_err, lf_int, lf_int_err, @@ -31,7 +58,8 @@ select {0}, cast(floor(ldecl) as integer) as zone, lra, ldecl, lra_err, ldecl_er from detections where lf_int_err > 0 and lf_int > 0 - and lf_peak_err > 0; + and lf_peak_err > 0 + and run_id = [r]; --#insert dummysources @@ -48,7 +76,7 @@ select image_id, zone, ra - 360.0, decl, ra_err, decl_err, g_minor, g_minor_err, g_major, g_major_err, g_pa, g_pa_err, xtrsrcid, healpix_zone from extractedsources - where image_id = {0} + where image_id = [i] and ra > 360 - 1/cos(radians(decl)) and ra > 180 union @@ -59,7 +87,7 @@ select image_id, zone, ra + 360.0, decl, ra_err, decl_err, g_minor, g_minor_err, g_major, g_major_err, g_pa, g_pa_err, xtrsrcid, healpix_zone from extractedsources - where image_id = {0} + where image_id = [i] and ra < 1/cos(radians(decl)) and ra < 180; @@ -70,8 +98,10 @@ update temp_associations from extractedsources e, temp_associations ta where e.xtrsrcid = ta.xtrsrc_id + and ta.image_id = [i] and ta.runcat_id = temp_associations.runcat_id) where kind = 3 + and image_id = [i] and lr_method < 3; update temp_associations @@ -79,9 +109,11 @@ update temp_associations from extractedsources e, temp_associations ta where e.xtrsrcid = ta.xtrsrc_id + and ta.image_id = [i] and ta.xtrsrc_id = temp_associations.xtrsrc_id and ta.runcat_id = temp_associations.runcat_id) where kind = 3 + and image_id = [i] and lr_method < 3; --#add 1 to 1 @@ -91,12 +123,14 @@ insert into assocxtrsources(xtrsrc_id, runcat_id, distance_arcsec, lr_method, r) select ta.xtrsrc_id, ta.runcat_id, ta.distance_arcsec, ta.lr_method, ta.r from temp_associations ta where kind = 1 + and image_id = [i] union select ta.xtrsrc_id, r.parent_runcat_id, ta.distance_arcsec, 3, ta.r from temp_associations ta, runningcatalog r where ta.kind = 1 and ta.lr_method = 2 + and ta.image_id = [i] and r.runcatid = ta.runcat_id; @@ -108,9 +142,11 @@ insert into assocxtrsources(xtrsrc_id, runcat_id, distance_arcsec, lr_method, r) select ta.xtrsrc_id, ta.runcat_id, ta.distance_arcsec, ta.lr_method, ta.r from temp_associations ta where ta.kind = 2 + and ta.image_id = [i] and ta.distance_arcsec = (select min(tb.distance_arcsec) from temp_associations tb where tb.xtrsrc_id = ta.xtrsrc_id + and tb.image_id = [i] and tb.kind = 2 ) union @@ -118,11 +154,13 @@ select ta.xtrsrc_id, r.parent_runcat_id, ta.distance_arcsec, ta.lr_method, ta.r from temp_associations ta, runningcatalog r where ta.kind = 2 + and ta.image_id = [i] and r.runcatid = ta.runcat_id and r.band is not null and ta.distance_arcsec = (select min(tb.distance_arcsec) from temp_associations tb where tb.xtrsrc_id = ta.xtrsrc_id + and tb.image_id = [i] and tb.kind = 2 ); @@ -138,12 +176,14 @@ select e.xtrsrcid, 1, zone, from extractedsources e, temp_associations ta where ta.xtrsrc_id = e.xtrsrcid + and ta.image_id = [i] and ta.kind = 3 and ta.lr_method = 1 and ta.xtrsrc_id not in (select tx.min_id from (select tb.runcat_id, min(tb.xtrsrc_id) as min_id from temp_associations tb where tb.kind = 3 + and tb.image_id = [i] group by tb.runcat_id) tx); --extended sources - per-band match @@ -161,11 +201,13 @@ select r.band, r.stokes, r.parent_runcat_id, where ta.xtrsrc_id = e.xtrsrcid and ta.kind = 3 and ta.lr_method = 2 + and ta.image_id = [i] and r.runcatid = ta.runcat_id and ta.xtrsrc_id not in (select tx.min_id from (select tb.runcat_id, min(tb.xtrsrc_id) as min_id from temp_associations tb where tb.kind = 3 + and tb.image_id = [i] group by tb.runcat_id) tx); --extended sources - cross-band match @@ -182,6 +224,7 @@ select i.band, i.stokes, ta.runcat_id, images i where ta.xtrsrc_id = e.xtrsrcid and ta.kind = 3 + and ta.image_id = [i] and ta.lr_method = 3 and i.imageid = e.image_id; @@ -195,6 +238,7 @@ select r.runcatid, r.band, r.stokes, 1, where ta.xtrsrc_id = e.xtrsrcid and r.first_xtrsrc_id = e.xtrsrcid and r.parent_runcat_id is not null + and ta.image_id = [i] and ta.kind = 3 and ta.lr_method = 3; @@ -209,6 +253,7 @@ select a.xtrsrc_id, r.runcatid, $$get_distance('r', 'e')$$, 4, 0.0, a.weight*ta. runningcatalog r where a.runcat_id = ta.runcat_id and e.xtrsrcid = a.xtrsrc_id + and ta.image_id = [i] and r.first_xtrsrc_id = ta.xtrsrc_id and not r.deleted and ta.kind = 3; @@ -219,7 +264,8 @@ select ta.xtrsrc_id, r.runcatid, 0.0, ta.lr_method, 0.0 from temp_associations ta, runningcatalog r where r.first_xtrsrc_id = ta.xtrsrc_id - and (r.band is null or r.band = {0}) + and (r.band is null or r.band = [b]) + and ta.image_id = [i] and ta.runcat_id <> r.runcatid --not to the old sources(!!!) and ta.kind = 3; @@ -234,11 +280,13 @@ select e.xtrsrcid, ta.runcat_id, where ta.kind = 3 and ta.xtrsrc_id = e.xtrsrcid and not r.deleted + and ta.image_id = [i] and r.runcatid = ta.runcat_id and ta.xtrsrc_id in (select tx.min_id from (select tb.runcat_id, min(tb.xtrsrc_id) as min_id from temp_associations tb where tb.kind = 3 + and tb.image_id = [i] group by tb.runcat_id) tx) union select e.xtrsrcid, r.parent_runcat_id, @@ -248,6 +296,7 @@ select e.xtrsrcid, r.parent_runcat_id, temp_associations ta, runningcatalog r where ta.kind = 3 + and ta.image_id = [i] and ta.xtrsrc_id = e.xtrsrcid and not r.deleted and r.source_kind = 1 @@ -262,6 +311,7 @@ select e.xtrsrcid, r.runcatid, runningcatalog r where ta.kind = 3 and ta.xtrsrc_id = e.xtrsrcid + and ta.image_id = [i] and not r.deleted and r.source_kind = 1 and r.runcatid = ta.runcat_id @@ -277,6 +327,7 @@ SET weight = weight * (SELECT ta.flux_fraction AND ta.xtrsrc_id = a.xtrsrc_id AND r.first_xtrsrc_id <> ta.xtrsrc_id AND r.runcatid = ta.runcat_id + and ta.image_id = [i] AND ta.lr_method < 3 AND ta.kind = 3) WHERE EXISTS (SELECT ta.flux_fraction @@ -288,6 +339,7 @@ WHERE EXISTS (SELECT ta.flux_fraction AND r.first_xtrsrc_id <> ta.xtrsrc_id AND r.runcatid = ta.runcat_id AND ta.lr_method < 3 + and ta.image_id = [i] AND ta.kind = 3); --update old fluxes with new weights @@ -298,8 +350,9 @@ update runningcatalog_fluxes temp_associations ta where e.xtrsrcid = ta.xtrsrc_id and ta.runcat_id = runningcatalog_fluxes.runcat_id + and ta.image_id = [i] and ta.kind = 3) - and band <> {0}; + and band <> [b]; update runningcatalog_fluxes set $$get_column_update_second(['f_peak', 'f_int'])$$ @@ -308,8 +361,9 @@ update runningcatalog_fluxes temp_associations ta where e.xtrsrcid = ta.xtrsrc_id and ta.runcat_id = runningcatalog_fluxes.runcat_id + and ta.image_id = [i] and ta.kind = 3) - and band <> {0}; + and band <> [b]; --insert old fluxes for new sources insert into runningcatalog_fluxes(runcat_id, band, datapoints, @@ -327,5 +381,6 @@ select r.runcatid, f.band, f.datapoints, temp_associations ta where ta.runcat_id = f.runcat_id and ta.xtrsrc_id = r.first_xtrsrc_id - and f.band <> {0} + and ta.image_id = [i] + and f.band <> [b] and ta.kind = 3 ; diff --git a/CEP/GSM/bremen/src/sqllist_associate.sql b/CEP/GSM/bremen/src/sqllist_associate.sql index feef4e9c08977964cf986b79a637bd5a2085a1fc..967a6930aa2b012249b2660b4b54269b397f59c0 100644 --- a/CEP/GSM/bremen/src/sqllist_associate.sql +++ b/CEP/GSM/bremen/src/sqllist_associate.sql @@ -1,24 +1,26 @@ --#Associate point INSERT INTO temp_associations (xtrsrc_id, xtrsrc_id2, runcat_id, distance_arcsec, - lr_method, r, group_head_id) + lr_method, r, group_head_id, image_id) SELECT e.xtrsrcid, coalesce(e.xtrsrcid2, e.xtrsrcid), rc.runcatid, $$get_distance('rc', 'e')$$ AS assoc_distance_arcsec, 1, $$get_assoc_r('rc', 'e')$$ as assoc_r, - rc.group_head_id + rc.group_head_id, [i] FROM runningcatalog rc ,extractedsources e - WHERE e.image_id = {0} - and rc.x between e.x - {1} and e.x + {1} - and rc.y between e.y - {1} and e.y + {1} - and rc.z between e.z - {1} and e.z + {1} + ,images i + WHERE e.image_id = [i] + and i.imageid = [i] + and rc.x between e.x - {0} and e.x + {0} + and rc.y between e.y - {0} and e.y + {0} + and rc.z between e.z - {0} and e.z + {0} and e.source_kind = 0 and rc.source_kind = 0 and not rc.deleted - and rc.healpix_zone in ({3}) - AND rc.decl_zone BETWEEN e.zone - cast(0.025 as integer) - AND e.zone + cast(0.025 as integer) - AND $$get_assoc_r('rc', 'e')$$ < {2}; + AND rc.decl_zone BETWEEN CAST(FLOOR(e.decl - i.fov_radius) AS INTEGER) + AND CAST(FLOOR(e.decl + i.fov_radius) AS INTEGER) + and rc.healpix_zone in ({2}) + AND $$get_assoc_r('rc', 'e')$$ < {1}; --#Associate extended @@ -26,52 +28,56 @@ $$get_assoc_r('rc', 'e')$$ as assoc_r, --first associate per-band INSERT INTO temp_associations (xtrsrc_id, xtrsrc_id2, runcat_id, distance_arcsec, - lr_method, r, group_head_id) + lr_method, r, group_head_id, image_id) SELECT e.xtrsrcid, e.xtrsrcid, rc.runcatid, $$get_distance('rc', 'e')$$ AS assoc_distance_arcsec, 2, $$get_assoc_r_extended('rc', 'e')$$ as assoc_r, - rc.group_head_id + rc.group_head_id, [i] FROM runningcatalog rc ,extractedsources e - WHERE e.image_id = {0} - and rc.x between e.x - {1} and e.x + {1} - and rc.y between e.y - {1} and e.y + {1} - and rc.z between e.z - {1} and e.z + {1} + ,images i + WHERE e.image_id = [i] + and i.imageid = [i] + and rc.x between e.x - {0} and e.x + {0} + and rc.y between e.y - {0} and e.y + {0} + and rc.z between e.z - {0} and e.z + {0} and e.source_kind = 1 and rc.source_kind = 1 - and rc.band = {3} - and rc.stokes = '{4}' - and rc.healpix_zone in ({5}) + and rc.band = [b] + and rc.stokes = '[s]' + AND rc.decl_zone BETWEEN CAST(FLOOR(e.decl - i.fov_radius) AS INTEGER) + AND CAST(FLOOR(e.decl + i.fov_radius) AS INTEGER) + and rc.healpix_zone in ({2}) and not rc.deleted and e.xtrsrcid2 is null - AND rc.decl_zone BETWEEN e.zone - cast(0.025 as integer) - AND e.zone + cast(0.025 as integer) - AND $$get_assoc_r_extended('rc', 'e')$$ < {2}; + AND $$get_assoc_r_extended('rc', 'e')$$ < {1}; --if no match was found for this band, then use cross-band source. INSERT INTO temp_associations (xtrsrc_id, xtrsrc_id2, runcat_id, distance_arcsec, - lr_method, r, group_head_id) + lr_method, r, group_head_id, image_id) SELECT e.xtrsrcid, e.xtrsrcid, rc.runcatid, $$get_distance('rc', 'e')$$ AS assoc_distance_arcsec, 3, $$get_assoc_r_extended('rc', 'e')$$ as assoc_r, - rc.group_head_id + rc.group_head_id, [i] FROM runningcatalog rc ,extractedsources e - WHERE e.image_id = {0} - and rc.x between e.x - {1} and e.x + {1} - and rc.y between e.y - {1} and e.y + {1} - and rc.z between e.z - {1} and e.z + {1} + ,images i + WHERE e.image_id = [i] + and i.imageid = [i] + and rc.x between e.x - {0} and e.x + {0} + and rc.y between e.y - {0} and e.y + {0} + and rc.z between e.z - {0} and e.z + {0} and e.source_kind = 1 and rc.source_kind = 1 and rc.band is null and rc.stokes is null and not rc.deleted and e.xtrsrcid2 is null - and rc.healpix_zone in ({5}) - AND rc.decl_zone BETWEEN e.zone - cast(0.025 as integer) - AND e.zone + cast(0.025 as integer) + AND rc.decl_zone BETWEEN CAST(FLOOR(e.decl - i.fov_radius) AS INTEGER) + AND CAST(FLOOR(e.decl + i.fov_radius) AS INTEGER) + and rc.healpix_zone in ({2}) and not exists (select ta.runcat_id from temp_associations ta where ta.xtrsrc_id = e.xtrsrcid) - AND $$get_assoc_r_extended('rc', 'e')$$ < {2}; + AND $$get_assoc_r_extended('rc', 'e')$$ < {1}; diff --git a/CEP/GSM/bremen/src/sqllist_deduct.sql b/CEP/GSM/bremen/src/sqllist_deduct.sql index f787f6f7491a2a5015fa2c8c2f758285881138f4..b583c1559bfb04177f3a2fe190e7d4d1d90ef842 100644 --- a/CEP/GSM/bremen/src/sqllist_deduct.sql +++ b/CEP/GSM/bremen/src/sqllist_deduct.sql @@ -9,7 +9,7 @@ update runningcatalog and runningcatalog.runcatid = a.runcat_id and runningcatalog.group_head_id is null and runningcatalog.source_kind = 0 - and e.image_id = {0}; + and e.image_id = [i]; --#deduct runningcatalog non-zero update runningcatalog @@ -22,7 +22,7 @@ update runningcatalog and runningcatalog.group_head_id is null and runningcatalog.source_kind = 0 and runningcatalog.datapoints <> 0 - and e.image_id = {0}; + and e.image_id = [i]; --#deduct runningcatalog extended @@ -38,7 +38,7 @@ update runningcatalog and r.runcatid = a.runcat_id and r.group_head_id is null and r.source_kind <> 0 - and e.image_id = {0} + and e.image_id = [i] group by runcatid) as y where y.runcatid = runningcatalog.runcatid; @@ -52,7 +52,7 @@ update runningcatalog and runningcatalog.group_head_id is null and runningcatalog.source_kind <> 0 and runningcatalog.datapoints <> 0 - and e.image_id = {0}; + and e.image_id = [i]; --#deduct runningcatalog_fluxes update runningcatalog_fluxes @@ -66,7 +66,7 @@ update runningcatalog_fluxes runningcatalog_fluxes f where a.xtrsrc_id = e.xtrsrcid and f.runcat_id = a.runcat_id - and e.image_id = {0} + and e.image_id = [i] and e.image_id = i.imageid and a.lr_method <> 5 --not a group association and f.band = i.band @@ -88,17 +88,17 @@ update runningcatalog_fluxes and runningcatalog_fluxes.band = i.band and i.imageid = e.image_id and runningcatalog_fluxes.datapoints <> 0 - and e.image_id = {0}; + and e.image_id = [i]; --#deduct cleanup delete from assocxtrsources where exists (select 1 from extractedsources e - where e.image_id = {0} + where e.image_id = [i] and e.xtrsrcid = assocxtrsources.xtrsrc_id); --#deduct remove extractedsources delete from extractedsources - where image_id = {0} + where image_id = [i] and not exists (select 1 from assocxtrsources a where a.xtrsrc_id = extractedsources.xtrsrcid); diff --git a/CEP/GSM/bremen/src/sqllist_group.sql b/CEP/GSM/bremen/src/sqllist_group.sql index 37abcd66338e7c523f832f3974b7111a334aa9c8..0a1b85c5a65614aa7b020270fd618468203a244d 100644 --- a/CEP/GSM/bremen/src/sqllist_group.sql +++ b/CEP/GSM/bremen/src/sqllist_group.sql @@ -1,12 +1,14 @@ --#GroupFinder select xtrsrc_id, runcat_id, group_head_id from temp_associations - where kind = 4; + where kind = 4 + and image_id = [i]; --#GroupUpdate update temp_associations set group_head_id = {0} where kind = 4 + and image_id = [i] and runcat_id in ({1}); update runningcatalog @@ -18,4 +20,6 @@ update runningcatalog insert into assocxtrsources(xtrsrc_id, runcat_id, distance_arcsec, lr_method, r) select xtrsrc_id, runcat_id, distance_arcsec, 5, r from temp_associations - where kind = 4; + where kind = 4 + and image_id = [i] +; diff --git a/CEP/GSM/bremen/src/sqllist_join.sql b/CEP/GSM/bremen/src/sqllist_join.sql index 175b0975b70316fe39786afe8b408f48babbe4cd..09c6915e887393ff7a778a97a4600e9086ad8050 100644 --- a/CEP/GSM/bremen/src/sqllist_join.sql +++ b/CEP/GSM/bremen/src/sqllist_join.sql @@ -7,11 +7,13 @@ update runningcatalog temp_associations tt where ta.runcat_id = runningcatalog.parent_runcat_id and ta.xtrsrc_id = tt.xtrsrc_id + and ta.image_id = [i] and ta.kind = 5), last_update_date = current_timestamp where exists (select ta.kind from temp_associations ta where ta.runcat_id = runningcatalog.parent_runcat_id + and ta.image_id = [i] and ta.kind = 5) and parent_runcat_id is not null; @@ -22,10 +24,12 @@ update assocxtrsources temp_associations tt where ta.runcat_id = assocxtrsources.runcat_id and ta.xtrsrc_id = tt.xtrsrc_id + and ta.image_id = [i] and ta.kind = 5) where exists (select ta.kind from temp_associations ta where ta.runcat_id = assocxtrsources.runcat_id + and ta.image_id = [i] and ta.kind = 5); --mark obsolete sources as deleted @@ -35,6 +39,7 @@ update runningcatalog where exists (select ta.kind from temp_associations ta where ta.runcat_id = runningcatalog.runcatid + and ta.image_id = [i] and ta.kind = 5) and not exists (select a.lr_method from assocxtrsources a @@ -46,6 +51,7 @@ update runningcatalog where exists (select ta.kind from temp_associations ta where ta.runcat_id = runningcatalog.runcatid + and ta.image_id = [i] and ta.kind = 5) and exists (select a.lr_method from assocxtrsources a @@ -62,12 +68,13 @@ select i.band, i.stokes, e.xtrsrcid, 1, zone, images i, temp_associations ta, runningcatalog r - where e.image_id = {0} - and i.imageid = e.image_id + where e.image_id = [i] + and i.imageid = [i] and e.source_kind = 1 and e.xtrsrcid = ta.xtrsrc_id and ta.kind = 5 --there is only one association and ta.lr_method = 3 --this indicates that there is a cross-band association + and ta.image_id = [i] and r.runcatid = ta.runcat_id and not r.deleted order by e.xtrsrcid; @@ -79,6 +86,7 @@ select xtrsrc_id, r.runcatid, 0, 4, 0, 0 from temp_associations ta, runningcatalog r where ta.kind = 5 + and ta.image_id = [i] and r.parent_runcat_id = ta.runcat_id and r.first_xtrsrc_id = ta.xtrsrc_id union @@ -86,6 +94,7 @@ select xtrsrc_id, r.parent_runcat_id, 0, 4, 0, 0 from temp_associations ta, runningcatalog r where ta.kind = 5 + and ta.image_id = [i] and r.parent_runcat_id = ta.runcat_id and r.first_xtrsrc_id = ta.xtrsrc_id; @@ -98,12 +107,13 @@ select r.runcatid, i.band, 1, images i, runningcatalog r, temp_associations ta - where e.image_id = {0} + where e.image_id = [i] and i.imageid = e.image_id and r.first_xtrsrc_id = e.xtrsrcid and r.band is not null --this is not a cross-band source and ta.runcat_id = r.parent_runcat_id and ta.xtrsrc_id = e.xtrsrcid + and ta.image_id = [i] and ta.kind = 5; update runningcatalog @@ -112,6 +122,11 @@ update runningcatalog where a.runcat_id = runningcatalog.runcatid), $$get_column_update_total(['ra', 'decl', 'g_minor', 'g_major', 'g_pa'])$$ where not deleted + and exists (select ta.kind + from temp_associations ta + where ta.runcat_id = runningcatalog.runcatid + and ta.image_id = [i] + and ta.kind = 5) and source_kind = 4; update runningcatalog @@ -119,4 +134,9 @@ update runningcatalog last_update_date = current_timestamp, source_kind = 1 where not deleted + and exists (select ta.kind + from temp_associations ta + where ta.runcat_id = runningcatalog.runcatid + and ta.image_id = [i] + and ta.kind = 5) and source_kind = 4; diff --git a/CEP/GSM/bremen/src/sqllist_new.sql b/CEP/GSM/bremen/src/sqllist_new.sql index 05b6a9f99ac48dcd8a6f81dc13cf0f69b2e5b432..c0f397cf74a00242488e1e77783a120b4cba6d52 100644 --- a/CEP/GSM/bremen/src/sqllist_new.sql +++ b/CEP/GSM/bremen/src/sqllist_new.sql @@ -7,11 +7,12 @@ select e.xtrsrcid, 1, zone, $$get_column_insert_values(['ra', 'decl'])$$, x, y, z, 0, healpix_zone from extractedsources e - where image_id = {0} + where image_id = [i] and source_kind = 0 and not exists (select x.xtrsrc_id from temp_associations x - where x.xtrsrc_id = e.xtrsrcid) + where x.xtrsrc_id = e.xtrsrcid + and x.image_id = [i]) and e.xtrsrcid2 is null order by e.xtrsrcid; @@ -27,7 +28,8 @@ select i.band, i.stokes, e.xtrsrcid, 1, zone, from extractedsources e, images i, temp_associations ta - where e.image_id = {0} + where e.image_id = [i] + and ta.image_id = [i] and i.imageid = e.image_id and e.source_kind = 1 and e.xtrsrcid = ta.xtrsrc_id @@ -47,7 +49,8 @@ select i.band, i.stokes, e.xtrsrcid, 1, zone, from extractedsources e, images i, temp_associations ta - where e.image_id = {0} + where e.image_id = [i] + and ta.image_id = [i] and i.imageid = e.image_id and e.source_kind = 1 and e.xtrsrcid = ta.xtrsrc_id @@ -57,6 +60,7 @@ select i.band, i.stokes, e.xtrsrcid, 1, zone, from temp_associations tb where tb.xtrsrc_id = ta.xtrsrc_id and tb.kind = 2 + and tb.image_id = [i] ) order by e.xtrsrcid; @@ -70,12 +74,13 @@ select e.xtrsrcid, 1, zone, $$get_column_insert_values(['ra', 'decl', 'g_minor', 'g_major','g_pa'])$$, x, y, z, 1, null, healpix_zone from extractedsources e - where image_id = {0} + where image_id = [i] and source_kind = 1 and xtrsrcid2 is null and not exists (select x.xtrsrc_id from temp_associations x - where x.xtrsrc_id = e.xtrsrcid) + where x.xtrsrc_id = e.xtrsrcid + and x.image_id = [i]) order by e.xtrsrcid; insert into runningcatalog(band, stokes, first_xtrsrc_id, datapoints, decl_zone, @@ -88,8 +93,8 @@ select i.band, i.stokes, e.xtrsrcid, 1, zone, from extractedsources e, images i, runningcatalog r - where e.image_id = {0} - and i.imageid = {0} + where e.image_id = [i] + and i.imageid = [i] and e.source_kind = 1 and r.source_kind = 1 and e.xtrsrcid = r.first_xtrsrc_id @@ -97,7 +102,8 @@ select i.band, i.stokes, e.xtrsrcid, 1, zone, and not r.deleted and not exists (select x.xtrsrc_id from temp_associations x - where x.xtrsrc_id = e.xtrsrcid) + where x.xtrsrc_id = e.xtrsrcid + and x.image_id = [i]) order by e.xtrsrcid; --associate new extended sources and new point sources @@ -106,17 +112,19 @@ insert into assocxtrsources(xtrsrc_id, runcat_id, distance_arcsec, lr_method, select r.first_xtrsrc_id, r.runcatid, 0.0, 0, 0.0, 0.0 from runningcatalog r, extractedsources e - where e.image_id = {0} + where e.image_id = [i] and e.xtrsrcid = r.first_xtrsrc_id and not exists (select x.xtrsrc_id from temp_associations x - where x.xtrsrc_id = e.xtrsrcid) + where x.xtrsrc_id = e.xtrsrcid + and x.image_id = [i]) union select r.first_xtrsrc_id, r.runcatid, 0.0, 0, 0.0, 0.0 from runningcatalog r, extractedsources e, temp_associations ta - where e.image_id = {0} + where e.image_id = [i] + and ta.image_id = [i] and e.xtrsrcid = r.first_xtrsrc_id and ta.xtrsrc_id = e.xtrsrcid and not r.deleted @@ -132,7 +140,7 @@ select r.runcatid, i.band, r.datapoints, from extractedsources e, images i, runningcatalog r - where e.image_id = {0} + where e.image_id = [i] and i.imageid = e.image_id and r.first_xtrsrc_id = e.xtrsrcid and not r.deleted diff --git a/CEP/GSM/bremen/src/sqllist_update.sql b/CEP/GSM/bremen/src/sqllist_update.sql index da6896fee1ca243fc192056767d703e61f58b7e2..518d5556edc65949831ea2a13016eb3b98bf61dc 100644 --- a/CEP/GSM/bremen/src/sqllist_update.sql +++ b/CEP/GSM/bremen/src/sqllist_update.sql @@ -4,7 +4,7 @@ insert into runningcatalog_fluxes(runcat_id, band, datapoints, avg_wf_peak, avg_weight_f_peak, wm_f_int, wm_f_int_err, avg_wf_int, avg_weight_f_int) -select a.runcat_id, {1}, 1, +select a.runcat_id, [b], 1, e.f_peak, e.f_peak_err, e.f_peak/(e.f_peak_err*e.f_peak_err), 1/(e.f_peak_err*e.f_peak_err), e.f_int, e.f_int_err, @@ -16,6 +16,7 @@ select a.runcat_id, {1}, 1, where a.xtrsrc_id = e.xtrsrcid and ta.xtrsrc_id = a.xtrsrc_id and ta.runcat_id = a.runcat_id + and ta.image_id = [i] and ta.kind <> 4 and i.imageid = e.image_id and not exists (select f.band @@ -24,7 +25,7 @@ select a.runcat_id, {1}, 1, and f.band = i.band and f.stokes = i.stokes) and ta.lr_method = 1 - and e.image_id = {0}; + and e.image_id = [i]; --#update runningcatalog @@ -38,7 +39,7 @@ update runningcatalog and runningcatalog.runcatid = a.runcat_id and runningcatalog.group_head_id is null and runningcatalog.source_kind = 0 - and e.image_id = {0}; + and e.image_id = [i]; --#update runningcatalog extended update runningcatalog @@ -53,7 +54,7 @@ update runningcatalog and r.runcatid = a.runcat_id and r.group_head_id is null and r.source_kind <> 0 - and e.image_id = {0} + and e.image_id = [i] group by runcatid) as y where y.runcatid = runningcatalog.runcatid; @@ -70,7 +71,7 @@ update runningcatalog where a.xtrsrc_id = e.xtrsrcid and runningcatalog.runcatid = a.runcat_id and runningcatalog.group_head_id is null - and e.image_id = {0}); + and e.image_id = [i]); --#update runningcatalog_fluxes @@ -85,8 +86,8 @@ update runningcatalog_fluxes runningcatalog_fluxes f where a.xtrsrc_id = e.xtrsrcid and f.runcat_id = a.runcat_id - and e.image_id = {0} - and e.image_id = i.imageid + and e.image_id = [i] + and i.imageid = [i] and a.lr_method <> 5 --not a group association and f.band = i.band and f.stokes = i.stokes diff --git a/CEP/GSM/bremen/src/unifiedConnection.py b/CEP/GSM/bremen/src/unifiedConnection.py index 4e32e0b5f9a1bfb65ded18f542b8a4a84bab6574..f490caee0b3bc1140213940799efb930988e3e57 100644 --- a/CEP/GSM/bremen/src/unifiedConnection.py +++ b/CEP/GSM/bremen/src/unifiedConnection.py @@ -82,6 +82,7 @@ class UnifiedConnection(object): query = query + ';' try: self.start() + self.log.debug(query.replace('\n', ' ')) result = cursor.execute(query) except Exception as oerr: self.log.error(query.replace('\n', ' ')) @@ -166,7 +167,7 @@ class UnifiedConnection(object): """ Proper procedure call (for Monet/Postgres compatibility.) """ - self.conn.execute('call %s' % procname) + self.execute('call %s' % procname) def cursor(self): """ diff --git a/CEP/GSM/bremen/tests/bbsfiletest.py b/CEP/GSM/bremen/tests/bbsfiletest.py index c4031e96e98d9e6e882c31f8675408d4d8fbccfb..6887051962845572a6a8980d910e65bd77d9e65b 100644 --- a/CEP/GSM/bremen/tests/bbsfiletest.py +++ b/CEP/GSM/bremen/tests/bbsfiletest.py @@ -15,11 +15,11 @@ class BBSFileTest(SwitchableTest): self.conn = self.cm.get_connection() def test_first_file(self): - xfile = GSMBBSFileSource('test', 'tests/data/new_field.dat', 'test') + xfile = GSMBBSFileSource('test', 0, 'tests/data/new_field.dat', 'test') self.assertTrue(xfile.read_and_store_data(self.conn)) def test_full(self): - xfile = GSMBBSFileSource('test', 'tests/data/full_file.dat') + xfile = GSMBBSFileSource('test', 0, 'tests/data/full_file.dat') self.assertTrue(xfile.read_and_store_data(self.conn)) g_major =self.conn.exec_return('select g_major ' \ 'from detections where lra < 123.0;') @@ -29,19 +29,16 @@ class BBSFileTest(SwitchableTest): self.assertEqual(g_major, 0.101701) def test_full2(self): - xfile = GSMBBSFileSource('test', 'tests/data_extended/field_ext.dat') + xfile = GSMBBSFileSource('test', 0, 'tests/data_extended/field_ext.dat') self.assertTrue(xfile.read_and_store_data(self.conn)) def test_wrong_default(self): - with self.assertRaises(SourceException): - xfile = GSMBBSFileSource('test', 'tests/data/bad_file.dat') - xfile.read_and_store_data(self.conn) + xfile = GSMBBSFileSource('test', 0, 'tests/data/bad_file.dat') + self.assertRaises(SourceException, xfile.read_and_store_data, self.conn) def test_wrong_test(self): - with self.assertRaises(SourceException): - xfile = GSMBBSFileSource('test', 'tests/data/bbs_field.dat', 'test') - self.assertTrue(xfile.read_and_store_data(self.conn)) - + xfile = GSMBBSFileSource('test', 0, 'tests/data/bbs_field.dat', 'test') + self.assertRaises(SourceException, xfile.read_and_store_data, self.conn) def tearDown(self): self.conn.execute("delete from detections;") diff --git a/CEP/GSM/bremen/tests/gsmconnection.py b/CEP/GSM/bremen/tests/gsmconnection.py index fddd1c963b2f22b48b5257756551e61235834bdb..b1690a149ced483e08898500d4ba16e303f1d8bf 100644 --- a/CEP/GSM/bremen/tests/gsmconnection.py +++ b/CEP/GSM/bremen/tests/gsmconnection.py @@ -19,18 +19,16 @@ class ConnectionTest(SwitchableTest): self.assertTrue(conn.established()) def test_fail_connection(self): - with self.assertRaises((MonetDatabaseError, - psycopg2.OperationalError)): - self.cm.get_connection(database='test_nonexistent', - username='test1', - password='test1') + self.assertRaises((MonetDatabaseError, psycopg2.OperationalError), + self.cm.get_connection, database='test_nonexistent', + username='test1', + password='test1') def test_bad_sql(self): conn = self.cm.get_connection(database='test') self.assertTrue(conn.established()) - with self.assertRaises((MonetDatabaseError, - psycopg2.DatabaseError)): - conn.execute('select abracadabra from xxxtable;') + self.assertRaises((MonetDatabaseError, psycopg2.DatabaseError), + conn.execute, 'select abracadabra from xxxtable;') conn.rollback() bad_sql = """update assocxtrsources set weight = weight*(select ta.flux_fraction @@ -53,8 +51,7 @@ class ConnectionTest(SwitchableTest): and ta.lr_method = 1 and ta.kind = 3);""" if self.is_monet: - with self.assertRaises(MonetDatabaseError): - conn.execute(bad_sql) + self.assertRaises(MonetDatabaseError, conn.execute, bad_sql) self.assertFalse(conn.established()) def test_store_properties(self): diff --git a/CEP/GSM/bremen/tests/parset.py b/CEP/GSM/bremen/tests/parset.py index d730ebb53147cec632044a184a0d2373b6ff0dd4..be177ee82ad9d18389d010730612c792020cbed0 100644 --- a/CEP/GSM/bremen/tests/parset.py +++ b/CEP/GSM/bremen/tests/parset.py @@ -1,11 +1,11 @@ #!/usr/bin/python import unittest from src.errors import ParsetContentError, SourceException, GSMException -#from src.bbsfilesource import GSMBBSFileSource from src.gsmparset import GSMParset from src.gsmconnectionmanager import GSMConnectionManager from tests.switchable import SwitchableTest + class ParsetTest(SwitchableTest): def test_sample_parset(self): parset = GSMParset('tests/sample.parset') @@ -13,13 +13,12 @@ class ParsetTest(SwitchableTest): self.assertEquals(loaded, 22) def test_missing_parset(self): - with self.assertRaises(GSMException): - _ = GSMParset('tests/nonexists.parset') + self.assertRaises(GSMException, GSMParset, 'tests/nonexists.parset') def test_wrong_parset(self): - with self.assertRaises(ParsetContentError): - parset = GSMParset('tests/wrong1.parset') - loaded = parset.process(self.cm.get_connection(database='test')) - with self.assertRaises(SourceException): - parset = GSMParset('tests/wrong2.parset') - _ = parset.process(self.cm.get_connection(database='test')) + parset = GSMParset('tests/wrong1.parset') + self.assertRaises(ParsetContentError, parset.process, + self.cm.get_connection(database='test')) + parset = GSMParset('tests/wrong2.parset') + self.assertRaises(SourceException, parset.process, + self.cm.get_connection(database='test')) diff --git a/CEP/GSM/bremen/tests/pipeline_extended.py b/CEP/GSM/bremen/tests/pipeline_extended.py index add5d2942b6d2c4c3abec928ed908a33f9b359ab..a42f9605f5dc53f1b7d698b7c3fe12e8df44462f 100644 --- a/CEP/GSM/bremen/tests/pipeline_extended.py +++ b/CEP/GSM/bremen/tests/pipeline_extended.py @@ -9,8 +9,11 @@ from tests.tempparset import TempParset from tests.pipelinegeneral import PipelineGeneralTest class PipelineExtendedTest(PipelineGeneralTest): + PARSET_EXTRAS = {'pointing_ra': 0.0, + 'pointing_decl': 0.0, + 'beam_size': 1.0 } def run_series_part(self, x, band='150000000'): - parset = TempParset('data_extended/series%s.dat' % x, band) + parset = TempParset('data_extended/series%s.dat' % x, band, **self.PARSET_EXTRAS) self.pipeline.run_parset(parset) self.assertEquals(parset.source_count, 1) diff --git a/CEP/GSM/bremen/tests/spectra.py b/CEP/GSM/bremen/tests/spectra.py index edf9fd1f9a3f748fcf2c53b159c0fe319677f2bf..d8d07513f32ba8133c1286f3278b6bed4262153e 100644 --- a/CEP/GSM/bremen/tests/spectra.py +++ b/CEP/GSM/bremen/tests/spectra.py @@ -1,7 +1,7 @@ #!/usr/bin/python import unittest from math import log10, pow -from numpy.polynomial.polynomial import polyval +from src.spectra import polyval from numpy.testing import assert_array_almost_equal from stress.generator import FREQUENCY from src.gsmconnectionmanager import GSMConnectionManager diff --git a/CEP/GSM/bremen/tests/tempparset.py b/CEP/GSM/bremen/tests/tempparset.py index 42fa1f8019a828f72fb2279536c51263cc7a5c6f..53d03cc2fa08e2f0d58be6625ab49caad5d15e75 100644 --- a/CEP/GSM/bremen/tests/tempparset.py +++ b/CEP/GSM/bremen/tests/tempparset.py @@ -6,7 +6,7 @@ from src.gsmparset import GSMParset class TempParset(GSMParset): """ """ - def __init__(self, datafilename, freq): + def __init__(self, datafilename, freq, **extras): """ """ self.filename = datafilename @@ -14,7 +14,9 @@ class TempParset(GSMParset): self.data = {'image_id': datafilename, 'source_lists': datafilename, 'frequency': freq} + self.data.update(extras) self.parset_id = self.data.get('image_id') self.image_id = None # Not yet known. self.source_count = None self.log = get_gsm_logger('parsets', 'test.log') + self.recalculate_pointing = False diff --git a/CEP/GSM/bremen/tests/testlib.py b/CEP/GSM/bremen/tests/testlib.py index ee254d69dc678c51846526775a89dbd69d8b6e4a..6d9bff89f3671539be749f1e60342568e5c86281 100644 --- a/CEP/GSM/bremen/tests/testlib.py +++ b/CEP/GSM/bremen/tests/testlib.py @@ -54,6 +54,8 @@ def cleanup_db(conn): 'runningcatalog', 'temp_associations', 'images', + 'image_stats', + 'runs', 'extractedsources', 'detections']: if isinstance(conn, MonetConnection): @@ -63,6 +65,7 @@ def cleanup_db(conn): for seq in ['seq_datasets', 'seq_images', + 'seq_runs', 'seq_runningcatalog']: conn._execute_with_cursor('alter sequence %s restart with 1;' % seq, cursor) conn._execute_with_cursor('alter sequence seq_extractedsources restart with 1001;', cursor) diff --git a/CEP/GSM/bremen/tests/utils.py b/CEP/GSM/bremen/tests/utils.py index 3d1e9f3ca18c815f021de629eabe7ac8b437e0b1..7fcfe4320846f9412a8fc3374b124ee2b839e3b1 100644 --- a/CEP/GSM/bremen/tests/utils.py +++ b/CEP/GSM/bremen/tests/utils.py @@ -1,8 +1,13 @@ #!/usr/bin/python import unittest +import sys from src.queries import get_svn_version, makelistable class UtilsTest(unittest.TestCase): + if sys.version_info < (2, 7): + def assertIsInstance(self, par1, par2): + self.assertTrue(isinstance(par1, par2)) + def test_svn(self): self.assertIsInstance(get_svn_version(), int) diff --git a/CEP/Imager/LofarFT/src/CMakeLists.txt b/CEP/Imager/LofarFT/src/CMakeLists.txt index f52729c0ecb898b05cdc277226074d714d7f53bd..d75b3284917165126be16ad472a76e20e2f10cd9 100644 --- a/CEP/Imager/LofarFT/src/CMakeLists.txt +++ b/CEP/Imager/LofarFT/src/CMakeLists.txt @@ -25,6 +25,7 @@ lofar_add_bin_program(versionlofarft versionlofarft.cc) lofar_add_bin_program(awimager awimager.cc) lofar_add_bin_program(makefftwisdom2d makefftwisdom2d.cc) lofar_add_bin_program(fillRootImageGroup fillRootImageGroup.cc) +lofar_add_bin_program(makebeamimage makebeamimage.cc) install(PROGRAMS addImagingInfo diff --git a/CEP/Imager/LofarFT/src/fillRootImageGroup.cc b/CEP/Imager/LofarFT/src/fillRootImageGroup.cc index 7e34089181612bcf1039d61d264e14b083537331..93893cc485626d3b88e4bda17879336dda0b21ce 100644 --- a/CEP/Imager/LofarFT/src/fillRootImageGroup.cc +++ b/CEP/Imager/LofarFT/src/fillRootImageGroup.cc @@ -25,6 +25,8 @@ //# //# $Id$ +#include <lofar_config.h> + #include <casa/Containers/Record.h> #include <casa/HDF5/HDF5File.h> #include <casa/HDF5/HDF5Group.h> diff --git a/CEP/Imager/LofarFT/src/makebeamimage.cc b/CEP/Imager/LofarFT/src/makebeamimage.cc new file mode 100644 index 0000000000000000000000000000000000000000..b587ae4c3ae8ef873cdbb2a5bdd783b8622edd1c --- /dev/null +++ b/CEP/Imager/LofarFT/src/makebeamimage.cc @@ -0,0 +1,246 @@ +//# makebeamimage.cc: Generate images of the beam response of multiple stations +//# for a given MS. +//# +//# Copyright (C) 2011 +//# Associated Universities, Inc. Washington DC, USA. +//# +//# This program is free software; you can redistribute it and/or modify it +//# under the terms of the GNU General Public License as published by the Free +//# Software Foundation; either version 2 of the License, or (at your option) +//# any later version. +//# +//# This program is distributed in the hope that it will be useful, but WITHOUT +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//# more details. +//# +//# You should have received a copy of the GNU General Public License along +//# with this program; if not, write to the Free Software Foundation, Inc., +//# 675 Massachusetts Ave, Cambridge, MA 02139, USA. +//# +//# Correspondence concerning AIPS++ should be addressed as follows: +//# Internet email: aips2-request@nrao.edu. +//# Postal address: AIPS++ Project Office +//# National Radio Astronomy Observatory +//# 520 Edgemont Road +//# Charlottesville, VA 22903-2475 USA +//# +//# $Id$ + +#include <lofar_config.h> +#include <LofarFT/Exceptions.h> +#include <LofarFT/LofarConvolutionFunction.h> +#include <LofarFT/Package__Version.h> +#include <Common/InputParSet.h> +#include <Common/LofarLogger.h> +#include <Common/SystemUtil.h> + +#include <images/Images/PagedImage.h> +#include <images/Images/HDF5Image.h> +#include <images/Images/ImageFITSConverter.h> + +#include <ms/MeasurementSets/MSAntenna.h> +#include <ms/MeasurementSets/MSAntennaParse.h> +#include <ms/MeasurementSets/MSAntennaColumns.h> +#include <ms/MeasurementSets/MSDataDescription.h> +#include <ms/MeasurementSets/MSDataDescColumns.h> +#include <ms/MeasurementSets/MSField.h> +#include <ms/MeasurementSets/MSFieldColumns.h> +#include <ms/MeasurementSets/MSObservation.h> +#include <ms/MeasurementSets/MSObsColumns.h> +#include <ms/MeasurementSets/MSPolarization.h> +#include <ms/MeasurementSets/MSPolColumns.h> +#include <ms/MeasurementSets/MSSpectralWindow.h> +#include <ms/MeasurementSets/MSSpWindowColumns.h> +#include <ms/MeasurementSets/MSSelection.h> + +#include <measures/Measures/MDirection.h> +#include <measures/Measures/MEpoch.h> + +#include <casa/Arrays/ArrayUtil.h> +#include <casa/Arrays/ArrayMath.h> +#include <casa/Arrays/ArrayIter.h> +#include <casa/Utilities/Regex.h> +#include <casa/Utilities/Assert.h> +#include <casa/OS/Directory.h> +#include <casa/OS/File.h> +#include <casa/Exceptions/Error.h> +#include <casa/OS/Timer.h> +#include <casa/OS/PrecTimer.h> +#include <casa/iostream.h> +#include <casa/sstream.h> + +using namespace casa; +using namespace LOFAR; +using LOFAR::operator<<; + +Quantity readQuantity (const String& in) +{ + Quantity res; + if (!Quantity::read(res, in)) { + THROW(AWImagerException, in + " is an illegal quantity"); + } + return res; +} + +int main(int argc, char *argv[]) +{ + TEST_SHOW_VERSION(argc, argv, LofarFT); + INIT_LOGGER(basename(string(argv[0]))); + Version::show<LofarFTVersion>(cout); + + LOFAR::InputParSet inputs; + inputs.create("ms", "", "Name of input MeasurementSet", "string"); + inputs.create("stations", "[0]", "IDs of stations to process", + "int vector"); + inputs.create("cellsize", "60arcsec", "Angular pixel size", + "quantity string"); + inputs.create("size", "256", "Number of pixels along each axis", "int"); + inputs.create("offset", "0s", "Time offset from the start of the MS", + "quantity string"); + inputs.create("frames", "0", "Number of images that will be generated for" + " each station (equally spaced over the duration of the MS)", "int"); + inputs.create("abs", "false", "If set to true, store the absolute value of" + " the beam response instead of the complex value (intended for use with" + " older versions of casaviewer)", "bool"); + inputs.readArguments(argc, argv); + + String msName = inputs.getString("ms"); + if(msName.empty()) + { + THROW(AWImagerException, "An MS name must be provided, for example:" + " ms=test.ms"); + } + + vector<int> stationID(inputs.getIntVector("stations")); + Quantity cellsize = readQuantity(inputs.getString("cellsize")); + size_t size = max(inputs.getInt("size"), 1); + Quantity offset = readQuantity(inputs.getString("offset")); + size_t nFrames = max(inputs.getInt("frames"), 1); + Bool abs = inputs.getBool("abs"); + + // ---------------------------------------------------------------------- // + + MeasurementSet ms(msName); + + uInt idObservation = 0; + uInt idField = 0; + uInt idDataDescription = 0; + + // Read number of stations. + ROMSAntennaColumns antenna(ms.antenna()); + uInt nStation = antenna.nrow(); + + // Filter invalid station IDs. + vector<unsigned int> filteredID; + for(vector<int>::const_iterator it = stationID.begin(), + end = stationID.end(); it != end; ++it) + { + if(*it >= 0 && static_cast<size_t>(*it) < nStation) + { + filteredID.push_back(*it); + } + } + + // Read phase reference direction. + ROMSFieldColumns field(ms.field()); + ASSERT(field.nrow() > idField); + ASSERT(!field.flagRow()(idField)); + MDirection refDir = field.phaseDirMeas(idField); + + // Read reference frequency. + ROMSDataDescColumns desc(ms.dataDescription()); + ASSERT(desc.nrow() > idDataDescription); + ASSERT(!desc.flagRow()(idDataDescription)); + uInt idWindow = desc.spectralWindowId()(idDataDescription); + + ROMSSpWindowColumns window(ms.spectralWindow()); + ASSERT(window.nrow() > idWindow); + ASSERT(!window.flagRow()(idWindow)); + + double refFreq = window.refFrequency()(idWindow); + + // Read reference time. + Table msView = + ms(ms.col("OBSERVATION_ID") == static_cast<Int>(idObservation) + && ms.col("FIELD_ID") == static_cast<Int>(idField) + && ms.col("DATA_DESC_ID") == static_cast<Int>(idDataDescription)); + + Table tab_sorted = msView.sort("TIME", Sort::Ascending, + Sort::HeapSort | Sort::NoDuplicates); + + ROScalarColumn<Double> c_time(tab_sorted, "TIME"); + Vector<Double> time = c_time.getColumn(); + + // ---------------------------------------------------------------------- // + + MDirection refDirJ2000(MDirection::Convert(refDir, MDirection::J2000)()); + Quantum<Vector<Double> > angles = refDirJ2000.getAngle(); + + double ra = angles.getBaseValue()(0); + double dec = angles.getBaseValue()(1); + double delta = cellsize.getValue("rad"); + + // Construct DirectionCoordinate instance. + Matrix<Double> xform(2,2); + xform = 0.0; xform.diagonal() = 1.0; + DirectionCoordinate coordinates(MDirection::J2000, + Projection(Projection::SIN), + ra, dec, + -delta, delta, + xform, + size / 2, size / 2); + + // ---------------------------------------------------------------------- // + + LofarATerm aTerm(ms, Record()); + + IPosition shape(2, size, size); + aTerm.setDirection(coordinates, shape); + + Vector<Double> freq(1, refFreq); + + Quantity refTime(time(0), "s"); + refTime = refTime + offset; + + Quantity deltaTime((time(time.size() - 1) - time(0) - offset.getValue("s")) + / (nFrames - 1), "s"); + + cout << "computing..." << flush; + for(size_t j = 0; j < nFrames; ++j) + { + MEpoch refEpoch; + refEpoch.set(refTime); + aTerm.setEpoch(refEpoch); + refTime = refTime + deltaTime; + + for(vector<unsigned int>::const_iterator it = filteredID.begin(), + end = filteredID.end(); it != end; ++it) + { + vector<Cube<Complex> > response = aTerm.evaluate(*it, freq, freq); + + std::ostringstream oss; + oss << "beam-id-" << *it; + if(nFrames > 1) + { + oss << "-frame-" << j; + } + oss << ".img"; + + if(abs) + { + Cube<Float> ampl(amplitude(response[0])); + store(coordinates, ampl, oss.str()); + } + else + { + store(coordinates, response[0], oss.str()); + } + } + + cout << "." << flush; + } + cout << " done." << endl; + + return 0; +} diff --git a/CEP/LMWCommon/src/cexecms b/CEP/LMWCommon/src/cexecms index b6be7ec9103122108afec22094a4f6a9e111bb72..a1419b49d91f90d25978223398c05e523c14b13d 100755 --- a/CEP/LMWCommon/src/cexecms +++ b/CEP/LMWCommon/src/cexecms @@ -8,15 +8,16 @@ showhelp() { echo '' echo ' cexecms runs a command or script on cluster nodes for files matching the' - echo ' given file name glob pattern. Placeholders in command or script are' - echo ' replaced by the actual file name.' + echo ' given file name glob pattern. Placeholders in the command or script are' + echo ' replaced by the actual file name parts.' echo '' echo ' usage:' echo ' cexecms [-c cluster] [-d] [-s script] [-w workdir] command nameglob [arg1 arg2 ...]' echo '' echo ' -c cluster Cluster name as defined for cexec.' - echo ' default is lce: if run on an lfe node,' - echo ' test: if run on lce072, otherwise locus:' + echo ' default is lce: if run on an lfe node' + echo ' test: if run on lce072' + echo ' locus: otherwise' echo ' -d Do a dryrun.' echo ' (do not execute, but only print the command/script)' echo ' -i ids List of ids to replace <ID> in the nameglob argument.' @@ -31,9 +32,12 @@ showhelp() echo ' command Command to be executed remotely.' echo ' Quotes are needed if it contains spaces, etc.' echo ' Placeholders (like <FN>) in the command are replaced.' - echo ' nameglob File name glob pattern (# is a shorthand for [0-9]).' + echo ' nameglob File name glob pattern to find matching files' + echo ' # can be used as a shorthand for [0-9].' echo ' E.g., one can use SB### meaning any subband.' - echo ' arg1 arg2 .. Optional extra arguments to be given to command.' + echo ' The pattern can contain the placeholder <ID> as explained' + echo ' above in the -i option.' + echo ' arg1 arg2 .. Optional extra arguments to be given to the command.' echo '' echo ' Using cexec, the script cexecms-part is executed on the given cluster' echo ' nodes. It looks for files matching the given file name glob pattern.' @@ -46,6 +50,12 @@ showhelp() echo ' <DIRNAME> or <DN> for the directory part' echo ' The first two can be followed by a . (e.g. <FN.>) meaning that the' echo ' basename is used till the first dot (thus the extension is removed.)' + echo ' Similarly, <.BN> gives the extension (thus after the first dot).' + echo ' For standard LOFAR file names the following placeholders can also be used:' + echo ' <OBSID> for the obsid part of <BN.> (till first _)' + echo ' <SAP> for the subarray pointing part of <BN.> (till next _)' + echo ' <SB> for the subband part of <BN.> (till next _)' + echo ' <TYPE> for the dataset type part of <BN.> (after last _)' echo '' echo ' If -s is given, the command is executed like:' echo ' command script arg1 arg2 ..' @@ -68,7 +78,7 @@ showhelp() echo ' Also note that (t)csh requires a ! to be escaped with a backslash.' echo '' echo ' Sometimes a command can be dangerous or take a long time to run.' - echo ' In such a case it makes sense to execute it first with the -d option.' + echo ' In such a case it makes sense to first do a dry-run execution with the -d option.' echo '' echo ' Note that the current environment (paths, etc.) is copied. You should' echo ' have done "use LofIm" if you need LofIm in the (remote) command.' diff --git a/CEP/LMWCommon/src/cexecms-part b/CEP/LMWCommon/src/cexecms-part index 48b7e9268cfd96e88e62336177175f971ac94d36..4f68ccce6a9531689e2c78e024ae273083a20368 100755 --- a/CEP/LMWCommon/src/cexecms-part +++ b/CEP/LMWCommon/src/cexecms-part @@ -11,6 +11,10 @@ # <BASENAME> or <BN> by the basename part # <DIRNAME> or <DN> by the directory part # The first two can be followed by a . meaning that the extension is ignored. +# <OBSID> by the obsid part of <BN.> (till first _) +# <SAP> by the subarray pointing part of <BN.> (till next _) +# <SB> by the subband part of <BN.> (till next _) +# <TYPE> by the dataset type part of <BN.> (after last _) # If no substitutions are done, the command is executed like # command filename arg1 arg2 ... # otherwise like @@ -125,10 +129,15 @@ command=`echo "$command" | sed \ for fname in $names do # Form the various placeholder replacements. - dname=`dirname $fname` # directory - bname=`basename $fname` # basename - bnamed=`echo $bname | sed -e 's%\..*%%'` # basename without extension - fnamed=$dname/$bnamed # full name without extension + dname=`dirname $fname` # directory + bname=`basename $fname` # basename + bnamed=`echo $bname | sed -e 's%\..*%%'` # basename without extension + fnamed=$dname/$bnamed # full name without extension + ename=`echo $bname | sed -e "s%$bnamed\.%%"` # extension + obsid=`echo $bnamed | awk -F_ '{print $1}'` + sap=`echo $bnamed | awk -F_ '{print $2}'` + sb=`echo $bnamed | awk -F_ '{print $3}'` + type=`echo $bnamed | awk -F_ '{print $4}'` # Replace the placeholders. commandnew=`echo "$command" | sed \ -e "s%<FN>%$fname%g" \ @@ -137,12 +146,18 @@ do -e "s%<FN\.>%$fnamed%g" \ -e "s%<DN\.>%$dnamed%g" \ -e "s%<BN\.>%$bnamed%g" \ + -e "s%<\.BN>%$ename%g" \ -e "s%<FILENAME>%$fname%g" \ -e "s%<DIRNAME>%$dname%g" \ -e "s%<BASENAME>%$bname%g" \ -e "s%<FILENAME\.>%$fnamed%g" \ -e "s%<DIRNAME\.>%$dnamed%g" \ - -e "s%<BASENAME\.>%$bnamed%g"` + -e "s%<BASENAME\.>%$bnamed%g" \ + -e "s%<\.BASENAME>%$ename%g" \ + -e "s%<OBSID>%$obsid%g" \ + -e "s%<SAP>%$sap%g" \ + -e "s%<SB>%$sb%g" \ + -e "s%<TYPE>%$type%g"` if test "$script" != ""; then # A script is given, replace placeholders in there as well. psname=$HOME/`basename $script`-$USER-$$ @@ -153,12 +168,18 @@ do -e "s%<FN\.>%$fnamed%g" \ -e "s%<DN\.>%$dnamed%g" \ -e "s%<BN\.>%$bnamed%g" \ + -e "s%<\.BN>%$ename%g" \ -e "s%<FILENAME>%$fname%g" \ -e "s%<DIRNAME>%$dname%g" \ -e "s%<BASENAME>%$bname%g" \ -e "s%<FILENAME\.>%$fnamed%g" \ -e "s%<DIRNAME\.>%$dnamed%g" \ -e "s%<BASENAME\.>%$bnamed%g" \ + -e "s%<\.BASENAME>%$ename%g" \ + -e "s%<OBSID>%$obsid%g" \ + -e "s%<SAP>%$sap%g" \ + -e "s%<SB>%$sb%g" \ + -e "s%<TYPE>%$type%g" \ $script > $psname if test $dryrun = 1; then echo "Dryrun: " $commandnew $psname "$@" diff --git a/CEP/MS/test/CMakeLists.txt b/CEP/MS/test/CMakeLists.txt index e8148fe2d529c7c95c4d3b2b1a8b1ffa40788f74..f9dc314fdf70116cf5631dcbdae3c02c03612a27 100644 --- a/CEP/MS/test/CMakeLists.txt +++ b/CEP/MS/test/CMakeLists.txt @@ -22,4 +22,5 @@ lofar_add_test(tMSSplit tMSSplit.cc) lofar_add_test(tBaselineSelect tBaselineSelect.cc) lofar_add_test(tVdsMaker tVdsMaker.cc DEPENDS combinevds) lofar_add_test(tcombinevds DEPENDS combinevds) -lofar_add_test(tmakems DEPENDS getparsetvalue startdistproc finddproc socketrun) +lofar_add_test(tmakems + DEPENDS makems getparsetvalue finddproc startdistproc socketrun) diff --git a/CEP/Pipeline/deploy/fabfile.py b/CEP/Pipeline/deploy/deprecated/fabfile.py similarity index 100% rename from CEP/Pipeline/deploy/fabfile.py rename to CEP/Pipeline/deploy/deprecated/fabfile.py diff --git a/CEP/Pipeline/deploy/ipcontroller.sh b/CEP/Pipeline/deploy/deprecated/ipcontroller.sh similarity index 100% rename from CEP/Pipeline/deploy/ipcontroller.sh rename to CEP/Pipeline/deploy/deprecated/ipcontroller.sh diff --git a/CEP/Pipeline/deploy/ipengine.sh b/CEP/Pipeline/deploy/deprecated/ipengine.sh similarity index 100% rename from CEP/Pipeline/deploy/ipengine.sh rename to CEP/Pipeline/deploy/deprecated/ipengine.sh diff --git a/CEP/Pipeline/deploy/start_cluster.py b/CEP/Pipeline/deploy/deprecated/start_cluster.py similarity index 100% rename from CEP/Pipeline/deploy/start_cluster.py rename to CEP/Pipeline/deploy/deprecated/start_cluster.py diff --git a/CEP/Pipeline/deploy/stop_cluster.py b/CEP/Pipeline/deploy/deprecated/stop_cluster.py similarity index 100% rename from CEP/Pipeline/deploy/stop_cluster.py rename to CEP/Pipeline/deploy/deprecated/stop_cluster.py diff --git a/CEP/Pipeline/framework/lofarpipe/CMakeLists.txt b/CEP/Pipeline/framework/lofarpipe/CMakeLists.txt index f6e20c1a2faa0312d32d11454fbdda3d0f4d210f..1ac285fef5574a58a8bdfbc143ee8b1a638bd732 100644 --- a/CEP/Pipeline/framework/lofarpipe/CMakeLists.txt +++ b/CEP/Pipeline/framework/lofarpipe/CMakeLists.txt @@ -17,22 +17,18 @@ python_install( support/__init__.py support/baserecipe.py support/clusterdesc.py - support/clusterhandler.py - support/clusterlogger.py support/control.py support/group_data.py - support/ipython.py support/jobserver.py support/lofarexceptions.py support/lofaringredient.py support/lofarnode.py - support/lofarrecipe.py support/mac.py support/parset.py support/pipelinelogging.py support/pipelinexml.py support/remotecommand.py support/stateful.py - support/utilities.py support/subprocessgroup.py + support/utilities.py DESTINATION lofarpipe) diff --git a/CEP/Pipeline/framework/lofarpipe/cuisine/WSRTrecipe.py b/CEP/Pipeline/framework/lofarpipe/cuisine/WSRTrecipe.py index ea9b27cad4f6ae3483a585fca42859d0a4fa919b..e03ad0a7749647547c2d666d3f1f152b0c8cf881 100644 --- a/CEP/Pipeline/framework/lofarpipe/cuisine/WSRTrecipe.py +++ b/CEP/Pipeline/framework/lofarpipe/cuisine/WSRTrecipe.py @@ -138,7 +138,10 @@ class WSRTrecipe(object): ## confidence in return 1 else: - self.logger.info('recipe ' + name + ' completed') + if status == 0: + self.logger.info('recipe ' + name + ' completed') + else: + self.logger.warn('recipe ' + name + ' completed with errors') return status def get_run_info(self, filepath): diff --git a/CEP/Pipeline/framework/lofarpipe/support/clusterhandler.py b/CEP/Pipeline/framework/lofarpipe/support/deprecated/clusterhandler.py similarity index 100% rename from CEP/Pipeline/framework/lofarpipe/support/clusterhandler.py rename to CEP/Pipeline/framework/lofarpipe/support/deprecated/clusterhandler.py diff --git a/CEP/Pipeline/framework/lofarpipe/support/clusterlogger.py b/CEP/Pipeline/framework/lofarpipe/support/deprecated/clusterlogger.py similarity index 100% rename from CEP/Pipeline/framework/lofarpipe/support/clusterlogger.py rename to CEP/Pipeline/framework/lofarpipe/support/deprecated/clusterlogger.py diff --git a/CEP/Pipeline/framework/lofarpipe/support/ipython.py b/CEP/Pipeline/framework/lofarpipe/support/deprecated/ipython.py similarity index 100% rename from CEP/Pipeline/framework/lofarpipe/support/ipython.py rename to CEP/Pipeline/framework/lofarpipe/support/deprecated/ipython.py diff --git a/CEP/Pipeline/framework/lofarpipe/support/lofarrecipe.py b/CEP/Pipeline/framework/lofarpipe/support/deprecated/lofarrecipe.py similarity index 100% rename from CEP/Pipeline/framework/lofarpipe/support/lofarrecipe.py rename to CEP/Pipeline/framework/lofarpipe/support/deprecated/lofarrecipe.py diff --git a/CEP/Pipeline/framework/lofarpipe/support/group_data.py b/CEP/Pipeline/framework/lofarpipe/support/group_data.py index b30e79fb41f6081b39761c2cc2f8df037d476997..06af8ce7366463fd679beaa694d76a6be3a4540f 100644 --- a/CEP/Pipeline/framework/lofarpipe/support/group_data.py +++ b/CEP/Pipeline/framework/lofarpipe/support/group_data.py @@ -9,7 +9,6 @@ from collections import defaultdict import os import subprocess -from lofar.parameterset import parameterset from lofar.mstools import findFiles import lofarpipe.support.utilities as utilities @@ -17,44 +16,47 @@ from lofarpipe.support.clusterdesc import get_compute_nodes from lofarpipe.support.parset import Parset def group_files(logger, clusterdesc, node_directory, group_size, filenames): - """ - Group a list of files into blocks suitable for simultaneous - processing, such that a limited number of processes run on any given - host at a time. - - All node_directory on all compute nodes specified in clusterdesc is - searched for any of the files listed in filenames. A generator is - produced; on each call, no more than group_size files per node - are returned. - """ - # Given a limited number of processes per node, the first task is to - # partition up the data for processing. - logger.debug('Listing data on nodes') - data = {} - for node in get_compute_nodes(clusterdesc): - logger.debug("Node: %s" % (node)) - exec_string = ["ssh", node, "--", "find", - node_directory, - "-maxdepth 1", - "-print0" - ] - logger.debug("Executing: %s" % (" ".join(exec_string))) - my_process = subprocess.Popen(exec_string, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - sout, serr = my_process.communicate() - data[node] = sout.split('\x00') - data[node] = utilities.group_iterable( - [element for element in data[node] if element in filenames], - group_size, - ) - - # Now produce an iterator which steps through the various chunks of - # data to image, and image each chunk - data_iterator = utilities.izip_longest(*list(data.values())) - for data_chunk in data_iterator: - to_process = [] - for node_data in data_chunk: - if node_data: to_process.extend(node_data) - yield to_process + """ + Group a list of files into blocks suitable for simultaneous + processing, such that a limited number of processes run on any given + host at a time. + + All node_directory on all compute nodes specified in clusterdesc is + searched for any of the files listed in filenames. A generator is + produced; on each call, no more than group_size files per node + are returned. + """ + # Given a limited number of processes per node, the first task is to + # partition up the data for processing. + logger.debug('Listing data on nodes') + data = {} + for node in get_compute_nodes(clusterdesc): + logger.debug("Node: %s" % (node)) + exec_string = ["ssh", node, "--", "find", + node_directory, + "-maxdepth 1", + "-print0" + ] + logger.debug("Executing: %s" % (" ".join(exec_string))) + my_process = subprocess.Popen( + exec_string, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + sout = my_process.communicate()[0] + data[node] = sout.split('\x00') + data[node] = utilities.group_iterable( + [element for element in data[node] if element in filenames], + group_size, + ) + + # Now produce an iterator which steps through the various chunks of + # data to image, and image each chunk + data_iterator = utilities.izip_longest(*list(data.values())) + for data_chunk in data_iterator: + to_process = [] + for node_data in data_chunk: + if node_data: + to_process.extend(node_data) + yield to_process def gvds_iterator(gvds_file, nproc=4): """ @@ -134,13 +136,15 @@ def validate_data_maps(*args): # Check if all lists have equal length. We do this by creating a set # from a tuple of lenghts of `args`. The set must have length 1. - if len(set(len(arg) for arg in args)) != 1: return False + if len(set(len(arg) for arg in args)) != 1: + return False # Next, check if the data products in `args`, when matched by index, # reside on the same node. We can use the same trick as before, by # checking the size of a set created from a tuple of hostnames. for i in xrange(len(args[0])): - if len(set(arg[i][0] for arg in args)) != 1: return False + if len(set(arg[i][0] for arg in args)) != 1: + return False return True diff --git a/CEP/Pipeline/framework/lofarpipe/support/utilities.py b/CEP/Pipeline/framework/lofarpipe/support/utilities.py index 7bf619b5f99cc351a861de0ca9f5ffff08f2cf6a..32a827d0baa3bb2a9a6f0eed0419a7755ba3fd93 100644 --- a/CEP/Pipeline/framework/lofarpipe/support/utilities.py +++ b/CEP/Pipeline/framework/lofarpipe/support/utilities.py @@ -3,6 +3,8 @@ # Utility routines # John Swinbank, 2009-10 # swinbank@transientskp.org +# Marcel Loose, 2011-12 +# loose@astron.nl # ------------------------------------------------------------------------------ from __future__ import with_statement @@ -12,6 +14,7 @@ from itertools import islice, repeat, chain, izip from contextlib import closing, contextmanager from time import sleep from random import randint +import warnings import os import errno @@ -20,6 +23,22 @@ import subprocess from lofarpipe.support.pipelinelogging import log_process_output +def deprecated(func): + """ + This is a decorator which can be used to mark functions as deprecated. + It will result in a warning being emmitted when the function is used. + Ref.: http://code.activestate.com/recipes/391367-deprecated/ + """ + def new_func(*args, **kwargs): + warnings.warn("Call to deprecated function %s." % func.__name__, + category=DeprecationWarning, + stacklevel=2) + return func(*args, **kwargs) + new_func.__name__ = func.__name__ + new_func.__doc__ = func.__doc__ + new_func.__dict__.update(func.__dict__) + return new_func + # Compatibility # The following used to be defined in this module; # they are now included so as not to break existing code. diff --git a/CEP/Pipeline/recipes/sip/CMakeLists.txt b/CEP/Pipeline/recipes/sip/CMakeLists.txt index 45650061d70b9f910befdc23d4f295bed6109cdb..14e457a24138b9138e53e202da1d4a3d849c60cb 100644 --- a/CEP/Pipeline/recipes/sip/CMakeLists.txt +++ b/CEP/Pipeline/recipes/sip/CMakeLists.txt @@ -8,60 +8,37 @@ python_install( helpers/WritableParmDB.py helpers/ComplexArray.py master/__init__.py - master/bbs.py master/bbs_reducer.py - master/cep2_datamapper.py - master/cimager.py - master/compression_pipeline.py master/copier.py - master/count_timesteps.py - master/datamapper.py - master/demixing.py master/dppp.py - master/flag_baseline.py + master/gainoutliercorrection.py + master/get_metadata.py master/imager_awimager.py + master/imager_bbs.py master/imager_create_dbs.py master/imager_finalize.py master/imager_prepare.py - master/imager_bbs.py master/imager_source_finding.py - master/get_metadata.py - master/make_flaggable.py master/new_bbs.py - master/gainoutliercorrection.py master/rficonsole.py master/setupparmdb.py master/setupsourcedb.py - master/skymodel.py - master/storagemapper.py master/vdsmaker.py master/vdsreader.py nodes/__init__.py - nodes/bbs.py nodes/bbs_reducer.py - nodes/cimager.py nodes/copier.py - nodes/count_timesteps.py - nodes/demix/demixing.py nodes/demix/find_a_team.py - nodes/demix/median_filter.py - nodes/demix/shiftphasecenter.py - nodes/demix/smoothdemix.py - nodes/demix/subtract_from_averaged.py - nodes/demixing.py nodes/dppp.py - nodes/flag_baseline.py + nodes/gainoutliercorrection.py nodes/get_metadata.py - nodes/imager_create_dbs.py - nodes/make_flaggable.py - nodes/new_bbs.py - nodes/imager_bbs.py nodes/imager_awimager.py + nodes/imager_bbs.py nodes/imager_create_dbs.py nodes/imager_finalize.py nodes/imager_prepare.py nodes/imager_source_finding.py - nodes/gainoutliercorrection.py + nodes/new_bbs.py nodes/rficonsole.py nodes/setupparmdb.py nodes/setupsourcedb.py @@ -69,9 +46,11 @@ python_install( DESTINATION lofarpipe/recipes) install(PROGRAMS + bin/calibration_pipeline.py bin/msss_calibrator_pipeline.py bin/msss_imager_pipeline.py bin/msss_target_pipeline.py + bin/preprocessing_pipeline.py bin/startPython.sh external/bad_station_detection/asciistats.py external/bad_station_detection/statsplot.py diff --git a/CEP/Pipeline/recipes/sip/bin/calibration_pipeline.py b/CEP/Pipeline/recipes/sip/bin/calibration_pipeline.py new file mode 100644 index 0000000000000000000000000000000000000000..a469008c490315e3d56ea8982428fc11aa22b3b3 --- /dev/null +++ b/CEP/Pipeline/recipes/sip/bin/calibration_pipeline.py @@ -0,0 +1,236 @@ +#!/usr/bin/env python +# LOFAR CALIBRATION PIPELINE +# +# Calibration Pipeline recipe +# Marcel Loose, 2012 +# loose@astron.nl +# ------------------------------------------------------------------------------ + +import os +import sys + +from lofarpipe.support.control import control +from lofarpipe.support.group_data import validate_data_maps, tally_data_map +from lofarpipe.support.lofarexceptions import PipelineException +from lofarpipe.support.utilities import create_directory +from lofar.parameterset import parameterset + +class calibration_pipeline(control): + """ + The calibration pipeline can be used to pre-process raw UV-data (i.e. + average in time and frequency, flag RFI, and demix strong A-team sources), + and to calibrate these data using a user-supplied sky model. + + This pipeline will perform the following operations: + + 1. Prepare phase, collect data from parset and input mapfiles. + 2. Create VDS-file; it will contain important input-data for NDPPP + 3. Average and flag data, and demix A-team sources using NDPPP. + 4. Create a sourcedb from the user-supplied sky model, and an empty parmdb. + 5. Run BBS to calibrate the data. + """ + + def __init__(self): + super(calibration_pipeline, self).__init__() + self.parset = parameterset() + self.input_data = [] + self.output_data = [] + self.io_data_mask = [] + self.parset_feedback_file = None + + + def usage(self): + """ + Display usage + """ + print >> sys.stderr, "Usage: %s [options] <parset-file>" % sys.argv[0] + return 1 + + + def _get_io_product_specs(self): + """ + Get input- and output-data product specifications from the + parset-file, and do some sanity checks. + """ + dataproducts = self.parset.makeSubset( + self.parset.fullModuleName('DataProducts') + '.' + ) + self.input_data = [ + tuple(os.path.join(location, filename).split(':')) + for location, filename, skip in zip( + dataproducts.getStringVector('Input_Correlated.locations'), + dataproducts.getStringVector('Input_Correlated.filenames'), + dataproducts.getBoolVector('Input_Correlated.skip')) + if not skip + ] + self.logger.debug("%d Input_Correlated data products specified" % + len(self.input_data)) + self.output_data = [ + tuple(os.path.join(location, filename).split(':')) + for location, filename, skip in zip( + dataproducts.getStringVector('Output_Correlated.locations'), + dataproducts.getStringVector('Output_Correlated.filenames'), + dataproducts.getBoolVector('Output_Correlated.skip')) + if not skip + ] + self.logger.debug("%d Output_Correlated data products specified" % + len(self.output_data)) + # Sanity checks on input- and output data product specifications + if not validate_data_maps(self.input_data, self.output_data): + raise PipelineException( + "Validation of input/output data product specification failed!" + ) + # Validate input data, by searching the cluster for files + self._validate_input_data() + # Update input- and output-data product specifications if needed + if not all(self.io_data_mask): + self.logger.info("Updating input/output product specifications") + self.input_data = [ + f for (f, m) in zip(self.input_data, self.io_data_mask) if m + ] + self.output_data = [ + f for (f, m) in zip(self.output_data, self.io_data_mask) if m + ] + + + def _validate_input_data(self): + """ + Search for the requested input files and mask the files in + `self.input_data[]` that could not be found on the system. + """ + # Use filename glob-pattern as defined in LOFAR-USG-ICD-005. + self.io_data_mask = tally_data_map( + self.input_data, 'L*_SB???_uv.MS', self.logger + ) + # Log a warning if not all input data files were found. + if not all(self.io_data_mask): + self.logger.warn( + "The following input data files were not found: %s" % + ', '.join( + ':'.join(f) for (f, m) in zip( + self.input_data, self.io_data_mask + ) if not m + ) + ) + + + def go(self): + """ + Read the parset-file that was given as input argument; + set jobname, and input/output data products before calling the + base-class's `go()` method. + """ + try: + parset_file = os.path.abspath(self.inputs['args'][0]) + except IndexError: + return self.usage() + self.parset.adoptFile(parset_file) + self.parset_feedback_file = parset_file + "_feedback" + + # Set job-name to basename of parset-file w/o extension, if it's not + # set on the command-line with '-j' or '--job-name' + if not self.inputs.has_key('job_name'): + self.inputs['job_name'] = ( + os.path.splitext(os.path.basename(parset_file))[0]) + + # Call the base-class's `go()` method. + return super(calibration_pipeline, self).go() + + + def pipeline_logic(self): + """ + Define the individual tasks that comprise the current pipeline. + This method will be invoked by the base-class's `go()` method. + """ + # ********************************************************************* + # 1. Prepare phase, collect data from parset and input mapfiles. + py_parset = self.parset.makeSubset( + self.parset.fullModuleName('PythonControl') + '.') + + # Get input/output-data products specifications. + self._get_io_product_specs() + + job_dir = self.config.get("layout", "job_directory") + parset_dir = os.path.join(job_dir, "parsets") + mapfile_dir = os.path.join(job_dir, "mapfiles") + + # Create directories for temporary parset- and map files + create_directory(parset_dir) + create_directory(mapfile_dir) + + # Write input- and output data map-files + input_data_mapfile = os.path.join(mapfile_dir, "input_data.mapfile") + self._store_data_map(input_data_mapfile, self.input_data, "inputs") + output_data_mapfile = os.path.join(mapfile_dir, "output_data.mapfile") + self._store_data_map(output_data_mapfile, self.output_data, "output") + + if len(self.input_data) == 0: + self.logger.warn("No input data files to process. Bailing out!") + return 0 + + self.logger.debug("Processing: %s" % + ', '.join(':'.join(f) for f in self.input_data)) + + # ********************************************************************* + # 2. Create VDS-file; it will contain important input-data for NDPPP + gvds_file = self.run_task("vdsmaker", input_data_mapfile)['gvds'] + + # Read metadata (start, end times, pointing direction) from GVDS. + vdsinfo = self.run_task("vdsreader", gvds=gvds_file) + + # ********************************************************************* + # 3. Average and flag data, using NDPPP. + ndppp_parset = os.path.join(parset_dir, "NDPPP.parset") + py_parset.makeSubset('DPPP.').writeFile(ndppp_parset) + + # Run the Default Pre-Processing Pipeline (DPPP); + dppp_mapfile = self.run_task("ndppp", + input_data_mapfile, + data_start_time=vdsinfo['start_time'], + data_end_time=vdsinfo['end_time'], + parset=ndppp_parset)['mapfile'] + + # ********************************************************************* + # 4. Create a sourcedb from the user-supplied sky model, + # and an empty parmdb. + skymodel = py_parset.getString('Calibration.SkyModel') + + # The user-supplied sky model can either be a name, in which case the + # pipeline will search for a file <name>.skymodel in the default search + # path $LOFARROOT/share/pipeline/skymodels; or a full path. + # It is an error if the file does not exist. + if not os.path.isabs(skymodel): + skymodel = os.path.join( + # This should really become os.environ['LOFARROOT'] + self.config.get('DEFAULT', 'lofarroot'), + 'share', 'pipeline', 'skymodels', skymodel + '.skymodel' + ) + if not os.path.isfile(skymodel): + raise PipelineException("Skymodel %s does not exist" % skymodel) + + sourcedb_mapfile = self.run_task( + "setupsourcedb", dppp_mapfile, + skymodel=skymodel + )['mapfile'] + + parmdb_mapfile = self.run_task( + "setupparmdb", dppp_mapfile + )['mapfile'] + + # ********************************************************************* + # 5. Run BBS to calibrate the data. + + # Create a parameter subset for BBS + bbs_parset = os.path.join(parset_dir, "BBS.parset") + py_parset.makeSubset('BBS.').writeFile(bbs_parset) + + self.run_task("bbs_reducer", + (dppp_mapfile, output_data_mapfile), + parset=bbs_parset, + instrument_mapfile=parmdb_mapfile, + sky_mapfile=sourcedb_mapfile + ) + + +if __name__ == '__main__': + sys.exit(calibration_pipeline().main()) diff --git a/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py index 7c1028fef5f57a8ac89f3ff725b54a12f7f2fc8a..2eb6640974898cf6b8be36cb5c99f1f40f9c2d29 100755 --- a/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py +++ b/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# LOFAR IMAGING PIPELINE +# LOFAR CALIBRATION PIPELINE # # Calibrator Pipeline recipe # Marcel Loose, 2011-2012 diff --git a/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py index 6e1fd0f0c639a7938edfb13525ba8249298ea3d3..534c0ca79281a8c2674756f2863c7e551d3c7c27 100755 --- a/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py +++ b/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py @@ -1,10 +1,12 @@ #!/usr/bin/env python -# LOFAR IMAGING PIPELINE +# LOFAR IMAGING PIPELINE # -# Imager Pipeline recipe -# Marcel Loose, 2012 -# loose@astron.nl -# ------------------------------------------------------------------------------ +# Imager Pipeline recipe +# Marcel Loose, 2012 +# loose@astron.nl +# Wouter Klijn, 2012 +# klijn@astron.nl +# ----------------------------------------------------------------------------- import os import sys @@ -21,20 +23,20 @@ from lofar.parameterset import parameterset class msss_imager_pipeline(control): """ The Automatic MSSS imager pipeline is used to generate MSSS images and find - sources in the generated images. Generated images and lists of found sources - are complemented with meta data and thus ready for consumption by the - Long Term Storage (LTA) + sources in the generated images. Generated images and lists of found + sources are complemented with meta data and thus ready for consumption by + the Long Term Storage (LTA) *subband groups* The imager_pipeline is able to generate images on the frequency range of - LOFAR in parallel. Combining the frequency subbands together in so called - subbandgroups. Each subband group will result in an image and sourcelist, - (typically 8, because ten subband groups are combined). + LOFAR in parallel. Combining the frequency subbands together in so called + subbandgroups. Each subband group will result in an image and sourcelist, + (typically 8, because ten subband groups are combined). *Time Slices* - MSSS images are compiled from a number of so-called (time) slices. Each slice - comprises a short (approx. 10 min) observation of a field (an area on the - sky) containing typically 80 subbands. The number of slices will be + MSSS images are compiled from a number of so-called (time) slices. Each + slice comprises a short (approx. 10 min) observation of a field (an area on + the sky) containing typically 80 subbands. The number of slices will be different for LBA observations (typically 9) and HBA observations (typically 2), due to differences in sensitivity. @@ -45,38 +47,39 @@ class msss_imager_pipeline(control): **This pipeline performs the following operations:** 1. Prepare Phase. Copy the preprocessed MS's from the different compute - nodes to the nodes where the images will be compiled (the prepare phase). + nodes to the nodes where the images will be compiled (the prepare phase) Combine the subbands in subband groups, concattenate the timeslice in a single large measurement set and perform flagging, RFI and bad station exclusion. 2. Create db. Generate a local sky model (LSM) from the global sky model (GSM) for the sources that are in the field-of-view (FoV). The LSM is stored as sourcedb. - In step 3 calibration of the measurement sets is performed on these - sources and in step 4 to create a mask for the awimager. The calibration + In step 3 calibration of the measurement sets is performed on these + sources and in step 4 to create a mask for the awimager. The calibration solution will be placed in an instrument table/db also created in this step. 3. BBS. Calibrate the measurement set with the sourcedb from the gsm. In later iterations sourced found in the created images will be added - to this list. Resulting in a selfcalibration cycle. - 4. Awimager. The combined measurement sets are now imaged. The imaging - is performed using a mask: The sources in the sourcedb are used to create - an casa image masking known sources. Together with the measurement set - an image is created. - 5. Sourcefinding. The images created in step 4 are fed to pyBDSM to find and - describe sources. In multiple itterations substracting the found sources, - all sources are collectedin a sourcelist. - Step I. The sources found in step 5 are fed back into step 2. This allows the - Measurement sets to be calibrated with sources currently found in the - image. This loop will continue until convergence (3 times for the time - being). - 6. Finalize. Meta data with regards to the input, computations performed and - results are collected an added to the casa image. The images created are - converted from casa to HDF5 and copied to the correct output location. + to this list. Resulting in a selfcalibration cycle. + 4. Awimager. The combined measurement sets are now imaged. The imaging + is performed using a mask: The sources in the sourcedb are used to + create an casa image masking known sources. Together with the + measurement set an image is created. + 5. Sourcefinding. The images created in step 4 are fed to pyBDSM to find + and describe sources. In multiple itterations substracting the found + sources, all sources are collectedin a sourcelist. + Step I. The sources found in step 5 are fed back into step 2. + This allows the Measurement sets to be calibrated with sources currently + found in the image. This loop will continue until convergence (3 times + for the time being). + 6. Finalize. Meta data with regards to the input, computations performed + and results are collected an added to the casa image. The images created + are converted from casa to HDF5 and copied to the correct output + location. 7. Export meta data: An outputfile with meta data is generated ready for consumption by the LTA and/or the LOFAR framework. - + **Per subband-group, the following output products will be delivered:** a. An image @@ -98,7 +101,6 @@ class msss_imager_pipeline(control): self.parset_dir = None self.mapfile_dir = None - def usage(self): """ Display usage information @@ -119,13 +121,12 @@ class msss_imager_pipeline(control): self.parset_feedback_file = parset_file + "_feedback" # Set job-name to basename of parset-file w/o extension, if it's not # set on the command-line with '-j' or '--job-name' - if not self.inputs.has_key('job_name'): + if not 'job_name' in self.inputs: self.inputs['job_name'] = ( os.path.splitext(os.path.basename(parset_file))[0] ) return super(msss_imager_pipeline, self).go() - def pipeline_logic(self): """ Define the individual tasks that comprise the current pipeline. @@ -155,7 +156,7 @@ class msss_imager_pipeline(control): # ********************************************************************* # (INPUT) Get the input from external sources and create pipeline types - # Input measure ment sets + # Input measure ment sets input_mapfile = os.path.join(self.mapfile_dir, "uvdata.mapfile") store_data_map(input_mapfile, self.input_data) self.logger.debug( @@ -174,7 +175,7 @@ class msss_imager_pipeline(control): "Wrote output sky-image mapfile: {0}".format(output_image_mapfile)) # ****************************************************************** - # (1) prepare phase: copy and collect the ms + # (1) prepare phase: copy and collect the ms concat_ms_map_path, timeslice_map_path, raw_ms_per_image_map_path, \ processed_ms_dir = self._prepare_phase(input_mapfile, target_mapfile, skip=False) @@ -196,15 +197,14 @@ class msss_imager_pipeline(control): bbs_output = self._bbs(timeslice_map_path, parmdbs_path, sourcedb_map_path, skip=False) - - # ****************************************************************** + # ***************************************************************** # (4) Get parameters awimager from the prepare_parset and inputs aw_image_mapfile, maxbaseline = self._aw_imager(concat_ms_map_path, idx_loop, sourcedb_map_path, skip=False) # ***************************************************************** - # (5) Source finding + # (5) Source finding sourcelist_map, found_sourcedb_path = self._source_finding( aw_image_mapfile, idx_loop, skip=False) #should the output be a sourcedb? instead of a sourcelist @@ -271,7 +271,7 @@ class msss_imager_pipeline(control): """ Perform the final step of the imager: Convert the output image to hdf5 and copy to output location - Collect meta data and add to the image + Collect meta data and add to the image """ placed_image_mapfile = self._write_datamap_to_file(None, @@ -317,7 +317,8 @@ class msss_imager_pipeline(control): sourcedb_map_path = self._write_datamap_to_file(None, "source_dbs_outputs", "Map to sourcedbs based in found sources") - # construct the location to save the output products of the sourcefinder + # construct the location to save the output products of the + # sourcefinder cycle_path = os.path.join(self.scratch_directory, "awimage_cycle_{0}".format(major_cycle)) catalog_path = os.path.join(cycle_path, "bdsm_catalog") @@ -340,31 +341,30 @@ class msss_imager_pipeline(control): return source_list_map, sourcedb_map_path - def _bbs(self, timeslice_map_path, parmdbs_map_path, sourcedb_map_path, skip=False): """ Perform a calibration step. First with a set of sources from the gsm and in later iterations also on the found sources """ - #create parset for bbs run + #create parset for bbs run parset = self.parset.makeSubset("BBS.") parset_path = self._write_parset_to_file(parset, "bbs", - "Parset for calibration on local sky model") + "Parset for calibration on local sky model") # create the output file path output_mapfile = self._write_datamap_to_file(None, "bbs_output", "Mapfile with calibrated measurement sets.") converted_sourcedb_map_path = self._write_datamap_to_file(None, - "source_db", "correctly shaped mapfile for input sourcedbs") + "source_db", "correctly shaped mapfile for input sourcedbs") if skip: return output_mapfile # The create db step produces a mapfile with a single sourcelist for # the different timeslices. Generate a mapfile with copies of the - # sourcelist location: This allows validation of maps in combination + # sourcelist location: This allows validation of maps in combination # get the original map data sourcedb_map = load_data_map(sourcedb_map_path) @@ -408,12 +408,17 @@ class msss_imager_pipeline(control): parset = self.parset.makeSubset("AWimager.") # Get maxbaseline from 'full' parset max_baseline = self.parset.getInt("Imaging.maxbaseline") - patch_dictionary = {"maxbaseline":str( + patch_dictionary = {"maxbaseline": str( max_baseline)} - temp_parset_filename = patch_parset(parset, patch_dictionary) - aw_image_parset = get_parset(temp_parset_filename) - aw_image_parset_path = self._write_parset_to_file(aw_image_parset, - "awimager_cycle_{0}".format(major_cycle), "Awimager recipe parset") + try: + temp_parset_filename = patch_parset(parset, patch_dictionary) + aw_image_parset = get_parset(temp_parset_filename) + aw_image_parset_path = self._write_parset_to_file(aw_image_parset, + "awimager_cycle_{0}".format(major_cycle), + "Awimager recipe parset") + finally: + # remove tempfile + os.remove(temp_parset_filename) # Create path to write the awimage files intermediate_image_path = os.path.join(self.scratch_directory, @@ -438,16 +443,15 @@ class msss_imager_pipeline(control): return output_mapfile, max_baseline - def _prepare_phase(self, input_ms_map_path, target_mapfile, skip=False): """ - Copy ms to correct location, combine the ms in slices and combine + Copy ms to correct location, combine the ms in slices and combine the time slices into a large virtual measurement set """ # Create the dir where found and processed ms are placed # raw_ms_per_image_map_path contains all the original ms locations: - # this list contains possible missing files + # this list contains possible missing files processed_ms_dir = os.path.join(self.scratch_directory, "subbands") # get the parameters, create a subset for ndppp, save @@ -459,7 +463,7 @@ class msss_imager_pipeline(control): #[1] output -> prepare_output output_mapfile = self._write_datamap_to_file(None, "prepare_output") time_slices_mapfile = self._write_datamap_to_file(None, - "prepare_time_slices") + "prepare_time_slices") raw_ms_per_image_mapfile = self._write_datamap_to_file(None, "raw_ms_per_image") @@ -505,11 +509,10 @@ class msss_imager_pipeline(control): return output_mapfile, time_slices_mapfile, raw_ms_per_image_mapfile, \ processed_ms_dir - def _create_dbs(self, input_map_path, timeslice_map_path, source_list="", skip_create_dbs=False): """ - Create for each of the concatenated input measurement sets + Create for each of the concatenated input measurement sets an instrument model and parmdb """ # Create the parameters set @@ -545,10 +548,9 @@ class msss_imager_pipeline(control): # TODO: Move these helpers to the parent class def _write_parset_to_file(self, parset, parset_name, message): """ - Write the suplied the suplied parameterset to the parameter set + Write the suplied the suplied parameterset to the parameter set directory in the jobs dir with the filename suplied in parset_name. Return the full path to the created file. - """ parset_dir = os.path.join( self.config.get("layout", "job_directory"), "parsets") @@ -566,12 +568,11 @@ class msss_imager_pipeline(control): return parset_path - def _write_datamap_to_file(self, datamap, mapfile_name, message=""): """ - Write the suplied the suplied map to the mapfile + Write the suplied the suplied map to the mapfile. directory in the jobs dir with the filename suplied in mapfile_name. - Return the full path to the created file. + Return the full path to the created file. Id supllied data is None then the file is touched if not existing, but existing files are kept as is """ @@ -596,10 +597,8 @@ class msss_imager_pipeline(control): self.logger.debug( "Touched mapfile <{0}>: {1}".format(mapfile_path, message)) - return mapfile_path if __name__ == '__main__': sys.exit(msss_imager_pipeline().main()) - diff --git a/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py index f02495c285f8c44ab8239d54387bd5e25bb14e1a..a952274df85b62eef3714571e774933a25bceba8 100755 --- a/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py +++ b/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# LOFAR IMAGING PIPELINE +# LOFAR CALIBRATION PIPELINE # # Target Pre-Processing Pipeline recipe # Marcel Loose, 2011 @@ -162,20 +162,20 @@ class msss_target_pipeline(control): self.io_data_mask = [x and y for (x, y) in zip(data_mask, inst_mask)] - def _create_target_map_for_instruments(self, instrument_map, - input_data_map): + def _create_target_map_for_instruments(self): """ - Create a mapfile with target locations: based on the host found in the - input_data_map, the name of the instrument file and the working \ - directory + job name + Create a mapfile with target locations: based on the host found in + the input data map, the name of the instrument file in the input + instrument map, and the working directory + job name """ scratch_dir = os.path.join( self.inputs['working_directory'], self.inputs['job_name']) target_locations = [] - for instrument_pair, data_pair in zip(instrument_map, input_data_map): - host_instr, path_instr = instrument_pair - host_data, path_data = data_pair + for instrument_pair, data_pair \ + in zip(self.input_data['instrument'], self.input_data['data']): + path_instr = instrument_pair[1] + host_data = data_pair[0] # target location == working dir instrument file name target_path = os.path.join(scratch_dir, os.path.basename(path_instr)) target_locations.append((host_data, target_path)) @@ -183,19 +183,17 @@ class msss_target_pipeline(control): return target_locations - def _copy_instrument_files(self, instrument_map, input_data_map, - mapfile_dir): + def _copy_instrument_files(self, mapfile_dir): # For the copy recipe a target mapfile is needed - # create target map based on the node and the dir in the input_data_map + # create target map based on the node and the dir in the input data map # with the filename based on the copier_map_path = os.path.join(mapfile_dir, "copier") create_directory(copier_map_path) - target_map = self._create_target_map_for_instruments(instrument_map, - input_data_map) + target_map = self._create_target_map_for_instruments() #Write the two needed maps to file source_path = os.path.join(copier_map_path, "source_instruments.map") - store_data_map(source_path, instrument_map) + store_data_map(source_path, self.input_data['instrument']) target_path = os.path.join(copier_map_path, "target_instruments.map") store_data_map(target_path, target_map) @@ -215,13 +213,19 @@ class msss_target_pipeline(control): copied_instruments_map = load_data_map(copied_instruments_mapfile) new_instrument_map = [] new_input_data_map = [] - for instrument_pair, input_data_pair in zip(target_map, input_data_map): + new_output_data_map = [] + for instrument_pair, input_data_pair, output_data_pair in \ + zip(target_map, self.input_data['data'], self.output_data['data']): if instrument_pair in copied_instruments_map: new_instrument_map.append(instrument_pair) new_input_data_map.append(input_data_pair) + new_output_data_map.append(output_data_pair) # else: Do not process further in the recipe - return new_instrument_map, new_input_data_map + self.input_data['instrument'] = new_instrument_map + self.input_data['data'] = new_input_data_map + self.output_data['data'] = new_output_data_map + def go(self): """ @@ -272,9 +276,7 @@ class msss_target_pipeline(control): # Copy the instrument files to the corrent nodes: failures might happen # update both intrument and datamap to contain only successes! - self.input_data['instrument'], self.input_data['data'] = \ - self._copy_instrument_files(self.input_data['instrument'], - self.input_data['data'], mapfile_dir) + self._copy_instrument_files(mapfile_dir) # Write input- and output data map-files. diff --git a/CEP/Pipeline/recipes/sip/bin/preprocessing_pipeline.py b/CEP/Pipeline/recipes/sip/bin/preprocessing_pipeline.py new file mode 100644 index 0000000000000000000000000000000000000000..4f0a1f15335f0a0478abf2695db7c95ee42e853d --- /dev/null +++ b/CEP/Pipeline/recipes/sip/bin/preprocessing_pipeline.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python +# LOFAR PRE-PROCESSING PIPELINE +# +# Pre-Processing Pipeline recipe +# Marcel Loose, 2012 +# loose@astron.nl +# ------------------------------------------------------------------------------ + +import os +import sys + +from lofarpipe.support.control import control +from lofarpipe.support.group_data import validate_data_maps, tally_data_map +from lofarpipe.support.lofarexceptions import PipelineException +from lofarpipe.support.utilities import create_directory +from lofar.parameterset import parameterset + +class preprocessing_pipeline(control): + """ + The pre-processing pipeline can be used to average raw UV-data in time + and frequency, to flag RFI, and to demix strong A-team sources. + + This pipeline will perform the following operations: + + 1. Prepare phase, collect data from parset and input mapfiles. + 2. Create VDS-file; it will contain important input-data for NDPPP + 3. Average and flag data, and demix A-team sources using NDPPP. + """ + + def __init__(self): + super(preprocessing_pipeline, self).__init__() + self.parset = parameterset() + self.input_data = [] + self.output_data = [] + self.io_data_mask = [] + self.parset_feedback_file = None + + + def usage(self): + """ + Display usage + """ + print >> sys.stderr, "Usage: %s [options] <parset-file>" % sys.argv[0] + return 1 + + + def _get_io_product_specs(self): + """ + Get input- and output-data product specifications from the + parset-file, and do some sanity checks. + """ + dataproducts = self.parset.makeSubset( + self.parset.fullModuleName('DataProducts') + '.' + ) + self.input_data = [ + tuple(os.path.join(location, filename).split(':')) + for location, filename, skip in zip( + dataproducts.getStringVector('Input_Correlated.locations'), + dataproducts.getStringVector('Input_Correlated.filenames'), + dataproducts.getBoolVector('Input_Correlated.skip')) + if not skip + ] + self.logger.debug("%d Input_Correlated data products specified" % + len(self.input_data)) + self.output_data = [ + tuple(os.path.join(location, filename).split(':')) + for location, filename, skip in zip( + dataproducts.getStringVector('Output_Correlated.locations'), + dataproducts.getStringVector('Output_Correlated.filenames'), + dataproducts.getBoolVector('Output_Correlated.skip')) + if not skip + ] + self.logger.debug("%d Output_Correlated data products specified" % + len(self.output_data)) + # Sanity checks on input- and output data product specifications + if not validate_data_maps(self.input_data, self.output_data): + raise PipelineException( + "Validation of input/output data product specification failed!" + ) + # Validate input data, by searching the cluster for files + self._validate_input_data() + # Update input- and output-data product specifications if needed + if not all(self.io_data_mask): + self.logger.info("Updating input/output product specifications") + self.input_data = [ + f for (f, m) in zip(self.input_data, self.io_data_mask) if m + ] + self.output_data = [ + f for (f, m) in zip(self.output_data, self.io_data_mask) if m + ] + + + def _validate_input_data(self): + """ + Search for the requested input files and mask the files in + `self.input_data[]` that could not be found on the system. + """ + # Use filename glob-pattern as defined in LOFAR-USG-ICD-005. + self.io_data_mask = tally_data_map( + self.input_data, 'L*_SB???_uv.MS', self.logger + ) + # Log a warning if not all input data files were found. + if not all(self.io_data_mask): + self.logger.warn( + "The following input data files were not found: %s" % + ', '.join( + ':'.join(f) for (f, m) in zip( + self.input_data, self.io_data_mask + ) if not m + ) + ) + + + def go(self): + """ + Read the parset-file that was given as input argument; + set jobname, and input/output data products before calling the + base-class's `go()` method. + """ + try: + parset_file = os.path.abspath(self.inputs['args'][0]) + except IndexError: + return self.usage() + self.parset.adoptFile(parset_file) + self.parset_feedback_file = parset_file + "_feedback" + + # Set job-name to basename of parset-file w/o extension, if it's not + # set on the command-line with '-j' or '--job-name' + if not self.inputs.has_key('job_name'): + self.inputs['job_name'] = ( + os.path.splitext(os.path.basename(parset_file))[0]) + + # Call the base-class's `go()` method. + return super(preprocessing_pipeline, self).go() + + + def pipeline_logic(self): + """ + Define the individual tasks that comprise the current pipeline. + This method will be invoked by the base-class's `go()` method. + """ + # ********************************************************************* + # 1. Prepare phase, collect data from parset and input mapfiles. + py_parset = self.parset.makeSubset( + self.parset.fullModuleName('PythonControl') + '.') + + # Get input/output-data products specifications. + self._get_io_product_specs() + + job_dir = self.config.get("layout", "job_directory") + parset_dir = os.path.join(job_dir, "parsets") + mapfile_dir = os.path.join(job_dir, "mapfiles") + + # Create directories for temporary parset- and map files + create_directory(parset_dir) + create_directory(mapfile_dir) + + # Write input- and output data map-files + input_data_mapfile = os.path.join(mapfile_dir, "input_data.mapfile") + self._store_data_map(input_data_mapfile, self.input_data, "inputs") + output_data_mapfile = os.path.join(mapfile_dir, "output_data.mapfile") + self._store_data_map(output_data_mapfile, self.output_data, "output") + + if len(self.input_data) == 0: + self.logger.warn("No input data files to process. Bailing out!") + return 0 + + self.logger.debug("Processing: %s" % + ', '.join(':'.join(f) for f in self.input_data)) + + # ********************************************************************* + # 2. Create VDS-file; it will contain important input-data for NDPPP + gvds_file = self.run_task("vdsmaker", input_data_mapfile)['gvds'] + + # Read metadata (start, end times, pointing direction) from GVDS. + vdsinfo = self.run_task("vdsreader", gvds=gvds_file) + + # ********************************************************************* + # 3. Average and flag data, using NDPPP. + ndppp_parset = os.path.join(parset_dir, "NDPPP.parset") + py_parset.makeSubset('DPPP.').writeFile(ndppp_parset) + + # Run the Default Pre-Processing Pipeline (DPPP); + self.run_task("ndppp", + (input_data_mapfile, output_data_mapfile), + data_start_time=vdsinfo['start_time'], + data_end_time=vdsinfo['end_time'], + parset=ndppp_parset) + + +if __name__ == '__main__': + sys.exit(preprocessing_pipeline().main()) diff --git a/CEP/Pipeline/recipes/sip/bin/startPython.sh b/CEP/Pipeline/recipes/sip/bin/startPython.sh index 61f04cb99f81b576a6711bfd29e3f98043c822be..dcd39e36328a18830209cf5570cbc6acab5fbe26 100755 --- a/CEP/Pipeline/recipes/sip/bin/startPython.sh +++ b/CEP/Pipeline/recipes/sip/bin/startPython.sh @@ -53,7 +53,7 @@ if [ -n "$debug" ]; then echo "**** $(date) ****" >> ${logFile} echo "$0 $@" >> ${logFile} echo "PATH=${PATH}" >> ${logFile} - echo "PYHONTPATH=${PYTHONPATH}" >> ${logFile} + echo "PYTHONPATH=${PYTHONPATH}" >> ${logFile} echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> ${logFile} echo "${pythonProgram} ${programOptions} ${parsetFile}" >> ${logFile} fi diff --git a/CEP/Pipeline/recipes/sip/master/bbs.py b/CEP/Pipeline/recipes/sip/master/deprecated/bbs.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/bbs.py rename to CEP/Pipeline/recipes/sip/master/deprecated/bbs.py diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/casapy.py b/CEP/Pipeline/recipes/sip/master/deprecated/casapy.py deleted file mode 100644 index 36332ca328d61bd9b6e3ece6ee19f0a159a6280f..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/casapy.py +++ /dev/null @@ -1,186 +0,0 @@ -from __future__ import with_statement -import sys, os - -# Local helpers -from lofarpipe.support.lofarrecipe import LOFARrecipe -from lofarpipe.support.lofaringredient import LOFARoutput, LOFARinput -from lofarpipe.support.ipython import LOFARTask -from lofarpipe.support.group_data import group_files -import lofarpipe.support.utilities as utilities -from lofarpipe.support.clusterlogger import clusterlogger -from lofarpipe.support.clusterdesc import ClusterDesc - -def run_casapy(infile, parset, start_time, end_time, increment): - # Run on engine to process data with Casapy - from lofarrecipe.nodes.casapy import casapy_node - return casapy_node(loghost=loghost, logport=logport).run( - infile, - parset, - start_time, - end_time, - increment - ) - -class casapy(LOFARrecipe): - def __init__(self): - super(casapy, self).__init__() - self.optionparser.add_option( - '--executable', - dest="executable", - help="CASApy executable" - ) - self.optionparser.add_option( - '-p', '--parset', - dest="parset", - help="Parset containing configuration for CASAPY" - ) - self.optionparser.add_option( - '-w', '--working-directory', - dest="working_directory", - help="Working directory used on compute nodes" - ) - self.optionparser.add_option( - '-t', '--increment', - dest="increment", - help="Length of each image in seconds" - ) - self.optionparser.add_option( - '-g', '--g(v)ds-file', - dest="gvds", - help="G(V)DS file describing data to be processed" - ) - self.optionparser.add_option( - '--makevds-exec', - dest="makevds_exec", - help="makevds executable" - ) - self.optionparser.add_option( - '--combinevds-exec', - dest="combinevds_exec", - help="combinevds executable" - ) - self.optionparser.add_option( - '--max-bands-per-node', - dest="max_bands_per_node", - help="Maximum number of subbands to farm out to a given cluster node", - default="8" - ) - - def go(self): - self.logger.info("Starting CASApy run") - super(casapy, self).go() - - job_directory = self.config.get("layout", "job_directory") - - # Connect to the IPython cluster and initialise it with - # the funtions we need. - tc, mec = self._get_cluster() - mec.push_function( - dict( - run_casapy=run_casapy, - build_available_list=utilities.build_available_list, - clear_available_list=utilities.clear_available_list - ) - ) - self.logger.info("Pushed functions to cluster") - - # Use build_available_list() to determine which SBs are available - # on each engine; we use this for dependency resolution later. - self.logger.info("Building list of data available on engines") - available_list = "%s%s" % ( - self.inputs['job_name'], self.__class__.__name__ - ) - mec.push(dict(filenames=self.inputs['args'])) - mec.execute( - "build_available_list(\"%s\")" % (available_list,) - ) - - clusterdesc = ClusterDesc( - self.config.get('cluster', 'clusterdesc') - ) - - for data_group in group_files( - self.logger, - clusterdesc, - os.path.join(self.inputs['working_directory'], self.inputs['job_name']), - int(self.inputs['max_bands_per_node']), - self.inputs['args'] - ): - self.logger.debug("Processing: " + str(data_group)) - self.logger.info("Calling vdsmaker") - inputs = LOFARinput(self.inputs) - inputs['directory'] = self.config.get('layout', 'vds_directory') - inputs['gvds'] = self.inputs['gvds'] - inputs['args'] = data_group - inputs['makevds'] = self.inputs['makevds_exec'] - inputs['combinevds'] = self.inputs['combinevds_exec'] - outputs = LOFARoutput() - if self.cook_recipe('vdsmaker', inputs, outputs): - self.logger.warn("vdsmaker reports failure") - return 1 - - - gvds = utilities.get_parset( - os.path.join( - self.config.get('layout', 'vds_directory'), self.inputs['gvds'] - ) - ) - start_time = gvds['StartTime'] - end_time = gvds['EndTime'] - self.inputs['increment'] = int(self.inputs['increment']) - - # clusterlogger context manager accepts networked logging - # from compute nodes. - with clusterlogger(self.logger) as (loghost, logport): - # Timer for total casapy job execution - with utilities.log_time(self.logger): - self.logger.debug("Logging to %s:%d" % (loghost, logport)) - tasks = [] - # Iterate over SB names, building and scheduling a casapy job - # for each one. - for ms_name in data_group: - task = LOFARTask( - "result = run_casapy(infile, parset, start_time, end_time, increment)", - push=dict( - infile=ms_name, - parset=self.inputs['parset'], - start_time=start_time, - end_time=end_time, - increment=self.inputs['increment'], - loghost=loghost, - logport=logport - ), - pull="result", - depend=utilities.check_for_path, - dependargs=(ms_name, available_list) - ) - self.logger.info("Scheduling processing of %s" % (ms_name,)) - if self.inputs['dry_run'] == "False": - self.inputs['dry_run'] = False - if not self.inputs['dry_run']: - tasks.append(tc.run(task)) - else: - self.logger.info("Dry run: scheduling skipped") - - # Wait for all jobs to finish - self.logger.info("Waiting for all CASApy tasks to complete") - tc.barrier(tasks) - - failure = False - for task in tasks: - ##### Print failing tasks? - ##### Abort if all tasks failed? - res = tc.get_task_result(task) - if res.failure: - self.logger.warn("Task %s failed" % (task)) - self.logger.warn(res) - self.logger.warn(res.failure.getTraceback()) - failure = True - - if failure: - return 1 -# self.outputs['data'] = outnames - return 0 - -if __name__ == '__main__': - sys.exit(casapy().main()) diff --git a/CEP/Pipeline/recipes/sip/master/cep2_datamapper.py b/CEP/Pipeline/recipes/sip/master/deprecated/cep2_datamapper.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/cep2_datamapper.py rename to CEP/Pipeline/recipes/sip/master/deprecated/cep2_datamapper.py diff --git a/CEP/Pipeline/recipes/sip/master/cimager.py b/CEP/Pipeline/recipes/sip/master/deprecated/cimager.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/cimager.py rename to CEP/Pipeline/recipes/sip/master/deprecated/cimager.py diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/collector.py b/CEP/Pipeline/recipes/sip/master/deprecated/collector.py deleted file mode 100644 index 5d87ba4845cc05c6d8d337ca594292520dadaf9a..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/collector.py +++ /dev/null @@ -1,140 +0,0 @@ -# Local helpers -from lofarpipe.support.lofarrecipe import LOFARrecipe -from lofarpipe.support.ipython import LOFARTask -from lofarpipe.support.clusterdesc import ClusterDesc, get_compute_nodes -import lofarpipe.support.utilities as utilities -import pyrap.images -from skim.main import run as create_hdf5 -import os, os.path, glob, subprocess, sys, numpy -import shutil, errno, re, logging, imp - -class collector(LOFARrecipe): - """ - Collect images into results directory. - Convert to fits files. - Average. - - Outstanding issue: breaks if the results directory is already - populated and the --clobber option isn't set. - """ - - def __init__(self): - super(collector, self).__init__() - self.optionparser.add_option( - '--image-re', - dest="image_re", - help="Regular expression to match CASA image names", - ) - self.optionparser.add_option( - '--working-directory', - dest="working_directory", - help="Working directory containing images on compute nodes", - ) - self.optionparser.add_option( - '--image2fits', - dest="image2fits", - help="Location of image2fits tool (from casacore)" - ) - self.optionparser.add_option( - '--averaged-name', - dest="averaged_name", - help="Base filename for averaged images" - ) - - def go(self): - self.logger.info("Starting data collector run") - super(collector, self).go() - - clusterdesc = ClusterDesc( - self.config.get('cluster', 'clusterdesc') - ) - results_dir = self.config.get('layout', 'results_directory') - try: - os.makedirs(results_dir) - except OSError, failure: - if failure.errno != errno.EEXIST: - raise - - self.logger.debug("Copying CASA images to to %s" % (results_dir)) - for node in get_compute_nodes(clusterdesc): - self.logger.debug("Node: %s" % (node)) - try: - exec_string = [ - "ssh", - node, - "--", - "cp", - "-r", - "%s/%s/%s" % ( - self.inputs['working_directory'], - self.inputs['job_name'], - self.inputs['image_re'] - ), - results_dir - ] - self.logger.info(exec_string) - subprocess.check_call(exec_string, close_fds=True) - except subprocess.CalledProcessError: - self.logger.warn("No images moved from %s" % (node)) - - image_names = glob.glob("%s/%s" % (results_dir, self.inputs['image_re'])) - if len(image_names) > 0: - self.logger.info("Averaging results") - result = reduce( - numpy.add, - (pyrap.images.image(file).getdata() for file in image_names) - ) / len(image_names) - - self.logger.info("Writing averaged files") - averaged_file = os.path.join( - self.config.get('layout', 'results_directory'), - self.inputs['averaged_name'] - ) - # Output for the averaged image. - # Use the coordinate system from SB0. - output = pyrap.images.image( - averaged_file + ".img", values=result, - coordsys=pyrap.images.image(image_names[0]).coordinates() - ) - self.logger.info("Wrote: %s" % (averaged_file + ".img",)) - output.tofits(averaged_file + ".fits") - self.logger.info("Wrote: %s" % (averaged_file + ".fits",)) - self.outputs['data'] = (averaged_file + ".fits",) - else: - self.logger.info("No images found; not averaging") - self.outputs['data'] = None - - self.logger.info("Generating FITS files") - fits_files = [] - for filename in image_names: - self.logger.debug(filename) - subband = re.search('(SB\d+)', os.path.basename(filename)).group() - output = os.path.join( - self.config.get('layout', 'results_directory'), - "%s.fits" % (subband) - ) - fits_files.append(output) - subprocess.check_call( - [ - self.inputs['image2fits'], - 'in=%s' % (filename), - 'out=%s' % (output) - ], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - close_fds=True - ) - - self.logger.info("Creating HDF5 file") - hdf5logger = logging.getLogger(self.logger.name + ".hdf5") - hdf5logger.setLevel(logging.INFO) - create_hdf5( - self.config.get('layout', 'job_directory'), - self.inputs['start_time'], - hdf5logger - ) - - return 0 - -if __name__ == '__main__': - sys.exit(collector().main()) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/colmaker.py b/CEP/Pipeline/recipes/sip/master/deprecated/colmaker.py deleted file mode 100644 index cf4bf423b56f1fe255964a9769d867bc18074b4c..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/colmaker.py +++ /dev/null @@ -1,67 +0,0 @@ -from __future__ import with_statement -import sys, os, tempfile - -from lofarpipe.support.ipython import LOFARTask -from lofarpipe.support.lofarrecipe import LOFARrecipe -import lofarpipe.support.utilities as utilities -from lofarpipe.support.clusterlogger import clusterlogger - -def make_columns(file): - from lofarrecipe.nodes.colmaker import makecolumns_node - return makecolumns_node(loghost=loghost, logport=logport).run(file) - -class colmaker(LOFARrecipe): - """ - Add imaging columns to inputs using pyrap. - """ - def go(self): - super(colmaker, self).go() - - ms_names = self.inputs['args'] - - tc, mec = self._get_cluster() - mec.push_function( - dict( - make_columns=make_columns, - build_available_list=utilities.build_available_list, - clear_available_list=utilities.clear_available_list - ) - ) - self.logger.info("Pushed functions to cluster") - - # Build VDS files for each of the newly created MeasurementSets - self.logger.info("Building list of data available on engines") - available_list = "%s%s" % (self.inputs['job_name'], "colmaker") - mec.push(dict(filenames=ms_names)) - mec.execute( - "build_available_list(\"%s\")" % (available_list,) - ) - clusterdesc = self.config.get('cluster', 'clusterdesc') - tasks = [] - - with clusterlogger(self.logger) as (loghost, logport): - for ms_name in ms_names: - task = LOFARTask( - "result = make_columns(ms_name)", - push=dict( - ms_name=ms_name, - loghost=loghost, - logport=logport - ), - pull="result", - depend=utilities.check_for_path, - dependargs=(ms_name, available_list) - ) - self.logger.info("Scheduling processing of %s" % (ms_name,)) - tasks.append(tc.run(task)) - self.logger.info("Waiting for all colmaker tasks to complete") - tc.barrier(tasks) - for task in tasks: - res = tc.get_task_result(task) - if res.failure: - print res.failure - - mec.execute("clear_available_list(\"%s\")" % (available_list,)) - -if __name__ == '__main__': - sys.exit(colmaker().main()) diff --git a/CEP/Pipeline/recipes/sip/master/compression_pipeline.py b/CEP/Pipeline/recipes/sip/master/deprecated/compression_pipeline.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/compression_pipeline.py rename to CEP/Pipeline/recipes/sip/master/deprecated/compression_pipeline.py diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/copier.py b/CEP/Pipeline/recipes/sip/master/deprecated/copier.py deleted file mode 100644 index 47434b3d24299d347c3e0623a700ac779733645d..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/copier.py +++ /dev/null @@ -1,50 +0,0 @@ -# Local helpers -from lofarpipe.support.lofarrecipe import LOFARrecipe -import lofarpipe.support.utilities as utilities -import os.path - -class copier(LOFARrecipe): - """ - Copy files to compute nodes. - """ - def __init__(self): - super(copier, self).__init__() - self.optionparser.add_option( - '--destination', - dest="destination", - help="Destination directory on compute nodes" - ) - - def go(self): - self.logger.info("Starting copier run") - super(copier, self).go() - - tc, mec = self._get_cluster() - - mec.execute('import shutil') - - self.logger.info("Compiling list of output destinations") - destinations = [ - os.path.join( - self.inputs['destination'], - os.path.basename(file) - ) - for file in self.inputs['args'] - ] - self.logger.debug(destinations) - - self.logger.info("Copying files on cluster") - try: - tc.map( - lambda x: shutil.copytree(x[0], x[1]), - zip(self.inputs['args'], destinations) - ) - except Exception, e: - self.logger.exception('Failed to copy files on cluster') - return 1 - - self.outputs['ms_names'] = destinations - - return 0 - - diff --git a/CEP/Pipeline/recipes/sip/master/count_timesteps.py b/CEP/Pipeline/recipes/sip/master/deprecated/count_timesteps.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/count_timesteps.py rename to CEP/Pipeline/recipes/sip/master/deprecated/count_timesteps.py diff --git a/CEP/Pipeline/recipes/sip/master/datamapper.py b/CEP/Pipeline/recipes/sip/master/deprecated/datamapper.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/datamapper.py rename to CEP/Pipeline/recipes/sip/master/deprecated/datamapper.py diff --git a/CEP/Pipeline/recipes/sip/master/demixing.py b/CEP/Pipeline/recipes/sip/master/deprecated/demixing.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/demixing.py rename to CEP/Pipeline/recipes/sip/master/deprecated/demixing.py diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/dppp.py b/CEP/Pipeline/recipes/sip/master/deprecated/dppp.py deleted file mode 100644 index 71795699c6748670c743efe5d6e532caf7c73edc..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/dppp.py +++ /dev/null @@ -1,151 +0,0 @@ -from __future__ import with_statement -import sys, os - -import lofarpipe.support.utilities as utilities -from lofarpipe.support.lofarrecipe import LOFARrecipe -from lofarpipe.support.ipython import LOFARTask -from lofarpipe.support.clusterlogger import clusterlogger -from lofarpipe.support.lofarnode import run_node - -class dppp(LOFARrecipe): - def __init__(self): - super(dppp, self).__init__() - self.optionparser.add_option( - '--executable', - dest="executable", - help="DPPP executable" - ) - self.optionparser.add_option( - '--initscript', - dest="initscript", - help="DPPP initscript" - ) - self.optionparser.add_option( - '-p', '--parset', - dest="parset", - help="Parset containing configuration for DPPP" - ) - self.optionparser.add_option( - '--suffix', - dest="suffix", - default=".dppp", - help="Suffix to add to trimmed data (default: overwrite existing)" - ) - self.optionparser.add_option( - '-w', '--working-directory', - dest="working_directory", - help="Working directory used on compute nodes" - ) - self.optionparser.add_option( - '--data-start-time', - help="Start time to be passed to DPPP (optional)", - ) - self.optionparser.add_option( - '--data-end-time', - help="End time to be passed to DPPP (optional)", - ) - self.optionparser.add_option( - '--nthreads', - help="Number of threads per (N)DPPP process", - default="2" - ) - - - def go(self): - self.logger.info("Starting DPPP run") - super(dppp, self).go() - - job_directory = self.config.get("layout", "job_directory") - ms_names = self.inputs['args'] - - # Connect to the IPython cluster and initialise it with - # the funtions we need. - tc, mec = self._get_cluster() - mec.push_function( - dict( - run_dppp=run_node, - build_available_list=utilities.build_available_list, - clear_available_list=utilities.clear_available_list - ) - ) - self.logger.debug("Pushed functions to cluster") - - # Use build_available_list() to determine which SBs are available - # on each engine; we use this for dependency resolution later. - self.logger.debug("Building list of data available on engines") - available_list = "%s%s" % ( - self.inputs['job_name'], self.__class__.__name__ - ) - mec.push(dict(filenames=ms_names)) - mec.execute( - "build_available_list(\"%s\")" % (available_list,) - ) - self.logger.debug("Data lists available. Starting processing loop.") - - # clusterlogger context manager accepts networked logging - # from compute nodes. - with clusterlogger(self.logger) as (loghost, logport): - # Timer for total DPPP job execution - with utilities.log_time(self.logger): - self.logger.debug("Logging to %s:%d" % (loghost, logport)) - tasks = [] - outnames = [] - # Iterate over SB names, building and scheduling a DPPP job - # for each one. - for ms_name in ms_names: - outnames.append( - os.path.join( - self.inputs['working_directory'], - self.inputs['job_name'], - os.path.basename(ms_name) + self.inputs['suffix'] - ) - ) - task = LOFARTask( - "result = run_dppp(ms_name, ms_outname, parset, executable, initscript, start_time, end_time, nthreads)", - push=dict( - recipename=self.name, - nodepath=os.path.dirname(self.__file__.replace('master', 'nodes')), - ms_name=ms_name, - ms_outname=outnames[-1], - parset=self.inputs['parset'], - executable=self.inputs['executable'], - initscript=self.inputs['initscript'], - start_time=self.inputs['data_start_time'], - end_time=self.inputs['data_end_time'], - end_time=self.inputs['nthreads'], - loghost=loghost, - logport=logport - ), - pull="result", - depend=utilities.check_for_path, - dependargs=(ms_name, available_list) - ) - self.logger.info("Scheduling processing of %s" % (ms_name,)) - if self.inputs['dry_run'] == "False": - self.inputs['dry_run'] = False - if not self.inputs['dry_run']: - tasks.append((tc.run(task), ms_name)) - else: - self.logger.info("Dry run: scheduling skipped") - - # Wait for all jobs to finish - self.logger.debug("Waiting for all DPPP tasks to complete") - tc.barrier([task for task, subband in tasks]) - - failure = False - for task, subband in tasks: - ##### Print failing tasks? - ##### Abort if all tasks failed? - res = tc.get_task_result(task) - if res.failure: - self.logger.warn("Task %s failed (processing %s)" % (task, subband)) - self.logger.warn(res) - self.logger.warn(res.failure.getTraceback()) - failure = True - if failure: - return 1 - self.outputs['data'] = outnames - return 0 - -if __name__ == '__main__': - sys.exit(dppp().main()) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/dummy_echo_parallel.py b/CEP/Pipeline/recipes/sip/master/deprecated/dummy_echo_parallel.py deleted file mode 100644 index efab83835737bdb885355683247885354bac5ac8..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/dummy_echo_parallel.py +++ /dev/null @@ -1,63 +0,0 @@ -from __future__ import with_statement -import sys, os - -from lofarpipe.support.lofarrecipe import LOFARrecipe -from lofarpipe.support.ipython import LOFARTask -from lofarpipe.support.clusterlogger import clusterlogger -from lofarpipe.support.lofarnode import run_node - -class dummy_echo_parallel(LOFARrecipe): - def __init__(self): - super(dummy_echo_parallel, self).__init__() - self.optionparser.add_option( - '--executable', - dest="executable", - help="Executable to be run (ie, dummy_echo.sh)", - default="/home/swinbank/sw/bin/dummy_echo.sh" - ) - - def go(self): - self.logger.info("Starting dummy_echo run") - super(dummy_echo_parallel, self).go() - - # Connect to the IPython cluster and initialise it with the functions - # we need. - tc, mec = self._get_cluster() - mec.push_function( - dict( - run_dummy_echo=run_node, - ) - ) - self.logger.info("Cluster initialised") - - with clusterlogger(self.logger) as (loghost, logport): - self.logger.debug("Logging to %s:%d" % (loghost, logport)) - tasks = [] # this will be a list of scheduled jobs - for filename in self.inputs['args']: - task = LOFARTask( - "result = run_dummy_echo(filename, executable)", - push = dict( - recipename=self.name, - nodepath=os.path.dirname(self.__file__.replace('master', 'nodes')), - filename=filename, - executable=self.inputs['executable'], - loghost=loghost, - logport=logport - ), - pull="result" - ) - self.logger.info("Scheduling processing of %s" % (filename)) - tasks.append(tc.run(task)) - self.logger.info("Waiting for all dummy_echo tasks to complete") - tc.barrier(tasks) - - for task in tasks: - result = tc.get_task_result(task) - if result.failure: - self.logger.warn(result) - self.logger.warn(result.failure.getTraceback()) - - return 0 - -if __name__ == '__main__': - sys.exit(dummy_echo_parallel().main()) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/excluder.py b/CEP/Pipeline/recipes/sip/master/deprecated/excluder.py deleted file mode 100644 index 7c023ea6c117773a905780ff48c7002942146a43..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/excluder.py +++ /dev/null @@ -1,18 +0,0 @@ -import sys -from lofarpipe.support.pyraprunner import pyraprunner -from lofarpipe.support.utilities import string_to_list - -class excluder(pyraprunner): - def __init__(self): - super(excluder, self).__init__() - self.optionparser.add_option( - '--station', - dest="station", - help="Name of stations to exclude (e.g. DE001LBA)" - ) - - def _generate_arguments(self): - return "\"%s\"" % ('\", \"'.join(string_to_list(self.inputs['station']))) - -if __name__ == '__main__': - sys.exit(excluder().main()) diff --git a/CEP/Pipeline/recipes/sip/master/flag_baseline.py b/CEP/Pipeline/recipes/sip/master/deprecated/flag_baseline.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/flag_baseline.py rename to CEP/Pipeline/recipes/sip/master/deprecated/flag_baseline.py diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/flagger.py b/CEP/Pipeline/recipes/sip/master/deprecated/flagger.py deleted file mode 100644 index 3a303aead787752d566d5cc79fe19062ddec66f6..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/flagger.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import with_statement -import sys, os -from lofarpipe.support.pyraprunner import pyraprunner - -# Quick n dirty tool to read ASCII sourcelists used as input by BBS. -# The format for these doesn't seem all that well specified: see the -# makesourcedb tool, which vaguely refers to a format string which might have -# spaces, commas, ... -# We'll do our best. - -class Source(dict): - pass - -class SourceList(list): - def __init__(self, filename): - # Default format if we can't read one from the file - format = ( - "Name", "Type", "Ra", "Dec", "I", "Q", "U", "V", - "ReferenceFrequency='60e6'", "SpectralIndexDegree='0'", - "SpectralIndex:0='0.0'", "Major", "Minor", "Phi" - ) - with open(filename, 'r') as file: - try: - # Maybe the first line is a comma-separated format string... - first_line = file.readline().strip().split() - if first_line.split()[-1] == "format": - format = map(str.strip, first_line[3:-10].split(",")) - else: - raise - except: - # ...or maybe not. - file.seek(0) - for line in file: - if len(line.strip()) == 0 or line.strip()[0] == '#': continue - data = map(str.strip, line.split(',')) - self.append(Source(zip(format, data))) - -class flagger(pyraprunner): - def __init__(self): - super(flagger, self).__init__() - self.optionparser.add_option( - '-s', '--skymodel', - dest="skymodel", - help="initial sky model (in makesourcedb format)" - ) - self.optionparser.add_option( - '--n-factor', - dest="n_factor", - type="float", - help="Custom factor for flagging threshold" - ) - - def _generate_arguments(self): - self.inputs['skymodel'] = os.path.join( - self.config.get("layout", "parset_directory"), - self.inputs['skymodel'] - ) - self.logger.info("Using %s for %s skymodel" % - (self.inputs['skymodel'], "flagger") - ) - if not os.access(self.inputs['skymodel'], os.R_OK): - raise IOError - - sl = SourceList(self.inputs['skymodel']) - return float(self.inputs['n_factor']) * sum(float(s['I']) for s in sl) - -if __name__ == '__main__': - sys.exit(flagger().main()) diff --git a/CEP/Pipeline/recipes/sip/master/make_flaggable.py b/CEP/Pipeline/recipes/sip/master/deprecated/make_flaggable.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/make_flaggable.py rename to CEP/Pipeline/recipes/sip/master/deprecated/make_flaggable.py diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/mwimager.py b/CEP/Pipeline/recipes/sip/master/deprecated/mwimager.py deleted file mode 100644 index ec28e97b68b37daaba1183ec02518a2e23523234..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/mwimager.py +++ /dev/null @@ -1,214 +0,0 @@ -from __future__ import with_statement -import sys, os, tempfile, glob, subprocess, itertools -from contextlib import closing -from lofarpipe.support.clusterdesc import ClusterDesc - -# Local helpers -from lofarpipe.support.lofarrecipe import LOFARrecipe -from lofarpipe.support.lofaringredient import LOFARinput, LOFARoutput -from lofarpipe.support.group_data import group_files -import lofarpipe.support.utilities as utilities - -class mwimager(LOFARrecipe): - def __init__(self): - super(mwimager, self).__init__() - self.optionparser.add_option( - '--executable', - dest="executable", - help="Executable to be run (ie, mwimager script)" - ) - self.optionparser.add_option( - '--initscript', - dest="initscript", - help="Initscript to source (ie, lofarinit.sh)" - ) - self.optionparser.add_option( - '-g', '--g(v)ds-file', - dest="gvds", - help="G(V)DS file describing data to be processed" - ) - self.optionparser.add_option( - '-p', '--parset', - dest="parset", - help="MWImager configuration parset" - ) - self.optionparser.add_option( - '-w', '--working-directory', - dest="working_directory", - help="Working directory used on compute nodes" - ) - self.optionparser.add_option( - '--log', - dest="log", - help="Log file" - ) - self.optionparser.add_option( - '--askapsoft-path', - dest="askapsoft_path", - help="Path to cimager.sh" - ) - self.optionparser.add_option( - '--casa', - dest="casa", - help="Use the CASA lwimager", - action="store_true" - ) - self.optionparser.add_option( - '--makevds-exec', - dest="makevds_exec", - help="makevds executable" - ) - self.optionparser.add_option( - '--combinevds-exec', - dest="combinevds_exec", - help="combinevds executable" - ) - self.optionparser.add_option( - '--max-bands-per-node', - dest="max_bands_per_node", - help="Maximum number of subbands to farm out to a given cluster node", - default="8" - ) - - def go(self): - self.logger.info("Starting MWImager run") - super(mwimager, self).go() - - clusterdesc = ClusterDesc( - self.config.get('cluster', 'clusterdesc') - ) - - self.outputs["data"] = [] - - # Given a limited number of processes per node, the first task is to - # partition up the data for processing. - for iteration, data_group in enumerate(group_files( - self.logger, - clusterdesc, - os.path.join(self.inputs['working_directory'], self.inputs['job_name']), - int(self.inputs['max_bands_per_node']), - self.inputs['args'] - )): - self.logger.info("Calling vdsmaker") - vds_file = os.path.join( - self.config.get("layout", "vds_directory"), self.inputs['gvds'] - ) - self.run_task('vdsmaker', data_group, gvds=vds_file, unlink=False) - - # Patch GVDS filename into parset - self.logger.debug("Setting up MWImager configuration") - temp_parset_filename = utilities.patch_parset( - self.inputs['parset'], - { - 'dataset': os.path.join( - self.config.get('layout', 'vds_directory'), self.inputs['gvds'] - ) - }, - self.config.get('layout', 'parset_directory') - ) - - # Individual subband logs go in a temporary directory - # to be sorted out later. - log_root = os.path.join(tempfile.mkdtemp(), self.inputs['log']) - self.logger.debug("Logs dumped with root %s" % (log_root)) - - # Initscript for basic LOFAR utilities - env = utilities.read_initscript(self.inputs['initscript']) - # Also add the path for cimager.sh - env['PATH'] = "%s:%s" % (self.inputs['askapsoft_path'], env['PATH']) - - # For the overall MWimgager log - log_location = "%s/%s" % ( - self.config.get('layout', 'log_directory'), - self.inputs['log'] - ) - self.logger.debug("Logging to %s" % (log_location)) - - mwimager_cmd = [ - self.inputs['executable'], - temp_parset_filename, - self.config.get('cluster', 'clusterdesc'), - os.path.join( - self.inputs['working_directory'], - self.inputs['job_name'] - ), - log_root - ] - if self.inputs['casa'] is True or self.inputs['casa'] == "True": - mwimager_cmd.insert(1, '-casa') - try: - self.logger.info("Running MWImager") - self.logger.debug("Executing: %s" % " ".join(mwimager_cmd)) - if not self.inputs['dry_run']: - with utilities.log_time(self.logger): - with closing(open(log_location + '-' + str(iteration), 'w')) as log: - result = subprocess.check_call( - mwimager_cmd, - env=env, - stdout=log, - stderr=log, - close_fds=True - ) - else: - self.logger.info("Dry run: execution skipped") - result = 0 - except subprocess.CalledProcessError: - self.logger.exception("Call to mwimager failed") - result = 1 - finally: - os.unlink(temp_parset_filename) - - # Now parse the log files to: - # 1: find the name of the images that have been written - # 2: save the logs in appropriate places - # This is ugly! - self.logger.info("Parsing logfiles") - for log_file in glob.glob("%s%s" % (log_root, "*")): - self.logger.debug("Processing %s" % (log_file)) - ms_name, image_name = "", "" - with closing(open(log_file)) as file: - for line in file.xreadlines(): - if 'Cimager.Images.Names' in line.strip(): - try: - image_name = line.strip().split("=")[1].lstrip("['").rstrip("]'") - break - except IndexError: - pass - file.seek(0) - for line in file.xreadlines(): - split_line = line.split('=') - if split_line[0] == "Cimager.dataset": - ms_name = os.path.basename(split_line[1].rstrip()) - break - if not image_name: - self.logger.info("Couldn't identify image for %s "% (log_file)) - else: - self.logger.debug("Found image: %s" % (image_name)) - self.outputs["data"].append(image_name) - if not ms_name: - self.logger.info("Couldn't identify file for %s" % (log_file)) - else: - destination = "%s/%s/%s" % ( - self.config.get('layout', 'log_directory'), - ms_name, - self.inputs['log'] - ) - self.logger.debug( - "Moving logfile %s to %s" % (log_file, destination) - ) - utilities.move_log(log_file, destination) - try: - self.logger.debug("Removing temporary log directory") - os.rmdir(os.path.dirname(log_root)) - except OSError, failure: - self.logger.info("Failed to remove temporary directory") - self.logger.debug(failure) - try: - utilities.move_log(os.path.dirname(log_root), log_location) - except: - pass - - return result - -if __name__ == '__main__': - sys.exit(mwimager().main()) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/pyraprunner.py b/CEP/Pipeline/recipes/sip/master/deprecated/pyraprunner.py deleted file mode 100644 index e09b556020895b04049f4be2721ed8f99beba788..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/pyraprunner.py +++ /dev/null @@ -1,98 +0,0 @@ -from __future__ import with_statement -import sys, os - -import lofarpipe.support.utilities as utilities -from lofarpipe.support.ipython import LOFARTask -from lofarpipe.support.lofarrecipe import LOFARrecipe -from lofarpipe.support.clusterlogger import clusterlogger -from lofarpipe.support.lofarnode import run_node - -class pyraprunner(LOFARrecipe): - """ - Provides all the basic infrastructure for applying a pyrap-based filter to - code on the cluster, distributed using an IPython task client. - """ - def __init__(self): - super(pyraprunner, self).__init__() - self.optionparser.add_option( - '--suffix', - dest="suffix", - help="Suffix to add to trimmed data (default: overwrite existing)" - ) - - def _generate_arguments(self): - return '' - - def go(self): - super(pyraprunner, self).go() - - ms_names = self.inputs['args'] - - tc, mec = self._get_cluster() - function_name = self.__class__.__name__ + "_remote" - mec.push_function( - { - function_name: run_node, - "build_available_list": utilities.build_available_list, - "clear_available_list": utilities.clear_available_list - } - ) - self.logger.info("Pushed functions to cluster") - - self.logger.info("Building list of data available on engines") - available_list = "%s%s" % ( - self.inputs['job_name'], self.__class__.__name__ - ) - mec.push(dict(filenames=ms_names)) - mec.execute( - "build_available_list(\"%s\")" % (available_list,) - ) - - with clusterlogger(self.logger) as (loghost, logport): - self.logger.debug("Logging to %s:%d" % (loghost, logport)) - tasks = [] - outnames = [] - for ms_name in ms_names: - outnames.append(ms_name + self.inputs['suffix']) - execute_string = "result = %s(ms_name, \"%s\", %s)" % ( - function_name, outnames[-1], self._generate_arguments() - ) - task = LOFARTask( - execute_string, - push=dict( - recipename=self.name, - nodepath=os.path.dirname(self.__file__.replace('master', 'nodes')), - ms_name=ms_name, - loghost=loghost, - logport=logport - ), - pull="result", - depend=utilities.check_for_path, - dependargs=(ms_name, available_list) - ) - self.logger.info("Scheduling processing of %s" % (ms_name,)) - tasks.append(tc.run(task)) - self.logger.info( - "Waiting for all %s tasks to complete" % - (self.__class__.__name__) - ) - tc.barrier(tasks) - - - failure = False - for task in tasks: - res = tc.get_task_result(task) - if res.failure: - self.logger.warn("Task %s failed" % (task)) - self.logger.warn(res) - self.logger.warn(res.failure.getTraceback()) - failure = True - if failure: - return 1 - - mec.execute("clear_available_list(\"%s\")" % (available_list,)) - self.outputs['data'] = outnames - return 0 - -if __name__ == '__main__': - sys.exit(pyraprunner().main()) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/qcheck.py b/CEP/Pipeline/recipes/sip/master/deprecated/qcheck.py deleted file mode 100644 index 567f6873875c4829bd49a8b234c335a6d4b2535a..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/qcheck.py +++ /dev/null @@ -1,91 +0,0 @@ -from __future__ import with_statement -import sys, os - -from lofarpipe.support.ipython import LOFARTask -from lofarpipe.support.lofarrecipe import LOFARrecipe -import lofarpipe.support.utilities as utilities -from lofarpipe.support.clusterlogger import clusterlogger - -def run_qcheck(infile, pluginlist, outputdir): - from lofarrecipe.nodes.qcheck import qcheck_node - return qcheck_node(loghost=loghost, logport=logport).run( - infile, - pluginlist, - outputdir - ) - -class qcheck(LOFARrecipe): - def __init__(self): - super(qcheck, self).__init__() - self.optionparser.add_option( - '-w', '--working-directory', - dest="working_directory", - help="Working directory used on compute nodes" - ) - self.optionparser.add_option( - '--plugins', - dest="plugins", - help="[Expert use] Quality check plugins" - ) - - def go(self): - super(qcheck, self).go() - self.logger.info("Quality check system starting") - - self.outputs['data'] = [ - os.path.join( - self.inputs['working_directory'], self.inputs['job_name'], filename - ) - for filename in self.inputs['args'] - ] - plugins = utilities.string_to_list(self.inputs['plugins']) - self.logger.info("Using plugins: %s" % (str(plugins))) - - tc, mec = self._get_cluster() - mec.push_function( - dict( - run_qcheck=run_qcheck, - build_available_list=utilities.build_available_list, - clear_available_list=utilities.clear_available_list - ) - ) - self.logger.info("Pushed functions to cluster") - - self.logger.info("Building list of data available on engines") - available_list = "%s%s" % (self.inputs['job_name'], "qcheck") - mec.push(dict(filenames=self.outputs['data'])) - mec.execute( - "build_available_list(\"%s\")" % (available_list,) - ) - clusterdesc = self.config.get('cluster', 'clusterdesc') - - with clusterlogger(self.logger) as (loghost, logport): - self.logger.debug("Logging to %s:%d" % (loghost, logport)) - tasks = [] - for image_name in self.outputs['data']: - task = LOFARTask( - "result = run_qcheck(infile, pluginlist, outputdir)", - push=dict( - infile=image_name, - pluginlist=plugins, - outputdir=self.config.get('layout', 'results_directory'), - loghost=loghost, - logport=logport - ), - pull="result", - depend=utilities.check_for_path, - dependargs=(image_name, available_list) - ) - self.logger.info("Scheduling processing of %s" % (image_name,)) - tasks.append(tc.run(task)) - self.logger.info("Waiting for all qcheck tasks to complete") - tc.barrier(tasks) - - for task in tasks: - tc.get_task_result(task) - - mec.execute("clear_available_list(\"%s\")" % (available_list,)) - self.logger.info("qcheck done") - -if __name__ == '__main__': - sys.exit(eval(os.path.splitext(os.path.basename(sys.argv[0]))[0])().main()) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/qcheck/README b/CEP/Pipeline/recipes/sip/master/deprecated/qcheck/README deleted file mode 100644 index e7152d38e659459637ff431db2feff799e5cb698..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/qcheck/README +++ /dev/null @@ -1,4 +0,0 @@ -Simple image quality check, designed for use in (deprecated) pipeline qcheck -recipe. - -Original by Evert Rol. diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/qcheck/qcheck.py b/CEP/Pipeline/recipes/sip/master/deprecated/qcheck/qcheck.py deleted file mode 100644 index eb99a3cf6425562cadc98111eb8d51a3faf4b873..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/qcheck/qcheck.py +++ /dev/null @@ -1,200 +0,0 @@ -from pyrap import tables as ptables -import numpy -import logging -import sys -import os.path -import pylab -from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas -from matplotlib.figure import Figure - - -DEFAULTS = {} -DEFAULTS['fieldnames'] = ['logtable', 'coords', 'units'] -DEFAULTS['colnames'] = ['map'] -IMAGEDIMS = {'y': 3, 'x': 4, 'polarization': 2, 'channel': 1} - -""" - -TODO: - - - check for NaNs - -""" - - - -def check_basics(image, loggers): - logger = loggers["main"] - assert image.ndim == 5, "image does not have 5 dimensions" - - -def clip_image(image, niter=0, clip=(-3, 3)): - if niter > 0: - mean = image.mean() - sigma = numpy.sqrt(image.var()) - return clip_image(image[(image > mean+clip[0]*sigma)&(image < mean+clip[1]*sigma)], - niter=niter-1, clip=clip) - return image - - -def check_stats(image, filename, loggers, plot=False): - BINCOUNTS = 1000 - MINNBINS = 20 - CLIPCOUNTS = 0.001 - NSIGMA = 0.1 - NMAXSIGMA = 10.0 - POLAXIS = ['I', 'Q', 'U', 'V'] - if plot: - figure = Figure() - canvas = FigureCanvas(figure) - npols = image.shape[IMAGEDIMS['polarization']] - nchannels = image.shape[IMAGEDIMS['channel']] - nsubplotrows = nsubplotcols = int(numpy.sqrt(npols)) - if nsubplotcols * nsubplotrows < npols: - nsubplotrows += 1 - for npol in range(npols): - if plot: - axes = figure.add_subplot(nsubplotrows, nsubplotcols, npol+1) - for nchan in range(nchannels): - twodimage = image[0, nchan, npol, :, :] - flatimage = twodimage.flatten() - mean = flatimage.mean() - variance = flatimage.var() - stddev = numpy.sqrt(variance) - median = numpy.median(flatimage) - imgmin, imgmax = min(flatimage), max(flatimage) - loggers["main"].info("%d.%d.minimum = %.4e" % (npol+1, nchan+1, - imgmin)) - loggers["main"].info("%d.%d.maximum = %.4e" % (npol+1, nchan+1, - imgmax)) - loggers["main"].info("%d.%d.mean = %.4e" % (npol+1, nchan+1, mean)) - loggers["main"].info("%d.%d.median = %.4e" % ( - npol+1, nchan+1, median)) - loggers["main"].info("%d.%d.Standard deviation = %.4e" % ( - npol+1, nchan+1,stddev)) - # Keep only the bins with a minimum number of counts, - # so we can 'fit' a Gaussian distribution to calculate the mode - nbins = (int(flatimage.size/BINCOUNTS) - if flatimage.size > 1e5 else MINNBINS) - counts, bins = numpy.histogram(flatimage, nbins) - clipped = {} - clipped['indices'] = counts > max(counts)*CLIPCOUNTS - clipped['counts'] = counts[clipped['indices']] - clipped['bins'] = bins[clipped['indices']] - if plot: - axes.plot(bins[numpy.invert(clipped['indices'])], - counts[numpy.invert(clipped['indices'])], 'ob') - clippedimage = flatimage[(flatimage >= min(clipped['bins'])) & - (flatimage <= max(clipped['bins']))] - nbins = (int(clippedimage.size/BINCOUNTS) - if clippedimage.size > 1e5 else MINNBINS) - counts, bins = numpy.histogram(clippedimage, nbins) - bins = (bins[0:-1] + bins[1:])/2. # new behaviour in numpy 1.2 - mode = sum(bins * counts)/sum(counts) - width = (numpy.sqrt(abs(sum( (bins - mode)**2 * counts) / - sum(counts)))) - loggers["main"].info("%d.%d.mode = %.4e" % (npol+1, nchan+1, mode)) - # Also calculate the statistics for a clipped image, ie - # only the background (no sources) - clippedimage = clip_image(flatimage, niter=3, clip=(-1, 1)) - mean = clippedimage.mean() - variance = clippedimage.var() - stddev = numpy.sqrt(variance) - median = numpy.median(clippedimage) - imgmin, imgmax = min(clippedimage), max(clippedimage) - loggers["main"].info("%d.%d.background-minimum = %.4e" % ( - npol+1, nchan+1, imgmin)) - loggers["main"].info("%d.%d.background-maximum = %.4e" % ( - npol+1, nchan+1, imgmax)) - loggers["main"].info("%d.%d.background-mean = %.4e" % ( - npol+1, nchan+1, mean)) - loggers["main"].info("%d.%d.background-median = %.4e" % ( - npol+1, nchan+1, median)) - loggers["main"].info("%d.%d.background-stddev = %.4e" % ( - npol+1, nchan+1, stddev)) - # Verify that mode, background mean & background median are within - # a few background sigma from each other: - if abs(mean-median) > NSIGMA*stddev: - loggers["warn"].warn( - " Background mean and background median are more " - "than %.1f standard deviations different" % NSIGMA) - if abs(mean-mode) > NSIGMA*stddev: - loggers["warn"].warn( - " Mode and background mean are more than %.1f " - "standard deviations different" % NSIGMA) - if abs(mode-median) > NSIGMA*stddev: - loggers["warn"].warn( - " Mode and background median are more than %.1f " - "standard deviations different" % NSIGMA) - if imgmax < 0: - loggers["warn"].warn(" Background maximum is negative") - if imgmin > 0: - loggers["warn"].warn(" Background minimum is positive") - if imgmax > NMAXSIGMA*stddev: - loggers["warn"].warn( - " Background maximum is more than %.1f the " - "standard deviation") - if imgmin < -NMAXSIGMA*stddev: - loggers["warn"].warn( - " Background minimum is less than %.1f the " - "standard deviation") - - if plot: - axes.plot(bins, counts, 'ob') - axes.plot(bins, max(counts) * numpy.exp(-(bins-mode)**2 / - (2 * width**2)), '-g') - if plot: - canvas.print_figure(plot) - - -def setup_logging(logfile): - loggers = {'main': logging.getLogger('main'), - 'warn': logging.getLogger('warn')} - handlers = {'main': logging.FileHandler(logfile, mode="w"), - 'warn': logging.StreamHandler()} - formatters = {'main': logging.Formatter("%(message)s"), - 'warn': logging.Formatter("%(levelname)s: %(message)s")} - handlers['main'].setFormatter(formatters['main']) - handlers['warn'].setFormatter(formatters['warn']) - loggers['main'].addHandler(handlers['main']) - loggers['warn'].addHandler(handlers['warn']) - loggers['main'].setLevel(logging.INFO) - loggers['warn'].setLevel(logging.WARNING) # warnings only - return loggers - - -def run(filename, logfile=None, plot=False, outputdir=False, loggers=False): - if not logfile: - logfile = filename + "_stats.log" - if not isinstance(plot, basestring): - plot = filename + "_histo.pdf" - if outputdir: - plot = os.path.join(outputdir, os.path.basename(plot)) - if not loggers: - loggers = setup_logging(logfile) - try: - table = ptables.table(filename, ack=False) - except RuntimeError: # pyrap is just a wrapper around C++, so no proper exceptions are thrown - loggers['main'].error("Error: image %s not properly opened" % filename) - return - names = {} - for part in ('col', 'field'): - partname = part + 'names' - names[part] = table.__getattribute__(partname)() - for defaultname in DEFAULTS[partname]: - if defaultname not in names[part]: - # use 'warn' logger instead? - # But script can't continue with this fault, - # so should quit - raise KeyError("%s not in %snames" % (defaultname, part)) - imgcol = table.col('map') - image = imgcol.getcol() - check_basics(image, loggers) - check_stats(image, filename, loggers, plot=plot) - - -if __name__ == '__main__': - args = sys.argv[1:] - if len(args) != 1: - sys.exit(1) - run(args[0], plot=True) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/sextractor.py b/CEP/Pipeline/recipes/sip/master/deprecated/sextractor.py deleted file mode 100644 index e4f566c383a23c7107a3807fc3c280563acb1e97..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/sextractor.py +++ /dev/null @@ -1,92 +0,0 @@ -import sys, os - -# Local helpers -from lofarpipe.support.lofarrecipe import LOFARrecipe -from lofarpipe.support.lofaringredient import LOFARinput, LOFARoutput -from lofarpipe.support.ipython import LOFARTask -import lofarpipe.support.utilities as utilities - -from tkp_lib.dataset import DataSet - -def sextract(image, dataset): - # Run on engine to source extract - from lofarrecipe.nodes.sextractor import sextract - return sextract(image, dataset) - -class sextractor(LOFARrecipe): - def __init__(self): - super(sextractor, self).__init__() - self.optionparser.add_option( - '-w', '--working-directory', - dest="working_directory", - help="Working directory used on compute nodes" - ) - - def go(self): - self.logger.info("Starting source extraction run") - super(sextractor, self).go() - - tc, mec = self._get_cluster() - mec.push_function( - dict( - sextract=sextract, - build_available_list=utilities.build_available_list - ) - ) - self.logger.info("Pushed functions to cluster") - - # We read the GVDS file to find the names of all the data files we're - # going to process, then push this list out to the engines so they can - # let us know which we have available - image_names = [ - "%s/%s" % (self._input_or_default('working_directory'), image) - for image in self.inputs['args'] - ] - - # Construct list of available files on engines - self.logger.info("Building list of data available on engines") - available_list = "%s%s" % (self.inputs['job_name'], "sextractor") - mec.push(dict(filenames=image_names)) - mec.execute( - "build_available_list(\"%s\")" % (available_list,) - ) - - tasks = [] - - dataset = DataSet(self.inputs['job_name']) - - for image_name in image_names: - task = LOFARTask( - "result = sextract(image_name, dataset)", - push=dict( - image_name=image_name, - dataset=dataset, - ), - pull="result", - depend=utilities.check_for_path, - dependargs=(image_name, available_list) - ) - self.logger.info("Scheduling processing of %s" % (image_name,)) - tasks.append(tc.run(task)) - self.logger.info("Waiting for all source extraction tasks to complete") - tc.barrier(tasks) - for task in tasks: - ##### Print failing tasks? - ##### Abort if all tasks failed? - res = tc.get_task_result(task) - self.logger.info(res) - if res.failure: - print res.failure - - mec.push_function( - dict( - clear_available_list=utilities.clear_available_list - ) - ) - # Save space on engines by clearing out old file lists - mec.execute("clear_available_list(\"%s\")" % (available_list,)) - - self.logger.info("Source extraction done") - -if __name__ == '__main__': - sys.exit(sextractor().main()) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/simple_se.py b/CEP/Pipeline/recipes/sip/master/deprecated/simple_se.py deleted file mode 100644 index 57fdec55ff2bb2040d00ca98329df8f6645783dc..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/simple_se.py +++ /dev/null @@ -1,122 +0,0 @@ -from __future__ import with_statement -from contextlib import closing - -# Local helpers -from lofarpipe.support.lofarrecipe import LOFARrecipe -import lofarpipe.support.utilities as utilities -import os, os.path, glob, subprocess, sys, numpy, shutil, errno, re - -# SE tools -from tkp_lib.dataset import DataSet -from tkp_lib.image import ImageData -from tkp_lib.accessors import FitsFile -from tkp_lib.dbplots import plotAssocCloudByXSource -from tkp_lib.dbregion import createRegionByImage -import tkp_lib.database as database - -associations = """ -SELECT - x1.xtrsrcid, x1.ra, x1.decl, x1.i_peak, x1.i_int, c.catname, c1.ra, c1.decl, a1.assoc_distance_arcsec -FROM - extractedsources x1 -LEFT OUTER JOIN - assoccatsources a1 ON x1.xtrsrcid = a1.xtrsrc_id -LEFT OUTER JOIN - catalogedsources c1 ON a1.assoc_catsrc_id = c1.catsrcid -LEFT OUTER JOIN - catalogs c ON c.catid = c1.cat_id -WHERE - image_id = %d -ORDER BY - x1.I_Peak; -""" - -class simple_se(LOFARrecipe): - """ - Run source extraction on FITS images on the front-end. - Dump ds9 region files of found sources & WENSS sources. - Dump text file of assocations with catalogue sources. - - Designed to be run e.g. on an averaged image at the end of a pipeline run. - """ - - def __init__(self): - super(simple_se, self).__init__() - self.optionparser.add_option( - '--detected-regions', - dest="detected_regions", - help="Filename for region file of local detections", - default="detected.reg" - ) - self.optionparser.add_option( - '--wenss-regions', - dest="wenss_regions", - help="Filename for region file of WENSS detections", - default="wenss.reg" - ) - self.optionparser.add_option( - '--associations', - dest="associations", - help="Filename for association list", - default="association.list" - ) - - def go(self): - self.logger.info("Starting source identification") - super(simple_se, self).go() - - ds_name = "%s-%s" % (self.inputs['job_name'], self.inputs['start_time']) - self.logger.info("Creating dataset %s" % (ds_name,)) - dataset = DataSet(ds_name) - src_ids = [] - for file in self.inputs['args']: - self.logger.info("Processing %s" % (file,)) - image = ImageData(FitsFile(file), dataset=dataset) - self.logger.info("Running source finder") - sr = image.sextract(det=5, anl=2) - with closing(database.connection()) as con: - self.logger.debug("Saving results to database") - sr.savetoDB(con) - self.logger.info("Generating source associations") - database.assocXSrc2XSrc(image.id, con) - database.assocXSrc2Cat(image.id, con) - self.logger.info("Querying for region file") - createRegionByImage(image.id[0], con, - os.path.join( - os.path.dirname(file), - self.inputs['detected_regions'] - ), logger=self.logger - ) - with closing(con.cursor()) as cur: - self.logger.info("Querying for association list") - my_query = associations % (image.id) - self.logger.debug(my_query) - cur.execute(my_query) - with open( - os.path.join( - os.path.dirname(file), - self.inputs['associations'] - ), - 'w' - ) as output_file: - for line in cur.fetchall(): - output_file.write(str(line) + '\n') - src_ids.append(line[0]) - - # Diagnostic plot for each extracted source - self.logger.info("Generating associations plots") - # Use set to uniqify the list of src_ids - src_ids = list(set(src_ids)) - with closing(database.connection()) as con: - for src_id in src_ids: - self.logger.debug("Generating associations plot for src %d" % src_id) - plotAssocCloudByXSource( - src_id, con, os.path.dirname(self.inputs['args'][0]) - ) - - self.outputs['data'] = None - return 0 - -if __name__ == '__main__': - sys.exit(eval(os.path.splitext(os.path.basename(sys.argv[0]))[0])().main()) - diff --git a/CEP/Pipeline/recipes/sip/master/skymodel.py b/CEP/Pipeline/recipes/sip/master/deprecated/skymodel.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/skymodel.py rename to CEP/Pipeline/recipes/sip/master/deprecated/skymodel.py diff --git a/CEP/Pipeline/recipes/sip/master/storagemapper.py b/CEP/Pipeline/recipes/sip/master/deprecated/storagemapper.py similarity index 100% rename from CEP/Pipeline/recipes/sip/master/storagemapper.py rename to CEP/Pipeline/recipes/sip/master/deprecated/storagemapper.py diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/trimmer.py b/CEP/Pipeline/recipes/sip/master/deprecated/trimmer.py deleted file mode 100644 index 71b5b16e8c042f80d5d450e7092821bd8b30c38a..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/trimmer.py +++ /dev/null @@ -1,27 +0,0 @@ -import sys -from lofarpipe.support.pyraprunner import pyraprunner - -class trimmer(pyraprunner): - def __init__(self): - super(trimmer, self).__init__() - self.optionparser.add_option( - '--start-seconds', - dest="start_seconds", - type="float", - help="Seconds to trim from start of data" - ) - self.optionparser.add_option( - '--end-seconds', - dest="end_seconds", - type="float", - help="Seconds to trim from end of data" - ) - - def _generate_arguments(self): - return "%f, %f" % ( - float(self.inputs['start_seconds']), - float(self.inputs['end_seconds']) - ) - -if __name__ == '__main__': - sys.exit(trimmer().main()) diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/vdsmaker.py b/CEP/Pipeline/recipes/sip/master/deprecated/vdsmaker.py deleted file mode 100644 index 0df58c549ff590b4247f440e31c34a48c30817ff..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/deprecated/vdsmaker.py +++ /dev/null @@ -1,175 +0,0 @@ -from __future__ import with_statement -import sys, os, tempfile, errno -import subprocess - -import lofarpipe.support.utilities as utilities -from lofarpipe.support.ipython import LOFARTask -from lofarpipe.support.lofarrecipe import LOFARrecipe -from lofarpipe.support.clusterlogger import clusterlogger -from lofarpipe.support.lofarnode import run_node - -class vdsmaker(LOFARrecipe): - def __init__(self): - super(vdsmaker, self).__init__() - self.optionparser.add_option( - '-g', '--gvds', - dest="gvds", - help="Output file name" - ) - self.optionparser.add_option( - '--directory', - dest="directory", - help="Directory for output files" - ) - self.optionparser.add_option( - '--makevds', - dest="makevds", - help="makevds executable", - default="/opt/LofIm/daily/lofar/bin/makevds" - ) - self.optionparser.add_option( - '--combinevds', - dest="combinevds", - help="combinevds executable", - default="/opt/LofIm/daily/lofar/bin/combinevds" - ) - self.optionparser.add_option( - '--unlink', - help="Unlink VDS files after combining", - default="True" - ) - - def go(self): - super(vdsmaker, self).go() - - ms_names = self.inputs['args'] - if self.inputs['unlink'] == "False": - self.inputs['unlink'] = False - - try: - os.makedirs(self.inputs['directory']) - except OSError, failure: - if failure.errno != errno.EEXIST: - raise - - tc, mec = self._get_cluster() - mec.push_function( - dict( - make_vds=run_node, - build_available_list=utilities.build_available_list, - clear_available_list=utilities.clear_available_list - ) - ) - self.logger.info("Pushed functions to cluster") - - # Build VDS files for each of the newly created MeasurementSets - self.logger.info("Building list of data available on engines") - available_list = "%s%s" % (self.inputs['job_name'], "dppp-vds") - mec.push(dict(filenames=ms_names)) - mec.execute( - "build_available_list(\"%s\")" % (available_list,) - ) - clusterdesc = self.config.get('cluster', 'clusterdesc') - - with clusterlogger(self.logger) as (loghost, logport): - self.logger.debug("Logging to %s:%d" % (loghost, logport)) - tasks = [] - vdsnames = [] - for ms_name in ms_names: - vdsnames.append( - "%s/%s.vds" % (self.inputs['directory'], os.path.basename(ms_name)) - ) - task = LOFARTask( - "result = make_vds(ms_name, clusterdesc, vds_name, executable)", - push=dict( - recipename=self.name, - nodepath=os.path.dirname(self.__file__.replace('master', 'nodes')), - ms_name=ms_name, - vds_name=vdsnames[-1], - clusterdesc=clusterdesc, - executable=self.inputs['makevds'], - loghost=loghost, - logport=logport - ), - pull="result", - depend=utilities.check_for_path, - dependargs=(ms_name, available_list) - ) - self.logger.info("Scheduling processing of %s" % (ms_name,)) - tasks.append(tc.run(task)) - self.logger.info("Waiting for all makevds tasks to complete") - tc.barrier(tasks) - - # Save space on engines by clearing out old file lists - mec.execute("clear_available_list(\"%s\")" % (available_list,)) - failure = False - for task in tasks: - res = tc.get_task_result(task) - if res.failure: - self.logger.warn("Task %s failed" % (task)) - self.logger.warn(res) - self.logger.warn(res.failure.getTraceback()) - failure = True - if failure: - return 1 - - # Combine VDS files to produce GDS - self.logger.info("Combining VDS files") - executable = self.inputs['combinevds'] - gvds_out = self.inputs['gvds'] - try: - command = [executable, gvds_out] + vdsnames - combineproc = subprocess.Popen( - command, - close_fds=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE - ) - sour, serr = combineproc.communicate() - if combineproc.returncode != 0: - raise subprocess.CalledProcessError(combineproc.returncode, command) - self.outputs['gvds'] = gvds_out - except subprocess.CalledProcessError, cpe: - self.logger.exception("combinevds failed with status %d: %s" % (cpe.returncode, serr)) - failure = True - except OSError, failure: - self.logger.warn("Caught OSError") - try: - if failure.errno == errno.EMFILE: - count = 0 - for x in xrange(0, os.sysconf('SC_OPEN_MAX')): - try: - self.logger.debug("open file %d: %s" (x, str(os.fstat(x)))) - count += 1 - except: - pass - self.logger.info("Had %d open files" % (count,)) - elif failure.errno == errno.ENOMEM: - self.logger.info("Failed to run: %s" % str(command)) - import operator - total = reduce(operator.add, (len(x) for x in command)) - self.logger.debug("Num args: %d, num characters: %d" % (len(command), total)) - try: - p = subprocess.Popen(['free'], stdout=subprocess.PIPE) - sout, serr = p.communicate() - self.logger.free(sout) - except: - self.logger.warn("Failed to spawn free") - self.logger.exception(failure) - else: - self.logger.exception(failure) - finally: - failure = True - finally: - if self.inputs["unlink"]: - self.logger.debug("Unlinking temporary files") - for file in vdsnames: - os.unlink(file) - self.logger.info("vdsmaker done") - if failure: - return 1 - else: - return 0 - -if __name__ == '__main__': - sys.exit(vdsmaker().main()) diff --git a/CEP/Pipeline/recipes/sip/master/new_bbs.py b/CEP/Pipeline/recipes/sip/master/new_bbs.py index 4997c9a2ba8376a2a67df5bcee348ee4b32e2e5e..02b99cb80765a3535edf758280e1dd32c93f1710 100644 --- a/CEP/Pipeline/recipes/sip/master/new_bbs.py +++ b/CEP/Pipeline/recipes/sip/master/new_bbs.py @@ -1,9 +1,11 @@ -# LOFAR IMAGING PIPELINE +# LOFAR IMAGING PIPELINE # -# BBS (BlackBoard Selfcal) recipe -# John Swinbank, 2009-10 -# swinbank@transientskp.org -# ------------------------------------------------------------------------------ +# BBS (BlackBoard Selfcal) recipe +# John Swinbank, 2009-10 +# swinbank@transientskp.org +# Wouter Klijn, 2012 +# klijn@astron.nl +# ----------------------------------------------------------------------------- from __future__ import with_statement import subprocess @@ -20,7 +22,6 @@ from lofar.parameterset import parameterset from lofarpipe.support.baserecipe import BaseRecipe from lofarpipe.support.group_data import load_data_map, store_data_map from lofarpipe.support.group_data import validate_data_maps -from lofarpipe.support.lofarexceptions import PipelineException from lofarpipe.support.pipelinelogging import CatchLog4CPlus from lofarpipe.support.pipelinelogging import log_process_output from lofarpipe.support.remotecommand import run_remote_command @@ -28,13 +29,14 @@ from lofarpipe.support.remotecommand import ComputeJob from lofarpipe.support.jobserver import job_server import lofarpipe.support.utilities as utilities import lofarpipe.support.lofaringredient as ingredient +from lofarpipe.support.utilities import create_directory class new_bbs(BaseRecipe): """ **This bbs recipe still uses the oldstyle bbs with global control** **New versions will have stand alone capability** - + The bbs recipe coordinates running BBS on a group of MeasurementSets. It runs both GlobalControl and KernelControl; as yet, SolverControl has not been integrated. @@ -111,7 +113,6 @@ class new_bbs(BaseRecipe): self.parset = parameterset() self.killswitch = threading.Event() - def _set_input(self, in_key, ps_key): """ Set the input-key `in_key` to the value of `ps_key` in the parset, if @@ -119,9 +120,8 @@ class new_bbs(BaseRecipe): """ try: self.inputs[in_key] = self.parset.getString(ps_key) - except RuntimeError, e: - self.logger.warn(str(e)) - + except RuntimeError, exceptionobject: + self.logger.warn(str(exceptionobject)) def _make_bbs_map(self): """ @@ -140,7 +140,7 @@ class new_bbs(BaseRecipe): '/data/scratch/loose/L29697/L29697_SAP000_SB000_uv.MS.instrument', '/data/scratch/loose/L29697/L29697_SAP000_SB000_uv.MS.sky') ) - + Returns `False` if validation of the three map-files fails, otherwise returns `True`. """ @@ -166,13 +166,12 @@ class new_bbs(BaseRecipe): return True - def go(self): self.logger.info("Starting BBS run") super(new_bbs, self).go() - # Check for relevant input parameters in the parset-file - # ---------------------------------------------------------------------- + # Check for relevant input parameters in the parset-file + # --------------------------------------------------------------------- self.logger.debug("Reading parset from %s" % self.inputs['parset']) self.parset = parameterset(self.inputs['parset']) @@ -183,8 +182,8 @@ class new_bbs(BaseRecipe): #self.logger.debug("self.inputs = %s" % self.inputs) - # Clean the blackboard database - # ---------------------------------------------------------------------- + # Clean the blackboard database + # --------------------------------------------------------------------- self.logger.info( "Cleaning BBS database for key '%s'" % (self.inputs['db_key']) ) @@ -202,8 +201,8 @@ class new_bbs(BaseRecipe): self.inputs['db_key'] ) - # Create a bbs_map describing the file mapping on disk - # ---------------------------------------------------------------------- + # Create a bbs_map describing the file mapping on disk + # --------------------------------------------------------------------- if not self._make_bbs_map(): return 1 @@ -218,18 +217,33 @@ class new_bbs(BaseRecipe): # file and database information into the supplied template # ------------------------------------------------------------------ self.logger.debug("Building parset for BBS control") - bbs_parset = utilities.patch_parset( - self.parset, - { - 'Observation': gvds_file, - 'BBDB.Key': self.inputs['db_key'], - 'BBDB.Name': self.inputs['db_name'], - 'BBDB.User': self.inputs['db_user'], - 'BBDB.Host': self.inputs['db_host'], - #'BBDB.Port': self.inputs['db_name'], - } - ) - self.logger.debug("BBS control parset is %s" % (bbs_parset,)) + # Create a location for parsets + job_directory = self.config.get( + "layout", "job_directory") + parset_directory = os.path.join(job_directory, "parsets") + create_directory(parset_directory) + + # patch the parset and copy result to target location remove tempfile + try: + bbs_parset = utilities.patch_parset( + self.parset, + { + 'Observation': gvds_file, + 'BBDB.Key': self.inputs['db_key'], + 'BBDB.Name': self.inputs['db_name'], + 'BBDB.User': self.inputs['db_user'], + 'BBDB.Host': self.inputs['db_host'], + #'BBDB.Port': self.inputs['db_name'], + } + ) + bbs_parset_path = os.path.join(parset_directory, + "bbs_control.parset") + shutil.copyfile(bbs_parset, bbs_parset_path) + self.logger.debug("BBS control parset is %s" % (bbs_parset_path,)) + + finally: + # Always remove the file in the tempdir + os.remove(bbs_parset) try: # When one of our processes fails, we set the killswitch. @@ -262,7 +276,8 @@ class new_bbs(BaseRecipe): command = "python %s" % (self.__file__.replace('master', 'nodes')) jobpool = {} bbs_kernels = [] - with job_server(self.logger, jobpool, self.error) as (jobhost, jobport): + with job_server(self.logger, jobpool, self.error) as(jobhost, + jobport): self.logger.debug("Job server at %s:%d" % (jobhost, jobport)) for job_id, details in enumerate(self.bbs_map): host, files = details @@ -284,10 +299,11 @@ class new_bbs(BaseRecipe): ) ) self.logger.info("Starting %d threads" % len(bbs_kernels)) - [thread.start() for thread in bbs_kernels] + for thread in bbs_kernels: + thread.start() self.logger.debug("Waiting for all kernels to complete") - [thread.join() for thread in bbs_kernels] - + for thread in bbs_kernels: + thread.join() # When GlobalControl finishes, our work here is done # ---------------------------------------------------------- @@ -295,11 +311,12 @@ class new_bbs(BaseRecipe): bbs_control.join() finally: os.unlink(bbs_parset) - if self.killswitch.isSet(): - # If killswitch is set, then one of our processes failed so - # the whole run is invalid - # ---------------------------------------------------------- - return 1 + + if self.killswitch.isSet(): + # If killswitch is set, then one of our processes failed so + # the whole run is invalid + # ---------------------------------------------------------- + return 1 self.outputs['mapfile'] = self.inputs['data_mapfile'] return 0 @@ -321,11 +338,12 @@ class new_bbs(BaseRecipe): self.environment, arguments=arguments ) - except Exception, e: + except OSError: self.logger.exception("BBS Kernel failed to start") self.killswitch.set() return 1 - result = self._monitor_process(bbs_kernel_process, "BBS Kernel on %s" % host) + result = self._monitor_process(bbs_kernel_process, + "BBS Kernel on %s" % host) sout, serr = bbs_kernel_process.communicate() serr = serr.replace("Connection to %s closed.\r\n" % host, "") log_process_output("SSH session (BBS kernel)", sout, serr, self.logger) @@ -356,9 +374,11 @@ class new_bbs(BaseRecipe): env=self.environment ) # _monitor_process() needs a convenient kill() method. - bbs_control_process.kill = lambda : os.kill(bbs_control_process.pid, signal.SIGKILL) + bbs_control_process.kill = lambda : os.kill( + bbs_control_process.pid, signal.SIGKILL) except OSError, e: - self.logger.error("Failed to spawn BBS Control (%s)" % str(e)) + self.logger.error( + "Failed to spawn BBS Control (%s)" % str(e)) self.killswitch.set() return 1 finally: @@ -385,22 +405,33 @@ class new_bbs(BaseRecipe): while True: try: returncode = process.poll() - if returncode == None: # Process still running + # Process still running + if returncode == None: time.sleep(1) - elif returncode != 0: # Process broke! + + # Process broke! + elif returncode != 0: self.logger.warn( - "%s returned code %d; aborting run" % (name, returncode) + "%s returned code %d; aborting run" % (name, + returncode) ) self.killswitch.set() break - else: # Process exited cleanly + + # Process exited cleanly + else: self.logger.info("%s clean shutdown" % (name)) break - if self.killswitch.isSet(): # Other process failed; abort + + # Other process failed; abort + if self.killswitch.isSet(): self.logger.warn("Killing %s" % (name)) process.kill() returncode = process.wait() break + + # Catch All exceptions: we need to take down all processes whatever + # is throw except: # An exception here is likely a ctrl-c or similar. Whatever it # is, we bail out. diff --git a/CEP/Pipeline/recipes/sip/master/parset.test b/CEP/Pipeline/recipes/sip/master/parset.test deleted file mode 100644 index 8cb90402ed5a9aa36d543ceacb2a54fa5e6bfff0..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/master/parset.test +++ /dev/null @@ -1,5 +0,0 @@ -data=CORRECTED_DATA -operation=csclean -select="sumsqr(UVW[0:1])<1e8" -image=TestImage -maxbaseline=10000 diff --git a/CEP/Pipeline/recipes/sip/nodes/bbs.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/bbs.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/bbs.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/bbs.py diff --git a/CEP/Pipeline/recipes/sip/nodes/deprecated/casapy.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/casapy.py deleted file mode 100644 index 8478e836537d3b1d1c050236c2a7cdb40771a541..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/nodes/deprecated/casapy.py +++ /dev/null @@ -1,68 +0,0 @@ -# Python standard library -from __future__ import with_statement -from contextlib import closing -from subprocess import check_call, CalledProcessError -from dateutil.parser import parse as parse_date -from datetime import timedelta -import os.path, tempfile, shutil, time - -from pipeline.support.lofarnode import LOFARnode -from pipeline.support.utilities import patch_parset, create_directory, log_time -from pipeline.support.lofarexceptions import ExecutableMissing -import pipeline.support.utilities as utilities - -CASA_DATE_FORMAT = "%Y/%m/%d/%H:%M:%S.000" - -class casapy_node(LOFARnode): - def run(self, infile, parset, start_time, end_time, increment): - # Time execution of this job - with log_time(self.logger): - self.logger.info("Processing %s" % (infile,)) - - start_time = parse_date(start_time) - end_time = parse_date(end_time) - - self.logger.debug("Start time: %s, end time: %s" % (str(start_time), str(end_time))) - increment = timedelta(0, increment) - - process_start = start_time - while process_start < end_time: - process_end = process_start + increment - if process_end > end_time: - td = end_time - process_start - self.logger.info( - "Note: final image is %.3f seconds long" % ( - td.days * 86400 + td.seconds + td.microseconds / 1e6 - ) - ) - process_end = end_time - time_range = "\'%s~%s\'" % ( - process_start.strftime(CASA_DATE_FORMAT), - process_end.strftime(CASA_DATE_FORMAT) - ) - self.logger.debug("Now processing %s" % (time_range)) - - tmp_parset_filename = patch_parset( - parset, { - 'Selection.timerange': time_range, - 'Images.name': '-' + str(int(time.mktime(process_start.timetuple()))), - 'dataset': infile - } - ) - - try: - result = check_call([ - os.path.expanduser('~rol/sw/bin/casapy'), - tmp_parset_filename, - ]) - except CalledProcessError, e: - self.logger.error(str(e)) - self.logger.error("Failed dataset was %s %s" % (infile, time_range)) - raise Exception - finally: - # Clean up tempoerary files. - os.unlink(tmp_parset_filename) - - process_start += increment - - return result diff --git a/CEP/Pipeline/recipes/sip/nodes/cimager.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/cimager.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/cimager.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/cimager.py diff --git a/CEP/Pipeline/recipes/sip/nodes/deprecated/colmaker.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/colmaker.py deleted file mode 100644 index 7a2a43cdf7324e929f46a4022e1a84cd1e8aadf7..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/nodes/deprecated/colmaker.py +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import with_statement -import pyrap.tables - -from pipeline.support.lofarnode import LOFARnode -from pipeline.support.utilities import log_time - -class makecolumns_node(LOFARnode): - """ - Add imaging columns to a given MS using pyrap. - """ - def run(self, file): - with log_time(self.logger): - self.logger.info("Processing: %s" % (file)) - try: - pyrap.tables.addImagingColumns(file) - except ValueError: - self.logger.debug('Add imaging columns failed: already exist?') diff --git a/CEP/Pipeline/recipes/sip/nodes/count_timesteps.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/count_timesteps.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/count_timesteps.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/count_timesteps.py diff --git a/CEP/Pipeline/recipes/sip/nodes/demix/demixing.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/demix/demixing.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/demix/demixing.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/demix/demixing.py diff --git a/CEP/Pipeline/recipes/sip/nodes/demix/median_filter.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/demix/median_filter.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/demix/median_filter.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/demix/median_filter.py diff --git a/CEP/Pipeline/recipes/sip/nodes/demix/shiftphasecenter.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/demix/shiftphasecenter.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/demix/shiftphasecenter.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/demix/shiftphasecenter.py diff --git a/CEP/Pipeline/recipes/sip/nodes/demix/smoothdemix.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/demix/smoothdemix.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/demix/smoothdemix.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/demix/smoothdemix.py diff --git a/CEP/Pipeline/recipes/sip/nodes/demix/subtract_from_averaged.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/demix/subtract_from_averaged.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/demix/subtract_from_averaged.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/demix/subtract_from_averaged.py diff --git a/CEP/Pipeline/recipes/sip/nodes/demixing.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/demixing.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/demixing.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/demixing.py diff --git a/CEP/Pipeline/recipes/sip/nodes/deprecated/dummy_echo_parallel.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/dummy_echo_parallel.py deleted file mode 100644 index c165e51626d0d4497dc397c6424e440cd18a5f44..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/nodes/deprecated/dummy_echo_parallel.py +++ /dev/null @@ -1,14 +0,0 @@ -import subprocess -from lofarpipe.support.lofarnode import LOFARnode - -class dummy_echo_parallel(LOFARnode): - def run(self, filename, executable): - self.logger.info("Processing %s" % (filename)) - execute = [executable, filename] - - my_process = subprocess.Popen(execute, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - sout, serr = my_process.communicate() - self.logger.info("stdout: " + sout) - self.logger.info("stderr: " + serr) - - return filename diff --git a/CEP/Pipeline/recipes/sip/nodes/deprecated/excluder.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/excluder.py deleted file mode 100644 index 2d212e9bee656f306ea0a46928d1186630970c83..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/nodes/deprecated/excluder.py +++ /dev/null @@ -1,27 +0,0 @@ -from __future__ import with_statement -from pyrap.tables import table - -from lofarpipe.support.lofarnode import LOFARnode -from lofarpipe.support.utilities import log_time - -class excluder(LOFARnode): - """ - Remove data from the given station from the input MS. - """ - def run(self, input, output, *stations): - try: - t = table(input) - except Exception, e: - self.logger.error(str(e)) - raise e - try: - a = table(t.getkeyword('ANTENNA').split()[1]) - station_ids = [a.getcol('NAME').index(name) for name in stations] - selection = t.query( - "ANTENNA1 not in %s and ANTENNA2 not in %s" % - (str(station_ids), str(station_ids)) - ) - selection.copy(output, deep=True).close() - except Exception, e: - self.logger.error(str(e)) - raise e diff --git a/CEP/Pipeline/recipes/sip/nodes/flag_baseline.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/flag_baseline.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/flag_baseline.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/flag_baseline.py diff --git a/CEP/Pipeline/recipes/sip/nodes/deprecated/flagger.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/flagger.py deleted file mode 100644 index b5a6c49d2c6a72fc2f723049abef84f94aa8647b..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/nodes/deprecated/flagger.py +++ /dev/null @@ -1,31 +0,0 @@ -from __future__ import with_statement -from pyrap.tables import table -import numpy - -from lofarpipe.support.lofarnode import LOFARnode -from lofarpipe.support.utilities import log_time - -class flagger(LOFARnode): - """ - Flag out CORRECTED_DATA greater than some maximum value. - """ - def run(self, input, output, max_value): - with log_time(self.logger): - self.logger.info("Processing: %s" % (input)) - try: - t = table(input) - t2 = t.copy(output, deep=True) - t2.close() - t = table(output, readonly=False) - except Exception, e: - self.logger.error(str(e)) - raise e - try: - for i, data in enumerate(t.getcol('CORRECTED_DATA')): - if max([abs(val) for val in data[0]]) > max_value: - t.putcell('FLAG', i, numpy.array([[True, True, True, True]])) - t.putcell('FLAG_ROW', i, True) - t.close() - except Exception, e: - self.logger.error(str(e)) - raise e diff --git a/CEP/Pipeline/recipes/sip/nodes/make_flaggable.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/make_flaggable.py similarity index 100% rename from CEP/Pipeline/recipes/sip/nodes/make_flaggable.py rename to CEP/Pipeline/recipes/sip/nodes/deprecated/make_flaggable.py diff --git a/CEP/Pipeline/recipes/sip/nodes/deprecated/qcheck.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/qcheck.py deleted file mode 100644 index da2c5f6ad73e1c23ee43b89b64e136462b05f42b..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/nodes/deprecated/qcheck.py +++ /dev/null @@ -1,51 +0,0 @@ -from __future__ import with_statement -import os, imp, logging, errno - -from pipeline.support.lofarnode import LOFARnode -from pipeline.support.utilities import log_time - -class qcheck_node(LOFARnode): - """ - Run quality check modules on an image. - """ - def run(self, infile, pluginlist, outputdir): - with log_time(self.logger): - self.logger.info("Processing: %s" % (infile)) - - try: - os.makedirs(outputdir) - except OSError, failure: - if failure.errno != errno.EEXIST: - raise - - file_handler = logging.FileHandler(os.path.join( - outputdir, - os.path.basename(infile) + ".qcheck.log" - ), - mode='w' - ) - file_handler.setFormatter(logging.Formatter("%(message)s")) - file_logger = logging.getLogger('main') - file_logger.addHandler(file_handler) - file_logger.setLevel(logging.INFO) - pipeline_logger = logging.getLogger(self.logger.name + "." + os.path.basename(infile)) - pipeline_logger.setLevel(logging.WARN) - - loggers = {'main': file_logger, 'warn': pipeline_logger} - - for plugin in pluginlist: - try: - qcheck = imp.load_source('qcheck', plugin) - except ImportError: - self.logger.warn("Quality check module (%s) not found" % (plugin)) - try: - qcheck.run(infile, outputdir=outputdir, loggers=loggers) - except Exception, e: - self.logger.warn("Quality check failed on %s" % (infile)) - self.logger.exception(str(e)) - - # Tidy up for the next image - file_handler.flush() - loggers['main'].remove_handler(file_handler) - - return 0 diff --git a/CEP/Pipeline/recipes/sip/nodes/deprecated/sextractor.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/sextractor.py deleted file mode 100644 index bf87b51e9f75d3eeab8309eef21545e343771a3a..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/nodes/deprecated/sextractor.py +++ /dev/null @@ -1,59 +0,0 @@ -# Python standard library -from __future__ import with_statement -from contextlib import closing -from subprocess import check_call -from tempfile import mkdtemp -from ConfigParser import SafeConfigParser as ConfigParser -from shutil import rmtree -import os.path - -# Root directory for config file -from pipeline import __path__ as config_path - -from tkp_lib.accessors import FitsFile -from tkp_lib.image import ImageData -from tkp_lib.database import connection - -from tkp_lib.dataset import DataSet - -def sextract(filename, dataset): - raise NotImplementedError - # Hack around MonetDB concurrency issues(!) - import time, random - time.sleep(random.randint(0,60)) - - try: - config = ConfigParser() - config.read("%s/pipeline.cfg" % (config_path[0],)) - image2fits = config.get('sextractor', 'image2fits') - - tempdir = mkdtemp(dir='/data/swinbank') - fitsfile = os.path.join(tempdir, os.path.basename(filename) + ".fits") - - command_line = [image2fits, "in=%s" % (os.path.basename(filename)), "out=%s" % (fitsfile)] - cwd = os.path.dirname(filename) - - check_call( - command_line, - cwd=os.path.dirname(filename), - close_fds=True - ) - - image = ImageData(FitsFile(fitsfile), dataset=dataset) - except Exception, inst: - return "ERROR: %s on %s, %s" % (str((type(inst))), platform.node(), fitsfile) - - sr = image.sextract() - with closing(connection()) as con: - sr.savetoDB(con) - - rmtree(tempdir) - return "%s found %d sources" % (filename, len(sr)) - -if __name__ == "__main__": - from sys import argv - dataset = DataSet("command line") - try: - sextract(argv[1], dataset) - except: - print "Usage: sextractor [filename]" diff --git a/CEP/Pipeline/recipes/sip/nodes/deprecated/trimmer.py b/CEP/Pipeline/recipes/sip/nodes/deprecated/trimmer.py deleted file mode 100644 index 391a76ec89fb2986bdc057040263f5faba9a06e9..0000000000000000000000000000000000000000 --- a/CEP/Pipeline/recipes/sip/nodes/deprecated/trimmer.py +++ /dev/null @@ -1,32 +0,0 @@ -from __future__ import with_statement -from pyrap.tables import table - -from lofarpipe.support.lofarnode import LOFARnode -from lofarpipe.support.utilities import log_time - -class trimmer(LOFARnode): - """ - Remove data from the start and/or end of a MeasurementSet. - """ - def run(self, input, output, start_seconds, end_seconds): - # Remove data from the start and/or end of a MeasurementSet. - copy_columns = ",".join([ - 'UVW', 'FLAG', 'FLAG_CATEGORY', 'WEIGHT', 'SIGMA', 'ANTENNA1', - 'ANTENNA2', 'ARRAY_ID', 'DATA_DESC_ID', 'EXPOSURE', 'FEED1', 'FEED2', - 'FIELD_ID', 'FLAG_ROW', 'INTERVAL', 'OBSERVATION_ID', 'PROCESSOR_ID', - 'SCAN_NUMBER', 'STATE_ID', 'TIME', 'TIME_CENTROID', 'DATA', - 'WEIGHT_SPECTRUM' - ]) - try: - t = table(input) - selection = t.query( - "TIME > %.16f AND TIME < %.16f" % ( - t.getcol('TIME')[0] + float(start_seconds), - t.getcol('TIME')[-1] - float(end_seconds) - ), - columns=copy_columns - ) - selection.copy(output, deep=True) - except Exception, e: - self.logger.error(str(e)) - raise e diff --git a/CEP/Pipeline/recipes/sip/nodes/imager_awimager.py b/CEP/Pipeline/recipes/sip/nodes/imager_awimager.py index 75c68fe76cab00486ef04cd2d64b6da32edc4cf3..a2af35124a33d356d33693846a205115627cf0a9 100644 --- a/CEP/Pipeline/recipes/sip/nodes/imager_awimager.py +++ b/CEP/Pipeline/recipes/sip/nodes/imager_awimager.py @@ -34,14 +34,15 @@ from lofarpipe.support.parset import Parset import lofar.parmdb #@UnresolvedImport import numpy as np + class imager_awimager(LOFARnodeTCP): def run(self, executable, environment, parset, working_directory, output_image, concatenated_measurement_set, sourcedb_path, mask_patch_size): - """ + """ :param executable: Path to awimager executable :param environment: environment for catch_segfaults (executable runner) - :param parset: parameters for the awimager, + :param parset: parameters for the awimager, :param working_directory: directory the place temporary files :param output_image: location and filesname to story the output images the multiple images are appended with type extentions @@ -49,14 +50,14 @@ class imager_awimager(LOFARnodeTCP): :param sourcedb_path: Path the the sourcedb used to create the image mask :param mask_patch_size: Scaling of the patch around the source in the - mask + mask :rtype: self.outputs["image"] The path to the output image """ self.logger.info("Start imager_awimager node run:") log4_cplus_name = "imager_awimager" self.environment.update(environment) - + with log_time(self.logger): # **************************************************************** # 1. Calculate awimager parameters that depend on measurement set @@ -79,28 +80,33 @@ class imager_awimager(LOFARnodeTCP): working_directory, log4_cplus_name, sourcedb_path, mask_patch_size, image_path_head) - # ****************************************************************** + # ***************************************************************** # 4. Update the parset with calculated parameters, and output image patch_dictionary = {'uselogger': 'True', # enables log4cpluscd log 'ms': str(concatenated_measurement_set), 'cellsize': str(cell_size), 'npix': str(npix), 'wmax': str(w_max), - 'wprojplanes':str(w_proj_planes), - 'image':str(output_image), - 'maxsupport':str(npix), - #'mask':str(mask_file_path), #TODO REINTRODUCE + 'wprojplanes': str(w_proj_planes), + 'image': str(output_image), + 'maxsupport': str(npix), + #'mask':str(mask_file_path), #TODO REINTRODUCE # MASK, excluded to speed up in this debug stage } - # save the parset at the target dir for the image - temp_parset_filename = patch_parset(parset, patch_dictionary) + # save the parset at the target dir for the image calculated_parset_path = os.path.join(image_path_head, - "parset.par") - # Copy tmp file to the final location - shutil.copy(temp_parset_filename, calculated_parset_path) - self.logger.debug("Wrote parset for awimager run: {0}".format( + "parset.par") + + try: + temp_parset_filename = patch_parset(parset, patch_dictionary) + # Copy tmp file to the final location + shutil.copyfile(temp_parset_filename, calculated_parset_path) + self.logger.debug("Wrote parset for awimager run: {0}".format( calculated_parset_path)) + finally: + # remove temp file + os.remove(temp_parset_filename) # ***************************************************************** # 5. Run the awimager with the updated parameterset @@ -126,24 +132,26 @@ class imager_awimager(LOFARnodeTCP): # ********************************************************************* # 6. Return output # Append static .restored: This might change but prob. not - # The actual output image has this extention always, default of awimager + # The actual output image has this extention always, default of + # awimager self.outputs["image"] = output_image + ".restored" return 0 def _calc_par_from_measurement(self, measurement_set, parset): """ - (1) calculate and format some parameters that are determined runtime. + (1) calculate and format some parameters that are determined runtime. Based on values in the measurementset and input parameter (set): - a. <string> The cellsize + a. <string> The cellsize b. <int> The npixels in a each of the two dimension of the image c. <string> The largest baseline in the ms smaller then the maxbaseline d. <string> The number of projection planes - + The calculation of these parameters is done in three steps: 1. Calculate intermediate results based on the ms. - 2. The calculation of the actual target values using intermediate result + 2. The calculation of the actual target values using intermediate + result 3. Scaling of cellsize and npix to allow for user input of the npix """ @@ -155,16 +163,17 @@ class imager_awimager(LOFARnodeTCP): # npix round up to nearest pow 2 parset_npix = self._nearest_ceiled_power2(parset_object.getInt('npix')) - # Get the longest baseline + # Get the longest baseline sqrt_max_baseline = pt.taql( 'CALC sqrt(max([select sumsqr(UVW[:2]) from ' + \ '{0} where sumsqr(UVW[:2]) <{1} giving as memory]))'.format(\ measurement_set, baseline_limit * - baseline_limit))[0] #ask ger van diepen for details if ness. + baseline_limit))[0] # ask ger van diepen for details if ness. #Calculate the wave_length table_ms = pt.table(measurement_set) - table_spectral_window = pt.table(table_ms.getkeyword("SPECTRAL_WINDOW")) + table_spectral_window = pt.table( + table_ms.getkeyword("SPECTRAL_WINDOW")) freq = table_spectral_window.getcell("REF_FREQUENCY", 0) table_spectral_window.close() wave_length = pt.taql('CALC C()') / freq @@ -200,12 +209,12 @@ class imager_awimager(LOFARnodeTCP): "Calculated w_max and the number pf projection plances:" " {0} , {1}".format(w_max, w_proj_planes)) - # MAximum number of proj planes set to 1024: George Heald, Ger van + # MAximum number of proj planes set to 1024: George Heald, Ger van # Diepen if this exception occurs maxsupport = max(1024, npix) if w_proj_planes > maxsupport: - raise Exception("The number of projections planes for the current" + - "measurement set is to large.") + raise Exception("The number of projections planes for the current" + + "measurement set is to large.") # ********************************************************************* # 3. if the npix from the parset is different to the ms calculations, @@ -231,7 +240,7 @@ class imager_awimager(LOFARnodeTCP): """ _field_of_view calculates the fov, which is dependend on the station type, location and mode: - For details see: + For details see: (1) http://www.astron.nl/radio-observatory/astronomers/lofar-imaging-capabilities-sensitivity/lofar-imaging-capabilities/lofar """ @@ -247,7 +256,7 @@ class imager_awimager(LOFARnodeTCP): antenna_set = observation.getcell('LOFAR_ANTENNA_SET', 0) observation.close() - #static parameters for the station diameters ref (1) + #static parameters for the station diameters ref (1) hba_core_diameter = 30.8 hba_remote_diameter = 41.1 lba_inner = 32.3 @@ -275,13 +284,14 @@ class imager_awimager(LOFARnodeTCP): "Unknown antenna type encountered in Measurement set") #Get the wavelength - spectral_window_table = pt.table(table_ms.getkeyword("SPECTRAL_WINDOW")) + spectral_window_table = pt.table(table_ms.getkeyword( + "SPECTRAL_WINDOW")) freq = float(spectral_window_table.getcell("REF_FREQUENCY", 0)) wave_length = pt.taql('CALC C()') / freq spectral_window_table.close() # Now calculate the FOV see ref (1) - # alpha_one is a magic parameter: The value 1.3 is representative for a + # alpha_one is a magic parameter: The value 1.3 is representative for a # WSRT dish, where it depends on the dish illumination alpha_one = 1.3 @@ -322,17 +332,18 @@ class imager_awimager(LOFARnodeTCP): # 1. Create the parset used to make a mask mask_file_path = output_image + ".mask" - mask_patch_dictionary = {"npix":str(npix), - "cellsize":str(cell_size), - "image":str(mask_file_path), - "ms":str(concatenated_measurement_set), - "operation":"empty", - "stokes":"'I'" + mask_patch_dictionary = {"npix": str(npix), + "cellsize": str(cell_size), + "image": str(mask_file_path), + "ms": str(concatenated_measurement_set), + "operation": "empty", + "stokes": "'I'" } mask_parset = Parset.fromDict(mask_patch_dictionary) mask_parset_path = os.path.join(image_path_directory, "mask.par") mask_parset.writeFile(mask_parset_path) - self.logger.debug("Write parset for awimager mask creation: {0}".format( + self.logger.debug( + "Write parset for awimager mask creation: {0}".format( mask_parset_path)) # ********************************************************************* @@ -393,21 +404,21 @@ class imager_awimager(LOFARnodeTCP): Version 0.3 (Wouter Klijn, klijn@astron.nl) - Usage of sourcedb instead of txt document as 'source' of sources This allows input from different source sources - Version 0.31 (Wouter Klijn, klijn@astron.nl) + Version 0.31 (Wouter Klijn, klijn@astron.nl) - Adaptable patch size (patch size needs specification) - Patch size and geometry is broken: needs some astronomer magic to fix it, problem with afine transformation prol. Version 0.32 (Wouter Klijn, klijn@astron.nl) - - Renaming of variable names to python convention + - Renaming of variable names to python convention """ - pad = 500. # increment in maj/minor axes [arcsec] + # increment in maj/minor axes [arcsec] + pad = 500. # open mask mask = pim.image(mask_file_path, overwrite=True) mask_data = mask.getdata() xlen, ylen = mask.shape()[2:] - freq, stokes, null, null = mask.toworld([0, 0, 0, 0]) #@UnusedVariable - + freq, stokes, null, null = mask.toworld([0, 0, 0, 0]) #Open the sourcedb: table = pt.table(sourcedb_path + "::SOURCES") @@ -442,12 +453,13 @@ class imager_awimager(LOFARnodeTCP): # minor radius (+pad) in rad minor = (((min_raw + pad)) / 3600.) * np.pi / 180. pix_asc = pa_raw * np.pi / 180. - # wenss writes always 'GAUSSIAN' even for point sources + # wenss writes always 'GAUSSIAN' even for point sources #-> set to wenss beam+pad if maj == 0 or minor == 0: maj = ((54. + pad) / 3600.) * np.pi / 180. minor = ((54. + pad) / 3600.) * np.pi / 180. - elif source_type == 0: # set to wenss beam+pad + # set to wenss beam+pad + elif source_type == 0: maj = (((54. + pad) / 2.) / 3600.) * np.pi / 180. minor = (((54. + pad) / 2.) / 3600.) * np.pi / 180. pix_asc = 0. @@ -505,7 +517,7 @@ class imager_awimager(LOFARnodeTCP): # some helper functions def _nearest_ceiled_power2(self, value): """ - Return int value of the nearest Ceiled power of 2 for the + Return int value of the nearest Ceiled power of 2 for the suplied argument """ diff --git a/CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py b/CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py index c9ac3acc05125e41977fbc334cc6ce3453f4ff07..f2b714fa0cda4c0c476facf17a346dc036b79164 100644 --- a/CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py +++ b/CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py @@ -73,7 +73,7 @@ class imager_create_dbs(LOFARnodeTCP): #******************************************************************* # 2convert it to a sourcedb (casa table) if self._create_source_db(source_list, sourcedb_target_path, - working_directory, makesourcedb_path, + working_directory, makesourcedb_path, append) == None: self.logger.error("failed creating sourcedb") return 1 @@ -151,7 +151,7 @@ class imager_create_dbs(LOFARnodeTCP): os.path.basename(executable) ) as logger: catch_segfaults(cmd, working_directory, self.environment, - logger, cleanup = None) + logger, cleanup=None) except subprocess.CalledProcessError, called_proc_error: self.logger.error("Execution of external failed:") @@ -372,21 +372,101 @@ class imager_create_dbs(LOFARnodeTCP): if ra_c < 0: #gsm utils break when using negative ra_c ergo add 360 ra_c += 360.0 decl_c = float(decl_c) * (180 / math.pi) + self.logger.debug("external call to gsm module:") + self.logger.debug("gsm.expected_fluxes_in_fov(conn, {0} , {1}, {2}, {3}, {4}, {5})".format( + ra_c, decl_c, float(fov_radius), float(assoc_theta), sourcelist, "storespectraplots=False")) gsm.expected_fluxes_in_fov(conn, ra_c , decl_c, float(fov_radius), float(assoc_theta), sourcelist, storespectraplots=False) + self.logger.debug(gsm.__file__) + except Exception, exception: self.logger.error("expected_fluxes_in_fov raise exception: " + str(exception)) return 1 + # validate the retrieve sourcelist + fp = open(sourcelist) + sourcelist_corrected = self._validate_and_correct_sourcelist(fp.read()) + fp.close() + + if sourcelist_corrected != None: + self.logger.debug("Found duplicates in the sourcelist!") + self.logger.debug("Creating a new sourcelist") + #if a corrected sourcelist is created. + # move original sourcelist + shutil.move(sourcelist, sourcelist + "_with_duplicates") + # write correcte sourcelist at that location + fp = open(sourcelist, "w",) + fp.write(sourcelist_corrected) + self.logger.debug("Moved sourcelist and create a new sourcelist") + fp.close() + else: + self.logger.debug("Sourcelist did not contain duplicates") return 0 + def _validate_and_correct_sourcelist(self, sourcelist): + """ + Create a sourcelist with non duplicate entries based on the + supplied sourcelist + Return None of no duplicate found + """ + all_lines = sourcelist.split("\n") + header = "" + all_entries_list = [] + for line in all_lines: + #skip the whiteline + if len(line) == 0: + continue + # get the header + if line[0] == "#": + header = line + continue + # unpack the values + all_entries_list.append(line.split(",")) + + # Get the names for the entries + entrie_names = [] + for entrie in all_entries_list: + entrie_names.append(entrie[0]) #name is first index in entrie + + #enumerate over all names-1 + duplicate_entry_idx = 0 + for idx, name in enumerate(entrie_names[:-1]): + if name in entrie_names[idx + 1:]: + # If duplicate change current entrie to unique name + entrie_names[idx] = name + "_duplicate_{0}".format(duplicate_entry_idx) + duplicate_entry_idx += 1 + + # now put back the possible changed name + for entrie, entrie_name in zip(all_entries_list, + entrie_names) : + entrie[0] = entrie_name + + # Write the new sourcelist if we found duplicate entries! + if duplicate_entry_idx > 0: + new_lines = [] + # add header + new_lines.append(header) + # empty line + new_lines.append("") + # entries with non duplicate names + for entrie in all_entries_list: + new_lines.append(",".join(entrie)) + # return the sourcelist + return "\n".join(new_lines) + + return None + + + if __name__ == "__main__": # args contain information regarding to the logging server _jobid, _jobhost, _jobport = sys.argv[1:4] sys.exit(imager_create_dbs( _jobid, _jobhost, _jobport).run_with_stored_arguments()) + + diff --git a/CEP/Pipeline/recipes/sip/nodes/imager_prepare.py b/CEP/Pipeline/recipes/sip/nodes/imager_prepare.py index be24bf7e18bf0e695e213940d6d3eb977d143fbb..8c4d1c73ac386153dcd2f19addcb5940fe594555 100644 --- a/CEP/Pipeline/recipes/sip/nodes/imager_prepare.py +++ b/CEP/Pipeline/recipes/sip/nodes/imager_prepare.py @@ -1,9 +1,9 @@ # LOFAR IMAGING PIPELINE -# Prepare phase node -# Wouter Klijn +# Prepare phase node +# Wouter Klijn # 2012 # klijn@astron.nl -# ------------------------------------------------------------------------------ +# ----------------------------------------------------------------------------- from __future__ import with_statement import sys import shutil @@ -19,7 +19,7 @@ from lofarpipe.support.utilities import create_directory from lofarpipe.support.group_data import load_data_map from lofarpipe.support.subprocessgroup import SubProcessGroup -import pyrap.tables as pt #@UnresolvedImport +import pyrap.tables as pt # Some constant settings for the recipe _time_slice_dir_name = "time_slices" @@ -37,8 +37,8 @@ class imager_prepare(LOFARnodeTCP): 5. Concatenate the time slice measurment sets, to a single virtual ms. 6. Filter bad stations. Find station with repeated bad measurement and remove these completely from the dataset. - - **Members:** + + **Members:** """ def run(self, environment, parset, working_dir, processed_ms_dir, ndppp_executable, output_measurement_set, @@ -53,10 +53,10 @@ class imager_prepare(LOFARnodeTCP): input_map = load_data_map(raw_ms_mapfile) #****************************************************************** - # I. Create the directories used in this recipe + # I. Create the directories used in this recipe create_directory(processed_ms_dir) - # time slice dir_to_remove: assure empty directory: Stale data + # time slice dir_to_remove: assure empty directory: Stale data # is problematic for dppp time_slice_dir = os.path.join(working_dir, _time_slice_dir_name) create_directory(time_slice_dir) @@ -84,6 +84,12 @@ class imager_prepare(LOFARnodeTCP): time_slices_per_image, input_map, subbands_per_group, processed_ms_dir, parset, ndppp_executable) + # If no timeslices were created, bail out with exit status 1 + if len(time_slices) == 0: + self.logger.error("No timeslices were created.") + self.logger.error("Exiting with error state 1") + return 1 + self.logger.debug("Produced time slices: {0}".format(time_slices)) #*********************************************************** # 3. run rfi_concole: flag datapoints which are corrupted @@ -95,7 +101,8 @@ class imager_prepare(LOFARnodeTCP): # ndppp_executable fails if not present for ms in time_slices: pt.addImagingColumns(ms) - self.logger.debug("Added imaging columns to ms: {0}".format(ms)) + self.logger.debug( + "Added imaging columns to ms: {0}".format(ms)) #***************************************************************** # 5. Filter bad stations @@ -109,7 +116,7 @@ class imager_prepare(LOFARnodeTCP): output_measurement_set) #****************************************************************** - # return + # return self.outputs["time_slices"] = group_measurement_filtered self.outputs["completed"] = "true" @@ -120,7 +127,7 @@ class imager_prepare(LOFARnodeTCP): """ Perform a optionalskip_copy copy of the input ms: For testing purpose the output, the missing_files can be saved - allowing the skip of this step + allowing the skip of this step """ missing_files = [] temp_missing = os.path.join(processed_ms_dir, "temp_missing") @@ -147,7 +154,7 @@ class imager_prepare(LOFARnodeTCP): """ Collect all the measurement sets in a single directory: The measurement sets are located on different nodes on the cluster. - This function collects all the file in the input map in the + This function collects all the file in the input map in the processed_ms_dir Return value is a set of missing files """ missing_files = [] @@ -155,22 +162,23 @@ class imager_prepare(LOFARnodeTCP): #loop all measurement sets for node, path in input_map: # construct copy command - command = ["rsync", "-r", "{0}:{1}".format(node, path) , + command = ["rsync", "-r", "{0}:{1}".format(node, path), "{0}".format(processed_ms_dir)] self.logger.debug("executing: " + " ".join(command)) # Spawn a subprocess and connect the pipes - # DO NOT USE SUBPROCESSGROUP - # The copy step is performed 720 at once in that case which might - # saturate the cluster. + # DO NOT USE SUBPROCESSGROUP + # The copy step is performed 720 at once in that case which might + # saturate the cluster. copy_process = subprocess.Popen( command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # Wait for finish of copy inside the loop: enforce single tread copy + # Wait for finish of copy inside the loop: enforce single tread + # copy (stdoutdata, stderrdata) = copy_process.communicate() exit_status = copy_process.returncode @@ -200,9 +208,9 @@ class imager_prepare(LOFARnodeTCP): input_map, subbands_per_image, collected_ms_dir_name, parset, ndppp): """ - Run NDPPP: + Run NDPPP: Create dir for grouped measurements, assure clean workspace - Call with log for cplus and catch segfaults. Pparameters are + Call with log for cplus and catch segfaults. Pparameters are supplied in parset """ time_slice_path_collected = [] @@ -213,7 +221,7 @@ class imager_prepare(LOFARnodeTCP): ((idx_time_slice + 1) * subbands_per_image)] # get the filenames - input_subgroups = map(lambda x: x.split("/")[-1] , + input_subgroups = map(lambda x: x.split("/")[-1], list(zip(*input_map_subgroup)[1])) # join with the group_measurement_directory to get the locations @@ -226,29 +234,35 @@ class imager_prepare(LOFARnodeTCP): # construct time slice name time_slice_path = os.path.join(time_slice_dir_path, output_ms_name) - time_slice_path_collected.append(time_slice_path) msin = "['{0}']".format("', '".join(ndppp_input_ms)) # Update the parset with computed parameters patch_dictionary = {'uselogger': 'True', # enables log4cplus 'msin': msin, - 'msout':time_slice_path} + 'msout': time_slice_path} nddd_parset_path = time_slice_path + ".ndppp.par" - temp_parset_filename = patch_parset(parset, patch_dictionary) - shutil.copy(temp_parset_filename, nddd_parset_path) + try: + temp_parset_filename = patch_parset(parset, patch_dictionary) + shutil.copyfile(temp_parset_filename, nddd_parset_path) + # Remove the temp file + finally: + os.remove(temp_parset_filename) try: nddd_parset_path = time_slice_path + ".ndppp.par" temp_parset_filename = patch_parset(parset, patch_dictionary) shutil.copy(temp_parset_filename, nddd_parset_path) - self.logger.debug("Wrote a ndppp parset with runtime variables:" + self.logger.debug( + "Wrote a ndppp parset with runtime variables:" " {0}".format(nddd_parset_path)) - os.unlink(temp_parset_filename) except Exception, exception: self.logger.error("failed loading and updating the " + "parset: {0}".format(parset)) raise exception + # remove the temp file + finally: + os.unlink(temp_parset_filename) #run ndppp cmd = [ndppp, nddd_parset_path] @@ -256,13 +270,17 @@ class imager_prepare(LOFARnodeTCP): try: # Actual dppp call to externals (allows mucking) self._dppp_call(working_dir, ndppp, cmd, self.environment) + # append the created timeslice on succesfull run + time_slice_path_collected.append(time_slice_path) + # On error the current timeslice should be skipped except subprocess.CalledProcessError, exception: - self.logger.error(str(exception)) - return 1 + self.logger.warning(str(exception)) + continue + except Exception, exception: - self.logger.error(str(exception)) - return 1 + self.logger.warning(str(exception)) + continue return time_slice_path_collected @@ -270,9 +288,9 @@ class imager_prepare(LOFARnodeTCP): output_file_path): """ Msconcat to combine the time slices in a single ms: - It is a virtual ms, a ms with symbolic links to actual data is created! + It is a virtual ms, a ms with symbolic links to actual data is created! """ - pt.msconcat(group_measurements_collected, #@UndefinedVariable + pt.msconcat(group_measurements_collected, output_file_path, concatTime=True) self.logger.debug("Concatenated the files: {0} into the single measure" "mentset: {1}".format( @@ -281,25 +299,23 @@ class imager_prepare(LOFARnodeTCP): def _run_rficonsole(self, rficonsole_executable, time_slice_dir, time_slices): """ - _run_rficonsole runs the rficonsole application on the supplied timeslices - in time_slices. - + _run_rficonsole runs the rficonsole application on the supplied + timeslices in time_slices. + """ #loop all measurement sets rfi_temp_dir = os.path.join(time_slice_dir, "rfi_temp_dir") create_directory(rfi_temp_dir) - try: rfi_console_proc_group = SubProcessGroup(self.logger) for time_slice in time_slices: - temp_slice_path = os.path.join(temp_dir_path, + # Each rfi console needs own working space for temp files + temp_slice_path = os.path.join(rfi_temp_dir, os.path.basename(time_slice)) create_directory(temp_slice_path) - # Each rfi console needs own working space for temp files - temp_dir_path = os.path.join(rfi_temp_dir, os.path.basename(group_set)) - create_directory(temp_dir_path) + # construct copy command self.logger.info(time_slice) command = [rficonsole_executable, "-indirect-read", @@ -315,20 +331,20 @@ class imager_prepare(LOFARnodeTCP): raise Exception("an rfi_console_proc_group run failed!") finally: - shutil.rmtree(temp_dir_path) + shutil.rmtree(rfi_temp_dir) def _filter_bad_stations(self, group_measurements_collected, asciistat_executable, statplot_executable, msselect_executable): """ A Collection of scripts for finding and filtering of bad stations: - 1. First a number of statistics with regards to the spread of the data + 1. First a number of statistics with regards to the spread of the data is collected using the asciistat_executable. 2. Secondly these statistics are consumed by the statplot_executable which produces a set of bad stations. - 3. In the final step the bad stations are removed from the dataset using - ms select - + 3. In the final step the bad stations are removed from the dataset + using ms select + REF: http://www.lofar.org/wiki/lib/exe/fetch.php?media=msss:pandeymartinez-week9-v1p2.pdf """ # run asciistat to collect statistics about the ms @@ -353,7 +369,8 @@ class imager_prepare(LOFARnodeTCP): asciiplot_output = [] asciiplot_proc_group = SubProcessGroup(self.logger) for (ms, output_dir) in asciistat_output: - ms_stats = os.path.join(output_dir, os.path.split(ms)[1] + ".stats") + ms_stats = os.path.join( + output_dir, os.path.split(ms)[1] + ".stats") cmd_string = "{0} -i {1} -o {2}".format(statplot_executable, ms_stats, ms_stats) @@ -383,7 +400,7 @@ class imager_prepare(LOFARnodeTCP): #add the name of station station_to_filter.append(entries[1]) - # if this measurement does not contain baselines to skip do not + # if this measurement does not contain baselines to skip do not # filter and provide the original ms as output if len(station_to_filter) == 0: msselect_output[ms] = ms diff --git a/CEP/Pipeline/recipes/sip/nodes/imager_source_finding.py b/CEP/Pipeline/recipes/sip/nodes/imager_source_finding.py index f58e45748e7c6e0c27010ceb467a7b80c878341a..b8f41a9f7c1339217a749eee4bb421964f6ca12c 100644 --- a/CEP/Pipeline/recipes/sip/nodes/imager_source_finding.py +++ b/CEP/Pipeline/recipes/sip/nodes/imager_source_finding.py @@ -92,6 +92,7 @@ class imager_source_finding(LOFARnodeTCP): pass #do nothing bdsm_parameters[key] = parameter_value + # ***************************************************************** # 3. Start pybdsm self.logger.debug( @@ -119,7 +120,7 @@ class imager_source_finding(LOFARnodeTCP): img.write_catalog( outfile=catalog_output_path + "_{0}".format(str(idx)), catalog_type='gaul', clobber=True, - format="bbs") + format="bbs", force_output=True) self.logger.debug("Wrote list of sources to file at: {0})".format( catalog_output_path)) @@ -132,7 +133,7 @@ class imager_source_finding(LOFARnodeTCP): # Save the frequency from image header of the original input file, # This information is not written by pybdsm to the exported image - frequency = img.cfreq + frequency = img.frequency # if not set the maximum number of itteration us performed if n_itter_sourcefind == None: @@ -244,7 +245,7 @@ class imager_source_finding(LOFARnodeTCP): os.path.basename(create_sourcdb_exec) ) as logger: catch_segfaults(cmd, working_directory, self.environment, - logger, cleanup = None) + logger, cleanup=None) except Exception, exception: self.logger.error("Execution of external failed:") diff --git a/CEP/Pipeline/recipes/sip/pipeline.cfg.in b/CEP/Pipeline/recipes/sip/pipeline.cfg.in index 0ac8e373673366a5236dd3113798ba1d1eb09c5c..83de06dd17cf1d3f7749a5cf11064c105b4c1906 100644 --- a/CEP/Pipeline/recipes/sip/pipeline.cfg.in +++ b/CEP/Pipeline/recipes/sip/pipeline.cfg.in @@ -11,7 +11,7 @@ working_directory = /data/scratch/$ENV{USER} task_files = [%(lofarroot)s/share/pipeline/tasks.cfg] [layout] -job_directory = %(runtime_directory)s/jobs/%(job_name)s +job_directory = %(runtime_directory)s/%(job_name)s [cluster] clusterdesc = %(lofarroot)s/share/cep2.clusterdesc @@ -21,5 +21,5 @@ engine_ppath = %(pythonpath)s:%(pyraproot)s/lib:/opt/cep/pythonlibs/lib/python/s engine_lpath = %(lofarroot)s/lib:%(casaroot)s/lib:%(pyraproot)s/lib:%(hdf5root)s/lib:%(wcsroot)s/lib [logging] -log_file = %(runtime_directory)s/jobs/%(job_name)s/logs/%(start_time)s/pipeline.log +log_file = %(runtime_directory)s/%(job_name)s/logs/%(start_time)s/pipeline.log diff --git a/CEP/Pipeline/recipes/sip/tasks.cfg.in b/CEP/Pipeline/recipes/sip/tasks.cfg.in index db5f7b75b5f4ca314f340d5cbdaccbad5fb53f8d..bb8d2472f7c0c8342f5c3ee6c7a0910e7144ce84 100644 --- a/CEP/Pipeline/recipes/sip/tasks.cfg.in +++ b/CEP/Pipeline/recipes/sip/tasks.cfg.in @@ -1,105 +1,54 @@ -[cep2_datamapper] -recipe = cep2_datamapper -mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/data.mapfile - -[datamapper] -recipe = datamapper -mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/data.mapfile - [ndppp] recipe = dppp executable = %(lofarroot)s/bin/NDPPP dry_run = False -mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/dppp.mapfile -parset = %(runtime_directory)s/jobs/%(job_name)s/parsets/NDPPP.parset +mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/dppp.mapfile +parset = %(runtime_directory)s/%(job_name)s/parsets/NDPPP.parset #demix_always = #demix_if_needed = CasA nproc = 1 nthreads = 8 clobber = False -[bbs] -recipe = bbs -control_exec = %(lofarroot)s/bin/GlobalControl -kernel_exec = %(lofarroot)s/bin/KernelControl -parset = %(runtime_directory)s/jobs/%(job_name)s/parsets/bbs.parset -key = bbs_%(job_name)s -db_host = ldb001 -db_name = $ENV{USER} -db_user = postgres -makevds = %(lofarroot)s/bin/makevds -combinevds = %(lofarroot)s/bin/combinevds -makesourcedb = %(lofarroot)s/bin/makesourcedb -parmdbm = %(lofarroot)s/bin/parmdbm - [vdsreader] recipe = vdsreader -gvds = %(runtime_directory)s/jobs/%(job_name)s/vds/%(job_name)s.gvds +gvds = %(runtime_directory)s/%(job_name)s/vds/%(job_name)s.gvds [setupparmdb] recipe = setupparmdb executable = %(lofarroot)s/bin/parmdbm -mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/parmdb.mapfile +mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/parmdb.mapfile [setupsourcedb] recipe = setupsourcedb executable = %(lofarroot)s/bin/makesourcedb -mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/sky.mapfile - -[skymodel] -recipe = skymodel -min_flux = 0.5 -skymodel_file = %(runtime_directory)s/jobs/%(job_name)s/parsets/bbs.skymodel +mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/sky.mapfile [vdsmaker] recipe = vdsmaker -directory = %(runtime_directory)s/jobs/%(job_name)s/vds -gvds = %(runtime_directory)s/jobs/%(job_name)s/vds/%(job_name)s.gvds +directory = %(runtime_directory)s/%(job_name)s/vds +gvds = %(runtime_directory)s/%(job_name)s/vds/%(job_name)s.gvds makevds = %(lofarroot)s/bin/makevds combinevds = %(lofarroot)s/bin/combinevds -[cimager] -recipe = cimager -imager_exec = /opt/LofIm/daily/askapsoft/bin/cimager.sh -convert_exec = /opt/LofIm/daily/lofar/bin/convertimagerparset -parset = %(runtime_directory)s/jobs/%(job_name)s/parsets/mwimager.parset -results_dir = %(runtime_directory)s/jobs/%(job_name)s/results/%(start_time)s - -[flag_baseline] -recipe = flag_baseline - -[demixing] -recipe = demixing -demix_parset_dir = %(lofarroot)s/share/pipeline/demixing -db_host = ldb001 -skymodel = %(lofarroot)s/share/pipeline/skymodels/Ateam_LBA_CC.skymodel -demix_sources = CasA,CygA -mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/demix.mapfile -nproc=1 - [new_bbs] recipe = new_bbs control_exec = %(lofarroot)s/bin/GlobalControl kernel_exec = %(lofarroot)s/bin/KernelControl -parset = %(runtime_directory)s/jobs/%(job_name)s/parsets/BBS.parset -gvds = %(runtime_directory)s/jobs/%(job_name)s/vds/%(job_name)s.gvds +parset = %(runtime_directory)s/%(job_name)s/parsets/BBS.parset +gvds = %(runtime_directory)s/%(job_name)s/vds/%(job_name)s.gvds db_key = %(job_name)s db_host = ldb001 db_user = postgres db_name = $ENV{USER} -instrument_mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/instrument.mapfile -sky_mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/sky.mapfile -data_mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/bbs.mapfile +instrument_mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/instrument.mapfile +sky_mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/sky.mapfile +data_mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/bbs.mapfile [gainoutliercorrection] recipe = gainoutliercorrection executable = '' # Comment out the executable, for now use the editparmdb behaviour. #%(lofarroot)s/bin/parmexportcal -mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/instrument.mapfile - -[parmexportcal] -recipe = parmexportcal -executable = %(lofarroot)s/bin/parmexportcal -mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/instrument.mapfile +mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/instrument.mapfile [rficonsole] recipe = rficonsole @@ -139,13 +88,13 @@ fillrootimagegroup_exec = %(lofarroot)s/bin/fillRootImageGroup [copier] recipe = copier -mapfiles_dir = %(runtime_directory)s/jobs/%(job_name)s/mapfiles +mapfiles_dir = %(runtime_directory)s/%(job_name)s/mapfiles [bbs_reducer] recipe = bbs_reducer executable = %(lofarroot)s/bin/bbs-reducer -parset = %(runtime_directory)s/jobs/%(job_name)s/parsets/bbs.parset -instrument_mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/instrument.mapfile -sky_mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/sky.mapfile -data_mapfile = %(runtime_directory)s/jobs/%(job_name)s/mapfiles/bbs.mapfile +parset = %(runtime_directory)s/%(job_name)s/parsets/bbs.parset +instrument_mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/instrument.mapfile +sky_mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/sky.mapfile +data_mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/bbs.mapfile diff --git a/CEP/Pipeline/test/recipes/nodes/imager_create_dbs_test.py b/CEP/Pipeline/test/recipes/nodes/imager_create_dbs_test.py index 2cbdd591d2630e5dae08a2ef649221c9b41a0cd9..bce1838dae1be5b2a20c6acb58003b1e5b1651ef 100644 --- a/CEP/Pipeline/test/recipes/nodes/imager_create_dbs_test.py +++ b/CEP/Pipeline/test/recipes/nodes/imager_create_dbs_test.py @@ -288,6 +288,73 @@ class ImagerCreateDBsTest(unittest.TestCase): self.assertTrue(self.imager_create_dbs.logger.last()[1].count(error_message) > 0, "The last logged message is incorrect") + def test_validate_and_correct_sourcelist_duplicate(self): + input_sourcelist = """# (Name, Type, Ra, Dec, I, Q, U, V, ReferenceFrequency='60e6', SpectralIndex='[0.0]', MajorAxis, MinorAxis, Orientation) = format + +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.5251, -0.1572] +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.51, -2.1572] # <-- duplicatie +1410.6+7004, POINT, 14:10:37.39920000, +70.04.00.58800000, 0.6217, , , , , [-0.4707, -0.3064] +1413.4+7122, POINT, 14:13:24.47040000, +71.22.08.18400000, 0.5473, , , , , [-0.8313, 0.0274] +1414.8+6831, POINT, 14:14:49.54080000, +68.31.23.59200000, 1.627, , , , , [-0.5004, -0.1755]""" + + target_sourcelist = """# (Name, Type, Ra, Dec, I, Q, U, V, ReferenceFrequency='60e6', SpectralIndex='[0.0]', MajorAxis, MinorAxis, Orientation) = format + +1409.2+7035_duplicate_0, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.5251, -0.1572] +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.51, -2.1572] # <-- duplicatie +1410.6+7004, POINT, 14:10:37.39920000, +70.04.00.58800000, 0.6217, , , , , [-0.4707, -0.3064] +1413.4+7122, POINT, 14:13:24.47040000, +71.22.08.18400000, 0.5473, , , , , [-0.8313, 0.0274] +1414.8+6831, POINT, 14:14:49.54080000, +68.31.23.59200000, 1.627, , , , , [-0.5004, -0.1755]""" + + output_sourcelist = self.imager_create_dbs._validate_and_correct_sourcelist(input_sourcelist) + self.assertTrue(output_sourcelist == target_sourcelist, + "The produced sourcelist was not correct: duplicate entry was not correctted properly: \n{0} \n{1}".format(output_sourcelist, target_sourcelist)) + + def test_validate_and_correct_sourcelist_2duplicate(self): + input_sourcelist = """# (Name, Type, Ra, Dec, I, Q, U, V, ReferenceFrequency='60e6', SpectralIndex='[0.0]', MajorAxis, MinorAxis, Orientation) = format + +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.5251, -0.1572] +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.51, -2.1572] # <-- duplicatie +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.51, -2.1572] # <-- duplicatie +1410.6+7004, POINT, 14:10:37.39920000, +70.04.00.58800000, 0.6217, , , , , [-0.4707, -0.3064] +1413.4+7122, POINT, 14:13:24.47040000, +71.22.08.18400000, 0.5473, , , , , [-0.8313, 0.0274] +1414.8+6831, POINT, 14:14:49.54080000, +68.31.23.59200000, 1.627, , , , , [-0.5004, -0.1755]""" + + target_sourcelist = """# (Name, Type, Ra, Dec, I, Q, U, V, ReferenceFrequency='60e6', SpectralIndex='[0.0]', MajorAxis, MinorAxis, Orientation) = format + +1409.2+7035_duplicate_0, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.5251, -0.1572] +1409.2+7035_duplicate_1, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.51, -2.1572] # <-- duplicatie +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.51, -2.1572] # <-- duplicatie +1410.6+7004, POINT, 14:10:37.39920000, +70.04.00.58800000, 0.6217, , , , , [-0.4707, -0.3064] +1413.4+7122, POINT, 14:13:24.47040000, +71.22.08.18400000, 0.5473, , , , , [-0.8313, 0.0274] +1414.8+6831, POINT, 14:14:49.54080000, +68.31.23.59200000, 1.627, , , , , [-0.5004, -0.1755]""" + + output_sourcelist = self.imager_create_dbs._validate_and_correct_sourcelist(input_sourcelist) + self.assertTrue(output_sourcelist == target_sourcelist, + "The produced sourcelist was not correct: duplicate entry was not correctted properly: \n{0} \n{1}".format(output_sourcelist, target_sourcelist)) + + + + def test_validate_and_correct_sourcelist_nonduplicate(self): + input_sourcelist = """# (Name, Type, Ra, Dec, I, Q, U, V, ReferenceFrequency='60e6', SpectralIndex='[0.0]', MajorAxis, MinorAxis, Orientation) = format + +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.5251, -0.1572] +1409.2+7036, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.51, -2.1572] # <-- nonduplicatie +1410.6+7004, POINT, 14:10:37.39920000, +70.04.00.58800000, 0.6217, , , , , [-0.4707, -0.3064] +1413.4+7122, POINT, 14:13:24.47040000, +71.22.08.18400000, 0.5473, , , , , [-0.8313, 0.0274] +1414.8+6831, POINT, 14:14:49.54080000, +68.31.23.59200000, 1.627, , , , , [-0.5004, -0.1755]""" + + target_sourcelist = """# (Name, Type, Ra, Dec, I, Q, U, V, ReferenceFrequency='60e6', SpectralIndex='[0.0]', MajorAxis, MinorAxis, Orientation) = format + +1409.2+7035, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.5251, -0.1572] +1409.2+7036, POINT, 14:09:16.30080000, +70.35.38.18400000, 1.4221, , , , , [-0.51, -2.1572] # <-- nonduplicatie +1410.6+7004, POINT, 14:10:37.39920000, +70.04.00.58800000, 0.6217, , , , , [-0.4707, -0.3064] +1413.4+7122, POINT, 14:13:24.47040000, +71.22.08.18400000, 0.5473, , , , , [-0.8313, 0.0274] +1414.8+6831, POINT, 14:14:49.54080000, +68.31.23.59200000, 1.627, , , , , [-0.5004, -0.1755]""" + + output_sourcelist = self.imager_create_dbs._validate_and_correct_sourcelist(input_sourcelist) + self.assertTrue(output_sourcelist == None, + "The produced sourcelist was not correct: the output for correct sourcelists was not correct!") + if __name__ == "__main__": unittest.main() diff --git a/CEP/Pipeline/test/regression_tests/jenkins_config/calibrator_regression.config.xml b/CEP/Pipeline/test/regression_tests/jenkins_config/calibrator_regression.config.xml new file mode 100644 index 0000000000000000000000000000000000000000..22799078eae318173d1b89f09e2e116af70ae3e1 --- /dev/null +++ b/CEP/Pipeline/test/regression_tests/jenkins_config/calibrator_regression.config.xml @@ -0,0 +1,176 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <actions/> + <description>Regression/delta test for the LOFAR calibration pipeline. +Triggers after a build on changes in the trunk at 2:00 AM</description> + <logRotator> + <daysToKeep>-1</daysToKeep> + <numToKeep>15</numToKeep> + <artifactDaysToKeep>-1</artifactDaysToKeep> + <artifactNumToKeep>-1</artifactNumToKeep> + </logRotator> + <keepDependencies>false</keepDependencies> + <properties> + <hudson.plugins.redmine.RedmineProjectProperty> + <redmineWebsite>https://support.astron.nl/lofar_issuetracker/</redmineWebsite> + <projectName>lofarsys</projectName> + <redmineVersion>true</redmineVersion> + </hudson.plugins.redmine.RedmineProjectProperty> + </properties> + <scm class="hudson.scm.SubversionSCM"> + <locations> + <hudson.scm.SubversionSCM_-ModuleLocation> + <remote>https://svn.astron.nl/LOFAR/trunk/CEP</remote> + <local>LOFAR/CEP</local> + </hudson.scm.SubversionSCM_-ModuleLocation> + <hudson.scm.SubversionSCM_-ModuleLocation> + <remote>https://svn.astron.nl/LOFAR/trunk/CMake</remote> + <local>LOFAR/CMake</local> + </hudson.scm.SubversionSCM_-ModuleLocation> + </locations> + <browser class="hudson.plugins.viewVC.ViewVCRepositoryBrowser"> + <url>https://svn.astron.nl/</url> + <location>LOFAR</location> + </browser> + <excludedRegions/> + <includedRegions/> + <excludedUsers/> + <excludedRevprop/> + <excludedCommitMessages/> + <workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/> + </scm> + <assignedNode>LCE072</assignedNode> + <canRoam>false</canRoam> + <disabled>false</disabled> + <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> + <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> + <jdk>(Default)</jdk> + <triggers class="vector"> + <hudson.triggers.SCMTrigger> + <spec>0 2 * * *</spec> + </hudson.triggers.SCMTrigger> + </triggers> + <concurrentBuild>true</concurrentBuild> + <customWorkspace>/home/lofarbuild/jenkins_builds/msss_calibrator</customWorkspace> + <builders> + <hudson.plugins.cmake.CmakeBuilder> + <sourceDir>LOFAR</sourceDir> + <buildDir>gnu_debug</buildDir> + <installDir>install</installDir> + <buildType>Debug</buildType> + <otherBuildType/> + <generator>Unix Makefiles</generator> + <makeCommand>make -j8</makeCommand> + <installCommand>make install -j8</installCommand> + <preloadScript/> + <cmakeArgs>-Wdev -DBUILD_ASKAPsoft=OFF -DUSE_OPENMP=ON -DBUILD_PACKAGES=Offline </cmakeArgs> + <projectCmakePath/> + <cleanBuild>false</cleanBuild> + <cleanInstallDir>false</cleanInstallDir> + <builderImpl/> + </hudson.plugins.cmake.CmakeBuilder> + <hudson.tasks.Shell> + <command># This command will perform the actual regression test steps + +# 1. A unit test +ctest -R pipeline + +# 2. set environment +. /opt/cep/login/bashrc +use LofIm +export PYTHONPATH=$WORKSPACE/install/lib/python2.6/dist-packages:$PYTHONPATH + +# 3. run the pipeline +#remove old state file +rm -f $WORKSPACE/install/var/run/pipeline/jobs/Observation64405/statefile + +# remove old data products +ssh lce068 "rm -rf /data/scratch/lofarbuild/Observation64405/*" +ssh lce069 "rm -rf /data/scratch/lofarbuild/Observation64405/*" + +mkdir -p $WORKSPACE/install/var/run/pipeline + +#copy the config file to a 'writable' location +cp $WORKSPACE/install/share/pipeline/pipeline.cfg $WORKSPACE/install/var/run/pipeline/pipeline_copy.cfg + +# replace clusterdesc file in the cfg file: allows running in lce072 +sed -i 's/cep2.clusterdesc/cep1_test.clusterdesc/g' $WORKSPACE/install/var/run/pipeline/pipeline_copy.cfg +cd $WORKSPACE/install/bin + +# Copy the parsetfile from a local to a global location +mkdir -p $WORKSPACE/parset_files +cp /data/lofar/testdata/CEP/Pipeline/calibrator_pipeline/Observation64405 $WORKSPACE/parset_files/Observation64405 + +# Run the calibrator with adapted cfg file +python msss_calibrator_pipeline.py $WORKSPACE/parset_files/Observation64405 -c $WORKSPACE/install/var/run/pipeline/pipeline_copy.cfg -d + +# 4. Test correct functioning +# a. copy target image data to the scratch directory +rm -rf /data/scratch/lofarbuild/pipeline_regression_test/calibrator +mkdir -p /data/scratch/lofarbuild/pipeline_regression_test/calibrator + +# copy target data +scp -r /data/lofar/testdata/CEP/Pipeline/calibrator_pipeline/datasets/*.INST /data/scratch/lofarbuild/pipeline_regression_test/calibrator + +# copy the run results +scp -r lce068:/data/scratch/lofarbuild/calibrator_test/L64405_SAP000_SB000_inst.INST /data/scratch/lofarbuild/pipeline_regression_test/calibrator/L64405_SAP000_SB000_inst.INST.result + +scp -r lce069:/data/scratch/lofarbuild/calibrator_test/L64405_SAP000_SB001_inst.INST /data/scratch/lofarbuild/pipeline_regression_test/calibrator/L64405_SAP000_SB001_inst.INST.result + +# c. Do actual comparison +#cd /data/scratch/lofarbuild/pipeline +# first sb +python $WORKSPACE/LOFAR/CEP/Pipeline/test/regression_tests/calibrator_pipeline.py /data/scratch/lofarbuild/pipeline_regression_test/calibrator/L64405_SAP000_SB000_inst.INST /data/scratch/lofarbuild/pipeline_regression_test/calibrator/L64405_SAP000_SB000_inst.INST.result 0.0001 + +#second subband +python $WORKSPACE/LOFAR/CEP/Pipeline/test/regression_tests/calibrator_pipeline.py /data/scratch/lofarbuild/pipeline_regression_test/calibrator/L64405_SAP000_SB001_inst.INST /data/scratch/lofarbuild/pipeline_regression_test/calibrator/L64405_SAP000_SB001_inst.INST.result 0.0001 + +# 5 remove the pipeline products +# On failure of the test this delete step is not performed and the data can be inspected +# ***************** DANGER: HERE BE DRAGONS!!************* +#ssh lce069 "rm -rf /data/scratch/lofarbuild/out/*" +#rm /home/lofarbuild/jenkins_builds/install/var/run/pipeline/jobs/out/statefile +# ***************** DANGER: HERE BE DRAGONS!!************* +</command> + </hudson.tasks.Shell> + </builders> + <publishers> + <hudson.plugins.warnings.WarningsPublisher> + <healthy/> + <unHealthy/> + <thresholdLimit>low</thresholdLimit> + <pluginName>[WARNINGS] </pluginName> + <defaultEncoding/> + <canRunOnFailed>true</canRunOnFailed> + <useDeltaValues>false</useDeltaValues> + <thresholds> + <unstableTotalAll/> + <unstableTotalHigh/> + <unstableTotalNormal/> + <unstableTotalLow/> + <unstableNewAll/> + <unstableNewHigh/> + <unstableNewNormal/> + <unstableNewLow/> + <failedTotalAll/> + <failedTotalHigh/> + <failedTotalNormal/> + <failedTotalLow/> + <failedNewAll/> + <failedNewHigh/> + <failedNewNormal/> + <failedNewLow/> + </thresholds> + <shouldDetectModules>false</shouldDetectModules> + <dontComputeNew>false</dontComputeNew> + <parserConfigurations/> + <consoleLogParsers> + <string>GNU compiler 4 (ld)</string> + <string>GNU compiler 4 (gcc)</string> + </consoleLogParsers> + </hudson.plugins.warnings.WarningsPublisher> + </publishers> + <buildWrappers> + <hudson.plugins.timestamper.TimestamperBuildWrapper/> + </buildWrappers> +</project> \ No newline at end of file diff --git a/CEP/Pipeline/test/regression_tests/jenkins_config/imaging_regression.config.xml b/CEP/Pipeline/test/regression_tests/jenkins_config/imaging_regression.config.xml new file mode 100644 index 0000000000000000000000000000000000000000..15d4c1c3da37a6cd920dc9cc085ac8d9aef727b6 --- /dev/null +++ b/CEP/Pipeline/test/regression_tests/jenkins_config/imaging_regression.config.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <actions/> + <description>Regression/delta test for the LOFAR imaging pipeline. +Triggers a build and test at midnight on changes in the trunk.</description> + <logRotator> + <daysToKeep>-1</daysToKeep> + <numToKeep>15</numToKeep> + <artifactDaysToKeep>-1</artifactDaysToKeep> + <artifactNumToKeep>-1</artifactNumToKeep> + </logRotator> + <keepDependencies>false</keepDependencies> + <properties> + <hudson.plugins.redmine.RedmineProjectProperty> + <redmineWebsite>https://support.astron.nl/lofar_issuetracker/</redmineWebsite> + <projectName>lofarsys</projectName> + <redmineVersion>true</redmineVersion> + </hudson.plugins.redmine.RedmineProjectProperty> + </properties> + <scm class="hudson.scm.SubversionSCM"> + <locations> + <hudson.scm.SubversionSCM_-ModuleLocation> + <remote>https://svn.astron.nl/LOFAR/trunk/CEP</remote> + <local>LOFAR/CEP</local> + </hudson.scm.SubversionSCM_-ModuleLocation> + <hudson.scm.SubversionSCM_-ModuleLocation> + <remote>https://svn.astron.nl/LOFAR/trunk/CMake</remote> + <local>LOFAR/CMake</local> + </hudson.scm.SubversionSCM_-ModuleLocation> + </locations> + <browser class="hudson.plugins.viewVC.ViewVCRepositoryBrowser"> + <url>https://svn.astron.nl/</url> + <location>LOFAR</location> + </browser> + <excludedRegions/> + <includedRegions/> + <excludedUsers/> + <excludedRevprop/> + <excludedCommitMessages/> + <workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/> + </scm> + <assignedNode>LCE072</assignedNode> + <canRoam>false</canRoam> + <disabled>false</disabled> + <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> + <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> + <jdk>(Default)</jdk> + <triggers class="vector"> + <hudson.triggers.SCMTrigger> + <spec>0 5 * * *</spec> + </hudson.triggers.SCMTrigger> + </triggers> + <concurrentBuild>true</concurrentBuild> + <customWorkspace>/home/lofarbuild/jenkins_builds</customWorkspace> + <builders> + <hudson.tasks.Shell> + <command># Perform svn steps needed before building +if [ -f $WORKSPACE/LOFAR/CMakeLists.txt ] + then echo "Found a previous checkout: updating"; svn up --depth files LOFAR + else echo "not found a previous checkout: checkingout"; svn checkout --depth files https://svn.astron.nl/LOFAR/trunk LOFAR +fi</command> + </hudson.tasks.Shell> + <hudson.plugins.cmake.CmakeBuilder> + <sourceDir>LOFAR</sourceDir> + <buildDir>gnu_debug</buildDir> + <installDir>install</installDir> + <buildType>Debug</buildType> + <otherBuildType/> + <generator>Unix Makefiles</generator> + <makeCommand>make -j8</makeCommand> + <installCommand>make install</installCommand> + <preloadScript/> + <cmakeArgs>-Wdev -DBUILD_ASKAPsoft=OFF -DUSE_OPENMP=ON -DBUILD_PACKAGES=Offline </cmakeArgs> + <projectCmakePath/> + <cleanBuild>false</cleanBuild> + <cleanInstallDir>false</cleanInstallDir> + <builderImpl/> + </hudson.plugins.cmake.CmakeBuilder> + <hudson.tasks.Shell> + <command># This command will perform the actual regression test steps + +# 1. A unit test +ctest -R pipeline + +# 2. set environment +. /opt/cep/login/bashrc +use LofIm +use Pythonlibs +export PYTHONPATH=$WORKSPACE/install/lib/python2.6/dist-packages:$PYTHONPATH + +# 3. run the pipeline +#remove old state file +rm -f $WORKSPACE/install/var/run/pipeline/jobs/Observation64405/statefile +ssh lce069 "rm -rf /data/scratch/lofarbuild/out/*" + +mkdir -p $WORKSPACE/install/var/run/pipeline +cd $WORKSPACE/install/bin + +python msss_imager_pipeline.py /data/lofar/testdata/CEP/Pipeline/imager_pipeline/basic_test/out.parset -c $WORKSPACE/install/share/pipeline/pipeline.cfg -d +# 4. Test correct functioning +# a. copy target image data to the scratch directory +scp -r /data/lofar/testdata/CEP/Pipeline/imager_pipeline/basic_test/image.restored /data/scratch/lofarbuild/pipeline/image.restored.target +scp -r lce069:/data/scratch/lofarbuild/out/awimage_cycle_0/image.restored /data/scratch/lofarbuild/pipeline/image.restored + +# b. copy target sourcelist to the scratch directory +scp -r /data/lofar/testdata/CEP/Pipeline/imager_pipeline/basic_test/bdsm_catalog /data/scratch/lofarbuild/pipeline/bdsm_catalog.target +scp -r lce069:/data/scratch/lofarbuild/out/awimage_cycle_0/bdsm_catalog /data/scratch/lofarbuild/pipeline/bdsm_catalog + +# c. Do actual comparison +cd /data/scratch/lofarbuild/pipeline + +python $WORKSPACE/LOFAR/CEP/Pipeline/test/regression_tests/imaging_pipeline.py bdsm_catalog bdsm_catalog.target image.restored image.restored.target 0.0002 + +# 5 remove the pipeline products +# On failure of the test this delete step is not performed and the data can be inspected +# ***************** DANGER: HERE BE DRAGONS!!************* +ssh lce069 "rm -rf /data/scratch/lofarbuild/out/*" +rm /home/lofarbuild/jenkins_builds/install/var/run/pipeline/jobs/out/statefile +# ***************** DANGER: HERE BE DRAGONS!!************* +</command> + </hudson.tasks.Shell> + </builders> + <publishers> + <hudson.plugins.warnings.WarningsPublisher> + <healthy/> + <unHealthy/> + <thresholdLimit>low</thresholdLimit> + <pluginName>[WARNINGS] </pluginName> + <defaultEncoding/> + <canRunOnFailed>true</canRunOnFailed> + <useDeltaValues>false</useDeltaValues> + <thresholds> + <unstableTotalAll/> + <unstableTotalHigh/> + <unstableTotalNormal/> + <unstableTotalLow/> + <unstableNewAll/> + <unstableNewHigh/> + <unstableNewNormal/> + <unstableNewLow/> + <failedTotalAll/> + <failedTotalHigh/> + <failedTotalNormal/> + <failedTotalLow/> + <failedNewAll/> + <failedNewHigh/> + <failedNewNormal/> + <failedNewLow/> + </thresholds> + <shouldDetectModules>false</shouldDetectModules> + <dontComputeNew>false</dontComputeNew> + <parserConfigurations/> + <consoleLogParsers> + <string>GNU compiler 4 (ld)</string> + <string>GNU compiler 4 (gcc)</string> + </consoleLogParsers> + </hudson.plugins.warnings.WarningsPublisher> + </publishers> + <buildWrappers> + <hudson.plugins.timestamper.TimestamperBuildWrapper/> + </buildWrappers> +</project> \ No newline at end of file diff --git a/CEP/Pipeline/test/regression_tests/jenkins_config/pipeline_task_regression.config.xml b/CEP/Pipeline/test/regression_tests/jenkins_config/pipeline_task_regression.config.xml new file mode 100644 index 0000000000000000000000000000000000000000..f2d69e1536d45089e325fb28b577e975b6876746 --- /dev/null +++ b/CEP/Pipeline/test/regression_tests/jenkins_config/pipeline_task_regression.config.xml @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <actions/> + <description>This is a jenkins build to test the imaging pipeline regressions test on task branches. +It performs a complete build from scratch. Builds the task branche and performs a simple imaging pipeline. +Produced data products are compared default data. +This build will fail if the branche produces output different to the baseline. +</description> + <logRotator> + <daysToKeep>-1</daysToKeep> + <numToKeep>15</numToKeep> + <artifactDaysToKeep>-1</artifactDaysToKeep> + <artifactNumToKeep>-1</artifactNumToKeep> + </logRotator> + <keepDependencies>false</keepDependencies> + <properties> + <hudson.plugins.redmine.RedmineProjectProperty> + <redmineWebsite>https://support.astron.nl/lofar_issuetracker/</redmineWebsite> + <projectName>lofarsys</projectName> + <redmineVersion>true</redmineVersion> + </hudson.plugins.redmine.RedmineProjectProperty> + <hudson.model.ParametersDefinitionProperty> + <parameterDefinitions> + <hudson.scm.listtagsparameter.ListSubversionTagsParameterDefinition> + <name>BRANCHE</name> + <description>Select a Subversion entry</description> + <tagsDir>https://svn.astron.nl/LOFAR/branches</tagsDir> + <tagsFilter/> + <reverseByDate>true</reverseByDate> + <reverseByName>false</reverseByName> + <defaultValue/> + <maxTags/> + <uuid>41b88e15-dbbe-4a3b-96b0-4a4b9949e906</uuid> + </hudson.scm.listtagsparameter.ListSubversionTagsParameterDefinition> + </parameterDefinitions> + </hudson.model.ParametersDefinitionProperty> + </properties> + <scm class="hudson.scm.SubversionSCM"> + <locations> + <hudson.scm.SubversionSCM_-ModuleLocation> + <remote>https://svn.astron.nl/LOFAR/branches/$BRANCHE/CEP</remote> + <local>LOFAR/CEP</local> + </hudson.scm.SubversionSCM_-ModuleLocation> + <hudson.scm.SubversionSCM_-ModuleLocation> + <remote>https://svn.astron.nl/LOFAR/branches/$BRANCHE/CMake</remote> + <local>LOFAR/CMake</local> + </hudson.scm.SubversionSCM_-ModuleLocation> + </locations> + <browser class="hudson.plugins.viewVC.ViewVCRepositoryBrowser"> + <url>https://svn.astron.nl/</url> + <location>LOFAR</location> + </browser> + <excludedRegions/> + <includedRegions/> + <excludedUsers/> + <excludedRevprop/> + <excludedCommitMessages/> + <workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/> + </scm> + <assignedNode>LCE072</assignedNode> + <canRoam>false</canRoam> + <disabled>false</disabled> + <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> + <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> + <jdk>(Default)</jdk> + <triggers class="vector"/> + <concurrentBuild>true</concurrentBuild> + <customWorkspace>/home/lofarbuild/jenkins_builds/imager_branche_test</customWorkspace> + <builders> + <hudson.tasks.Shell> + <command># Perform svn steps needed before building +echo "This is a test" +if [ -f $WORKSPACE/LOFAR/CMakeLists.txt ] + then echo "Found a previous checkout: updating"; svn up --depth files LOFAR + else echo "not found a previous checkout: checkingout"; svn checkout --depth files https://svn.astron.nl/LOFAR/branches/$BRANCHE LOFAR +fi +#svn checkout --depth files https://svn.astron.nl/LOFAR/branches/$BRANCHE LOFAR +</command> + </hudson.tasks.Shell> + <hudson.plugins.cmake.CmakeBuilder> + <sourceDir>LOFAR</sourceDir> + <buildDir>gnu_debug</buildDir> + <installDir>install</installDir> + <buildType>Debug</buildType> + <otherBuildType/> + <generator>Unix Makefiles</generator> + <makeCommand>make -j8</makeCommand> + <installCommand>make install</installCommand> + <preloadScript/> + <cmakeArgs>-Wdev -DBUILD_ASKAPsoft=OFF -DUSE_OPENMP=ON -DBUILD_PACKAGES=Offline </cmakeArgs> + <projectCmakePath/> + <cleanBuild>false</cleanBuild> + <cleanInstallDir>false</cleanInstallDir> + <builderImpl/> + </hudson.plugins.cmake.CmakeBuilder> + <hudson.tasks.Shell> + <command># This command will perform the actual regression test steps + +# 1. A unit test +ctest -R pipeline + +# ***************** DANGER: HERE BE DRAGONS!!************* +# assure existance of a single file in dir +ssh lce069 "touch /data/scratch/lofarbuild/$BRANCHE/file.txt" +ssh lce069 "rm -rf /data/scratch/lofarbuild/$BRANCHE/*" +rm -f $WORKSPACE/install/var/run/pipeline/jobs/$BRANCHE/statefile +# ***************** DANGER: HERE BE DRAGONS!!************* + +# 2. set environment +. /opt/cep/login/bashrc +use LofIm +use Pythonlibs +export PYTHONPATH=$WORKSPACE/install/lib/python2.6/dist-packages:$PYTHONPATH + +# 3. run the pipeline +mkdir -p $WORKSPACE/install/var/run/pipeline +cd $WORKSPACE/install/bin + +python msss_imager_pipeline.py /data/lofar/testdata/CEP/Pipeline/imager_pipeline/basic_test/out.parset -c $WORKSPACE/install/share/pipeline/pipeline.cfg --job $BRANCHE -d + +# 4. Test correct functioning +# a. copy target image data to the scratch directory +scp -r /data/lofar/testdata/CEP/Pipeline/imager_pipeline/basic_test/image.restored /data/scratch/lofarbuild/pipeline/image.restored.target +scp -r lce069:/data/scratch/lofarbuild/out/awimage_cycle_0/image.restored /data/scratch/lofarbuild/pipeline/image.restored + +# b. copy target sourcelist to the scratch directory +scp -r /data/lofar/testdata/CEP/Pipeline/imager_pipeline/basic_test/bdsm_catalog /data/scratch/lofarbuild/pipeline/bdsm_catalog.target +scp -r lce069:/data/scratch/lofarbuild/$BRANCHE/awimage_cycle_0/bdsm_catalog /data/scratch/lofarbuild/pipeline/bdsm_catalog + +# c. Do actual comparison +cd /data/scratch/lofarbuild/pipeline + +python $WORKSPACE/LOFAR/CEP/Pipeline/test/regression_tests/imaging_pipeline.py bdsm_catalog bdsm_catalog.target image.restored image.restored.target 0.0002 + + + +</command> + </hudson.tasks.Shell> + </builders> + <publishers> + <hudson.plugins.warnings.WarningsPublisher> + <healthy/> + <unHealthy/> + <thresholdLimit>low</thresholdLimit> + <pluginName>[WARNINGS] </pluginName> + <defaultEncoding/> + <canRunOnFailed>true</canRunOnFailed> + <useDeltaValues>false</useDeltaValues> + <thresholds> + <unstableTotalAll/> + <unstableTotalHigh/> + <unstableTotalNormal/> + <unstableTotalLow/> + <unstableNewAll/> + <unstableNewHigh/> + <unstableNewNormal/> + <unstableNewLow/> + <failedTotalAll/> + <failedTotalHigh/> + <failedTotalNormal/> + <failedTotalLow/> + <failedNewAll/> + <failedNewHigh/> + <failedNewNormal/> + <failedNewLow/> + </thresholds> + <shouldDetectModules>false</shouldDetectModules> + <dontComputeNew>false</dontComputeNew> + <parserConfigurations/> + <consoleLogParsers> + <string>GNU compiler 4 (ld)</string> + <string>GNU compiler 4 (gcc)</string> + </consoleLogParsers> + </hudson.plugins.warnings.WarningsPublisher> + </publishers> + <buildWrappers> + <hudson.plugins.timestamper.TimestamperBuildWrapper/> + </buildWrappers> +</project> \ No newline at end of file diff --git a/CEP/Pipeline/test/regression_tests/jenkins_config/target_regression.config.xml b/CEP/Pipeline/test/regression_tests/jenkins_config/target_regression.config.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe5cbfb521691fae52077137e93b19be6b67cb17 --- /dev/null +++ b/CEP/Pipeline/test/regression_tests/jenkins_config/target_regression.config.xml @@ -0,0 +1,176 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <actions/> + <description>Regression/delta test for the LOFAR target pipeline. +Triggers a build and test after midnight on changes in the trunk.</description> + <logRotator> + <daysToKeep>-1</daysToKeep> + <numToKeep>15</numToKeep> + <artifactDaysToKeep>-1</artifactDaysToKeep> + <artifactNumToKeep>-1</artifactNumToKeep> + </logRotator> + <keepDependencies>false</keepDependencies> + <properties> + <hudson.plugins.redmine.RedmineProjectProperty> + <redmineWebsite>https://support.astron.nl/lofar_issuetracker/</redmineWebsite> + <projectName>lofarsys</projectName> + <redmineVersion>true</redmineVersion> + </hudson.plugins.redmine.RedmineProjectProperty> + </properties> + <scm class="hudson.scm.SubversionSCM"> + <locations> + <hudson.scm.SubversionSCM_-ModuleLocation> + <remote>https://svn.astron.nl/LOFAR/trunk/CEP</remote> + <local>LOFAR/CEP</local> + </hudson.scm.SubversionSCM_-ModuleLocation> + <hudson.scm.SubversionSCM_-ModuleLocation> + <remote>https://svn.astron.nl/LOFAR/trunk/CMake</remote> + <local>LOFAR/CMake</local> + </hudson.scm.SubversionSCM_-ModuleLocation> + </locations> + <browser class="hudson.plugins.viewVC.ViewVCRepositoryBrowser"> + <url>https://svn.astron.nl/</url> + <location>LOFAR</location> + </browser> + <excludedRegions/> + <includedRegions/> + <excludedUsers/> + <excludedRevprop/> + <excludedCommitMessages/> + <workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/> + </scm> + <assignedNode>LCE072</assignedNode> + <canRoam>false</canRoam> + <disabled>false</disabled> + <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> + <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> + <jdk>(Default)</jdk> + <triggers class="vector"> + <hudson.triggers.SCMTrigger> + <spec>0 4 * * *</spec> + </hudson.triggers.SCMTrigger> + </triggers> + <concurrentBuild>true</concurrentBuild> + <customWorkspace>/home/lofarbuild/jenkins_builds/target_regression</customWorkspace> + <builders> + <hudson.plugins.cmake.CmakeBuilder> + <sourceDir>LOFAR</sourceDir> + <buildDir>gnu_debug</buildDir> + <installDir>install</installDir> + <buildType>Debug</buildType> + <otherBuildType/> + <generator>Unix Makefiles</generator> + <makeCommand>make -j4</makeCommand> + <installCommand>make install</installCommand> + <preloadScript/> + <cmakeArgs>-Wdev -DBUILD_ASKAPsoft=OFF -DUSE_OPENMP=ON -DBUILD_PACKAGES=Offline </cmakeArgs> + <projectCmakePath/> + <cleanBuild>false</cleanBuild> + <cleanInstallDir>false</cleanInstallDir> + <builderImpl/> + </hudson.plugins.cmake.CmakeBuilder> + <hudson.tasks.Shell> + <command># This command will perform the actual regression test steps + +# 1. A unit test +ctest -R pipeline + +# 2. set environment +. /opt/cep/login/bashrc +use LofIm +export PYTHONPATH=$WORKSPACE/install/lib/python2.6/dist-packages:$PYTHONPATH + +ssh lce068 "rm -rf /data/scratch/lofarbuild/Observation64406/*" +ssh lce069 "rm -rf /data/scratch/lofarbuild/Observation64406/*" +ssh lce068 "rm -rf /data/scratch/lofarbuild/target_integration/*" +ssh lce069 "rm -rf /data/scratch/lofarbuild/target_integration/*" + +# copy the test data to the correct place on the node +ssh lce068 "mkdir -p /data/scratch/lofarbuild/target_integration" +scp -rp /data/lofar/testdata/CEP/Pipeline/target_pipeline/datasets/L64372_SAP000_SB000_uv.MS lce068:/data/scratch/lofarbuild/target_integration + +scp -rp /data/lofar/testdata/CEP/Pipeline/target_pipeline/datasets/L64405_SAP000_SB000_inst.INST lce068:/data/scratch/lofarbuild/target_integration + +ssh lce069 "mkdir -p /data/scratch/lofarbuild/target_integration" +scp -rp /data/lofar/testdata/CEP/Pipeline/target_pipeline/datasets/L64372_SAP000_SB001_uv.MS lce069:/data/scratch/lofarbuild/target_integration + +scp -rp /data/lofar/testdata/CEP/Pipeline/target_pipeline/datasets/L64405_SAP000_SB001_inst.INST lce069:/data/scratch/lofarbuild/target_integration + +# 3. run the pipeline +#remove old state file +rm -f $WORKSPACE/install/var/run/pipeline/jobs/Observation64406/statefile + +mkdir -p $WORKSPACE/install/var/run/pipeline + +#copy the config file to a 'writable' location +cp $WORKSPACE/install/share/pipeline/pipeline.cfg $WORKSPACE/install/var/run/pipeline/pipeline_copy.cfg + +#copy the parset to a writable location +cp /data/lofar/testdata/CEP/Pipeline/target_pipeline/Observation64406 $WORKSPACE/install/var/run/pipeline/Observation64406 + +# replace clusterdesc file in the cfg file: allows running in lce072 +sed -i 's/cep2.clusterdesc/cep1_test.clusterdesc/g' $WORKSPACE/install/var/run/pipeline/pipeline_copy.cfg + +cd $WORKSPACE/install/bin + +python msss_target_pipeline.py $WORKSPACE/install/var/run/pipeline/Observation64406 -c $WORKSPACE/install/var/run/pipeline/pipeline_copy.cfg -d + +## 4. Test correct functioning +# a. copy target calibrated data to the scratch directory +mkdir -p /data/scratch/lofarbuild/target_regression_test +scp -r /data/lofar/testdata/CEP/Pipeline/target_pipeline/datasets/L64406_SB000_uv.dppp.MS_target /data/scratch/lofarbuild/target_regression_test/L64406_SB000_uv.dppp.MS_target +scp -r /data/lofar/testdata/CEP/Pipeline/target_pipeline/datasets/L64406_SB001_uv.dppp.MS_target /data/scratch/lofarbuild/target_regression_test/L64406_SB001_uv.dppp.MS_target + +# b. copy target sourcelist to the scratch directory +scp -r lce068:/data/scratch/lofarbuild/target_integration/L64406_SB000_uv.dppp.MS /data/scratch/lofarbuild/target_regression_test/L64406_SB000_uv.dppp.MS +scp -r lce069:/data/scratch/lofarbuild/target_integration/L64406_SB001_uv.dppp.MS /data/scratch/lofarbuild/target_regression_test/L64406_SB001_uv.dppp.MS + + +# c. Do actual comparison +python $WORKSPACE/LOFAR/CEP/Pipeline/test/regression_tests/target_pipeline.py /data/scratch/lofarbuild/target_regression_test/L64406_SB000_uv.dppp.MS_target /data/scratch/lofarbuild/target_regression_test/L64406_SB000_uv.dppp.MS + +python $WORKSPACE/LOFAR/CEP/Pipeline/test/regression_tests/target_pipeline.py /data/scratch/lofarbuild/target_regression_test/L64406_SB001_uv.dppp.MS_target /data/scratch/lofarbuild/target_regression_test/L64406_SB001_uv.dppp.MS + +</command> + </hudson.tasks.Shell> + </builders> + <publishers> + <hudson.plugins.warnings.WarningsPublisher> + <healthy/> + <unHealthy/> + <thresholdLimit>low</thresholdLimit> + <pluginName>[WARNINGS] </pluginName> + <defaultEncoding/> + <canRunOnFailed>true</canRunOnFailed> + <useDeltaValues>false</useDeltaValues> + <thresholds> + <unstableTotalAll/> + <unstableTotalHigh/> + <unstableTotalNormal/> + <unstableTotalLow/> + <unstableNewAll/> + <unstableNewHigh/> + <unstableNewNormal/> + <unstableNewLow/> + <failedTotalAll/> + <failedTotalHigh/> + <failedTotalNormal/> + <failedTotalLow/> + <failedNewAll/> + <failedNewHigh/> + <failedNewNormal/> + <failedNewLow/> + </thresholds> + <shouldDetectModules>false</shouldDetectModules> + <dontComputeNew>false</dontComputeNew> + <parserConfigurations/> + <consoleLogParsers> + <string>GNU compiler 4 (ld)</string> + <string>GNU compiler 4 (gcc)</string> + </consoleLogParsers> + </hudson.plugins.warnings.WarningsPublisher> + </publishers> + <buildWrappers> + <hudson.plugins.timestamper.TimestamperBuildWrapper/> + </buildWrappers> +</project> \ No newline at end of file diff --git a/CEP/Pipeline/test/regression_tests/target_pipeline.py b/CEP/Pipeline/test/regression_tests/target_pipeline.py new file mode 100644 index 0000000000000000000000000000000000000000..fff69f7a4cc33dc9aff5e7718746806163470af0 --- /dev/null +++ b/CEP/Pipeline/test/regression_tests/target_pipeline.py @@ -0,0 +1,64 @@ +import pyrap.tables as pt +import numpy +import sys + +def load_and_compare_data_sets(ms1, ms2): + # open the two datasets + ms1 = pt.table(ms1) + ms2 = pt.table(ms2) + + #get the amount of rows in the dataset + n_row = len(ms1.getcol('DATA')) + n_complex_vis = 4 + + # create a target array with the same length as the datacolumn + div_array = numpy.zeros((n_row, 1, n_complex_vis), dtype=numpy.complex64) + ms1_array = ms1.getcol('DATA') + ms2_array = ms2.getcol('DATA') + + div_max = 0 + for idx in xrange(n_row): + for idy in xrange(n_complex_vis): + + div_value = ms1_array[idx][0][idy] - ms2_array[idx][0][idy] + if numpy.abs(div_value) > numpy.abs(div_max): + div_max = div_value + + div_array[idx][0][idy] = div_value + print "maximum different value between measurement sets: {0}".format(div_max) + + if div_max != 0: + print "The measurement sets are contained a different value" + print "failed delta test!" + return False + + return True + + + + + +if __name__ == "__main__": + ms_1, mw_2 = None, None + # Parse parameters from command line + error = False + print sys.argv + try: + ms_1, mw_2 = sys.argv[1:3] + except Exception, e: + print e + print "usage: python {0} ms1 "\ + " ms2 ".format(sys.argv[0]) + print "target calibration is deterministic and should result in the same ms" + sys.exit(1) + + if not error: + print "regression test:" + data_equality = load_and_compare_data_sets(ms_1, mw_2) + + if not data_equality: + print "Regression test failed: exiting with exitstatus 1" + sys.exit(1) + + print "Regression test Succeed!!" + sys.exit(0) diff --git a/CEP/PyBDSM/doc/source/_templates/searchbox.html b/CEP/PyBDSM/doc/source/_templates/searchbox.html new file mode 100644 index 0000000000000000000000000000000000000000..5899a99386a7af32caef158b19909e6e781b19ad --- /dev/null +++ b/CEP/PyBDSM/doc/source/_templates/searchbox.html @@ -0,0 +1,24 @@ +{# + basic/searchbox.html + ~~~~~~~~~~~~~~~~~~~~ + + Sphinx sidebar template: quick search box. + + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{%- if pagename != "search" %} +<div id="searchbox" style="display: none"> + <h3>{{ _('Quick search') }}</h3> + <form class="search" action="{{ pathto('search') }}" method="get"> + <input type="text" name="q" /> + <input type="submit" value="{{ _('Go') }}" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + <p class="searchtip" style="font-size: 90%"> + {{ _('Enter search terms or a command, task, or parameter name.') }} + </p> +</div> +<script type="text/javascript">$('#searchbox').show(0);</script> +{%- endif %} diff --git a/CEP/PyBDSM/doc/source/conf.py b/CEP/PyBDSM/doc/source/conf.py index 2c1e500dc6ecc43001731d61acd1c94b4f8c2ad9..457c7341fe324ead8d63359a15ec162e34c25fcd 100644 --- a/CEP/PyBDSM/doc/source/conf.py +++ b/CEP/PyBDSM/doc/source/conf.py @@ -34,7 +34,7 @@ templates_path = ['_templates'] source_suffix = '.rst' # The encoding of source files. -#source_encoding = 'utf-8-sig' +source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' @@ -50,7 +50,7 @@ copyright = u'2012, David Rafferty and Niruj Mohan' # The short X.Y version. version = '1.4' # The full version, including alpha/beta/rc tags. -release = '1.4.0' +release = '1.4.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/CEP/PyBDSM/doc/source/examples.rst b/CEP/PyBDSM/doc/source/examples.rst index b435a3ad5d1a83828474dcb97da1a9053e534601..09fe759e3b88c404e9516b1b061c041756dd59a5 100644 --- a/CEP/PyBDSM/doc/source/examples.rst +++ b/CEP/PyBDSM/doc/source/examples.rst @@ -7,7 +7,7 @@ Below is an example of running PyBDSM on an image composed primarily of point so :: $ pybdsm - + PyBDSM version 1.1 (LOFAR revision 20883) ======================================================================== PyBDSM commands @@ -29,30 +29,30 @@ Below is an example of running PyBDSM on an image composed primarily of point so help 'par' .......... : Get help on a parameter (e.g., help 'rms_box') help changelog ...... : See list of recent changes ________________________________________________________________________ - + BDSM [1]: filename='VLSS.fits' - + .. note:: When PyBDSM starts up, the ``process_image`` task is automatically set to be the current task, so one does not need to set it with ``inp process_image``. - + :: BDSM [2]: frequency=74e6 - + .. note:: For this image, no frequency information was present in the image header, so the frequency must be specified manually. - + :: BDSM [3]: interactive=T - + .. note:: It is often advisable to use the interactive mode when processing an image for the first time. This mode will display the islands that PyBDSM has found before proceeding to fitting, allowing the user to check that they are reasonable. - + :: BDSM [4]: go @@ -84,23 +84,23 @@ Below is an example of running PyBDSM on an image composed primarily of point so Press "m" ........ : Change min and max scaling values Press "n" ........ : Show / hide island IDs Press "0" ........ : Reset scaling to default - Click Gaussian ... : Print Gaussian and source IDs (zoom_rect mode, - toggled with the "zoom" button and indicated in + Click Gaussian ... : Print Gaussian and source IDs (zoom_rect mode, + toggled with the "zoom" button and indicated in the lower right corner, must be off) ________________________________________________________________________ - + .. note:: At this point, because ``interactive=True``, PyBDSM plots the islands. Once the plot window is closed, PyBDSM prompts the user to continue or to quit fitting: :: - Press enter to continue or 'q' to quit .. : + Press enter to continue or 'q' to quit .. : Fitting islands with Gaussians .......... : [==========================================] 115/115 Total number of Gaussians fit to image .. : 147 Total flux in model ..................... : 211.800 Jy Number of sources formed from Gaussians : 117 - + The ``process_image`` task has now finished. PyBDSM estimated a reasonable value for the ``rms_box`` parameter and determined that 2-D rms and mean maps were required to model the background of the image. Straightforward island thresholding at the 5-sigma level was used, and the minimum island size was set at 5 pixels. In total 115 islands were found, and 147 Gaussians were fit to these islands. These 147 Gaussians were then grouped into 117 sources. To check the fit, call the ``show_fit`` task: @@ -115,8 +115,8 @@ The ``process_image`` task has now finished. PyBDSM estimated a reasonable value Press "m" ........ : Change min and max scaling values Press "n" ........ : Show / hide island IDs Press "0" ........ : Reset scaling to default - Click Gaussian ... : Print Gaussian and source IDs (zoom_rect mode, - toggled with the "zoom" button and indicated in + Click Gaussian ... : Print Gaussian and source IDs (zoom_rect mode, + toggled with the "zoom" button and indicated in the lower right corner, must be off) ________________________________________________________________________ @@ -138,26 +138,26 @@ Lastly, the plot window is closed, and the source catalog is written out to an A --------> inp(write_catalog) WRITE_CATALOG: Write the Gaussian, source, or shapelet list to a file. ================================================================================ - outfile ............... None : Output file name. None => file is named - automatically + outfile ............... None : Output file name. None => file is named + automatically bbs_patches ........... None : For BBS format, type of patch to use: None => no patches. 'single' => all Gaussians in one patch. 'gaussian' => each Gaussian gets its own patch. 'source' => all Gaussians belonging to a single - source are grouped into one patch + source are grouped into one patch catalog_type ......... 'gaul': Type of catalog to write: 'gaul' - Gaussian list, 'srl' - source list (formed by grouping - Gaussians), 'shap' - shapelet list - clobber .............. False : Overwrite existing file? + Gaussians), 'shap' - shapelet list + clobber .............. False : Overwrite existing file? format ................ 'bbs': Format of output catalog: 'bbs', 'ds9', 'fits', - 'star', 'kvis', or 'ascii' + 'star', 'kvis', or 'ascii' srcroot ............... None : Root name for entries in the output catalog. None - => use image file name - + => use image file name + BDSM [7]: catalog_type='srl' - + BDSM [8]: format='ascii' - + BDSM [9]: go ---------> go() --> Wrote ASCII file 'VLSS.fits.pybdsm.srl' @@ -166,7 +166,7 @@ Lastly, the plot window is closed, and the source catalog is written out to an A Image with artifacts -------------------- -Occasionally, an analysis run with the default parameters does not produce good results. For example, if there are significant deconvolution artifacts in the image, the ``thresh_isl``, ``thresh_pix``, or ``rms_box`` parameters might need to be changed to prevent PyBDSM from fitting Gaussians to such artifacts. An example of running PyBDSM with the default parameters on such an image is shown in the figures below. +Occasionally, an analysis run with the default parameters does not produce good results. For example, if there are significant deconvolution artifacts in the image, the ``thresh_isl``, ``thresh_pix``, or ``rms_box`` parameters might need to be changed to prevent PyBDSM from fitting Gaussians to such artifacts. An example of running PyBDSM with the default parameters on such an image is shown in the figures below. .. figure:: art_fit_def.png :scale: 50 % @@ -225,48 +225,119 @@ You can use the complete functionality of PyBDSM within Python scripts (see :ref .. note:: If you are working on the LOFAR CEP I/II clusters, then at some point before running the script, you will need to do:: - + $ use LofIm $ use Pythonlibs :: - + # pybdsm_example.py # - # This script fits a number of images automatically, writing out source + # This script fits a number of images automatically, writing out source # catalogs and residual and model images for each input image. Call it # with "python pybdsm_example.py" - + import lofar.bdsm as bdsm - + # Define the list of images to process and the parameter save file input_images = ['a2597.fits', 'a2256_1.fits', 'a2256_2.fits', 'a2256_3.fits', 'a2256_4.fits', 'a2256_5.fits'] save_file = 'a2256.sav' - + # Now loop over the input images and process them for input_image in input_images: - + if input_image == 'a2597.fits': # For this one image, run with different parameters. - # Note that the image name is the first argument to + # Note that the image name is the first argument to # process_image: img = bdsm.process_image(input_image, rms_box=(100,20)) - + else: # For the other images, use the 'a2256.sav` parameter save file. # The quiet argument is used to supress output to the terminal # (it still goes to the log file). - # Note: when a save file is used, it must be given first in the + # Note: when a save file is used, it must be given first in the # call to process_image: - img = bdsm.process_image(save_file, filename=input_image, quiet=True) + img = bdsm.process_image(save_file, filename=input_image, quiet=True) # Write the source list catalog. File is named automatically. - img.write_catalog(format='fits', catalog_type='srl') + img.write_catalog(format='fits', catalog_type='srl') # Write the residual image. File is name automatically. - img.export_image(img_type='gaus_resid') - + img.export_image(img_type='gaus_resid') + # Write the model image. File name is specified. - img.export_image(img_type='gaus_model', outfile=input_image+'.model') - + img.export_image(img_type='gaus_model', outfile=input_image+'.model') + + +.. _samp_example: + +Using SAMP interoperability +--------------------------- +PyBDSM supports SAMP (Simple Application Messaging Protocol) to provide interoperability to other applications, such as TOPCAT [#f1]_, ds9 [#f2]_, and Aladin [#f3]_. To use this functionality, a SAMP hub must be running (both TOPCAT and Aladin come with SAMP hubs). Below is an example of using PyBDSM with TOPCAT. In this example, it is assumed that an image has already been processed with ``process_image``. + +:: + + BDSM [1]: process_image('VLSS.fits') + ... + +At this point, make sure that TOPCAT is started and its SAMP hub is running (activated by clicking the "Attempt to connect to SAMP hub" icon in the lower right-hand corner and selecting "Start internal hub"). Next, we send the PyBDSM source list to TOPCAT with ``write_catalog``: + +:: + + BSDM [2]: inp write_catalog + --------> inp(write_catalog) + WRITE_CATALOG: Write the Gaussian, source, or shapelet list to a file. + ================================================================================ + outfile ............... None : Output file name. None => file is named + automatically; 'SAMP' => send to SAMP hub (e.g., + to TOPCAT, ds9, or Aladin) + bbs_patches ........... None : For BBS format, type of patch to use: None => no + patches. 'single' => all Gaussians in one patch. + 'gaussian' => each Gaussian gets its own patch. + 'source' => all Gaussians belonging to a single + source are grouped into one patch + catalog_type ......... 'gaul': Type of catalog to write: 'gaul' - Gaussian + list, 'srl' - source list (formed by grouping + Gaussians), 'shap' - shapelet list + clobber .............. False : Overwrite existing file? + format ................ 'bbs': Format of output catalog: 'bbs', 'ds9', 'fits', + 'star', 'kvis', or 'ascii' + srcroot ............... None : Root name for entries in the output catalog. None + => use image file name + + BDSM [3]: outfile='SAMP' + + BDSM [4]: catalog_type='srl' + + BDSM [5]: go + ---------> go() + --> Table sent to SAMP hub. + +TOPCAT should automatically load the table. Double-click on the table name in TOPCAT to open the table viewer. We can use now the ``show_fit`` task to highlight the table row that corresponds to a source of interest. To do this, we start ``show_fit`` with ``broadcast = True``: + +:: + + BDSM [6]: show_fit(broadcast=T) + ======================================================================== + NOTE -- With the mouse pointer in plot window: + Press "i" ........ : Get integrated flux densities and mean rms + values for the visible portion of the image + Press "m" ........ : Change min and max scaling values + Press "n" ........ : Show / hide island IDs + Press "0" ........ : Reset scaling to default + Click Gaussian ... : Print Gaussian and source IDs (zoom_rect mode, + toggled with the "zoom" button and indicated in + the lower right corner, must be off) + ________________________________________________________________________ + +Now, clicking on a Gaussian will highlight the row corresponding to the source to which the Gaussian belongs. Gaussian catalogs (i.e., made with ``catalog_type='srl'`` in ``write_catalog``) are also supported (and may be used simultaneously in TOPCAT with source catalogs). + +Images can be sent to ds9 or Aladin using the ``export_image`` task in the same way (with ``outfile = 'SAMP'``). Furthermore, if an image was sent, clicking on a Gaussian in the ``show_fit`` window will tell ds9 or Aladin to center their view on the coordinates of the Gaussian's center. + + +.. rubric:: Footnotes +.. [#f1] http://www.star.bristol.ac.uk/~mbt/topcat/ +.. [#f2] http://hea-www.harvard.edu/RD/ds9/site/Home.html +.. [#f3] http://aladin.u-strasbg.fr diff --git a/CEP/PyBDSM/doc/source/export_image.rst b/CEP/PyBDSM/doc/source/export_image.rst index e8eb8691b3879c1fac7d0c8bcf82b0fa65d6f524..ac353ad8406256f3cb9c77104dd931c9de295dca 100644 --- a/CEP/PyBDSM/doc/source/export_image.rst +++ b/CEP/PyBDSM/doc/source/export_image.rst @@ -11,14 +11,15 @@ Internally derived images (e.g, the Gaussian model image) can be exported to FIT EXPORT_IMAGE: Write one or more images to a file. ================================================================================ :term:`outfile` ............... None : Output file name. None => file is named - automatically; 'SAMP' => send to SAMP Hub (e.g., to + automatically; 'SAMP' => send to SAMP hub (e.g., to TOPCAT, ds9, or Aladin) :term:`clobber` .............. False : Overwrite existing file? :term:`img_format` ........... 'fits': Format of output image: 'fits' or 'casa' (at the moment only 'fits' is supported) :term:`img_type` ....... 'gaus_resid': Type of image to export: 'gaus_resid', 'shap_resid', 'rms', 'mean', 'gaus_model', - 'shap_model', 'ch0', 'pi' + 'shap_model', 'ch0', 'pi', 'psf_major', 'psf_minor', + 'psf_pa', 'psf_ratio', 'psf_ratio_aper' Each of the parameters is described in detail below. @@ -53,3 +54,13 @@ Each of the parameters is described in detail below. * ``'shap_model'`` - Shapelet model image + * ``'psf_major'`` - image of major axis FWHM variation (arcsec) + + * ``'psf_minor'`` - image of minor axis FWHM variation (arcsec) + + * ``'psf_pa'`` - image of position angle variation (degrees east of north) + + * ``'psf_ratio'`` - image of peak-to-total flux variation (1/beam) + + * ``'psf_ratio_aper'`` - image of peak-to-aperture flux variation (1/beam) + diff --git a/CEP/PyBDSM/doc/source/process_image.rst b/CEP/PyBDSM/doc/source/process_image.rst index 1fe0b26dcc080c510a2c560e563b0a6d84180732..67594324bbba6aa18dfe84d9bec31a6813851d6d 100644 --- a/CEP/PyBDSM/doc/source/process_image.rst +++ b/CEP/PyBDSM/doc/source/process_image.rst @@ -850,7 +850,7 @@ If ``psf_vary_do = True``, then the spatial variations in the PSF are estimated * The unresolved sources within each tile that have SNRs greater than ``psf_snrcutstack`` are then stacked to form a high-SNR PSF. For each tile, this PSF is fit with a Gaussian to recover its size. The significance of the variation in the sizes across the image is quantified. -* If the variation is significant, the major axis, minor axis, and position angle are then interpolated across the image. Where there is sufficient information, the interpolation is done using Delaunay triangulation; otherwise, the values within the tiles defined by tessellation are simply set to those of the appropriate PSF. +* If the variation is significant, the major axis, minor axis, and position angle are then interpolated across the image. Smoothing can be applied to these images to smooth out artifacts due to noise and the interpolation. Additionally, images are made of the ratio of peak-to-total flux and peak-to-aperture flux (if an aperture is specified). These ratio images provide conversions from total flux to peak flux for point sources. In the absence of smearing effects, these ratios should be around unity. However, if ionospheric effects are present, significant smearing can be present. In this case, these ratio images can be useful, for example, in determining the sensitivity at a particular location in the image to a point source with a given total flux. * Lastly, the deconvolved source sizes are adjusted to include the PSF variation as a function of position. @@ -868,6 +868,8 @@ The options for this module are as follows: :term:`psf_nsig` ............. 3.0 : Kappa for clipping within each bin :term:`psf_over` ............... 2 : Factor of nyquist sample for binning bmaj, etc. vs SNR + :term:`psf_smooth` .......... None : Size of Gaussian to use for smoothing of + interpolated images in arcsec. None => no smoothing :term:`psf_snrcut` .......... 10.0 : Minimum SNR for statistics :term:`psf_snrcutstack` ..... 15.0 : Unresolved sources with higher SNR taken for stacked psfs @@ -906,6 +908,9 @@ The options for this module are as follows: psf_over This parameter is an integer (default is 2). When constructing a set of 'unresolved' sources for psf estimation, this parameter controls the factor of nyquist sample for binning bmaj, etc. vs SNR. + psf_smooth + This parameter is a float (default is ``None``) that sets the smoothing scale (in arcsec) used to smooth the interpolated images. Generally, artifacts due to noise and the interpolation can be significantly reduced if the smoothing scale is similar to the typical source separation scale. + psf_snrcut This parameter is a float (default is 10.0). Only Gaussians with SNR greater than this are considered for processing. The minimum value is 5.0 diff --git a/CEP/PyBDSM/doc/source/show_fit.rst b/CEP/PyBDSM/doc/source/show_fit.rst index 99ae8a7c70f9887427066af7691b64124dc852e0..2a676f81fc9658517fb8cb5e282ba9ac2fda8266 100644 --- a/CEP/PyBDSM/doc/source/show_fit.rst +++ b/CEP/PyBDSM/doc/source/show_fit.rst @@ -10,70 +10,75 @@ PyBDSM includes a task named ``show_fit`` that allows the user to quickly check SHOW_FIT: Show results of fit. ================================================================================ + :term:`broadcast` ............ False : Broadcast Gaussian and source IDs and coordinates + to SAMP hub when a Gaussian is clicked? :term:`ch0_flagged` .......... False : Show the ch0 image with flagged Gaussians (if - any) overplotted + any) overplotted :term:`ch0_image` ............. True : Show the ch0 image. This is the image used for - source detection + source detection :term:`ch0_islands` ........... True : Show the ch0 image with islands and Gaussians (if - any) overplotted - :term:`gmodel_image` .......... True : Show the Gaussian model image - :term:`gresid_image` .......... True : Show the Gaussian residual image + any) overplotted + :term:`gmodel_image` .......... True : Show the Gaussian model image + :term:`gresid_image` .......... True : Show the Gaussian residual image :term:`mean_image` ............ True : Show the background mean image :term:`pi_image` ............. False : Show the polarized intensity image - :term:`psf_major` ............ False : Show the PSF major axis variation - :term:`psf_minor` ............ False : Show the PSF minor axis variation - :term:`psf_pa` ............... False : Show the PSF position angle variation - :term:`rms_image` ............. True : Show the background rms image - :term:`smodel_image` ......... False : Show the shapelet model image - :term:`source_seds` .......... False : Plot the source SEDs and best-fit spectral - indices (if image was processed with + :term:`psf_major` ............ False : Show the PSF major axis variation + :term:`psf_minor` ............ False : Show the PSF minor axis variation + :term:`psf_pa` ............... False : Show the PSF position angle variation + :term:`rms_image` ............. True : Show the background rms image + :term:`smodel_image` ......... False : Show the shapelet model image + :term:`source_seds` .......... False : Plot the source SEDs and best-fit spectral + indices (if image was processed with spectralindex_do = True). Sources may be chosen by ID with the 'c' key or, if ch0_islands = True, - by picking a source with the mouse - :term:`sresid_image` ......... False : Show the shapelet residual image + by picking a source with the mouse + :term:`sresid_image` ......... False : Show the shapelet residual image Each of the parameters is described in detail below. .. glossary:: + broadcast + This parameter is a Boolean (default is ``False``) that determines whether the Gaussian and source IDs and coordinates are sent to a running SAMP Hub when a Gaussian is clicked on. Note that for the IDs to be useful, a catalog must have been sent to the SAMP hub previously using the ``write_catalog`` task (with ``outfile = 'SAMP'``). + ch0_flagged This parameter is a Boolean (default is ``False``) that determines whether to plot the ch0 image (the image used for source detection) with any flagged Gaussians overplotted. - + ch0_image This parameter is a Boolean (default is ``True``) that determines whether to plot the ch0 image (the image used for source detection). - - ch0_islands + + ch0_islands This parameter is a Boolean (default is ``True``) that determines whether to plot the ch0 image (the image used for source detection) with islands and Gaussians overplotted. - + gmodel_image This parameter is a Boolean (default is ``True``) that determines whether to plot the Gaussian model image. - + gresid_image This parameter is a Boolean (default is ``True``) that determines whether to plot the Gaussian residual image. - + mean_image This parameter is a Boolean (default is ``True``) that determines whether to plot the background mean image. - + pi_image This parameter is a Boolean (default is ``False``) that determines whether to plot the polarized intensity image. - + psf_major This parameter is a Boolean (default is ``False``) that determines whether to plot the variation of the major axis of the PSF. - + psf_minor This parameter is a Boolean (default is ``False``) that determines whether to plot the variation of the minor axis of the PSF. - + psf_pa This parameter is a Boolean (default is ``False``) that determines whether to plot the variation of the position angle of the PSF. - + rms_image This parameter is a Boolean (default is ``True``) that determines whether to plot the background rms image. - + smodel_image This parameter is a Boolean (default is ``False``) that determines whether to plot the shapelet model image. - - source_seds - This parameter is a Boolean (default is ``False``) that determines whether to plot the source SEDs and best-fit spectral indices. - + + source_seds + This parameter is a Boolean (default is ``False``) that determines whether to plot the source SEDs and best-fit spectral indices. + sresid_image This parameter is a Boolean (default is ``False``) that determines whether to plot the shapelet residual image. diff --git a/CEP/PyBDSM/doc/source/whats_new.rst b/CEP/PyBDSM/doc/source/whats_new.rst index 8f18108a387784111a3d63a3b7855b653b48a0ec..b62ae3fffb345b2de8af56556476b1ba4ca6fa0c 100644 --- a/CEP/PyBDSM/doc/source/whats_new.rst +++ b/CEP/PyBDSM/doc/source/whats_new.rst @@ -4,6 +4,40 @@ What's New ********** +Version 1.4.5 (2012/10/12): + + * Added option (``incl_empty``) to include empty islands (that have no un-flagged Gaussians) in output catalogs. Any such empty islands are given negative source IDs and have positions given by the location of the peak of the island. + + * Fixed a bug in Gaussian fitting that could cause a crash when fitting fails. + + * Fixed a bug in parallelization that could cause a crash due to improper concatenation of result lists. + +Version 1.4.4 (2012/10/09): + + * Fixed a bug related to the parallelization of Gaussian fitting that could cause a crash due to improper mapping of island lists to processes. + + * Improved logging. + + * Added a warning when one or more islands are not fit (i.e., no valid, unflagged Gaussians were found). + + * Added code to handle images with no unblanked pixels. + + * Improved fitting robustness. + +Version 1.4.3 (2012/10/04): + + * Fixed a bug in the mean map calculation that caused mean maps with constant values (i.e., non-2D maps) to have values of 0.0 Jy/beam unless ``mean_map = 'const'`` was explicitly specified. + + * Fixed a bug in the PSF vary module that resulted in incorrect PSF generators being used. Added an option to smooth the resulting PSF images (``psf_smooth``). Parallelized the PSF interpolation and smoothing steps. Improved PSF vary documentation. + +Version 1.4.2 (2012/09/25): + + * Dramatically reduced time required to identify valid wavelet islands. Fixed bug that resulted in output FITS gaul tables being improperly sorted. + +Version 1.4.1 (2012/09/11): + + * Added SAMP (Simple Application Messaging Protocol) support to the write_catalog, export_image, and show_fit tasks. These tasks can now use SAMP to communicate with other programs connected to a SAMP hub (e.g., ds9, Topcat, Aladin). + Version 1.4.0 (2012/09/11): * Parallelized Gaussian fitting, shapelet decomposition, validation of wavelet islands, and mean/rms map generation. The number of cores to be used can be specified with the ``ncores`` option (default is to use all). diff --git a/CEP/PyBDSM/doc/source/write_catalog.rst b/CEP/PyBDSM/doc/source/write_catalog.rst index 70c79853da8e7cd31ebba5124072206fee1e7c92..e5fc7d128aaf49897999c110bd1432d3f1fcdc14 100644 --- a/CEP/PyBDSM/doc/source/write_catalog.rst +++ b/CEP/PyBDSM/doc/source/write_catalog.rst @@ -17,7 +17,7 @@ The task parameters are as follows: WRITE_CATALOG: Write the Gaussian, source, or shapelet list to a file. ================================================================================ :term:`outfile` ............... None : Output file name. None => file is named - automatically; 'SAMP' => send to SAMP Hub (e.g., to + automatically; 'SAMP' => send to SAMP hub (e.g., to TOPCAT, ds9, or Aladin) :term:`bbs_patches` ........... None : For BBS format, type of patch to use: None => no patches. 'single' => all Gaussians in one patch. @@ -32,6 +32,8 @@ The task parameters are as follows: :term:`format` ................ 'bbs': Format of output Gaussian list: 'bbs', 'ds9', 'fits', 'star', 'kvis', or 'ascii' :term:`incl_chan` ............ False : Include fluxes from each channel (if any)? + :term:`incl_empty` ........... False : Include islands without any valid Gaussians + (source list only)? :term:`srcroot` ............... None : Root name for entries in the output catalog. None => use image file name @@ -40,7 +42,7 @@ Each of the parameters is described in detail below. .. glossary:: outfile - This parameter is a string (default is ``None``) that sets the name of the output file. If ``None``, the file is named automatically. If 'SAMP' the table is sent to a running SAMP Hub (e.g., to TOPCAT or Aladin). + This parameter is a string (default is ``None``) that sets the name of the output file. If ``None``, the file is named automatically. If 'SAMP' the full catalog (i.e., ``format = 'fits'``) is sent to a running SAMP Hub (e.g., to TOPCAT or Aladin). bbs_patches This parameter is a string (default is ``None``) that sets the type of patch to use in BBS-formatted catalogs. When the Gaussian catalogue is written as a BBS-readable sky file, this @@ -86,6 +88,9 @@ Each of the parameters is described in detail below. incl_chan This parameter is a Boolean (default is ``False``) that determines whether the total flux densities of each source measured in each channel by the spectral index module are included in the output. + incl_empty + This parameter is a Boolean (default is ``False``) that determines whether islands without any valid Gaussians are included in the output catalog. This option is only available for source lists. If True, islands for which Gaussian fitting failed will be included in the output catalog. In these cases, the source IDs are negative. + srcroot This parameter is a string (default is ``None``) that sets the root for source names in the output catalog. diff --git a/CEP/PyBDSM/src/python/__init__.py b/CEP/PyBDSM/src/python/__init__.py index 2d3e8d0db1d50b4ec20a66cc43c4895c10700ce9..e6b53202ead8503361be2061917064de8bd8f0ac 100644 --- a/CEP/PyBDSM/src/python/__init__.py +++ b/CEP/PyBDSM/src/python/__init__.py @@ -124,13 +124,14 @@ def _run_op_list(img, chain): mylog = mylogger.logging.getLogger("PyBDSM.Init") mylog.info("PyBDSM version %s (LUS revision %s)" % (__version__, __revision__)) - mylog.info("Non-default input parameters:") + par_msg = "Non-default input parameters:\n" user_opts = img.opts.to_list() for user_opt in user_opts: k, v = user_opt val = img.opts.__getattribute__(k) if val != v._default and v.group() != 'hidden': - mylog.info(' %-20s : %s' % (k, repr(val))) + par_msg += ' %-20s : %s\n' % (k, repr(val)) + mylog.info(par_msg[:-1]) # -1 is to trim final newline # Run all op's dc = '\033[34;1m' @@ -194,7 +195,7 @@ def _run_op_list(img, chain): # Log all internally derived parameters mylog = mylogger.logging.getLogger("PyBDSM.Final") - mylog.info("Internally derived input parameters:") + par_msg = "Internally derived parameters:\n" import inspect import types @@ -207,7 +208,8 @@ def _run_op_list(img, chain): types.NoneType, tuple, list)): - mylog.info(' %-20s : %s' % (attr[0], repr(used))) + par_msg += ' %-20s : %s\n' % (attr[0], repr(used)) + mylog.info(par_msg[:-1]) # -1 is to trim final newline return True diff --git a/CEP/PyBDSM/src/python/_version.py b/CEP/PyBDSM/src/python/_version.py index 8d0014cbde02704568107e3eb3b11d6657bb7626..f62324431f67c16ab9d02a518328d609928b9a2a 100644 --- a/CEP/PyBDSM/src/python/_version.py +++ b/CEP/PyBDSM/src/python/_version.py @@ -9,7 +9,7 @@ adding to the changelog will naturally do this. """ # Version number -__version__ = '1.4.0' +__version__ = '1.4.5' # Store svn Revision number. For this to work, one also needs to do: # @@ -27,15 +27,73 @@ def changelog(): PyBDSM Changelog. ----------------------------------------------------------------------- - 2011/09/18 - Added option to send images and catalogs to a SAMP hub + 2012/10/22 - Added option ("force_output") to force output of catalogs + even if they are empty (when no sources are found). + + 2012/10/12 - Version 1.4.5 + + 2012/10/12 - Added option ("incl_empty") to include empty islands (that + have no un-flagged Gaussians) in output catalogs. Any such empty + islands are given negative source IDs and positions given by the + location of the peak of the island. + + 2012/10/10 - Fixed a bug in Gaussian fitting that could cause a crash + when fitting fails. Fixed a bug in parallelization that could + cause a crash due to improper concatenation of result lists. + + 2012/10/09 - Version 1.4.4 + + 2012/10/09 - Improved logging. Added a warning when one or more islands + are not fit properly (i.e., no valid, unflagged Gaussians were + fit). Fixed a bug in parallelization of Gaussian fitting that + could cause a crash due to improper mapping of island lists to + processes. + + 2012/10/05 - Added code to handle images with no unblanked pixels. + Improved fitting robustness. + + 2012/10/04 - Version 1.4.3 + + 2012/10/04 - Fixed a bug in the mean map calculation that caused mean + maps with constant values (i.e., non-2D maps) to have values of + 0.0 Jy/beam unless "mean_map = 'const'" was explicitly specified. + Fixed a bug in Gaussian fitting that could cause an island to be + skipped. + + 2012/10/02 - Fixed a bug in the PSF vary module that resulted in + incorrect PSF generators being used. Added an option to smooth + the resulting PSF images ("psf_smooth"). Parallelized the PSF + interpolation and smoothing steps. Improved PSF vary documentation. + + 2012/09/25 - Version 1.4.2 + + 2012/09/25 - Dramatically reduced the time required to identify valid + wavelet islands. + + 2012/09/21 - Fixed bug that resulted in output FITS gaul tables being + improperly sorted. Fixed cosmetic bug in the statusbar that could + sometimes cause improper formatting. Added example of SAMP usage + to the documentation. + + 2012/09/20 - Version 1.4.1 + + 2012/09/20 - Fixed a bug in the wavelet module that caused a crash when + no Gaussians were fit to the ch0 image. + + 2012/09/19 - Added "broadcast" option to show_fit task to send + coordinates and row highlight request to a SAMP hub when a Gaussian + is clicked. Fixed bug in aperture flux masking that sometimes caused + the mask to be the wrong shape. + + 2012/09/18 - Added option to send images and catalogs to a SAMP hub (activated by setting outfile = 'SAMP' in the export_image and write_catalog tasks). - 2011/09/13 - Improved speed of plotting when images are large and in + 2012/09/13 - Improved speed of plotting when images are large and in mean/rms map generation. Fixed bug that caused residual image statistics to fail when NaNs are present. - 2011/09/11 - Version 1.4.0 + 2012/09/11 - Version 1.4.0 2012/09/11 - Parallelized Gaussian fitting, shapelet decomposition, validation of wavelet islands, and mean/rms map generation. diff --git a/CEP/PyBDSM/src/python/collapse.py b/CEP/PyBDSM/src/python/collapse.py index c10d8cba75f715f5101d272810a6348155db5fa8..7b5d8a092972871a9e6f0d88a26af376d167064a 100644 --- a/CEP/PyBDSM/src/python/collapse.py +++ b/CEP/PyBDSM/src/python/collapse.py @@ -22,9 +22,9 @@ class Op_collapse(Op): def __call__(self, img): mylog = mylogger.logging.getLogger("PyBDSM."+img.log+"Collapse") - if img.opts.polarisation_do: + if img.opts.polarisation_do: pols = ['I', 'Q', 'U', 'V'] # make sure I is done first - else: + else: pols = ['I'] # assume I is always present if img.image.shape[1] > 1: @@ -36,10 +36,10 @@ class Op_collapse(Op): if len(c_list) == 1: c_mode = 'single' chan0 = c_list[0] - img.collapse_ch0 = chan0 + img.collapse_ch0 = chan0 ch0sh = img.image.shape[2:] img.ch0 = N.zeros(ch0sh) - if img.opts.polarisation_do: + if img.opts.polarisation_do: img.ch0_Q = N.zeros(ch0sh); img.ch0_U = N.zeros(ch0sh); img.ch0_V = N.zeros(ch0sh) ch0images = [img.ch0, img.ch0_Q, img.ch0_U, img.ch0_V] else: @@ -51,30 +51,30 @@ class Op_collapse(Op): kappa = img.opts.kappa_clip mean, rms, cmean, crms = chan_stats(img, kappa) - img.channel_mean = mean; img.channel_rms = rms + img.channel_mean = mean; img.channel_rms = rms img.channel_clippedmean = cmean; img.channel_clippedrms = crms for ipol, pol in enumerate(pols): if c_mode == 'single': - if pol == 'I': + if pol == 'I': img.ch0 = ch0 = img.image[0, chan0] mylogger.userinfo(mylog, 'Source extraction will be ' \ 'done on channel', '%i (%.3f MHz)' % \ - (chan0, img.cfreq/1e6)) + (chan0, img.frequency/1e6)) else: ch0images[ipol][:] = ch0[:] = img.image[ipol, chan0][:] if c_mode == 'average': if not hasblanks: - if pol == 'I': + if pol == 'I': ch0, wtarr = avspc_direct(c_list, img.image[0], img.channel_clippedrms, c_wts) else: # use wtarr from the I image, which is always collapsed first ch0, wtarr = avspc_direct(c_list, img.image[ipol], img.channel_clippedrms, c_wts, wtarr=wtarr) else: - if pol == 'I': + if pol == 'I': ch0, wtarr = avspc_blanks(c_list, img.image[0], img.channel_clippedrms, c_wts) - else: + else: # use wtarr from the I image, which is always collapsed first ch0, wtarr = avspc_blanks(c_list, img.image[ipol], img.channel_clippedrms, c_wts, wtarr=wtarr) ch0images[ipol][:] = ch0[:] @@ -92,29 +92,29 @@ class Op_collapse(Op): 'done on averaged ("ch0") image') mylogger.userinfo(mylog, 'Frequency of averaged '\ 'image', '%.3f MHz' % \ - (img.cfreq/1e6,)) + (img.frequency/1e6,)) str1 = " ".join(str(n) for n in c_list) mylog.debug('%s %s' % ('Channels averaged : ', str1)) str1 = " ".join(["%9.4e" % n for n in wtarr]) mylog.debug('%s %s %s' % ('Channel weights : ', str1, '; unity=zero if c_wts="rms"')) - + if img.opts.output_all: func.write_image_to_file(img.use_io, img.imagename+'.ch0_'+pol+'.fits', ch0, img) mylog.debug('%s %s ' % ('Writing file ', img.imagename+'.ch0_'+pol+'.fits')) - + else: # Only one channel in image img.ch0 = img.image[0, 0] mylogger.userinfo(mylog, 'Frequency of image', - '%.3f MHz' % (img.cfreq/1e6,)) - if img.opts.polarisation_do: + '%.3f MHz' % (img.frequency/1e6,)) + if img.opts.polarisation_do: for pol in pols[1:]: if pol == 'Q': img.ch0_Q = img.image[1, 0][:] if pol == 'U': img.ch0_U = img.image[2, 0][:] if pol == 'V': img.ch0_V = img.image[3, 0][:] - + # Lastly, remove Q, U, and V images from img.image, as they are no longer needed - if img.opts.polarisation_do: + if img.opts.polarisation_do: img.image = img.image[0,:].reshape(1, img.image.shape[1], img.image.shape[2], img.image.shape[3]) # create mask if needed (assume all pols have the same mask as I) @@ -128,9 +128,12 @@ class Op_collapse(Op): frac_blank = round(float(img.blankpix)/float(image.shape[0]*image.shape[1]),3) mylogger.userinfo(mylog, "Number of blank pixels", str(img.blankpix) +' ('+str(frac_blank*100.0)+'%)') + if img.blankpix == image.shape[0]*image.shape[1]: + # ALL pixels are blanked! + raise RuntimeError('All pixels in the image are blanked.') img.completed_Ops.append('collapse') - - + + ######################################################################################## def chan_stats(img, kappa): @@ -149,7 +152,7 @@ def chan_stats(img, kappa): if N.any(im): immask = N.isnan(im) - if immask.all(): + if immask.all(): m, r, cm, cr = 0, 0, 0, 0 else: if immask.any(): @@ -160,7 +163,7 @@ def chan_stats(img, kappa): m, r, cm, cr = 0, 0, 0, 0 mean.append(m); rms.append(r); cmean.append(cm); crms.append(cr) - return N.array(mean), N.array(rms), N.array(cmean), N.array(crms) + return N.array(mean), N.array(rms), N.array(cmean), N.array(crms) ######################################################################################## @@ -170,7 +173,7 @@ def avspc_direct(c_list, image, rmsarr, c_wts, wtarr=None): shape2 = image.shape[1:] ch0 = N.zeros(shape2) sumwts = 0.0 - if wtarr == None: + if wtarr == None: wtarr = N.zeros(len(c_list)) for i, ch in enumerate(c_list): im = image[ch] @@ -178,7 +181,7 @@ def avspc_direct(c_list, image, rmsarr, c_wts, wtarr=None): if c_wts == 'unity': wt = 1.0 if c_wts == 'rms': wt = r if r != 0: - wt = 1.0/(wt*wt) + wt = 1.0/(wt*wt) else: wt = 0 sumwts += wt @@ -194,13 +197,13 @@ def avspc_direct(c_list, image, rmsarr, c_wts, wtarr=None): return ch0, wtarr ######################################################################################## - + def avspc_blanks(c_list, image, rmsarr, c_wts, wtarr=None): shape2 = image.shape[1:] ch0 = N.zeros(shape2) sumwtim = N.zeros(shape2) - if wtarr == None: + if wtarr == None: wtarr = N.zeros(len(c_list)) for i, ch in enumerate(c_list): im = image[ch] @@ -208,7 +211,7 @@ def avspc_blanks(c_list, image, rmsarr, c_wts, wtarr=None): if c_wts == 'unity': wt = 1.0 if c_wts == 'rms': wt = r if r != 0: - wt = 1.0/(wt*wt) + wt = 1.0/(wt*wt) else: wt = 0 wtim = N.ones(shape2)*wt*(~N.isnan(im)) @@ -242,8 +245,8 @@ def init_freq_collapse(img, wtarr): for i, ch in enumerate(c_list): sumwts += wtarr[i] sumfrq += freqs[ch]*wtarr[i] - img.cfreq = sumfrq / sumwts - img.freq_pars = (img.cfreq, 0.0, 0.0) + img.frequency = sumfrq / sumwts + img.freq_pars = (img.frequency, 0.0, 0.0) else: # Calculate from header info c_list = img.opts.collapse_av @@ -260,4 +263,4 @@ def init_freq_collapse(img, wtarr): sumwts += wtarr[i] freq = crval+cdelt*(ch+1-crpix) sumfrq += freq*wtarr[i] - img.cfreq = sumfrq / sumwts + img.frequency = sumfrq / sumwts diff --git a/CEP/PyBDSM/src/python/functions.py b/CEP/PyBDSM/src/python/functions.py index d1a18162647c7b3aa0e9678ec49c97213831cb98..79bd29e45a2d1fe73a28c1bc956d666998d9979a 100755 --- a/CEP/PyBDSM/src/python/functions.py +++ b/CEP/PyBDSM/src/python/functions.py @@ -179,8 +179,12 @@ def gdist_pa(pix1, pix2, gsize): val = atanproper(dumr, dx, dy) psi = val - (gsize[2]+90.0)/180.0*pi - # convert angle to eccentric anomaly - psi=atan(gsize[0]/gsize[1]*tan(psi)) + + # convert angle to eccentric anomaly + if approx_equal(gsize[1], 0.0): + psi = pi/2.0 + else: + psi=atan(gsize[0]/gsize[1]*tan(psi)) dumr2 = gsize[0]*cos(psi) dumr3 = gsize[1]*sin(psi) fwhm = sqrt(dumr2*dumr2+dumr3*dumr3) @@ -514,11 +518,12 @@ def imageshift(image, shift): def trans_gaul(q): " transposes a tuple " y=[] - for i in range(len(q[0])): - elem=[] - for j in range(len(q)): - elem.append(q[j][i]) - y.append(elem) + if len(q) > 0: + for i in range(len(q[0])): + elem=[] + for j in range(len(q)): + elem.append(q[j][i]) + y.append(elem) return y def momanalmask_gaus(subim, mask, isrc, bmar_p, allpara=True): @@ -730,38 +735,41 @@ def get_errors(img, p, stdav, bm_pix=None): errors = [] for i in range(ngaus): pp = p[i*7:i*7+7] - ### Now do error analysis as in Condon (and fBDSM) + ### Now do error analysis as in Condon (and fBDSM) size = pp[3:6] size = corrected_size(size) # angle is now degrees CCW from +y-axis - sq2 = sqrt(2.0) - if bm_pix == None: - bm_pix = N.array([img.pixel_beam[0]*fwsig, img.pixel_beam[1]*fwsig, img.pixel_beam[2]]) - dumr = sqrt(abs(size[0]*size[1]/(4.0*bm_pix[0]*bm_pix[1]))) - dumrr1 = 1.0+bm_pix[0]*bm_pix[1]/(size[0]*size[0]) - dumrr2 = 1.0+bm_pix[0]*bm_pix[1]/(size[1]*size[1]) - dumrr3 = dumr*pp[0]/stdav - d1 = sqrt(8.0*log(2.0)) - d2 = (size[0]*size[0]-size[1]*size[1])/(size[0]*size[0]) - try: - e_peak = pp[0]*sq2/(dumrr3*pow(dumrr1,0.75)*pow(dumrr2,0.75)) - e_maj=size[0]*sq2/(dumrr3*pow(dumrr1,1.25)*pow(dumrr2,0.25)) - e_min=size[1]*sq2/(dumrr3*pow(dumrr1,0.25)*pow(dumrr2,1.25)) # in fw - pa_rad = size[2]*pi/180.0 - e_x0 = sqrt( (e_maj*N.sin(pa_rad))**2 + (e_min*N.cos(pa_rad))**2 ) / d1 - e_y0 = sqrt( (e_maj*N.cos(pa_rad))**2 + (e_min*N.sin(pa_rad))**2 ) / d1 - e_pa=2.0/(d2*dumrr3*pow(dumrr1,0.25)*pow(dumrr2,1.25)) - e_pa=e_pa*180.0/pi - e_tot=pp[0]*sqrt(e_peak*e_peak/(pp[0]*pp[0])+(0.25/dumr/dumr)*(e_maj*e_maj/(size[0]*size[0])+e_min*e_min/(size[1]*size[1]))) - except: - e_peak = 0.0 - e_x0 = 0.0 - e_y0 = 0.0 - e_maj = 0.0 - e_min = 0.0 - e_pa = 0.0 - e_tot = 0.0 - if abs(e_pa) > 180.0: e_pa=180.0 # dont know why i did this - errors = errors + [e_peak, e_x0, e_y0, e_maj, e_min, e_pa, e_tot] + if size[0] == 0.0 or size[1] == 0.0: + errors = errors + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] + else: + sq2 = sqrt(2.0) + if bm_pix == None: + bm_pix = N.array([img.pixel_beam[0]*fwsig, img.pixel_beam[1]*fwsig, img.pixel_beam[2]]) + dumr = sqrt(abs(size[0]*size[1]/(4.0*bm_pix[0]*bm_pix[1]))) + dumrr1 = 1.0+bm_pix[0]*bm_pix[1]/(size[0]*size[0]) + dumrr2 = 1.0+bm_pix[0]*bm_pix[1]/(size[1]*size[1]) + dumrr3 = dumr*pp[0]/stdav + d1 = sqrt(8.0*log(2.0)) + d2 = (size[0]*size[0]-size[1]*size[1])/(size[0]*size[0]) + try: + e_peak = pp[0]*sq2/(dumrr3*pow(dumrr1,0.75)*pow(dumrr2,0.75)) + e_maj=size[0]*sq2/(dumrr3*pow(dumrr1,1.25)*pow(dumrr2,0.25)) + e_min=size[1]*sq2/(dumrr3*pow(dumrr1,0.25)*pow(dumrr2,1.25)) # in fw + pa_rad = size[2]*pi/180.0 + e_x0 = sqrt( (e_maj*N.sin(pa_rad))**2 + (e_min*N.cos(pa_rad))**2 ) / d1 + e_y0 = sqrt( (e_maj*N.cos(pa_rad))**2 + (e_min*N.sin(pa_rad))**2 ) / d1 + e_pa=2.0/(d2*dumrr3*pow(dumrr1,0.25)*pow(dumrr2,1.25)) + e_pa=e_pa*180.0/pi + e_tot=pp[0]*sqrt(e_peak*e_peak/(pp[0]*pp[0])+(0.25/dumr/dumr)*(e_maj*e_maj/(size[0]*size[0])+e_min*e_min/(size[1]*size[1]))) + except: + e_peak = 0.0 + e_x0 = 0.0 + e_y0 = 0.0 + e_maj = 0.0 + e_min = 0.0 + e_pa = 0.0 + e_tot = 0.0 + if abs(e_pa) > 180.0: e_pa=180.0 # dont know why i did this + errors = errors + [e_peak, e_x0, e_y0, e_maj, e_min, e_pa, e_tot] return errors @@ -1570,7 +1578,7 @@ def aperture_flux(aperture_pix, posn_pix, aper_im, aper_rms, beamarea): """Returns aperture flux and error""" import numpy as N - dist_mask = generate_aperture(aper_im.shape[1], aper_im.shape[0], posn_pix[1], posn_pix[0], aperture_pix) + dist_mask = generate_aperture(aper_im.shape[0], aper_im.shape[1], posn_pix[1], posn_pix[0], aperture_pix) aper_mask = N.where(dist_mask) if N.size(aper_mask) == 0: return [0.0, 0.0] @@ -1696,3 +1704,33 @@ def send_fits_table(s, private_key, name, file_path): raise RuntimeError("A running SAMP hub was not found.") else: s.samp.hub.notifyAll(private_key, message) + +def send_highlight_row(s, private_key, url, row_id): + """Send a SAMP notification to highlight a row in a table.""" + import os + + message = {} + message['samp.mtype'] = "table.highlight.row" + message['samp.params'] = {} + message['samp.params']['row'] = str(row_id) + message['samp.params']['url'] = url + lockfile = os.path.expanduser('~/.samp') + if not os.path.exists(lockfile): + raise RuntimeError("A running SAMP hub was not found.") + else: + s.samp.hub.notifyAll(private_key, message) + +def send_coords(s, private_key, coords): + """Send a SAMP notification to point at given coordinates.""" + import os + + message = {} + message['samp.mtype'] = "coord.pointAt.sky" + message['samp.params'] = {} + message['samp.params']['ra'] = str(coords[0]) + message['samp.params']['dec'] = str(coords[1]) + lockfile = os.path.expanduser('~/.samp') + if not os.path.exists(lockfile): + raise RuntimeError("A running SAMP hub was not found.") + else: + s.samp.hub.notifyAll(private_key, message) diff --git a/CEP/PyBDSM/src/python/gaul2srl.py b/CEP/PyBDSM/src/python/gaul2srl.py index d8471893bab387c46cf4a19d1d0f144f4c027f17..317b6b35fd82385c591db430a7276b60929c59e9 100644 --- a/CEP/PyBDSM/src/python/gaul2srl.py +++ b/CEP/PyBDSM/src/python/gaul2srl.py @@ -18,6 +18,7 @@ Also, each island object of img.islands list has the source object island.source from image import * from islands import * from gausfit import Gaussian +from interface import wrap import mylogger import numpy as N N.seterr(divide='raise') @@ -42,9 +43,13 @@ class Op_gaul2srl(Op): img.aperture = None src_index = -1 + dsrc_index = 0 sources = [] + dsources = [] + no_gaus_islands = [] for iisl, isl in enumerate(img.islands): isl_sources = [] + isl_dsources = [] g_list = [] for g in isl.gaul: if g.flag == 0: @@ -59,13 +64,43 @@ class Op_gaul2srl(Op): src_index, source = self.process_CM(img, g_list, isl, src_index) sources.extend(source) isl_sources.extend(source) + else: + if not img.waveletimage: + dg = isl.dgaul[0] + no_gaus_islands.append((isl.island_id, dg.centre_pix[0], dg.centre_pix[1])) + # Put in the dummy Source as the source and use negative IDs + g_list = isl.dgaul + dsrc_index, dsource = self.process_single_gaussian(img, g_list, dsrc_index, code = 'S') + dsources.append(dsource) + isl_dsources.append(dsource) isl.sources = isl_sources - + isl.dsources = isl_dsources img.sources = sources - img.nsrc = src_index+1 + img.dsources = dsources + img.nsrc = src_index + 1 mylogger.userinfo(mylog, "Number of sources formed from Gaussians", str(img.nsrc)) + if not img.waveletimage and not img._pi and len(no_gaus_islands) > 0 and not img.opts.quiet: + message = 'All Gaussians were flagged for the following island' + if len(no_gaus_islands) == 1: + message += ':\n' + else: + message += 's:\n' + for isl_id in no_gaus_islands: + message += ' Island #%i (x=%i, y=%i)\n' % isl_id + if len(no_gaus_islands) == 1: + message += 'Please check this island. If it is a valid island and\n' + else: + message += 'Please check these islands. If they are valid islands and\n' + if img.opts.atrous_do: + message += 'should be fit, try adjusting the flagging options (use\n'\ + 'show_fit with "ch0_flagged=True" to see the flagged Gaussians).' + else: + message += 'should be fit, try adjusting the flagging options (use\n'\ + 'show_fit with "ch0_flagged=True" to see the flagged Gaussians)\n'\ + 'or enabling the wavelet module (with "atrous_do=True").' + mylog.warning(message) img.completed_Ops.append('gaul2srl') @@ -85,14 +120,20 @@ class Op_gaul2srl(Op): bbox = img.islands[g.island_id].bbox ngaus = 1 island_id = g.island_id - gaussians = list([g]) + if g.gaus_num < 0: + gaussians = [] + else: + gaussians = list([g]) aper_flux = func.ch0_aperture_flux(img, g.centre_pix, img.aperture) source_prop = list([code, total_flux, peak_flux_centroid, peak_flux_max, aper_flux, posn_sky_centroid, \ posn_sky_max, size_sky, deconv_size_sky, bbox, ngaus, island_id, gaussians]) source = Source(img, source_prop) - src_index += 1 + if g.gaussian_idx == -1: + src_index -= 1 + else: + src_index += 1 g.source_id = src_index g.code = code source.source_id = src_index diff --git a/CEP/PyBDSM/src/python/gausfit.py b/CEP/PyBDSM/src/python/gausfit.py index 7c65d75d48e3e2a52483a90c100a1a9aa7295534..0b27e19dd01b5c1e8a83aebfc96c3ccb2a2c0c34 100644 --- a/CEP/PyBDSM/src/python/gausfit.py +++ b/CEP/PyBDSM/src/python/gausfit.py @@ -48,6 +48,8 @@ class Op_gausfit(Op): mylog = mylogger.logging.getLogger("PyBDSM."+img.log+"Gausfit") if len(img.islands) == 0: img.gaussians = [] + img.ngaus = 0 + img.total_flux_gaus = 0.0 img.completed_Ops.append('gausfit') return img @@ -98,22 +100,34 @@ class Op_gausfit(Op): idx = isl.island_id gaul = gaus_list[idx][0] fgaul = gaus_list[idx][1] + dgaul = [] gaul = [Gaussian(img, par, idx, gidx) for (gidx, par) in enumerate(gaul)] if len(gaul) == 0: + # No good Gaussians were fit. In this case, make a dummy + # Gaussian located at the island center so + # that the source may still be included in output catalogs. + # These dummy Gaussians all have an ID of -1. They do not + # appear in any of the source or island Gaussian lists except + # the island dgaul list. + posn = N.unravel_index(N.argmax(isl.image*~isl.mask_active), isl.shape) + N.array(isl.origin) + par = [isl.max_value, posn[0], posn[1], 0.0, 0.0, 0.0] + dgaul = [Gaussian(img, par, idx, -1)] gidx = 0 fgaul= [Gaussian(img, par, idx, gidx + gidx2 + 1, flag) for (gidx2, (flag, par)) in enumerate(fgaul)] isl.gaul = gaul isl.fgaul= fgaul + isl.dgaul = dgaul gaussian_list = [g for isl in img.islands for g in isl.gaul] img.gaussians = gaussian_list ### put in the serial number of the gaussians for the whole image n = 0 + nn = 0 tot_flux = 0.0 if img.waveletimage: # store the wavelet scale for each Gaussian @@ -127,6 +141,10 @@ class Op_gausfit(Op): n += 1; m += 1 g.gaus_num = n - 1 tot_flux += g.total_flux + for dg in isl.dgaul: + nn -= 1 + dg.gaus_num = nn + isl.ngaus = m img.ngaus = n img.total_flux_gaus = tot_flux @@ -157,15 +175,13 @@ class Op_gausfit(Op): return img - def process_island(self, isl, img, opts=None, multi=True): + def process_island(self, isl, img, opts=None): """Processes a single island. - Returns a list best-fit Gaussians and flagged Gaussians. + Returns a list of the best-fit Gaussians and flagged Gaussians. """ import functions as func - if multi == False: - global bar if opts == None: opts = img.opts iter_ngmax = 10 @@ -201,26 +217,18 @@ class Op_gausfit(Op): else: sgaul, sfgaul = self.fit_island(islcp, opts, img) gaul = gaul + sgaul; fgaul = fgaul + sfgaul - if multi == False: - if bar.started: bar.spin() - if multi == False: - if bar.started: bar.increment() else: isl.islmean = 0.0 if opts.peak_fit and size > peak_size: gaul, fgaul = self.fit_island_iteratively(img, isl, iter_ngmax=iter_ngmax, opts=opts) else: gaul, fgaul = self.fit_island(isl, opts, img) - if multi == False: - if bar.started: bar.increment() else: if opts.peak_fit and size > peak_size: gaul, fgaul = self.fit_island_iteratively(img, isl, iter_ngmax=iter_ngmax, opts=opts) else: gaul, fgaul = self.fit_island(isl, opts, img) - if multi == False: - if bar.started: bar.increment() # Return list of Gaussians return [gaul, fgaul] @@ -248,10 +256,13 @@ class Op_gausfit(Op): """ from _cbdsm import MGFunction + import functions as func + if ffimg == None: - fcn = MGFunction(isl.image-isl.islmean, isl.mask_active, 1) + fit_image = isl.image-isl.islmean else: - fcn = MGFunction(isl.image-isl.islmean-ffimg, isl.mask_active, 1) + fit_image = isl.image-isl.islmean-ffimg + fcn = MGFunction(fit_image, isl.mask_active, 1) beam = img.pixel_beam if abs(beam[0]/beam[1]) < 1.1: @@ -308,20 +319,18 @@ class Op_gausfit(Op): break if not fitok: # If normal fitting fails, try to fit 5 or fewer Gaussians to the island - ngmax = 5 + ngmax = 6 while not fitok and ngmax > 1: - fitok = self.fit_iter([], 0, fcn, dof, beam, thr0, 1, 'simple', ngmax, verbose) ngmax -= 1 + fitok = self.fit_iter([], 0, fcn, dof, beam, thr0, 1, 'simple', ngmax, verbose) gaul, fgaul = self.flag_gaussians(fcn.parameters, opts, beam, thr0, peak, shape, isl.mask_active, isl.image, size) + sm_isl = nd.binary_dilation(isl.mask_active) if not fitok and N.sum(~sm_isl) >= img.minpix_isl: - # If all else fails, shrink the island a little and try one last time - if ffimg == None: - fcn = MGFunction(isl.image-isl.islmean, nd.binary_dilation(isl.mask_active), 1) - else: - fcn = MGFunction(isl.image-isl.islmean-ffimg, nd.binary_dilation(isl.mask_active), 1) + # If fitting still fails, shrink the island a little and try again + fcn = MGFunction(fit_image, nd.binary_dilation(isl.mask_active), 1) gaul = [] iter = 0 ng1 = 0 @@ -337,11 +346,8 @@ class Op_gausfit(Op): break lg_isl = nd.binary_erosion(isl.mask_active) if not fitok and N.sum(~lg_isl) >= img.minpix_isl: - # If all else fails, expand the island a little and try one last time - if ffimg == None: - fcn = MGFunction(isl.image-isl.islmean, nd.binary_erosion(isl.mask_active), 1) - else: - fcn = MGFunction(isl.image-isl.islmean-ffimg, nd.binary_erosion(isl.mask_active), 1) + # If fitting still fails, expand the island a little and try again + fcn = MGFunction(fit_image, nd.binary_erosion(isl.mask_active), 1) gaul = [] iter = 0 ng1 = 0 @@ -356,6 +362,29 @@ class Op_gausfit(Op): if fitok and len(fgaul) == 0: break + if not fitok: + # If all else fails, try to use moment analysis + inisl = N.where(~isl.mask_active) + mask_id = N.zeros(isl.image.shape, dtype=int) - 1 + mask_id[inisl] = isl.island_id + try: + mompara = func.momanalmask_gaus(fit_image, mask_id, isl.island_id, img.pixel_beamarea, True) + mompara[5] += 90.0 + if not N.isnan(mompara[1]) and not N.isnan(mompara[2]): + x1 = N.int(N.floor(mompara[1])) + y1 = N.int(N.floor(mompara[2])) + xind = slice(x1, x1+2, 1); yind = slice(y1, y1+2, 1) + t=(mompara[1]-x1)/(x1+1-x1) + u=(mompara[2]-y1)/(y1+1-y1) + s_peak=(1.0-t)*(1.0-u)*fit_image[x1,y1]+t*(1.0-u)*fit_image[x1+1,y1]+ \ + t*u*fit_image[x1+1,y1+1]+(1.0-t)*u*fit_image[x1,y1+1] + mompara[0] = s_peak + par = [mompara.tolist()] + gaul, fgaul = self.flag_gaussians(par, opts, + beam, thr0, peak, shape, isl.mask_active, + isl.image, size) + except: + pass ### return whatever we got isl.mg_fcn = fcn @@ -368,82 +397,6 @@ class Op_gausfit(Op): print 'Number of flagged Gaussians: %i' % (len(fgaul),) return gaul, fgaul - def deblend_and_fit(self, img, isl, opts=None): - """Deblends an island and then fits it""" - import functions as func - sgaul = []; sfgaul = [] - gaul = []; fgaul = [] - if opts == None: - opts = img.opts - thresh_isl = opts.thresh_isl - thresh_pix = opts.thresh_pix - thresh = opts.fittedimage_clip - rms = isl.rms - factor = 1.0 - # Set desired size of sub-island. Don't let it get too small, or fitting - # won't work well. - maxsize = max(opts.peak_maxsize, (~isl.mask_active).sum()/img.pixel_beamarea/2.0) - - if opts.verbose_fitting: - print 'Finding and fitting peaks of island ', isl.island_id - while True: - factor *= 1.2 - if N.max(isl.image-isl.islmean-isl.mean)/thresh_isl/factor <= rms: - if int(factor) == 1: - slices = [] - break - mask_active_orig = isl.mask_active - act_pixels = (isl.image-isl.islmean-isl.mean)/thresh_isl/factor >= rms - N.logical_and(act_pixels, ~mask_active_orig, act_pixels) - rank = len(isl.shape) - # generates matrix for connectivity, in this case, 8-conn - connectivity = nd.generate_binary_structure(rank, rank) - # labels = matrix with value = (initial) island number - sub_labels, count = nd.label(act_pixels, connectivity) - # slices has limits of bounding box of each such island - slices = nd.find_objects(sub_labels) - if len(slices) == 0: - break - size = [] - for idx, s in enumerate(slices): - idx += 1 # nd.labels indices are counted from 1 - size.append((sub_labels[s] == idx).sum()*2.0) - # Check whether we have reduced the size of smallest island to less - # than maxsize; if not, continue with higher threshhold - if min(size) < maxsize*img.pixel_beamarea: - break - gaul = []; fgaul = [] - n_subisl = len(slices) - if opts.verbose_fitting and n_subisl > 1: - print 'SEPARATED ISLAND INTO ',n_subisl,' PEAKS FOR ISLAND ',isl.island_id - for i_sub_isl in range(n_subisl): - islcp = isl.copy(img) - islcp.mask_active = N.where(sub_labels == i_sub_isl+1, False, True) - islcp.mask_noisy = N.where(sub_labels == i_sub_isl+1, False, True) - sgaul, sfgaul = self.fit_island(islcp, opts, img) - gaul = gaul + sgaul; fgaul = fgaul + sfgaul -# if bar.started: bar.spin() - - # Now fit residuals - ffimg_tot = N.zeros(isl.shape) - if len(gaul) > 0: - gaul_obj_list = [Gaussian(img, par, isl.island_id, gidx) for (gidx, par) in enumerate(gaul)] - for g in gaul_obj_list: - g.centre_pix[0] -= isl.origin[0] - g.centre_pix[1] -= isl.origin[1] - C1, C2 = g.centre_pix - shape = isl.shape - b = find_bbox(thresh*isl.rms, g) - bbox = N.s_[max(0, int(C1-b)):min(shape[0], int(C1+b+1)), - max(0, int(C2-b)):min(shape[1], int(C2+b+1))] - x_ax, y_ax = N.mgrid[bbox] - ffimg = func.gaussian_fcn(g, x_ax, y_ax) - ffimg_tot[bbox] += ffimg - if N.max(isl.image-ffimg_tot-isl.islmean-isl.mean)/thresh_pix >= rms: - sgaul, sfgaul = self.fit_island(isl, opts, img, ffimg=ffimg_tot) - gaul = gaul + sgaul; fgaul = fgaul + sfgaul - - return gaul, fgaul def fit_island_iteratively(self, img, isl, iter_ngmax=5, opts=None): """Fits an island iteratively. @@ -639,7 +592,6 @@ class Op_gausfit(Op): verbose: whether to print fitting progress information """ from _cbdsm import lmder_fit, dn2g_fit, dnsg_fit -# global bar fit = lmder_fit beam = list(beam) @@ -658,7 +610,6 @@ class Op_gausfit(Op): ### iteratively add gaussians while there are high peaks ### in the image and fitting converges while fitok: -# if bar.started: bar.spin() peak, coords = fcn.find_peak() if peak < thr: ### no good peaks left break @@ -815,7 +766,6 @@ class Op_gausfit(Op): elif mask[tuple(pt)]: flag += 256 break - return flag def fixup_gaussian(self, isl, gaussian): diff --git a/CEP/PyBDSM/src/python/image.py b/CEP/PyBDSM/src/python/image.py index 88da33456d3d03aec277570cf2049e3f088bae40..48d4cb48bf454b5619ac25413cb91215b2059748 100644 --- a/CEP/PyBDSM/src/python/image.py +++ b/CEP/PyBDSM/src/python/image.py @@ -41,6 +41,9 @@ class Image(object): basedir = String('DUMMY', doc="Base directory for output files") completed_Ops = List(String(), doc="List of completed operations") _is_interactive_shell = Bool(False, doc="PyBDSM is being used in the interactive shell") + waveletimage = Bool(False, doc="Image is a wavelet transform image") + _pi = Bool(False, doc="Image is a polarized intensity image") + def __init__(self, opts): diff --git a/CEP/PyBDSM/src/python/interface.py b/CEP/PyBDSM/src/python/interface.py index 520b6945867ace75766bdbd59725a0fd3509e2c3..5bbd5763648b675db0a2cfc5d2bac1b5898631a5 100644 --- a/CEP/PyBDSM/src/python/interface.py +++ b/CEP/PyBDSM/src/python/interface.py @@ -24,6 +24,7 @@ def process(img, **kwargs): # First, reset img to initial state (in case img is being reprocessed) if hasattr(img, 'use_io'): del img.use_io if hasattr(img, 'sources'): del img.sources + if hasattr(img, 'dsources'): del img.dsources if hasattr(img, 'gaussians'): del img.gaussians if hasattr(img, 'atrous_gaussians'): del img.atrous_gaussians if hasattr(img, 'islands'): del img.islands @@ -545,9 +546,11 @@ def export_image(img, outfile=None, img_format='fits', 'gaus_model' - Gaussian model image 'shap_resid' - Shapelet model residual image 'shap_model' - Shapelet model image - 'psf_major' - PSF major axis FWHM image - 'psf_minor' - PSF minor axis FWHM image - 'psf_pa' - PSF position angle image + 'psf_major' - PSF major axis FWHM image (FWHM in arcsec) + 'psf_minor' - PSF minor axis FWHM image (FWHM in arcsec) + 'psf_pa' - PSF position angle image (degrees east of north) + 'psf_ratio' - PSF peak-to-total flux ratio (in units of 1/beam) + 'psf_ratio_aper' - PSF peak-to-aperture flux ratio (in units of 1/beam) """ import os import functions as func @@ -625,6 +628,14 @@ def export_image(img, outfile=None, img_format='fits', func.write_image_to_file(use_io, filename, img.psf_vary_pa, img, bdir, clobber=clobber) + elif img_type == 'psf_ratio': + func.write_image_to_file(use_io, filename, + img.psf_vary_ratio, img, bdir, + clobber=clobber) + elif img_type == 'psf_ratio_aper': + func.write_image_to_file(use_io, filename, + img.psf_vary_ratio_aper, img, bdir, + clobber=clobber) elif img_type == 'gaus_resid': im = img.resid_gaus func.write_image_to_file(use_io, filename, @@ -666,7 +677,8 @@ def export_image(img, outfile=None, img_format='fits', def write_catalog(img, outfile=None, format='bbs', srcroot=None, catalog_type='gaul', - bbs_patches=None, incl_chan=True, clobber=False): + bbs_patches=None, incl_chan=False, incl_empty=False, clobber=False, + force_output=False): """Write the Gaussian, source, or shapelet list to a file. Returns True if successful, False if not. @@ -693,9 +705,11 @@ def write_catalog(img, outfile=None, format='bbs', srcroot=None, catalog_type='g patch "source" - sources are grouped by source into patches incl_chan - Include fluxes for each channel? + incl_empty - Include islands without any valid Gaussians (source list only)? sort_by - Property to sort output list by: "flux" - sort by total integrated flux, largest first "indx" - sort by Gaussian and island or source index, smallest first + force_output - Force the creation of a catalog, even if it is empty clobber - Overwrite existing file? """ import output @@ -728,15 +742,17 @@ def write_catalog(img, outfile=None, format='bbs', srcroot=None, catalog_type='g print '\033[91mERROR\033[0m: catalog_type must be "gaul", '\ '"srl", or "shap"' return False - if img.ngaus == 0: - print 'No Gaussians were fit to image. Output file not written.' - return False + if (len(img.sources) == 0 and not incl_empty) or (len(img.sources) == 0 and len(img.dsources) == 0 and incl_empty): + if not force_output: + print 'No sources were found in the image. Output file not written.' + return False if filename == '': filename = None # Now go format by format and call appropriate function if filename == 'SAMP': import tempfile import functions as func + import os if not hasattr(img,'samp_client'): s, private_key = func.start_samp_proxy() img.samp_client = s @@ -745,14 +761,19 @@ def write_catalog(img, outfile=None, format='bbs', srcroot=None, catalog_type='g # Broadcast fits table to SAMP Hub tfile = tempfile.NamedTemporaryFile(delete=False) filename = output.write_fits_list(img, filename=tfile.name, - incl_chan=incl_chan, - clobber=clobber, objtype=catalog_type) - func.send_fits_table(img.samp_client, img.samp_key, 'PyBDSM table', tfile.name) + incl_chan=incl_chan, incl_empty=incl_empty, + clobber=True, objtype=catalog_type) + table_name = 'PyBDSM '+ catalog_type + ' table' + if catalog_type == 'srl': + img.samp_srl_table_url = 'file://' + os.path.abspath(tfile.name) + if catalog_type == 'gaul': + img.samp_gaul_table_url = 'file://' + os.path.abspath(tfile.name) + func.send_fits_table(img.samp_client, img.samp_key, table_name, tfile.name) print '--> Table sent to SMAP hub' return True if format == 'fits': filename = output.write_fits_list(img, filename=filename, - incl_chan=incl_chan, + incl_chan=incl_chan, incl_empty=incl_empty, clobber=clobber, objtype=catalog_type) if filename == None: print '\033[91mERROR\033[0m: File exists and clobber = False.' @@ -762,7 +783,7 @@ def write_catalog(img, outfile=None, format='bbs', srcroot=None, catalog_type='g return True if format == 'ascii': filename = output.write_ascii_list(img, filename=filename, - incl_chan=incl_chan, + incl_chan=incl_chan, incl_empty=incl_empty, sort_by='index', clobber=clobber, objtype=catalog_type) if filename == None: diff --git a/CEP/PyBDSM/src/python/make_residimage.py b/CEP/PyBDSM/src/python/make_residimage.py index 903657698e728b0338681acbbedfdc6d79286651..93a3268386953d7a2bcb026bc19522e3e2103b05 100644 --- a/CEP/PyBDSM/src/python/make_residimage.py +++ b/CEP/PyBDSM/src/python/make_residimage.py @@ -85,18 +85,7 @@ class Op_make_residimage(Op): ### residual rms and mean per island for isl in img.islands: resid = img.resid_gaus[isl.bbox] - n, m = resid.shape - - ind = N.where(~isl.mask_active) - resid = resid[ind] - isl.gresid_rms = N.std(resid) - isl.gresid_mean = N.mean(resid) - for src in isl.sources: - src.gresid_rms = N.std(resid) - src.gresid_mean = N.mean(resid) - for g in src.gaussians: - g.gresid_rms = N.std(resid) - g.gresid_mean = N.mean(resid) + self.calc_resid_mean_rms(isl, resid, type='gaus') # Calculate some statistics for the Gaussian residual image non_masked = N.where(~N.isnan(img.ch0)) @@ -104,11 +93,12 @@ class Op_make_residimage(Op): std_dev = N.std(img.resid_gaus[non_masked], axis=None) skew = stats.skew(img.resid_gaus[non_masked], axis=None) kurt = stats.kurtosis(img.resid_gaus[non_masked], axis=None) - mylog.info("Statistics of the Gaussian residual image:") - mylog.info(" mean: %.3e (Jy/beam)" % mean) - mylog.info(" std. dev: %.3e (Jy/beam)" % std_dev) - mylog.info(" skew: %.3f" % skew) - mylog.info(" kurtosis: %.3f" % kurt) + stat_msg = "Statistics of the Gaussian residual image:\n" + stat_msg += " mean: %.3e (Jy/beam)\n" % mean + stat_msg += " std. dev: %.3e (Jy/beam)\n" % std_dev + stat_msg += " skew: %.3f\n" % skew + stat_msg += " kurtosis: %.3f" % kurt + mylog.info(stat_msg) # Now residual image for shapelets if img.opts.shapelet_do: @@ -144,17 +134,7 @@ class Op_make_residimage(Op): ### shapelet residual rms and mean per island for isl in img.islands: resid = img.resid_shap[isl.bbox] - n, m = resid.shape - ind = N.where(~isl.mask_active) - resid = resid[ind] - isl.sresid_rms = N.std(resid) - isl.sresid_mean = N.mean(resid) - for src in isl.sources: - src.sresid_rms = N.std(resid) - src.sresid_mean = N.mean(resid) - for g in src.gaussians: - g.sresid_rms = N.std(resid) - g.sresid_mean = N.mean(resid) + self.calc_resid_mean_rms(isl, resid, type='shap') # Calculate some statistics for the Shapelet residual image non_masked = N.where(~N.isnan(img.ch0)) @@ -192,4 +172,44 @@ class Op_make_residimage(Op): return ceil(S*1.5) return ceil(S*sqrt(-2*log(thresh/A))) + def calc_resid_mean_rms(self, isl, resid, type): + """Inserts mean and rms of residual image into isl, src, and gaussians + + type - specifies 'gaus' or 'shap' + """ + if len(isl.gaul) == 0: + resid = N.zeros(isl.shape) + + ind = N.where(~isl.mask_active) + resid = resid[ind] + if type == 'gaus': + isl.gresid_rms = N.std(resid) + isl.gresid_mean = N.mean(resid) + else: + isl.sresid_rms = N.std(resid) + isl.sresid_mean = N.mean(resid) + if hasattr(isl, 'sources'): + for src in isl.sources: + if type == 'gaus': + src.gresid_rms = N.std(resid) + src.gresid_mean = N.mean(resid) + else: + src.sresid_rms = N.std(resid) + src.sresid_mean = N.mean(resid) + for g in src.gaussians: + if type == 'gaus': + g.gresid_rms = N.std(resid) + g.gresid_mean = N.mean(resid) + else: + g.sresid_rms = N.std(resid) + g.sresid_mean = N.mean(resid) + if hasattr(isl, 'dsources'): + for dsrc in isl.dsources: # Handle dummy sources (if any) + if type == 'gaus': + dsrc.gresid_rms = N.std(resid) + dsrc.gresid_mean = N.mean(resid) + else: + dsrc.sresid_rms = N.std(resid) + dsrc.sresid_mean = N.mean(resid) + diff --git a/CEP/PyBDSM/src/python/multi_proc.py b/CEP/PyBDSM/src/python/multi_proc.py index a353b1f84559b149e7eed5ec7777a7287b8341fc..27364e2ef7da3a87bad9abdd29a466855f433f08 100644 --- a/CEP/PyBDSM/src/python/multi_proc.py +++ b/CEP/PyBDSM/src/python/multi_proc.py @@ -58,9 +58,11 @@ def worker(f, ii, chunk, out_q, err_q, lock, bar, bar_state): if bar_state['started']: bar.pos = bar_state['pos'] bar.spin_pos = bar_state['spin_pos'] - bar.increment() - bar_state['pos'] += 1 - bar_state['spin_pos'] += 1 + bar.started = bar_state['started'] + increment = bar.increment() + bar_state['started'] = bar.started + bar_state['pos'] += increment + bar_state['spin_pos'] += increment if bar_state['spin_pos'] >= 4: bar_state['spin_pos'] = 0 @@ -105,11 +107,14 @@ def run_tasks(procs, err_q, out_q, num): results=[None]*num; for i in range(num): idx, result = out_q.get() - results[idx] = numpy.array(result, dtype=object) + results[idx] = result # Remove extra dimension added by array_split - return numpy.concatenate(results).tolist() + result_list = [] + for result in results: + result_list += result + return result_list def parallel_map(function, sequence, numcores=None, bar=None, weights=None): @@ -139,7 +144,11 @@ def parallel_map(function, sequence, numcores=None, bar=None, weights=None): size = len(sequence) if not _multi or size == 1: - return map(function, sequence) + results = map(function, sequence) + if bar != None: + bar.stop() + return results + # Set default number of cores to use. Leave one core free for pyplot. if numcores is None: @@ -183,12 +192,16 @@ def parallel_map(function, sequence, numcores=None, bar=None, weights=None): for indx, weight in enumerate(weights): temp_sum += weight if temp_sum > weight_per_core: - cut_values.append(indx) + cut_values.append(indx+1) temp_sum = weight if len(cut_values) > numcores - 1: cut_values = cut_values[0:numcores-1] sequence = numpy.array_split(sequence, cut_values) + # Make sure there are no empty chunks at the end of the sequence + while len(sequence[-1]) == 0: + sequence.pop() + procs = [multiprocessing.Process(target=worker, args=(function, ii, chunk, out_q, err_q, lock, bar, bar_state)) for ii, chunk in enumerate(sequence)] @@ -197,10 +210,7 @@ def parallel_map(function, sequence, numcores=None, bar=None, weights=None): results = run_tasks(procs, err_q, out_q, len(sequence)) if bar != None: if bar.started: - bar.pos = bar_state['pos'] - bar.spin_pos = bar_state['spin_pos'] - while bar.pos < bar.max: - bar.increment() + bar.stop() return results except KeyboardInterrupt: diff --git a/CEP/PyBDSM/src/python/mylogger.py b/CEP/PyBDSM/src/python/mylogger.py index 94e9530855dfee80e2d3404308e6e32094a73d79..7196c1fdf4d5a80182a82a719633b138dc26d3b1 100644 --- a/CEP/PyBDSM/src/python/mylogger.py +++ b/CEP/PyBDSM/src/python/mylogger.py @@ -1,5 +1,5 @@ """ WARNING, ERROR, and CRITICAL are always output to screen and to log file. -INFO and USERINFO always go to the log file. DEBUG goes to log file if debug is +INFO and USERINFO always go to the log file. DEBUG goes to log file if debug is True. USERINFO goes to screen only if quiet is False. Use as follows: @@ -26,23 +26,23 @@ def init_logger(logfilename, quiet=False, debug=False): # before in this session but the quiet or debug options have changed while len(logger.handlers) > 0: logger.removeHandler(logger.handlers[0]) - + # File handlers fh = ColorStripperHandler(logfilename) if debug: # For log file and debug on, print name and levelname fh.setLevel(logging.DEBUG) - fmt1 = logging.Formatter('%(asctime)s %(name)-20s:: %(levelname)-8s: '\ + fmt1 = MultiLineFormatter('%(asctime)s %(name)-20s:: %(levelname)-8s: '\ '%(message)s', datefmt='%a %d-%m-%Y %H:%M:%S') else: # For log file and debug off, don't print name and levelname as # they have no meaning to the user. fh.setLevel(logging.INFO) - fmt1 = logging.Formatter('%(asctime)s:: %(message)s', + fmt1 = MultiLineFormatter('%(asctime)s:: %(levelname)-8s: %(message)s', datefmt='%a %d-%m-%Y %H:%M:%S') fh.setFormatter(fmt1) - logger.addHandler(fh) + logger.addHandler(fh) # Console handler for warning, error, and critical: format includes levelname # ANSI colors are used @@ -65,14 +65,21 @@ def init_logger(logfilename, quiet=False, debug=False): chi.setLevel(logging.USERINFO) fmt3 = logging.Formatter('%(message)s') chi.setFormatter(fmt3) - logger.addHandler(chi) + logger.addHandler(chi) class InfoFilter(logging.Filter): # Lets only USERINFO through def filter(self, rec): return rec.levelno == logging.USERINFO - - + +class MultiLineFormatter(logging.Formatter): + def format(self, record): + str = logging.Formatter.format(self, record) + header, footer = str.split(record.message) + nocolor_header = strip_color(header) + str = str.replace('\n', '\n' + ' '*len(nocolor_header)) + return str + def userinfo(mylog, desc_str, val_str=''): """Writes a nicely formatted string to the log file and console @@ -101,25 +108,30 @@ def userinfo(mylog, desc_str, val_str=''): desc_str += '.' else: while len(desc_str) < 41: - desc_str += ' ' + desc_str += ' ' mylog.log(logging.USERINFO, desc_str+sep+val_str) class ColorStripperHandler(logging.FileHandler): def emit(self, record): - """Strips ANSI color codes from file stream - - The color codes are hard-coded to those used above - in userinfo() and in WARNING, ERROR, and CRITICAL. - """ + """Strips ANSI color codes from file stream""" myrecord = copy.copy(record) - nocolor_msg = '' - a = myrecord.msg.split('\033[1;34m') - for b in a: - c = b.split('\033[0m') - for d in c: - e = d.split('\033[31;1m') - for f in e: - nocolor_msg += f + nocolor_msg = strip_color(myrecord.msg) myrecord.msg = nocolor_msg - logging.FileHandler.emit(self, myrecord) \ No newline at end of file + logging.FileHandler.emit(self, myrecord) + +def strip_color(msg): + """Strips specific ANSI color codes from an input string + + The color codes are hard-coded to those used above + in userinfo() and in WARNING, ERROR, and CRITICAL. + """ + nocolor_msg = '' + a = msg.split('\033[1;34m') + for b in a: + c = b.split('\033[0m') + for d in c: + e = d.split('\033[31;1m') + for f in e: + nocolor_msg += f + return nocolor_msg diff --git a/CEP/PyBDSM/src/python/opts.py b/CEP/PyBDSM/src/python/opts.py index 3d4e6ec45e16e62c9a3cb14b35b5c1cf9eade4a9..f201db78607d14dda8c0b08492de8b0207b639be 100644 --- a/CEP/PyBDSM/src/python/opts.py +++ b/CEP/PyBDSM/src/python/opts.py @@ -620,7 +620,7 @@ class Opts(object): "flag_maxsnr times the image value at the peak "\ "is flagged. The flag value is increased by 2.", group = "flagging_opts") - flag_maxsize_isl = Float(1.0, + flag_maxsize_isl = Float(2.0, doc = "Flag Gaussian if x, y bounding box "\ "around sigma-contour is factor times island bbox\n"\ "Any fitted Gaussian whose maximum x-dimension is "\ @@ -879,6 +879,11 @@ class Opts(object): "considered 'unresolved' and are used further to "\ "estimate the PSFs.", group = "psf_vary_do") + psf_smooth = Option(None, Float(), + doc = "Size of Gaussian to use for smoothing of "\ + "interpolated images in arcsec. None => no "\ + "smoothing", + group = "psf_vary_do") psf_snrcut = Float(10.0, doc = "Minimum SNR for statistics\n"\ "Only Gaussians with SNR greater than this are "\ @@ -1039,9 +1044,17 @@ class Opts(object): group = "hidden") outfile = Option(None, String(), doc = "Output file name. None => file is named "\ - "automatically; 'SAMP' => send to SAMP Hub "\ + "automatically; 'SAMP' => send to SAMP hub "\ "(e.g., to TOPCAT, ds9, or Aladin)", group = 'hidden') + broadcast = Bool(False, + doc = "Broadcast Gaussian and source IDs and "\ + "coordinates to SAMP hub when a Gaussian is "\ + "clicked?\nNote that for the "\ + "IDs to be useful, a catalog must have been sent "\ + "to the SAMP hub previously using the write_catalog "\ + "task (with outfile = 'SAMP').", + group = 'hidden') clobber = Bool(False, doc = "Overwrite existing file?", group = 'hidden') @@ -1072,6 +1085,21 @@ class Opts(object): doc = "Include flux densities from each channel "\ "(if any)?", group = 'hidden') + incl_empty = Bool(False, + doc = "Include islands without any valid Gaussians "\ + "(source list only)?\n"\ + "If True, islands for which Gaussian fitting "\ + "failed will be included in the output catalog. "\ + "In these cases, the source IDs "\ + "are negative.", + group = 'hidden') + force_output = Bool(False, + doc = "Force creation of output file, even if the "\ + "catalog is empty?\n"\ + "If True, the output catalog will be created, "\ + "even if there are no sources. In this case, "\ + "the catalog will have a header but no entries.", + group = 'hidden') catalog_type = Enum('gaul', 'shap', 'srl', doc = "Type of catalog to write: 'gaul' - Gaussian "\ "list, 'srl' - source list (formed "\ @@ -1085,7 +1113,7 @@ class Opts(object): group = 'hidden') img_type = Enum('gaus_resid', 'shap_resid', 'rms', 'mean', 'gaus_model', 'shap_model', 'ch0', 'pi', 'psf_major', 'psf_minor', - 'psf_pa', + 'psf_pa', 'psf_ratio', 'psf_ratio_aper', doc = "Type of image to export: 'gaus_resid', "\ "'shap_resid', 'rms', 'mean', 'gaus_model', "\ "'shap_model', 'ch0', 'pi', 'psf_major', "\ @@ -1099,9 +1127,11 @@ class Opts(object): "'gaus_model' - Gaussian model image\n"\ "'shap_resid' - Shapelet model residual image\n"\ "'shap_model' - Shapelet model image\n"\ - "'psf_major' - PSF major axis FWHM (in pixels) image\n"\ - "'psf_minor' - PSF minor axis FWHM (in pixels) image\n"\ - "'psf_pa' - PSF position angle (E from N in degrees) image\n", + "'psf_major' - PSF major axis FWHM image (FWHM in arcsec)\n"\ + "'psf_minor' - PSF minor axis FWHM image (FWHM in arcsec)\n"\ + "'psf_pa' - PSF position angle image (degrees east of north)\n"\ + "'psf_ratio' - PSF peak-to-total flux ratio (in units of 1/beam)\n"\ + "'psf_ratio_aper' - PSF peak-to-aperture flux ratio (in units of 1/beam)", group = 'hidden') ch0_image = Bool(True, doc = "Show the ch0 image. This is the image used for "\ @@ -1146,11 +1176,11 @@ class Opts(object): group = "hidden") psf_major = Bool(False, doc = "Show the PSF major axis variation (values are "\ - "FWHM in pixels)", + "FWHM in arcsec)", group = "hidden") psf_minor = Bool(False, doc = "Show the FWHM of PSF minor axis variation (values are "\ - "FWHM in pixels)", + "FWHM in arcsec)", group = "hidden") psf_pa = Bool(False, doc = "Show the PSF position angle variation (values are "\ @@ -1200,7 +1230,7 @@ class Opts(object): # and then try to parse it if hasattr(self, k): if isinstance(self.__getattribute__(k), bool): - if isinstance(v, bool): + if isinstance(v, bool) or v == None: # just enter the bool into the parameter pass elif isinstance(v, basestring): diff --git a/CEP/PyBDSM/src/python/output.py b/CEP/PyBDSM/src/python/output.py index ca29a577ef9f8f6c4914a76dd4800036cec70654..b7290c3c1ed8bff35026e87d24d564f61bfea808 100644 --- a/CEP/PyBDSM/src/python/output.py +++ b/CEP/PyBDSM/src/python/output.py @@ -266,7 +266,7 @@ def write_lsm_gaul(img, filename=None, srcroot=None, patch=None, def write_ds9_list(img, filename=None, srcroot=None, deconvolve=False, - clobber=False, objtype='gaul'): + clobber=False, incl_empty=False, objtype='gaul'): """Writes Gaussian list to a ds9 region file""" import numpy as N from const import fwsig @@ -279,10 +279,18 @@ def write_ds9_list(img, filename=None, srcroot=None, deconvolve=False, elif objtype == 'srl': root = img.parentname outl = [img.sources] + if incl_empty: + # Append the dummy sources for islands without any unflagged Gaussians + outl[0] += img.dsources outn = [] for src in img.sources: outn.append(root + '_i' + str(src.island_id) + '_s' + str(src.source_id)) + if incl_empty: + # Append the dummy sources for islands without any unflagged Gaussians + for dsrc in img.dsources: + outn.append(root + '_i' + str(dsrc.island_id) + '_s' + + str(dsrc.source_id)) outn = [outn] outstr_list = make_ds9_str(img, outl, outn, deconvolve=deconvolve) if filename == None: @@ -298,7 +306,7 @@ def write_ds9_list(img, filename=None, srcroot=None, deconvolve=False, def write_ascii_list(img, filename=None, sort_by='indx', - incl_chan=False, clobber=False, objtype='gaul'): + incl_chan=False, incl_empty=False, clobber=False, objtype='gaul'): """Writes Gaussian list to an ASCII file""" import mylogger import os @@ -308,6 +316,9 @@ def write_ascii_list(img, filename=None, sort_by='indx', outl, outn, patl = list_and_sort_gaussians(img, patch=None, sort_by=sort_by) elif objtype == 'srl': outl = [img.sources] + if incl_empty: + # Append the dummy sources for islands without any unflagged Gaussians + outl[0] += img.dsources outstr_list = make_ascii_str(img, outl, objtype=objtype) if filename == None: if objtype == 'gaul': @@ -344,8 +355,8 @@ def write_casa_gaul(img, filename=None, clobber=False): return filename -def write_fits_list(img, filename=None, sort_by='indx', objtype='gaul', - incl_chan=False, clobber=False): +def write_fits_list(img, filename=None, sort_by='index', objtype='gaul', + incl_chan=False, incl_empty=False, clobber=False): """ Write as FITS binary table. """ import mylogger @@ -359,6 +370,9 @@ def write_fits_list(img, filename=None, sort_by='indx', objtype='gaul', outl, outn, patl = list_and_sort_gaussians(img, patch=None, sort_by=sort_by) elif objtype == 'srl': outl = [img.sources] + if incl_empty: + # Append the dummy sources for islands without any unflagged Gaussians + outl[0] += img.dsources elif objtype == 'shap': outl = [img.islands] @@ -374,19 +388,23 @@ def write_fits_list(img, filename=None, sort_by='indx', objtype='gaul', incl_aper = True else: incl_aper = False - cvals, cnames, cformats, cunits = make_output_columns(outl[0][0], fits=True, - objtype=objtype, - incl_spin=img.opts.spectralindex_do, - incl_chan=img.opts.incl_chan, - incl_pol=img.opts.polarisation_do, - incl_aper=incl_aper, - nmax=nmax, nchan=img.nchan) + if len(outl[0]) > 0: + cvals, cnames, cformats, cunits = make_output_columns(outl[0][0], fits=True, + objtype=objtype, + incl_spin=img.opts.spectralindex_do, + incl_chan=img.opts.incl_chan, + incl_pol=img.opts.polarisation_do, + incl_aper=incl_aper, + incl_empty=incl_empty, + nmax=nmax, nchan=img.nchan) out_list = make_fits_list(img, outl, objtype=objtype, nmax=nmax) col_list = [] for ind, col in enumerate(out_list): list1 = pyfits.Column(name=cnames[ind], format=cformats[ind], unit=cunits[ind], array=N.array(out_list[ind])) col_list.append(list1) + if len(col_list) == 0: + col_list = [pyfits.Column(name='Blank', format='1J')] tbhdu = pyfits.new_table(col_list) if objtype == 'gaul': tbhdu.header.add_comment('Gaussian list for '+img.filename) @@ -396,7 +414,7 @@ def write_fits_list(img, filename=None, sort_by='indx', objtype='gaul', tbhdu.header.add_comment('Shapelet list for '+img.filename) tbhdu.header.add_comment('Generated by PyBDSM version %s (LUS revision %s)' % (__version__, __revision__)) - freq = "%.5e" % img.cfreq + freq = "%.5e" % img.frequency tbhdu.header.add_comment('Reference frequency of the detection ("ch0") image: %s Hz' % freq) tbhdu.header.add_comment('Equinox : %s' % img.equinox) tbhdu.header.update('INIMAGE', img.filename, 'Filename of image') @@ -488,8 +506,15 @@ def make_bbs_str(img, glist, gnames, patchnames): import numpy as N outstr_list = [] - freq = "%.5e" % img.cfreq - if patchnames[0] == None: + freq = "%.5e" % img.frequency + + if len(patchnames) == 0: + # Handle empty list: just write default header + outstr_list.append("format = Name, Type, Ra, Dec, I, Q, U, V, "\ + "MajorAxis, MinorAxis, Orientation, "\ + "ReferenceFrequency='"+freq+"', "\ + "SpectralIndex='[]'\n\n") + elif patchnames[0] == None: outstr_list.append("format = Name, Type, Ra, Dec, I, Q, U, V, "\ "MajorAxis, MinorAxis, Orientation, "\ "ReferenceFrequency='"+freq+"', "\ @@ -507,51 +532,54 @@ def make_bbs_str(img, glist, gnames, patchnames): gaussians_in_patch = glist[pindx] names_in_patch = gnames[pindx] for gindx, g in enumerate(gaussians_in_patch): - src_name = names_in_patch[gindx] - ra, dec = g.centre_sky - if img.equinox == 1950: - ra, dec = B1950toJ2000([ra, dec]) - ra = ra2hhmmss(ra) - sra = str(ra[0]).zfill(2)+':'+str(ra[1]).zfill(2)+':'+str("%.3f" % (ra[2])).zfill(6) - dec = dec2ddmmss(dec) - decsign = ('-' if dec[3] < 0 else '+') - sdec = decsign+str(dec[0]).zfill(2)+'.'+str(dec[1]).zfill(2)+'.'+str("%.3f" % (dec[2])).zfill(6) - total = str("%.3e" % (g.total_flux)) - deconv = g.deconv_size_sky - if deconv[0] == 0.0 and deconv[1] == 0.0: - stype = 'POINT' - deconv[2] = 0.0 - else: - stype = 'GAUSSIAN' - deconv1 = str("%.5e" % (deconv[0]*3600.0)) - deconv2 = str("%.5e" % (deconv[1]*3600.0)) - deconv3 = str("%.5e" % (deconv[2])) - deconvstr = deconv1 + ', ' + deconv2 + ', ' + deconv3 - specin = '-0.8' - if hasattr(g, 'spec_indx'): - if g.spec_indx != None and N.isfinite(g.spec_indx): - specin = str("%.3e" % (g.spec_indx)) - sep = ', ' - if img.opts.polarisation_do: - Q_flux = str("%.3e" % (g.total_flux_Q)) - U_flux = str("%.3e" % (g.total_flux_U)) - V_flux = str("%.3e" % (g.total_flux_V)) - else: - Q_flux = '0.0' - U_flux = '0.0' - V_flux = '0.0' - if patch_name == None: - outstr_list.append(src_name + sep + stype + sep + sra + sep + - sdec + sep + total + sep + Q_flux + sep + - U_flux + sep + V_flux + sep + - deconvstr + sep + freq + sep + - '[' + specin + ']\n') + if g.gaus_num >= 0 or (g.gaus_num < 0 and img.opts.incl_empty): + src_name = names_in_patch[gindx] + ra, dec = g.centre_sky + if img.equinox == 1950: + ra, dec = B1950toJ2000([ra, dec]) + ra = ra2hhmmss(ra) + sra = str(ra[0]).zfill(2)+':'+str(ra[1]).zfill(2)+':'+str("%.3f" % (ra[2])).zfill(6) + dec = dec2ddmmss(dec) + decsign = ('-' if dec[3] < 0 else '+') + sdec = decsign+str(dec[0]).zfill(2)+'.'+str(dec[1]).zfill(2)+'.'+str("%.3f" % (dec[2])).zfill(6) + total = str("%.3e" % (g.total_flux)) + deconv = g.deconv_size_sky + if deconv[0] == 0.0 and deconv[1] == 0.0: + stype = 'POINT' + deconv[2] = 0.0 + else: + stype = 'GAUSSIAN' + deconv1 = str("%.5e" % (deconv[0]*3600.0)) + deconv2 = str("%.5e" % (deconv[1]*3600.0)) + deconv3 = str("%.5e" % (deconv[2])) + deconvstr = deconv1 + ', ' + deconv2 + ', ' + deconv3 + specin = '-0.8' + if hasattr(g, 'spec_indx'): + if g.spec_indx != None and N.isfinite(g.spec_indx): + specin = str("%.3e" % (g.spec_indx)) + sep = ', ' + if img.opts.polarisation_do: + Q_flux = str("%.3e" % (g.total_flux_Q)) + U_flux = str("%.3e" % (g.total_flux_U)) + V_flux = str("%.3e" % (g.total_flux_V)) + else: + Q_flux = '0.0' + U_flux = '0.0' + V_flux = '0.0' + if patch_name == None: + outstr_list.append(src_name + sep + stype + sep + sra + sep + + sdec + sep + total + sep + Q_flux + sep + + U_flux + sep + V_flux + sep + + deconvstr + sep + freq + sep + + '[' + specin + ']\n') + else: + outstr_list.append(src_name + sep + stype + sep + patch_name + + sep + sra + sep + sdec + sep + total + sep + + Q_flux + sep + U_flux + sep + V_flux + sep + + deconvstr + sep + freq + sep + + '[' + specin + ']\n') else: - outstr_list.append(src_name + sep + stype + sep + patch_name + - sep + sra + sep + sdec + sep + total + sep + - Q_flux + sep + U_flux + sep + V_flux + sep + - deconvstr + sep + freq + sep + - '[' + specin + ']\n') + outstr_list.pop() return outstr_list def make_lsm_str(img, glist, gnames): @@ -562,56 +590,57 @@ def make_lsm_str(img, glist, gnames): import numpy as N outstr_list = [] - freq = "%.5e" % img.cfreq + freq = "%.5e" % img.frequency outstr_list.append("## LSM file\n### Name | RA (hr,min,sec) | DEC (deg,min,sec) | I | Q | U | V | SI | RM | eX | eY | eP | freq0\n\n") for gindx, g in enumerate(glist[0]): - src_name = gnames[0][gindx] - ra, dec = g.centre_sky - if img.equinox == 1950: - ra, dec = B1950toJ2000([ra, dec]) - ra = ra2hhmmss(ra) - sra = str(ra[0]).zfill(2)+' '+str(ra[1]).zfill(2)+' '+str("%.3f" % (ra[2])).zfill(6) - dec = dec2ddmmss(dec) - decsign = ('-' if dec[3] < 0 else '+') - sdec = decsign+str(dec[0]).zfill(2)+' '+str(dec[1]).zfill(2)+' '+str("%.3f" % (dec[2])).zfill(6) - size = g.size_sky # degrees, in terms of FWHM - src_area = 1.1331*size[0]*size[1]*fwsig*fwsig*3600.0**2 # area of source in arcsec**2 - peak = str("%.3e" % (g.total_flux/src_area)) # peak flux in Jy/arcsec**2 - deconv = g.deconv_size_sky - if deconv[0] == 0.0 and deconv[1] == 0.0: - sname = 'P' + src_name - deconv[2] = 0.0 - else: - sname = 'G' + src_name - deconv1 = str("%.5e" % (deconv[0]*N.pi/180.0/2.0)) - deconv2 = str("%.5e" % (deconv[1]*N.pi/180.0/2.0)) - deconv3 = str("%.5e" % (deconv[2]*N.pi/180.0/2.0)) - deconvstr = deconv1 + ' ' + deconv2 + ' ' + deconv3 - specin = '-0.8' - if hasattr(g, 'spec_indx'): - if g.spec_indx != None and N.isfinite(g.spec_indx): - specin = str("%.3e" % (g.spec_indx)) - sep = ' ' - if img.opts.polarisation_do: - Q_flux = str("%.3e" % (g.total_flux_Q/src_area)) - U_flux = str("%.3e" % (g.total_flux_U/src_area)) - V_flux = str("%.3e" % (g.total_flux_V/src_area)) - else: - Q_flux = '0.0' - U_flux = '0.0' - V_flux = '0.0' - outstr_list.append(sname + sep + sra + sep + - sdec + sep + peak + sep + Q_flux + sep + - U_flux + sep + V_flux + sep + - specin + sep + '0' + sep + deconvstr + sep + - freq + sep + '\n') + if g.gaus_num >= 0 or (g.gaus_num < 0 and img.opts.incl_empty): + src_name = gnames[0][gindx] + ra, dec = g.centre_sky + if img.equinox == 1950: + ra, dec = B1950toJ2000([ra, dec]) + ra = ra2hhmmss(ra) + sra = str(ra[0]).zfill(2)+' '+str(ra[1]).zfill(2)+' '+str("%.3f" % (ra[2])).zfill(6) + dec = dec2ddmmss(dec) + decsign = ('-' if dec[3] < 0 else '+') + sdec = decsign+str(dec[0]).zfill(2)+' '+str(dec[1]).zfill(2)+' '+str("%.3f" % (dec[2])).zfill(6) + size = g.size_sky # degrees, in terms of FWHM + src_area = 1.1331*size[0]*size[1]*fwsig*fwsig*3600.0**2 # area of source in arcsec**2 + peak = str("%.3e" % (g.total_flux/src_area)) # peak flux in Jy/arcsec**2 + deconv = g.deconv_size_sky + if deconv[0] == 0.0 and deconv[1] == 0.0: + sname = 'P' + src_name + deconv[2] = 0.0 + else: + sname = 'G' + src_name + deconv1 = str("%.5e" % (deconv[0]*N.pi/180.0/2.0)) + deconv2 = str("%.5e" % (deconv[1]*N.pi/180.0/2.0)) + deconv3 = str("%.5e" % (deconv[2]*N.pi/180.0/2.0)) + deconvstr = deconv1 + ' ' + deconv2 + ' ' + deconv3 + specin = '-0.8' + if hasattr(g, 'spec_indx'): + if g.spec_indx != None and N.isfinite(g.spec_indx): + specin = str("%.3e" % (g.spec_indx)) + sep = ' ' + if img.opts.polarisation_do: + Q_flux = str("%.3e" % (g.total_flux_Q/src_area)) + U_flux = str("%.3e" % (g.total_flux_U/src_area)) + V_flux = str("%.3e" % (g.total_flux_V/src_area)) + else: + Q_flux = '0.0' + U_flux = '0.0' + V_flux = '0.0' + outstr_list.append(sname + sep + sra + sep + + sdec + sep + peak + sep + Q_flux + sep + + U_flux + sep + V_flux + sep + + specin + sep + '0' + sep + deconvstr + sep + + freq + sep + '\n') return outstr_list def make_ds9_str(img, glist, gnames, deconvolve=False): """Makes a list of string entries for a ds9 region file.""" outstr_list = [] - freq = "%.5e" % img.cfreq + freq = "%.5e" % img.frequency if img.equinox == None: equinox = 'fk5' else: @@ -629,29 +658,30 @@ def make_ds9_str(img, glist, gnames, deconvolve=False): 'move=1 delete=1 include=1 fixed=0 source\n'+equinox+'\n') for gindx, g in enumerate(glist[0]): - src_name = gnames[0][gindx] - try: - ra, dec = g.centre_sky - except AttributeError: - ra, dec = g.posn_sky_centroid - if deconvolve: - deconv = g.deconv_size_sky - else: - deconv = g.size_sky - if deconv[0] == 0.0 and deconv[1] == 0.0: - stype = 'POINT' - deconv[2] = 0.0 - region = 'point(' + str(ra) + ',' + str(dec) + \ - ') # point=cross width=2 text={' + src_name + '}\n' - else: - # ds9 can't handle 1-D Gaussians, so make sure they are 2-D - if deconv[0] < 1.0/3600.0: deconv[0] = 1.0/3600.0 - if deconv[1] < 1.0/3600.0: deconv[1] = 1.0/3600.0 - stype = 'GAUSSIAN' - region = 'ellipse(' + str(ra) + ',' + str(dec) + ',' + \ - str(deconv[0]*3600.0) + '",' + str(deconv[1]*3600.0) + \ - '",' + str(deconv[2]+90.0) + ') # text={' + src_name + '}\n' - outstr_list.append(region) + if g.gaus_num >= 0 or (g.gaus_num < 0 and img.opts.incl_empty): + src_name = gnames[0][gindx] + try: + ra, dec = g.centre_sky + except AttributeError: + ra, dec = g.posn_sky_centroid + if deconvolve: + deconv = g.deconv_size_sky + else: + deconv = g.size_sky + if deconv[0] == 0.0 and deconv[1] == 0.0: + stype = 'POINT' + deconv[2] = 0.0 + region = 'point(' + str(ra) + ',' + str(dec) + \ + ') # point=cross width=2 text={' + src_name + '}\n' + else: + # ds9 can't handle 1-D Gaussians, so make sure they are 2-D + if deconv[0] < 1.0/3600.0: deconv[0] = 1.0/3600.0 + if deconv[1] < 1.0/3600.0: deconv[1] = 1.0/3600.0 + stype = 'GAUSSIAN' + region = 'ellipse(' + str(ra) + ',' + str(dec) + ',' + \ + str(deconv[0]*3600.0) + '",' + str(deconv[1]*3600.0) + \ + '",' + str(deconv[2]+90.0) + ') # text={' + src_name + '}\n' + outstr_list.append(region) return outstr_list @@ -659,7 +689,7 @@ def make_ascii_str(img, glist, objtype='gaul'): """Makes a list of string entries for an ascii region file.""" from _version import __version__, __revision__ outstr_list = [] - freq = "%.5e" % img.cfreq + freq = "%.5e" % img.frequency if objtype == 'gaul': outstr_list.append('# Gaussian list for '+img.filename+'\n') @@ -682,11 +712,13 @@ def make_ascii_str(img, glist, objtype='gaul'): incl_chan=img.opts.incl_chan, incl_pol=img.opts.polarisation_do, incl_aper=incl_aper, + incl_empty = img.opts.incl_empty, nchan=img.nchan) - cformats[-1] += "\n" - if i == 0: - outstr_list.append("# " + " ".join(cnames) + "\n") - outstr_list.append(" ".join(cformats) % tuple(cvals)) + if cvals != None: + cformats[-1] += "\n" + if i == 0: + outstr_list.append("# " + " ".join(cnames) + "\n") + outstr_list.append(" ".join(cformats) % tuple(cvals)) return outstr_list @@ -704,8 +736,10 @@ def make_fits_list(img, glist, objtype='gaul', nmax=30): incl_chan=img.opts.incl_chan, incl_pol=img.opts.polarisation_do, incl_aper=incl_aper, + incl_empty=img.opts.incl_empty, nmax=nmax, nchan=img.nchan) - out_list.append(cvals) + if cvals != None: + out_list.append(cvals) out_list = func.trans_gaul(out_list) return out_list @@ -909,7 +943,7 @@ def list_and_sort_gaussians(img, patch=None, root=None, def make_output_columns(obj, fits=False, objtype='gaul', incl_spin=False, incl_chan=False, incl_pol=False, incl_aper=False, - nmax=30, nchan=1): + incl_empty=False, nmax=30, nchan=1): """Returns a list of column names, formats, and units for Gaussian, Source, or Shapelet""" import numpy as N @@ -950,7 +984,7 @@ def make_output_columns(obj, fits=False, objtype='gaul', incl_spin=False, 'shapelet_beta', 'shapelet_nmax', 'shapelet_cf'] else: print 'Object type unrecongnized.' - return None + return (None, None, None, None) if incl_spin: names += ['spec_indx', 'e_spec_indx'] if incl_chan: @@ -1040,4 +1074,11 @@ def make_output_columns(obj, fits=False, objtype='gaul', incl_spin=False, cformats.append('%10f') if isinstance(v, str): cformats.append('%4s') + + if objtype == 'gaul': + if obj.gaus_num < 0 and not incl_empty: + return (None, cnames, cformats, cunits) + if objtype == 'srl': + if obj.source_id < 0 and not incl_empty: + return (None, cnames, cformats, cunits) return (cvals, cnames, cformats, cunits) diff --git a/CEP/PyBDSM/src/python/plotresults.py b/CEP/PyBDSM/src/python/plotresults.py index 3e6401ae05b6b3220b0f3295124b747fa9cb6320..f2956b98f759086a8624ae0bd1e4f6bdc3c55db7 100644 --- a/CEP/PyBDSM/src/python/plotresults.py +++ b/CEP/PyBDSM/src/python/plotresults.py @@ -25,17 +25,35 @@ def plotresults(img, ch0_image=True, rms_image=True, mean_image=True, ch0_islands=True, gresid_image=True, sresid_image=False, gmodel_image=True, smodel_image=False, pyramid_srcs=False, source_seds=False, ch0_flagged=False, pi_image=False, - psf_major=False, psf_minor=False, psf_pa=False): + psf_major=False, psf_minor=False, psf_pa=False, broadcast=False): """Show the results of a fit.""" global img_ch0, img_rms, img_mean, img_gaus_mod, img_shap_mod global img_gaus_resid, img_shap_resid, pixels_per_beam, pix2sky global vmin, vmax, vmin_cur, vmax_cur, ch0min, ch0max, img_pi global low, fig, images, src_list, srcid_cur, sky2pix, markers - global img_psf_maj, img_psf_min, img_psf_pa + global img_psf_maj, img_psf_min, img_psf_pa, do_broadcast, samp_client + global samp_key, samp_gaul_table_url, samp_srl_table_url if not has_pl: print "\033[31;1mWARNING\033[0m: Matplotlib not found. Plotting is disabled." return + if hasattr(img, 'samp_client'): + samp_client = img.samp_client + samp_key = img.samp_key + if hasattr(img, 'samp_srl_table_url'): + samp_srl_table_url = img.samp_srl_table_url + else: + samp_srl_table_url = None + if hasattr(img, 'samp_gaul_table_url'): + samp_gaul_table_url = img.samp_gaul_table_url + else: + samp_gaul_table_url = None + else: + samp_clent = None + samp_key = None + samp_srl_table_url = None + samp_gaul_table_url = None + do_broadcast = broadcast # Define the images. The images are used both by imshow and by the # on_press() and coord_format event handlers @@ -282,7 +300,7 @@ def plotresults(img, ch0_image=True, rms_image=True, mean_image=True, valid = g.valid else: valid = True - if g.jlevel == 0 and valid: + if g.jlevel == 0 and valid and g.gaus_num >= 0: gidx = g.gaus_num e = Ellipse(xy=g.centre_pix, width=g.size_pix[0], height=g.size_pix[1], angle=g.size_pix[2]+90.0) @@ -297,6 +315,7 @@ def plotresults(img, ch0_image=True, rms_image=True, mean_image=True, e.isl_id = g.island_id e.tflux = g.total_flux e.pflux = g.peak_flux + e.centre_sky = g.centre_sky if len(img.islands) > 0: island_offsets = zip(N.array(island_offsets_x), N.array(island_offsets_y)) isl_borders = collections.AsteriskPolygonCollection(4, offsets=island_offsets, color=border_color, @@ -305,7 +324,7 @@ def plotresults(img, ch0_image=True, rms_image=True, mean_image=True, if hasattr(img, 'gaussians'): for atrg in img.gaussians: - if atrg.jlevel > 0: + if atrg.jlevel > 0 and atrg.gaus_num >= 0: col = 'r' style = '-' gidx = atrg.gaus_num @@ -322,6 +341,7 @@ def plotresults(img, ch0_image=True, rms_image=True, mean_image=True, e.isl_id = atrg.island_id e.tflux = atrg.total_flux e.pflux = atrg.peak_flux + e.centre_sky = atrg.centre_sky if 'Flagged' in titles[i]: for iisl, isl in enumerate(img.islands): @@ -378,8 +398,7 @@ def plotresults(img, ch0_image=True, rms_image=True, mean_image=True, def on_pick(event): - global images - global srcid_cur + global images, srcid_cur, samp_client, samp_key, do_broadcast, samp_gaul_table_url, samp_srl_table_url g = event.artist if hasattr(g, 'gaus_id'): gaus_id = g.gaus_id @@ -398,6 +417,14 @@ def on_pick(event): '): F_tot = ' + str(round(tflux,3)) + ' Jy, F_peak = ' + \ str(round(pflux,4)) + ' Jy/beam' + # Transmit src_id, gaus_id, and coordinates to SAMP Hub (if we are connected) + if do_broadcast and samp_key != None: + if samp_gaul_table_url != None: + func.send_highlight_row(samp_client, samp_key, samp_gaul_table_url, gaus_id) + if samp_srl_table_url != None: + func.send_highlight_row(samp_client, samp_key, samp_srl_table_url, src_id) + func.send_coords(samp_client, samp_key, g.centre_sky) + # Change source SED # First check that SEDs are being plotted and that the selected Gaussian # is from the zeroth wavelet image @@ -640,14 +667,14 @@ def format_coord_psf_maj(x, y): """Custom coordinate format for PSF major image""" global img_psf_maj im = img_psf_maj - coord_str = make_coord_str(x, y, im, unit='pixels') + coord_str = make_coord_str(x, y, im, unit='arcsec') return coord_str def format_coord_psf_min(x, y): """Custom coordinate format for PSF minor image""" global img_psf_min im = img_psf_min - coord_str = make_coord_str(x, y, im, unit='pixels') + coord_str = make_coord_str(x, y, im, unit='arcsec') return coord_str def format_coord_psf_pa(x, y): diff --git a/CEP/PyBDSM/src/python/polarisation.py b/CEP/PyBDSM/src/python/polarisation.py index a18bf2b1b905210caf2e94269952cfd2c47acbda..2cca57ead7226314ea7b4bc54fe1f2074e7d4ff4 100644 --- a/CEP/PyBDSM/src/python/polarisation.py +++ b/CEP/PyBDSM/src/python/polarisation.py @@ -354,6 +354,7 @@ class Op_polarisation(Op): src.lpol_angle_err = lpol_ang_err if bar.started: bar.increment() + bar.stop() img.completed_Ops.append('polarisation') #################################################################################### diff --git a/CEP/PyBDSM/src/python/preprocess.py b/CEP/PyBDSM/src/python/preprocess.py index f804470a10a834f6c0d8e71fae512b2136e19a76..650ba4a7d52b9d63f8baf9c536b4e50bb8d67917 100644 --- a/CEP/PyBDSM/src/python/preprocess.py +++ b/CEP/PyBDSM/src/python/preprocess.py @@ -32,7 +32,7 @@ Image.omega = Float(doc="Solid angle covered by the image") confused = String(doc = 'confused image or not') class Op_preprocess(Op): - """Preprocessing -- calculate some basic statistics and set + """Preprocessing -- calculate some basic statistics and set processing parameters. Should assume that pixels outside the universe are blanked in QC ? """ @@ -84,7 +84,7 @@ class Op_preprocess(Op): mylogger.userinfo(mylog, "Determining the pixels outside the universe") noutside_univ = self.outside_univ(img) img.noutside_univ = noutside_univ - + # If any are found, (re)mask the image if noutside_univ > 0: mask = N.isnan(img.ch0) @@ -122,10 +122,10 @@ class Op_preprocess(Op): ### Total flux in ch0 image if 'atrous' in img.filename or hasattr(img, '_pi') or img.log == 'Detection image': - # Don't do this estimate for atrous wavelet images + # Don't do this estimate for atrous wavelet images # or polarized intensity image, # as it doesn't give the correct flux. Also, ignore - # the flux in the detection image, as it's likely + # the flux in the detection image, as it's likely # wrong (e.g., not corrected for the primary beam). img.ch0_sum_jy = 0 else: @@ -133,14 +133,14 @@ class Op_preprocess(Op): img.ch0_sum_jy = im_flux mylogger.userinfo(mylog, 'Flux from sum of (non-blank) pixels', '%.3f Jy' % (im_flux,)) - + ### if image seems confused, then take background mean as zero instead - alpha_sourcecounts = 2.5 # approx diff src count slope. 2.2? + alpha_sourcecounts = 2.5 # approx diff src count slope. 2.2? if opts.bmpersrc_th is None: n = (image >= 5.*crms).sum() - if n <= 0: + if n <= 0: n = 1 - mylog.warning('No pixels in image > 5-sigma.') + mylog.info('No pixels in image > 5-sigma.') mylog.info('Taking number of pixels above 5-sigma as 1.') img.bmpersrc_th = N.product(shape)/((alpha_sourcecounts-1.)*n) mylog.info('%s %6.2f' % ('Estimated bmpersrc_th = ', img.bmpersrc_th)) @@ -154,14 +154,14 @@ class Op_preprocess(Op): confused = True img.confused = confused mylog.info('Parameter confused is '+str(img.confused)) - + img.completed_Ops.append('preprocess') return img def outside_univ(self,img): - """ Checks if a pixel is outside the universe and is not blanked, + """ Checks if a pixel is outside the universe and is not blanked, and blanks it. (fits files written by CASA dont do this). """ - + noutside = 0 n, m = img.ch0.shape for i in range(n): @@ -172,10 +172,10 @@ class Op_preprocess(Op): try: skyc = img.pix2sky(pix1) pix2 = img.sky2pix(skyc) - if abs(pix1[0]-pix2[0]) > 0.5 or abs(pix1[1]-pix2[1]) > 0.5: out=True + if abs(pix1[0]-pix2[0]) > 0.5 or abs(pix1[1]-pix2[1]) > 0.5: out=True except RuntimeError, err: pass - if out or ("8" in str(err)): + if out or ("8" in str(err)): noutside += 1 img.ch0[pix1] = float("NaN") return noutside diff --git a/CEP/PyBDSM/src/python/psf_vary.py b/CEP/PyBDSM/src/python/psf_vary.py index 4fa993ba0fc3303407e81dfdab121daf563a9f7b..252e09f3d027fce62a4b88a52eb105602354c9a5 100644 --- a/CEP/PyBDSM/src/python/psf_vary.py +++ b/CEP/PyBDSM/src/python/psf_vary.py @@ -19,6 +19,9 @@ import nat from math import * import statusbar from const import fwsig +import multi_proc as mp +import itertools + class Op_psf_vary(Op): """Computes variation of psf across the image """ @@ -128,7 +131,6 @@ class Op_psf_vary(Op): tile_prop = self.edit_vorogenlist(vorogenP, frac=0.9) # tesselate the image - #volrank, volrank_tilenum, wts = tesselate(vorogenP, vorogenS, tile_prop, tess_method, tess_sc, tess_fuzzy, \ volrank, vorowts = self.tesselate(vorogenP, vorogenS, tile_prop, tess_method, tess_sc, tess_fuzzy, \ generators, gencode, image.shape) if opts.output_all: @@ -168,6 +170,7 @@ class Op_psf_vary(Op): psf_cf.append(cf) if img.opts.quiet == False: bar.increment() + bar.stop() # transpose the psf image list xt, yt = N.transpose(tile_coord) @@ -191,7 +194,7 @@ class Op_psf_vary(Op): basis, beta, cen, totpsfimage, plot) img.psf_images = aa else: - if ntile < 3: + if ntile < 4: mylog.warning('Insufficient number of tiles to do interpolation of PSF variation') return else: @@ -226,37 +229,82 @@ class Op_psf_vary(Op): if img.opts.quiet == False: bar.increment() + bar.stop() # Interpolate Gaussian parameters - psf_maj_int = self.interp_prop(psf_maj, psfcoords, image.shape) - psf_min_int = self.interp_prop(psf_min, psfcoords, image.shape) - psf_pa_int = self.interp_prop(psf_pa, psfcoords, image.shape) - psf_ratio_int = self.interp_prop(psfratio, psfcoords, image.shape) - psf_ratio_aper_int = self.interp_prop(psfratio_aper, psfcoords, image.shape) + if img.aperture == None: + psf_maps = [psf_maj, psf_min, psf_pa, psfratio] + else: + psf_maps = [psf_maj, psf_min, psf_pa, psfratio, psfratio_aper] + nimgs = len(psf_maps) + bar = statusbar.StatusBar('Interpolating PSF images ................ : ', 0, nimgs) + if img.opts.quiet == False: + bar.start() + map_list = mp.parallel_map(func.eval_func_tuple, + itertools.izip(itertools.repeat(self.interp_prop), + psf_maps, itertools.repeat(psfcoords), + itertools.repeat(image.shape)), numcores=opts.ncores, + bar=bar) + if img.aperture == None: + psf_maj_int, psf_min_int, psf_pa_int, psf_ratio_int = map_list + else: + psf_maj_int, psf_min_int, psf_pa_int, psf_ratio_int, psf_ratio_aper_int = map_list + + # Smooth if desired + if img.opts.psf_smooth != None: + sm_scale = img.opts.psf_smooth / img.pix2beam([1.0, 1.0, 0.0])[0] / 3600.0 # pixels + if img.opts.aperture == None: + psf_maps = [psf_maj_int, psf_min_int, psf_pa_int, psf_ratio_int] + else: + psf_maps = [psf_maj_int, psf_min_int, psf_pa_int, psf_ratio_int, psf_ratio_aper_int] + nimgs = len(psf_maps) + bar = statusbar.StatusBar('Smoothing PSF images .................... : ', 0, nimgs) + if img.opts.quiet == False: + bar.start() + map_list = mp.parallel_map(func.eval_func_tuple, + itertools.izip(itertools.repeat(self.blur_image), + psf_maps, itertools.repeat(sm_scale)), numcores=opts.ncores, + bar=bar) + if img.aperture == None: + psf_maj_int, psf_min_int, psf_pa_int, psf_ratio_int = map_list + else: + psf_maj_int, psf_min_int, psf_pa_int, psf_ratio_int, psf_ratio_aper_int = map_list + + # Make sure all smoothed, interpolated images are ndarrays + psf_maj_int = N.array(psf_maj_int) + psf_min_int = N.array(psf_min_int) + psf_pa_int = N.array(psf_pa_int) + psf_ratio_int = N.array(psf_ratio_int) + if img.aperture == None: + psf_ratio_aper_int = N.zeros(psf_maj_int.shape) + else: + psf_ratio_aper_int = N.array(psf_ratio_aper_int) + + # Store interpolated images. The major and minor axis images are + # the sigma in units of arcsec, the PA image in units of degrees east of + # north, the ratio images in units of 1/beam. + img.psf_vary_maj = psf_maj_int * img.pix2beam([1.0, 1.0, 0.0])[0] * 3600.0 # sigma in arcsec + img.psf_vary_min = psf_min_int * img.pix2beam([1.0, 1.0, 0.0])[0] * 3600.0 # sigma in arcsec + img.psf_vary_pa = psf_pa_int + img.psf_vary_ratio = psf_ratio_int # in 1/beam + img.psf_vary_ratio_aper = psf_ratio_aper_int # in 1/beam # Blank with NaNs if needed mask = img.mask if isinstance(mask, N.ndarray): pix_masked = N.where(mask == True) - psf_maj_int[pix_masked] = N.nan - psf_min_int[pix_masked] = N.nan - psf_pa_int[pix_masked] = N.nan - psf_ratio_int[pix_masked] = N.nan - psf_ratio_aper_int[pix_masked] = N.nan - - # Store interpolated images - img.psf_vary_maj = psf_maj_int - img.psf_vary_min = psf_min_int - img.psf_vary_pa = psf_pa_int - img.psf_vary_ratio = psf_ratio_int - img.psf_vary_ratio_aper = psf_ratio_aper_int + img.psf_vary_maj[pix_masked] = N.nan + img.psf_vary_min[pix_masked] = N.nan + img.psf_vary_pa[pix_masked] = N.nan + img.psf_vary_ratio[pix_masked] = N.nan + img.psf_vary_ratio_aper[pix_masked] = N.nan if opts.output_all: - func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_maj.fits', psf_maj_int*fwsig, img, dir) - func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_min.fits', psf_min_int*fwsig, img, dir) - func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_pa.fits', psf_pa_int, img, dir) - func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_ratio.fits', psf_ratio_int, img, dir) - func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_ratio_aper.fits', psf_ratio_aper_int, img, dir) + func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_maj.fits', img.psf_vary_maj*fwsig, img, dir) + func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_min.fits', img.psf_vary_min*fwsig, img, dir) + func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_pa.fits', img.psf_vary_pa, img, dir) + func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_ratio.fits', img.psf_vary_ratio, img, dir) + func.write_image_to_file(img.use_io, img.imagename + '.psf_vary_ratio_aper.fits', img.psf_vary_ratio_aper, img, dir) # Loop through source and Gaussian lists and deconvolve the sizes using appropriate beam bar2 = statusbar.StatusBar('Correcting deconvolved source sizes ..... : ', 0, img.nsrc) @@ -279,6 +327,7 @@ class Op_psf_vary(Op): bar2.spin() if img.opts.quiet == False: bar2.increment() + bar2.stop() img.completed_Ops.append('psf_vary') ################################################################################################## @@ -297,8 +346,8 @@ class Op_psf_vary(Op): def bindata(self, over,num): #ptpbin,nbin,ptplastbin, same as get_bins in fBDSM. - if num <100: ptpbin=num/5 - if num >100: ptpbin=num/10 + if num <= 100: ptpbin=num/5 + if num > 100: ptpbin=num/10 if num > 1000: ptpbin=num/20 if ptpbin % 2 == 1: ptpbin=ptpbin+1 if num < 10: ptpbin=num @@ -485,43 +534,30 @@ class Op_psf_vary(Op): ################################################################################################## def get_voronoi_generators(self, g_gauls, generators, gencode, snrcut, snrtop, snrbot, snrcutstack): """This gets the list of all voronoi generators. It is either the centres of the brightest - sources, or is imported from metadata (in future). generators=calib implies only one source - per facet, and sources between snrtop and snrmax are primary generators. generators=field - implies all sources between snrbot and snrtop are secondary generators. This is the same as - get_voronoi_generators.f in fBDSM. If calibrators='field' then vorogenS is a list of gen.s else - is None.""" + sources, or is imported from metadata (in future).""" from math import sqrt num=len(g_gauls[0]) snr=N.asarray(g_gauls[1])/N.asarray(g_gauls[8]) index=snr.argsort() - snr = snr[index] -# snr = snr[::-1] + snr_incr = snr[index] + snr = snr_incr[::-1] x = N.asarray(g_gauls[2])[index] y = N.asarray(g_gauls[3])[index] - cutoff = 0; npts = 0 + cutoff = 0 if generators == 'calibrators' or generators == 'field': - if gencode != 'file': gencode = 'list' + if gencode != 'file': + gencode = 'list' if gencode == 'list': cutoff = int(round(num*(snrtop))) - if cutoff == len(snr): - cutoff -= 1 + if cutoff > len(snr): + cutoff = len(snr) # Make sure we don't fall below snrcutstack (SNR cut for stacking of PSFs), since # it makes no sense to make tiles with generators that fall below this cut. - if snr[cutoff] < snrcutstack: cutoff = snr.searchsorted(snrcutstack) - if cutoff < 2: - cutoff = 2 - npts = num - cutoff + 1 - -# if generators == 'field': -# cutoff = int(round(num*(1.0-snrtop))) -# if cutoff < 2: -# cutoff = 2 -# npts = num - cutoff + 1 -# cutoffs = int(round(num*(1.0-snrbot))) -# nptss = cutoff - cutoffs + if snr[cutoff-1] < snrcutstack: + cutoff = num - snr_incr.searchsorted(snrcutstack) if generators == 'calibrators': if gencode == 'file': @@ -531,17 +567,10 @@ class Op_psf_vary(Op): y1 = y.tolist() x1.reverse() y1.reverse() - x=x1 - y=y1 snr1 = snr.tolist() - snr1.reverse() - snr = snr1 - vorogenP = N.asarray([x[0:cutoff-2], y[0:cutoff-2], snr[0:cutoff-2]]) + vorogenP = N.asarray([x1[0:cutoff], y1[0:cutoff], snr1[0:cutoff]]) - # for generator=field vorogenS = None - if generators == 'field': - vorogenS = N.asarray([x[cutoff-2:cutoffs-2:-1], y[cutoff-2:cutoffs-2:-1], snr[cutoff-2:cutoffs-2:-1]]) return vorogenP, vorogenS @@ -551,9 +580,8 @@ class Op_psf_vary(Op): have more than one generator to be averaged. tile_list is a list of arrays, indexed by the tile number and each array is an array of numbers in the ngen list which are the generators in that tile. xtile, ytile and snrtile are arrays of length number_of_tiles - and have x,y,snr of each tile. The list of tiles is modified later - using the secondary list in tesselate. For now though, just group together gen.s - if closer than a fraction of dist to third closest. Same as edit_vorogenlist in fBDSM. """ + and have x,y,snr of each tile. Group together generators + if closer than a fraction of dist to third closest.""" xgen, ygen, snrgen = vorogenP flag = N.zeros(len(xgen)) @@ -781,6 +809,7 @@ class Op_psf_vary(Op): and pass it to stackpsf with a weight for each gaussian, to calculate the average psf per tile. Should define weights inside a tile to include closure errors """ + mylog = mylogger.logging.getLogger("PyBDSM."+img.log+"Psf_Vary") tile_list, tile_coord, tile_snr = tile_prop tr_gaul = self.trans_gaul(g_gauls) @@ -792,10 +821,10 @@ class Op_psf_vary(Op): psfratio_aper = [] # ratio of peak flux to aperture flux srcpertile = N.zeros(ntile) snrpertile = N.zeros(ntile) + xt, yt = N.transpose(tile_coord) if plot: pl.figure(None) - xt, yt = N.transpose(tile_coord) colours=['b','g','r','c','m','y','k']*(len(xt)/7+1) pl.axis([0.0, image.shape[0], 0.0, image.shape[1]]) pl.title('Tesselated image with tile centres and unresolved sources') @@ -807,7 +836,6 @@ class Op_psf_vary(Op): tile_gauls = [n for n in tr if volrank[int(round(n[2])),int(round(n[3]))]-1 \ == itile] t_gauls = self.trans_gaul(tile_gauls) - srcpertile[itile] = len(tile_gauls) if plot: pl.plot(t_gauls[2], t_gauls[3], 'x'+'k', mew=1.3)#colours[itile]) @@ -817,6 +845,8 @@ class Op_psf_vary(Op): pl.plot(xx,yy,'-'+colours[itile]) wts = N.asarray(t_gauls[1])/N.asarray(t_gauls[8]) # wt is SNR snrpertile[itile] = sum(wts) + mylog.info('PSF tile #%i (center = %i, %i): %i unresolved sources, SNR = %.1f' % + (itile, xt[itile], yt[itile], srcpertile[itile], snrpertile[itile])) a = self.stackpsf(image, beam, t_gauls, wts, cdelt, factor) psfimages.append(a) psfcoords.append([sum(N.asarray(t_gauls[2])*wts)/sum(wts), sum(N.asarray(t_gauls[3])*wts)/sum(wts)]) @@ -921,19 +951,6 @@ class Op_psf_vary(Op): yo=N.arange(0.0,round(imshape[1]), round(compress)) rgrid=nat.Natgrid(xi,yi,xo,yo) prop_int = rgrid.rgrd(prop) -# if img.masked: -# unmasked = N.where(~mask) -# stdprop = N.std(prop_int[unmasked]) -# minprop = N.min(prop_int[unmasked]) -# maxprop = N.max(prop_int[unmasked]) -# else: -# stdprop = N.std(prop_int) -# minprop = N.min(prop_int) -# maxprop = N.max(prop_int) -# if (maxprop - minprop) > 3.0*stdprop: -# return prop_int -# else: -# return N.mean(prop_int) return prop_int ################################################################################################## @@ -992,3 +1009,18 @@ class Op_psf_vary(Op): # return blah +################################################################################################## + def blur_image(self, im, n, ny=None) : + """ blurs the image by convolving with a gaussian kernel of typical + size n. The optional keyword argument ny allows for a different + size in the y direction. + """ + from scipy.ndimage import gaussian_filter + + sx = n + if ny != None: + sy = ny + else: + sy = n + improc = gaussian_filter(im, [sy, sx]) + return improc diff --git a/CEP/PyBDSM/src/python/pybdsm.py b/CEP/PyBDSM/src/python/pybdsm.py index cf1a39fd917ec23c78f54f403f58801b91e5dee9..a2ca8f2f22c042d9e6ff4a6a9ef1f2dcb64b8e06 100644 --- a/CEP/PyBDSM/src/python/pybdsm.py +++ b/CEP/PyBDSM/src/python/pybdsm.py @@ -127,6 +127,12 @@ def tget(filename=None): import os global _img + + # Check whether user has given a task name as input (as done in casapy). + # If so, reset filename to None. + if hasattr(filename, 'arg_list'): + filename = None + if filename == None or filename == '': if os.path.isfile('pybdsm.last'): filename = 'pybdsm.last' @@ -223,12 +229,13 @@ def _set_pars_from_prompt(): # If an opt fails to set, replace its value in the namespace # with its current value in _img. Then print error so user knows. err_msg = str(err) - indx1 = err_msg.find('"') + 1 - indx2 = err_msg.find('"', indx1) - k = err_msg[indx1:indx2] + err_msg_trim = err_msg.split('(')[0] + indx1 = err_msg_trim.find('"') + 1 + indx2 = err_msg_trim.find('"', indx1) + k = err_msg_trim[indx1:indx2] orig_opt_val = opts[k] f_dict[k] = orig_opt_val - print '\033[31;1mERROR\033[0m: ' + str(err) + \ + print '\033[31;1mERROR\033[0m: ' + err_msg_trim + \ '\nResetting to previous value.' return False @@ -385,7 +392,7 @@ def show_fit(**kwargs): Parameters: ch0_image, rms_image, mean_image, ch0_islands, gresid_image, sresid_image, gmodel_image, smodel_image, source_seds, ch0_flagged, pi_image, - psf_major, psf_minor, psf_pa + psf_major, psf_minor, psf_pa, broadcast For more information about a parameter, use help. E.g., > help 'ch0_image' @@ -410,7 +417,7 @@ def show_fit(**kwargs): show_fit.arg_list = ['ch0_image', 'rms_image', 'mean_image', 'ch0_islands', 'gresid_image', 'sresid_image', 'gmodel_image', 'smodel_image', 'source_seds', 'ch0_flagged', 'pi_image', - 'psf_major', 'psf_minor', 'psf_pa'] + 'psf_major', 'psf_minor', 'psf_pa', 'broadcast'] show_fit.use_groups = False @@ -422,7 +429,7 @@ def write_catalog(**kwargs): "help 'format'" for more information. Parameters: outfile, format, srcroot, bbs_patches, incl_wavelet, clobber, - catalog_type + catalog_type, incl_empty For more information about a parameter, use help. E.g., > help 'bbs_patches' @@ -445,7 +452,7 @@ def write_catalog(**kwargs): print "\n\033[31;1mAborted\033[0m" write_catalog.arg_list = ['bbs_patches', 'format', 'outfile', 'srcroot', - 'incl_chan', 'clobber', 'catalog_type'] + 'incl_chan', 'clobber', 'catalog_type', 'incl_empty'] write_catalog.use_groups = False diff --git a/CEP/PyBDSM/src/python/readimage.py b/CEP/PyBDSM/src/python/readimage.py index 5fa6119d635d2fdb6ee299ec17075c4730cd8f16..50f17569e00bc7d907a3daaf052d9cd10c60a41d 100644 --- a/CEP/PyBDSM/src/python/readimage.py +++ b/CEP/PyBDSM/src/python/readimage.py @@ -23,7 +23,7 @@ Image.imagename = String(doc="Identifier name for output files") Image.filename = String(doc="Name of input file without FITS extension") Image.bbspatchnum = Int(doc="To keep track of patch number for bbs file "\ "for seperate patches per source") -Image.cfreq = Float(doc="Frequency in the header") +Image.frequency = Float(doc="Frequency in the header") Image.use_io = String(doc="pyfits or pyrap") Image.j = Int(doc="Wavelet order j, 0 for normal run") Image.freq_pars = Tuple((0.0, 0.0, 0.0), @@ -103,12 +103,15 @@ class Op_readimage(Op): root, ext = os.path.splitext(img.opts.filename) if ext in ['.fits', '.FITS', '.image']: fname = root + elif ext in ['.gz', '.GZ']: + root2, ext2 = os.path.splitext(root) + if ext2 in ['.fits', '.FITS', '.image']: + fname = root2 else: fname = img.opts.filename img.filename = img.opts.filename img.parentname = fname img.imagename = fname + '.pybdsm' - img.waveletimage = False if img.opts.output_all: # Set up directory to write output to basedir = './' + fname + '_pybdsm' @@ -140,9 +143,9 @@ class Op_readimage(Op): Thanks to transpose operation done to image earlier we can use p2s & s2p transforms directly. - + Both WCSLIB (from LOFAR svn) and PyWCS (http://stsdas.stsci.edu/ - astrolib/pywcs/, available from https://trac6.assembla.com/astrolib) + astrolib/pywcs/, available from https://trac6.assembla.com/astrolib) are supported. """ try: @@ -220,7 +223,7 @@ class Op_readimage(Op): img.sky2pix = t.s2p elif img.use_wcs == 'pywcs': # Here we define new p2s and s2p methods to match those of wcslib. - # Note that, due to a bug in pywcs version 1.10-4.7, the + # Note that, due to a bug in pywcs version 1.10-4.7, the # "ra_dec_order" option cannot be used. When the bug is fixed, # this option should probably be re-enabled. def p2s(self, xy): @@ -269,7 +272,7 @@ class Op_readimage(Op): ### define beam conversion routines: def beam2pix(x, location=None): """ Converts beam in deg to pixels. - + location specifies the location in pixels (x, y) for which beam is desired Input beam angle should be degrees CCW from North. The output beam angle is degrees CCW from the +y axis of the image. @@ -290,7 +293,7 @@ class Op_readimage(Op): def pix2beam(x, location=None): """ Converts beam in pixels to deg. - + location specifies the location in pixels (x, y) for which beam is desired Input beam angle should be degrees CCW from the +y axis of the image. The output beam angle is degrees CCW from North. @@ -376,13 +379,13 @@ class Op_readimage(Op): mylog = mylogger.logging.getLogger("PyBDSM.InitFreq") if img.opts.frequency_sp != None and img.image.shape[1] > 1: # If user specifies multiple frequencies, then let - # collapse.py do the initialization - img.cfreq = img.opts.frequency_sp[0] + # collapse.py do the initialization + img.frequency = img.opts.frequency_sp[0] img.freq_pars = (0.0, 0.0, 0.0) mylog.info('Using user-specified frequencies.') elif img.opts.frequency != None and img.image.shape[1] == 1: - img.cfreq = img.opts.frequency - img.freq_pars = (img.cfreq, 0.0, 0.0) + img.frequency = img.opts.frequency + img.freq_pars = (img.frequency, 0.0, 0.0) mylog.info('Using user-specified frequency.') else: found = False @@ -407,9 +410,9 @@ class Op_readimage(Op): ff = crval + cdelt * (1. - crpix) if found: if img.opts.frequency != None: - img.cfreq = img.opts.frequency + img.frequency = img.opts.frequency else: - img.cfreq = ff + img.frequency = ff img.freq_pars = (crval, cdelt, crpix) else: raise RuntimeError('No frequency information found in image header.') @@ -469,7 +472,7 @@ class Op_readimage(Op): def get_rot(self, img, location=None): """Returns CCW rotation angle (in degrees) between N and +y axis of image - + location specifies the location in pixels (x, y) for which beam is desired """ if location == None: diff --git a/CEP/PyBDSM/src/python/rmsimage.py b/CEP/PyBDSM/src/python/rmsimage.py index 3ed75ea76706db9cb8c85ea92c4d31a3963abc3e..fdc3e3f8cb93ad25540186d0f1999e327e00e19e 100644 --- a/CEP/PyBDSM/src/python/rmsimage.py +++ b/CEP/PyBDSM/src/python/rmsimage.py @@ -172,7 +172,6 @@ class Op_rmsimage(Op): if opts.rms_box is None or (opts.rms_box_bright is None and do_adapt): if do_adapt: bsize = int(max(brightsize, min_size_allowed, max_isl_size_highthresh*2.0)) -# bsize = int(max(brightsize, min_size_allowed, max_isl_size_lowthresh)) else: bsize = int(max(brightsize, min_size_allowed, max_isl_size*2.0)) bsize2 = int(max(min(img.ch0.shape)/10.0, max_isl_size*5.0)) @@ -185,22 +184,25 @@ class Op_rmsimage(Op): bstep = int(round(min(bsize/3., min(shape)/10.))) bstep2 = int(round(min(bsize2/3., min(shape)/10.))) if opts.rms_box_bright is None: - img.rms_box = (bsize, bstep) + img.rms_box_bright = (bsize, bstep) else: - img.rms_box = opts.rms_box_bright + img.rms_box_bright = opts.rms_box_bright if opts.rms_box is None: - img.rms_box2 = (bsize2, bstep2) + img.rms_box = (bsize2, bstep2) else: - img.rms_box2 = opts.rms_box + img.rms_box = opts.rms_box else: if do_adapt: - img.rms_box = opts.rms_box_bright - img.rms_box2 = opts.rms_box + img.rms_box_bright = opts.rms_box_bright + img.rms_box = opts.rms_box else: + img.rms_box_bright = opts.rms_box img.rms_box = opts.rms_box - img.rms_box2 = opts.rms_box + if do_adapt: + map_opts = (opts.kappa_clip, img.rms_box_bright, opts.spline_rank) + else: + map_opts = (opts.kappa_clip, img.rms_box, opts.spline_rank) - map_opts = (opts.kappa_clip, img.rms_box, opts.spline_rank) for ipol, pol in enumerate(pols): data = ch0_images[ipol] mean = N.zeros(data.shape, dtype=N.float32) @@ -211,85 +213,28 @@ class Op_rmsimage(Op): pol_txt = '' ## calculate rms/mean maps if needed - if ((opts.rms_map is not False) or (opts.mean_map not in ['zero', 'const'])) and img.rms_box2[0] > min(img.ch0.shape)/4.0: + if ((opts.rms_map is not False) or (opts.mean_map not in ['zero', 'const'])) and img.rms_box[0] > min(img.ch0.shape)/4.0: # rms box is too large - just use constant rms and mean self.output_rmsbox_size(img) - mylog.warning('Size of rms_box larger than 1/4 of image size') + mylogger.userinfo(mylog, 'Size of rms_box larger than 1/4 of image size') mylogger.userinfo(mylog, 'Using constant background rms and mean') img.use_rms_map = False img.mean_map_type = 'const' else: if (opts.rms_map is not False) or (opts.mean_map not in ['zero', 'const']): if len(data.shape) == 2: ## 2d case - rms_ok = False - while not rms_ok: - self.map_2d(data, mean, rms, mask, *map_opts, do_adapt=do_adapt, - bright_pt_coords=isl_pos, rms_box2=img.rms_box2, + mean, rms = self.calculate_maps(img, data, mean, rms, mask, map_opts, do_adapt=do_adapt, + bright_pt_coords=isl_pos, rms_box2=img.rms_box, logname="PyBDSM."+img.log, ncores=img.opts.ncores) - if N.any(rms < 0.0): - rms_ok = False - if (opts.rms_box_bright is None and do_adapt) or (opts.rms_box is None and not do_adapt): - # Increase box by 20% - new_width = int(img.rms_box[0]*1.2) - if new_width == img.rms_box[0]: - new_width = img.rms_box[0] + 1 - new_step = int(new_width/3.0) - img.rms_box = (new_width, new_step) - if img.rms_box[0] > min(img.ch0.shape)/4.0: - #self.output_rmsbox_size(img) - mylog.warning('Size of rms_box larger than 1/4 of image size') - mylogger.userinfo(mylog, 'Using constant background rms and mean') - img.use_rms_map = False - img.mean_map_type = 'const' - rms_ok = True - else: - map_opts = (opts.kappa_clip, img.rms_box, opts.spline_rank) - else: - # User has specified box size, use order=1 to prevent negatives - if opts.spline_rank > 1: - mylog.warning('Negative values found in rms map interpolated with spline_rank = %i' % opts.spline_rank) - mylog.warning('Using spline_rank = 1 (bilinear interpolation) instead') - map_opts = (opts.kappa_clip, img.rms_box, 1) - else: - rms_ok = True - elif len(data.shape) == 3: ## 3d case if not isinstance(mask, N.ndarray): mask = N.zeros(data.shape[0], dtype=bool) for i in range(data.shape[0]): ## iterate each plane - rms_ok = False - while not rms_ok: - self.map_2d(data[i], mean[i], rms[i], mask[i], *map_opts, + mean, rms = self.calculate_maps(img, data[i], mean[i], rms[i], mask[i], map_opts, do_adapt=do_adapt, bright_pt_coords=isl_pos, - rms_box2=img.rms_box2, logname="PyBDSM."+img.log, + rms_box2=img.rms_box, logname="PyBDSM."+img.log, ncores=img.opts.ncores) - if N.any(rms[i] < 0.0): - rms_ok = False - if (opts.rms_box_bright is None and do_adapt) or (opts.rms_box is None and not do_adapt): - # Increase box by 20% - new_width = int(img.rms_box[0]*1.2) - if new_width == img.rms_box[0]: - new_width = img.rms_box[0] + 1 - new_step = int(new_width/3.0) - img.rms_box = (new_width, new_step) - if img.rms_box[0] > min(img.ch0.shape)/4.0: - #self.output_rmsbox_size(img) - mylog.warning('Size of rms_box larger than 1/4 of image size') - mylogger.userinfo(mylog, 'Using constant background rms and mean') - img.use_rms_map = False - img.mean_map_type = 'const' - rms_ok = True - else: - map_opts = (opts.kappa_clip, img.rms_box, opts.spline_rank) - else: - # User has specified box size, use order=1 to prevent negatives - if opts.spline_rank > 1: - mylog.warning('Negative values found in rms map interpolated with spline_rank = %i' % opts.spline_rank) - mylog.warning('Using spline_rank = 1 (bilinear interpolation) instead') - map_opts = (opts.kappa_clip, img.rms_box, 1) - else: - rms_ok = True else: mylog.critical('Image shape not handleable' + pol_txt) raise RuntimeError("Can't handle array of this shape" + pol_txt) @@ -340,8 +285,10 @@ class Op_rmsimage(Op): '(%.5f, %.5f) Jy/beam' % (rms_min, rms_max)) if img.mean_map_type != 'map': - val = 0.0 - if opts.mean_map == 'const': val = img.clipped_mean + if opts.mean_map == 'zero': + val = 0.0 + else: + val = img.clipped_mean mean[:] = val mylogger.userinfo(mylog, 'Value of background mean' + pol_txt, str(round(val,5))+' Jy/beam') @@ -455,6 +402,67 @@ class Op_rmsimage(Op): return img + + def calculate_maps(self, img, data, mean, rms, mask, map_opts, do_adapt, + bright_pt_coords=[], rms_box2=None, + logname=None, ncores=None): + """Calls map_2d and checks for problems""" + rms_ok = False + mylog = mylogger.logging.getLogger("PyBDSM."+img.log+"Rmsimage.Calcmaps ") + opts = img.opts + while not rms_ok: + self.map_2d(data, mean, rms, mask, *map_opts, do_adapt=do_adapt, + bright_pt_coords=bright_pt_coords, rms_box2=rms_box2, + logname=logname, ncores=ncores) + if N.any(rms < 0.0): + rms_ok = False + if (opts.rms_box_bright is None and do_adapt) or (opts.rms_box is None and not do_adapt): + # Increase box by 20% + if do_adapt: + new_width = int(img.rms_box_bright[0]*1.2) + if new_width == img.rms_box_bright[0]: + new_width = img.rms_box_bright[0] + 1 + new_step = int(new_width/3.0) + img.rms_box_bright = (new_width, new_step) + if img.rms_box_bright[0] > min(img.ch0.shape)/4.0: + mylogger.userinfo(mylog, 'Size of rms_box_bright larger than 1/4 of image size') + mylogger.userinfo(mylog, 'Using constant background rms and mean') + img.use_rms_map = False + img.rms_box = img.rms_box_bright + img.mean_map_type = 'const' + rms_ok = True + else: + map_opts = (opts.kappa_clip, img.rms_box_bright, opts.spline_rank) + else: + new_width = int(img.rms_box[0]*1.2) + if new_width == img.rms_box[0]: + new_width = img.rms_box[0] + 1 + new_step = int(new_width/3.0) + img.rms_box = (new_width, new_step) + if img.rms_box[0] > min(img.ch0.shape)/4.0: + mylogger.userinfo(mylog, 'Size of rms_box larger than 1/4 of image size') + mylogger.userinfo(mylog, 'Using constant background rms and mean') + img.use_rms_map = False + img.mean_map_type = 'const' + rms_ok = True + else: + map_opts = (opts.kappa_clip, img.rms_box, opts.spline_rank) + + else: + # User has specified box size, use order=1 to prevent negatives + if opts.spline_rank > 1: + mylog.warning('Negative values found in rms map interpolated with spline_rank = %i' % opts.spline_rank) + mylog.warning('Using spline_rank = 1 (bilinear interpolation) instead') + if do_adapt: + map_opts = (opts.kappa_clip, img.rms_box_bright, 1) + else: + map_opts = (opts.kappa_clip, img.rms_box, 1) + else: + rms_ok = True + + return mean, rms + + def map_2d(self, arr, out_mean, out_rms, mask=False, kappa=3, box=None, interp=1, do_adapt=False, bright_pt_coords=None, rms_box2=None, logname='', ncores=None): @@ -604,12 +612,8 @@ class Op_rmsimage(Op): if float(BS)/float(imgshape[0]) < 0.1 and \ float(BS)/float(imgshape[1]) < 0.1: use_extrapolation = True - mylog.info('Using simple extrapolation for edges of mean '\ - 'and rms maps') else: use_extrapolation = False - mylog.info('Using padded array for edges of mean '\ - 'and rms maps') if use_extrapolation: boxcount = 1 + (imgshape - BS)/SS @@ -968,26 +972,26 @@ class Op_rmsimage(Op): if do_adapt: if opts.rms_box_bright is None: mylogger.userinfo(mylog, 'Derived rms_box (box size, step size)', - '(' + str(img.rms_box[0]) + ', ' + - str(img.rms_box[1]) + ') pixels (small scale)') + '(' + str(img.rms_box_bright[0]) + ', ' + + str(img.rms_box_bright[1]) + ') pixels (small scale)') else: mylogger.userinfo(mylog, 'Using user-specified rms_box', - '(' + str(img.rms_box[0]) + ', ' + - str(img.rms_box[1]) + ') pixels (small scale)') + '(' + str(img.rms_box_bright[0]) + ', ' + + str(img.rms_box_bright[1]) + ') pixels (small scale)') if opts.rms_box is None: mylogger.userinfo(mylog, 'Derived rms_box (box size, step size)', - '(' + str(img.rms_box2[0]) + ', ' + - str(img.rms_box2[1]) + ') pixels (large scale)') + '(' + str(img.rms_box[0]) + ', ' + + str(img.rms_box[1]) + ') pixels (large scale)') else: mylogger.userinfo(mylog, 'Using user-specified rms_box', - '(' + str(img.rms_box2[0]) + ', ' + - str(img.rms_box2[1]) + ') pixels (large scale)') + '(' + str(img.rms_box[0]) + ', ' + + str(img.rms_box[1]) + ') pixels (large scale)') else: if opts.rms_box is None: mylogger.userinfo(mylog, 'Derived rms_box (box size, step size)', - '(' + str(img.rms_box2[0]) + ', ' + - str(img.rms_box2[1]) + ') pixels') + '(' + str(img.rms_box[0]) + ', ' + + str(img.rms_box[1]) + ') pixels') else: mylogger.userinfo(mylog, 'Using user-specified rms_box', - '(' + str(img.rms_box2[0]) + ', ' + - str(img.rms_box2[1]) + ') pixels') + '(' + str(img.rms_box[0]) + ', ' + + str(img.rms_box[1]) + ') pixels') diff --git a/CEP/PyBDSM/src/python/spectralindex.py b/CEP/PyBDSM/src/python/spectralindex.py index 6e7b80b2dbac27812b1adf8d14e0b24b21d41a43..9bf81a841d4c57beba382543cea7db2d9883af31 100644 --- a/CEP/PyBDSM/src/python/spectralindex.py +++ b/CEP/PyBDSM/src/python/spectralindex.py @@ -1,6 +1,6 @@ """Module Spectral index. - - This module calculates spectral indices for Gaussians and sources for a multichannel cube. + + This module calculates spectral indices for Gaussians and sources for a multichannel cube. """ @@ -10,7 +10,7 @@ import mylogger from gaul2srl import Source from copy import deepcopy as cp import _cbdsm -import collapse +import collapse import sys import functions as func import time @@ -24,34 +24,34 @@ Gaussian.specin_flux = List(Float(), doc = "Total flux density per channel, Jy", Gaussian.specin_fluxE = List(Float(), doc = "Error in total flux density per channel, Jy", colname=['E_Total_flux'], units=['Jy']) Gaussian.specin_freq = List(Float(), doc = "Frequency per channel, Hz", colname=['Freq'], units=['Hz']) Source.spec_indx = Float(doc = "Spectral index", colname='Spec_Indx', units=None) -Source.e_spex_indx = Float(doc = "Error in spectral index", colname='E_Spec_Indx', units=None) +Source.e_spec_indx = Float(doc = "Error in spectral index", colname='E_Spec_Indx', units=None) Source.specin_flux = List(Float(), doc = "Total flux density, Jy", colname=['Total_flux'], units=['Jy']) Source.specin_fluxE = List(Float(), doc = "Error in total flux density per channel, Jy", colname=['E_Total_flux'], units=['Jy']) Source.specin_freq = List(Float(), doc = "Frequency per channel, Hz", colname=['Freq'], units=['Hz']) class Op_spectralindex(Op): """Computes spectral index of every gaussian and every source. - + First do a quick fit to all channels to determine whether averaging over frequency is needed to obtain desired SNR (set by img.opts.specind_snr). - This averaging should be done separately for both Gaussians and + This averaging should be done separately for both Gaussians and sources. For S and C sources, averaging only needs to be done once (as the sources have only one Gaussian). - + For M sources, averaging is needed twice: once to obtain the desired SNR for the faintest Gaussian in the source, and once to obtain the desired SNR for the source as a whole. - + If averaging is needed for a given source, don't let the number of resulting channels fall below 2. If it is not possible to obtain the desired SNR in 2 or more channels, set spec_indx of Gaussian/source to NaN. - + """ def __call__(self, img): global bar1 - + mylog = mylogger.logging.getLogger("PyBDSM."+img.log+"SpectIndex") img.mylog = mylog if img.opts.spectralindex_do: @@ -62,9 +62,9 @@ class Op_spectralindex(Op): self.freq_beamsp_unav(img) sbeam = img.beam_spectrum freqin = img.freq - + # calc initial channel flags if needed - iniflags = self.iniflag(img) + iniflags = self.iniflag(img) img.specind_iniflags = iniflags good_chans = N.where(iniflags == False) unav_image = img.image[0][good_chans] @@ -74,24 +74,24 @@ class Op_spectralindex(Op): mylog.info('After initial flagging of channels by rms, %i good channels remain' % (nchan,)) if nmax_to_avg == 0: nmax_to_avg = nchan - + # calculate the rms map of each unflagged channel bar1 = statusbar.StatusBar('Determing rms for channels in image ..... : ', 0, nchan) if img.opts.quiet == False: bar1.start() rms_spec = self.rms_spectrum(img, unav_image) # bar1 updated here - + bar2 = statusbar.StatusBar('Calculating spectral indices for sources : ', 0, img.nsrc) c_wts = img.opts.collapse_wt snr_desired = img.opts.specind_snr - + if img.opts.quiet == False and img.opts.verbose_fitting == False: bar2.start() for src in img.sources: isl = img.islands[src.island_id] isl_bbox = isl.bbox - - # Fit each channel with ch0 Gaussian(s) of the source, + + # Fit each channel with ch0 Gaussian(s) of the source, # allowing only the normalization to vary. chan_images = unav_image[:, isl_bbox[0], isl_bbox[1]] chan_rms = rms_spec[:, isl_bbox[0], isl_bbox[1]] @@ -102,7 +102,7 @@ class Op_spectralindex(Op): # and is True if measured flux is upper limit. n_good_chan_per_gaus is array of N_gaussians # that gives number of unmasked channels for each Gaussian. gaus_mask, n_good_chan_per_gaus = self.mask_upper_limits(unavg_total_flux, e_unavg_total_flux, snr_desired) - + # Average if needed and fit again # First find flux of faintest Gaussian of source and use it to estimate rms_desired gflux = [] @@ -110,33 +110,33 @@ class Op_spectralindex(Op): gflux.append(g.peak_flux) rms_desired = min(gflux)/snr_desired total_flux = unavg_total_flux - e_total_flux = e_unavg_total_flux - freq_av = unav_freqs + e_total_flux = e_unavg_total_flux + freq_av = unav_freqs nchan = chan_images.shape[0] nchan_prev = nchan while min(n_good_chan_per_gaus) < 2 and nchan > 2: - avimages, beamlist, freq_av, crms_av = self.windowaverage_cube(chan_images, rms_desired, chan_rms, + avimages, beamlist, freq_av, crms_av = self.windowaverage_cube(chan_images, rms_desired, chan_rms, c_wts, sbeam, freqin, nmax_to_avg=nmax_to_avg) - total_flux, e_total_flux = self.fit_channels(img, avimages, crms_av, src, beamlist) + total_flux, e_total_flux = self.fit_channels(img, avimages, crms_av, src, beamlist) gaus_mask, n_good_chan_per_gaus = self.mask_upper_limits(total_flux, e_total_flux, snr_desired) nchan = avimages.shape[0] if nchan == nchan_prev: break nchan_prev = nchan rms_desired *= 0.8 - + # Now fit Gaussian fluxes to obtain spectral indices. - # Only fit if there are detections (at specified sigma threshold) - # in at least two bands. If not, don't fit and set spec_indx + # Only fit if there are detections (at specified sigma threshold) + # in at least two bands. If not, don't fit and set spec_indx # and error to NaN. for ig, gaussian in enumerate(src.gaussians): npos = len(N.where(total_flux[:, ig] > 0.0)[0]) if img.opts.verbose_fitting: if img.opts.flagchan_snr: - print 'Gaussian #%i : averaged to %i channels, of which %i meet SNR criterion' % (gaussian.gaus_num, + print 'Gaussian #%i : averaged to %i channels, of which %i meet SNR criterion' % (gaussian.gaus_num, len(total_flux[:, ig]), n_good_chan_per_gaus[ig]) else: - print 'Gaussian #%i : averaged to %i channels, all of which will be used' % (gaussian.gaus_num, + print 'Gaussian #%i : averaged to %i channels, all of which will be used' % (gaussian.gaus_num, len(total_flux[:, ig])) if (img.opts.flagchan_snr and n_good_chan_per_gaus[ig] < 2) or npos < 2: gaussian.spec_indx = N.NaN @@ -160,7 +160,7 @@ class Op_spectralindex(Op): gaussian.specin_fluxE = e_fluxes_to_fit.tolist() gaussian.specin_freq = freqs_to_fit.tolist() gaussian.specin_freq0 = N.median(freqs_to_fit) - + # Next fit total source fluxes for spectral index. if len(src.gaussians) > 1: # First, check unaveraged SNRs for total source. @@ -169,18 +169,18 @@ class Op_spectralindex(Op): src_total_flux[:,0] = N.sum(unavg_total_flux, 1) # sum over all Gaussians in source to obtain total fluxes in each channel src_e_total_flux[:,0] = N.sqrt(N.sum(N.power(e_unavg_total_flux, 2.0), 1)) src_mask, n_good_chan = self.mask_upper_limits(src_total_flux, src_e_total_flux, snr_desired) - + # Average if needed and fit again rms_desired = src.peak_flux_max/snr_desired total_flux = unavg_total_flux e_total_flux = e_unavg_total_flux - freq_av = unav_freqs + freq_av = unav_freqs nchan = chan_images.shape[0] nchan_prev = nchan while n_good_chan < 2 and nchan > 2: - avimages, beamlist, freq_av, crms_av = self.windowaverage_cube(chan_images, rms_desired, chan_rms, + avimages, beamlist, freq_av, crms_av = self.windowaverage_cube(chan_images, rms_desired, chan_rms, c_wts, sbeam, freqin, nmax_to_avg=nmax_to_avg) - total_flux, e_total_flux = self.fit_channels(img, avimages, crms_av, src, beamlist) + total_flux, e_total_flux = self.fit_channels(img, avimages, crms_av, src, beamlist) src_total_flux = N.sum(total_flux, 1) # sum over all Gaussians in source to obtain total fluxes in each channel src_e_total_flux = N.sqrt(N.sum(N.power(e_total_flux, 2.0), 1)) src_mask, n_good_chan = self.mask_upper_limits(src_total_flux, src_e_total_flux, snr_desired) @@ -189,18 +189,18 @@ class Op_spectralindex(Op): break nchan_prev = nchan rms_desired *= 0.8 - + # Now fit source for spectral index. src_total_flux = src_total_flux.reshape((src_total_flux.shape[0],)) src_e_total_flux = src_e_total_flux.reshape((src_e_total_flux.shape[0],)) src_mask = src_mask.reshape((src_mask.shape[0],)) if img.opts.verbose_fitting: if img.opts.flagchan_snr: - print 'Source #%i : averaged to %i channels, of which %i meet SNR criterion' % (src.source_id, + print 'Source #%i : averaged to %i channels, of which %i meet SNR criterion' % (src.source_id, len(src_total_flux), nchan) else: - print 'Source #%i : averaged to %i channels, all of which will be used' % (src.source_id, - len(src_total_flux)) + print 'Source #%i : averaged to %i channels, all of which will be used' % (src.source_id, + len(src_total_flux)) npos = len(N.where(src_total_flux > 0.0)) if (img.opts.flagchan_snr and n_good_chan < 2) or npos < 2: src.spec_indx = N.NaN @@ -249,11 +249,11 @@ class Op_spectralindex(Op): #################################################################################### def flagchans_rmschan(self, crms, zeroflags, iniflags, cutoff): - """ Calculate clipped rms (r1) of the rms as fn of channel, crms, with zeroflags + """ Calculate clipped rms (r1) of the rms as fn of channel, crms, with zeroflags applied and kappa=cutoff. Then exclude crms=0 (for NaN mages etc) and get ch.s which are more than cutoff*r1 away from median of rms. If this is less than 10 % - of all channels, flag them. - + of all channels, flag them. + """ # crms_rms and median dont include rms=0 channels @@ -263,8 +263,8 @@ class Op_spectralindex(Op): median = N.median(N.delete(crms, zeroind)) badind = N.where(N.abs(N.delete(crms, zeroind) - median)/crms_rms >=cutoff)[0] frac = len(badind)/(nchan - len(zeroind)) - - if frac <= 0.1: + + if frac <= 0.1: badind = N.where(N.abs(crms - median)/crms_rms >=cutoff)[0] iniflags[badind] = True @@ -274,7 +274,7 @@ class Op_spectralindex(Op): def iniflag(self, img): """ Calculate clipped rms of every channel, and then median and clipped rms of this rms distribution. Exclude channels where rms=0 (all pixels 0 or blanked) and of the remaining, if outliers beyond 5 sigma - are less then 10 % of number of channels, flag them. This is done only when flagchan_rms = True. + are less then 10 % of number of channels, flag them. This is done only when flagchan_rms = True. If False, only rms=0 (meaning, entire channel image is zero or blanked) is flagged.""" image = img.image @@ -288,17 +288,17 @@ class Op_spectralindex(Op): iniflags = cp(zeroflags) if img.opts.flagchan_rms: - iniflags = self.flagchans_rmschan(crms, zeroflags, iniflags, 4.0) + iniflags = self.flagchans_rmschan(crms, zeroflags, iniflags, 4.0) return iniflags - + #################################################################################### def freq_beamsp_unav(self, img): """ Defines img.beam_spectrum and img.freq for the unaveraged cube. """ shp = img.image.shape - sbeam = img.opts.beam_spectrum + sbeam = img.opts.beam_spectrum if sbeam != None and len(sbeam) != shp[1]: sbeam = None # sanity check if sbeam == None: sbeam = [img.beam]*shp[1] @@ -353,7 +353,7 @@ class Op_spectralindex(Op): median_rms = rms_spec str1 = " ".join(["%9.4e" % n for n in img.channel_clippedrms]) - if rms_map: + if rms_map: mylog.debug('%s %s ' % ('Median rms of channels : ', str1)) mylog.info('RMS image made for each channel') else: @@ -366,7 +366,7 @@ class Op_spectralindex(Op): #################################################################################### def fit_specindex(self, freqarr, fluxarr, efluxarr, do_log=False): """ Fits spectral index to data. - + do_log is True/False implies you fit spectral index in logFlux vs logFreq space or not.""" import functions as func import math @@ -384,7 +384,7 @@ class Op_spectralindex(Op): else: x = x/f0; y = flux; sig = eflux funct = func.sp_in - + spin, espin = func.fit_mask_1d(x, y, sig, mask, funct, do_err=True, order=1) if do_log: @@ -395,31 +395,31 @@ class Op_spectralindex(Op): ######################################################################################## - - def windowaverage_cube(self, imagein, rms_desired, chanrms, c_wts, sbeam, + + def windowaverage_cube(self, imagein, rms_desired, chanrms, c_wts, sbeam, freqin, n_min=2, nmax_to_avg=10): """Average neighboring channels of cube to obtain desired rms in at least n_min channels - + The clipped rms of each channel is compared to the desired rms. If the clipped rms is too high, the channel is averaged with as many neighboring channels as necessary to obtain at least the desired rms. This is done until the number of OK channels is 2. The averaging is done first at - the frequency extremes, as frequency range the resulting averaged flux array + the frequency extremes, as frequency range the resulting averaged flux array will be maximized. - - For example, if the desired rms is 0.1 and the list of rms's is: - + + For example, if the desired rms is 0.1 and the list of rms's is: + [0.2, 0.2, 0.3, 0.2, 0.2] - + the resulting channels that will be averaged are: - + [[0, 1], [2], [3, 4]] """ from math import sqrt from collapse import avspc_direct, avspc_blanks - + nchan = imagein.shape[0] - + # chan_list is a list of lists of channels to average. E.g., if we have # 5 channels and we want to average only the first 2: # chan_list = [[0,1], [2], [3], [4]] @@ -428,7 +428,7 @@ class Op_spectralindex(Op): else: crms = chanrms chan_list = self.get_avg_chan_list(rms_desired, crms, nmax_to_avg) - + n_new = len(chan_list) beamlist = [] crms_av = N.zeros(n_new) @@ -438,7 +438,7 @@ class Op_spectralindex(Op): hasblanks = blank.any() for ichan, avg_list in enumerate(chan_list): if len(avg_list) > 1: - if not hasblanks: + if not hasblanks: imageout[ichan], dum = avspc_direct(avg_list, imagein, crms, c_wts) else: imageout[ichan], dum = avspc_blanks(avg_list, imagein, crms, c_wts) @@ -451,9 +451,9 @@ class Op_spectralindex(Op): beamlist.append(sbeam[avg_list[0]]) freq_av[ichan] = N.mean(freqin[avg_list[0]]) crms_av[ichan] = 1.0/sqrt(N.sum(1.0/crms[avg_list[0]]**2)) - - return imageout, beamlist, freq_av, crms_av - + + return imageout, beamlist, freq_av, crms_av + def get_avg_chan_list(self, rms_desired, chanrms, nmax_to_avg): """Returns a list of channels to average to obtain given rms_desired @@ -468,7 +468,7 @@ class Op_spectralindex(Op): rms_avg = chanrms[0] while rms_avg > rms_desired: end += 1 - chan_slice = slice(0, end) + chan_slice = slice(0, end) rms_avg = 1.0/N.sqrt(N.sum(1.0/N.array(chanrms)[chan_slice]**2)) if end == nchan or end == nmax_to_avg: break @@ -481,18 +481,18 @@ class Op_spectralindex(Op): # and return. chan_list = [range(0, int(float(nchan)/2.0)), range(int(float(nchan)/2.0), nchan)] return chan_list - + # Average channels at end of list rms_avg = chanrms[-1] end = nchan start = nchan while rms_avg > rms_desired: start -= 1 - chan_slice = slice(start, end) + chan_slice = slice(start, end) rms_avg = 1.0/N.sqrt(N.sum(1.0/chanrms[chan_slice]/chanrms[chan_slice])) if end-start == nmax_to_avg: break - + if start <= max(chan_list[0]): # This means we cannot get two averaged channels with desired rms, # so just average remaining channels @@ -509,27 +509,27 @@ class Op_spectralindex(Op): for i in range(nchan): chan_list.append([i]) return chan_list - + def fit_channels(self, img, chan_images, clip_rms, src, beamlist): """Fits normalizations of Gaussians in source to multiple channels - - If unresolved, the size of the Gaussians are adjusted to match the + + If unresolved, the size of the Gaussians are adjusted to match the channel's beam size (given by beamlist) before fitting. - - Returns array of total fluxes (N_channels x N_Gaussians) and array + + Returns array of total fluxes (N_channels x N_Gaussians) and array of errors (N_channels x N_Gaussians). """ import functions as func from const import fwsig - + isl = img.islands[src.island_id] isl_bbox = isl.bbox nchan = chan_images.shape[0] x, y = N.mgrid[isl_bbox] gg = src.gaussians fitfix = N.ones(len(gg)) # fit only normalization - srcmask = isl.mask_active + srcmask = isl.mask_active total_flux = N.zeros((nchan, len(fitfix))) # array of fluxes: N_channels x N_Gaussians errors = N.zeros((nchan, len(fitfix))) # array of fluxes: N_channels x N_Gaussians @@ -545,7 +545,7 @@ class Op_spectralindex(Op): rms_isl = N.mean(clip_rms[cind]) errors[cind] = func.get_errors(img, p, rms_isl, bm_pix=(bm_pix[0]*fwsig, bm_pix[1]*fwsig, bm_pix[2]))[6] self.reset_size(gg) - + return total_flux, errors def adjust_size_by_freq(self, beam_ch0, beam, gg): @@ -559,12 +559,12 @@ class Op_spectralindex(Op): g.size_pix_adj[1] *= beam[1] / beam_ch0[1] gg_adj.append(g) return gg_adj - + def reset_size(self, gg): """Reset size of unresolved Gaussians to match the ch0 beam size""" for g in gg: if hasattr(g, 'size_pix_adj'): del g.size_pix_adj - + def mask_upper_limits(self, total_flux, e_total_flux, threshold): """Returns mask of upper limits""" mask = N.zeros(total_flux.shape, dtype=bool) @@ -587,15 +587,15 @@ class Op_spectralindex(Op): if meas_flux < threshold * e_meas_flux: # Upper limit if is_src: - mask[ichan] = True + mask[ichan] = True else: mask[ichan, ig] = True else: # Detection if is_src: ndet += 1 - mask[ichan] = False + mask[ichan] = False else: ndet[ig] += 1 mask[ichan, ig] = False - return mask, ndet \ No newline at end of file + return mask, ndet diff --git a/CEP/PyBDSM/src/python/statusbar.py b/CEP/PyBDSM/src/python/statusbar.py index e3183b690a6dce6726aeae1d23b64dbb58b259ab..6e438fc620a77c343f19e83f841c650a5236074d 100644 --- a/CEP/PyBDSM/src/python/statusbar.py +++ b/CEP/PyBDSM/src/python/statusbar.py @@ -73,7 +73,6 @@ class StatusBar(): self.comp = self.columns self.busy_char = '' self.__print() - sys.stdout.write('\n') return 0 else: self.pos += self.inc @@ -87,3 +86,13 @@ class StatusBar(): def start(self): self.started = 1 self.__print() + + def stop(self): + if self.started: + self.pos = self.max + self.comp = self.columns + self.busy_char = '' + self.__print() + sys.stdout.write('\n') + self.started = 0 + return 0 diff --git a/CEP/PyBDSM/src/python/threshold.py b/CEP/PyBDSM/src/python/threshold.py index c688091f5fb5198dcb7788ae930fd818ff9957eb..6ef88950e38e453e691f62331401a47632c2090f 100644 --- a/CEP/PyBDSM/src/python/threshold.py +++ b/CEP/PyBDSM/src/python/threshold.py @@ -2,7 +2,7 @@ Defines operation Op_threshold. If the option 'thresh' is defined as 'fdr' then the value of thresh_pix is estimated using the -False Detection Rate algorithm (using the user defined value +False Detection Rate algorithm (using the user defined value of fdr_alpha). If thresh is None, then the false detection probability is first calculated, and if the number of false source pixels is more than fdr_ratio times the estimated number of true source @@ -34,13 +34,13 @@ class Op_threshold(Op): if img.opts.thresh is None: source_p = self.get_srcp(img) - cutoff = 5.0 + cutoff = 5.0 false_p = 0.5*erfc(cutoff/sq2)*size if false_p < opts.fdr_ratio*source_p: img.thresh = 'hard' mylogger.userinfo(mylog, "Expected 5-sigma-clipped false detection rate < fdr_ratio") mylogger.userinfo(mylog, "Using sigma-clipping ('hard') thresholding") - else: + else: img.thresh = 'fdr' mylogger.userinfo(mylog, "Expected 5-sigma-clipped false detection rate > fdr_ratio") mylogger.userinfo(mylog, "Using FDR (False Detection Rate) thresholding") @@ -49,7 +49,7 @@ class Op_threshold(Op): mylog.debug("Threshold for pixels set to : "+str.swapcase(img.thresh)) else: img.thresh = img.opts.thresh - + if img.thresh=='fdr': cdelt = img.wcs_obj.acdelt[:2] bm = (img.beam[0], img.beam[1]) @@ -79,7 +79,7 @@ class Op_threshold(Op): mylogger.userinfo(mylog, "FDR threshold (replaces thresh_pix)", str(round(sigcrit, 4))) else: img.thresh_pix = opts.thresh_pix - + img.completed_Ops.append('threshold') return img @@ -88,7 +88,7 @@ class Op_threshold(Op): fwsig = const.fwsig cutoff = 5.0 spin = -0.80 - freq = img.cfreq + freq = img.frequency bm = (img.beam[0], img.beam[1]) cdelt = img.wcs_obj.acdelt[:2] x = 2.0*pi*N.product(bm)/abs(N.product(cdelt))/(fwsig*fwsig)*img.omega @@ -98,7 +98,7 @@ class Op_threshold(Op): scnum = sc.n index = 0 for i,s in enumerate(scflux): - if s < smin_L: + if s < smin_L: index = i break n1 = scnum[index]; n2 = scnum[-1] diff --git a/CEP/PyBDSM/src/python/wavelet_atrous.py b/CEP/PyBDSM/src/python/wavelet_atrous.py index b8ceb4192e9823cb2c27e8637053fab605988537..ccf22d5d181c696b75ef16d20b559109ebfa0dfd 100644 --- a/CEP/PyBDSM/src/python/wavelet_atrous.py +++ b/CEP/PyBDSM/src/python/wavelet_atrous.py @@ -51,6 +51,11 @@ class Op_wavelet_atrous(Op): mylog = mylogger.logging.getLogger("PyBDSM." + img.log + "Wavelet") if img.opts.atrous_do: + if img.nisl == 0: + mylog.warning("No islands found. Skipping wavelet decomposition.") + img.completed_Ops.append('wavelet_atrous') + return + mylog.info("Decomposing gaussian residual image into a-trous wavelets") bdir = img.basedir + '/wavelet/' if img.opts.output_all: @@ -158,51 +163,45 @@ class Op_wavelet_atrous(Op): for op in wchain: op(wimg) if isinstance(op, Op_islands): - # Delete islands that do not share any pixels with - # islands in original ch0 image. - good_isl = [] - - # Make original rank image boolean; rank counts from 0, with -1 being - # outside any island - orig_rankim_bool = N.array(img.pyrank + 1, dtype = bool) - - # Multiply rank images - valid_islands = orig_rankim_bool * (wimg.pyrank + 1) - - bar = statusbar.StatusBar('Checking for valid islands .............. : ', 0, wimg.nisl) - if img.opts.quiet == False: - bar.start() - - # Now call the parallel mapping function. Returns True or - # False for each island. - check_list = mp.parallel_map(func.eval_func_tuple, - itertools.izip(itertools.repeat(self.check_island), - wimg.islands, itertools.repeat(valid_islands)), - numcores=img.opts.ncores, bar=bar) - - for idx, wvisl in enumerate(wimg.islands): - if check_list[idx]: - wvisl.valid = True - good_isl.append(wvisl) - else: - wvisl.valid = False - - wimg.islands = good_isl - wimg.nisl = len(good_isl) - mylogger.userinfo(mylog, "Number of vaild islands found", '%i' % - wimg.nisl) - # Renumber islands: - for wvindx, wvisl in enumerate(wimg.islands): - wvisl.island_id = wvindx + if wimg.nisl > 0: + # Delete islands that do not share any pixels with + # islands in original ch0 image. + good_isl = [] + + # Make original rank image boolean; rank counts from 0, with -1 being + # outside any island + orig_rankim_bool = N.array(img.pyrank + 1, dtype = bool) + + # Multiply rank images + valid_islands = orig_rankim_bool * (wimg.pyrank + 1) - 1 + + # Get unique island IDs + valid_ids = set(valid_islands.flatten()) + for idx, wvisl in enumerate(wimg.islands): + if idx in valid_ids: + wvisl.valid = True + good_isl.append(wvisl) + else: + wvisl.valid = False + + wimg.islands = good_isl + wimg.nisl = len(good_isl) + mylogger.userinfo(mylog, "Number of vaild islands found", '%i' % + wimg.nisl) + + # Renumber islands: + for wvindx, wvisl in enumerate(wimg.islands): + wvisl.island_id = wvindx if isinstance(op, Op_gaul2srl): # Restrict Gaussians to original ch0 islands. gaul = wimg.gaussians tot_flux = 0.0 nwvgaus = 0 - - # TODO fix following when img.ngaus == 0! - gaus_id = img.gaussians[-1].gaus_num + if img.ngaus == 0: + gaus_id = -1 + else: + gaus_id = img.gaussians[-1].gaus_num for isl in img.islands: wvgaul = [] for g in gaul: @@ -267,11 +266,10 @@ class Op_wavelet_atrous(Op): break pdir = img.basedir + '/misc/' - #self.morphfilter_pyramid(img, pdir) img.ngaus += ntot_wvgaus img.total_flux_gaus += total_flux - mylogger.userinfo(mylog, "Total flux density in model over all scales" , '%.3f Jy' % img.total_flux_gaus) + mylogger.userinfo(mylog, "Total flux density in model on all scales" , '%.3f Jy' % img.total_flux_gaus) if img.opts.output_all: func.write_image_to_file(img.use_io, img.imagename + '.atrous.cJ.fits', im_new, img, bdir) @@ -365,14 +363,7 @@ class Op_wavelet_atrous(Op): wimg.mask = mask wimg.use_io = img.use_io -####################################################################################################### - def check_island(self, isl, valid_islands): - if isl.island_id in valid_islands - 1: - return True - else: - return False - -####################################################################################################### +###################################################################################################### def subtract_wvgaus(self, opts, residim, gaussians, islands): import functions as func from make_residimage import Op_make_residimage as opp diff --git a/CMake/FindCFITSIO.cmake b/CMake/FindCFITSIO.cmake index 85c26039240cb32123b871c5c35390098ee20fb3..108ab0c1e07751e2393e84cd913fe4a9cf656ca5 100644 --- a/CMake/FindCFITSIO.cmake +++ b/CMake/FindCFITSIO.cmake @@ -33,7 +33,7 @@ if(NOT CFITSIO_FOUND) find_path(CFITSIO_INCLUDE_DIR fitsio.h - HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include) + HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include include/cfitsio include/libcfitsio0) find_library(CFITSIO_LIBRARY cfitsio HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES lib) find_library(M_LIBRARY m) diff --git a/CMake/variants/variants.RS005C b/CMake/variants/variants.RS005C index f546f8acb7d7709f02a83809310aaf9dd52ae173..2fb3ca3b231ba6d8a6861d380307be03647505e1 100644 --- a/CMake/variants/variants.RS005C +++ b/CMake/variants/variants.RS005C @@ -26,6 +26,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "/boost/date_time/time.hpp:[0-9]+: warning: unused parameter" "/boost/tuple/detail/tuple_basic.hpp:[0-9]+: warning: unused parameter" "/boost/python/object/value_holder.hpp:[0-9]+: warning: unused parameter" + "/boost/dynamic_bitset/dynamic_bitset.hpp:" "/matlab-2008a/extern/include/mclcppclass.h" "/pvss2_v3.7/api/include/(Basics|Datapoint|Manager|Messages)/" "/opt/WinCC_OA/3.10/api/include/(Basics|Datapoint|Manager|Messages)/" diff --git a/JAVA/CEP/jParmFacade/Makefile.am b/JAVA/CEP/jParmFacade/Makefile.am deleted file mode 100644 index 0657d6123965e4aff457b05c186f93f582b41352..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -SUBDIRS=src test include - -ACLOCAL_AMFLAGS = -I autoconf_share - -pkgextdir = $(prefix)/config/$(PACKAGE) -pkgext_DATA = pkgext pkgextcppflags pkgextcxxflags pkgextldflags - -DISTCHECK_CONFIGURE_FLAGS=\ - --with-common=$(prefix) - -EXTRA_DIST = \ - Makefile.common \ - jParmFacade.spec \ - autoconf_share/compiletool - -include $(top_srcdir)/Makefile.common diff --git a/JAVA/CEP/jParmFacade/bootstrap b/JAVA/CEP/jParmFacade/bootstrap deleted file mode 100755 index 06f18cde1dbfd6912ef7d927c4d35d25c7137a62..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -../../../autoconf_share/bootstrap ../../../autoconf_share diff --git a/JAVA/CEP/jParmFacade/build.xml b/JAVA/CEP/jParmFacade/build.xml deleted file mode 100644 index e4f025e13178f3c11be69f7c17f4652ce5c77c4e..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/build.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- You may freely edit this file. See commented blocks below for --> -<!-- some examples of how to customize the build. --> -<!-- (If you delete it and reopen the project it will be recreated.) --> -<!-- By default, only the Clean and Build commands use this build script. --> -<!-- Commands such as Run, Debug, and Test only use this build script if --> -<!-- the Compile on Save feature is turned off for the project. --> -<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> -<!-- in the project's Project Properties dialog box.--> -<project name="jParmFacade" default="default" basedir="."> - <description>Builds, tests, and runs the project jParmFacade.</description> - <import file="nbproject/build-impl.xml"/> - <!-- - - There exist several targets which are by default empty and which can be - used for execution of your tasks. These targets are usually executed - before and after some main targets. They are: - - -pre-init: called before initialization of project properties - -post-init: called after initialization of project properties - -pre-compile: called before javac compilation - -post-compile: called after javac compilation - -pre-compile-single: called before javac compilation of single file - -post-compile-single: called after javac compilation of single file - -pre-compile-test: called before javac compilation of JUnit tests - -post-compile-test: called after javac compilation of JUnit tests - -pre-compile-test-single: called before javac compilation of single JUnit test - -post-compile-test-single: called after javac compilation of single JUunit test - -pre-jar: called before JAR building - -post-jar: called after JAR building - -post-clean: called after cleaning build products - - (Targets beginning with '-' are not intended to be called on their own.) - - Example of inserting an obfuscator after compilation could look like this: - - <target name="-post-compile"> - <obfuscate> - <fileset dir="${build.classes.dir}"/> - </obfuscate> - </target> - - For list of available properties check the imported - nbproject/build-impl.xml file. - - - Another way to customize the build is by overriding existing main targets. - The targets of interest are: - - -init-macrodef-javac: defines macro for javac compilation - -init-macrodef-junit: defines macro for junit execution - -init-macrodef-debug: defines macro for class debugging - -init-macrodef-java: defines macro for class execution - -do-jar-with-manifest: JAR building (if you are using a manifest) - -do-jar-without-manifest: JAR building (if you are not using a manifest) - run: execution of project - -javadoc-build: Javadoc generation - test-report: JUnit report generation - - An example of overriding the target for project execution could look like this: - - <target name="run" depends="jParmFacade-impl.jar"> - <exec dir="bin" executable="launcher.exe"> - <arg file="${dist.jar}"/> - </exec> - </target> - - Notice that the overridden target depends on the jar target and not only on - the compile target as the regular run target does. Again, for a list of available - properties which you can use, check the target you are overriding in the - nbproject/build-impl.xml file. - - --> -</project> diff --git a/JAVA/CEP/jParmFacade/configure.in b/JAVA/CEP/jParmFacade/configure.in deleted file mode 100644 index ba5b954fdf2828744cb7a2340a81dd2e83732122..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/configure.in +++ /dev/null @@ -1,87 +0,0 @@ -dnl -dnl Process this file with autoconf to produce a configure script. -dnl -AC_INIT -dnl AC_CONFIG_AUX_DIR(config) -dnl AM_CONFIG_HEADER(config/config.h) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(jParmFacade, 1.0, no-define) - -dnl Initialize for LOFAR (may set compilers) -lofar_INIT - -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_YACC -AC_PROG_CC -AC_PROG_CXX -AM_PROG_LEX -AC_PROG_INSTALL -AC_PROG_LN_S -dnl AC_DISABLE_SHARED -AC_PROG_LIBTOOL - -dnl Checks for libraries. - -dnl dnl Replace `main' with a function in -lfl: -dnl AC_CHECK_LIB(fl, main) -dnl dnl Replace `main' with a function in -lcosev_r: -dnl AC_CHECK_LIB(cosev_r, main) -dnl dnl Replace `main' with a function in -lcosnm_r: -dnl AC_CHECK_LIB(cosnm_r, main) -dnl dnl Replace `main' with a function in -lorb_r: -dnl AC_CHECK_LIB(orb_r, main) -dnl dnl Replace `main' with a function in -lpthread: -dnl AC_CHECK_LIB(pthread, main) -dnl dnl Replace `main' with a function in -lvport_r: -dnl AC_CHECK_LIB(vport_r, main) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_FUNC_VPRINTF - -dnl -dnl Check for LOFAR specific things -dnl -dnl lofar_BLITZ -dnl lofar_MPI - -#lofar_INTERNAL(CEP/CEPFrame,CEPFrame,,1,CEPFrame/DataManager.h) -#lofar_INTERNAL(CEP/tinyCEP,tinyCEP,,1,tinyCEP/TinyDataManager.h,,) -#lofar_INTERNAL(LCS/ACC/PLC,PLC,,1,PLC/ProcessControl.h,,) -#lofar_INTERNAL(LCS/databases/TransportPostgres,TransportPostgres,,1,TransportPostgres/DH_DB.h,,) -#lofar_EXTERNAL(pq,,libpq-fe.h, pq, /usr/local/pgsql) -#lofar_EXTERNAL(pqxx,2.5.5,pqxx/pqxx, pqxx) - -lofar_GENERAL -lofar_INTERNAL(CEP/BB/ParmDB,ParmDB,,1,ParmDB/ParmDB.h,,) -lofar_INTERNAL(CEP/BB/BBSKernel,BBSKernel,,1,BBSKernel/MNS/MeqParmFunklet.h) -lofar_INTERNAL(CEP/BB/ParmFacade,ParmFacade,,1,ParmFacade/ParmFacade.h,,) -lofar_INTERNAL(CEP/BB/MS,MS,,1,MS/MSDesc.h,bbms) -lofar_INTERNAL(LCS/Transport,Transport,,1,Transport/TransportHolder.h,,) -lofar_INTERNAL(LCS/Blob,Blob,,1,Blob/BlobHeader.h,,) -lofar_INTERNAL(LCS/Common,Common,,1,Common/LofarTypedefs.h,,) - -lofar_AIPSPP(1,"-lms -lmeasures -ltables -lscimath -lscimath_f -lcasa") -lofar_LAPACK(1) - -dnl -dnl Output Makefiles -dnl -AC_CONFIG_FILES([test/runctest.sh:autoconf_share/runctest.sh.in], - [chmod +x test/runctest.sh]) -AC_OUTPUT( -include/Makefile -include/jParmFacade/Makefile -src/Makefile -test/Makefile -Makefile -jParmFacade.spec -) diff --git a/JAVA/CEP/jParmFacade/include/jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jParmFacade.h b/JAVA/CEP/jParmFacade/include/jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jParmFacade.h deleted file mode 100644 index 5912c2e16d4bb5c237da30203e45bac302a550ec..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/include/jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jParmFacade.h +++ /dev/null @@ -1,45 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_java_cep_jparmfacade_jParmFacade */ - -#ifndef _Included_nl_astron_lofar_java_cep_jparmfacade_jParmFacade -#define _Included_nl_astron_lofar_java_cep_jparmfacade_jParmFacade -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade - * Method: getRange - * Signature: (Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getRange - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade - * Method: getNames - * Signature: (Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getNames - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade - * Method: getValues - * Signature: (Ljava/lang/String;DDIDDI)Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getValues - (JNIEnv *, jobject, jstring, jdouble, jdouble, jint, jdouble, jdouble, jint); - -/* - * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade - * Method: getHistory - * Signature: (Ljava/lang/String;DDIDDI)Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getHistory - (JNIEnv *, jobject, jstring, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/JAVA/CEP/jParmFacade/jParmFacade.spec.in b/JAVA/CEP/jParmFacade/jParmFacade.spec.in deleted file mode 100644 index f053bd89130d33c47e225f3867ff52442f06265d..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/jParmFacade.spec.in +++ /dev/null @@ -1,160 +0,0 @@ -# -*- Mode:rpm-spec -*- -# jParmFacade.spec.in -# - -############################################################################## -# -# Preamble -# -############################################################################## - -Summary: jParmFacade is ... brief description ... - -%define release @RPM_RELEASE@ -%define version @VERSION@ -%define pkgname @PACKAGE@ -%define pkgdir %{pkgname}-%{version}-%{release} -%define prefix /opt/lofar -%define configure_args @RPM_CONFIGURE_ARGS@ -##define build_kernel_version @BUILD_KERNEL_VERSION@ - -Name: %{pkgname} -Version: %{version} -Release: %{release} -Copyright: LGPL -Group: Application/System -Source: %{pkgname}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{pkgdir}-root -URL: http://www.astron.nl -Prefix: %{prefix} -BuildArchitectures: i386 # Target platforms, i.e., i586 -##Requires: Common = 1.2 ## define dependent packages here -Packager: %{packager} -Distribution: The LOFAR project -Vendor: ASTRON - -AutoReqProv: no - -%description - -jParmFacade ... more detailed description ... - -############################################################################## -# -# prep -# -############################################################################## -%prep -echo $prefix - -# create the build directory, untar the source -%setup - -############################################################################## -# -# build -# -############################################################################## -%build -./configure %{configure_args} --prefix=%{prefix} && make - -############################################################################## -# -# install -# -############################################################################## -%install -# To make things work with BUILDROOT -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi -mkdir -p $RPM_BUILD_ROOT%{prefix} -make DESTDIR="$RPM_BUILD_ROOT" install - -#uninstall - -############################################################################## -# -# verify -# -############################################################################## -#verify - -############################################################################## -# -# clean -# -############################################################################## -%clean -# Call me paranoid, but I do not want to be responsible for nuking -# someone's harddrive! -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi - -############################################################################## -# -# files -# -############################################################################## - -# empty 'files' means all distributed files -%files -%defattr(-, root, root) -%{prefix} - -# Your application file list goes here -# %{prefix}/lib/lib*.so* - -# Documentation -# doc COPYING ChangeLog README AUTHORS NEWS -# doc doc/* - -# link the module to the correct path -%post - -# before uninstall -%preun - -# after uninstall -%postun - -############################################################################## -# -# package devel -# -############################################################################## - -#package devel -#Summary: Development files for %{pkgname} -#Group: Applications/System -#description devel -#Development files for %{pkgname}. - -#files devel - -# Your development files go here -# Programmers documentation goes here -#doc doc - -# end of file diff --git a/JAVA/CEP/jParmFacade/manifest.mf b/JAVA/CEP/jParmFacade/manifest.mf deleted file mode 100644 index 328e8e5bc3b7f1f7bad2bc0751a933e00c801983..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/JAVA/CEP/jParmFacade/pom.xml b/JAVA/CEP/jParmFacade/pom.xml deleted file mode 100644 index e702b5eb8589c18180776f07f2ebe0a421e98cdb..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/pom.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project - xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>nl.astron.lofar.cep</groupId> - <artifactId>jParmFacade</artifactId> - <name>jParmFacade</name> - <version>1.0.2</version> - - <organization> - <name>Astron</name> - <url>http://www.astron.nl</url> - </organization> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.test.sourceEncoding>UTF-8</project.test.sourceEncoding> - </properties> - - <build> - - <sourceDirectory>src</sourceDirectory> - <testSourceDirectory>test</testSourceDirectory> - - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - - <resource> - <directory>conf</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - - <resource> - <directory>include</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - - </resources> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>nl.astron.lofar.sas</groupId> - <artifactId>jOTDB3</artifactId> - <version>1.0.2</version> - </dependency> - - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.16</version> - </dependency> - </dependencies> - - <distributionManagement> - <snapshotRepository> - <id>snapshots</id> - <name>Astron Nexus Repository</name> - <url>https://support.astron.nl/nexus/content/repositories/snapshots/</url> - </snapshotRepository> - </distributionManagement> - -</project> - - diff --git a/JAVA/CEP/jParmFacade/src/Makefile.am b/JAVA/CEP/jParmFacade/src/Makefile.am deleted file mode 100644 index a8064c8658ee00e5f9831abeaa49b737c16ee527..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/src/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# if HAVE_SHMEM -# SUBDIRS = shmem . -# endif - -lib_LTLIBRARIES = libjparmfacade.la - -libjparmfacade_la_SOURCES = $(DOCHDRS) \ - nl_astron_lofar_java_cep_jparmfacade_jParmFacade.cc - -# AM_YFLAGS = -d -p KeyParse -# AM_LFLAGS = -PKeyTokenize -# LEX_OUTPUT_ROOT = lex.KeyTokenize - -if HAVE_SHMEM -libjparmfacade_la_LIBADD = $(prefix)/lib/libshmem.la -endif - -bin_PROGRAMS = - -# Lines to build a program prg -#prg_SOURCES = prg.cc -#prg_LDADD = libjparmfacade.la -#prg_DEPENDENCIES = libjparmfacade.la $(LOFAR_DEPEND) - -glishdir = $(libexecdir)/glish -dist_glish_SCRIPTS = - -pythondir = $(bindir) -dist_python_SCRIPTS = - -scriptdir = $(bindir) -dist_script_SCRIPTS = - -include $(top_srcdir)/Makefile.common diff --git a/JAVA/CEP/jParmFacade/test/Makefile.am b/JAVA/CEP/jParmFacade/test/Makefile.am deleted file mode 100644 index 22ad8b25407ab275fc775dbfdce0b6b42a46150f..0000000000000000000000000000000000000000 --- a/JAVA/CEP/jParmFacade/test/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -check_PROGRAMS = - -# programs to run through supplied checktools -CHECKTOOLPROGS = -#ENDCHECKTOOLPROGS - -# scripts used to run tests -TESTSCRIPTS = - -# scripts and possible programs to run tests -TESTS = $(TESTSCRIPTS) - -XFAIL_TESTS = - -# all files (.run, .stdout, .in, .log_prop, etc.) needed to run tests -EXTRA_DIST = $(TESTSCRIPTS) - -# Lines to build a test program testprg -#testprg_SOURCES = testprg.cc -#testprg_LDADD = ../src/libjparmfacade.la -#testprg_DEPENDENCIES = ../src/libjparmfacade.la $(LOFAR_DEPEND) - - - -include $(top_srcdir)/Makefile.common diff --git a/JAVA/GUI/MAC/jRSP/build.xml b/JAVA/GUI/MAC/jRSP/build.xml deleted file mode 100644 index 06bdfa758add42ff60205d128a8d1c4341c6d374..0000000000000000000000000000000000000000 --- a/JAVA/GUI/MAC/jRSP/build.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- You may freely edit this file. See commented blocks below for --> -<!-- some examples of how to customize the build. --> -<!-- (If you delete it and reopen the project it will be recreated.) --> -<project name="jRSP" default="default" basedir="."> - <description>Builds, tests, and runs the project jRSP.</description> - <import file="nbproject/build-impl.xml"/> - <!-- - - There exist several targets which are by default empty and which can be - used for execution of your tasks. These targets are usually executed - before and after some main targets. They are: - - -pre-init: called before initialization of project properties - -post-init: called after initialization of project properties - -pre-compile: called before javac compilation - -post-compile: called after javac compilation - -pre-compile-single: called before javac compilation of single file - -post-compile-single: called after javac compilation of single file - -pre-compile-test: called before javac compilation of JUnit tests - -post-compile-test: called after javac compilation of JUnit tests - -pre-compile-test-single: called before javac compilation of single JUnit test - -post-compile-test-single: called after javac compilation of single JUunit test - -pre-jar: called before JAR building - -post-jar: called after JAR building - -post-clean: called after cleaning build products - - (Targets beginning with '-' are not intended to be called on their own.) - - Example of inserting an obfuscator after compilation could look like this: - - <target name="-post-compile"> - <obfuscate> - <fileset dir="${build.classes.dir}"/> - </obfuscate> - </target> - - For list of available properties check the imported - nbproject/build-impl.xml file. - - - Another way to customize the build is by overriding existing main targets. - The targets of interest are: - - -init-macrodef-javac: defines macro for javac compilation - -init-macrodef-junit: defines macro for junit execution - -init-macrodef-debug: defines macro for class debugging - -init-macrodef-java: defines macro for class execution - -do-jar-with-manifest: JAR building (if you are using a manifest) - -do-jar-without-manifest: JAR building (if you are not using a manifest) - run: execution of project - -javadoc-build: Javadoc generation - test-report: JUnit report generation - - An example of overriding the target for project execution could look like this: - - <target name="run" depends="jRSP-impl.jar"> - <exec dir="bin" executable="launcher.exe"> - <arg file="${dist.jar}"/> - </exec> - </target> - - Notice that the overridden target depends on the jar target and not only on - the compile target as the regular run target does. Again, for a list of available - properties which you can use, check the target you are overriding in the - nbproject/build-impl.xml file. - - --> -</project> diff --git a/JAVA/GUI/MAC/jRSP/manifest.mf b/JAVA/GUI/MAC/jRSP/manifest.mf deleted file mode 100644 index 328e8e5bc3b7f1f7bad2bc0751a933e00c801983..0000000000000000000000000000000000000000 --- a/JAVA/GUI/MAC/jRSP/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/JAVA/GUI/Plotter/pom.xml b/JAVA/GUI/Plotter/pom.xml index 8def45692afcc73b026bcf8cccdc626f0c8946d3..e64802db0d743b7fe5a942c340296fd18f2aac9d 100644 --- a/JAVA/GUI/Plotter/pom.xml +++ b/JAVA/GUI/Plotter/pom.xml @@ -1,62 +1,47 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>nl.astron.lofar.gui</groupId> - <artifactId>plotter</artifactId> - <name>Java Plotter GUI Lib</name> - <version>1.0.2</version> - - <organization> - <name>Astron</name> - <url>http://www.astron.nl</url> - </organization> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.test.sourceEncoding>UTF-8</project.test.sourceEncoding> - </properties> - - <build> - <sourceDirectory>src</sourceDirectory> - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - - <resource> - <directory>PlotterConfig/src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - </plugins> - - </build> - - <distributionManagement> - <snapshotRepository> - <id>snapshots</id> - <name>Astron Nexus Repository</name> - <url>https://support.astron.nl/nexus/content/repositories/snapshots/</url> - </snapshotRepository> - </distributionManagement> - -</project> +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar Utilities :: Plotter GUI</name> + + <parent> + <groupId>nl.astron.lofar.lib</groupId> + <artifactId>lofar-lib-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + + <artifactId>plotter</artifactId> + + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/JAVA/GUI/Plotter</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/JAVA/GUI/Plotter</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + <sourceDirectory>src</sourceDirectory> + <resources> + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + + <resource> + <directory>PlotterConfig/src</directory> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + </resources> + + </build> + +</project> diff --git a/JAVA/LofarUtils/pom.xml b/JAVA/LofarUtils/pom.xml index dc86fd466784b1edb41c106ed6ee07e4a187a97d..f60c7c769cb184354b4d9c4bbaca52e0e19cf57f 100644 --- a/JAVA/LofarUtils/pom.xml +++ b/JAVA/LofarUtils/pom.xml @@ -1,65 +1,52 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project - xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>nl.astron.lofar</groupId> - <artifactId>lofarutils</artifactId> - <name>Lofar Utils</name> - <version>1.0.2</version> - - <organization> - <name>Astron</name> - <url>http://www.astron.nl</url> - </organization> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.test.sourceEncoding>UTF-8</project.test.sourceEncoding> - </properties> - - <build> - <sourceDirectory>src</sourceDirectory> - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.16</version> - </dependency> - </dependencies> - - <distributionManagement> - <snapshotRepository> - <id>snapshots</id> - <name>Astron Nexus Repository</name> - <url>https://support.astron.nl/nexus/content/repositories/snapshots/</url> - </snapshotRepository> - </distributionManagement> - - -</project> \ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar Utilities :: LofarUtils</name> + + <parent> + <groupId>nl.astron.lofar.lib</groupId> + <artifactId>lofar-lib-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + </parent> + + <artifactId>lofarutils</artifactId> + + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/JAVA/LofarUtils</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/JAVA/LofarUtils</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + <sourceDirectory>src</sourceDirectory> + <resources> + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + </resources> + </build> + + + <!-- This element describes all of the dependencies associated with a project. + These dependencies are used to construct a classpath for your project during + the build process. They are automatically downloaded from the repositories + defined in this project. See for more information: + http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html --> + <dependencies> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + </dependencies> + +</project> + diff --git a/JAVA/MAC/jRSP/Makefile.am b/JAVA/MAC/jRSP/Makefile.am deleted file mode 100644 index 68d785500cadbea0aa27ab5fbe1085e5e4a30670..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -SUBDIRS=src test include - -ACLOCAL_AMFLAGS = -I autoconf_share - -pkgextdir = $(prefix)/config/$(PACKAGE) -pkgext_DATA = pkgext pkgextcppflags pkgextcxxflags pkgextldflags - -DISTCHECK_CONFIGURE_FLAGS=\ - --with-common=$(prefix) - -EXTRA_DIST = \ - Makefile.common \ - jRSP.spec \ - autoconf_share/compiletool - -include $(top_srcdir)/Makefile.common diff --git a/JAVA/MAC/jRSP/bootstrap b/JAVA/MAC/jRSP/bootstrap deleted file mode 100755 index 06f18cde1dbfd6912ef7d927c4d35d25c7137a62..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -../../../autoconf_share/bootstrap ../../../autoconf_share diff --git a/JAVA/MAC/jRSP/build.xml b/JAVA/MAC/jRSP/build.xml deleted file mode 100644 index 06bdfa758add42ff60205d128a8d1c4341c6d374..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/build.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- You may freely edit this file. See commented blocks below for --> -<!-- some examples of how to customize the build. --> -<!-- (If you delete it and reopen the project it will be recreated.) --> -<project name="jRSP" default="default" basedir="."> - <description>Builds, tests, and runs the project jRSP.</description> - <import file="nbproject/build-impl.xml"/> - <!-- - - There exist several targets which are by default empty and which can be - used for execution of your tasks. These targets are usually executed - before and after some main targets. They are: - - -pre-init: called before initialization of project properties - -post-init: called after initialization of project properties - -pre-compile: called before javac compilation - -post-compile: called after javac compilation - -pre-compile-single: called before javac compilation of single file - -post-compile-single: called after javac compilation of single file - -pre-compile-test: called before javac compilation of JUnit tests - -post-compile-test: called after javac compilation of JUnit tests - -pre-compile-test-single: called before javac compilation of single JUnit test - -post-compile-test-single: called after javac compilation of single JUunit test - -pre-jar: called before JAR building - -post-jar: called after JAR building - -post-clean: called after cleaning build products - - (Targets beginning with '-' are not intended to be called on their own.) - - Example of inserting an obfuscator after compilation could look like this: - - <target name="-post-compile"> - <obfuscate> - <fileset dir="${build.classes.dir}"/> - </obfuscate> - </target> - - For list of available properties check the imported - nbproject/build-impl.xml file. - - - Another way to customize the build is by overriding existing main targets. - The targets of interest are: - - -init-macrodef-javac: defines macro for javac compilation - -init-macrodef-junit: defines macro for junit execution - -init-macrodef-debug: defines macro for class debugging - -init-macrodef-java: defines macro for class execution - -do-jar-with-manifest: JAR building (if you are using a manifest) - -do-jar-without-manifest: JAR building (if you are not using a manifest) - run: execution of project - -javadoc-build: Javadoc generation - test-report: JUnit report generation - - An example of overriding the target for project execution could look like this: - - <target name="run" depends="jRSP-impl.jar"> - <exec dir="bin" executable="launcher.exe"> - <arg file="${dist.jar}"/> - </exec> - </target> - - Notice that the overridden target depends on the jar target and not only on - the compile target as the regular run target does. Again, for a list of available - properties which you can use, check the target you are overriding in the - nbproject/build-impl.xml file. - - --> -</project> diff --git a/JAVA/MAC/jRSP/configure.in b/JAVA/MAC/jRSP/configure.in deleted file mode 100644 index ba1960f4a30a68b6220fcf4a1b7d878d9265e72e..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/configure.in +++ /dev/null @@ -1,74 +0,0 @@ -dnl -dnl Process this file with autoconf to produce a configure script. -dnl -AC_INIT -dnl AC_CONFIG_AUX_DIR(config) -dnl AM_CONFIG_HEADER(config/config.h) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(jRSP, 1.0, no-define) - -dnl Initialize for LOFAR (may set compilers) -lofar_INIT - -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_YACC -AC_PROG_CC -AC_PROG_CXX -AM_PROG_LEX -AC_PROG_INSTALL -AC_PROG_LN_S -dnl AC_DISABLE_SHARED -AC_PROG_LIBTOOL - -dnl Checks for libraries. - -dnl dnl Replace `main' with a function in -lfl: -dnl AC_CHECK_LIB(fl, main) -dnl dnl Replace `main' with a function in -lcosev_r: -dnl AC_CHECK_LIB(cosev_r, main) -dnl dnl Replace `main' with a function in -lcosnm_r: -dnl AC_CHECK_LIB(cosnm_r, main) -dnl dnl Replace `main' with a function in -lorb_r: -dnl AC_CHECK_LIB(orb_r, main) -dnl dnl Replace `main' with a function in -lpthread: -dnl AC_CHECK_LIB(pthread, main) -dnl dnl Replace `main' with a function in -lvport_r: -dnl AC_CHECK_LIB(vport_r, main) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_FUNC_VPRINTF - -dnl -dnl Check for LOFAR specific things -dnl -lofar_GENERAL -lofar_BLITZ -dnl lofar_MPI -lofar_INTERNAL(LCS/Common,Common,,1,Common/LofarTypedefs.h,,) -lofar_INTERNAL(MAC/GCF/TM, GCFTM,, 1, GCF/TM/GCF_Control.h,,) -lofar_INTERNAL(MAC/GCF/GCFCommon, GCFCommon,, 1, GCF/GCF_Defines.h,,) -lofar_INTERNAL(MAC/APL/PIC/RSP_Protocol, RSP_Protocol,,1, APL/RSP_Protocol/RSP_Protocol.ph,,) -lofar_INTERNAL(MAC/APL/GUI/RSP, RSP,,1, RSP/RSPport.h,,) - -dnl -dnl Output Makefiles -dnl -AC_CONFIG_FILES([test/runctest.sh:autoconf_share/runctest.sh.in], - [chmod +x test/runctest.sh]) -AC_OUTPUT( -include/Makefile -include/jRSP/Makefile -src/Makefile -test/Makefile -Makefile -jRSP.spec -) diff --git a/JAVA/MAC/jRSP/depcomp b/JAVA/MAC/jRSP/depcomp deleted file mode 100644 index ffcd540c3366d4ac158cd738c98d712460d99696..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/depcomp +++ /dev/null @@ -1,529 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2005-02-09.22 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to <bug-automake@gnu.org>. -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/JAVA/MAC/jRSP/include/jRSP/nl_astron_lofar_java_mac_jrsp_Board.h b/JAVA/MAC/jRSP/include/jRSP/nl_astron_lofar_java_mac_jrsp_Board.h deleted file mode 100644 index dca8ceb9c027a42556a76f50ab42256c8faef118..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/include/jRSP/nl_astron_lofar_java_mac_jrsp_Board.h +++ /dev/null @@ -1,125 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_java_mac_jrsp_Board */ - -#ifndef _Included_nl_astron_lofar_java_mac_jrsp_Board -#define _Included_nl_astron_lofar_java_mac_jrsp_Board -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: init - * Signature: (Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_init - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: delete - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_delete - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: retrieveStatus - * Signature: (II)[Lnl/astron/lofar/java/mac/jrsp/BoardStatus; - */ -JNIEXPORT jobjectArray JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_retrieveStatus - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: setWaveformSettings - * Signature: (IIDSII)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_setWaveformSettings - (JNIEnv *, jobject, jint, jint, jdouble, jshort, jint, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: getSubbandStats - * Signature: (II)[D - */ -JNIEXPORT jdoubleArray JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_getSubbandStats - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: getWaveformSettings - * Signature: (II)[Lnl/astron/lofar/java/mac/jrsp/WGRegisterType; - */ -JNIEXPORT jobjectArray JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_getWaveformSettings - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: getNrRCUs - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_getNrRCUs - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: getNrRSPBoards - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_getNrRSPBoards - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: getMaxRSPBoards - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_getMaxRSPBoards - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: setFilter - * Signature: (III)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_setFilter - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: sendClear - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_sendClear - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: sendReset - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_sendReset - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: sendSync - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_sendSync - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_java_mac_jrsp_Board - * Method: getBeamletStats - * Signature: (II)[D - */ -JNIEXPORT jdoubleArray JNICALL Java_nl_astron_lofar_java_mac_jrsp_Board_getBeamletStats - (JNIEnv *, jobject, jint, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/JAVA/MAC/jRSP/jRSP.spec.in b/JAVA/MAC/jRSP/jRSP.spec.in deleted file mode 100644 index f4c8ce83a3fc4357851f04eb0ce9221176575b02..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/jRSP.spec.in +++ /dev/null @@ -1,160 +0,0 @@ -# -*- Mode:rpm-spec -*- -# jRSP.spec.in -# - -############################################################################## -# -# Preamble -# -############################################################################## - -Summary: jRSP is ... brief description ... - -%define release @RPM_RELEASE@ -%define version @VERSION@ -%define pkgname @PACKAGE@ -%define pkgdir %{pkgname}-%{version}-%{release} -%define prefix /opt/lofar -%define configure_args @RPM_CONFIGURE_ARGS@ -##define build_kernel_version @BUILD_KERNEL_VERSION@ - -Name: %{pkgname} -Version: %{version} -Release: %{release} -Copyright: LGPL -Group: Application/System -Source: %{pkgname}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{pkgdir}-root -URL: http://www.astron.nl -Prefix: %{prefix} -BuildArchitectures: i386 # Target platforms, i.e., i586 -##Requires: Common = 1.2 ## define dependent packages here -Packager: %{packager} -Distribution: The LOFAR project -Vendor: ASTRON - -AutoReqProv: no - -%description - -jRSP ... more detailed description ... - -############################################################################## -# -# prep -# -############################################################################## -%prep -echo $prefix - -# create the build directory, untar the source -%setup - -############################################################################## -# -# build -# -############################################################################## -%build -./configure %{configure_args} --prefix=%{prefix} && make - -############################################################################## -# -# install -# -############################################################################## -%install -# To make things work with BUILDROOT -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi -mkdir -p $RPM_BUILD_ROOT%{prefix} -make DESTDIR="$RPM_BUILD_ROOT" install - -#uninstall - -############################################################################## -# -# verify -# -############################################################################## -#verify - -############################################################################## -# -# clean -# -############################################################################## -%clean -# Call me paranoid, but I do not want to be responsible for nuking -# someone's harddrive! -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi - -############################################################################## -# -# files -# -############################################################################## - -# empty 'files' means all distributed files -%files -%defattr(-, root, root) -%{prefix} - -# Your application file list goes here -# %{prefix}/lib/lib*.so* - -# Documentation -# doc COPYING ChangeLog README AUTHORS NEWS -# doc doc/* - -# link the module to the correct path -%post - -# before uninstall -%preun - -# after uninstall -%postun - -############################################################################## -# -# package devel -# -############################################################################## - -#package devel -#Summary: Development files for %{pkgname} -#Group: Applications/System -#description devel -#Development files for %{pkgname}. - -#files devel - -# Your development files go here -# Programmers documentation goes here -#doc doc - -# end of file diff --git a/JAVA/MAC/jRSP/manifest.mf b/JAVA/MAC/jRSP/manifest.mf deleted file mode 100644 index 328e8e5bc3b7f1f7bad2bc0751a933e00c801983..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/JAVA/MAC/jRSP/pom.xml b/JAVA/MAC/jRSP/pom.xml deleted file mode 100644 index 10e01f64e0075e9e229caf05c303e36e11bf6cd1..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project> - <modelVersion>4.0.0</modelVersion> - <groupId>nl.astron.lofar.mac</groupId> - <artifactId>jRSP</artifactId> - <name>jRSP</name> - <version>1.0.0</version> - - <organization> - <name>Astron</name> - <url>http://www.astron.nl</url> - </organization> - - <build> - - - <sourceDirectory>src</sourceDirectory> - - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - </plugins> - - </build> - - <dependencies> - - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.16</version> - </dependency> - - </dependencies> - -</project> \ No newline at end of file diff --git a/JAVA/MAC/jRSP/src/Makefile.am b/JAVA/MAC/jRSP/src/Makefile.am deleted file mode 100644 index 54490656ef2d843f9a7e6a7abec7a394853683f5..0000000000000000000000000000000000000000 --- a/JAVA/MAC/jRSP/src/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -lib_LTLIBRARIES = libjrsp.la - -libjrsp_la_SOURCES = $(DOCHDRS) nl_astron_lofar_java_mac_jrsp_Board.cc - -# AM_YFLAGS = -d -p KeyParse -# AM_LFLAGS = -PKeyTokenize -# LEX_OUTPUT_ROOT = lex.KeyTokenize - -# if HAVE_SHMEM -# libjotdb2_la_LIBADD = shmem/libshmem.la -# endif - -bin_PROGRAMS = - -glishdir = $(libexecdir)/glish -dist_glish_SCRIPTS = - -pythondir = $(bindir) -dist_python_SCRIPTS = - -scriptdir = $(bindir) -dist_script_SCRIPTS = - -include $(top_srcdir)/Makefile.common diff --git a/JAVA/pom.xml b/JAVA/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..da792280c5dac1a0bc5e0a427cab13372f147581 --- /dev/null +++ b/JAVA/pom.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar Utilities :: Parent</name> + + <parent> + <groupId>nl.astron</groupId> + <artifactId>parent</artifactId> + <version>2.0.0</version> + </parent> + + <groupId>nl.astron.lofar.lib</groupId> + <artifactId>lofar-lib-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + <packaging>pom</packaging> + + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/JAVA</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/JAVA</developerConnection> + </scm> + + + <!-- The modules (sometimes called subprojects) to build as a part of this + project. Each module listed is a relative path to the directory containing + the module. --> + <modules> + <module>LofarUtils</module> + <module>GUI/Plotter</module> + </modules> + + + <!-- Default dependency information for projects that inherit from this + one. The dependencies in this section are not immediately resolved. Instead, + when a POM derived from this one declares a dependency described by a matching + groupId and artifactId, the version and other values from this section are + used for that dependency if they were not already specified. --> + <dependencyManagement> + <dependencies> + + <!-- Child dependencies, childs use the same group-ID and version by default. --> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>lofarutils</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>plotter</artifactId> + <version>${project.version}</version> + </dependency> + + </dependencies> + </dependencyManagement> + +</project> diff --git a/LCS/ApplCommon/include/ApplCommon/Observation.h b/LCS/ApplCommon/include/ApplCommon/Observation.h index 210f15f69fb7c634ef7bd07fa4fc387792f2f141..4ff478784dc46dbcc97db4f78858c7910c1f6173 100644 --- a/LCS/ApplCommon/include/ApplCommon/Observation.h +++ b/LCS/ApplCommon/include/ApplCommon/Observation.h @@ -179,6 +179,7 @@ public: vector<string> stations; int nrSlotsInFrame; int sampleClock; // 160 | 200 + int bitsPerSample; // 4 | 8 | 16 string filter; // LBA_30_80, LBA_10_90, HBA_110_190, etc. string MSNameMask; string realPVSSdatapoint; @@ -198,6 +199,11 @@ public: vector<StreamToStorage> streamsToStorage; + // type of observation + string processType; + string processSubtype; + string strategy; + // couple of values of the virtual instrument as compacted strings string receiverList; string stationList; diff --git a/LCS/ApplCommon/include/ApplCommon/StationDatatypes.h b/LCS/ApplCommon/include/ApplCommon/StationDatatypes.h index cc9ac7860f4e02de970728b4994ddd3ea7d8427e..443df01e330ee34ab386a232eaefc93d68b8a373 100644 --- a/LCS/ApplCommon/include/ApplCommon/StationDatatypes.h +++ b/LCS/ApplCommon/include/ApplCommon/StationDatatypes.h @@ -40,12 +40,10 @@ namespace LOFAR { typedef bitset<MAX_RCUS> RCUmask_t; typedef bitset<MAX_ANTENNAS> AntennaMask_t; typedef bitset<MAX_SUBBANDS> SubbandMask_t; -typedef bitset<MAX_BEAMLETS> BeamletMask_t; using LOFAR::RCUmask_t; using LOFAR::AntennaMask_t; using LOFAR::SubbandMask_t; -using LOFAR::BeamletMask_t; RCUmask_t Antenna2RCUmask(const AntennaMask_t& am); AntennaMask_t RCU2AntennaMask(const RCUmask_t& rm); diff --git a/LCS/ApplCommon/src/AntennaSets.cc b/LCS/ApplCommon/src/AntennaSets.cc index 14d9d19ac93bfc1d6b323723275b9e2dba48b7ba..15327a090e65c23b106cb6398f4b8d4daa24fdf2 100644 --- a/LCS/ApplCommon/src/AntennaSets.cc +++ b/LCS/ApplCommon/src/AntennaSets.cc @@ -163,17 +163,15 @@ bool AntennaSets::_adoptSelector(const string& selector, const string& antennaFi // next get the pattern string pattern; - uint patLen(0); while (sIdx < strLen && !isdigit(selector[sIdx])) { - pattern[patLen] = selector[sIdx]; - patLen++; + pattern += selector[sIdx]; sIdx++; } - ASSERTSTR(patLen, "Expected a pattern at position " << sIdx << " of selector " << selector); + ASSERTSTR(pattern.length(), "Expected a pattern at position " << sIdx << " of selector " << selector); // now we have both the loopcount and the pattern, apply it to Set. for (uint l = 0; l < loopCnt; l++) { - for (uint p = 0; p < patLen; p++) { + for (uint p = 0; p < pattern.length(); p++) { char input = pattern[p]; ASSERTSTR(input=='l' || input=='h' || input=='H' || input=='.', "character '" << input << diff --git a/LCS/ApplCommon/src/Observation.cc b/LCS/ApplCommon/src/Observation.cc index 4bbd63a1451f9de8eed89c29a95e3f55087ce9c5..3f33ef36bd2d34a5ed22c66ebe0feacb7a54d5aa 100644 --- a/LCS/ApplCommon/src/Observation.cc +++ b/LCS/ApplCommon/src/Observation.cc @@ -31,6 +31,7 @@ #include <Common/lofar_vector.h> #include <Common/StreamUtil.h> #include <Common/SystemUtil.h> +#include <Common/LofarBitModeInfo.h> #include <ApplCommon/Observation.h> #include <Common/lofar_map.h> @@ -66,6 +67,7 @@ Observation::Observation(const ParameterSet* aParSet, stopTime(0), nyquistZone(0), sampleClock(0), + bitsPerSample(0), splitterOn(false), itsStnHasDualHBA(hasDualHBA) { @@ -73,6 +75,9 @@ Observation::Observation(const ParameterSet* aParSet, string prefix = aParSet->locateModule("Observation") + "Observation."; LOG_TRACE_VAR_STR("'Observation' located at: " << prefix); + string olapprefix = aParSet->locateModule("OLAP") + "OLAP."; + LOG_TRACE_VAR_STR("'OLAP' located at: " << olapprefix); + name = aParSet->getString(prefix+"name", ""); obsID = aParSet->getInt32("_treeID", 0); realPVSSdatapoint = aParSet->getString("_DPname","NOT_THE_REAL_DPNAME"); @@ -101,9 +106,21 @@ Observation::Observation(const ParameterSet* aParSet, } // miscellaneous - sampleClock = aParSet->getUint32(prefix+"sampleClock", 0); - filter = aParSet->getString(prefix+"bandFilter", ""); - antennaArray= aParSet->getString(prefix+"antennaArray", ""); + sampleClock = aParSet->getUint32(prefix+"sampleClock", 0); + filter = aParSet->getString(prefix+"bandFilter", ""); + antennaArray = aParSet->getString(prefix+"antennaArray", ""); + processType = aParSet->getString(prefix+"processType", ""); + processSubtype= aParSet->getString(prefix+"processSubtype", ""); + strategy = aParSet->getString(prefix+"strategy", ""); + + if (aParSet->isDefined(prefix+"nrBitsPerSample")) { + bitsPerSample = aParSet->getUint32(prefix+"nrBitsPerSample", 16); + } else { + // backward compatibility + LOG_WARN("Could not find Observation.nrBitsPerSample, using depricated OLAP.nrBitsPerSample"); + bitsPerSample = aParSet->getUint32(olapprefix+"nrBitsPerSample", 16); + } + nyquistZone = nyquistzoneFromFilter(filter); // new way of specifying the receivers and choosing the antenna array. @@ -133,16 +150,14 @@ Observation::Observation(const ParameterSet* aParSet, storageNodeList = compactedArrayString(aParSet->getString(prefix+"VirtualInstrument.storageNodeList","[]")); // construct array with usable (-1) slots and unusable(999) slots. Unusable slots arise - // when nrSlotsInFrame differs from MAX_BEAMLETS_PER_RSP. - itsSlotTemplate.resize (MAX_BEAMLETS, -1); // assume all are usable. - nrSlotsInFrame = aParSet->getInt(prefix+"nrSlotsInFrame",MAX_BEAMLETS_PER_RSP); - if (nrSlotsInFrame != MAX_BEAMLETS_PER_RSP) { - for (int rsp = 0; rsp < 4; rsp++) { - for (int bl = nrSlotsInFrame; bl < MAX_BEAMLETS_PER_RSP; bl++) { - itsSlotTemplate[rsp*MAX_BEAMLETS_PER_RSP + bl] = 999; - } - } - } + // when nrSlotsInFrame differs from maxBeamletsPerRSP. + itsSlotTemplate.resize (maxBeamlets(bitsPerSample), -1); // assume all are usable. + nrSlotsInFrame = aParSet->getInt(prefix+"nrSlotsInFrame", maxBeamletsPerRSP(bitsPerSample)); + for (int rsp = 0; rsp < 4; rsp++) { + for (int bl = nrSlotsInFrame; bl < maxBeamletsPerRSP(bitsPerSample); bl++) { + itsSlotTemplate[rsp * maxBeamletsPerRSP(bitsPerSample) + bl] = 999; + } + } // determine if DataslotLists are available in this parset itsHasDataslots = _hasDataSlots(aParSet); @@ -302,7 +317,6 @@ Observation::Observation(const ParameterSet* aParSet, } // for all analogue beams // loop over all data products and generate all data flows - string olapprefix = aParSet->locateModule("OLAP") + "OLAP."; if (!olapprefix.empty()) { // offline Pipelines don't have OLAP in the parset. const char *dataProductNames[] = { "Beamformed", "Correlated" }; unsigned dataProductPhases[] = { 3, 2 }; @@ -412,6 +426,12 @@ bool Observation::conflicts(const Observation& other) const return (true); } + // Observation overlap, check bit mode + if (other.bitsPerSample != bitsPerSample) { + LOG_INFO_STR("Bit mode of observation " << obsID << " and " << other.obsID << " conflict"); + return (true); + } + // Observation overlap, check splitters if (other.splitterOn != splitterOn) { LOG_INFO_STR("Splitters of observation " << obsID << " and " << other.obsID << " conflict"); @@ -526,7 +546,7 @@ vector<int> Observation::getBeamAllocation(const string& stationName) const // fill with required information for (int i = RSPboardList.size()-1; i >= 0; --i) { - int idx = RSPboardList[i] * MAX_BEAMLETS_PER_RSP + DataslotList[i]; + int idx = RSPboardList[i] * maxBeamletsPerRSP(bitsPerSample) + DataslotList[i]; if (b2b[idx] != -1) { THROW (Exception, "beamlet " << i << " of beam " << itsBeamSlotList[i] << " clashes with beamlet of other beam(" << b2b[idx] << ")"); } @@ -578,7 +598,7 @@ vector<int> Observation::getBeamlets (uint beamIdx, const string& stationName) c uint nrEntries = itsBeamSlotList.size(); for (uint i = 0; i < nrEntries; ++i) { if (itsBeamSlotList[i] == parsetIdx) { - result.push_back(RSPboardList[i] * MAX_BEAMLETS_PER_RSP + DataslotList[i]); + result.push_back(RSPboardList[i] * maxBeamletsPerRSP(bitsPerSample) + DataslotList[i]); } } return (result); @@ -709,6 +729,7 @@ ostream& Observation::print (ostream& os) const os << "antenna set : " << antennaSet << endl; os << "receiver set : " << RCUset << endl; os << "sampleClock : " << sampleClock << endl; + os << "bits/sample : " << bitsPerSample << endl; os << "filter : " << filter << endl; os << "splitter : " << (splitterOn ? "ON" : "OFF") << endl; os << "nyquistZone : " << nyquistZone << endl << endl; diff --git a/LCS/ApplCommon/src/StationInfo.cc b/LCS/ApplCommon/src/StationInfo.cc index 698a00e99033e5b5e3ad3177bae53fb795a4b39e..f6cbc084553db80ca2528ea2ffef8883bb669e5d 100644 --- a/LCS/ApplCommon/src/StationInfo.cc +++ b/LCS/ApplCommon/src/StationInfo.cc @@ -147,32 +147,32 @@ string realHostname(const string& someName) // // SAS : LOFAR.PIC.<RING>.<SYSTEM>.xxx // PVSS: <SYSTEM>:LOFAR_PIC_xxx -// ^ ^ ^ -// | | +-- locationPos + locationLen -// | +-- colon -// +-- systemLen // // NOTE: instead of PIC the DPname may contain PermSW or ObsSW_Observation<n> // string PVSS2SASname(const string& PVSSname) { const char* structure_match = "(([A-Z]{2,3}[0-9]{3}[A-Z]?):LOFAR_(PIC|PermSW)_)|" // 1,2,3 - "(([A-Z]{2,3}[0-9]{3}[A-Z]?):LOFAR_(PIC|PermSW)\\.)"; // 4,5,6 + "(([A-Z]{2,3}[0-9]{3}[A-Z]?):LOFAR_(PIC|PermSW)\\.)"; // 4,5,6 const char* location_match = "(RCU[0-9]{3})|" // 1 - "_(CS[0-9]{3}[A-Z]?)_|" // 2 CS999 - "_(RS[0-9]{3}[A-Z]?)_|" // 3 RS999 - "_([ABD-QS-Z][A-Z][0-9]{3}[A-Z]?)_|" // 4 XX999 - "_([A-Z]{3}[0-9]{3}[A-Z]?)_"; // 5 XXX999 + "(LBA[0-9]{3})|" // 2 LBA999 + "(HBA[0-9]{2})|" // 3 HBA99 + "_(CS[0-9]{3}[A-Z]?)_|" // 4 CS999 + "_(RS[0-9]{3}[A-Z]?)_|" // 5 RS999 + "_([ABD-QS-Z][A-Z][0-9]{3}[A-Z]?)_|" // 6 XX999 + "_([A-Z]{3}[0-9]{3}[A-Z]?)_"; // 7 XXX999 const char* separator_match = "(_)|(\\.)"; const char* boundary_match = "(^([^_]+)_)"; const char* structure_repl = "(?1LOFAR_$3_$2_)" // LOFAR_PIC_RS002 "(?4LOFAR_$6.)"; // LOFAR_PIC const char* location_repl = "(?1$&)" // ignore RCU999 - "(?2_Core$&)" - "(?3_Remote$&)" - "(?4_Europe$&)" - "(?5_Control$&)"; + "(?2$&)" + "(?3$&)" + "(?4_Core$&)" + "(?5_Remote$&)" + "(?6_Europe$&)" + "(?7_Control$&)"; const char* separator_repl = "(?1.)(?2_)"; // swap separators const char* boundary_repl = "$2."; // reverse separator on object-field edge diff --git a/LCS/ApplCommon/test/CMakeLists.txt b/LCS/ApplCommon/test/CMakeLists.txt index faab09b58de095dc2c04eda5648d4e1adbc047fe..d2f57bccdcf4adee3d662fc047f1bdad3b7962c5 100644 --- a/LCS/ApplCommon/test/CMakeLists.txt +++ b/LCS/ApplCommon/test/CMakeLists.txt @@ -6,3 +6,4 @@ lofar_add_test(tAntField tAntField.cc) lofar_add_test(tAntennaSet tAntennaSet.cc) lofar_add_test(tObservation tObservation.cc) lofar_add_executable(tHasDataslots tHasDataslots.cc) +lofar_add_executable(tStationInfo tStationInfo.cc) diff --git a/LCS/ApplCommon/test/tObservation.cc b/LCS/ApplCommon/test/tObservation.cc index 4903ea8efb11e43363c3e563837726d07ac46c24..c333da8137896331010a8d92a55b0d63f01ca4e6 100644 --- a/LCS/ApplCommon/test/tObservation.cc +++ b/LCS/ApplCommon/test/tObservation.cc @@ -126,6 +126,12 @@ int main (int argc, char* argv[]) Observation conflictObs5(&conflictPS5, false); ASSERTSTR(!obs2.conflicts(conflictObs5), "File 5 should NOT have had a conflict"); cout << "No conflict found in file 5 which is oke." << endl; + + // test conflicts in bit mode + ParameterSet conflictPS6("tObservation.in_conflict6"); + Observation conflictObs6(&conflictPS6, false); + ASSERTSTR(obs2.conflicts(conflictObs6), "File 6 should have had a bit mode conflict"); + cout << "<<<" << endl; // on // basic test on RCU bitsets diff --git a/LCS/ApplCommon/test/tObservation.in_conflict1 b/LCS/ApplCommon/test/tObservation.in_conflict1 index 34afeaf6cccbebbd8bb5859c8a188880aecc106a..07ae577f6dae074d562127748defb1f0c28f5759 100644 --- a/LCS/ApplCommon/test/tObservation.in_conflict1 +++ b/LCS/ApplCommon/test/tObservation.in_conflict1 @@ -1,4 +1,5 @@ # Clock is different, while time overlaps on all sides. +OLAP.nrBitsPerSample=16 Clock160.channelWidth=610.3515625 Clock160.samplesPerSecond=155648 Clock160.subbandWidth=156.250 diff --git a/LCS/ApplCommon/test/tObservation.in_conflict2 b/LCS/ApplCommon/test/tObservation.in_conflict2 index 1c3184ecb45c991c79b3f958367eafc27dec650b..3f8da0d76dc87327f87581f67d3f29a9f9a98858 100644 --- a/LCS/ApplCommon/test/tObservation.in_conflict2 +++ b/LCS/ApplCommon/test/tObservation.in_conflict2 @@ -1,4 +1,5 @@ # Receivers conflict because time overlap and other rcumode +OLAP.nrBitsPerSample=16 Clock160.channelWidth=610.3515625 Clock160.samplesPerSecond=155648 Clock160.subbandWidth=156.250 diff --git a/LCS/ApplCommon/test/tObservation.in_conflict3 b/LCS/ApplCommon/test/tObservation.in_conflict3 index 0f84d04e6c8c71f22c23bec39956cdfaad7f93f4..ae71c60d2031a539582126714b195a5550eafb8e 100644 --- a/LCS/ApplCommon/test/tObservation.in_conflict3 +++ b/LCS/ApplCommon/test/tObservation.in_conflict3 @@ -1,4 +1,5 @@ # beamlets overlap. +OLAP.nrBitsPerSample=16 Clock160.channelWidth=610.3515625 Clock160.samplesPerSecond=155648 Clock160.subbandWidth=156.250 diff --git a/LCS/ApplCommon/test/tObservation.in_conflict4 b/LCS/ApplCommon/test/tObservation.in_conflict4 index 31da254d89c5061c98f59648371b242ef1d32bda..95ee1dafd1cf45e9f82ae1ab1e8a3726d49dc9d9 100644 --- a/LCS/ApplCommon/test/tObservation.in_conflict4 +++ b/LCS/ApplCommon/test/tObservation.in_conflict4 @@ -1,3 +1,4 @@ +# Conflicts in nrSlotsPerFrame Clock160.channelWidth=610.3515625 Clock160.samplesPerSecond=155648 Clock160.subbandWidth=156.250 diff --git a/LCS/ApplCommon/test/tObservation.in_conflict5 b/LCS/ApplCommon/test/tObservation.in_conflict5 index 0fe1c9debc7c2db94d4f20161b404b75ab27177a..d1bc2a207dfddf4a900854f4d8e6aafd83554d61 100644 --- a/LCS/ApplCommon/test/tObservation.in_conflict5 +++ b/LCS/ApplCommon/test/tObservation.in_conflict5 @@ -1,4 +1,5 @@ # everything conflicts except for the observation period +OLAP.nrBitsPerSample=8 Clock160.channelWidth=610.3515625 Clock160.samplesPerSecond=155648 Clock160.subbandWidth=156.250 diff --git a/LCS/ApplCommon/test/tObservation.in_conflict6 b/LCS/ApplCommon/test/tObservation.in_conflict6 new file mode 100644 index 0000000000000000000000000000000000000000..0d61bdfdfa0adc62e8a6de45116fce3483496bcf --- /dev/null +++ b/LCS/ApplCommon/test/tObservation.in_conflict6 @@ -0,0 +1,59 @@ +# Conflicts in nrBitsPerSample +OLAP.nrBitsPerSample=8 +Clock160.channelWidth=610.3515625 +Clock160.samplesPerSecond=155648 +Clock160.subbandWidth=156.250 +Clock160.systemClock=160 +Clock200.channelWidth=762.939453125 +Clock200.samplesPerSecond=196608 +Clock200.subbandWidth=195.3125 +Clock200.systemClock=200 +ObsSW.Observation.Beam[0].angle1=6 +ObsSW.Observation.Beam[0].angle2=0.5 +ObsSW.Observation.Beam[0].angleTimes=0 +ObsSW.Observation.Beam[0].beamletList=[40..43] +ObsSW.Observation.Beam[0].directionType=J2000 +ObsSW.Observation.Beam[0].subbandList=[2..5] +ObsSW.Observation.MSNameMask=/data/L${YEAR}_${MSNUMBER}/SB${SUBBAND}.MS +ObsSW.Observation.ObsCtrl.StationCtrl._hostname=[CS016] +ObsSW.Observation.ObsCtrl._hostname=MCU001 +ObsSW.Observation.ObsCtrl.heartbeatInterval=10 +ObsSW.Observation.TBB.TBBsetting.C0=0 +ObsSW.Observation.TBB.TBBsetting.C1=0 +ObsSW.Observation.TBB.TBBsetting.C2=0 +ObsSW.Observation.TBB.TBBsetting.C3=0 +ObsSW.Observation.TBB.TBBsetting.RCUs=[] +ObsSW.Observation.TBB.TBBsetting.baselevel=2048 +ObsSW.Observation.TBB.TBBsetting.filter=128 +ObsSW.Observation.TBB.TBBsetting.operatingMode=1 +ObsSW.Observation.TBB.TBBsetting.startlevel=7 +ObsSW.Observation.TBB.TBBsetting.stoplevel=7 +ObsSW.Observation.TBB.TBBsetting.window=1K +ObsSW.Observation.VirtualInstrument.BGLNodeList=[bgl001,bgl002,bgl003] +ObsSW.Observation.VirtualInstrument.imageNodeList=[lioff005,lioff002,lioff003] +ObsSW.Observation.VirtualInstrument.partitionList=[R001_128_0,R001_128_1,R001_128_2,R001_128_3] +ObsSW.Observation.VirtualInstrument.stationList=[CS016,CS017,CS018] +ObsSW.Observation.VirtualInstrument.storageCapacity=760 +ObsSW.Observation.VirtualInstrument.storageNodeList=[list001,list002] +ObsSW.Observation.antennaArray=HBA +ObsSW.Observation.antennaSet= +ObsSW.Observation.bandFilter=HB_210_240 +ObsSW.Observation.channelWidth=610.3515625 +ObsSW.Observation.channelsPerSubband=256 +ObsSW.Observation.claimPeriod=120 +ObsSW.Observation.clockMode=<<Clock160 +ObsSW.Observation.longBaselines=No +ObsSW.Observation.nrBeamformers=0 +ObsSW.Observation.nrBeams=1 +ObsSW.Observation.nrPolarisations=2 +ObsSW.Observation.nrSlotsInFrame=48 +ObsSW.Observation.preparePeriod=120 +ObsSW.Observation.receiverList=[0..11] +ObsSW.Observation.sampleClock=160 +ObsSW.Observation.samplesPerSecond=155648 +ObsSW.Observation.startTime=2008-Dec-16 15:30:00 +ObsSW.Observation.stopTime=2008-Dec-16 15:34:00 +ObsSW.Observation.subbandWidth=156.250 +_DPname=LOFAR_ObsSW_TempObs0016 +_treeID=5029 +prefix=LOFAR. diff --git a/LCS/ApplCommon/test/tObservation.in_parset1 b/LCS/ApplCommon/test/tObservation.in_parset1 index 971cdc4ade62c4413367171a5854d69b44b38fd9..018f0d5459f4678d256f4631edf35e3c57c4d513 100644 --- a/LCS/ApplCommon/test/tObservation.in_parset1 +++ b/LCS/ApplCommon/test/tObservation.in_parset1 @@ -1,3 +1,4 @@ +OLAP.nrBitsPerSample=16 Clock160.channelWidth=610.3515625 Clock160.samplesPerSecond=155648 Clock160.subbandWidth=156.250 diff --git a/LCS/ApplCommon/test/tStationInfo.cc b/LCS/ApplCommon/test/tStationInfo.cc index b755f1d4d5216beb152a1623b43e7d91dfe7dde1..372dc591309a15d83b93cabac57c1c5a0afbc19b 100644 --- a/LCS/ApplCommon/test/tStationInfo.cc +++ b/LCS/ApplCommon/test/tStationInfo.cc @@ -23,17 +23,18 @@ //# Always #include <lofar_config.h> first! #include <lofar_config.h> -#if defined HAVE_BOOST_REGEX - //# Includes #include <Common/LofarLogger.h> + +#if defined HAVE_BOOST_REGEX + #include <Common/SystemUtil.h> #include <ApplCommon/StationInfo.h> #include <boost/regex.hpp> using namespace LOFAR; -int main (int argc, char* argv[]) +int main (int/*argc*/, char* argv[]) { INIT_LOGGER(argv[0]); @@ -59,6 +60,14 @@ int main (int argc, char* argv[]) PVSS2SASname("RS002:LOFAR_ObsSW_Observation5.antennaArray")); LOG_INFO_STR("PVSS==>SAS(RS002:LOFAR_ObsSW_Observation5_BeamControl.status.state) = " << PVSS2SASname("RS002:LOFAR_ObsSW_Observation5_BeamControl.status.state")); + LOG_INFO_STR("PVSS==>SAS(RS005:LOFAR_PIC_HBA05.status.state) = " << + PVSS2SASname("RS005:LOFAR_PIC_HBA05.status.state")); + LOG_INFO_STR("PVSS==>SAS(DE603:LOFAR_PIC_LBA005.status.state) = " << + PVSS2SASname("DE603:LOFAR_PIC_LBA005.status.state")); + LOG_INFO_STR("PVSS==>SAS(CS101:LOFAR_PIC_HBA01.element00.status.state) = " << + PVSS2SASname("CS101:LOFAR_PIC_HBA01.element00.status.state")); + LOG_INFO_STR("PVSS==>SAS(CS101:LOFAR_PIC_HBA02.element12.X.status.state) = " << + PVSS2SASname("CS101:LOFAR_PIC_HBA02.element12.X.status.state")); LOG_INFO_STR("SAS==>PVSS(LOFAR.PIC.Remote.RS002.Cabinet0.Subrack0.status_state) = " << SAS2PVSSname("LOFAR.PIC.Remote.RS002.Cabinet0.Subrack0.status_state")); @@ -68,8 +77,21 @@ int main (int argc, char* argv[]) SAS2PVSSname("LOFAR.PermSW.Control.MCU001.MACScheduler.status_state")); LOG_INFO_STR("SAS==>PVSS(LOFAR.ObsSW.Observation.VirtualInstrument.stationList) = " << SAS2PVSSname("LOFAR.ObsSW.Observation.VirtualInstrument.stationList")); + LOG_INFO_STR("SAS==>PVSS(LOFAR.PIC.Remote.RS005.LBA123.status_state) = " << + SAS2PVSSname("LOFAR.PIC.Remote.RS005.LBA123.status_state")); + LOG_INFO_STR("SAS==>PVSS(LOFAR.PIC.Europe.DE603.HBA23.status_state) = " << + SAS2PVSSname("LOFAR.PIC.Europe.DE603.HBA23.status_state")); return (0); } +#else + +int main (int/*argc*/, char* argv[]) +{ + INIT_LOGGER(argv[0]); + + return 0; +} + #endif diff --git a/LCS/Common/include/Common/CMakeLists.txt b/LCS/Common/include/Common/CMakeLists.txt index 98885fcc0047186588ea33606781b33f0d19b653..6ab3bf84263d9683836f751d9e625790b29e18b0 100644 --- a/LCS/Common/include/Common/CMakeLists.txt +++ b/LCS/Common/include/Common/CMakeLists.txt @@ -27,6 +27,7 @@ install(FILES KVpair.h lofar_algorithm.h lofar_bitset.h + LofarBitModeInfo.h LofarConstants.h lofar_complex.h lofar_datetime.h diff --git a/LCS/Common/include/Common/LofarBitModeInfo.h b/LCS/Common/include/Common/LofarBitModeInfo.h new file mode 100644 index 0000000000000000000000000000000000000000..a23db97128108868c3a364a6f411ba7d672c3822 --- /dev/null +++ b/LCS/Common/include/Common/LofarBitModeInfo.h @@ -0,0 +1,67 @@ +//# LofarBitModeInfo.h +//# +//# Copyright (C) 2012 +//# ASTRON (Netherlands Institute for Radio Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands +//# +//# This file is part of the LOFAR software suite. +//# The LOFAR software suite is free software: you can redistribute it and/or +//# modify it under the terms of the GNU General Public License as published +//# by the Free Software Foundation, either version 3 of the License, or +//# (at your option) any later version. +//# +//# The LOFAR software suite is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License along +//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. +//# +//# $Id: LofarBitModeInfo.h 21167 2012-06-08 13:36:34Z mol $ + +#ifndef LOFAR_COMMON_BITMODEINFO_H_ +#define LOFAR_COMMON_BITMODEINFO_H_ + +#include <Common/LofarConstants.h> +#include <cassert> + +namespace LOFAR { + //int maxBeamletsPerRSP(int bitsPerSample); + //int maxBeamlets(int bitsPerSample); + + inline static int maxDataslotsPerRSP(int bitsPerSample) { + assert(bitsPerSample >= MIN_BITS_PER_SAMPLE && bitsPerSample <= MAX_BITS_PER_SAMPLE && bitsPerSample%2==0); + return(61); + } + + + inline static int maxBeamletsPerRSP(int bitsPerSample) { + assert(bitsPerSample >= MIN_BITS_PER_SAMPLE && bitsPerSample <= MAX_BITS_PER_SAMPLE && bitsPerSample%2==0); + switch (bitsPerSample) { + case 4: + return(4*maxDataslotsPerRSP(bitsPerSample)); + case 8: + return(2*maxDataslotsPerRSP(bitsPerSample)); + default: + return(maxDataslotsPerRSP(bitsPerSample)); + } + } + + inline static int maxBeamletsPerBank(int bitsPerSample) { + // 4 output lanes on one station + return(4 * maxDataslotsPerRSP(bitsPerSample)); + } + + inline static int maxBeamletsPerPlane(int bitsPerSample) { + return(maxBeamletsPerBank(bitsPerSample)); + } + + + inline static int maxBeamlets(int bitsPerSample) { + // 4 output lanes on one station + return(4 * maxBeamletsPerRSP(bitsPerSample)); + } +} + +#endif diff --git a/LCS/Common/include/Common/LofarConstants.h b/LCS/Common/include/Common/LofarConstants.h index 0047200fa40a3546e8204cbc25b079e497ac4456..50203b18d8f9b99c5bd4bc2cbf6d13f1e5470745 100644 --- a/LCS/Common/include/Common/LofarConstants.h +++ b/LCS/Common/include/Common/LofarConstants.h @@ -45,13 +45,14 @@ namespace LOFAR { static const int MAX_ANTENNAS = 96; // Max number antenna's of each type. static const int MAX_RCUS = (MAX_ANTENNAS * N_POL); // Max number of RCU's in one station static const int MAX_SUBBANDS = 512; // Number of subbands that are created - static const int MAX_BEAMLETS_PER_RSP = 61; // Max number of beamlets comming from one RSPboard - static const int MAX_BEAMLETS = (4 * MAX_BEAMLETS_PER_RSP); // Max number of beamlets comming from one station static const int MAX_RSPBOARDS = (MAX_RCUS / NR_RCUS_PER_RSPBOARD); static const int NR_RCU_MODES = 7; static const int NR_SPECTRAL_WINDOWS = 5; + static const int MAX_BITS_PER_SAMPLE = 16; + static const int MIN_BITS_PER_SAMPLE = 4; + static const int MAX_NR_BM_BANKS = (MAX_BITS_PER_SAMPLE / MIN_BITS_PER_SAMPLE); } #endif diff --git a/LCS/Common/include/Common/Thread/Thread.h b/LCS/Common/include/Common/Thread/Thread.h index 2ab828e37a32e3b6acc7016d2c498d0776cc7c86..aaea0e3abfc2fc1a2654d470e313ffd4efd5bad5 100644 --- a/LCS/Common/include/Common/Thread/Thread.h +++ b/LCS/Common/include/Common/Thread/Thread.h @@ -71,6 +71,7 @@ class Thread void wait(); bool wait(const struct timespec &); + bool isDone(); private: Thread(const Thread&); @@ -189,6 +190,14 @@ inline bool Thread::wait(const struct timespec ×pec) } +inline bool Thread::isDone() +{ + struct timespec deadline = { 0, 0 }; + + return wait(deadline); +} + + template <typename T> inline void Thread::stub(Args<T> *args) { // (un)register WITHIN the thread, since the thread id diff --git a/LCS/Common/include/Common/i4complex.h b/LCS/Common/include/Common/i4complex.h index 6366f47946db06af149b27267f59c29940d13f0b..901da26ca6c2820d418455a1a71141c16dd130b6 100644 --- a/LCS/Common/include/Common/i4complex.h +++ b/LCS/Common/include/Common/i4complex.h @@ -33,15 +33,24 @@ namespace LOFAR { i4complex() {} i4complex(double real, double imag) { - value = ((int) rint(real - .5) & 0xF) | (((int) rint(imag - .5) & 0xF) << 4); + int r = (int) rint(real); + int i = (int) rint(imag); + + // clip to [-7..7] to center dynamic range around 0 + if (r <= -8) r = -7; + if (i <= -8) i = -7; + if (r >= 8) r = 7; + if (i >= 8) i = 7; + + value = (r & 0xF) | ((i & 0xF) << 4); } double real() const { - return ((signed char) (value << 4) >> 4) + .5; // extend sign + return ((signed char) (value << 4) >> 4); // extend sign } double imag() const { - return (value >> 4) + .5; + return (value >> 4); } i4complex conj() const { diff --git a/LCS/Common/src/InputParSet.cc b/LCS/Common/src/InputParSet.cc index 17750b720acbffc5f57c129c28df19f6947b4a6e..b4f721b8b29781a6434be148a7baeb14e5bc3d55 100644 --- a/LCS/Common/src/InputParSet.cc +++ b/LCS/Common/src/InputParSet.cc @@ -208,7 +208,7 @@ namespace LOFAR { void InputParSet::setVersion (const string& version) { - itsVersion == version; + itsVersion = version; #ifdef HAVE_AIPSPP itsInput->version (version); #endif diff --git a/LCS/Common/test/CMakeLists.txt b/LCS/Common/test/CMakeLists.txt index 34abcc6413e97910f8cf89a1046c53ab46564cb6..b6bfef90bbe46b1864a992e05b9a3e091ccfb6c1 100644 --- a/LCS/Common/test/CMakeLists.txt +++ b/LCS/Common/test/CMakeLists.txt @@ -2,6 +2,8 @@ include(LofarCTest) +lofar_add_test(tBoostBitset tBoostBitset.cc) + lofar_add_test(testLogger testLogger.cc) lofar_add_test(tCasaLogSink tCasaLogSink.cc) lofar_add_test(tAllocator tAllocator.cc) diff --git a/LCS/Common/test/tBoostBitset.cc b/LCS/Common/test/tBoostBitset.cc new file mode 100644 index 0000000000000000000000000000000000000000..5481fed1f0079af3b64f354a340653651c5eeeb3 --- /dev/null +++ b/LCS/Common/test/tBoostBitset.cc @@ -0,0 +1,64 @@ +#include <lofar_config.h> +#include <iostream> +#include <sstream> +#include <boost/dynamic_bitset.hpp> + +using namespace std; + +int main(int, char*[]) { + boost::dynamic_bitset<> x(25); // all 0's by default + x[0] = 1; + x[1] = 1; + x[22] = 1; + for (boost::dynamic_bitset<>::size_type i = 0; i < x.size(); ++i) + std::cout << x[i]; + std::cout << "\n"; + std::cout << x << "\n"; + std::cout << "size:" << x.size() << "\n"; + std::cout << "count:" << x.count() << "\n"; + std::cout << "num_blocks:" << x.num_blocks() << "\n"; + std::cout << "max_size:" << x.max_size() << "\n"; + std::cout << "bits_per_block:" << x.bits_per_block << "\n"; + std::cout << "sizeof:" << sizeof(x) << "\n"; + + stringstream buf(stringstream::in | stringstream::out); + buf << x; + string s = buf.str(); + cout << "s:" << s << endl; + cout << "len(s):" << s.size() << endl; + + boost::dynamic_bitset<> y(x.size()); + buf >> y; + std::cout << "\nmemcpy to y...\n"; + std::cout << y << "\n"; + std::cout << "size:" << y.size() << "\n"; + std::cout << "count:" << y.count() << "\n"; + std::cout << "num_blocks:" << y.num_blocks() << "\n"; + std::cout << "max_size:" << y.max_size() << "\n"; + std::cout << "bits_per_block:" << y.bits_per_block << "\n"; + std::cout << "sizeof:" << sizeof(y) << "\n"; + + vector<boost::dynamic_bitset<>::block_type> abc; + abc.resize(x.num_blocks()); + vector<boost::dynamic_bitset<>::block_type>::iterator sIter(abc.begin()); + boost::to_block_range(x, sIter); + cout << "AFTER to_block_range" << endl; + + boost::dynamic_bitset<> z(x.size()); + boost::from_block_range(abc.begin(), abc.end(), z); + cout << "AFTER from_block_range" << endl; + + std::cout << "\nblock copy to z...\n"; + std::cout << z << "\n"; + std::cout << "size:" << z.size() << "\n"; + std::cout << "count:" << z.count() << "\n"; + std::cout << "num_blocks:" << z.num_blocks() << "\n"; + std::cout << "max_size:" << z.max_size() << "\n"; + std::cout << "bits_per_block:" << z.bits_per_block << "\n"; + std::cout << "sizeof:" << sizeof(z) << "\n"; + + + + return EXIT_SUCCESS; +} + diff --git a/LCS/MSLofar/include/MSLofar/BeamTables.h b/LCS/MSLofar/include/MSLofar/BeamTables.h index ad0921e859bb65fee876dbd511c4f6aee61ee26b..902a051b904f552bb1ae43aa2b09852334e6d79b 100644 --- a/LCS/MSLofar/include/MSLofar/BeamTables.h +++ b/LCS/MSLofar/include/MSLofar/BeamTables.h @@ -59,7 +59,7 @@ namespace LOFAR { bool overwrite = false); // Fill the subtables. They should be empty. - // <src>mustExist</src> tells if the AntennaField and iHBADelta file on + // <src>mustExist</src> tells if the AntennaField and iHBADelta file of // an antenna must exist. static void fill (casa::Table& ms, const string& antennaSet, @@ -68,6 +68,14 @@ namespace LOFAR { const string& iHBADeltaDir, bool mustExist=false); + // Update the beam info subtables for broken elements. + // The 'before' file contains the elements already broken at the beginning + // of the observation. The 'during' file contains elements broken during + // the observation. + /// static void updateBroken (casa::Table& ms, + /// const string& beforeFileName, + /// const string& duringFilename); + // Write an AntennaField entry in the given row. static void writeAntField (MSAntennaFieldColumns& columns, int rownr, int antennaId, const string& stationName, @@ -79,14 +87,15 @@ namespace LOFAR { // Write the possible AntennaField elements. // The elements in the configuration are given in the bitset // starting at the given bit (there is a bit for X and one for Y). - // The number of skipped elements has to be added for HBA1. - static void writeElements (MSAntennaFieldColumns& columns, - int rownr, - const AntField::AFArray& elemOffsets, - const vector<int16>& elemPresent, - bool addSkip, - const AntField::AFArray& stationCenter, - const AntField::AFArray& fieldCenter); + // It returns the diameter of the station calculated from the maximum + // distance of a used element to the center. + static double writeElements (MSAntennaFieldColumns& columns, + int rownr, + const AntField::AFArray& elemOffsets, + const vector<int16>& posIndex, + int addAnt, + const AntField::AFArray& stationCenter, + const AntField::AFArray& fieldCenter); // Write the antenna set name into all rows of the LOFAR_ANTENNA_SET // column of the OBSERVATION table. @@ -104,7 +113,8 @@ namespace LOFAR { // The column is added if not existing. static void writeAntenna (casa::Table& antTable, const casa::Vector<casa::String>& antNames, - const map<string,int>& stationIdMap); + const map<string,int>& stationIdMap, + const vector<double>& diameters); // Convert an AFArray to a casacore Array object. static casa::Array<double> array2Casa (const AntField::AFArray& barray); diff --git a/LCS/MSLofar/include/MSLofar/CMakeLists.txt b/LCS/MSLofar/include/MSLofar/CMakeLists.txt index d83ec1d068f2ffbd0b2c57079637601a394bb59b..3416bcffbc71156c050a74371730da6898d39264 100644 --- a/LCS/MSLofar/include/MSLofar/CMakeLists.txt +++ b/LCS/MSLofar/include/MSLofar/CMakeLists.txt @@ -21,6 +21,7 @@ set (inst_HEADERS MSStation.h MSStationColumns.h BeamTables.h + FailedTileInfo.h ) # Install header files. diff --git a/LCS/MSLofar/include/MSLofar/FailedTileInfo.h b/LCS/MSLofar/include/MSLofar/FailedTileInfo.h new file mode 100644 index 0000000000000000000000000000000000000000..780256bb4050b691ff696aebdc20c2cf1cec3262 --- /dev/null +++ b/LCS/MSLofar/include/MSLofar/FailedTileInfo.h @@ -0,0 +1,79 @@ +//# FailedTleInfo.cc: Class to write failed tile info into an MS +//# Copyright (C) 2012 +//# ASTRON (Netherlands Institute for Radio Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands +//# +//# This file is part of the LOFAR software suite. +//# The LOFAR software suite is free software: you can redistribute it and/or +//# modify it under the terms of the GNU General Public License as published +//# by the Free Software Foundation, either version 3 of the License, or +//# (at your option) any later version. +//# +//# The LOFAR software suite is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License along +//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. +//# +//# $Id$ + +#ifndef LOFAR_FAILEDTILEINFO_H +#define LOFAR_FAILEDTILEINFO_H + +#include <tables/Tables/Table.h> +#include <casa/Quanta/MVEpoch.h> +#include <casa/Arrays/Matrix.h> + +#include <Common/lofar_vector.h> +#include <Common/lofar_map.h> +#include <Common/lofar_string.h> + +namespace LOFAR { + + class FailedTileInfo + { + public: + // Define a vector of FailedTileInfo objects. + typedef vector<FailedTileInfo> VectorFailed; + + // Construct the object for a failed tile or RCU. + FailedTileInfo (const string& station, const string& time, + const casa::MVEpoch& epoch, const string& type, int seqnr); + + // Read the broken hardware file giving a map of antenna name to a vector + // of pairs of tile/RCU and time. + static map<string, VectorFailed> readFile + (const string& fileName, double startTime, double endTime); + + // Convert the info per station name to info per antennaId. + static vector<VectorFailed> antennaConvert + (const casa::Table& ms, const map<string,VectorFailed>& broken); + + // Find the tile nr from the given seqnr which can be a tile or rcu. + // If a tile for the given station type is given, the element is seqnr/2. + // Otherwise find the matching rcu in the rcuList and return its index. + static int findTile (const FailedTileInfo&, + const casa::Matrix<casa::Int>& rcus); + + // Write the failed tile info. + static void writeFailed (casa::Table& ms, + const vector<VectorFailed>& brokenBefore, + const vector<VectorFailed>& brokenDuring); + + // Read the failed tile info and write into MS as needed. + static void failedTiles2MS (const string& msName, const string& beforeName, + const string& duringName); + + private: + string itsStation; + string itsTime; + casa::MVEpoch itsEpoch; + string itsType; //# RCU, LBA, or HBA + int itsSeqNr; + }; + +} //# end namespace + +#endif diff --git a/LCS/MSLofar/include/MSLofar/MSAntennaFieldColumns.h b/LCS/MSLofar/include/MSLofar/MSAntennaFieldColumns.h index fa04159d4aad90287b96fba05f2636c045f2030f..6c77060b432a3a5ca44a4dbb1e2b29c1e22a2ab1 100644 --- a/LCS/MSLofar/include/MSLofar/MSAntennaFieldColumns.h +++ b/LCS/MSLofar/include/MSLofar/MSAntennaFieldColumns.h @@ -79,6 +79,8 @@ namespace LOFAR { { return elementOffset_p; } const casa::ROArrayQuantColumn<casa::Double>& elementOffsetQuant() const { return elementOffsetQuant_p; } + const casa::ROArrayColumn<casa::Int>& elementRCU() const + { return elementRCU_p; } const casa::ROArrayColumn<casa::Bool>& elementFlag() const { return elementFlag_p; } const casa::ROScalarColumn<casa::Double>& tileRotation() const @@ -116,6 +118,7 @@ namespace LOFAR { casa::ROArrayColumn<casa::Double> position_p; casa::ROArrayColumn<casa::Double> coordinateAxes_p; casa::ROArrayColumn<casa::Double> elementOffset_p; + casa::ROArrayColumn<casa::Int> elementRCU_p; casa::ROArrayColumn<casa::Bool> elementFlag_p; casa::ROScalarColumn<casa::Double> tileRotation_p; casa::ROArrayColumn<casa::Double> tileElementOffset_p; @@ -169,6 +172,8 @@ namespace LOFAR { { return elementOffset_p; } casa::ArrayQuantColumn<casa::Double>& elementOffsetQuant() { return elementOffsetQuant_p; } + casa::ArrayColumn<casa::Int>& elementRCU() + { return elementRCU_p; } casa::ArrayColumn<casa::Bool>& elementFlag() { return elementFlag_p; } casa::ScalarColumn<casa::Double>& tileRotation() @@ -201,6 +206,7 @@ namespace LOFAR { casa::ArrayColumn<casa::Double> position_p; casa::ArrayColumn<casa::Double> coordinateAxes_p; casa::ArrayColumn<casa::Double> elementOffset_p; + casa::ArrayColumn<casa::Int> elementRCU_p; casa::ArrayColumn<casa::Bool> elementFlag_p; casa::ScalarColumn<casa::Double> tileRotation_p; casa::ArrayColumn<casa::Double> tileElementOffset_p; diff --git a/LCS/MSLofar/src/BeamTables.cc b/LCS/MSLofar/src/BeamTables.cc index f50489677d779b414f3bd433f9786c7eae602870..db5f07145f299f2e7c4d616033b781f96278587b 100644 --- a/LCS/MSLofar/src/BeamTables.cc +++ b/LCS/MSLofar/src/BeamTables.cc @@ -99,6 +99,7 @@ void BeamTables::fill (Table& ms, // Read the station names from the MS ANTENNA subtable. Table antTab (ms.keywordSet().asTable("ANTENNA")); ROScalarColumn<String> antNameCol(antTab, "NAME"); + ScalarColumn<double> diameterCol(antTab, "DISH_DIAMETER"); Vector<String> antNames(antNameCol.getColumn()); // Fill the LOFAR_ANTENNA_FIELD table for each entry in the ANTENNA table. @@ -107,20 +108,25 @@ void BeamTables::fill (Table& ms, int rownr = 0; // Keep a list of station names; keep it in order. // Also keep a map of unique station names and map them to clockId. - vector<string> stationNames; + vector<string> stationNames; map<string,int> stationIdMap; + vector<double> diameters; stationNames.reserve (antNames.size()); + diameters.reserve (antNames.size()); // Now write the info for each entry in the MS ANTENNA table. for (uint i=0; i<antNames.size(); ++i) { - // The MS antenna name consists of antenna field name and type. + // The MS antenna name consists of station name and antenna field name. + // E.g. CS001HBA0 (for dual mode) or CS001HBA (for joined mode). // For test purposes we do not assume that the station name has 5 chars. + // Get station type (core,remote,europe) using StationInfo.h. int stationType = stationTypeValue (antNames[i]); string stationName = antNames[i].substr (0, 5); string antFieldName; if (antNames[i].size() > 5) { antFieldName = antNames[i].substr (5, 4); } + // Antenna field type is first 3 characters of antenna field name. string antFieldType = antFieldName.substr (0, 3); stationNames.push_back (stationName); // possibly non-unique names // Define id for a new station, otherwise get the id. @@ -128,16 +134,13 @@ void BeamTables::fill (Table& ms, int stationId = stationIdMap.size(); stationIdMap[stationName] = stationId; } + // Get the antenna field info of the station. AntField antField(antFieldPath + stationName + "-AntennaField.conf", mustExist); - // Get the station type from the station name (using StationInfo.h). - // Use it to get the bitset telling which elements are present for - // the given antennaSet. // HBA stations have to be treated a bit special. AntField::AFArray hbaOffsets; // offsets of HBA dipoles in a tile bool done = false; - int firstHbaOffset = 0; if (antFieldType == "HBA") { // Get the offsets of HBA dipoles w.r.t. tile center. getHBADeltas (hbaDeltaPath + stationName + "-iHBADeltas.conf", @@ -152,46 +155,62 @@ void BeamTables::fill (Table& ms, antFieldType = "LBA"; antFieldName = "LBA"; } + double diameter = 0; if (antFieldName == "HBA") { - // HBA can be split into HBA0 and HBA1. + // HBA can be split into HBA0 and HBA1 (in e.g. core stations). // They have to be written separately. - if (antFieldName == "HBA") { - uint nelem0 = antField.nrAnts("HBA0"); - uint nelem1 = antField.nrAnts("HBA1"); - if (nelem0 > 0 && nelem1 > 0) { - // An extra row is needed. - antfTab.addRow(); - // The HBA offsets can be the same for HBA0 and HBA1 (16 values) - // or different (32 values). - if (AntField::getShape(hbaOffsets)[0] == 16) { - writeAntField (antfCols, rownr, i, stationName, - antField, "HBA0", hbaOffsets, 0); - writeAntField (antfCols, rownr+1, i, stationName, - antField, "HBA1", hbaOffsets, 0); - } else { - writeAntField (antfCols, rownr, i, stationName, - antField, "HBA0", hbaOffsets, 0); - writeAntField (antfCols, rownr+1, i, stationName, - antField, "HBA1", hbaOffsets, 16); - } - // Write all elements. - writeElements (antfCols, rownr, antField.AntPos("HBA"), - antennaSet.positionIndex ("HBA_ZERO", stationType), - false, - antField.Centre("HBA"), - antField.Centre("HBA0")); - writeElements (antfCols, rownr+1, antField.AntPos("HBA"), - antennaSet.positionIndex ("HBA_ONE", stationType), - true, - antField.Centre("HBA"), - antField.Centre("HBA1")); - rownr += 2; - done = true; + uint nelem0 = antField.nrAnts("HBA0"); + uint nelem1 = antField.nrAnts("HBA1"); + if (nelem0 > 0 && nelem1 > 0) { + // Write separately, so an extra row is needed. + antfTab.addRow(); + // The HBA offsets can be the same for HBA0 and HBA1 (16 values) + // or different (32 values). + if (AntField::getShape(hbaOffsets)[0] == 16) { + writeAntField (antfCols, rownr, i, stationName, + antField, "HBA0", hbaOffsets, 0); + writeAntField (antfCols, rownr+1, i, stationName, + antField, "HBA1", hbaOffsets, 0); + } else { + writeAntField (antfCols, rownr, i, stationName, + antField, "HBA0", hbaOffsets, 0); + writeAntField (antfCols, rownr+1, i, stationName, + antField, "HBA1", hbaOffsets, 16); } + // Write all elements. + // An HBA tile is 5 m wide, so add that to the diameter. + double d1 = writeElements (antfCols, rownr, antField.AntPos("HBA"), + antennaSet.positionIndex ("HBA_ZERO", + stationType), + 0, + antField.Centre("HBA"), + antField.Centre("HBA0")) + 5; + double d2 = writeElements (antfCols, rownr+1, antField.AntPos("HBA"), + antennaSet.positionIndex ("HBA_ONE", + stationType), + 48, + antField.Centre("HBA"), + antField.Centre("HBA1")) + 5; + // Calculate diameter from distance between field centers and + // the diameters of the fields. + AntField::AFArray c0 = antField.Centre("HBA0"); + AntField::AFArray c1 = antField.Centre("HBA1"); + double a0 = (AntField::getData(c0)[0] - AntField::getData(c1)[0]); + double a1 = (AntField::getData(c0)[1] - AntField::getData(c1)[1]); + double a2 = (AntField::getData(c0)[2] - AntField::getData(c1)[2]); + diameter = sqrt(a0*a0 + a1*a1 + a2*a2) + 0.5*(d1 + d2); + rownr += 2; + done = true; } } // In all other cases write a single row. if (!done) { + // For HBA1 48 needs to be added to the posIndex value to get the + // correct antenna number. + // Set diameter of an LBA element or HBA tile. + int firstHbaOffset = 0; + int addAnt = 0; + double elemDiam = (antFieldType=="LBA" ? 2:5); string setName(antennaSetName); if (antFieldName == "HBA0") { setName = "HBA_ZERO"; @@ -199,24 +218,28 @@ void BeamTables::fill (Table& ms, setName = "HBA_ONE"; if (AntField::getShape(hbaOffsets)[0] == 32) { firstHbaOffset = 16; + addAnt = 48; } } writeAntField (antfCols, rownr, i, stationName, antField, antFieldName, hbaOffsets, firstHbaOffset); - writeElements (antfCols, rownr, antField.AntPos(antFieldType), - antennaSet.positionIndex (setName, stationType), - setName == "HBA_ONE", - antField.Centre(antFieldType), - antField.Centre(antFieldName)); + diameter = writeElements (antfCols, rownr, + antField.AntPos(antFieldType), + antennaSet.positionIndex (setName, stationType), + addAnt, + antField.Centre(antFieldType), + antField.Centre(antFieldName)) + elemDiam; rownr++; } - LOG_DEBUG_STR ("Wrote " << rownr << " station field rows"); + // Keep station diameter. + diameters.push_back (diameter); } + LOG_DEBUG_STR ("Wrote " << rownr << " station field rows"); // Write the LOFAR_STATION subtable. writeStation (statTab, statCols, stationNames, stationIdMap.size()); - // Write the STATION_ID in the ANTENNA subtable. - writeAntenna (antTab, antNames, stationIdMap); + // Write the STATION_ID and DISH_DIAMETER into the ANTENNA subtable. + writeAntenna (antTab, antNames, stationIdMap, diameters); // Write the AntennaSet name into the OBSERVATION subtable. if (ms.keywordSet().isDefined ("OBSERVATION")) { Table obsTable (ms.keywordSet().asTable("OBSERVATION")); @@ -251,13 +274,13 @@ void BeamTables::writeAntField (MSAntennaFieldColumns& columns, int rownr, } } -void BeamTables::writeElements (MSAntennaFieldColumns& columns, - int rownr, - const AntField::AFArray& elemOffsets, - const vector<int16>& elemPresent, - bool addSkip, - const AntField::AFArray& stationCenter, - const AntField::AFArray& fieldCenter) +double BeamTables::writeElements (MSAntennaFieldColumns& columns, + int rownr, + const AntField::AFArray& elemOffsets, + const vector<int16>& posIndex, + int addAnt, + const AntField::AFArray& stationCenter, + const AntField::AFArray& fieldCenter) { double off0 = (AntField::getData(stationCenter)[0] - AntField::getData(fieldCenter)[0]); @@ -269,6 +292,7 @@ void BeamTables::writeElements (MSAntennaFieldColumns& columns, int nelem = elemOff.shape()[2]; Matrix<Double> offset(3,nelem); Matrix<Bool> flag(2,nelem, True); + Matrix<Int> rcus(2,nelem, -1); for (int i=0; i<nelem; ++i) { // The element offsets are given as [nelem,npol,xyz]. // Offsets are the same for the X and Y polarisation. @@ -277,30 +301,35 @@ void BeamTables::writeElements (MSAntennaFieldColumns& columns, offset(2,i) = elemOff(2,0,i) + off2; } // Clear the flag for the dipoles that are present. - // Normally the value in the elemPresent vector gives the element index, - // but not for HBA1 in the core stations. For those the skipped number - // of values has to be added. - // Note that elemPresent defines which elements are used for a mode. - // -1 means not used. - // If >=0, the value is normally equal to the vector's index. - // However, for HBA_ONE this is not the case. It has 48 -1 values, and - // thereafter value 0..47. SAS/MAC/BeamServer needs it this way. - // Therefore the code adds the nr of -1 values if value != index to get - // the proper flag index (which is the RCU number). + // The index in the posIndex vector gives the RCU used (if not -1). + // The value in the posIndex vector gives the element number. Bool* flagPtr = flag.data(); - int nskip = 0; - for (uint i=0; i<elemPresent.size(); ++i) { - if (elemPresent[i] < 0) { - nskip++; - } else { - int index = elemPresent[i]; - if (addSkip) index += nskip; - ASSERT (index < int(flag.size())); - flagPtr[index] = False; + Int * rcusPtr = rcus.data(); + for (uint i=0; i<posIndex.size(); ++i) { + if (posIndex[i] >= 0) { + int antNr = posIndex[i] + addAnt; + ASSERT (antNr < int(flag.size())); + flagPtr[antNr] = False; + rcusPtr[antNr] = i; } } columns.elementOffset().put (rownr, offset); + columns.elementRCU().put (rownr, rcus); columns.elementFlag().put (rownr, flag); + // Determine the station radius as the maximum distance of the used elements + // to the field center. Note that their offsets are wrt field center (0,0,0). + double radius = 0; + for (int i=0; i<nelem; ++i) { + if (! flag(0,i)) { + double dist = (offset(0,i) * offset(0,i) + + offset(1,i) * offset(1,i) + + offset(2,i) * offset(2,i)); + if (dist > radius) { + radius = dist; + } + } + } + return 2*sqrt(radius); } void BeamTables::writeObservation (Table& obsTable, @@ -349,18 +378,22 @@ void BeamTables::writeStation (MSStation& tab, MSStationColumns& columns, void BeamTables::writeAntenna (Table& antTable, const Vector<String>& antNames, - const map<string,int>& stationIdMap) + const map<string,int>& stationIdMap, + const vector<double>& diameters) { ASSERT (antTable.nrow() == antNames.size()); + ASSERT (antTable.nrow() == diameters.size()); // Add column if not existing yet. if (! antTable.tableDesc().isColumn ("LOFAR_STATION_ID")) { antTable.addColumn (ScalarColumnDesc<Int> ("LOFAR_STATION_ID")); } - // Write for each antenna the id in the LOFAR_STATION table. - ScalarColumn<Int> idCol (antTable, "LOFAR_STATION_ID"); + // Write for each antenna the id and diameter into the LOFAR_STATION table. + ScalarColumn<Int> idCol (antTable, "LOFAR_STATION_ID"); + ScalarColumn<double> dmCol (antTable, "DISH_DIAMETER"); for (uInt i=0; i<antTable.nrow(); ++i) { string stationName = antNames[i].substr(0,5); idCol.put (i, stationIdMap.find(stationName)->second); + dmCol.put (i, diameters[i]); } } diff --git a/LCS/MSLofar/src/CMakeLists.txt b/LCS/MSLofar/src/CMakeLists.txt index 3a3bd460e530fb2b6d5809fc435d9ed2715570ff..1d417871b56d1a165fa08ad85fc72285f82da027 100644 --- a/LCS/MSLofar/src/CMakeLists.txt +++ b/LCS/MSLofar/src/CMakeLists.txt @@ -20,8 +20,10 @@ lofar_add_library(mslofar MSLofar.cc # MeasurementSet.cc BeamTables.cc + FailedTileInfo.cc ) lofar_add_bin_program(versionmslofar versionmslofar.cc) lofar_add_bin_program(makebeamtables makebeamtables.cc) +lofar_add_bin_program(addfailedtileinfo addfailedtileinfo.cc) diff --git a/LCS/MSLofar/src/FailedTileInfo.cc b/LCS/MSLofar/src/FailedTileInfo.cc new file mode 100644 index 0000000000000000000000000000000000000000..f10cc6e12131a3616ca65ccbf7a07cd45afb860c --- /dev/null +++ b/LCS/MSLofar/src/FailedTileInfo.cc @@ -0,0 +1,279 @@ +//# FailedTileInfo.cc: Class to write failed tile info into the MS +//# Copyright (C) 2012 +//# ASTRON (Netherlands Institute for Radio Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands +//# +//# This file is part of the LOFAR software suite. +//# The LOFAR software suite is free software: you can redistribute it and/or +//# modify it under the terms of the GNU General Public License as published +//# by the Free Software Foundation, either version 3 of the License, or +//# (at your option) any later version. +//# +//# The LOFAR software suite is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License along +//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. +//# +//# $Id$ + +#include <lofar_config.h> +#include <MSLofar/FailedTileInfo.h> + +#include <tables/Tables/Table.h> +#include <tables/Tables/TableRecord.h> +#include <tables/Tables/ScalarColumn.h> +#include <tables/Tables/ArrayColumn.h> +#include <measures/TableMeasures/ScalarQuantColumn.h> +#include <measures/TableMeasures/ArrayQuantColumn.h> +#include <casa/Quanta/MVEpoch.h> +#include <casa/Quanta/MVTime.h> + +#include <Common/StringUtil.h> +#include <Common/StreamUtil.h> +#include <Common/LofarLogger.h> +#include <Common/LofarTypes.h> +#include <Common/lofar_vector.h> +#include <Common/lofar_map.h> +#include <Common/lofar_iostream.h> + +using namespace casa; + +namespace LOFAR { + + FailedTileInfo::FailedTileInfo (const string& station, const string& time, + const MVEpoch& epoch, const string& type, + int seqnr) + : itsStation (station), + itsTime (time), + itsEpoch (epoch), + itsType (type), + itsSeqNr (seqnr) + {} + + // Read the broken hardware file giving a map of antenna name to a vector + // of pairs of element and time. + map<string, FailedTileInfo::VectorFailed> FailedTileInfo::readFile + (const string& fileName, double startTime, double endTime) + { + map<string, FailedTileInfo::VectorFailed> brokenHardware; + fstream infile (fileName.c_str()); + ASSERTSTR (infile, "Unable to open file " << fileName); + int linenumber=0; + string station, name, date, time; + Quantity q; + // Read first line. + string line; + getline (infile, line); + while (infile) { + linenumber++; + // Skip leading and trailing whitespace. + uint st = lskipws (line, 0, line.size()); + if (st < line.size() && line[st] != '#') { // skip if only comment + bool valid = false; + istringstream istr(line); + istr >> station >> name >> date >> time; + if (!(station.empty() || name.empty() || + date.empty() || time.empty())) { + if (MVTime::read (q, date+'/'+time)) { + valid = true; + if (name.size() > 3) { + string type = name.substr(0,3); + if (type == "RCU" || type == "LBA" || type == "HBA") { + istringstream istr(name.substr(3)); + int seqnr; + istr >> seqnr; + // Only use the entry if the time is within the limits. + MVEpoch epoch(q); + if (epoch.get() >= startTime && epoch.get() < endTime) { + // Add the the vector for this station. + // Note that the vector is created if not existing yet. + brokenHardware[station].push_back + (FailedTileInfo(station, date+'/'+time.substr(0,8), + epoch, type, seqnr)); + } + } + } + } + } + if (!valid) { + LOG_WARN_STR("line " << linenumber << " in file " << fileName + << " is invalid. Skipping..."); + } + } + // Read next line. + getline (infile, line); + } + return brokenHardware; + } + + // Convert the info per station name to info per antennaId. + // Only keep the RCU entries or entries ith a matching station type + // (LBA or HBA). + vector<FailedTileInfo::VectorFailed> FailedTileInfo::antennaConvert + (const Table& ms, const map<string,FailedTileInfo::VectorFailed>& broken) + { + // Open ANTENNA table columns. + Table antTab (ms.keywordSet().asTable("ANTENNA")); + ROScalarColumn<String> nameCol(antTab, "NAME"); + // Size the vector (which creates empty elements). + vector<FailedTileInfo::VectorFailed> brokenAnt (antTab.nrow()); + for (uInt row=0; row<antTab.nrow(); ++row) { + // Get first 5 and next 3 characters of the station name giving + // proper station name and station type (LBA or HBA). + string name = nameCol(row); + string type = name.substr(5,3); + // Get the entry matching the station name proper. + map<string, FailedTileInfo::VectorFailed>::const_iterator iter = + broken.find(name.substr(0,5)); + if (iter != broken.end()) { + // Take all entries matching station type or RCU. + for (FailedTileInfo::VectorFailed::const_iterator fail = + iter->second.begin(); fail != iter->second.end(); ++fail) { + // Insert the info into the vector at the given row (=antId) + // if it is matching the station type. + if (fail->itsType == "RCU" || fail->itsType == type) { + brokenAnt[row].push_back (*fail); + } + } + } + } + return brokenAnt; + } + + // Write the failed tile info. + void FailedTileInfo::writeFailed + (Table& ms, + const vector<FailedTileInfo::VectorFailed>& brokenBefore, + const vector<FailedTileInfo::VectorFailed>& brokenDuring) + { + ASSERT (brokenBefore.size() == brokenDuring.size()); + // Open ANTENNA_FIELD table. + Table antFieldTab (ms.keywordSet().asTable("LOFAR_ANTENNA_FIELD")); + ROScalarColumn<Int> antIdCol(antFieldTab, "ANTENNA_ID"); + ArrayColumn<Bool> flagCol (antFieldTab, "ELEMENT_FLAG"); + ArrayColumn<Int> rcuCol (antFieldTab, "ELEMENT_RCU"); + // Define the vectors to hold the failures during the observation. + vector<Double> times; + vector<Int> tiles; + vector<Int> antFldIds; + vector<string> stations; + vector<string> timestrs; + // Loop through all rows in the AntennaField table. + for (uInt row=0; row<antFieldTab.nrow(); ++row) { + uInt antId = antIdCol(row); + ASSERT (antId < brokenBefore.size()); + // Process if the matching entry in the antenna info vector is not empty. + if (!brokenBefore[antId].empty() || !brokenDuring[antId].empty()) { + Matrix<Bool> flags (flagCol(row)); + Matrix<Int> rcuList (rcuCol(row)); + bool changed = false; + // Loop through all rcus in the vector. + for (FailedTileInfo::VectorFailed::const_iterator + iter = brokenBefore[antId].begin(); + iter != brokenBefore[antId].end(); ++iter) { + int elem = findTile (*iter, rcuList); + if (elem >= 0 && elem < int(flags.ncolumn()) && !flags(0,elem)) { + // Only set and report if not set yet. + flags(0,elem) = flags(1,elem) = True; + changed = true; + LOG_INFO_STR ("Flagged element " << elem + << " for antenna field " << row + << " (" << iter->itsType << ' ' << iter->itsSeqNr + << " on " << iter->itsStation + << " failed at " << iter->itsTime << ')'); + } + } + if (changed) { + flagCol.put (row, flags); + } + // Now loop through all entries for the tiles broken during the obs. + // Add to the vectors if its flag is not set yet. + for (FailedTileInfo::VectorFailed::const_iterator + iter = brokenDuring[antId].begin(); + iter != brokenDuring[antId].end(); ++iter) { + int elem = findTile (*iter, rcuList); + if (elem >= 0 && elem < int(flags.ncolumn()) && !flags(0,elem)) { + tiles.push_back (elem); + times.push_back (iter->itsEpoch.get()); + antFldIds.push_back (row); + stations.push_back (iter->itsStation); + timestrs.push_back (iter->itsTime); + } + } + } + } + // Now write the elements that failed during the observation. + // First sort the vectors on time, antfldid, index and make unique. + if (! times.empty()) { + Sort sort; + sort.sortKey (&(times[0]), TpDouble); + sort.sortKey (&(antFldIds[0]), TpInt); + sort.sortKey (&(tiles[0]), TpInt); + Vector<uInt> indexs, index; + sort.sort (indexs, times.size()); + sort.unique (index, indexs); + // Now write the sorted data into the ELEMENT_FAILURE table. + Table failedTab (ms.keywordSet().asTable("LOFAR_ELEMENT_FAILURE")); + ScalarColumn<Int> antFldIdCol (failedTab, "ANTENNA_FIELD_ID"); + ScalarColumn<Int> elemIdCol (failedTab, "ELEMENT_INDEX"); + ScalarQuantColumn<Double> timeCol (failedTab, "TIME"); + uInt row = failedTab.nrow(); + failedTab.addRow (index.size()); + for (uInt i=0; i<index.size(); ++i) { + int inx = indexs[index[i]]; + antFldIdCol.put (row, antFldIds[inx]); + elemIdCol.put (row, tiles[inx]); + timeCol.put (row, Quantity(times[inx], "d")); // MVEpoch gives days + LOG_INFO_STR ("Added failure for antenna field " << antFldIds[inx] + << " (tile " << tiles[inx] + << " on " << stations[inx] + << " at " << timestrs[inx] << ')'); + row++; + } + } + } + + int FailedTileInfo::findTile (const FailedTileInfo& fail, + const Matrix<Int>& rcus) + { + if (fail.itsType == "RCU") { + for (uInt i=0; i<rcus.ncolumn(); ++i) { + if (rcus(0,i) == fail.itsSeqNr || rcus(1,i) == fail.itsSeqNr) { + return i; + } + } + } else { + return fail.itsSeqNr/2; + } + return -1; + } + + void FailedTileInfo::failedTiles2MS + (const string& msName, const string& beforeName, const string& duringName) + { + ASSERT (!(msName.empty() || beforeName.empty() || duringName.empty())); + // Open the measurementset table. + Table ms(msName, Table::Update); + // Get the start and end time from the Observation subtable. + Table obsTab (ms.keywordSet().asTable ("OBSERVATION")); + ROArrayQuantColumn<Double> timeCol(obsTab, "TIME_RANGE"); + ASSERT (obsTab.nrow() > 0); + Vector<Quantity> times = timeCol(0); + ASSERT (times.size() > 1); + MVEpoch startTime (times[0]); + MVEpoch endTime (times[1]); + // Read the files containing the elements broken before and during the obs. + // Turn the results into a vector per station. + vector<FailedTileInfo::VectorFailed> before + (antennaConvert(ms, readFile(beforeName, 0., startTime.get()))); + vector<FailedTileInfo::VectorFailed> during + (antennaConvert(ms, readFile(duringName, startTime.get(), + endTime.get()))); + // Write the broken info into the MS. + writeFailed (ms, before, during); + } + +} // end namespace diff --git a/LCS/MSLofar/src/MSAntennaField.cc b/LCS/MSLofar/src/MSAntennaField.cc index 0c9d627e07741e65b582aa06d425752a1b11da38..0a19d4497dd995861ae155a436468ab253e1eebc 100644 --- a/LCS/MSLofar/src/MSAntennaField.cc +++ b/LCS/MSLofar/src/MSAntennaField.cc @@ -77,6 +77,9 @@ namespace LOFAR { addColumn (td, "ELEMENT_OFFSET", TpArrayDouble, "Position offsets of elements w.r.t. center of station field", "m", "POSITION", MPosition::ITRF, 2); + addColumn (td, "ELEMENT_RCU", TpArrayInt, + "RCU used for the elements (for X and Y)", + String(), String(), 0, 2); addColumn (td, "ELEMENT_FLAG", TpArrayBool, "T for inactive element receptors (for X and Y)", String(), String(), 0, 2); diff --git a/LCS/MSLofar/src/MSAntennaFieldColumns.cc b/LCS/MSLofar/src/MSAntennaFieldColumns.cc index 2f7f6e77adda6f603f987988aabf1e517b59f003..1b55b48cd515bf9862a4bc40784250ff315c19c7 100644 --- a/LCS/MSLofar/src/MSAntennaFieldColumns.cc +++ b/LCS/MSLofar/src/MSAntennaFieldColumns.cc @@ -51,6 +51,7 @@ namespace LOFAR { coordinateAxesQuant_p.attach (msAntennaField, "COORDINATE_AXES"); elementOffset_p.attach (msAntennaField, "ELEMENT_OFFSET"); elementOffsetQuant_p.attach (msAntennaField, "ELEMENT_OFFSET"); + elementRCU_p.attach (msAntennaField, "ELEMENT_RCU"); elementFlag_p.attach (msAntennaField, "ELEMENT_FLAG"); tileRotation_p.attach (msAntennaField, "TILE_ROTATION"); tileRotationQuant_p.attach (msAntennaField, "TILE_ROTATION"); @@ -84,6 +85,7 @@ namespace LOFAR { coordinateAxesQuant_p.attach (msAntennaField, "COORDINATE_AXES"); elementOffset_p.attach (msAntennaField, "ELEMENT_OFFSET"); elementOffsetQuant_p.attach (msAntennaField, "ELEMENT_OFFSET"); + elementRCU_p.attach (msAntennaField, "ELEMENT_RCU"); elementFlag_p.attach (msAntennaField, "ELEMENT_FLAG"); tileRotation_p.attach (msAntennaField, "TILE_ROTATION"); tileRotationQuant_p.attach (msAntennaField, "TILE_ROTATION"); diff --git a/LCS/MSLofar/src/addfailedtileinfo.cc b/LCS/MSLofar/src/addfailedtileinfo.cc new file mode 100644 index 0000000000000000000000000000000000000000..935d6485b80b7e2fb76542bb8e8988679681242c --- /dev/null +++ b/LCS/MSLofar/src/addfailedtileinfo.cc @@ -0,0 +1,66 @@ +//# addfailedtileinfo.cc: Program to add failed tile info to an MS +//# Copyright (C) 2012 +//# ASTRON (Netherlands Institute for Radio Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands +//# +//# This file is part of the LOFAR software suite. +//# The LOFAR software suite is free software: you can redistribute it and/or +//# modify it under the terms of the GNU General Public License as published +//# by the Free Software Foundation, either version 3 of the License, or +//# (at your option) any later version. +//# +//# The LOFAR software suite is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License along +//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. +//# +//# $Id$ +//# +//# @author Ger van Diepen + +#include <lofar_config.h> +#include <MSLofar/FailedTileInfo.h> +#include <MSLofar/Package__Version.h> +#include <Common/InputParSet.h> +#include <Common/SystemUtil.h> +#include <Common/LofarLogger.h> + +using namespace LOFAR; + +int main (int argc, char* argv[]) +{ + TEST_SHOW_VERSION (argc, argv, MSLofar); + INIT_LOGGER(basename(string(argv[0]))); + try { + InputParSet inputs; + // Define the input parameters. + inputs.setVersion("2012Oct29-GvD"); + inputs.create ("ms", "", + "Name of MeasurementSet", + "string"); + inputs.create ("BrokenTileFile", "brokenTiles.txt", + "File containing tiles broken before the observation", + "string"); + inputs.create ("FailedTileFile", "failedTiles.txt", + "File containing tiles failing during the observation", + "string"); + inputs.readArguments (argc, argv); + string msName = inputs.getString("ms"); + string brokenName = inputs.getString("BrokenTileFile"); + string failedName = inputs.getString("FailedTileFile"); + ASSERT (! msName.empty()); + ASSERT (! brokenName.empty()); + ASSERT (! failedName.empty()); + FailedTileInfo::failedTiles2MS (msName, brokenName, failedName); + } catch (Exception& x) { + cerr << "Unexpected LOFAR exception: " << x << endl; + return 1; + } catch (std::exception& x) { + cerr << "Unexpected exception: " << x.what() << endl; + return 1; + } + return 0; +} diff --git a/LCS/MSLofar/src/makebeamtables.cc b/LCS/MSLofar/src/makebeamtables.cc index 7f44dbb29a1fc69bb2a365adb67d399c3cee3b4d..4f20a3dfca07164cc4008cc2b8abbf39fce6001c 100644 --- a/LCS/MSLofar/src/makebeamtables.cc +++ b/LCS/MSLofar/src/makebeamtables.cc @@ -23,7 +23,10 @@ #include <lofar_config.h> #include <MSLofar/BeamTables.h> -#include <casa/Inputs.h> +#include <MSLofar/Package__Version.h> +#include <Common/InputParSet.h> +#include <Common/SystemUtil.h> +#include <Common/LofarLogger.h> #include <tables/Tables/ScalarColumn.h> #include <ms/MeasurementSets/MeasurementSet.h> @@ -32,10 +35,12 @@ using namespace casa; int main (int argc, char* argv[]) { + TEST_SHOW_VERSION (argc, argv, MSLofar); + INIT_LOGGER(basename(string(argv[0]))); try { - Input inputs(1); + InputParSet inputs; // define the input structure - inputs.version("2011Mar31-GvD"); + inputs.setVersion("2012Oct29-GvD"); inputs.create ("ms", "", "Name of MeasurementSet", "string"); @@ -52,7 +57,7 @@ int main (int argc, char* argv[]) "Directory where the iHBADelta.conf files reside", "string"); inputs.create ("overwrite", "false", - "Overwriting existing beam subtables?" + "Overwriting existing beam subtables?", "bool"); inputs.readArguments (argc, argv); String msName = inputs.getString("ms"); @@ -74,7 +79,7 @@ int main (int argc, char* argv[]) } ASSERTSTR (!antSet.empty(), "No LOFAR_ANTENNA_SET found in OBSERVATION" " subtable of " << msName); - BeamTables::create (ms, overwrite); + BeamTables::create (ms, overwrite); BeamTables::fill (ms, antSet, antSetFile, antFieldDir, hbaDeltaDir, true); } catch (Exception& x) { cerr << "Unexpected LOFAR exception: " << x << endl; diff --git a/LCS/MSLofar/test/tBeamTables.cc b/LCS/MSLofar/test/tBeamTables.cc index f26dc18d9f6aee38074324a3ceab56bf53af091d..9d4088b2d860373f01d34057ffa04e072cf20763 100644 --- a/LCS/MSLofar/test/tBeamTables.cc +++ b/LCS/MSLofar/test/tBeamTables.cc @@ -24,12 +24,18 @@ #include <lofar_config.h> #include <MSLofar/BeamTables.h> +#include <MSLofar/FailedTileInfo.h> #include <tables/Tables/SetupNewTab.h> #include <tables/Tables/Table.h> #include <tables/Tables/ScaColDesc.h> #include <tables/Tables/ScalarColumn.h> #include <tables/Tables/TableRow.h> +#include <tables/Tables/ArrayColumn.h> +#include <tables/Tables/ArrColDesc.h> +#include <measures/TableMeasures/TableQuantumDesc.h> +#include <measures/TableMeasures/ArrayQuantColumn.h> +#include <casa/Quanta/MVTime.h> #include <casa/OS/Path.h> using namespace LOFAR; @@ -51,51 +57,86 @@ void testBM (const string& antSet, const String& suffixa1 = String(), bool makeObs = false) { - cout << endl << "Test " << antSet << " ....." << endl; - // Make a simple table tBeamTables_tmp.ms with ANTENNA subtable. - // The ANTENNA table only needs column NAME. - SetupNewTable stab1("tBeamTables_tmp.ms", TableDesc(), Table::New); - Table tab1(stab1); - TableDesc td; - td.addColumn (ScalarColumnDesc<String>("NAME")); - SetupNewTable stab2("tBeamTables_tmp.ms/ANTENNA", td, Table::New); - Table antTab(stab2, 3); - // Write a core, remote, and international station into the table. - // Add a possible suffix (e.g. HBA0). - ScalarColumn<String> nameCol(antTab, "NAME"); - nameCol.put (0, "CS001"+suffix1+suffixa0); - nameCol.put (1, "RS106"+suffix1); - nameCol.put (2, "DE601"+suffix1); - // Write core station more if a second suffix is given. - if (! suffixa1.empty()) { - antTab.addRow (1); - nameCol.put (3, "CS001"+suffix1+suffixa1); - } - antTab.flush(); - tab1.rwKeywordSet().defineTable ("ANTENNA", antTab); - // Optionally add OBSERVATION table. - if (makeObs) { - SetupNewTable stab3("tBeamTables_tmp.ms/OBSERVATION", - TableDesc(), Table::New); - Table obsTab(stab3, 3); - tab1.rwKeywordSet().defineTable ("OBSERVATION", obsTab); - } - - // Get current directory to get absolute path name. - string pwd = Path(".").absoluteName(); - // Now add the beam table info. - BeamTables::create (tab1, false); - BeamTables::fill (tab1, antSet, pwd+"/tBeamTables.in_antset", - pwd+"/tBeamTables.in_af", pwd+"/tBeamTables.in_hd", - true); + { + cout << endl << "Test " << antSet << " ....." << endl; + // Make a simple table tBeamTables_tmp.ms with ANTENNA subtable. + // The ANTENNA table only needs columns NAME and DISH_DIAMETER. + SetupNewTable stab1("tBeamTables_tmp.ms", TableDesc(), Table::New); + Table tab1(stab1); + TableDesc td; + td.addColumn (ScalarColumnDesc<String>("NAME")); + td.addColumn (ScalarColumnDesc<double>("DISH_DIAMETER")); + SetupNewTable stab2("tBeamTables_tmp.ms/ANTENNA", td, Table::New); + Table antTab(stab2, 3); + // Write a core, remote, and international station into the table. + // Add a possible suffix (e.g. HBA0). + ScalarColumn<String> nameCol(antTab, "NAME"); + nameCol.put (0, "CS001"+suffix1+suffixa0); + nameCol.put (1, "RS106"+suffix1); + nameCol.put (2, "DE601"+suffix1); + // Write core station more if a second suffix is given. + if (! suffixa1.empty()) { + antTab.addRow (1); + nameCol.put (3, "CS001"+suffix1+suffixa1); + } + antTab.flush(); + tab1.rwKeywordSet().defineTable ("ANTENNA", antTab); + // Optionally add OBSERVATION table. + if (makeObs) { + TableDesc td; + td.addColumn (ArrayColumnDesc<Double> ("TIME_RANGE", IPosition(1,2))); + TableQuantumDesc tq(td, "TIME_RANGE", Unit("s")); + tq.write (td); + SetupNewTable stab3("tBeamTables_tmp.ms/OBSERVATION", + td, Table::New); + Table obsTab(stab3, 1); + ArrayQuantColumn<double> timeCol (obsTab, "TIME_RANGE"); + Vector<Quantity> times(2); + MVTime::read (times[0], "12-Oct-2012/12:00:00"); + MVTime::read (times[1], "12-Oct-2012/15:00:00"); + timeCol.put (0, times); + tab1.rwKeywordSet().defineTable ("OBSERVATION", obsTab); + } + // Get current directory to get absolute path name. + string pwd = Path(".").absoluteName(); + // Now add the beam table info. + BeamTables::create (tab1, false); + BeamTables::fill (tab1, antSet, pwd+"/tBeamTables.in_antset", + pwd+"/tBeamTables.in_af", pwd+"/tBeamTables.in_hd", + true); + } // Now print all the output (which is checked by assay). + showTab ("tBeamTables_tmp.ms/ANTENNA"); showTab ("tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD"); showTab ("tBeamTables_tmp.ms/LOFAR_ELEMENT_FAILURE"); showTab ("tBeamTables_tmp.ms/LOFAR_STATION"); if (makeObs) { showTab ("tBeamTables_tmp.ms/OBSERVATION"); } + + // Update for broken/failed tiles if an OBSERVATION table was written + // (because FailedTileInfo needs it). + // First with empty files; thereafter with some broken info. + if (makeObs) { + String name[2]; + name[0] = "_empty"; + name[1] = "_filled"; + for (int i=0; i<2; ++i) { + FailedTileInfo::failedTiles2MS ("tBeamTables_tmp.ms", + "tBeamTables.in_before" + name[i], + "tBeamTables.in_during" + name[i]); + // Show the resulting flags. + Table tab("tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD"); + cout << endl << "ELEMENT_FLAG after FailedTileInfo " + << name[i] << ':' << endl; + ROArrayColumn<Bool> flagCol (tab, "ELEMENT_FLAG"); + for (uInt i=0; i<tab.nrow(); ++i) { + cout << flagCol(i); + } + showTab ("tBeamTables_tmp.ms/LOFAR_ELEMENT_FAILURE"); + } + } } diff --git a/CEP/Pipeline/recipes/sip/master/deprecated/qcheck/__init__.py b/LCS/MSLofar/test/tBeamTables.in_before_empty similarity index 100% rename from CEP/Pipeline/recipes/sip/master/deprecated/qcheck/__init__.py rename to LCS/MSLofar/test/tBeamTables.in_before_empty diff --git a/LCS/MSLofar/test/tBeamTables.in_before_filled b/LCS/MSLofar/test/tBeamTables.in_before_filled new file mode 100644 index 0000000000000000000000000000000000000000..91211003c59518ffbfb2f385a8f739cfc71542dd --- /dev/null +++ b/LCS/MSLofar/test/tBeamTables.in_before_filled @@ -0,0 +1,12 @@ +CS101 RCU66 2011-May-20 10:00:05 +CS001 RCU600 2011-May-20 10:00:05 +CS001 RCU76 2012-May-20 10:00:05 +CS001 RCU65 2013-May-20 10:00:05 +CS001 RCU6 2011-May-20 10:00:05 +CS001 LBA3 2011-May-20 10:00:05 +CS001 LBA100 2011-May-20 10:00:05 +CS001 HBA10 2011-May-20 10:00:05 +CS001 HBA10 2011-May-20 10:00:05 +RS106 HBA9 2011-May-20 10:00:05 +RS106 HBA12 2011-May-20 10:00:05 +DE601 HBA23 2011-May-20 10:00:05 diff --git a/MAC/Deployment/data/PVSS/License/test_shield.txt b/LCS/MSLofar/test/tBeamTables.in_during_empty similarity index 100% rename from MAC/Deployment/data/PVSS/License/test_shield.txt rename to LCS/MSLofar/test/tBeamTables.in_during_empty diff --git a/LCS/MSLofar/test/tBeamTables.in_during_filled b/LCS/MSLofar/test/tBeamTables.in_during_filled new file mode 100644 index 0000000000000000000000000000000000000000..bbc59d19f0e7ed809c642a94ba6f6ed6462c17f5 --- /dev/null +++ b/LCS/MSLofar/test/tBeamTables.in_during_filled @@ -0,0 +1,27 @@ +# Non existing station. +CS101 RCU66 2012-Oct-12 12:00:05 +# Non existing RCU +CS001 RCU600 2012-Oct-12 12:00:05 +# Outside observation times +CS001 RCU80 2012-May-12 12:00:05 +# Outside observation times +CS001 RCU65 2013-May-20 12:00:05 +# Non-HBA entries +CS001 LBA3 2012-Oct-12 12:00:05 +CS001 LBA100 2012-Oct-12 12:00:05 + +# Entries that were already flagged. +CS001 RCU6 2012-Oct-12 12:00:05 +CS001 HBA10 2012-Oct-12 12:00:05 +RS106 HBA9 2012-Oct-12 12:00:05 +RS106 HBA12 2012-Oct-12 12:00:05 +DE601 HBA23 2012-Oct-12 12:00:05 + +# Correct entries. +CS001 RCU3 2012-Oct-12 12:00:05 +CS001 RCU88 2012-Oct-12 12:00:05 +CS001 HBA22 2012-Oct-12 12:00:05 +CS001 HBA22 2012-Oct-12 12:00:05 # duplicate +RS106 HBA24 2012-Oct-12 12:10:05 +RS106 HBA10 2012-Oct-12 12:00:05 +DE601 HBA43 2012-Oct-12 12:00:15 diff --git a/LCS/MSLofar/test/tBeamTables.stdout b/LCS/MSLofar/test/tBeamTables.stdout index 6f02b3a3435d15cf91f4ab656b0ad4c32722158a..9f898e5afb9e0e23996361582e082c663d50b187 100644 --- a/LCS/MSLofar/test/tBeamTables.stdout +++ b/LCS/MSLofar/test/tBeamTables.stdout @@ -1,6 +1,17 @@ Test LBA_OUTER ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001LBA" + DISH_DIAMETER: Double 85.9589 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106LBA" + DISH_DIAMETER: Double 85.9578 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601LBA" + DISH_DIAMETER: Double 68.4069 + LOFAR_STATION_ID: Int 2 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "LBA" @@ -18,6 +29,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) 0, -0.243, 2.105, 2.363, 0.243, -2.105, -2.363, 5.784, 4.398, 0.954001, -2.937, -5.454, -5.418, -2.848, 1.056, 4.464, 7.669, 9.615, 9.9, 5.379, 2.445, -1.838, -5.348, -8.547, -9.695, -8.074, -4.693, 0.039, 4.57, 12.525, 14.313, 14.115, 11.17, 11.35, 4.35, -0.687999, -5.927, -7.719, -10.726, -13.161, -13.579, -11.373, -10.491, -2.214, 1.757, 7.096, 64.587, 6.207, 11.405, 14.457, 20.337, 13.262, 9.704, -2.401, -13.787, -19.53, -16.092, -12.457, -3.007, 2.275, 14.488, 22.972, 25.092, 26.419, 16.011, 9.587, -3.813, -16.284, -22.799, -24.699, -22.397, -8.27, 2.319, 15.331, 25.967, 30.704, 30.482, 23.593, 13.316, 4.116, -10.203, -25.852, -30.56, -34.573, -31.083, -20.428, -13.823, -15.007, 24.092, 37.912, 41.232, 33.938, -6.839, -24.575, -37.626, -29.4 0, 1.538, 0.814, -0.814, -1.538, -0.814, 0.814, -0.365, -2.516, -3.489, -2.83, -0.846, 1.533, 3.196, 3.362, 1.956, 2.726, 0.756, -2.281, -5.436, -6.063, -5.849, -4.206, -1.125, 1.73, 4.081, 5.096, 5.428, 4.528, 3.442, 1.315, -0.546, -4.834, -6.638, -7.806, -7.823, -8.001, -6.194, -3.815, 0.267, 1.946, 4.73, 7.115, 8.511, 8.185, 7.163, 0.002, -39.233, 7.65, 7.65, -1.312, -9.591, -11.428, -10.77, -6.033, -2.399, 5.811, 9.993, 11.271, 14.719, 11.367, 5.074, 1.408, -3.671, -11.604, -14.057, -15.316, -10.539, -6.182, 0.878, 10.322, 15.921, 20.616, 15.538, 8.922, 4.779, -6.553, -16.166, -19.596, -18.076, -19.002, -11.648, -6.799, 2.703, 6.972, 16.936, 17.224, 20.993, 19.068, 5.309, -6.767, -14.946, -23.973, -14.794, -8.133, 16.827] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -42,6 +58,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) 0, -0.243, 2.105, 2.363, 0.243, -2.105, -2.363, 2.49, -1.45, -4.71, -5.767, -4.125, -0.553001, 3.277, 5.575, 5.264, 8.094, 6.174, 1.789, -5.296, -7.771, -9.698, -9.088, -6.164, -2.503, 1.857, 5.148, 8.125, 9.16, 11.711, 9.473, 6.591, -1.358, -3.958, -9.375, -12.043, -15.057, -13.3, -11.324, -6.506, -4.219, 1.095, 5.12, 11.548, 13.145, 14.419, 17.674, 57.565, 17.408, 19.009, 8.711, -7.364, -11.973, -17.343, -16.244, -13.831, 0.234999, 8.386, 15.254, 23.173, 24.576, 19.631, 15.269, 8.381, -8.928, -15.961, -24.872, -24.282, -21.194, -11.649, 3.662, 19.436, 32.003, 31.247, 26.949, 23.246, 6.208, -11.761, -22.276, -24.833, -33.729, -30.959, -26.187, -14.105, -5.898, 14.571, 18.468, 23.475, 41.115, 27.821, 11.529, -4.511, -39.389, -34.986, -31.887, 9.701 0, 1.538, 0.814, -0.814, -1.538, -0.814, 0.814, -3.287, -3.287, -1.749, 0.607, 2.679, 3.498, 2.68, 0.607, -1.749, -3.227, -4.983, -6.208, -4.851, -3.469, -1.056, 1.439, 4.27, 5.902, 5.845, 4.356, 1.89, -0.901, -5.626, -7.351, -7.898, -7.8, -8.534, -5.122, -2.378, 0.42, 2.034, 4.512, 7.279, 8.099, 7.874, 8.232, 4.205, 1.922, -1.353, 33.182, -13.748, -3.533, -5.2, -11.565, -10.616, -9.321, -2.48, 5.403, 9.818, 10.831, 10.32, 5.609, 3.939, -3.908, -10.756, -13.203, -15.716, -12.826, -10.183, -3.31, 5.18, 10.271, 13.794, 15.861, 10.12, 5.991, -2.9, -11.036, -15.08, -18.949, -18.572, -14.168, -8.611, -1.119, 10.014, 14.291, 19.827, 19.425, 17.115, 13.61, 15.584, -6.441, -18.83, -24.893, -23.79, -4.705, 8.209, 17.679, 21.975] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -66,6 +87,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -12.31, -5.631, -12.058, -6.449, 19.175, 23.908, 21.431, 25.765, -17.357, -23.938, -26.191, -24.343, 4.375, 2.384, 5.27, 9.094, 5.674, 1.819, 10.084, 7.012, -9.445, -18.025, -13.61, -22.828, -13.503, -16.217, -16.395, -20.226, 6.202, 8.834, -0.605998, 3.514, 13.911, 19.696, 27.355, 22.016, 2.949, 8.433, 4.213, 7.903, -12.226, -2.335, -9.405, 1.091, -3.563, -2.727, -8.349, -6.723, 17.569, -2.772, 28.513, 19.9, -23.675, -6.744, 27.458, 7.756, -19.124, -17.05, -19.827, 13.069, -0.397999, -13.234, -2.025, -0.674, 13.951, -6.971, 13.371, 7.401, -24.018, -25.785, -4.952, -10.591, 0.178001, 15.125, 13.718, 27.602, -9.917, -5.396, -17.64, 6.024, 2.431, 21.652, 9.68, -3.355, -9.262, -0.348999, 22.425, 15.42, -0.99, 11.894, -8.855, -24.628, 13.018, -8.065, -11.836, 12.299 5.535, 8.142, 7.964, 10.284, -5.68, -3.276, -10.88, -9.621, 8.085, 6.985, 9.229, 11.473, -1.331, 2.185, 3.164, 1.104, 5.37, 7.64, 8.765, 11.181, -11.56, -9.361, -16.577, -11.084, 0.767, 2.91, -1.051, -1.674, -12.724, -14.714, -16.087, -19.088, 9.007, 6.705, 10.221, 12.866, -4.217, -3.499, -6.697, -6.741, 14.983, 15.51, 19.548, 19.192, -4.02, -6.557, -3.81, -7.072, -1.331, -12.66, -2.374, 4.486, -4.376, -19.139, 4.194, -1.299, 15.453, -5.966, 4.111, -18.369, -10.689, -6.468, 12.77, 4.372, -4.096, 2.891, -12.73, -9.367, 1.053, 2.96, -0.409, 12.071, -8.172, 3.596, -6.315, 1.905, 0.824, -9.64, 10.507, 14.97, 10.596, -0.663, 6.355, 2.535, -15.07, -3.251, -15.458, -11.122, 6.54, 17.818, 4.849, -6.284, 12.141, -1.191, -3.728, 1.664] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -90,6 +116,17 @@ Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) Test LBA_INNER ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001LBA" + DISH_DIAMETER: Double 32.2517 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106LBA" + DISH_DIAMETER: Double 32.2538 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601LBA" + DISH_DIAMETER: Double 68.4069 + LOFAR_STATION_ID: Int 2 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "LBA" @@ -107,6 +144,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) 0, -0.243, 2.105, 2.363, 0.243, -2.105, -2.363, 5.784, 4.398, 0.954001, -2.937, -5.454, -5.418, -2.848, 1.056, 4.464, 7.669, 9.615, 9.9, 5.379, 2.445, -1.838, -5.348, -8.547, -9.695, -8.074, -4.693, 0.039, 4.57, 12.525, 14.313, 14.115, 11.17, 11.35, 4.35, -0.687999, -5.927, -7.719, -10.726, -13.161, -13.579, -11.373, -10.491, -2.214, 1.757, 7.096, 64.587, 6.207, 11.405, 14.457, 20.337, 13.262, 9.704, -2.401, -13.787, -19.53, -16.092, -12.457, -3.007, 2.275, 14.488, 22.972, 25.092, 26.419, 16.011, 9.587, -3.813, -16.284, -22.799, -24.699, -22.397, -8.27, 2.319, 15.331, 25.967, 30.704, 30.482, 23.593, 13.316, 4.116, -10.203, -25.852, -30.56, -34.573, -31.083, -20.428, -13.823, -15.007, 24.092, 37.912, 41.232, 33.938, -6.839, -24.575, -37.626, -29.4 0, 1.538, 0.814, -0.814, -1.538, -0.814, 0.814, -0.365, -2.516, -3.489, -2.83, -0.846, 1.533, 3.196, 3.362, 1.956, 2.726, 0.756, -2.281, -5.436, -6.063, -5.849, -4.206, -1.125, 1.73, 4.081, 5.096, 5.428, 4.528, 3.442, 1.315, -0.546, -4.834, -6.638, -7.806, -7.823, -8.001, -6.194, -3.815, 0.267, 1.946, 4.73, 7.115, 8.511, 8.185, 7.163, 0.002, -39.233, 7.65, 7.65, -1.312, -9.591, -11.428, -10.77, -6.033, -2.399, 5.811, 9.993, 11.271, 14.719, 11.367, 5.074, 1.408, -3.671, -11.604, -14.057, -15.316, -10.539, -6.182, 0.878, 10.322, 15.921, 20.616, 15.538, 8.922, 4.779, -6.553, -16.166, -19.596, -18.076, -19.002, -11.648, -6.799, 2.703, 6.972, 16.936, 17.224, 20.993, 19.068, 5.309, -6.767, -14.946, -23.973, -14.794, -8.133, 16.827] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -131,6 +173,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) 0, -0.243, 2.105, 2.363, 0.243, -2.105, -2.363, 2.49, -1.45, -4.71, -5.767, -4.125, -0.553001, 3.277, 5.575, 5.264, 8.094, 6.174, 1.789, -5.296, -7.771, -9.698, -9.088, -6.164, -2.503, 1.857, 5.148, 8.125, 9.16, 11.711, 9.473, 6.591, -1.358, -3.958, -9.375, -12.043, -15.057, -13.3, -11.324, -6.506, -4.219, 1.095, 5.12, 11.548, 13.145, 14.419, 17.674, 57.565, 17.408, 19.009, 8.711, -7.364, -11.973, -17.343, -16.244, -13.831, 0.234999, 8.386, 15.254, 23.173, 24.576, 19.631, 15.269, 8.381, -8.928, -15.961, -24.872, -24.282, -21.194, -11.649, 3.662, 19.436, 32.003, 31.247, 26.949, 23.246, 6.208, -11.761, -22.276, -24.833, -33.729, -30.959, -26.187, -14.105, -5.898, 14.571, 18.468, 23.475, 41.115, 27.821, 11.529, -4.511, -39.389, -34.986, -31.887, 9.701 0, 1.538, 0.814, -0.814, -1.538, -0.814, 0.814, -3.287, -3.287, -1.749, 0.607, 2.679, 3.498, 2.68, 0.607, -1.749, -3.227, -4.983, -6.208, -4.851, -3.469, -1.056, 1.439, 4.27, 5.902, 5.845, 4.356, 1.89, -0.901, -5.626, -7.351, -7.898, -7.8, -8.534, -5.122, -2.378, 0.42, 2.034, 4.512, 7.279, 8.099, 7.874, 8.232, 4.205, 1.922, -1.353, 33.182, -13.748, -3.533, -5.2, -11.565, -10.616, -9.321, -2.48, 5.403, 9.818, 10.831, 10.32, 5.609, 3.939, -3.908, -10.756, -13.203, -15.716, -12.826, -10.183, -3.31, 5.18, 10.271, 13.794, 15.861, 10.12, 5.991, -2.9, -11.036, -15.08, -18.949, -18.572, -14.168, -8.611, -1.119, 10.014, 14.291, 19.827, 19.425, 17.115, 13.61, 15.584, -6.441, -18.83, -24.893, -23.79, -4.705, 8.209, 17.679, 21.975] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -155,6 +202,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -12.31, -5.631, -12.058, -6.449, 19.175, 23.908, 21.431, 25.765, -17.357, -23.938, -26.191, -24.343, 4.375, 2.384, 5.27, 9.094, 5.674, 1.819, 10.084, 7.012, -9.445, -18.025, -13.61, -22.828, -13.503, -16.217, -16.395, -20.226, 6.202, 8.834, -0.605998, 3.514, 13.911, 19.696, 27.355, 22.016, 2.949, 8.433, 4.213, 7.903, -12.226, -2.335, -9.405, 1.091, -3.563, -2.727, -8.349, -6.723, 17.569, -2.772, 28.513, 19.9, -23.675, -6.744, 27.458, 7.756, -19.124, -17.05, -19.827, 13.069, -0.397999, -13.234, -2.025, -0.674, 13.951, -6.971, 13.371, 7.401, -24.018, -25.785, -4.952, -10.591, 0.178001, 15.125, 13.718, 27.602, -9.917, -5.396, -17.64, 6.024, 2.431, 21.652, 9.68, -3.355, -9.262, -0.348999, 22.425, 15.42, -0.99, 11.894, -8.855, -24.628, 13.018, -8.065, -11.836, 12.299 5.535, 8.142, 7.964, 10.284, -5.68, -3.276, -10.88, -9.621, 8.085, 6.985, 9.229, 11.473, -1.331, 2.185, 3.164, 1.104, 5.37, 7.64, 8.765, 11.181, -11.56, -9.361, -16.577, -11.084, 0.767, 2.91, -1.051, -1.674, -12.724, -14.714, -16.087, -19.088, 9.007, 6.705, 10.221, 12.866, -4.217, -3.499, -6.697, -6.741, 14.983, 15.51, 19.548, 19.192, -4.02, -6.557, -3.81, -7.072, -1.331, -12.66, -2.374, 4.486, -4.376, -19.139, 4.194, -1.299, 15.453, -5.966, 4.111, -18.369, -10.689, -6.468, 12.77, 4.372, -4.096, 2.891, -12.73, -9.367, 1.053, 2.96, -0.409, 12.071, -8.172, 3.596, -6.315, 1.905, 0.824, -9.64, 10.507, 14.97, 10.596, -0.663, 6.355, 2.535, -15.07, -3.251, -15.458, -11.122, 6.54, 17.818, 4.849, -6.284, 12.141, -1.191, -3.728, 1.664] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -179,6 +231,17 @@ Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) Test HBA_JOINED ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001HBA" + DISH_DIAMETER: Double 160.262 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106HBA" + DISH_DIAMETER: Double 44.2208 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601HBA" + DISH_DIAMETER: Double 65.2905 + LOFAR_STATION_ID: Int 2 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "HBA0" @@ -196,6 +259,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.363, -6.491, -1.62, 3.251, 8.121, 12.992, -12.993, -8.122, -3.251, 1.62, 6.491, 11.362, -9.753, -4.881, -0.011, 4.86, -6.512, -1.641, -80.217, -75.346, -86.718, -81.847, -76.977, -72.106, -93.22, -88.349, -83.478, -78.607, -73.737, -68.866, -94.85, -89.979, -85.109, -80.238, -75.367, -70.496, -91.61, -86.739, -81.869, -76.998, -88.37, -83.499 7.725, 6.463, 6.151, 4.888, 3.625, 2.362, 4.577, 3.313, 2.051, 0.787, -0.476, -1.739, 1.739, 0.476, -0.787, -2.05, -3.313, -4.576, -2.361, -3.624, -4.887, -6.15, -6.462, -7.725, -47.289, -48.551, -48.863, -50.126, -51.389, -52.652, -50.437, -51.701, -52.963, -54.227, -55.49, -56.753, -53.275, -54.538, -55.801, -57.064, -58.327, -59.59, -57.375, -58.638, -59.901, -61.164, -61.476, -62.739] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -224,6 +292,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 83.499, 88.37, 76.998, 81.869, 86.739, 91.61, 70.495, 75.367, 80.238, 85.109, 89.979, 94.85, 68.865, 73.736, 78.607, 83.478, 88.349, 93.22, 72.105, 76.977, 81.847, 86.718, 75.346, 80.217, 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.362, -6.491, -1.62, 3.251, 8.121, 12.992, -12.992, -8.121, -3.251, 1.62, 6.491, 11.362, -9.752, -4.881, -0.011, 4.86, -6.512, -1.641 62.739, 61.477, 61.165, 59.902, 58.639, 57.376, 59.591, 58.327, 57.065, 55.801, 54.538, 53.275, 56.753, 55.49, 54.227, 52.964, 51.701, 50.438, 52.653, 51.39, 50.127, 48.864, 48.552, 47.289, 7.72501, 6.46301, 6.15101, 4.88801, 3.62501, 2.36201, 4.57701, 3.31301, 2.05101, 0.78701, -0.47599, -1.73899, 1.73901, 0.47601, -0.78699, -2.04999, -3.31299, -4.57599, -2.36099, -3.62399, -4.88699, -6.14999, -6.46199, -7.72499] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -252,6 +325,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 2.489, 6.915, 11.34, 15.765, -0.119001, 4.307, 8.732, 13.157, -11.577, -7.151, -2.726, 1.699, 6.125, 10.549, 14.975, 19.4, -14.185, -9.76, -5.334, -0.909, 3.517, 7.942, 12.368, 16.793, -16.793, -12.368, -7.942, -3.517, 0.909, 5.334, 9.76, 14.185, -19.4, -14.975, -10.549, -6.125, -1.699, 2.726, 7.151, 11.577, -13.157, -8.732, -4.307, 0.119001, -15.765, -11.34, -6.915, -2.489 11.533, 9.707, 7.882, 6.057, 9.02, 7.195, 5.37, 3.544, 10.158, 8.333, 6.507, 4.682, 2.856, 1.031, -0.794, -2.62, 7.645, 5.82, 3.995, 2.169, 0.344, -1.482, -3.307, -5.133, 5.133, 3.307, 1.482, -0.344, -2.169, -3.995, -5.82, -7.645, 2.62, 0.794, -1.031, -2.856, -4.682, -6.507, -8.333, -10.158, -3.544, -5.37, -7.195, -9.02, -6.057, -7.882, -9.707, -11.533] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -280,6 +358,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -14.584, -9.512, -4.44, 0.633001, 5.705, -18.849, -13.777, -8.704, -3.632, 1.44, 6.512, 11.584, -23.114, -18.041, -12.969, -7.897, -2.825, 2.247, 7.319, 12.391, 17.463, -22.306, -17.234, -12.162, -7.09, -2.018, 3.054, 8.126, 13.198, 18.271, -21.499, -16.427, -11.355, -6.283, -1.211, 3.861, 8.934, 14.006, 19.078, -20.692, -15.62, -10.548, -5.476, -0.403, 4.669, 9.741, 14.813, 19.885, -19.885, -14.813, -9.74, -4.668, 0.403999, 5.476, 10.548, 15.62, 20.692, -19.077, -14.005, -8.933, -3.861, 1.211, 6.283, 11.355, 16.427, 21.499, -18.27, -13.198, -8.126, -3.054, 2.018, 7.09, 12.162, 17.235, 22.307, -17.463, -12.391, -7.319, -2.247, 2.825, 7.898, 12.97, 18.042, 23.114, -11.584, -6.512, -1.439, 3.633, 8.705, 13.777, 18.849, -5.704, -0.632002, 4.44, 9.512, 14.584 -15.823, -16.636, -17.448, -18.261, -19.073, -11.838, -12.651, -13.463, -14.276, -15.088, -15.901, -16.714, -7.853, -8.666, -9.478, -10.291, -11.104, -11.916, -12.729, -13.541, -14.354, -4.681, -5.494, -6.306, -7.119, -7.931, -8.744, -9.556, -10.369, -11.181, -1.509, -2.321, -3.134, -3.946, -4.759, -5.571, -6.384, -7.196, -8.009, 1.664, 0.851, 0.039, -0.774, -1.586, -2.399, -3.211, -4.024, -4.836, 4.836, 4.024, 3.211, 2.399, 1.586, 0.774, -0.039, -0.851, -1.664, 8.009, 7.196, 6.384, 5.571, 4.759, 3.946, 3.134, 2.321, 1.509, 11.181, 10.369, 9.556, 8.744, 7.931, 7.119, 6.306, 5.494, 4.681, 14.354, 13.541, 12.729, 11.916, 11.104, 10.291, 9.478, 8.666, 7.853, 16.714, 15.901, 15.088, 14.276, 13.463, 12.651, 11.838, 19.073, 18.261, 17.448, 16.636, 15.823] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -308,6 +391,17 @@ Axis Lengths: [3, 16] (NB: Matrix in Row/Column order) Test HBA_JOINED_INNER ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001HBA" + DISH_DIAMETER: Double 160.262 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106HBA" + DISH_DIAMETER: Double 31.2612 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601HBA" + DISH_DIAMETER: Double 65.2905 + LOFAR_STATION_ID: Int 2 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "HBA0" @@ -325,6 +419,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.363, -6.491, -1.62, 3.251, 8.121, 12.992, -12.993, -8.122, -3.251, 1.62, 6.491, 11.362, -9.753, -4.881, -0.011, 4.86, -6.512, -1.641, -80.217, -75.346, -86.718, -81.847, -76.977, -72.106, -93.22, -88.349, -83.478, -78.607, -73.737, -68.866, -94.85, -89.979, -85.109, -80.238, -75.367, -70.496, -91.61, -86.739, -81.869, -76.998, -88.37, -83.499 7.725, 6.463, 6.151, 4.888, 3.625, 2.362, 4.577, 3.313, 2.051, 0.787, -0.476, -1.739, 1.739, 0.476, -0.787, -2.05, -3.313, -4.576, -2.361, -3.624, -4.887, -6.15, -6.462, -7.725, -47.289, -48.551, -48.863, -50.126, -51.389, -52.652, -50.437, -51.701, -52.963, -54.227, -55.49, -56.753, -53.275, -54.538, -55.801, -57.064, -58.327, -59.59, -57.375, -58.638, -59.901, -61.164, -61.476, -62.739] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -353,6 +452,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 83.499, 88.37, 76.998, 81.869, 86.739, 91.61, 70.495, 75.367, 80.238, 85.109, 89.979, 94.85, 68.865, 73.736, 78.607, 83.478, 88.349, 93.22, 72.105, 76.977, 81.847, 86.718, 75.346, 80.217, 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.362, -6.491, -1.62, 3.251, 8.121, 12.992, -12.992, -8.121, -3.251, 1.62, 6.491, 11.362, -9.752, -4.881, -0.011, 4.86, -6.512, -1.641 62.739, 61.477, 61.165, 59.902, 58.639, 57.376, 59.591, 58.327, 57.065, 55.801, 54.538, 53.275, 56.753, 55.49, 54.227, 52.964, 51.701, 50.438, 52.653, 51.39, 50.127, 48.864, 48.552, 47.289, 7.72501, 6.46301, 6.15101, 4.88801, 3.62501, 2.36201, 4.57701, 3.31301, 2.05101, 0.78701, -0.47599, -1.73899, 1.73901, 0.47601, -0.78699, -2.04999, -3.31299, -4.57599, -2.36099, -3.62399, -4.88699, -6.14999, -6.46199, -7.72499] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -381,6 +485,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 2.489, 6.915, 11.34, 15.765, -0.119001, 4.307, 8.732, 13.157, -11.577, -7.151, -2.726, 1.699, 6.125, 10.549, 14.975, 19.4, -14.185, -9.76, -5.334, -0.909, 3.517, 7.942, 12.368, 16.793, -16.793, -12.368, -7.942, -3.517, 0.909, 5.334, 9.76, 14.185, -19.4, -14.975, -10.549, -6.125, -1.699, 2.726, 7.151, 11.577, -13.157, -8.732, -4.307, 0.119001, -15.765, -11.34, -6.915, -2.489 11.533, 9.707, 7.882, 6.057, 9.02, 7.195, 5.37, 3.544, 10.158, 8.333, 6.507, 4.682, 2.856, 1.031, -0.794, -2.62, 7.645, 5.82, 3.995, 2.169, 0.344, -1.482, -3.307, -5.133, 5.133, 3.307, 1.482, -0.344, -2.169, -3.995, -5.82, -7.645, 2.62, 0.794, -1.031, -2.856, -4.682, -6.507, -8.333, -10.158, -3.544, -5.37, -7.195, -9.02, -6.057, -7.882, -9.707, -11.533] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, 10, 12, -1, -1, -1, 20, 22, 24, 26, -1, -1, -1, 34, 36, 38, 40, 42, 44, -1, -1, 50, 52, 54, 56, 58, 60, -1, -1, -1, 68, 70, 72, 74, -1, -1, -1, 82, 84, -1, -1, -1, -1, -1 + -1, -1, -1, -1, -1, 11, 13, -1, -1, -1, 21, 23, 25, 27, -1, -1, -1, 35, 37, 39, 41, 43, 45, -1, -1, 51, 53, 55, 57, 59, 61, -1, -1, -1, 69, 71, 73, 75, -1, -1, -1, 83, 85, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 @@ -409,6 +518,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -14.584, -9.512, -4.44, 0.633001, 5.705, -18.849, -13.777, -8.704, -3.632, 1.44, 6.512, 11.584, -23.114, -18.041, -12.969, -7.897, -2.825, 2.247, 7.319, 12.391, 17.463, -22.306, -17.234, -12.162, -7.09, -2.018, 3.054, 8.126, 13.198, 18.271, -21.499, -16.427, -11.355, -6.283, -1.211, 3.861, 8.934, 14.006, 19.078, -20.692, -15.62, -10.548, -5.476, -0.403, 4.669, 9.741, 14.813, 19.885, -19.885, -14.813, -9.74, -4.668, 0.403999, 5.476, 10.548, 15.62, 20.692, -19.077, -14.005, -8.933, -3.861, 1.211, 6.283, 11.355, 16.427, 21.499, -18.27, -13.198, -8.126, -3.054, 2.018, 7.09, 12.162, 17.235, 22.307, -17.463, -12.391, -7.319, -2.247, 2.825, 7.898, 12.97, 18.042, 23.114, -11.584, -6.512, -1.439, 3.633, 8.705, 13.777, 18.849, -5.704, -0.632002, 4.44, 9.512, 14.584 -15.823, -16.636, -17.448, -18.261, -19.073, -11.838, -12.651, -13.463, -14.276, -15.088, -15.901, -16.714, -7.853, -8.666, -9.478, -10.291, -11.104, -11.916, -12.729, -13.541, -14.354, -4.681, -5.494, -6.306, -7.119, -7.931, -8.744, -9.556, -10.369, -11.181, -1.509, -2.321, -3.134, -3.946, -4.759, -5.571, -6.384, -7.196, -8.009, 1.664, 0.851, 0.039, -0.774, -1.586, -2.399, -3.211, -4.024, -4.836, 4.836, 4.024, 3.211, 2.399, 1.586, 0.774, -0.039, -0.851, -1.664, 8.009, 7.196, 6.384, 5.571, 4.759, 3.946, 3.134, 2.321, 1.509, 11.181, 10.369, 9.556, 8.744, 7.931, 7.119, 6.306, 5.494, 4.681, 14.354, 13.541, 12.729, 11.916, 11.104, 10.291, 9.478, 8.666, 7.853, 16.714, 15.901, 15.088, 14.276, 13.463, 12.651, 11.838, 19.073, 18.261, 17.448, 16.636, 15.823] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -437,6 +551,20 @@ Axis Lengths: [3, 16] (NB: Matrix in Row/Column order) Test HBA_DUAL ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001HBA0" + DISH_DIAMETER: Double 31.2625 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106HBA" + DISH_DIAMETER: Double 44.2208 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601HBA" + DISH_DIAMETER: Double 65.2905 + LOFAR_STATION_ID: Int 2 + NAME: String "CS001HBA1" + DISH_DIAMETER: Double 31.2621 + LOFAR_STATION_ID: Int 0 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "HBA0" @@ -454,6 +582,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.363, -6.491, -1.62, 3.251, 8.121, 12.992, -12.993, -8.122, -3.251, 1.62, 6.491, 11.362, -9.753, -4.881, -0.011, 4.86, -6.512, -1.641, -80.217, -75.346, -86.718, -81.847, -76.977, -72.106, -93.22, -88.349, -83.478, -78.607, -73.737, -68.866, -94.85, -89.979, -85.109, -80.238, -75.367, -70.496, -91.61, -86.739, -81.869, -76.998, -88.37, -83.499 7.725, 6.463, 6.151, 4.888, 3.625, 2.362, 4.577, 3.313, 2.051, 0.787, -0.476, -1.739, 1.739, 0.476, -0.787, -2.05, -3.313, -4.576, -2.361, -3.624, -4.887, -6.15, -6.462, -7.725, -47.289, -48.551, -48.863, -50.126, -51.389, -52.652, -50.437, -51.701, -52.963, -54.227, -55.49, -56.753, -53.275, -54.538, -55.801, -57.064, -58.327, -59.59, -57.375, -58.638, -59.901, -61.164, -61.476, -62.739] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -482,6 +615,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 2.489, 6.915, 11.34, 15.765, -0.119001, 4.307, 8.732, 13.157, -11.577, -7.151, -2.726, 1.699, 6.125, 10.549, 14.975, 19.4, -14.185, -9.76, -5.334, -0.909, 3.517, 7.942, 12.368, 16.793, -16.793, -12.368, -7.942, -3.517, 0.909, 5.334, 9.76, 14.185, -19.4, -14.975, -10.549, -6.125, -1.699, 2.726, 7.151, 11.577, -13.157, -8.732, -4.307, 0.119001, -15.765, -11.34, -6.915, -2.489 11.533, 9.707, 7.882, 6.057, 9.02, 7.195, 5.37, 3.544, 10.158, 8.333, 6.507, 4.682, 2.856, 1.031, -0.794, -2.62, 7.645, 5.82, 3.995, 2.169, 0.344, -1.482, -3.307, -5.133, 5.133, 3.307, 1.482, -0.344, -2.169, -3.995, -5.82, -7.645, 2.62, 0.794, -1.031, -2.856, -4.682, -6.507, -8.333, -10.158, -3.544, -5.37, -7.195, -9.02, -6.057, -7.882, -9.707, -11.533] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -510,6 +648,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -14.584, -9.512, -4.44, 0.633001, 5.705, -18.849, -13.777, -8.704, -3.632, 1.44, 6.512, 11.584, -23.114, -18.041, -12.969, -7.897, -2.825, 2.247, 7.319, 12.391, 17.463, -22.306, -17.234, -12.162, -7.09, -2.018, 3.054, 8.126, 13.198, 18.271, -21.499, -16.427, -11.355, -6.283, -1.211, 3.861, 8.934, 14.006, 19.078, -20.692, -15.62, -10.548, -5.476, -0.403, 4.669, 9.741, 14.813, 19.885, -19.885, -14.813, -9.74, -4.668, 0.403999, 5.476, 10.548, 15.62, 20.692, -19.077, -14.005, -8.933, -3.861, 1.211, 6.283, 11.355, 16.427, 21.499, -18.27, -13.198, -8.126, -3.054, 2.018, 7.09, 12.162, 17.235, 22.307, -17.463, -12.391, -7.319, -2.247, 2.825, 7.898, 12.97, 18.042, 23.114, -11.584, -6.512, -1.439, 3.633, 8.705, 13.777, 18.849, -5.704, -0.632002, 4.44, 9.512, 14.584 -15.823, -16.636, -17.448, -18.261, -19.073, -11.838, -12.651, -13.463, -14.276, -15.088, -15.901, -16.714, -7.853, -8.666, -9.478, -10.291, -11.104, -11.916, -12.729, -13.541, -14.354, -4.681, -5.494, -6.306, -7.119, -7.931, -8.744, -9.556, -10.369, -11.181, -1.509, -2.321, -3.134, -3.946, -4.759, -5.571, -6.384, -7.196, -8.009, 1.664, 0.851, 0.039, -0.774, -1.586, -2.399, -3.211, -4.024, -4.836, 4.836, 4.024, 3.211, 2.399, 1.586, 0.774, -0.039, -0.851, -1.664, 8.009, 7.196, 6.384, 5.571, 4.759, 3.946, 3.134, 2.321, 1.509, 11.181, 10.369, 9.556, 8.744, 7.931, 7.119, 6.306, 5.494, 4.681, 14.354, 13.541, 12.729, 11.916, 11.104, 10.291, 9.478, 8.666, 7.853, 16.714, 15.901, 15.088, 14.276, 13.463, 12.651, 11.838, 19.073, 18.261, 17.448, 16.636, 15.823] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -538,6 +681,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 83.499, 88.37, 76.998, 81.869, 86.739, 91.61, 70.495, 75.367, 80.238, 85.109, 89.979, 94.85, 68.865, 73.736, 78.607, 83.478, 88.349, 93.22, 72.105, 76.977, 81.847, 86.718, 75.346, 80.217, 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.362, -6.491, -1.62, 3.251, 8.121, 12.992, -12.992, -8.121, -3.251, 1.62, 6.491, 11.362, -9.752, -4.881, -0.011, 4.86, -6.512, -1.641 62.739, 61.477, 61.165, 59.902, 58.639, 57.376, 59.591, 58.327, 57.065, 55.801, 54.538, 53.275, 56.753, 55.49, 54.227, 52.964, 51.701, 50.438, 52.653, 51.39, 50.127, 48.864, 48.552, 47.289, 7.72501, 6.46301, 6.15101, 4.88801, 3.62501, 2.36201, 4.57701, 3.31301, 2.05101, 0.78701, -0.47599, -1.73899, 1.73901, 0.47601, -0.78699, -2.04999, -3.31299, -4.57599, -2.36099, -3.62399, -4.88699, -6.14999, -6.46199, -7.72499] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -566,6 +714,20 @@ Axis Lengths: [3, 16] (NB: Matrix in Row/Column order) Test HBA_DUAL_INNER ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001HBA0" + DISH_DIAMETER: Double 31.2625 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106HBA" + DISH_DIAMETER: Double 31.2612 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601HBA" + DISH_DIAMETER: Double 65.2905 + LOFAR_STATION_ID: Int 2 + NAME: String "CS001HBA1" + DISH_DIAMETER: Double 31.2621 + LOFAR_STATION_ID: Int 0 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "HBA0" @@ -583,6 +745,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.363, -6.491, -1.62, 3.251, 8.121, 12.992, -12.993, -8.122, -3.251, 1.62, 6.491, 11.362, -9.753, -4.881, -0.011, 4.86, -6.512, -1.641, -80.217, -75.346, -86.718, -81.847, -76.977, -72.106, -93.22, -88.349, -83.478, -78.607, -73.737, -68.866, -94.85, -89.979, -85.109, -80.238, -75.367, -70.496, -91.61, -86.739, -81.869, -76.998, -88.37, -83.499 7.725, 6.463, 6.151, 4.888, 3.625, 2.362, 4.577, 3.313, 2.051, 0.787, -0.476, -1.739, 1.739, 0.476, -0.787, -2.05, -3.313, -4.576, -2.361, -3.624, -4.887, -6.15, -6.462, -7.725, -47.289, -48.551, -48.863, -50.126, -51.389, -52.652, -50.437, -51.701, -52.963, -54.227, -55.49, -56.753, -53.275, -54.538, -55.801, -57.064, -58.327, -59.59, -57.375, -58.638, -59.901, -61.164, -61.476, -62.739] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -611,6 +778,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 2.489, 6.915, 11.34, 15.765, -0.119001, 4.307, 8.732, 13.157, -11.577, -7.151, -2.726, 1.699, 6.125, 10.549, 14.975, 19.4, -14.185, -9.76, -5.334, -0.909, 3.517, 7.942, 12.368, 16.793, -16.793, -12.368, -7.942, -3.517, 0.909, 5.334, 9.76, 14.185, -19.4, -14.975, -10.549, -6.125, -1.699, 2.726, 7.151, 11.577, -13.157, -8.732, -4.307, 0.119001, -15.765, -11.34, -6.915, -2.489 11.533, 9.707, 7.882, 6.057, 9.02, 7.195, 5.37, 3.544, 10.158, 8.333, 6.507, 4.682, 2.856, 1.031, -0.794, -2.62, 7.645, 5.82, 3.995, 2.169, 0.344, -1.482, -3.307, -5.133, 5.133, 3.307, 1.482, -0.344, -2.169, -3.995, -5.82, -7.645, 2.62, 0.794, -1.031, -2.856, -4.682, -6.507, -8.333, -10.158, -3.544, -5.37, -7.195, -9.02, -6.057, -7.882, -9.707, -11.533] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, 10, 12, -1, -1, -1, 20, 22, 24, 26, -1, -1, -1, 34, 36, 38, 40, 42, 44, -1, -1, 50, 52, 54, 56, 58, 60, -1, -1, -1, 68, 70, 72, 74, -1, -1, -1, 82, 84, -1, -1, -1, -1, -1 + -1, -1, -1, -1, -1, 11, 13, -1, -1, -1, 21, 23, 25, 27, -1, -1, -1, 35, 37, 39, 41, 43, 45, -1, -1, 51, 53, 55, 57, 59, 61, -1, -1, -1, 69, 71, 73, 75, -1, -1, -1, 83, 85, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 @@ -639,6 +811,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -14.584, -9.512, -4.44, 0.633001, 5.705, -18.849, -13.777, -8.704, -3.632, 1.44, 6.512, 11.584, -23.114, -18.041, -12.969, -7.897, -2.825, 2.247, 7.319, 12.391, 17.463, -22.306, -17.234, -12.162, -7.09, -2.018, 3.054, 8.126, 13.198, 18.271, -21.499, -16.427, -11.355, -6.283, -1.211, 3.861, 8.934, 14.006, 19.078, -20.692, -15.62, -10.548, -5.476, -0.403, 4.669, 9.741, 14.813, 19.885, -19.885, -14.813, -9.74, -4.668, 0.403999, 5.476, 10.548, 15.62, 20.692, -19.077, -14.005, -8.933, -3.861, 1.211, 6.283, 11.355, 16.427, 21.499, -18.27, -13.198, -8.126, -3.054, 2.018, 7.09, 12.162, 17.235, 22.307, -17.463, -12.391, -7.319, -2.247, 2.825, 7.898, 12.97, 18.042, 23.114, -11.584, -6.512, -1.439, 3.633, 8.705, 13.777, 18.849, -5.704, -0.632002, 4.44, 9.512, 14.584 -15.823, -16.636, -17.448, -18.261, -19.073, -11.838, -12.651, -13.463, -14.276, -15.088, -15.901, -16.714, -7.853, -8.666, -9.478, -10.291, -11.104, -11.916, -12.729, -13.541, -14.354, -4.681, -5.494, -6.306, -7.119, -7.931, -8.744, -9.556, -10.369, -11.181, -1.509, -2.321, -3.134, -3.946, -4.759, -5.571, -6.384, -7.196, -8.009, 1.664, 0.851, 0.039, -0.774, -1.586, -2.399, -3.211, -4.024, -4.836, 4.836, 4.024, 3.211, 2.399, 1.586, 0.774, -0.039, -0.851, -1.664, 8.009, 7.196, 6.384, 5.571, 4.759, 3.946, 3.134, 2.321, 1.509, 11.181, 10.369, 9.556, 8.744, 7.931, 7.119, 6.306, 5.494, 4.681, 14.354, 13.541, 12.729, 11.916, 11.104, 10.291, 9.478, 8.666, 7.853, 16.714, 15.901, 15.088, 14.276, 13.463, 12.651, 11.838, 19.073, 18.261, 17.448, 16.636, 15.823] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -667,6 +844,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 83.499, 88.37, 76.998, 81.869, 86.739, 91.61, 70.495, 75.367, 80.238, 85.109, 89.979, 94.85, 68.865, 73.736, 78.607, 83.478, 88.349, 93.22, 72.105, 76.977, 81.847, 86.718, 75.346, 80.217, 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.362, -6.491, -1.62, 3.251, 8.121, 12.992, -12.992, -8.121, -3.251, 1.62, 6.491, 11.362, -9.752, -4.881, -0.011, 4.86, -6.512, -1.641 62.739, 61.477, 61.165, 59.902, 58.639, 57.376, 59.591, 58.327, 57.065, 55.801, 54.538, 53.275, 56.753, 55.49, 54.227, 52.964, 51.701, 50.438, 52.653, 51.39, 50.127, 48.864, 48.552, 47.289, 7.72501, 6.46301, 6.15101, 4.88801, 3.62501, 2.36201, 4.57701, 3.31301, 2.05101, 0.78701, -0.47599, -1.73899, 1.73901, 0.47601, -0.78699, -2.04999, -3.31299, -4.57599, -2.36099, -3.62399, -4.88699, -6.14999, -6.46199, -7.72499] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -694,12 +876,73 @@ Axis Lengths: [3, 16] (NB: Matrix in Row/Column order) FLAG_ROW: Bool 0 Table tBeamTables_tmp.ms/OBSERVATION ... + TIME_RANGE: Double array with shape [2] +[4.85676e+09, 4.85677e+09] LOFAR_ANTENNA_SET: String "HBA_DUAL_INNER" - LOFAR_ANTENNA_SET: String "HBA_DUAL_INNER" - LOFAR_ANTENNA_SET: String "HBA_DUAL_INNER" + +ELEMENT_FLAG after FailedTileInfo _empty: +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + + Table tBeamTables_tmp.ms/LOFAR_ELEMENT_FAILURE ... + +ELEMENT_FLAG after FailedTileInfo _filled: +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0] + + Table tBeamTables_tmp.ms/LOFAR_ELEMENT_FAILURE ... + ANTENNA_FIELD_ID: Int 0 + ELEMENT_INDEX: Int 1 + TIME: Double 4.85676e+09 + ANTENNA_FIELD_ID: Int 0 + ELEMENT_INDEX: Int 11 + TIME: Double 4.85676e+09 + ANTENNA_FIELD_ID: Int 1 + ELEMENT_INDEX: Int 5 + TIME: Double 4.85676e+09 + ANTENNA_FIELD_ID: Int 3 + ELEMENT_INDEX: Int 44 + TIME: Double 4.85676e+09 + ANTENNA_FIELD_ID: Int 2 + ELEMENT_INDEX: Int 21 + TIME: Double 4.85676e+09 + ANTENNA_FIELD_ID: Int 1 + ELEMENT_INDEX: Int 12 + TIME: Double 4.85676e+09 Test HBA_ZERO ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001HBA0" + DISH_DIAMETER: Double 31.2625 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106HBA" + DISH_DIAMETER: Double 44.2208 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601HBA" + DISH_DIAMETER: Double 65.2905 + LOFAR_STATION_ID: Int 2 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "HBA0" @@ -717,6 +960,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.363, -6.491, -1.62, 3.251, 8.121, 12.992, -12.993, -8.122, -3.251, 1.62, 6.491, 11.362, -9.753, -4.881, -0.011, 4.86, -6.512, -1.641, -80.217, -75.346, -86.718, -81.847, -76.977, -72.106, -93.22, -88.349, -83.478, -78.607, -73.737, -68.866, -94.85, -89.979, -85.109, -80.238, -75.367, -70.496, -91.61, -86.739, -81.869, -76.998, -88.37, -83.499 7.725, 6.463, 6.151, 4.888, 3.625, 2.362, 4.577, 3.313, 2.051, 0.787, -0.476, -1.739, 1.739, 0.476, -0.787, -2.05, -3.313, -4.576, -2.361, -3.624, -4.887, -6.15, -6.462, -7.725, -47.289, -48.551, -48.863, -50.126, -51.389, -52.652, -50.437, -51.701, -52.963, -54.227, -55.49, -56.753, -53.275, -54.538, -55.801, -57.064, -58.327, -59.59, -57.375, -58.638, -59.901, -61.164, -61.476, -62.739] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -745,6 +993,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 2.489, 6.915, 11.34, 15.765, -0.119001, 4.307, 8.732, 13.157, -11.577, -7.151, -2.726, 1.699, 6.125, 10.549, 14.975, 19.4, -14.185, -9.76, -5.334, -0.909, 3.517, 7.942, 12.368, 16.793, -16.793, -12.368, -7.942, -3.517, 0.909, 5.334, 9.76, 14.185, -19.4, -14.975, -10.549, -6.125, -1.699, 2.726, 7.151, 11.577, -13.157, -8.732, -4.307, 0.119001, -15.765, -11.34, -6.915, -2.489 11.533, 9.707, 7.882, 6.057, 9.02, 7.195, 5.37, 3.544, 10.158, 8.333, 6.507, 4.682, 2.856, 1.031, -0.794, -2.62, 7.645, 5.82, 3.995, 2.169, 0.344, -1.482, -3.307, -5.133, 5.133, 3.307, 1.482, -0.344, -2.169, -3.995, -5.82, -7.645, 2.62, 0.794, -1.031, -2.856, -4.682, -6.507, -8.333, -10.158, -3.544, -5.37, -7.195, -9.02, -6.057, -7.882, -9.707, -11.533] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -773,6 +1026,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -14.584, -9.512, -4.44, 0.633001, 5.705, -18.849, -13.777, -8.704, -3.632, 1.44, 6.512, 11.584, -23.114, -18.041, -12.969, -7.897, -2.825, 2.247, 7.319, 12.391, 17.463, -22.306, -17.234, -12.162, -7.09, -2.018, 3.054, 8.126, 13.198, 18.271, -21.499, -16.427, -11.355, -6.283, -1.211, 3.861, 8.934, 14.006, 19.078, -20.692, -15.62, -10.548, -5.476, -0.403, 4.669, 9.741, 14.813, 19.885, -19.885, -14.813, -9.74, -4.668, 0.403999, 5.476, 10.548, 15.62, 20.692, -19.077, -14.005, -8.933, -3.861, 1.211, 6.283, 11.355, 16.427, 21.499, -18.27, -13.198, -8.126, -3.054, 2.018, 7.09, 12.162, 17.235, 22.307, -17.463, -12.391, -7.319, -2.247, 2.825, 7.898, 12.97, 18.042, 23.114, -11.584, -6.512, -1.439, 3.633, 8.705, 13.777, 18.849, -5.704, -0.632002, 4.44, 9.512, 14.584 -15.823, -16.636, -17.448, -18.261, -19.073, -11.838, -12.651, -13.463, -14.276, -15.088, -15.901, -16.714, -7.853, -8.666, -9.478, -10.291, -11.104, -11.916, -12.729, -13.541, -14.354, -4.681, -5.494, -6.306, -7.119, -7.931, -8.744, -9.556, -10.369, -11.181, -1.509, -2.321, -3.134, -3.946, -4.759, -5.571, -6.384, -7.196, -8.009, 1.664, 0.851, 0.039, -0.774, -1.586, -2.399, -3.211, -4.024, -4.836, 4.836, 4.024, 3.211, 2.399, 1.586, 0.774, -0.039, -0.851, -1.664, 8.009, 7.196, 6.384, 5.571, 4.759, 3.946, 3.134, 2.321, 1.509, 11.181, 10.369, 9.556, 8.744, 7.931, 7.119, 6.306, 5.494, 4.681, 14.354, 13.541, 12.729, 11.916, 11.104, 10.291, 9.478, 8.666, 7.853, 16.714, 15.901, 15.088, 14.276, 13.463, 12.651, 11.838, 19.073, 18.261, 17.448, 16.636, 15.823] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -801,6 +1059,17 @@ Axis Lengths: [3, 16] (NB: Matrix in Row/Column order) Test HBA_ZERO_INNER ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001HBA0" + DISH_DIAMETER: Double 31.2625 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106HBA" + DISH_DIAMETER: Double 31.2612 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601HBA" + DISH_DIAMETER: Double 65.2905 + LOFAR_STATION_ID: Int 2 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "HBA0" @@ -818,6 +1087,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.363, -6.491, -1.62, 3.251, 8.121, 12.992, -12.993, -8.122, -3.251, 1.62, 6.491, 11.362, -9.753, -4.881, -0.011, 4.86, -6.512, -1.641, -80.217, -75.346, -86.718, -81.847, -76.977, -72.106, -93.22, -88.349, -83.478, -78.607, -73.737, -68.866, -94.85, -89.979, -85.109, -80.238, -75.367, -70.496, -91.61, -86.739, -81.869, -76.998, -88.37, -83.499 7.725, 6.463, 6.151, 4.888, 3.625, 2.362, 4.577, 3.313, 2.051, 0.787, -0.476, -1.739, 1.739, 0.476, -0.787, -2.05, -3.313, -4.576, -2.361, -3.624, -4.887, -6.15, -6.462, -7.725, -47.289, -48.551, -48.863, -50.126, -51.389, -52.652, -50.437, -51.701, -52.963, -54.227, -55.49, -56.753, -53.275, -54.538, -55.801, -57.064, -58.327, -59.59, -57.375, -58.638, -59.901, -61.164, -61.476, -62.739] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -846,6 +1120,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 2.489, 6.915, 11.34, 15.765, -0.119001, 4.307, 8.732, 13.157, -11.577, -7.151, -2.726, 1.699, 6.125, 10.549, 14.975, 19.4, -14.185, -9.76, -5.334, -0.909, 3.517, 7.942, 12.368, 16.793, -16.793, -12.368, -7.942, -3.517, 0.909, 5.334, 9.76, 14.185, -19.4, -14.975, -10.549, -6.125, -1.699, 2.726, 7.151, 11.577, -13.157, -8.732, -4.307, 0.119001, -15.765, -11.34, -6.915, -2.489 11.533, 9.707, 7.882, 6.057, 9.02, 7.195, 5.37, 3.544, 10.158, 8.333, 6.507, 4.682, 2.856, 1.031, -0.794, -2.62, 7.645, 5.82, 3.995, 2.169, 0.344, -1.482, -3.307, -5.133, 5.133, 3.307, 1.482, -0.344, -2.169, -3.995, -5.82, -7.645, 2.62, 0.794, -1.031, -2.856, -4.682, -6.507, -8.333, -10.158, -3.544, -5.37, -7.195, -9.02, -6.057, -7.882, -9.707, -11.533] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, 10, 12, -1, -1, -1, 20, 22, 24, 26, -1, -1, -1, 34, 36, 38, 40, 42, 44, -1, -1, 50, 52, 54, 56, 58, 60, -1, -1, -1, 68, 70, 72, 74, -1, -1, -1, 82, 84, -1, -1, -1, -1, -1 + -1, -1, -1, -1, -1, 11, 13, -1, -1, -1, 21, 23, 25, 27, -1, -1, -1, 35, 37, 39, 41, 43, 45, -1, -1, 51, 53, 55, 57, 59, 61, -1, -1, -1, 69, 71, 73, 75, -1, -1, -1, 83, 85, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 @@ -874,6 +1153,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -14.584, -9.512, -4.44, 0.633001, 5.705, -18.849, -13.777, -8.704, -3.632, 1.44, 6.512, 11.584, -23.114, -18.041, -12.969, -7.897, -2.825, 2.247, 7.319, 12.391, 17.463, -22.306, -17.234, -12.162, -7.09, -2.018, 3.054, 8.126, 13.198, 18.271, -21.499, -16.427, -11.355, -6.283, -1.211, 3.861, 8.934, 14.006, 19.078, -20.692, -15.62, -10.548, -5.476, -0.403, 4.669, 9.741, 14.813, 19.885, -19.885, -14.813, -9.74, -4.668, 0.403999, 5.476, 10.548, 15.62, 20.692, -19.077, -14.005, -8.933, -3.861, 1.211, 6.283, 11.355, 16.427, 21.499, -18.27, -13.198, -8.126, -3.054, 2.018, 7.09, 12.162, 17.235, 22.307, -17.463, -12.391, -7.319, -2.247, 2.825, 7.898, 12.97, 18.042, 23.114, -11.584, -6.512, -1.439, 3.633, 8.705, 13.777, 18.849, -5.704, -0.632002, 4.44, 9.512, 14.584 -15.823, -16.636, -17.448, -18.261, -19.073, -11.838, -12.651, -13.463, -14.276, -15.088, -15.901, -16.714, -7.853, -8.666, -9.478, -10.291, -11.104, -11.916, -12.729, -13.541, -14.354, -4.681, -5.494, -6.306, -7.119, -7.931, -8.744, -9.556, -10.369, -11.181, -1.509, -2.321, -3.134, -3.946, -4.759, -5.571, -6.384, -7.196, -8.009, 1.664, 0.851, 0.039, -0.774, -1.586, -2.399, -3.211, -4.024, -4.836, 4.836, 4.024, 3.211, 2.399, 1.586, 0.774, -0.039, -0.851, -1.664, 8.009, 7.196, 6.384, 5.571, 4.759, 3.946, 3.134, 2.321, 1.509, 11.181, 10.369, 9.556, 8.744, 7.931, 7.119, 6.306, 5.494, 4.681, 14.354, 13.541, 12.729, 11.916, 11.104, 10.291, 9.478, 8.666, 7.853, 16.714, 15.901, 15.088, 14.276, 13.463, 12.651, 11.838, 19.073, 18.261, 17.448, 16.636, 15.823] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -902,6 +1186,17 @@ Axis Lengths: [3, 16] (NB: Matrix in Row/Column order) Test HBA_ONE ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001HBA1" + DISH_DIAMETER: Double 31.2621 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106HBA" + DISH_DIAMETER: Double 44.2208 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601HBA" + DISH_DIAMETER: Double 65.2905 + LOFAR_STATION_ID: Int 2 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "HBA1" @@ -919,6 +1214,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 83.499, 88.37, 76.998, 81.869, 86.739, 91.61, 70.495, 75.367, 80.238, 85.109, 89.979, 94.85, 68.865, 73.736, 78.607, 83.478, 88.349, 93.22, 72.105, 76.977, 81.847, 86.718, 75.346, 80.217, 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.362, -6.491, -1.62, 3.251, 8.121, 12.992, -12.992, -8.121, -3.251, 1.62, 6.491, 11.362, -9.752, -4.881, -0.011, 4.86, -6.512, -1.641 62.739, 61.477, 61.165, 59.902, 58.639, 57.376, 59.591, 58.327, 57.065, 55.801, 54.538, 53.275, 56.753, 55.49, 54.227, 52.964, 51.701, 50.438, 52.653, 51.39, 50.127, 48.864, 48.552, 47.289, 7.72501, 6.46301, 6.15101, 4.88801, 3.62501, 2.36201, 4.57701, 3.31301, 2.05101, 0.78701, -0.47599, -1.73899, 1.73901, 0.47601, -0.78699, -2.04999, -3.31299, -4.57599, -2.36099, -3.62399, -4.88699, -6.14999, -6.46199, -7.72499] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -947,6 +1247,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 2.489, 6.915, 11.34, 15.765, -0.119001, 4.307, 8.732, 13.157, -11.577, -7.151, -2.726, 1.699, 6.125, 10.549, 14.975, 19.4, -14.185, -9.76, -5.334, -0.909, 3.517, 7.942, 12.368, 16.793, -16.793, -12.368, -7.942, -3.517, 0.909, 5.334, 9.76, 14.185, -19.4, -14.975, -10.549, -6.125, -1.699, 2.726, 7.151, 11.577, -13.157, -8.732, -4.307, 0.119001, -15.765, -11.34, -6.915, -2.489 11.533, 9.707, 7.882, 6.057, 9.02, 7.195, 5.37, 3.544, 10.158, 8.333, 6.507, 4.682, 2.856, 1.031, -0.794, -2.62, 7.645, 5.82, 3.995, 2.169, 0.344, -1.482, -3.307, -5.133, 5.133, 3.307, 1.482, -0.344, -2.169, -3.995, -5.82, -7.645, 2.62, 0.794, -1.031, -2.856, -4.682, -6.507, -8.333, -10.158, -3.544, -5.37, -7.195, -9.02, -6.057, -7.882, -9.707, -11.533] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -975,6 +1280,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -14.584, -9.512, -4.44, 0.633001, 5.705, -18.849, -13.777, -8.704, -3.632, 1.44, 6.512, 11.584, -23.114, -18.041, -12.969, -7.897, -2.825, 2.247, 7.319, 12.391, 17.463, -22.306, -17.234, -12.162, -7.09, -2.018, 3.054, 8.126, 13.198, 18.271, -21.499, -16.427, -11.355, -6.283, -1.211, 3.861, 8.934, 14.006, 19.078, -20.692, -15.62, -10.548, -5.476, -0.403, 4.669, 9.741, 14.813, 19.885, -19.885, -14.813, -9.74, -4.668, 0.403999, 5.476, 10.548, 15.62, 20.692, -19.077, -14.005, -8.933, -3.861, 1.211, 6.283, 11.355, 16.427, 21.499, -18.27, -13.198, -8.126, -3.054, 2.018, 7.09, 12.162, 17.235, 22.307, -17.463, -12.391, -7.319, -2.247, 2.825, 7.898, 12.97, 18.042, 23.114, -11.584, -6.512, -1.439, 3.633, 8.705, 13.777, 18.849, -5.704, -0.632002, 4.44, 9.512, 14.584 -15.823, -16.636, -17.448, -18.261, -19.073, -11.838, -12.651, -13.463, -14.276, -15.088, -15.901, -16.714, -7.853, -8.666, -9.478, -10.291, -11.104, -11.916, -12.729, -13.541, -14.354, -4.681, -5.494, -6.306, -7.119, -7.931, -8.744, -9.556, -10.369, -11.181, -1.509, -2.321, -3.134, -3.946, -4.759, -5.571, -6.384, -7.196, -8.009, 1.664, 0.851, 0.039, -0.774, -1.586, -2.399, -3.211, -4.024, -4.836, 4.836, 4.024, 3.211, 2.399, 1.586, 0.774, -0.039, -0.851, -1.664, 8.009, 7.196, 6.384, 5.571, 4.759, 3.946, 3.134, 2.321, 1.509, 11.181, 10.369, 9.556, 8.744, 7.931, 7.119, 6.306, 5.494, 4.681, 14.354, 13.541, 12.729, 11.916, 11.104, 10.291, 9.478, 8.666, 7.853, 16.714, 15.901, 15.088, 14.276, 13.463, 12.651, 11.838, 19.073, 18.261, 17.448, 16.636, 15.823] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -1003,6 +1313,17 @@ Axis Lengths: [3, 16] (NB: Matrix in Row/Column order) Test HBA_ONE_INNER ..... + Table tBeamTables_tmp.ms/ANTENNA ... + NAME: String "CS001HBA1" + DISH_DIAMETER: Double 31.2621 + LOFAR_STATION_ID: Int 0 + NAME: String "RS106HBA" + DISH_DIAMETER: Double 31.2612 + LOFAR_STATION_ID: Int 1 + NAME: String "DE601HBA" + DISH_DIAMETER: Double 65.2905 + LOFAR_STATION_ID: Int 2 + Table tBeamTables_tmp.ms/LOFAR_ANTENNA_FIELD ... ANTENNA_ID: Int 0 NAME: String "HBA1" @@ -1020,6 +1341,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 83.499, 88.37, 76.998, 81.869, 86.739, 91.61, 70.495, 75.367, 80.238, 85.109, 89.979, 94.85, 68.865, 73.736, 78.607, 83.478, 88.349, 93.22, 72.105, 76.977, 81.847, 86.718, 75.346, 80.217, 1.641, 6.512, -4.86, 0.010999, 4.881, 9.752, -11.362, -6.491, -1.62, 3.251, 8.121, 12.992, -12.992, -8.121, -3.251, 1.62, 6.491, 11.362, -9.752, -4.881, -0.011, 4.86, -6.512, -1.641 62.739, 61.477, 61.165, 59.902, 58.639, 57.376, 59.591, 58.327, 57.065, 55.801, 54.538, 53.275, 56.753, 55.49, 54.227, 52.964, 51.701, 50.438, 52.653, 51.39, 50.127, 48.864, 48.552, 47.289, 7.72501, 6.46301, 6.15101, 4.88801, 3.62501, 2.36201, 4.57701, 3.31301, 2.05101, 0.78701, -0.47599, -1.73899, 1.73901, 0.47601, -0.78699, -2.04999, -3.31299, -4.57599, -2.36099, -3.62399, -4.88699, -6.14999, -6.46199, -7.72499] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -1048,6 +1374,11 @@ Axis Lengths: [3, 48] (NB: Matrix in Row/Column order) 2.489, 6.915, 11.34, 15.765, -0.119001, 4.307, 8.732, 13.157, -11.577, -7.151, -2.726, 1.699, 6.125, 10.549, 14.975, 19.4, -14.185, -9.76, -5.334, -0.909, 3.517, 7.942, 12.368, 16.793, -16.793, -12.368, -7.942, -3.517, 0.909, 5.334, 9.76, 14.185, -19.4, -14.975, -10.549, -6.125, -1.699, 2.726, 7.151, 11.577, -13.157, -8.732, -4.307, 0.119001, -15.765, -11.34, -6.915, -2.489 11.533, 9.707, 7.882, 6.057, 9.02, 7.195, 5.37, 3.544, 10.158, 8.333, 6.507, 4.682, 2.856, 1.031, -0.794, -2.62, 7.645, 5.82, 3.995, 2.169, 0.344, -1.482, -3.307, -5.133, 5.133, 3.307, 1.482, -0.344, -2.169, -3.995, -5.82, -7.645, 2.62, 0.794, -1.031, -2.856, -4.682, -6.507, -8.333, -10.158, -3.544, -5.37, -7.195, -9.02, -6.057, -7.882, -9.707, -11.533] + ELEMENT_RCU: Int array with shape [2, 48] +Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) +[-1, -1, -1, -1, -1, 10, 12, -1, -1, -1, 20, 22, 24, 26, -1, -1, -1, 34, 36, 38, 40, 42, 44, -1, -1, 50, 52, 54, 56, 58, 60, -1, -1, -1, 68, 70, 72, 74, -1, -1, -1, 82, 84, -1, -1, -1, -1, -1 + -1, -1, -1, -1, -1, 11, 13, -1, -1, -1, 21, 23, 25, 27, -1, -1, -1, 35, 37, 39, 41, 43, 45, -1, -1, 51, 53, 55, 57, 59, 61, -1, -1, -1, 69, 71, 73, 75, -1, -1, -1, 83, 85, -1, -1, -1, -1, -1] + ELEMENT_FLAG: Bool array with shape [2, 48] Axis Lengths: [2, 48] (NB: Matrix in Row/Column order) [1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 @@ -1076,6 +1407,11 @@ Axis Lengths: [3, 96] (NB: Matrix in Row/Column order) -14.584, -9.512, -4.44, 0.633001, 5.705, -18.849, -13.777, -8.704, -3.632, 1.44, 6.512, 11.584, -23.114, -18.041, -12.969, -7.897, -2.825, 2.247, 7.319, 12.391, 17.463, -22.306, -17.234, -12.162, -7.09, -2.018, 3.054, 8.126, 13.198, 18.271, -21.499, -16.427, -11.355, -6.283, -1.211, 3.861, 8.934, 14.006, 19.078, -20.692, -15.62, -10.548, -5.476, -0.403, 4.669, 9.741, 14.813, 19.885, -19.885, -14.813, -9.74, -4.668, 0.403999, 5.476, 10.548, 15.62, 20.692, -19.077, -14.005, -8.933, -3.861, 1.211, 6.283, 11.355, 16.427, 21.499, -18.27, -13.198, -8.126, -3.054, 2.018, 7.09, 12.162, 17.235, 22.307, -17.463, -12.391, -7.319, -2.247, 2.825, 7.898, 12.97, 18.042, 23.114, -11.584, -6.512, -1.439, 3.633, 8.705, 13.777, 18.849, -5.704, -0.632002, 4.44, 9.512, 14.584 -15.823, -16.636, -17.448, -18.261, -19.073, -11.838, -12.651, -13.463, -14.276, -15.088, -15.901, -16.714, -7.853, -8.666, -9.478, -10.291, -11.104, -11.916, -12.729, -13.541, -14.354, -4.681, -5.494, -6.306, -7.119, -7.931, -8.744, -9.556, -10.369, -11.181, -1.509, -2.321, -3.134, -3.946, -4.759, -5.571, -6.384, -7.196, -8.009, 1.664, 0.851, 0.039, -0.774, -1.586, -2.399, -3.211, -4.024, -4.836, 4.836, 4.024, 3.211, 2.399, 1.586, 0.774, -0.039, -0.851, -1.664, 8.009, 7.196, 6.384, 5.571, 4.759, 3.946, 3.134, 2.321, 1.509, 11.181, 10.369, 9.556, 8.744, 7.931, 7.119, 6.306, 5.494, 4.681, 14.354, 13.541, 12.729, 11.916, 11.104, 10.291, 9.478, 8.666, 7.853, 16.714, 15.901, 15.088, 14.276, 13.463, 12.651, 11.838, 19.073, 18.261, 17.448, 16.636, 15.823] + ELEMENT_RCU: Int array with shape [2, 96] +Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) +[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190 + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191] + ELEMENT_FLAG: Bool array with shape [2, 96] Axis Lengths: [2, 96] (NB: Matrix in Row/Column order) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 diff --git a/LCS/MSLofar/test/tMSLofarTable.cc b/LCS/MSLofar/test/tMSLofarTable.cc index 0151ce9807b11b7b4cc13ff3323e40a3209807ac..750045643edad16c8e1beca1f73afd264067aed5 100644 --- a/LCS/MSLofar/test/tMSLofarTable.cc +++ b/LCS/MSLofar/test/tMSLofarTable.cc @@ -50,6 +50,7 @@ void checkAntennaField() ASSERT (allEQ(afcol.position()(0), Vector<Double>(3, 2.5))); ASSERT (allEQ(afcol.coordinateAxes()(0), Matrix<Double>(3,3, 3.5))); ASSERT (allEQ(afcol.elementOffset()(0), Matrix<Double>(3,24, 5.))); + ASSERT (allEQ(afcol.elementRCU()(0), Matrix<Int>(2,24, 10))); ASSERT (allEQ(afcol.elementFlag()(0), Matrix<Bool>(2,24, False))); ASSERT (afcol.tileRotation()(0) == -2.); ASSERT (! afcol.tileElementOffset().isDefined(0)); @@ -87,6 +88,7 @@ void testAntennaField() afcol.position().put (0, Vector<Double>(3, 2.5)); afcol.coordinateAxes().put (0, Matrix<Double>(3,3, 3.5)); afcol.elementOffset().put (0, Matrix<Double>(3,24, 5.)); + afcol.elementRCU().put (0, Matrix<Int>(2,24, 10)); afcol.elementFlag().put (0, Matrix<Bool>(2,24, False)); afcol.tileRotation().put (0, -2.); af.addRow(); diff --git a/LCS/Stream/include/Stream/PortBroker.h b/LCS/Stream/include/Stream/PortBroker.h index bc09bbc90dd95937b535057742e44f2bf6cd7542..bb954fc80c7ba0d4a6f44b8097f06f0df8b429e5 100644 --- a/LCS/Stream/include/Stream/PortBroker.h +++ b/LCS/Stream/include/Stream/PortBroker.h @@ -60,12 +60,12 @@ class PortBroker: protected SocketStream { class ClientStream: public SocketStream { public: - ClientStream( const std::string &hostname, uint16 port, const std::string &resource ); + ClientStream( const std::string &hostname, uint16 port, const std::string &resource, time_t deadline = 0 ); }; protected: static void requestResource( Stream &stream, const std::string &resource ); - FileDescriptorBasedStream *waitForClient( const std::string &resource, time_t timeout = 0 ); + FileDescriptorBasedStream *waitForClient( const std::string &resource, time_t deadline = 0 ); private: PortBroker( uint16 port ); diff --git a/LCS/Stream/include/Stream/SocketStream.h b/LCS/Stream/include/Stream/SocketStream.h index 6b8c0854aee24dfadec6713d8892c7455e34ee96..37f2d2baa77c583cb2c72e9ad77f2c67c66d75c7 100644 --- a/LCS/Stream/include/Stream/SocketStream.h +++ b/LCS/Stream/include/Stream/SocketStream.h @@ -47,12 +47,12 @@ class SocketStream : public FileDescriptorBasedStream Client, Server }; - SocketStream(const std::string &hostname, uint16 _port, Protocol, Mode, time_t timeout = 0, const std::string &nfskey = "", bool doAccept = true); + SocketStream(const std::string &hostname, uint16 _port, Protocol, Mode, time_t deadline = 0, const std::string &nfskey = "", bool doAccept = true); virtual ~SocketStream(); FileDescriptorBasedStream *detach(); - void reaccept(time_t timeout = 0); // only for TCP server socket + void reaccept(time_t deadline = 0); // only for TCP server socket void setReadBufferSize(size_t size); const Protocol protocol; @@ -68,7 +68,7 @@ class SocketStream : public FileDescriptorBasedStream static void syncNFS(); - static std::string readkey(const std::string &nfskey, time_t &timeout); + static std::string readkey(const std::string &nfskey, time_t deadline); static void writekey(const std::string &nfskey, uint16 port); static void deletekey(const std::string &nfskey); }; diff --git a/LCS/Stream/src/PortBroker.cc b/LCS/Stream/src/PortBroker.cc index 0108096a1bf8291a88692bfba02cb580c4cea354..8a3224f0be46d5f5887cd09854b5ff47453b47f0 100644 --- a/LCS/Stream/src/PortBroker.cc +++ b/LCS/Stream/src/PortBroker.cc @@ -165,8 +165,8 @@ bool PortBroker::serverStarted() } -FileDescriptorBasedStream *PortBroker::waitForClient( const string &resource, time_t timeout ) { - struct timespec deadline = { time(0L) + timeout, 0 }; +FileDescriptorBasedStream *PortBroker::waitForClient( const string &resource, time_t deadline ) { + struct timespec deadline_ts = { deadline, 0 }; LOG_DEBUG_STR( "PortBroker server: registering " << resource ); @@ -188,9 +188,9 @@ FileDescriptorBasedStream *PortBroker::waitForClient( const string &resource, ti return serverStream.release(); } - if (timeout > 0) { - if (!itsCondition.wait(itsMutex, deadline)) - throw TimeOutException("port broker client: server did not register", THROW_ARGS); + if (deadline > 0) { + if (!itsCondition.wait(itsMutex, deadline_ts)) + THROW(TimeOutException, "port broker client: server did not register"); } else { itsCondition.wait(itsMutex); } @@ -222,10 +222,10 @@ PortBroker::ServerStream::ServerStream( const string &resource ) } -PortBroker::ClientStream::ClientStream( const string &hostname, uint16 port, const string &resource ) +PortBroker::ClientStream::ClientStream( const string &hostname, uint16 port, const string &resource, time_t deadline ) : // connect to port broker - SocketStream(hostname, port, SocketStream::TCP, SocketStream::Client) + SocketStream(hostname, port, SocketStream::TCP, SocketStream::Client, deadline) { // request service PortBroker::requestResource(*this, resource); diff --git a/LCS/Stream/src/SocketStream.cc b/LCS/Stream/src/SocketStream.cc index d14353da00811f57e440ce5c7c6461f1ffdb7821..e1791ecadc217de17b08bea97ff437dd347d400d 100644 --- a/LCS/Stream/src/SocketStream.cc +++ b/LCS/Stream/src/SocketStream.cc @@ -65,7 +65,7 @@ static struct RandomState { } randomState; -SocketStream::SocketStream(const std::string &hostname, uint16 _port, Protocol protocol, Mode mode, time_t timeout, const std::string &nfskey, bool doAccept) +SocketStream::SocketStream(const std::string &hostname, uint16 _port, Protocol protocol, Mode mode, time_t deadline, const std::string &nfskey, bool doAccept) : protocol(protocol), mode(mode), @@ -98,7 +98,7 @@ SocketStream::SocketStream(const std::string &hostname, uint16 _port, Protocol p struct addrinfo *result; if (mode == Client && nfskey != "") - port = boost::lexical_cast<uint16>(readkey(nfskey, timeout)); + port = boost::lexical_cast<uint16>(readkey(nfskey, deadline)); if (mode == Server && autoPort) port = MINPORT + static_cast<unsigned short>((MAXPORT - MINPORT) * erand48(randomState.xsubi)); // erand48() not thread safe, but not a problem. @@ -124,11 +124,9 @@ SocketStream::SocketStream(const std::string &hostname, uint16 _port, Protocol p throw SystemCallException("socket", errno, THROW_ARGS); if (mode == Client) { - time_t latestTime = time(0) + timeout; - while (connect(fd, result->ai_addr, result->ai_addrlen) < 0) if (errno == ECONNREFUSED) { - if (timeout > 0 && time(0) >= latestTime) + if (deadline > 0 && time(0) >= deadline) throw TimeOutException("client socket", THROW_ARGS); if (usleep(999999) < 0) { @@ -156,7 +154,7 @@ SocketStream::SocketStream(const std::string &hostname, uint16 _port, Protocol p throw BindException("listen", errno, THROW_ARGS); if (doAccept) - accept(timeout); + accept(deadline); else break; } @@ -212,18 +210,18 @@ FileDescriptorBasedStream *SocketStream::detach() } -void SocketStream::reaccept( time_t timeout ) +void SocketStream::reaccept(time_t deadline) { ASSERT( mode == Server ); if (fd >= 0 && close(fd) < 0) throw SystemCallException("close", errno, THROW_ARGS); - accept( timeout ); + accept(deadline); } -void SocketStream::accept( time_t timeout ) +void SocketStream::accept(time_t deadline) { if (nfskey != "") writekey(nfskey, port); @@ -246,7 +244,7 @@ void SocketStream::accept( time_t timeout ) } onDestruct = { nfskey }; (void)onDestruct; - if (timeout > 0) { + if (deadline > 0) { fd_set fds; FD_ZERO(&fds); @@ -254,13 +252,18 @@ void SocketStream::accept( time_t timeout ) struct timeval timeval; - timeval.tv_sec = timeout; + time_t now = time(0); + + if (now > deadline) + THROW(TimeOutException, "server socket"); + + timeval.tv_sec = deadline - now; timeval.tv_usec = 0; switch (select(listen_sk + 1, &fds, 0, 0, &timeval)) { case -1 : throw SystemCallException("select", errno, THROW_ARGS); - case 0 : throw TimeOutException("server socket", THROW_ARGS); + case 0 : THROW(TimeOutException, "server socket"); } } @@ -292,7 +295,7 @@ void SocketStream::syncNFS() } -std::string SocketStream::readkey(const std::string &nfskey, time_t &timeout) +std::string SocketStream::readkey(const std::string &nfskey, time_t deadline) { for(;;) { char portStr[16]; @@ -307,8 +310,8 @@ std::string SocketStream::readkey(const std::string &nfskey, time_t &timeout) return std::string(portStr); } - if (timeout == 0) - throw TimeOutException("client socket", THROW_ARGS); + if (deadline > 0 && deadline <= time(0)) + THROW(TimeOutException, "client socket"); if (usleep(999999) > 0) { // interrupted by a signal handler -- abort to allow this thread to @@ -316,8 +319,6 @@ std::string SocketStream::readkey(const std::string &nfskey, time_t &timeout) // system call throw SystemCallException("sleep", errno, THROW_ARGS); } - - timeout--; } } diff --git a/LCU/Firmware/tools/src/flash_images.sh b/LCU/Firmware/tools/src/flash_images.sh index 9c02160d587e6be7fc50364945aede3177ffdfc3..a479693557f196b47dd515e5237069db47028990 100755 --- a/LCU/Firmware/tools/src/flash_images.sh +++ b/LCU/Firmware/tools/src/flash_images.sh @@ -11,7 +11,7 @@ SyntaxError() exit 1 } -if [ ${#argv} == 0 ]; then +if [ $# == 0 ]; then SyntaxError fi diff --git a/LCU/StationTest/stationtest.py b/LCU/StationTest/stationtest.py index 1eda68a2a730910aa9a58b2836401d91bca5b836..253c81873bbbaae3963e4bd8f7d2404a03ab05de 100755 --- a/LCU/StationTest/stationtest.py +++ b/LCU/StationTest/stationtest.py @@ -3,7 +3,7 @@ # # Run the tests to test a LOFAR station # H. Meulman -# Version 0.14 17-feb-2012 SVN***** +# Version 0.18 2-okt-2012 SVN***** # 24 sep: local log directory aangepast # 27 sept: - Toevoeging delay voor tbbdriver polling @@ -31,7 +31,9 @@ # 27 jan 2012: Store logfiles in /localhome/stationtest/data in "local mode" # 17 feb 2012: Added detection of oscillating tiles. # 9 mar 2012: Devide by 0 error solved in HBAtest -# 13 sept 2012: Added for user0..9 sys.path.append("/opt/stationtest/modules") +# 13 Apr 2012: added LBAdatatest directory. Also directorys need to change permissions to work with USER0. +# 20 Apr 2012: Logging suspicious tiles and elements in HBA modem test +# 13 Sep 2012: Added for user0..9 sys.path.append("/opt/stationtest/modules") # todo: # - Als meer dan 10 elementen geen rf signaal hebben, keur dan hele tile af @@ -69,7 +71,7 @@ factor = 30 # station statistics fault window: Antenna average + and - factor = InternationalStations = ('DE601C','DE602C','DE603C','DE604C','DE605C','FR606C','SE607C','UK608C') RemoteStations = ('CS302C','RS106C','RS205C','RS208C','RS306C','RS307C','RS406C','RS503C') CoreStations = ('CS001C','CS002C','CS003C','CS004C','CS005C','CS006C','CS007C','CS011C','CS013C','CS017C','CS021C','CS024C','CS026C','CS028C','CS030C','CS031','CS032C','CS101C','CS103C','CS201C','CS301C','CS401C','CS501C') -NoHBAelementtestPossible = ('DE601C','DE602C','DE603C','DE605C','FR606C','SE607C','UK608C') +NoHBAelementtestPossible = ('DE601C','DE602C','DE603C','DE605C','FR606C','SE607C','UK608C') # NoHBANaStestPossible = ('') HBASubband = dict( DE601C=155,\ DE602C=155,\ @@ -77,7 +79,7 @@ HBASubband = dict( DE601C=155,\ DE604C=474,\ DE605C=479,\ FR606C=155,\ - SE607C=155,\ + SE607C=287,\ UK608C=155) # Do not change: @@ -340,7 +342,7 @@ def GotoSwlevel2(): time.sleep(120) res = os.popen3('rspctl --datastream=0')[1].readlines() print res - #time.sleep(90) # Tijdelijk toe gevoegd voor nieuwe tbbdriver. Deze loopt vast tijdens pollen +# time.sleep(90) # Tijdelijk toe gevoegd voor nieuwe tbbdriver. Deze loopt vast tijdens pollen # CheckTBB() # Tijdelijk weg gelaten voor nieuwe tbbdriver. Deze loopt vast tijdens pollen #fromprg.close() break @@ -714,10 +716,13 @@ def CheckRSPVersion(): RSPgold = open(RSPgoldfile,'r').readlines() # Read RSP Version gold RSPversion = os.popen3('rspctl --version')[1].readlines() # Get RSP Versions # res = cli.command('./rsp_version.sh') +# debug=1 if debug: + print ('RSPgold = ', RSPgold) for RSPnumber in range(len(RSPgold)): if RSPgold[RSPnumber] == RSPversion[RSPnumber]: print ('RSP OK = ', RSPnumber) else: print ('RSPNOK = ', RSPnumber) +# debug=0 # store subreck testlog for RSPnumber in range(len(RSPgold)): if RSPgold[RSPnumber] != RSPversion[RSPnumber]: @@ -1240,7 +1245,7 @@ def LBAtest(): SeverityOfThisTest=2 PriorityOfThisTest=2 - debug=0 +# debug=1 global Severity global Priority @@ -1249,7 +1254,8 @@ def LBAtest(): sr.setId('LBAmd1>: ') sub_time=[] sub_file=[] - dir_name = './lbadatatest/' #Work directory will be cleaned +# dir_name = './lbadatatest/' #Work directory will be cleaned + dir_name = '/opt/stationtest/test/hbatest/lbadatatest/' #Work directory will be cleaned if not (os.path.exists(dir_name)): os.mkdir(dir_name) rmfile = '*.log' @@ -1561,7 +1567,7 @@ def HBAModemTest(): global Priority global ModemFail - debug=0 +# debug=1 sr.setId('HBAmdt>: ') print ('HBA ModemTest') @@ -1605,6 +1611,61 @@ def HBAModemTest(): count+=1 ModemFail[TileNr]=1 # global variabele om in HBA element test de RF meting over te slaan. +# + if (count > 10 and isodd(RCUNr)): #Als er meer dan 10 fouten in zitten, keur dan hele tile af! + print ('Tile %s - RCU %s; Broken. No modem communication' % (TileNr,RCUNr)) + + # store station testlog + #if debug: print ('ModemFail = ',ModemFail) + if Severity<SeverityOfThisTest: Severity=SeverityOfThisTest + if Priority<PriorityOfThisTest: Priority=PriorityOfThisTest + st_log.write('HBAmdt>: Sv=%s Pr=%s, Tile %s - RCU %s; Suspicious.\n' % (SeverityLevel[SeverityOfThisTest], PriorityLevel[PriorityOfThisTest], TileNr, RCUNr)) + sr.setResult('FAILED') + + else: #Anders keur elementen af als fout. + for ElementNumber in range(4, 20): + if (ModemReply[ElementNumber] != ModemReplyGold[ElementNumber] and isodd(RCUNr)): + print ('Tile %s - RCU %s; Element %s; Suspicious. : (%s, %s)' % (TileNr, RCUNr, ElementNumber-3, ModemReply[ElementNumber], ModemReplyGold[ElementNumber])) + # store station testlog + if Severity<SeverityOfThisTest: Severity=SeverityOfThisTest + if Priority<PriorityOfThisTest: Priority=PriorityOfThisTest + st_log.write('HBAmdt>: Sv=%s Pr=%s, Tile %s - RCU %s; Element %s Suspicious. : (%s, %s)\n' % (SeverityLevel[SeverityOfThisTest], PriorityLevel[PriorityOfThisTest], TileNr, RCUNr, ElementNumber-3, ModemReply[ElementNumber], ModemReplyGold[ElementNumber])) + sr.setResult('FAILED') +# print ('ModemFail = ',ModemFail) + + try: + f=open('/opt/stationtest/test/hbatest/hba_modem3.log','rb') + except: + print ('Import error') + if Severity<SeverityOfThisTest: Severity=SeverityOfThisTest + if Priority<PriorityOfThisTest: Priority=PriorityOfThisTest + st_log.write('HBAmdt>: Sv=%s Pr=%s, No modem-logfile found!\n' % (SeverityLevel[SeverityOfThisTest], PriorityLevel[PriorityOfThisTest])) + return + time.sleep(1) + + for line in f: + ModemReply=line + ModemReplyGold=['HBA', '95', 'real', 'delays=', '253', '253', '253', '253', '253', '253', '253', '253', '253', '253', '253', '253', '253', '253', '253', '253'] + if debug: print ('line = ',line[0]) + if line[0] == 'H': # Check of regel geldig is! + ModemReply=line.replace('[',' ').replace('].',' ').split() + RCUNr=int(ModemReply[1]) + TileNr=RCUNr/2 + if debug: + print ('line = ',line) + print ('ModemReply = ',ModemReply) + print ('ModemReplyGold = ',ModemReplyGold) + print ('RCUNr = ',RCUNr) + print ('TileNr = ',TileNr) + +# Check if HBA modems work! + count=0 + for ElementNumber in range(4, 20): +# print ModemReplyGold[ElementNumber] + if ModemReply[ElementNumber] != ModemReplyGold[ElementNumber]: + count+=1 + ModemFail[TileNr]=1 # global variabele om in HBA element test de RF meting over te slaan. + # if (count > 10 and isodd(RCUNr)): #Als er meer dan 10 fouten in zitten, keur dan hele tile af! print ('Tile %s - RCU %s; Broken. No modem communication' % (TileNr,RCUNr)) @@ -1626,7 +1687,6 @@ def HBAModemTest(): st_log.write('HBAmdt>: Sv=%s Pr=%s, Tile %s - RCU %s; Element %s Broken. No modem communication : (%s, %s)\n' % (SeverityLevel[SeverityOfThisTest], PriorityLevel[PriorityOfThisTest], TileNr, RCUNr, ElementNumber-3, ModemReply[ElementNumber], ModemReplyGold[ElementNumber])) sr.setResult('FAILED') # print ('ModemFail = ',ModemFail) - return diff --git a/LCU/StationTest/tc/no_dc.py b/LCU/StationTest/tc/no_dc.py new file mode 100644 index 0000000000000000000000000000000000000000..73c222c18f4567ca4db653878843a7e071b65ed8 --- /dev/null +++ b/LCU/StationTest/tc/no_dc.py @@ -0,0 +1,37 @@ +"""Testcase for no DC offset + + Note: No specific arguments +""" + +################################################################################ +# Constants + + +################################################################################ +# - Verify options +rspId = tc.rspId +blpId = tc.blpId + +repeat = tc.repeat +tc.setResult('PASSED') # self checking test, so start assuming it will run PASSED + +tc.appendLog(11,'') +tc.appendLog(11,'>>> Set DC blocker for RSP-%s, BLP-%s' % (rspId, blpId)) +tc.appendLog(11,'') + +################################################################################ +# - Testcase initializations + + +#bypass = 0x01 # Enable DC blocker + +# default bypass is 0x01 Disable DC blocker + + +for ri in rspId: + for bi in blpId: + rsp.write_diag_bypass(tc, msg, 4, blpId, rspId) + print rsp.read_diag_bypass(tc,msg,blpId,rspId) + + + \ No newline at end of file diff --git a/MAC/APL/APLCommon/src/ControllerDefines.cc b/MAC/APL/APLCommon/src/ControllerDefines.cc index 5f06e931287e84cf290d2357b91535455ab942ad..8a321d4f28d9db07d0cafdfbff19a53442df63e2 100644 --- a/MAC/APL/APLCommon/src/ControllerDefines.cc +++ b/MAC/APL/APLCommon/src/ControllerDefines.cc @@ -29,7 +29,6 @@ #include <Common/SystemUtil.h> #include <Common/ParameterSet.h> // indexValue #include <APL/APLCommon/ControllerDefines.h> -#include <ApplCommon/LofarDirs.h> #include <ApplCommon/StationInfo.h> #include "Controller_Protocol.ph" @@ -312,7 +311,10 @@ string createPropertySetName(const string& propSetMask, psName.replace(pos, 10, string("Midplane%d")); } if ((pos = psName.find("@ionode@")) != string::npos) { - psName.replace(pos, 8, string("IONode%d")); + psName.replace(pos, 8, string("IONode%02d")); + } + if ((pos = psName.find("@locusnode@")) != string::npos) { + psName.replace(pos, 11, string("LocusNode%03d")); } if ((pos = psName.find("@osrack@")) != string::npos) { psName.replace(pos, 8, string("OSRack%d")); diff --git a/MAC/APL/APLCommon/src/swlevel b/MAC/APL/APLCommon/src/swlevel index a1c1b5145b3b74738bef4994da7ddbae81e4f395..8168875889a4b4a9ba8d4bc8313d607ccedd4b78 100644 --- a/MAC/APL/APLCommon/src/swlevel +++ b/MAC/APL/APLCommon/src/swlevel @@ -82,7 +82,7 @@ selectImage() # get version number of RSPboard in var. rsu boardHex=`echo $board | awk '{ printf "%02x", $1 }'` rsu=`sudo ${BINDIR}/../sbin/rsuctl3 -m 10:fa:00:00:$boardHex:00 -qV 2>&1 | grep BP | cut -d':' -f2 | sed 's/ //g' | cut -d'.' -f1` - if [ ${rsu} -eq 1 ]; then + if [ $imageForced ] || [ ${rsu} -eq 1 ]; then let version=$rsu # if board has reset itself to image 0, load image 1 again echo "Loading image $image on RSPboard $board ..." @@ -442,6 +442,7 @@ handle_args() show_lofar_version $flag ;; i) + imageForced=true image=$OPTARG # This is needed to be able to retrieve the requested swlevel # when it is not provided with option -l @@ -512,6 +513,7 @@ fi user=`id | cut -d'(' -f2 | cut -d')' -f1` group=`groups | awk '{print $1}'` +imageForced=false handle_args $* diff --git a/MAC/APL/CEPCU/CMakeLists.txt b/MAC/APL/CEPCU/CMakeLists.txt index bbdafe85ae51df4f47ec77e5d9f733318a298bb9..01fca5d2dcc6e3833b1a88f8119f361a52de7dfc 100644 --- a/MAC/APL/CEPCU/CMakeLists.txt +++ b/MAC/APL/CEPCU/CMakeLists.txt @@ -1,7 +1,7 @@ # $Id$ # Do not split the following line, otherwise makeversion will fail! -lofar_package(CEPCU 1.0 DEPENDS Common ALC PLC ApplCommon MACIO GCFTM GCFRTDB APLCommon OTDB) +lofar_package(CEPCU 1.0 DEPENDS Common ALC PLC ApplCommon MACIO GCFTM GCFRTDB APLCommon RTDBCommon OTDB) include(LofarFindPackage) lofar_find_package(Boost REQUIRED COMPONENTS date_time) diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc new file mode 100644 index 0000000000000000000000000000000000000000..350d5f831a19f8beededb99096d1d427095e02b1 --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc @@ -0,0 +1,330 @@ +//# BlueGeneMonitor.cc: Monitors if the BGP hardware is available +//# +//# Copyright (C) 2011 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: BlueGeneMonitor.cc 10505 2007-09-07 17:14:57Z overeem $ +#include <lofar_config.h> +#include <Common/LofarLogger.h> +#include <Common/LofarConstants.h> +#include <Common/LofarLocators.h> +#include <Common/StringUtil.h> +#include <Common/ParameterSet.h> + +#include <GCF/PVSS/GCF_PVTypes.h> +#include <GCF/PVSS/PVSSinfo.h> +#include <MACIO/MACServiceInfo.h> +#include <APL/APLCommon/ControllerDefines.h> +#include <APL/RTDBCommon/RTDButilities.h> +#include <GCF/RTDB/DP_Protocol.ph> +//#include <APL/APLCommon/StationInfo.h> +#include <errno.h> +#include <signal.h> +#include <unistd.h> // usleep +#include <netdb.h> // gethostbyname + +#include "BlueGeneMonitor.h" +#include "PVSSDatapointDefs.h" + +#define IONODES_PER_BGP_PARTITION 64 +#define MAX2(a,b) ((a) > (b)) ? (a) : (b) + +namespace LOFAR { + using namespace APLCommon; + using namespace APL::RTDBCommon; + using namespace GCF::TM; + using namespace GCF::PVSS; + using namespace GCF::RTDB; + namespace CEPCU { + +// +// BlueGeneMonitor() +// +BlueGeneMonitor::BlueGeneMonitor(const string& cntlrName) : + GCFTask ((State)&BlueGeneMonitor::initial_state,cntlrName), + itsOwnPropertySet (0), + itsTimerPort (0), + itsDPservice (0), + itsPollInterval (60), + itsLastBGPState (-1) +{ + LOG_TRACE_OBJ_STR (cntlrName << " construction"); + + // need port for timers. + itsTimerPort = new GCFTimerPort(*this, "BGPTimerPort"); + + itsDPservice = new DPservice(this); + ASSERTSTR(itsDPservice, "Can't allocate DPservice"); + + itsBlueGeneFrontEnd = globalParameterSet()->getString("BlueGeneFrontEnd", ""); + ASSERTSTR(!itsBlueGeneFrontEnd.empty(), "Name of BlueGene FrontEnd node not specified"); + + registerProtocol(DP_PROTOCOL, DP_PROTOCOL_STRINGS); +} + + +// +// ~BlueGeneMonitor() +// +BlueGeneMonitor::~BlueGeneMonitor() +{ + LOG_TRACE_OBJ_STR (getName() << " destruction"); + + if (itsDPservice) delete itsDPservice; + + if (itsTimerPort) delete itsTimerPort; +} + + +// +// initial_state(event, port) +// +// Setup connection with PVSS +// +GCFEvent::TResult BlueGeneMonitor::initial_state(GCFEvent& event, + GCFPortInterface& port) +{ + LOG_DEBUG_STR ("initial:" << eventName(event) << "@" << port.getName()); + + switch (event.signal) { + case F_INIT: + break; + + case F_ENTRY: { + // Get access to my own propertyset. + LOG_DEBUG_STR ("Activating PropertySet " << PSN_CEP_HARDWARE_MONITOR); + itsTimerPort->setTimer(2.0); + itsOwnPropertySet = new RTDBPropertySet(PSN_CEP_HARDWARE_MONITOR, + PST_CEP_HARDWARE_MONITOR, + PSAT_WO, + this); + + } + break; + + case DP_CREATED: { + // NOTE: this function may be called DURING the construction of the PropertySet. + // Always exit this event in a way that GCF can end the construction. + DPCreatedEvent dpEvent(event); + LOG_DEBUG_STR("Result of creating " << dpEvent.DPname << " = " << dpEvent.result); + itsTimerPort->cancelAllTimers(); + itsTimerPort->setTimer(0.0); + } + break; + + case F_TIMER: { + // PropertySet must exist by now + ASSERTSTR(itsOwnPropertySet, "Could not create the PVSS datapoint " << PSN_CEP_HARDWARE_MONITOR); + + // update PVSS. + LOG_TRACE_FLOW ("Updateing state to PVSS"); + itsOwnPropertySet->setValue(PN_FSM_CURRENT_ACTION, GCFPVString("BlueGene:initialising")); + itsOwnPropertySet->setValue(PN_CHM_BGP_CONNECTED, GCFPVBool(false)); + + // is name resolvable? + struct hostent* hostinfo = gethostbyname(itsBlueGeneFrontEnd.c_str()); + if (!hostinfo) { + itsOwnPropertySet->setValue(PN_FSM_ERROR, GCFPVString("Name of BG frontend node is unresolvable")); + TRAN(BlueGeneMonitor::finish_state); // go to final state. + } + itsOwnPropertySet->setValue(PN_FSM_ERROR, GCFPVString("")); + TRAN(BlueGeneMonitor::getBlueGeneState); // do inital check + } + break; + + case DP_SET: + break; + + case F_QUIT: + TRAN (BlueGeneMonitor::finish_state); + break; + + default: + LOG_DEBUG_STR ("initial, DEFAULT: " << eventName(event)); + break; + } + + return (GCFEvent::HANDLED); +} + + + +// +// getBlueGeneState(event, port) +// +// Ask the information of the BlueGene +// +GCFEvent::TResult BlueGeneMonitor::getBlueGeneState(GCFEvent& event, + GCFPortInterface& port) +{ + if (eventName(event) != "DP_SET") { + LOG_DEBUG_STR ("getBlueGeneState:" << eventName(event) << "@" << port.getName()); + } + + switch (event.signal) { + case F_ENTRY: { + itsOwnPropertySet->setValue(PN_FSM_CURRENT_ACTION,GCFPVString("BlueGene:requesting BlueGene info")); + itsTimerPort->setTimer(15.0); // in case the answer never comes + + string command(formatString("ssh %s 'bgpartstatus R00' 2>&1", itsBlueGeneFrontEnd.c_str())); + FILE* pipe(popen(command.c_str(), "r")); + char line[1024]; + line[0] = '\0'; + if (!pipe || !fgets (line, sizeof (line), pipe)) { + LOG_ERROR_STR ("BlueGene:Unable to read pipe: " << command); + itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("BlueGene:pipe failure")); + if (pipe) { + LOG_ERROR_STR("Pipe error: " << strerror(errno)); + fclose(pipe); + } + TRAN(BlueGeneMonitor::waitForNextCycle); // go to next state. + break; + } + fclose(pipe); + + // possible answers: + // free - partition is available. + // initializing - partition is booting. + // rebooting - partition is rebooting. + // busy - partition is running a job. + // unavailable - partition is partly used by other processes + // deallocating - partition is cleaning up. + // error - partition is in error state + bool inError(false); + if (!strcmp(line, "error")) { + LOG_ERROR_STR ("BlueGene:Partition R00 in error state: " << line); + itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("BlueGene:unknown partitionstate")); + inError = true; + } + + int newState(inError ? RTDB_OBJ_STATE_BROKEN : RTDB_OBJ_STATE_OPERATIONAL); + if (newState != itsLastBGPState) { + string pvssDBname(PVSSinfo::getLocalSystemName()); + for (int i = 0; i < IONODES_PER_BGP_PARTITION; i++) { + LOG_INFO_STR("setObjectState(" << getName() << "," << formatString("%s:%s", pvssDBname.c_str(), _IOnodeName(i).c_str()) << "," << newState << ")"); + setObjectState(getName(), formatString("%s:%s", pvssDBname.c_str(), _IOnodeName(i).c_str()), newState); + } + } + itsLastBGPState = newState; + TRAN(BlueGeneMonitor::waitForNextCycle); // go to next state. + break; + } + + case DP_SET: + case F_EXIT: + break; + + case F_QUIT: + TRAN (BlueGeneMonitor::finish_state); + break; + + default: + LOG_DEBUG_STR ("getBlueGeneState, DEFAULT: " << eventName(event)); + break; + } + + return (GCFEvent::HANDLED); +} + +// +// IOnodeName(nodeNr) +// +string BlueGeneMonitor::_IOnodeName(int nodeNr) +{ + string IONodeMask(createPropertySetName(PSN_IO_NODE,"")); + return (formatString(IONodeMask.c_str(), nodeNr/32, nodeNr)); +} + +// +// waitForNextCycle(event, port) +// +// Wait for our next cycle. +// +GCFEvent::TResult BlueGeneMonitor::waitForNextCycle(GCFEvent& event, + GCFPortInterface& port) +{ + if (eventName(event) != "DP_SET") { + LOG_DEBUG_STR ("waitForNextCycle:" << eventName(event) << "@" << port.getName()); + } + + switch (event.signal) { + case F_ENTRY: { + itsOwnPropertySet->setValue(PN_FSM_CURRENT_ACTION,GCFPVString("BlueGene:wait for next cycle")); + int waitTime = itsPollInterval - (time(0) % itsPollInterval); + if (waitTime == 0) { + waitTime = itsPollInterval; + } + itsTimerPort->cancelAllTimers(); + itsTimerPort->setTimer(double(waitTime)); + LOG_INFO_STR("BlueGene:Waiting " << waitTime << " seconds for next cycle"); + } + break; + + case F_TIMER: { + itsOwnPropertySet->setValue(string(PN_FSM_ERROR),GCFPVString("")); + TRAN(BlueGeneMonitor::getBlueGeneState); + } + break; + + case DP_SET: + case F_EXIT: + break; + + case F_QUIT: + TRAN (BlueGeneMonitor::finish_state); + break; + + default: + LOG_DEBUG_STR ("waitForNextCycle, DEFAULT: " << eventName(event)); + break; + } + + return (GCFEvent::HANDLED); +} + + +// +// finish_state(event, port) +// +// Write controller state to PVSS +// +GCFEvent::TResult BlueGeneMonitor::finish_state(GCFEvent& event, GCFPortInterface& port) +{ + LOG_DEBUG_STR ("finish_state:" << eventName(event) << "@" << port.getName()); + + switch (event.signal) { + case F_ENTRY: { + // update PVSS + itsOwnPropertySet->setValue(string(PN_FSM_CURRENT_ACTION),GCFPVString("BlueGene:finished")); + break; + } + + case DP_SET: + case F_EXIT: + break; + + default: + LOG_DEBUG("finishing_state, DEFAULT"); + break; + } + return (GCFEvent::HANDLED); +} + + +}; // CEPCU +}; // LOFAR diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.h b/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.h new file mode 100644 index 0000000000000000000000000000000000000000..5567484edeab186fe95ea7c72cda70fc26944219 --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.h @@ -0,0 +1,85 @@ +//# BlueGeneMonitor.h: Monitors the BlueGene hardware. +//# +//# Copyright (C) 2006 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: BlueGeneMonitor.h 10461 2007-08-23 22:44:03Z overeem $ + +#ifndef CEPCU_BLUEGENE_MONITOR_H +#define CEPCU_BLUEGENE_MONITOR_H + +//# Common Includes +#include <blitz/array.h> +#include <Common/lofar_string.h> +#include <Common/lofar_vector.h> +#include <Common/LofarConstants.h> + +//# GCF Includes +#include <GCF/TM/GCF_Control.h> +#include <GCF/RTDB/RTDB_PropertySet.h> +#include <GCF/RTDB/DPservice.h> + +// forward declaration + +namespace LOFAR { + namespace CEPCU { + +using MACIO::GCFEvent; +using GCF::TM::GCFPortInterface; +using GCF::TM::GCFTimerPort; +using GCF::TM::GCFTCPPort; +using GCF::TM::GCFTask; +using GCF::RTDB::RTDBPropertySet; +using GCF::RTDB::DPservice; + + +class BlueGeneMonitor : public GCFTask +{ +public: + explicit BlueGeneMonitor(const string& cntlrName); + ~BlueGeneMonitor(); + +private: + // During the initial state all connections with the other programs are made. + GCFEvent::TResult initial_state (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult getBlueGeneState (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult waitForNextCycle (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult finish_state (GCFEvent& e, GCFPortInterface& p); + + string _IOnodeName(int nodeNr); + + // avoid defaultconstruction and copying + BlueGeneMonitor(); + BlueGeneMonitor(const BlueGeneMonitor&); + BlueGeneMonitor& operator=(const BlueGeneMonitor&); + + // Data members + RTDBPropertySet* itsOwnPropertySet; + + GCFTimerPort* itsTimerPort; + DPservice* itsDPservice; + + string itsBlueGeneFrontEnd; + uint32 itsPollInterval; + + int itsLastBGPState; +}; + + };//CEPCU +};//LOFAR +#endif diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHWMonitor.dpl b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHWMonitor.dpl new file mode 100644 index 0000000000000000000000000000000000000000..02ffad928cff6819c183caa676432c194dfc83de --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHWMonitor.dpl @@ -0,0 +1,29 @@ +# DpType +TypeName +CEPHardwareMonitor.CEPHardwareMonitor 1# + status 41#:ObjectStatus + process 41#:ProcessStatus + BGP 1# + connected 23# + Cluster 1# + connected 23# + +DpName TypeName ID +_mp_CEPHardwareMonitor CEPHardwareMonitor 0 +_dt_CEPHardwareMonitor _DynamicDatapoints 0 + +ElementName TypeName _original.._value _original.._status +_dt_CEPHardwareMonitor.Leaf _DynamicDatapoints "_mp_CEPHardwareMonitor.logMsg:_archive" 0x101 +_dt_CEPHardwareMonitor.DynamicAttribute _DynamicDatapoints "_da_none" 0x101 + +StampSec StampMSec ElementName TypeName DetailNr _archive.._type _archive.._archive _archive.._class +0 0 _mp_CEPHardwareMonitor.process.logMsg CEPHardwareMonitor 45 1 +0 0 _mp_CEPHardwareMonitor.process.logMsg CEPHardwareMonitor 1 15 _ValueArchive_2 + +# Modify the default value for the leaf-field +ElementName TypeName _original.._value _original.._status +_mp_CEPHardwareMonitor.status.leaf CEPHardwareMonitor 1 0x101 + +DpName TypeName ID +LOFAR_PermSW_HardwareMonitor CEPHardwareMonitor 2213 + diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitor.conf b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitor.conf new file mode 100644 index 0000000000000000000000000000000000000000..0eeac979916e798b8f281edafc82bd07ce7c9c19 --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitor.conf @@ -0,0 +1,12 @@ +# +# CEPHardwareMonitor.conf +# +WatchBlueGene = 1 +WatchCluster = 1 +closingDelay = 2.0 +BlueGeneFrontEnd = bgfen1 + +ClusterNameMask = locus%03d +ClusterNetwork = cep2.lofar +FirstClusterNode = 1 +LastClusterNode = 100 diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc new file mode 100644 index 0000000000000000000000000000000000000000..64b50993a527ac17702aae0049bab4a7f29b0241 --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc @@ -0,0 +1,84 @@ +//# HardwareMonitor.cc: Main entry for the HardwareMonitor. +//# +//# Copyright (C) 2011 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: HardwareMonitorMain.cc 14858 2010-01-22 09:14:52Z loose $ +//# +#include <lofar_config.h> +#include <Common/LofarLogger.h> +#include <Common/Version.h> + +#include <Common/ParameterSet.h> +#include "BlueGeneMonitor.h" +#include "ClusterMonitor.h" +#include <CEPCU/Package__Version.h> + +using namespace LOFAR; +using namespace LOFAR::GCF; +using namespace LOFAR::GCF::TM; +using namespace LOFAR::CEPCU; + +int main(int argc, char* argv[]) +{ + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, "CEPHardwareMonitor"); + + LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor"); + LOG_INFO(Version::getInfo<CEPCUVersion>("CEPHardwareMonitor")); + + // Create tasks and call initial routines + BlueGeneMonitor* bgm(0); + ClusterMonitor* ctm(0); + + // monitor BLUEGENE? + if (globalParameterSet()->getUint32("WatchBlueGene",0)) { + bgm = new BlueGeneMonitor("BlueGeneMonitor"); + bgm->start(); + LOG_INFO("Monitoring the BlueGene"); + } + + // monitor CEP2Cluster? + if (globalParameterSet()->getUint32("WatchCluster",0)) { + ctm = new ClusterMonitor("ClusterMonitor"); + ctm->start(); + LOG_INFO("Monitoring the Cluster"); + } + + // sanity check + if (!bgm && !ctm) { + LOG_FATAL_STR("Non of the monitortask (WatchBlueGene, WatchCluster) " + "was switched on in the configfile, terminating program"); + return (0); + } + + // ok, we have something to do, do it. + GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown + GCFScheduler::instance()->run(); // until stop was called + + if (bgm) { + bgm->quit(); // let task quit nicely + } + if (ctm) { + ctm->quit(); // let task quit nicely + } + double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); + GCFScheduler::instance()->run(postRunTime); // let processes die. + + return (0); +} diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/CMakeLists.txt b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..95605102d92626dd153f587025c910e32a74c9dc --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CMakeLists.txt @@ -0,0 +1,14 @@ +# $Id: CMakeLists.txt 18492 2011-07-14 21:07:51Z loose $ + +lofar_add_bin_program(CEPHardwareMonitor + CEPHardwareMonitorMain.cc + BlueGeneMonitor.cc + ClusterMonitor.cc) + +install(FILES + CEPHardwareMonitor.conf + DESTINATION etc) + +install(PROGRAMS + zabbix_get + DESTINATION sbin) diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc new file mode 100644 index 0000000000000000000000000000000000000000..20fffaa8bea52424587d96af6f05f636fb337737 --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc @@ -0,0 +1,363 @@ +//# ClusterMonitor.cc: Monitors if the BGP hardware is available +//# +//# Copyright (C) 2011 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: ClusterMonitor.cc 10505 2007-09-07 17:14:57Z overeem $ +#include <lofar_config.h> +#include <Common/LofarLogger.h> +#include <Common/LofarConstants.h> +#include <Common/LofarLocators.h> +#include <Common/lofar_vector.h> +#include <Common/StringUtil.h> +#include <Common/ParameterSet.h> + +#include <GCF/PVSS/GCF_PVTypes.h> +#include <GCF/PVSS/PVSSinfo.h> +#include <MACIO/MACServiceInfo.h> +#include <APL/APLCommon/ControllerDefines.h> +#include <APL/RTDBCommon/RTDButilities.h> +#include <GCF/RTDB/DP_Protocol.ph> +//#include <APL/APLCommon/StationInfo.h> +#include <errno.h> +#include <signal.h> +#include <unistd.h> // usleep +#include <netdb.h> // gethostbyname + +#include "ClusterMonitor.h" +#include "PVSSDatapointDefs.h" + +#define MAX_CLUSTER_NODE 100 +#define MAX2(a,b) ((a) > (b)) ? (a) : (b) + +namespace LOFAR { + using namespace APLCommon; + using namespace APL::RTDBCommon; + using namespace GCF::TM; + using namespace GCF::PVSS; + using namespace GCF::RTDB; + namespace CEPCU { + +// +// ClusterMonitor() +// +ClusterMonitor::ClusterMonitor(const string& cntlrName) : + GCFTask ((State)&ClusterMonitor::initial_state,cntlrName), + itsOwnPropertySet (0), + itsTimerPort (0), + itsDPservice (0), + itsPollInterval (60) +{ + LOG_TRACE_OBJ_STR (cntlrName << " construction"); + + // need port for timers. + itsTimerPort = new GCFTimerPort(*this, "ClusterTimerPort"); + + itsDPservice = new DPservice(this); + ASSERTSTR(itsDPservice, "Can't allocate DPservice"); + + itsClusterNameMask = globalParameterSet()->getString("ClusterNameMask", "locus%03d"); + itsClusterNetwork = globalParameterSet()->getString("ClusterNetwork", "cep2.lofar"); + itsFirstClusterNode = globalParameterSet()->getUint("FirstClusterNode", 1); + itsLastClusterNode = globalParameterSet()->getUint("LastClusterNode", MAX_CLUSTER_NODE); + ASSERTSTR(!itsClusterNameMask.empty(), "NameMask of Cluster not specified"); + ASSERTSTR(!itsClusterNetwork.empty(), "Network name of Cluster not specified"); + ASSERTSTR(itsLastClusterNode <= MAX_CLUSTER_NODE, "Supporting only " << MAX_CLUSTER_NODE << " nodes"); + + itsLastState.resize(itsLastClusterNode+1, -1); +} + + +// +// ~ClusterMonitor() +// +ClusterMonitor::~ClusterMonitor() +{ + LOG_TRACE_OBJ_STR (getName() << " destruction"); + + if (itsDPservice) delete itsDPservice; + + if (itsTimerPort) delete itsTimerPort; +} + + +// +// initial_state(event, port) +// +// Setup connection with PVSS +// +GCFEvent::TResult ClusterMonitor::initial_state(GCFEvent& event, + GCFPortInterface& port) +{ + LOG_DEBUG_STR ("initial:" << eventName(event) << "@" << port.getName()); + + switch (event.signal) { + case F_INIT: + break; + + case F_ENTRY: { + // Get access to my own propertyset. + LOG_DEBUG_STR ("Activating PropertySet " << PSN_CEP_HARDWARE_MONITOR); + itsTimerPort->setTimer(2.0); + itsOwnPropertySet = new RTDBPropertySet(PSN_CEP_HARDWARE_MONITOR, + PST_CEP_HARDWARE_MONITOR, + PSAT_WO, + this); + + } + break; + + case DP_CREATED: { + // NOTE: this function may be called DURING the construction of the PropertySet. + // Always exit this event in a way that GCF can end the construction. + DPCreatedEvent dpEvent(event); + LOG_DEBUG_STR("Result of creating " << dpEvent.DPname << " = " << dpEvent.result); + itsTimerPort->cancelAllTimers(); + itsTimerPort->setTimer(0.0); + } + break; + + case F_TIMER: { + // PropertySet must exist by now + ASSERTSTR(itsOwnPropertySet, "Could not create the PVSS datapoint " << PSN_CEP_HARDWARE_MONITOR); + + // update PVSS. + LOG_TRACE_FLOW ("Updateing state to PVSS"); + itsOwnPropertySet->setValue(PN_FSM_CURRENT_ACTION, GCFPVString("Cluster:initialising")); + itsOwnPropertySet->setValue(PN_CHM_CLUSTER_CONNECTED, GCFPVBool(false)); + + TRAN(ClusterMonitor::getClusterState); // do inital check + } + break; + + case DP_SET: + break; + + case F_QUIT: + TRAN (ClusterMonitor::finish_state); + break; + + default: + LOG_DEBUG_STR ("initial, DEFAULT: " << eventName(event)); + break; + } + + return (GCFEvent::HANDLED); +} + + + +// +// getClusterState(event, port) +// +// Ask the information of the Cluster +// +GCFEvent::TResult ClusterMonitor::getClusterState(GCFEvent& event, + GCFPortInterface& port) +{ + if (eventName(event) != "DP_SET") { + LOG_DEBUG_STR ("getClusterState:" << eventName(event) << "@" << port.getName()); + } + + switch (event.signal) { + case F_ENTRY: { + itsOwnPropertySet->setValue(PN_FSM_CURRENT_ACTION,GCFPVString("Cluster:requesting Cluster info")); + itsTimerPort->setTimer(15.0); // in case the answer never comes + + string command(formatString("for i in `echo \".\" | awk '{ for (i=%d; i<=%d;i++) { printf \"%s.%s\\n\",i } }'`; do ../sbin/zabbix_get -s $i -k system.hostname ; done", + itsFirstClusterNode, itsLastClusterNode, itsClusterNameMask.c_str(), itsClusterNetwork.c_str())); + FILE* pipe(popen(command.c_str(), "r")); + if (!pipe) { + LOG_ERROR_STR ("Cluster:Unable to read pipe: " << command); + TRAN(ClusterMonitor::waitForNextCycle); + break; + } + + int lineLength((itsLastClusterNode-itsFirstClusterNode)*256); + vector<char> line(lineLength); + line[0] = '\0'; + size_t btsRead = fread(&line[0], 1, lineLength-1, pipe); + if (!btsRead) { + itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("Cluster:pipe failure")); + LOG_WARN_STR("Could not determine the state of the clusternodes!"); + } + else { + line[btsRead] = '\0'; + _analyzeClusterResult(line, btsRead); + } + fclose(pipe); + TRAN(ClusterMonitor::waitForNextCycle); // go to next state. + break; + } + + case DP_SET: + case F_EXIT: + break; + + case F_QUIT: + TRAN (ClusterMonitor::finish_state); + break; + + default: + LOG_DEBUG_STR ("getClusterState, DEFAULT: " << eventName(event)); + break; + } + + return (GCFEvent::HANDLED); +} + + +// +// _analyzeClusterResult(result, length); +// +void ClusterMonitor::_analyzeClusterResult(vector<char> result, size_t length) +{ + vector<bool> online(itsLastClusterNode+1, false); + size_t end(length); + size_t begin(end); + while (begin && end) { + while (end && (result[end]=='\0' || result[end]=='\n')) { + result[end--]='\0'; + } + begin = end; + while (begin && result[begin-1]!='\n') { + begin--; + } + + // possible answers: + // locus999 + // zabbix_get [4624]: Get value error: cannot connect to [[locus002.cep2.lofar]:10050]: [113] No route to host + int nodeNr = -1; + if (sscanf(&result[begin], itsClusterNameMask.c_str(), &nodeNr) != 1) { + LOG_INFO_STR("Received error: " << (char*)&result[begin]); + } + else if (nodeNr < itsFirstClusterNode || nodeNr > itsLastClusterNode) { + LOG_WARN_STR("Received info about node " << nodeNr << " which is not in my monitor range!"); + } + else { + online[nodeNr] = true; + } + end = begin - 1; + } + + // Finally update the statusfields of all the nodes + for (int i = itsFirstClusterNode; i <= itsLastClusterNode; i++) { + int newState = online[i] ? RTDB_OBJ_STATE_BROKEN : RTDB_OBJ_STATE_OPERATIONAL; + if (itsLastState[i] != newState) { + LOG_INFO_STR("Node " << _clusterNodeName(i) << ": " << (online[i] ? "ON" : "OFF")); + itsLastState[i] = newState; + } + } +} + +// +// _clusterNodeName(nodeNr) +// +string ClusterMonitor::_clusterNodeName(int nodeNr) +{ + // NOTE: THIS IS INSIDE INFORMATION ABOUT THE SETUP OF THE CLUSTER!!! + int rackMax[] = {12, 24, 36, 48, 52, 64, 76, 88, 100 }; + uint rack; + for (rack = 0; rack < sizeof(rackMax)-1; rack++) { + if (nodeNr <= rackMax[rack]) + break; + } + + string locusNodeMask (createPropertySetName(PSN_LOCUS_NODE, "")); + return (formatString(locusNodeMask.c_str(), rack, nodeNr)); +} + + +// +// waitForNextCycle(event, port) +// +// Wait for our next cycle. +// +GCFEvent::TResult ClusterMonitor::waitForNextCycle(GCFEvent& event, + GCFPortInterface& port) +{ + if (eventName(event) != "DP_SET") { + LOG_DEBUG_STR ("waitForNextCycle:" << eventName(event) << "@" << port.getName()); + } + + switch (event.signal) { + case F_ENTRY: { + itsOwnPropertySet->setValue(PN_FSM_CURRENT_ACTION,GCFPVString("Cluster:wait for next cycle")); + int waitTime = itsPollInterval - (time(0) % itsPollInterval); + if (waitTime == 0) { + waitTime = itsPollInterval; + } + itsTimerPort->cancelAllTimers(); + itsTimerPort->setTimer(double(waitTime)); + LOG_INFO_STR("Cluster:Waiting " << waitTime << " seconds for next cycle"); + } + break; + + case F_TIMER: { + itsOwnPropertySet->setValue(string(PN_FSM_ERROR),GCFPVString("")); + TRAN(ClusterMonitor::getClusterState); + } + break; + + case DP_SET: + case F_EXIT: + break; + + case F_QUIT: + TRAN (ClusterMonitor::finish_state); + break; + + default: + LOG_DEBUG_STR ("waitForNextCycle, DEFAULT: " << eventName(event)); + break; + } + + return (GCFEvent::HANDLED); +} + + +// +// finish_state(event, port) +// +// Write controller state to PVSS +// +GCFEvent::TResult ClusterMonitor::finish_state(GCFEvent& event, GCFPortInterface& port) +{ + LOG_DEBUG_STR ("finish_state:" << eventName(event) << "@" << port.getName()); + + switch (event.signal) { + case F_ENTRY: { + // update PVSS + itsOwnPropertySet->setValue(string(PN_FSM_CURRENT_ACTION),GCFPVString("Cluster:finished")); + break; + } + + case DP_SET: + case F_EXIT: + break; + + default: + LOG_DEBUG("finishing_state, DEFAULT"); + break; + } + return (GCFEvent::HANDLED); +} + + +}; // CEPCU +}; // LOFAR diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.h b/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.h new file mode 100644 index 0000000000000000000000000000000000000000..f4f91f07af9d165bb686cda293b7f051589bab79 --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.h @@ -0,0 +1,89 @@ +//# ClusterMonitor.h: Monitors the Cluster hardware. +//# +//# Copyright (C) 2006 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: ClusterMonitor.h 10461 2007-08-23 22:44:03Z overeem $ + +#ifndef CEPCU_CLUSTER_MONITOR_H +#define CEPCU_CLUSTER_MONITOR_H + +//# Common Includes +#include <blitz/array.h> +#include <Common/lofar_string.h> +#include <Common/lofar_vector.h> +#include <Common/LofarConstants.h> + +//# GCF Includes +#include <GCF/TM/GCF_Control.h> +#include <GCF/RTDB/RTDB_PropertySet.h> +#include <GCF/RTDB/DPservice.h> + +// forward declaration + +namespace LOFAR { + namespace CEPCU { + +using MACIO::GCFEvent; +using GCF::TM::GCFPortInterface; +using GCF::TM::GCFTimerPort; +using GCF::TM::GCFTCPPort; +using GCF::TM::GCFTask; +using GCF::RTDB::RTDBPropertySet; +using GCF::RTDB::DPservice; + + +class ClusterMonitor : public GCFTask +{ +public: + explicit ClusterMonitor(const string& cntlrName); + ~ClusterMonitor(); + +private: + // During the initial state all connections with the other programs are made. + GCFEvent::TResult initial_state (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult getClusterState (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult waitForNextCycle (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult finish_state (GCFEvent& e, GCFPortInterface& p); + + void _analyzeClusterResult(vector<char> result, size_t length); + string _clusterNodeName(int nodeNr); + + // avoid defaultconstruction and copying + ClusterMonitor(); + ClusterMonitor(const ClusterMonitor&); + ClusterMonitor& operator=(const ClusterMonitor&); + + // Data members + RTDBPropertySet* itsOwnPropertySet; + + GCFTimerPort* itsTimerPort; + DPservice* itsDPservice; + + string itsClusterNameMask; + string itsClusterNetwork; + int itsFirstClusterNode; + int itsLastClusterNode; + + uint32 itsPollInterval; + vector<int> itsLastState; +}; + + };//CEPCU +};//LOFAR +#endif diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/PVSSDatapointDefs.h b/MAC/APL/CEPCU/src/CEPHardwareMonitor/PVSSDatapointDefs.h new file mode 100644 index 0000000000000000000000000000000000000000..9f83a52dda5186c04b67baafe90c3bd19e564dce --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/PVSSDatapointDefs.h @@ -0,0 +1,457 @@ +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 + +#ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H +#define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H +// process +#define PN_FSM_PROCESSID "process.processID" +#define PN_FSM_START_TIME "process.startTime" +#define PN_FSM_STOP_TIME "process.stopTime" +#define PN_FSM_LOG_MSG "process.logMsg" +#define PN_FSM_ERROR "process.error" +#define PN_FSM_CURRENT_ACTION "process.currentAction" +// object +#define PN_OBJ_STATE "object.state" +#define PN_OBJ_CHILD_STATE "object.childState" +#define PN_OBJ_MESSAGE "object.message" +#define PN_OBJ_LEAF "object.leaf" + +// MACScheduler +#define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" +#define PST_MAC_SCHEDULER "MACScheduler" +#define PN_MS_PLANNED_OBSERVATIONS "plannedObservations" +#define PN_MS_ACTIVE_OBSERVATIONS "activeObservations" +#define PN_MS_FINISHED_OBSERVATIONS "finishedObservations" +#define PN_MS_OTDB_CONNECTED "OTDB.connected" +#define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" +#define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" + +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + +// Observation +#define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" +#define PST_OBSERVATION "Observation" +#define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" +#define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_CLAIM_PERIOD "claimPeriod" +#define PN_OBS_PREPARE_PERIOD "preparePeriod" +#define PN_OBS_START_TIME "startTime" +#define PN_OBS_STOP_TIME "stopTime" +#define PN_OBS_BAND_FILTER "bandFilter" +#define PN_OBS_NYQUISTZONE "nyquistzone" +#define PN_OBS_ANTENNA_ARRAY "antennaArray" +#define PN_OBS_RECEIVER_LIST "receiverList" +#define PN_OBS_SAMPLE_CLOCK "sampleClock" +#define PN_OBS_RUN_STATE "runState" +#define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" +#define PN_OBS_STATION_LIST "stationList" +#define PN_OBS_INPUT_NODE_LIST "inputNodeList" +#define PN_OBS_BGL_NODE_LIST "BGLNodeList" +#define PN_OBS_STORAGE_NODE_LIST "storageNodeList" +#define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" +#define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" +#define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" +#define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" + +// ObservationControl +#define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" +#define PST_OBSERVATION_CONTROL "ObservationControl" +#define PN_OBSCTRL_COMMAND "command" + +// InputBuffer +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" +#define PST_INPUT_BUFFER "InputBuffer" +#define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" +#define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" +#define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" +#define PN_IPB_STREAM0_REJECTED "stream0.rejected" +#define PN_IPB_STREAM1_BLOCKS_IN "stream1.blocksIn" +#define PN_IPB_STREAM1_PERC_BAD "stream1.percBad" +#define PN_IPB_STREAM1_REJECTED "stream1.rejected" +#define PN_IPB_STREAM2_BLOCKS_IN "stream2.blocksIn" +#define PN_IPB_STREAM2_PERC_BAD "stream2.percBad" +#define PN_IPB_STREAM2_REJECTED "stream2.rejected" +#define PN_IPB_STREAM3_BLOCKS_IN "stream3.blocksIn" +#define PN_IPB_STREAM3_PERC_BAD "stream3.percBad" +#define PN_IPB_STREAM3_REJECTED "stream3.rejected" +#define PN_IPB_LATE "late" +#define PN_IPB_IO_TIME "IOTime" + +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" + +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" + +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" + +// Cabinet +#define PSN_CABINET "LOFAR_PIC_@cabinet@" +#define PST_CABINET "Cabinet" +#define PN_CAB_FRONT_DOOR_OPEN "frontDoorOpen" +#define PN_CAB_FRONT_FAN_INNER "frontFanInner" +#define PN_CAB_FRONT_FAN_OUTER "frontFanOuter" +#define PN_CAB_FRONT_AIRFLOW "frontAirflow" +#define PN_CAB_BACK_DOOR_OPEN "backDoorOpen" +#define PN_CAB_BACK_FAN_INNER "backFanInner" +#define PN_CAB_BACK_FAN_OUTER "backFanOuter" +#define PN_CAB_BACK_AIRFLOW "backAirflow" +#define PN_CAB_TEMP_ALARM "tempAlarm" +#define PN_CAB_HUMIDITY_ALARM "humidityAlarm" +#define PN_CAB_TEMPERATURE "temperature" +#define PN_CAB_TEMP_MIN "tempMin" +#define PN_CAB_TEMP_MAX "tempMax" +#define PN_CAB_TEMP_MAX_MAX "tempMaxMax" +#define PN_CAB_HUMIDITY "humidity" +#define PN_CAB_HUMIDITY_MAX "humidityMax" +#define PN_CAB_HUMIDITY_MAX_MAX "humidityMaxMax" +#define PN_CAB_CONTROL_MODE "controlMode" +#define PN_CAB_TEMPERATURE_SENSOR "temperatureSensor" +#define PN_CAB_HUMIDITY_CONTROL "humidityControl" +#define PN_CAB_DOOR_CONTROL "doorControl" + +// SubRack +#define PSN_SUB_RACK "LOFAR_PIC_@cabinet@_@subrack@" +#define PST_SUB_RACK "SubRack" +#define PN_SRCK_SPU_STATUS_STATE "SPU.status.state" +#define PN_SRCK_SPU_STATUS_CHILD_STATE "SPU.status.childState" +#define PN_SRCK_SPU_STATUS_MESSAGE "SPU.status.message" +#define PN_SRCK_SPU_STATUS_LEAF "SPU.status.leaf" +#define PN_SRCK_SPU__VHBA "SPU.Vhba" +#define PN_SRCK_SPU__VLBA "SPU.Vlba" +#define PN_SRCK_SPU__VDIG "SPU.Vdig" +#define PN_SRCK_SPU_TEMPERATURE "SPU.temperature" +#define PN_SRCK_CLOCK_BOARD_STATUS_STATE "clockBoard.status.state" +#define PN_SRCK_CLOCK_BOARD_STATUS_CHILD_STATE "clockBoard.status.childState" +#define PN_SRCK_CLOCK_BOARD_STATUS_MESSAGE "clockBoard.status.message" +#define PN_SRCK_CLOCK_BOARD_STATUS_LEAF "clockBoard.status.leaf" +#define PN_SRCK_CLOCK_BOARD__VFSP "clockBoard.Vfsp" +#define PN_SRCK_CLOCK_BOARD__VCLOCK "clockBoard.Vclock" +#define PN_SRCK_CLOCK_BOARD_VERSION "clockBoard.version" +#define PN_SRCK_CLOCK_BOARD_FREQ "clockBoard.freq" +#define PN_SRCK_CLOCK_BOARD_LOCK160 "clockBoard.lock160" +#define PN_SRCK_CLOCK_BOARD_LOCK200 "clockBoard.lock200" +#define PN_SRCK_CLOCK_BOARD_TEMPERATURE "clockBoard.temperature" + +// RSPBoard +#define PSN_RSP_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@RSPBoard@" +#define PST_RSP_BOARD "RSPBoard" +#define PN_RSP_VOLTAGE12 "voltage12" +#define PN_RSP_VOLTAGE25 "voltage25" +#define PN_RSP_VOLTAGE33 "voltage33" +#define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" +#define PN_RSP_ALERT "alert" +#define PN_RSP_SPLITTER_ON "splitterOn" +#define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" +#define PN_RSP__ETHERNET_STATUS_CHILD_STATE "Ethernet.status.childState" +#define PN_RSP__ETHERNET_STATUS_MESSAGE "Ethernet.status.message" +#define PN_RSP__ETHERNET_STATUS_LEAF "Ethernet.status.leaf" +#define PN_RSP_ETHERNET_PACKETS_RECEIVED "Ethernet.packetsReceived" +#define PN_RSP_ETHERNET_PACKETS_ERROR "Ethernet.packetsError" +#define PN_RSP_ETHERNET_LAST_ERROR "Ethernet.lastError" +#define PN_RSP_MEP_SEQNR "MEP.seqnr" +#define PN_RSP_MEP_ERROR "MEP.error" +#define PN_RSP_BP_STATUS_STATE "BP.status.state" +#define PN_RSP_BP_STATUS_CHILD_STATE "BP.status.childState" +#define PN_RSP_BP_STATUS_MESSAGE "BP.status.message" +#define PN_RSP_BP_STATUS_LEAF "BP.status.leaf" +#define PN_RSP_BP_TEMPERATURE "BP.temperature" +#define PN_RSP_BP_VERSION "BP.version" +#define PN_RSP_AP0_STATUS_STATE "AP0.status.state" +#define PN_RSP_AP0_STATUS_CHILD_STATE "AP0.status.childState" +#define PN_RSP_AP0_STATUS_MESSAGE "AP0.status.message" +#define PN_RSP_AP0_STATUS_LEAF "AP0.status.leaf" +#define PN_RSP_AP0_TEMPERATURE "AP0.temperature" +#define PN_RSP_AP0_VERSION "AP0.version" +#define PN_RSP_AP0_SYNC_SAMPLE_COUNT "AP0.SYNC.sampleCount" +#define PN_RSP_AP0_SYNC_SYNC_COUNT "AP0.SYNC.syncCount" +#define PN_RSP_AP0_SYNC_ERROR_COUNT "AP0.SYNC.errorCount" +#define PN_RSP_AP1_STATUS_STATE "AP1.status.state" +#define PN_RSP_AP1_STATUS_CHILD_STATE "AP1.status.childState" +#define PN_RSP_AP1_STATUS_MESSAGE "AP1.status.message" +#define PN_RSP_AP1_STATUS_LEAF "AP1.status.leaf" +#define PN_RSP_AP1_TEMPERATURE "AP1.temperature" +#define PN_RSP_AP1_VERSION "AP1.version" +#define PN_RSP_AP1_SYNC_SAMPLE_COUNT "AP1.SYNC.sampleCount" +#define PN_RSP_AP1_SYNC_SYNC_COUNT "AP1.SYNC.syncCount" +#define PN_RSP_AP1_SYNC_ERROR_COUNT "AP1.SYNC.errorCount" +#define PN_RSP_AP2_STATUS_STATE "AP2.status.state" +#define PN_RSP_AP2_STATUS_CHILD_STATE "AP2.status.childState" +#define PN_RSP_AP2_STATUS_MESSAGE "AP2.status.message" +#define PN_RSP_AP2_STATUS_LEAF "AP2.status.leaf" +#define PN_RSP_AP2_TEMPERATURE "AP2.temperature" +#define PN_RSP_AP2_VERSION "AP2.version" +#define PN_RSP_AP2_SYNC_SAMPLE_COUNT "AP2.SYNC.sampleCount" +#define PN_RSP_AP2_SYNC_SYNC_COUNT "AP2.SYNC.syncCount" +#define PN_RSP_AP2_SYNC_ERROR_COUNT "AP2.SYNC.errorCount" +#define PN_RSP_AP3_STATUS_STATE "AP3.status.state" +#define PN_RSP_AP3_STATUS_CHILD_STATE "AP3.status.childState" +#define PN_RSP_AP3_STATUS_MESSAGE "AP3.status.message" +#define PN_RSP_AP3_STATUS_LEAF "AP3.status.leaf" +#define PN_RSP_AP3_TEMPERATURE "AP3.temperature" +#define PN_RSP_AP3_VERSION "AP3.version" +#define PN_RSP_AP3_SYNC_SAMPLE_COUNT "AP3.SYNC.sampleCount" +#define PN_RSP_AP3_SYNC_SYNC_COUNT "AP3.SYNC.syncCount" +#define PN_RSP_AP3_SYNC_ERROR_COUNT "AP3.SYNC.errorCount" + +// RCU +#define PSN_RCU "LOFAR_PIC_@cabinet@_@subrack@_@RSPBoard@_@rcu@" +#define PST_RCU "RCU" +#define PN_RCU_DELAY "Delay" +#define PN_RCU_INPUT_ENABLE "InputEnable" +#define PN_RCU_LBL_ENABLE "LBLEnable" +#define PN_RCU_LBH_ENABLE "LBHEnable" +#define PN_RCU_HBA_ENABLE "HBAEnable" +#define PN_RCU_BAND_SEL_LBA_HBA "bandSelLbaHba" +#define PN_RCU_HBA_FILTER_SEL "HBAFilterSel" +#define PN_RCU_VL_ENABLE "VlEnable" +#define PN_RCU_VH_ENABLE "VhEnable" +#define PN_RCU_VDD_VCC_ENABLE "VddVccEnable" +#define PN_RCU_BAND_SEL_LBL_LBH "bandSelLblLbh" +#define PN_RCU_LBA_FILTER_SEL "LBAFilterSel" +#define PN_RCU_ATTENUATION "Attenuation" +#define PN_RCU_NOF_OVERFLOW "nofOverflow" +#define PN_RCU_ADC_STATISTICS_OVERFLOW "ADCStatistics.overflow" +#define PN_RCU_TBB_ERROR "TBB.error" +#define PN_RCU_TBB_MODE "TBB.mode" +#define PN_RCU_TBB_START_ADDR "TBB.startAddr" +#define PN_RCU_TBB_BUF_SIZE "TBB.bufSize" +#define PN_RCU_TRIGGER_STARTLEVEL "Trigger.startlevel" +#define PN_RCU_TRIGGER_BASELEVEL "Trigger.baselevel" +#define PN_RCU_TRIGGER_STOPLEVEL "Trigger.stoplevel" +#define PN_RCU_TRIGGER_FILTER "Trigger.filter" +#define PN_RCU_TRIGGER_WINDOW "Trigger.window" +#define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" + +// TBBoard +#define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" +#define PST_TB_BOARD "TBBoard" +#define PN_TBB_BOARDID "boardID" +#define PN_TBB_RAM_SIZE "RAMSize" +#define PN_TBB_SW_VERSION "SWVersion" +#define PN_TBB_BOARD_VERSION "boardVersion" +#define PN_TBB_TP_VERSION "TPVersion" +#define PN_TBB_MP0_VERSION "MP0Version" +#define PN_TBB_MP1_VERSION "MP1Version" +#define PN_TBB_MP2_VERSION "MP2Version" +#define PN_TBB_MP3_VERSION "MP3Version" +#define PN_TBB_VOLTAGE12 "voltage12" +#define PN_TBB_VOLTAGE25 "voltage25" +#define PN_TBB_VOLTAGE33 "voltage33" +#define PN_TBB_TEMPPCB "tempPCB" +#define PN_TBB_TEMPTP "tempTP" +#define PN_TBB_TEMPMP0 "tempMP0" +#define PN_TBB_TEMPMP1 "tempMP1" +#define PN_TBB_TEMPMP2 "tempMP2" +#define PN_TBB_TEMPMP3 "tempMP3" +#define PN_TBB_IMAGE_INFO_VERSION "imageInfo.version" +#define PN_TBB_IMAGE_INFO_WRITE_DATE "imageInfo.writeDate" +#define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" +#define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" + +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + +// LogProcessor +#define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" +#define PST_LOG_PROCESSOR "LogProcessor" + +// SASGateway +#define PSN_SAS_GATEWAY "LOFAR_PermSW_Daemons_SASGateway" +#define PST_SAS_GATEWAY "SASGateway" + +// HardwareMonitor +#define PSN_HARDWARE_MONITOR "LOFAR_PermSW_HardwareMonitor" +#define PST_HARDWARE_MONITOR "HardwareMonitor" +#define PN_HWM_RSP_CONNECTED "RSP.connected" +#define PN_HWM_TBB_CONNECTED "TBB.connected" +#define PN_HWM_EC_CONNECTED "EC.connected" + +// SoftwareMonitor +#define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" +#define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" + +// SHMInfoServer +#define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" +#define PST_SHM_INFO_SERVER "SHMInfoServer" + +// StationControl +#define PSN_STATION_CONTROL "LOFAR_PermSW_StationControl" +#define PST_STATION_CONTROL "StationControl" +#define PN_SC_ACTIVE_OBSERVATIONS "activeObservations" + +// ClockControl +#define PSN_CLOCK_CONTROL "LOFAR_PermSW_ClockControl" +#define PST_CLOCK_CONTROL "ClockControl" +#define PN_CLC_CONNECTED "connected" +#define PN_CLC_REQUESTED_CLOCK "requestedClock" +#define PN_CLC_ACTUAL_CLOCK "actualClock" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" + +// StnObservation +#define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" +#define PST_STN_OBSERVATION "StnObservation" +#define PN_OBS_NAME "name" +#define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" +#define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" + +// BeamControl +#define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" +#define PST_BEAM_CONTROL "BeamControl" +#define PN_BC_CONNECTED "connected" +#define PN_BC_SUB_ARRAY "subArray" +#define PN_BC_SUBBAND_LIST "subbandList" +#define PN_BC_BEAMLET_LIST "beamletList" +#define PN_BC_ANGLE1 "angle1" +#define PN_BC_ANGLE2 "angle2" +#define PN_BC_DIRECTION_TYPE "directionType" +#define PN_BC_BEAM_NAME "beamName" + +// CalibrationControl +#define PSN_CALIBRATION_CONTROL "LOFAR_ObsSW_@observation@_CalibrationControl" +#define PST_CALIBRATION_CONTROL "CalibrationControl" +#define PN_CC_CONNECTED "connected" +#define PN_CC_BEAM_NAMES "beamNames" +#define PN_CC_ANTENNA_ARRAY "antennaArray" +#define PN_CC_FILTER "filter" +#define PN_CC_NYQUISTZONE "nyquistzone" +#define PN_CC_RCUS "rcus" + +// TBBControl +#define PSN_TBB_CONTROL "LOFAR_ObsSW_@observation@_TBBControl" +#define PST_TBB_CONTROL "TBBControl" +#define PN_TBC_CONNECTED "connected" +#define PN_TBC_TRIGGER_RCU_NR "trigger.rcuNr" +#define PN_TBC_TRIGGER_SEQUENCE_NR "trigger.sequenceNr" +#define PN_TBC_TRIGGER_TIME "trigger.time" +#define PN_TBC_TRIGGER_SAMPLE_NR "trigger.sampleNr" +#define PN_TBC_TRIGGER_SUM "trigger.sum" +#define PN_TBC_TRIGGER_NR_SAMPLES "trigger.nrSamples" +#define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" +#define PN_TBC_TRIGGER_FLAGS "trigger.flags" +#define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" + +#endif diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/README b/MAC/APL/CEPCU/src/CEPHardwareMonitor/README new file mode 100644 index 0000000000000000000000000000000000000000..546cc88ca7d39be2d4a3c36ed499bb1d9ca31ec3 --- /dev/null +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/README @@ -0,0 +1,10 @@ +HWMonitor via IPMI en bgpartstatus + swlevel.conf + +IPMI -> clustermnachine on/off + +bgpartstatus + swlevel.conf geeft status R00 (busy). +Als busy -> OPER + else als swlevel OFF -> OFF + else ERROR + + diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/zabbix_get b/MAC/APL/CEPCU/src/CEPHardwareMonitor/zabbix_get new file mode 100755 index 0000000000000000000000000000000000000000..d2f8ef579f41c827c9eefc9aaac67f8a703b8a38 Binary files /dev/null and b/MAC/APL/CEPCU/src/CEPHardwareMonitor/zabbix_get differ diff --git a/MAC/APL/CEPCU/src/CEPlogProcessor/PVSSDatapointDefs.h b/MAC/APL/CEPCU/src/CEPlogProcessor/PVSSDatapointDefs.h index 08712199f114fc8b2853d1f6b512ce7c7cc5b094..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/CEPCU/src/CEPlogProcessor/PVSSDatapointDefs.h +++ b/MAC/APL/CEPCU/src/CEPlogProcessor/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v2.0 on Thu Jul 23 13:58:12 UTC 2009 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,20 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#if 0 -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" -#endif - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -39,12 +25,15 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" -#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" #define PN_OBS_CLAIM_PERIOD "claimPeriod" #define PN_OBS_PREPARE_PERIOD "preparePeriod" #define PN_OBS_START_TIME "startTime" @@ -56,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -63,24 +55,24 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" - -// Adder -#define PSN_ADDER "@adder@" -#define PST_ADDER "Adder" -#define PN_ADD_DROPPING "dropping" -#define PN_ADD_NR_BLOCKS_DROPPED "nrBlocksDropped" -#define PN_ADD_LOG_LINE "process.logMsg" +#define PN_OBSCTRL_COMMAND "command" // InputBuffer -#define PSN_INPUT_BUFFER "@inputbuffer@" +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" #define PST_INPUT_BUFFER "InputBuffer" #define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" #define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" #define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" #define PN_IPB_STREAM0_REJECTED "stream0.rejected" @@ -96,13 +88,55 @@ #define PN_IPB_LATE "late" #define PN_IPB_IO_TIME "IOTime" -// Storage -#define PSN_STORAGE "@storage@" -#define PST_STORAGE "Storage" -#define PN_STR_TIME "time" -#define PN_STR_RANK "rank" -#define PN_STR_COUNT "count" -#define PN_STR_DROPPED "dropped" +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" + +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" + +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -159,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -241,10 +277,15 @@ #define PN_RCU_TRIGGER_FILTER "Trigger.filter" #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -272,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -290,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -306,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -326,6 +413,9 @@ #define PN_OBS_NAME "name" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" @@ -362,5 +452,6 @@ #define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" #define PN_TBC_TRIGGER_FLAGS "trigger.flags" #define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" #endif diff --git a/MAC/APL/CEPCU/src/CMakeLists.txt b/MAC/APL/CEPCU/src/CMakeLists.txt index 7eb79319c10f8afaede83d28120153973a0d69b6..fcc62f24f9181edf89b8d22fa259eb0505e771a8 100644 --- a/MAC/APL/CEPCU/src/CMakeLists.txt +++ b/MAC/APL/CEPCU/src/CMakeLists.txt @@ -13,4 +13,5 @@ lofar_add_bin_program(versioncepcu versioncepcu.cc) add_subdirectory(OnlineControl) add_subdirectory(PythonControl) add_subdirectory(CEPlogProcessor) +add_subdirectory(CEPHardwareMonitor) # add_subdirectory(OfflineControl) diff --git a/MAC/APL/CEPCU/src/OnlineControl/CMakeLists.txt b/MAC/APL/CEPCU/src/OnlineControl/CMakeLists.txt index 78eaac88f09dbdaa1bf7780c706432a75172ad94..a97577bda5839778d9b90238fada73087b9f2d39 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/CMakeLists.txt +++ b/MAC/APL/CEPCU/src/OnlineControl/CMakeLists.txt @@ -9,3 +9,5 @@ lofar_add_bin_program(OnlineControl OnlineControlMain.cc OnlineControl.cc CEPApplMgr.cc) + +lofar_add_executable(tPVSSMapping tPVSSMapping.cc) diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc index 5012f8b4fa45cbe2f5fe8d037bc89f9c4b3d06f2..61e13a626d0d398ac93e2aef947eca31050eb38c 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc @@ -28,7 +28,9 @@ #include <Common/ParameterSet.h> #include <Common/ParameterRecord.h> #include <Common/Exceptions.h> +#include <Common/SystemUtil.h> #include <ApplCommon/StationInfo.h> +#include <ApplCommon/Observation.h> #include <ApplCommon/LofarDirs.h> #include <MACIO/MACServiceInfo.h> #include <GCF/TM/GCF_Protocols.h> @@ -64,6 +66,7 @@ static OnlineControl* thisOnlineControl = 0; OnlineControl::OnlineControl(const string& cntlrName) : GCFTask ((State)&OnlineControl::initial_state,cntlrName), itsPropertySet (0), + itsBGPApplPropSet (0), itsPropertySetInitialized (false), itsParentControl (0), itsParentPort (0), @@ -304,10 +307,9 @@ void OnlineControl::_databaseEventHandler(GCFEvent& event) // // initial_state(event, port) // -// Setup all connections. +// Create my own propertySet // -GCFEvent::TResult OnlineControl::initial_state(GCFEvent& event, - GCFPortInterface& port) +GCFEvent::TResult OnlineControl::initial_state(GCFEvent& event, GCFPortInterface& port) { LOG_INFO_STR ("initial:" << eventName(event) << "@" << port.getName()); @@ -320,7 +322,8 @@ GCFEvent::TResult OnlineControl::initial_state(GCFEvent& event, case F_INIT: { // Get access to my own propertyset. // uint32 obsID = globalParameterSet()->getUint32("Observation.ObsID"); - string propSetName(createPropertySetName(PSN_ONLINE_CONTROL, getName())); + string obsDPname = globalParameterSet()->getString("_DPname"); + string propSetName(createPropertySetName(PSN_ONLINE_CONTROL, getName(), obsDPname)); LOG_DEBUG_STR ("Activating PropertySet: "<< propSetName); itsPropertySet = new RTDBPropertySet(propSetName, PST_ONLINE_CONTROL, @@ -330,12 +333,12 @@ GCFEvent::TResult OnlineControl::initial_state(GCFEvent& event, break; case DP_CREATED: { - // NOTE: thsi function may be called DURING the construction of the PropertySet. + // NOTE: this function may be called DURING the construction of the PropertySet. // Always exit this event in a way that GCF can end the construction. DPCreatedEvent dpEvent(event); LOG_DEBUG_STR("Result of creating " << dpEvent.DPname << " = " << dpEvent.result); itsTimerPort->cancelAllTimers(); - itsTimerPort->setTimer(0.0); + itsTimerPort->setTimer(0.1); } break; @@ -344,7 +347,63 @@ GCFEvent::TResult OnlineControl::initial_state(GCFEvent& event, LOG_TRACE_FLOW ("Updateing state to PVSS"); itsPropertySet->setValue(PN_FSM_CURRENT_ACTION, GCFPVString("initial")); itsPropertySet->setValue(PN_FSM_ERROR, GCFPVString("")); - + + LOG_DEBUG ("Going to create BGPAppl datapoint"); + TRAN(OnlineControl::propset_state); // go to next state. + } + break; + + case F_CONNECTED: + ASSERTSTR (&port == itsParentPort, "F_CONNECTED event from port " << port.getName()); + break; + + case F_DISCONNECTED: + break; + + default: + LOG_DEBUG_STR ("initial, default"); + status = GCFEvent::NOT_HANDLED; + break; + } + return (status); +} + +// +// propset_state(event, port) +// +// Connect to BGPAppl DP and start rest of tasks +// +GCFEvent::TResult OnlineControl::propset_state(GCFEvent& event, GCFPortInterface& port) +{ + LOG_INFO_STR ("propset:" << eventName(event) << "@" << port.getName()); + + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch (event.signal) { + case F_ENTRY: { + // Get access to my own propertyset. +// uint32 obsID = globalParameterSet()->getUint32("Observation.ObsID"); + string obsDPname = globalParameterSet()->getString("_DPname"); + string propSetName(createPropertySetName(PSN_BGP_APPL, getName(), obsDPname)); + LOG_DEBUG_STR ("Activating PropertySet: "<< propSetName); + itsBGPApplPropSet = new RTDBPropertySet(propSetName, + PST_BGP_APPL, + PSAT_RW, + this); + } + break; + + case DP_CREATED: { + // NOTE: this function may be called DURING the construction of the PropertySet. + // Always exit this event in a way that GCF can end the construction. + DPCreatedEvent dpEvent(event); + LOG_DEBUG_STR("Result of creating " << dpEvent.DPname << " = " << dpEvent.result); + itsTimerPort->cancelAllTimers(); + itsTimerPort->setTimer(0.1); + } + break; + + case F_TIMER: { // must be timer that PropSet is online. // start StopTimer for safety. LOG_INFO_STR("Starting QUIT timer that expires 5 seconds after end of observation"); ptime now(second_clock::universal_time()); @@ -361,15 +420,14 @@ GCFEvent::TResult OnlineControl::initial_state(GCFEvent& event, break; case F_CONNECTED: - ASSERTSTR (&port == itsParentPort, - "F_CONNECTED event from port " << port.getName()); + ASSERTSTR (&port == itsParentPort, "F_CONNECTED event from port " << port.getName()); break; case F_DISCONNECTED: break; default: - LOG_DEBUG_STR ("initial, default"); + LOG_DEBUG_STR ("propset, default"); status = GCFEvent::NOT_HANDLED; break; } @@ -441,6 +499,7 @@ GCFEvent::TResult OnlineControl::active_state(GCFEvent& event, GCFPortInterface& itsLogControlPort->send(announce); // execute this state _setState(CTState::CONNECT); + _setupBGPmappingTables(); _doBoot(); // start ACC's and boot them break; } @@ -573,6 +632,84 @@ GCFEvent::TResult OnlineControl::finishing_state(GCFEvent& event, GCFPortInterfa return (status); } +// +// _setupBGPmappingTables +// +void OnlineControl::_setupBGPmappingTables() +{ + Observation theObs(globalParameterSet(), false); + int nrStreams = theObs.streamsToStorage.size(); + LOG_DEBUG_STR("_setupBGPmapping: " << nrStreams << " streams found."); + + // e.g. CS001 , [0,2,3,6] , [L36000_SAP000_SB000_uv.MS, ...] , [1,3,5,4] + GCFPValueArray ionodeArr; + GCFPValueArray locusArr; + GCFPValueArray adderArr; + GCFPValueArray writerArr; + GCFPValueArray dpArr; + GCFPValueArray dptypeArr; + + uint prevPset = (nrStreams ? theObs.streamsToStorage[0].sourcePset : -1); + vector<string> locusVector; + vector<int> adderVector; + vector<int> writerVector; + vector<string> DPVector; + vector<string> DPtypeVector; + for (int i = 0; i < nrStreams; i++) { + if (theObs.streamsToStorage[i].sourcePset != prevPset) { // other Pset? write current vector to the database. + ionodeArr.push_back(new GCFPVInteger(prevPset)); + { stringstream os; + writeVector(os, locusVector); + locusArr.push_back (new GCFPVString(os.str())); + } + { stringstream os; + writeVector(os, adderVector); + adderArr.push_back (new GCFPVString(os.str())); + } + { stringstream os; + writeVector(os, writerVector); + writerArr.push_back(new GCFPVString(os.str())); + } + { stringstream os; + writeVector(os, DPVector); + dpArr.push_back (new GCFPVString(os.str())); + } + { stringstream os; + writeVector(os, DPtypeVector); + dptypeArr.push_back(new GCFPVString(os.str())); + } + // clear the collecting vectors + locusVector.clear(); + adderVector.clear(); + writerVector.clear(); + DPVector.clear(); + DPtypeVector.clear(); + prevPset = theObs.streamsToStorage[i].sourcePset; + } + // extend vector with info + locusVector.push_back (theObs.streamsToStorage[i].destStorageNode); + adderVector.push_back (theObs.streamsToStorage[i].adderNr); + writerVector.push_back(theObs.streamsToStorage[i].writerNr); + DPVector.push_back (theObs.streamsToStorage[i].filename); + DPtypeVector.push_back(theObs.streamsToStorage[i].dataProduct); + } + itsBGPApplPropSet->setValue(PN_BGPA_IO_NODE_LIST, GCFPVDynArr(LPT_DYNINTEGER, ionodeArr)); + itsBGPApplPropSet->setValue(PN_BGPA_LOCUS_NODE_LIST, GCFPVDynArr(LPT_DYNSTRING, locusArr)); + itsBGPApplPropSet->setValue(PN_BGPA_ADDER_LIST, GCFPVDynArr(LPT_DYNSTRING, adderArr)); + itsBGPApplPropSet->setValue(PN_BGPA_WRITER_LIST, GCFPVDynArr(LPT_DYNSTRING, writerArr)); + itsBGPApplPropSet->setValue(PN_BGPA_DATA_PRODUCT_LIST, GCFPVDynArr(LPT_DYNSTRING, dpArr)); + itsBGPApplPropSet->setValue(PN_BGPA_DATA_PRODUCT_TYPE_LIST, GCFPVDynArr(LPT_DYNSTRING, dptypeArr)); + + // release claimed memory. + for (int i = ionodeArr.size()-1; i>=0; i--) { + delete ionodeArr[i]; + delete locusArr[i]; + delete adderArr[i]; + delete writerArr[i]; + delete dpArr[i]; + delete dptypeArr[i]; + } +} // // _doBoot() diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h index 6594ed84a2c002dc9c3bb871a40e006fb3382e2c..09e695da178ecd507c4aea046f97d215ec09545e 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h @@ -65,15 +65,14 @@ public: explicit OnlineControl(const string& cntlrName); ~OnlineControl(); - // During the initial state all connections with the other programs are made. - GCFEvent::TResult initial_state (GCFEvent& e, - GCFPortInterface& p); + // Connect to our own propertyset. + GCFEvent::TResult initial_state (GCFEvent& e, GCFPortInterface& p); + // Connect to BGPAppl propset and start remaining tasks. + GCFEvent::TResult propset_state (GCFEvent& e, GCFPortInterface& p); // Normal control mode. - GCFEvent::TResult active_state (GCFEvent& e, - GCFPortInterface& p); + GCFEvent::TResult active_state (GCFEvent& e, GCFPortInterface& p); // Finishing mode. - GCFEvent::TResult finishing_state(GCFEvent& event, - GCFPortInterface& port); + GCFEvent::TResult finishing_state(GCFEvent& event, GCFPortInterface& port); // Interrupthandler for switching to finisingstate when exiting the program static void signalHandler (int signum); @@ -95,6 +94,7 @@ private: OnlineControl(const OnlineControl&); OnlineControl& operator=(const OnlineControl&); + void _setupBGPmappingTables(); void _doBoot(); void _doQuit(); void _finishController (uint16_t result); @@ -122,6 +122,7 @@ private: // ----- datamembers ----- RTDBPropertySet* itsPropertySet; + RTDBPropertySet* itsBGPApplPropSet; bool itsPropertySetInitialized; // pointer to parent control task diff --git a/MAC/APL/CEPCU/src/OnlineControl/PVSSDatapointDefs.h b/MAC/APL/CEPCU/src/OnlineControl/PVSSDatapointDefs.h index cbd965ef734851eac9ee2fe781706f559b0efca9..95cadd7cb63cd86cb01c7f49b46f759020968018 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/PVSSDatapointDefs.h +++ b/MAC/APL/CEPCU/src/OnlineControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v1.0 on Thu Mar 19 14:56:58 UTC 2009 +// This file was generated by create_db_files v2.0 on Fri Apr 13 09:04:54 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -42,7 +42,6 @@ #define PST_OBSERVATION "Observation" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" -#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" #define PN_OBS_CLAIM_PERIOD "claimPeriod" #define PN_OBS_PREPARE_PERIOD "preparePeriod" #define PN_OBS_START_TIME "startTime" @@ -63,22 +62,68 @@ #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" #define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" +#define PN_OBSCTRL_COMMAND "command" + +// Adder +#define PSN_ADDER "@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_NR_BLOCKS_DROPPED "nrBlocksDropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_STORAGE_NODE "storageNode" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// InputBuffer +#define PSN_INPUT_BUFFER "@inputbuffer@" +#define PST_INPUT_BUFFER "InputBuffer" +#define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" +#define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" +#define PN_IPB_STREAM0_REJECTED "stream0.rejected" +#define PN_IPB_STREAM1_BLOCKS_IN "stream1.blocksIn" +#define PN_IPB_STREAM1_PERC_BAD "stream1.percBad" +#define PN_IPB_STREAM1_REJECTED "stream1.rejected" +#define PN_IPB_STREAM2_BLOCKS_IN "stream2.blocksIn" +#define PN_IPB_STREAM2_PERC_BAD "stream2.percBad" +#define PN_IPB_STREAM2_REJECTED "stream2.rejected" +#define PN_IPB_STREAM3_BLOCKS_IN "stream3.blocksIn" +#define PN_IPB_STREAM3_PERC_BAD "stream3.percBad" +#define PN_IPB_STREAM3_REJECTED "stream3.rejected" +#define PN_IPB_LATE "late" +#define PN_IPB_IO_TIME "IOTime" + +// Storage +#define PSN_STORAGE "@storage@" +#define PST_STORAGE "Storage" +#define PN_STR_TIME "time" +#define PN_STR_COUNT "count" +#define PN_STR_DROPPED "dropped" // OnlineControl #define PSN_ONLINE_CONTROL "LOFAR_ObsSW_@observation@_OnlineControl" #define PST_ONLINE_CONTROL "OnlineControl" -// Correlator -#define PSN_CORRELATOR "LOFAR_ObsSW_@observation@_OnlineControl_Correlator" -#define PST_CORRELATOR "Correlator" - -// StorageAppl -#define PSN_STORAGE_APPL "LOFAR_ObsSW_@observation@_OnlineControl_StorageAppl" -#define PST_STORAGE_APPL "StorageAppl" +// BGPAppl +#define PSN_BGP_APPL "LOFAR_ObsSW_@observation@_OnlineControl_BGPAppl" +#define PST_BGP_APPL "BGPAppl" +#define PN_BGPA_IO_NODE_LIST "ioNodeList" +#define PN_BGPA_LOCUS_NODE_LIST "locusNodeList" +#define PN_BGPA_ADDER_LIST "adderList" +#define PN_BGPA_WRITER_LIST "writerList" +#define PN_BGPA_DATA_PRODUCT_LIST "dataProductList" +#define PN_BGPA_DATA_PRODUCT_TYPE_LIST "dataProductTypeList" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -217,10 +262,15 @@ #define PN_RCU_TRIGGER_FILTER "Trigger.filter" #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -294,7 +344,7 @@ #define PN_ANT_RCUY "RCUY" #define PN_ANT_DELTAX "deltaX" #define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_ANT_DELTAZ "deltaZ" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -302,6 +352,9 @@ #define PN_OBS_NAME "name" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HB_ABITMAP "HBAbitmap" +#define PN_OBS_LB_ABITMAP "LBAbitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" @@ -338,5 +391,6 @@ #define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" #define PN_TBC_TRIGGER_FLAGS "trigger.flags" #define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" #endif diff --git a/MAC/APL/CEPCU/src/OnlineControl/tPVSSMapping.cc b/MAC/APL/CEPCU/src/OnlineControl/tPVSSMapping.cc new file mode 100644 index 0000000000000000000000000000000000000000..a1d6039e88591175777534f90f2888719b1eb1c0 --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/tPVSSMapping.cc @@ -0,0 +1,87 @@ +//# tPVSSmapping.cc: test StreamToStrorage conversion to PVSS dps. +//# +//# Copyright (C) 2006 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: OnlineControl.cc 18153 2011-05-31 23:03:25Z schoenmakers $ +#include <lofar_config.h> +#include <Common/LofarLogger.h> + +#include <signal.h> +#include <Common/StreamUtil.h> +//#include <Common/lofar_vector.h> +//#include <Common/lofar_string.h> +#include <Common/ParameterSet.h> +#include <Common/Exceptions.h> +#include <Common/SystemUtil.h> +#include <ApplCommon/StationInfo.h> +#include <ApplCommon/Observation.h> + +using namespace std; +using namespace LOFAR; + +int main(int argc, char* argv[]) +{ + if (argc < 2) { + cout << "Syntax: " << argv[0] << " parameterSet" << endl; + return (-1); + } + + ParameterSet thePS(argv[1]); + Observation theObs(&thePS, false); + int nrStreams = theObs.streamsToStorage.size(); + cout << "_setupBGPmapping: " << nrStreams << " streams found." << endl; + cout << "ioNode , locusNodes , adders , writers , dataProducts, dataProductTypes" << endl; + + uint prevPset = (nrStreams ? theObs.streamsToStorage[0].sourcePset : -1); + vector<string> locusVector; + vector<int> adderVector; + vector<int> writerVector; + vector<string> DPVector; + vector<string> DPtypeVector; + for (int i = 0; i < nrStreams; i++) { + if (theObs.streamsToStorage[i].sourcePset != prevPset) { // other Pset? write current vector to the database. + stringstream os; + writeVector(os, locusVector); + os << ","; + writeVector(os, adderVector); + os << ","; + writeVector(os, writerVector); + os << ","; + writeVector(os, DPVector); + os << ","; + writeVector(os, DPtypeVector); + cout << prevPset << "," << os.str() << endl; + // clear the collecting vectors + locusVector.clear(); + adderVector.clear(); + writerVector.clear(); + DPVector.clear(); + DPtypeVector.clear(); + prevPset = theObs.streamsToStorage[i].sourcePset; + } + // extend vector with info + locusVector.push_back (theObs.streamsToStorage[i].destStorageNode); + adderVector.push_back (theObs.streamsToStorage[i].adderNr); + writerVector.push_back(theObs.streamsToStorage[i].writerNr); + DPVector.push_back (theObs.streamsToStorage[i].filename); + DPtypeVector.push_back(theObs.streamsToStorage[i].dataProduct); + } + return (0); +} + diff --git a/MAC/APL/CEPCU/src/PythonControl/PVSSDatapointDefs.h b/MAC/APL/CEPCU/src/PythonControl/PVSSDatapointDefs.h index 19f33ca2d9a265451de7f93fca6a0172dbf4d73e..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/CEPCU/src/PythonControl/PVSSDatapointDefs.h +++ b/MAC/APL/CEPCU/src/PythonControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v2.0 on Tue Mar 9 08:12:06 UTC 2010 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,6 +25,10 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" @@ -53,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -60,25 +55,24 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" #define PN_OBSCTRL_COMMAND "command" -// Adder -#define PSN_ADDER "@adder@" -#define PST_ADDER "Adder" -#define PN_ADD_DROPPING "dropping" -#define PN_ADD_NR_BLOCKS_DROPPED "nrBlocksDropped" -#define PN_ADD_LOG_LINE "logLine" - // InputBuffer -#define PSN_INPUT_BUFFER "@inputbuffer@" +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" #define PST_INPUT_BUFFER "InputBuffer" #define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" #define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" #define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" #define PN_IPB_STREAM0_REJECTED "stream0.rejected" @@ -94,16 +88,55 @@ #define PN_IPB_LATE "late" #define PN_IPB_IO_TIME "IOTime" -// Storage -#define PSN_STORAGE "@storage@" -#define PST_STORAGE "Storage" -#define PN_STR_TIME "time" -#define PN_STR_COUNT "count" -#define PN_STR_DROPPED "dropped" +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" + +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" + +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" -// PythonControl -#define PSN_PYTHON_CONTROL "LOFAR_ObsSW_@observation@_PythonControl" -#define PST_PYTHON_CONTROL "PythonControl" +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -160,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -243,10 +278,14 @@ #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" #define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -274,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -292,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -308,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -329,6 +414,8 @@ #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" #define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" diff --git a/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc b/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc index 6ca68cbe2fd7f54e5800358cc0b2055af4d643e2..ac863758473e20476fe6708ea4f4763015592975 100644 --- a/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc +++ b/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc @@ -185,6 +185,10 @@ bool PythonControl::_startPython(const string& pythonProg, } } + // Readin parameters from the obsercationfile. + itsFeedbackFile = observationParset(obsID)+"_feedback"; + LOG_INFO_STR ("Expect metadata to be in file " << itsFeedbackFile); + // construct system command string startCmd; string startScript("startPython.sh"); @@ -203,13 +207,23 @@ bool PythonControl::_startPython(const string& pythonProg, myHostname(true).c_str(), parentService.c_str(), itsPythonName.c_str()); } LOG_INFO_STR("About to start: " << startCmd); - - int32 result = system (startCmd.c_str()); - LOG_INFO_STR ("Result of start = " << result); - - // Readin parameters from the obsercationfile. - itsFeedbackFile = observationParset(obsID)+"_feedback"; - LOG_INFO_STR ("Expecting metadata in file " << itsFeedbackFile); +#if 1 + FILE* pipe = popen(startCmd.c_str(), "r"); + if (!pipe) { + LOG_FATAL_STR("Couldn't execute '" << startCmd << ", errno = " << strerror(errno)); + return (false); + } + LOG_INFO("Output of command: ..."); + while (!feof(pipe)) { + char buffer[1024]; + LOG_INFO_STR(fgets(buffer, 1024, pipe)); + } + LOG_INFO("... end of command output"); + int result = pclose(pipe); +#else + int result = system (startCmd.c_str()); +#endif + LOG_INFO_STR ("Result of command = " << result); if (result == -1) { return (false); diff --git a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRreadRequest.h b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRreadRequest.h index ce2f2951c9c6f72f970e8cce54602160aee5e809..4c0888b6c5844bbc2df74cf3aacbd985b38f2396 100644 --- a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRreadRequest.h +++ b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRreadRequest.h @@ -47,9 +47,9 @@ public: //@{ // --- marshalling methods --- - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize(); + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} // --- datamembers --- diff --git a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRreadVector.h b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRreadVector.h index b949463c89803cac76804b0ab1e73da54801ca46..0e082b4ea21bccf60c86a1dd62bef5e4b56402fe 100644 --- a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRreadVector.h +++ b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRreadVector.h @@ -43,9 +43,9 @@ public: //@{ // --- marshalling methods --- - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize(); + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} // --- datamembers --- diff --git a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRrecordRequest.h b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRrecordRequest.h index 1dd2be542cfe4c50244d2be9d7423527347652d6..dda38815376797930a855cc8d38ee140039c9ee1 100644 --- a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRrecordRequest.h +++ b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRrecordRequest.h @@ -44,9 +44,9 @@ public: //@{ // --- marshalling methods --- - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize(); + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} // --- datamembers --- diff --git a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRrecordVector.h b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRrecordVector.h index 1d8adefad8f06b935abdbc80a3ae4194f5f95ca6..60b4ac5cb5270206070b058800c8492dc9668689 100644 --- a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRrecordVector.h +++ b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRrecordVector.h @@ -43,9 +43,9 @@ public: //@{ // --- marshalling methods --- - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize(); + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} // --- datamembers --- diff --git a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRstopRequest.h b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRstopRequest.h index 5bf9b545ef104fced0de4908e541bc137b7546af..d6bafc1f9614b32dfa6a1904f7bd6a5eade2f1ab 100644 --- a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRstopRequest.h +++ b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRstopRequest.h @@ -44,9 +44,9 @@ public: //@{ // --- marshalling methods --- - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize(); + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} // --- datamembers --- diff --git a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRstopVector.h b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRstopVector.h index a14ffe5689b374197a4c7f33d5452c8febbfb53b..355a4d1e34017f092fa4f9f9287713f7dd97923b 100644 --- a/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRstopVector.h +++ b/MAC/APL/CR_Protocol/include/APL/CR_Protocol/CRstopVector.h @@ -43,9 +43,9 @@ public: //@{ // --- marshalling methods --- - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize(); + size_t pack (void* buffer); + size_t unpack(void *buffer); //@} // --- datamembers --- diff --git a/MAC/APL/CR_Protocol/src/CRreadRequest.cc b/MAC/APL/CR_Protocol/src/CRreadRequest.cc index 04c9e919cbd6573fc430daee7a12cf1f38c4101f..03a059de2a264e9cf369319b7590a6eb706b7838 100644 --- a/MAC/APL/CR_Protocol/src/CRreadRequest.cc +++ b/MAC/APL/CR_Protocol/src/CRreadRequest.cc @@ -26,7 +26,7 @@ //# Includes #include <Common/LofarLogger.h> #include <APL/CR_Protocol/CRreadRequest.h> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> namespace LOFAR { namespace CR_Protocol { @@ -40,27 +40,27 @@ ostream& CRreadRequest::print (ostream& os) const // --- marshalling methods --- -unsigned int CRreadRequest::getSize() +size_t CRreadRequest::getSize() { - return(MSH_STRING_SIZE(stationList) + MSH_STRING_SIZE(rcuList) + readTime.getSize() + timeBefore.getSize() + timeAfter.getSize()); + return(MSH_size(stationList) + MSH_size(rcuList) + readTime.getSize() + timeBefore.getSize() + timeAfter.getSize()); } -unsigned int CRreadRequest::pack (void* buffer) +size_t CRreadRequest::pack (char* buffer) const { - unsigned int offset(0); - MSH_PACK_STRING(buffer, offset, stationList); - MSH_PACK_STRING(buffer, offset, rcuList); + size_t offset = 0; + MSH_pack(buffer, offset, stationList); + MSH_pack(buffer, offset, rcuList); offset += readTime.pack((char*)(buffer)+offset); offset += timeBefore.pack((char*)(buffer)+offset); offset += timeAfter.pack((char*)(buffer)+offset); return (offset); } -unsigned int CRreadRequest::unpack(void *buffer) +size_t CRreadRequest::unpack(const char *buffer) { - unsigned int offset(0); - MSH_UNPACK_STRING(buffer, offset, stationList); - MSH_UNPACK_STRING(buffer, offset, rcuList); + size_t offset = 0; + MSH_unpack(buffer, offset, stationList); + MSH_unpack(buffer, offset, rcuList); offset += readTime.unpack((char*)(buffer)+offset); offset += timeBefore.unpack((char*)(buffer)+offset); offset += timeAfter.unpack((char*)(buffer)+offset); diff --git a/MAC/APL/CR_Protocol/src/CRreadVector.cc b/MAC/APL/CR_Protocol/src/CRreadVector.cc index a51a933d7cc6142d7763fa54ec22fc4d997ec567..a06f45e152c744555ae80572a0b45b974981cda4 100644 --- a/MAC/APL/CR_Protocol/src/CRreadVector.cc +++ b/MAC/APL/CR_Protocol/src/CRreadVector.cc @@ -43,35 +43,35 @@ ostream& CRreadVector::print (ostream& os) const // --- marshalling methods --- -unsigned int CRreadVector::getSize() +size_t CRreadVector::getSize() { - uint offset(sizeof(uint32)); - uint32 nrElems(requests.size()); + size_t offset(sizeof(uint32)); + uint32 nrElems(requests.size()); for (size_t i = 0; i < nrElems; i++) { offset += requests[i].getSize(); } return (offset); } -unsigned int CRreadVector::pack (void* buffer) +size_t CRreadVector::pack (char* buffer) const { - unsigned int offset(sizeof(uint32)); - uint32 nrElems(requests.size()); + size_t offset(sizeof(uint32)); + uint32 nrElems(requests.size()); memcpy(buffer, &nrElems, sizeof(uint32)); for (size_t i = 0; i < nrElems; i++) { - offset += requests[i].pack((char*)(buffer)+offset); + offset += requests[i].pack(buffer + offset); } return (offset); } -unsigned int CRreadVector::unpack(void *buffer) +size_t CRreadVector::unpack(const char *buffer) { - unsigned int offset(sizeof(uint32)); - uint32 nrElems; + size_t offset(sizeof(uint32)); + uint32 nrElems; memcpy(&nrElems, buffer, sizeof(uint32)); requests.resize(nrElems); for (size_t i = 0; i < nrElems; i++) { - offset += requests[i].unpack((char*)(buffer)+offset); + offset += requests[i].unpack(buffer + offset); } return (offset); } diff --git a/MAC/APL/CR_Protocol/src/CRrecordRequest.cc b/MAC/APL/CR_Protocol/src/CRrecordRequest.cc index d744f5d4beaee3e3703875b4c2dbde5251f6ce29..5630375bdb7e7dd30627aa0529e7a133219537c3 100644 --- a/MAC/APL/CR_Protocol/src/CRrecordRequest.cc +++ b/MAC/APL/CR_Protocol/src/CRrecordRequest.cc @@ -26,7 +26,7 @@ //# Includes #include <Common/LofarLogger.h> #include <APL/CR_Protocol/CRrecordRequest.h> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> namespace LOFAR { namespace CR_Protocol { @@ -40,24 +40,24 @@ ostream& CRrecordRequest::print (ostream& os) const // --- marshalling methods --- -unsigned int CRrecordRequest::getSize() +size_t CRrecordRequest::getSize() { - return(MSH_STRING_SIZE(stationList) + MSH_STRING_SIZE(rcuList)); + return(MSH_size(stationList) + MSH_size(rcuList)); } -unsigned int CRrecordRequest::pack (void* buffer) +size_t CRrecordRequest::pack (char* buffer) const { - unsigned int offset(0); - MSH_PACK_STRING(buffer, offset, stationList); - MSH_PACK_STRING(buffer, offset, rcuList); + size_t offset = 0; + MSH_pack(buffer, offset, stationList); + MSH_pack(buffer, offset, rcuList); return (offset); } -unsigned int CRrecordRequest::unpack(void *buffer) +size_t CRrecordRequest::unpack(const char *buffer) { - unsigned int offset(0); - MSH_UNPACK_STRING(buffer, offset, stationList); - MSH_UNPACK_STRING(buffer, offset, rcuList); + size_t offset = 0; + MSH_unpack(buffer, offset, stationList); + MSH_unpack(buffer, offset, rcuList); return (offset); } diff --git a/MAC/APL/CR_Protocol/src/CRrecordVector.cc b/MAC/APL/CR_Protocol/src/CRrecordVector.cc index 15525819696324edc5751b48aa638942bd73b5ff..e9423146f8f0b54b016b51fea231d88973a385e8 100644 --- a/MAC/APL/CR_Protocol/src/CRrecordVector.cc +++ b/MAC/APL/CR_Protocol/src/CRrecordVector.cc @@ -43,35 +43,35 @@ ostream& CRrecordVector::print (ostream& os) const // --- marshalling methods --- -unsigned int CRrecordVector::getSize() +size_t CRrecordVector::getSize() { - uint offset(sizeof(uint32)); - uint32 nrElems(requests.size()); + size_t offset(sizeof(uint32)); + uint32 nrElems(requests.size()); for (size_t i = 0; i < nrElems; i++) { offset += requests[i].getSize(); } return (offset); } -unsigned int CRrecordVector::pack (void* buffer) +size_t CRrecordVector::pack (char* buffer) const { - unsigned int offset(sizeof(uint32)); - uint32 nrElems(requests.size()); + size_t offset(sizeof(uint32)); + uint32 nrElems(requests.size()); memcpy(buffer, &nrElems, sizeof(uint32)); for (size_t i = 0; i < nrElems; i++) { - offset += requests[i].pack((char*)(buffer)+offset); + offset += requests[i].pack(buffer + offset); } return (offset); } -unsigned int CRrecordVector::unpack(void *buffer) +size_t CRrecordVector::unpack(const char *buffer) { - unsigned int offset(sizeof(uint32)); - uint32 nrElems; + size_t offset(sizeof(uint32)); + uint32 nrElems; memcpy(&nrElems, buffer, sizeof(uint32)); requests.resize(nrElems); for (size_t i = 0; i < nrElems; i++) { - offset += requests[i].unpack((char*)(buffer)+offset); + offset += requests[i].unpack(buffer + offset); } return (offset); } diff --git a/MAC/APL/CR_Protocol/src/CRstopRequest.cc b/MAC/APL/CR_Protocol/src/CRstopRequest.cc index 034bb9dc40428edba08acc23da68ee28ba91344c..c7197c1a65151a3ccce39fca669c2694dd8af413 100644 --- a/MAC/APL/CR_Protocol/src/CRstopRequest.cc +++ b/MAC/APL/CR_Protocol/src/CRstopRequest.cc @@ -26,7 +26,7 @@ //# Includes #include <Common/LofarLogger.h> #include <APL/CR_Protocol/CRstopRequest.h> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> namespace LOFAR { namespace CR_Protocol { @@ -40,26 +40,26 @@ ostream& CRstopRequest::print (ostream& os) const // --- marshalling methods --- -unsigned int CRstopRequest::getSize() +size_t CRstopRequest::getSize() { - return(MSH_STRING_SIZE(stationList) + MSH_STRING_SIZE(rcuList) + stopTime.getSize()); + return(MSH_size(stationList) + MSH_size(rcuList) + stopTime.getSize()); } -unsigned int CRstopRequest::pack (void* buffer) +size_t CRstopRequest::pack (char* buffer) const { - unsigned int offset(0); - MSH_PACK_STRING(buffer, offset, stationList); - MSH_PACK_STRING(buffer, offset, rcuList); - offset += stopTime.pack((char*)(buffer)+offset); + size_t offset = 0; + MSH_pack(buffer, offset, stationList); + MSH_pack(buffer, offset, rcuList); + offset += stopTime.pack(buffer + offset); return (offset); } - -unsigned int CRstopRequest::unpack(void *buffer) + +size_t CRstopRequest::unpack(const char *buffer) { - unsigned int offset(0); - MSH_UNPACK_STRING(buffer, offset, stationList); - MSH_UNPACK_STRING(buffer, offset, rcuList); - offset += stopTime.unpack((char*)(buffer)+offset); + size_t offset = 0; + MSH_unpack(buffer, offset, stationList); + MSH_unpack(buffer, offset, rcuList); + offset += stopTime.unpack(buffer + offset); return (offset); } diff --git a/MAC/APL/CR_Protocol/src/CRstopVector.cc b/MAC/APL/CR_Protocol/src/CRstopVector.cc index 7e27687c54652522c06fb1d6343e7a0bf2679513..1cd817a7a73c123979d8ebff20b5991a5c61f402 100644 --- a/MAC/APL/CR_Protocol/src/CRstopVector.cc +++ b/MAC/APL/CR_Protocol/src/CRstopVector.cc @@ -43,20 +43,20 @@ ostream& CRstopVector::print (ostream& os) const // --- marshalling methods --- -unsigned int CRstopVector::getSize() +size_t CRstopVector::getSize() { - uint offset(sizeof(uint32)); - uint32 nrElems(requests.size()); + size_t offset(sizeof(uint32)); + uint32 nrElems(requests.size()); for (size_t i = 0; i < nrElems; i++) { offset += requests[i].getSize(); } return (offset); } -unsigned int CRstopVector::pack (void* buffer) +size_t CRstopVector::pack (void* buffer) { - unsigned int offset(sizeof(uint32)); - uint32 nrElems(requests.size()); + size_t offset(sizeof(uint32)); + uint32 nrElems(requests.size()); memcpy(buffer, &nrElems, sizeof(uint32)); for (size_t i = 0; i < nrElems; i++) { offset += requests[i].pack((char*)(buffer)+offset); @@ -64,10 +64,10 @@ unsigned int CRstopVector::pack (void* buffer) return (offset); } -unsigned int CRstopVector::unpack(void *buffer) +size_t CRstopVector::unpack(void *buffer) { - unsigned int offset(sizeof(uint32)); - uint32 nrElems; + size_t offset(sizeof(uint32)); + uint32 nrElems; memcpy(&nrElems, buffer, sizeof(uint32)); requests.resize(nrElems); for (size_t i = 0; i < nrElems; i++) { diff --git a/MAC/APL/CUDaemons/src/CTStartDaemon/startController.sh b/MAC/APL/CUDaemons/src/CTStartDaemon/startController.sh index ec8a9ae0cd0a50a2a1a3c7ab387469159931e76e..adf013d325e97b761ab28b9cd40e3c87b34f4078 100755 --- a/MAC/APL/CUDaemons/src/CTStartDaemon/startController.sh +++ b/MAC/APL/CUDaemons/src/CTStartDaemon/startController.sh @@ -4,7 +4,7 @@ # # start process -($1 $2 $3 $4 1>/dev/null 2>&1 ) & +($1 $2 $3 $4 1>>"/opt/lofar/var/log/$2.stdout" 2>&1 ) & # get its pid # echo $! diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/PVSSDatapointDefs.h b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/PVSSDatapointDefs.h index cbd965ef734851eac9ee2fe781706f559b0efca9..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/PVSSDatapointDefs.h +++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v1.0 on Thu Mar 19 14:56:58 UTC 2009 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,12 +25,15 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" -#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" #define PN_OBS_CLAIM_PERIOD "claimPeriod" #define PN_OBS_PREPARE_PERIOD "preparePeriod" #define PN_OBS_START_TIME "startTime" @@ -54,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -61,24 +55,88 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" +#define PN_OBSCTRL_COMMAND "command" + +// InputBuffer +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" +#define PST_INPUT_BUFFER "InputBuffer" +#define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" +#define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" +#define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" +#define PN_IPB_STREAM0_REJECTED "stream0.rejected" +#define PN_IPB_STREAM1_BLOCKS_IN "stream1.blocksIn" +#define PN_IPB_STREAM1_PERC_BAD "stream1.percBad" +#define PN_IPB_STREAM1_REJECTED "stream1.rejected" +#define PN_IPB_STREAM2_BLOCKS_IN "stream2.blocksIn" +#define PN_IPB_STREAM2_PERC_BAD "stream2.percBad" +#define PN_IPB_STREAM2_REJECTED "stream2.rejected" +#define PN_IPB_STREAM3_BLOCKS_IN "stream3.blocksIn" +#define PN_IPB_STREAM3_PERC_BAD "stream3.percBad" +#define PN_IPB_STREAM3_REJECTED "stream3.rejected" +#define PN_IPB_LATE "late" +#define PN_IPB_IO_TIME "IOTime" + +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" -// OnlineControl -#define PSN_ONLINE_CONTROL "LOFAR_ObsSW_@observation@_OnlineControl" -#define PST_ONLINE_CONTROL "OnlineControl" +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" -// Correlator -#define PSN_CORRELATOR "LOFAR_ObsSW_@observation@_OnlineControl_Correlator" -#define PST_CORRELATOR "Correlator" +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" -// StorageAppl -#define PSN_STORAGE_APPL "LOFAR_ObsSW_@observation@_OnlineControl_StorageAppl" -#define PST_STORAGE_APPL "StorageAppl" +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -135,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -217,10 +277,15 @@ #define PN_RCU_TRIGGER_FILTER "Trigger.filter" #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -248,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -266,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -282,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -302,6 +413,9 @@ #define PN_OBS_NAME "name" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" @@ -338,5 +452,6 @@ #define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" #define PN_TBC_TRIGGER_FLAGS "trigger.flags" #define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" #endif diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc index 332515fdc41eff451a7b07ee732acca21f41fbb6..cd0b52641bd88f6769f8cbc5fe039ba2147224fb 100644 --- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc +++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc @@ -286,6 +286,7 @@ GCFEvent::TResult SoftwareMonitor::checkPrograms(GCFEvent& event, GCFPortInterfa int curLevel = system("swlevel >>/dev/null") >> 8; ASSERTSTR(curLevel >= 0, "Program 'swlevel' not in my execution path"); LOG_DEBUG_STR("Current level is " << curLevel); + itsOwnPropertySet->setValue(PN_SWM_SW_LEVEL, GCFPVInteger(curLevel)); // loop over the permanent processes and update their status in PVSS vector<Process>::iterator iter = itsPermProcs.begin(); diff --git a/MAC/APL/MainCU/src/CRTriggerControl/PVSSDatapointDefs.h b/MAC/APL/MainCU/src/CRTriggerControl/PVSSDatapointDefs.h index 5c1255899220c23e0f62ec8c372cfbed57561918..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/MainCU/src/CRTriggerControl/PVSSDatapointDefs.h +++ b/MAC/APL/MainCU/src/CRTriggerControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v2.0 on Mon Jul 25 13:48:26 UTC 2011 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -57,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -64,24 +55,24 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" - -// Adder -#define PSN_ADDER "@adder@" -#define PST_ADDER "Adder" -#define PN_ADD_DROPPING "dropping" -#define PN_ADD_NR_BLOCKS_DROPPED "nrBlocksDropped" -#define PN_ADD_LOG_LINE "logLine" +#define PN_OBSCTRL_COMMAND "command" // InputBuffer -#define PSN_INPUT_BUFFER "@inputbuffer@" +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" #define PST_INPUT_BUFFER "InputBuffer" #define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" #define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" #define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" #define PN_IPB_STREAM0_REJECTED "stream0.rejected" @@ -97,12 +88,55 @@ #define PN_IPB_LATE "late" #define PN_IPB_IO_TIME "IOTime" -// Storage -#define PSN_STORAGE "@storage@" -#define PST_STORAGE "Storage" -#define PN_STR_TIME "time" -#define PN_STR_COUNT "count" -#define PN_STR_DROPPED "dropped" +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" + +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" + +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -159,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -277,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -295,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -311,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAZ "deltaZ" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -332,6 +414,8 @@ #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" #define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" diff --git a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc index 15e7649bf3dbe5e3f4f7e76dd646a07c3c4905a9..04de8f94a769455ef086e1022a0ac39fe955033f 100644 --- a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc +++ b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc @@ -244,6 +244,11 @@ GCFEvent::TResult ObsClaimer::preparePVSS_state (GCFEvent& event, GCFPortInterfa theObsPS->setValue(PN_OBS_ANTENNA_ARRAY, GCFPVString (theObs.antennaArray), 0.0, false); theObsPS->setValue(PN_OBS_RECEIVER_LIST, GCFPVString (theObs.receiverList), 0.0, false); theObsPS->setValue(PN_OBS_SAMPLE_CLOCK, GCFPVInteger(theObs.sampleClock), 0.0, false); + + theObsPS->setValue(PN_OBS_PROCESS_TYPE, GCFPVString(theObs.processType), 0.0, false); + theObsPS->setValue(PN_OBS_PROCESS_SUBTYPE, GCFPVString(theObs.processSubtype), 0.0, false); + theObsPS->setValue(PN_OBS_STRATEGY, GCFPVString(theObs.strategy), 0.0, false); + stringstream osl; writeVector(osl, theObs.stations); theObsPS->setValue(PN_OBS_STATION_LIST, GCFPVString (osl.str()), 0.0, false); diff --git a/MAC/APL/MainCU/src/MACScheduler/PVSSDatapointDefs.h b/MAC/APL/MainCU/src/MACScheduler/PVSSDatapointDefs.h index ab7de2a66309080459c73f0eabecec14af526305..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/MainCU/src/MACScheduler/PVSSDatapointDefs.h +++ b/MAC/APL/MainCU/src/MACScheduler/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v2.0 on Fri Jan 13 13:20:29 UTC 2012 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,6 +25,10 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" @@ -53,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -60,7 +55,6 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" #define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" #define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" @@ -72,22 +66,13 @@ // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" - -// Adder -#define PSN_ADDER "@adder@" -#define PST_ADDER "Adder" -#define PN_ADD_DROPPING "dropping" -#define PN_ADD_NR_BLOCKS_DROPPED "nrBlocksDropped" -#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" -#define PN_ADD_FILE_NAME "fileName" -#define PN_ADD_STORAGE_NODE "storageNode" -#define PN_ADD_DIRECTORY "directory" -#define PN_ADD_OBSERVATION_NAME "observationName" +#define PN_OBSCTRL_COMMAND "command" // InputBuffer -#define PSN_INPUT_BUFFER "@inputbuffer@" +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" #define PST_INPUT_BUFFER "InputBuffer" #define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" #define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" #define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" #define PN_IPB_STREAM0_REJECTED "stream0.rejected" @@ -103,12 +88,55 @@ #define PN_IPB_LATE "late" #define PN_IPB_IO_TIME "IOTime" -// Storage -#define PSN_STORAGE "@storage@" -#define PST_STORAGE "Storage" -#define PN_STR_TIME "time" -#define PN_STR_COUNT "count" -#define PN_STR_DROPPED "dropped" +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" + +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" + +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -165,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -283,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -301,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -317,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAZ "deltaZ" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -338,6 +414,8 @@ #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" #define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc index 01ee0d27d866cdb4b9d80bc6bcf3ab82d2fb12f2..2a168081b5758772ba7be84c664b592aa78dee22 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc @@ -165,7 +165,7 @@ ObservationControl::~ObservationControl() // void ObservationControl::sigintHandler(int signum) { - LOG_DEBUG (formatString("SIGINT signal detected (%d)",signum)); + LOG_WARN (formatString("SIGINT signal detected (%d)",signum)); // Note we can't call TRAN here because the siginthandler does not know our object. if (thisObservationControl) { @@ -479,6 +479,10 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter // reschedule forced-quit timer for safety. itsTimerPort->cancelTimer(itsForcedQuitTimer); itsForcedQuitTimer = itsTimerPort->setTimer(1.0 * itsForcedQuitDelay); + // cancel all other timers in case premature quit was requested. + itsTimerPort->cancelTimer(itsStartTimer); + itsTimerPort->cancelTimer(itsPrepareTimer); + itsTimerPort->cancelTimer(itsClaimTimer); } else if (timerEvent.id == itsForcedQuitTimer) { LOG_WARN("QUITING BEFORE ALL CHILDREN DIED."); @@ -596,6 +600,8 @@ GCFEvent::TResult ObservationControl::finishing_state(GCFEvent& event, // first turn off 'old' timers itsTimerPort->cancelTimer(itsForcedQuitTimer); itsTimerPort->cancelTimer(itsStopTimer); + itsStopTimer = 0; + itsForcedQuitTimer = 0; // tell Parent task we like to go down. itsParentControl->nowInState(getName(), CTState::QUIT); @@ -647,8 +653,7 @@ void ObservationControl::setObservationTimers(double minimalDelay) itsTimerPort->cancelTimer(itsStartTimer); itsTimerPort->cancelTimer(itsStopTimer); itsTimerPort->cancelTimer(itsForcedQuitTimer); - itsClaimTimer = itsPrepareTimer = itsStartTimer = - itsStopTimer = itsForcedQuitTimer = 0; + itsClaimTimer = itsPrepareTimer = itsStartTimer = itsStopTimer = itsForcedQuitTimer = 0; // recalc new intervals int32 sec2claim = start - now - itsPreparePeriod - itsClaimPeriod; @@ -745,6 +750,7 @@ void ObservationControl::doHeartBeatTask() if (nrChilds != itsNrControllers) { LOG_WARN_STR("Only " << nrChilds << " out of " << itsNrControllers << " controllers still available."); // if no more children left while we are not in the quit-phase + uint32 nrStations = itsChildControl->countChilds(0, CNTLRTYPE_STATIONCTRL); time_t now = to_time_t(second_clock::universal_time()); time_t stop = to_time_t(itsStopTime); if (now < stop && itsProcessType == "Observation" && itsChildControl->countChilds(0, CNTLRTYPE_STATIONCTRL)==0) { diff --git a/MAC/APL/MainCU/src/ObservationControl/PVSSDatapointDefs.h b/MAC/APL/MainCU/src/ObservationControl/PVSSDatapointDefs.h index 0b0b6d33ec3cf66b13f5121c6c60fe807822440e..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/MainCU/src/ObservationControl/PVSSDatapointDefs.h +++ b/MAC/APL/MainCU/src/ObservationControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v2.0 on Tue Sep 8 12:34:54 UTC 2009 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,6 +25,10 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" @@ -53,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -60,25 +55,24 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" #define PN_OBSCTRL_COMMAND "command" -// Adder -#define PSN_ADDER "@adder@" -#define PST_ADDER "Adder" -#define PN_ADD_DROPPING "dropping" -#define PN_ADD_NR_BLOCKS_DROPPED "nrBlocksDropped" -#define PN_ADD_LOG_LINE "logLine" - // InputBuffer -#define PSN_INPUT_BUFFER "@inputbuffer@" +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" #define PST_INPUT_BUFFER "InputBuffer" #define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" #define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" #define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" #define PN_IPB_STREAM0_REJECTED "stream0.rejected" @@ -94,12 +88,55 @@ #define PN_IPB_LATE "late" #define PN_IPB_IO_TIME "IOTime" -// Storage -#define PSN_STORAGE "@storage@" -#define PST_STORAGE "Storage" -#define PN_STR_TIME "time" -#define PN_STR_COUNT "count" -#define PN_STR_DROPPED "dropped" +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" + +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" + +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -156,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -238,10 +277,15 @@ #define PN_RCU_TRIGGER_FILTER "Trigger.filter" #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -269,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -287,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -303,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -324,6 +414,8 @@ #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" #define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" @@ -360,5 +452,6 @@ #define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" #define PN_TBC_TRIGGER_FLAGS "trigger.flags" #define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" #endif diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/AntennaGains.h b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/AntennaGains.h index 896bb4d13362bbd06c188a3420dbf03b526b214a..a9d97927fefd7377101bd44f106e64d7a431450c 100644 --- a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/AntennaGains.h +++ b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/AntennaGains.h @@ -97,9 +97,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack (void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack (const char* buffer); /*@}*/ private: diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SpectralWindow.h b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SpectralWindow.h index 1d1a2b66c44303645b46a68d65ea8caf2d04b4b3..4cfc45d905f323cbd49201de2197efa4e51cd1a0 100644 --- a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SpectralWindow.h +++ b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SpectralWindow.h @@ -85,9 +85,9 @@ namespace LOFAR { public: /*@{*/ // marshalling methods - unsigned int getSize() const; - unsigned int pack (void* buffer) const; - unsigned int unpack (void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SubArray.h b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SubArray.h index d38e4ee246dc247b3916756fbe6a96f52c6d63c8..6b2c58682ad6a25ad794ea6efca15f540b3233c2 100644 --- a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SubArray.h +++ b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SubArray.h @@ -108,9 +108,9 @@ public: //@{ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack (void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} private: @@ -142,9 +142,9 @@ class SubArrayMap : public map<string, SubArray*> public: //@{ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack (void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} }; diff --git a/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc b/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc index ab3cb3c34893645e3bc84cc36cc3ee1594f83158..6f0f68c10b6df3a5580a751387a0b697c1700d74 100644 --- a/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc +++ b/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc @@ -75,21 +75,21 @@ AntennaGains::~AntennaGains() delete m_mutex; } -unsigned int AntennaGains::getSize() +size_t AntennaGains::getSize() const { return - MSH_ARRAY_SIZE(m_gains, complex<double>) - + MSH_ARRAY_SIZE(m_quality, double) + MSH_size(m_gains) + + MSH_size(m_quality) + sizeof(bool); } -unsigned int AntennaGains::pack(void* buffer) +size_t AntennaGains::pack(char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; lock(); - MSH_PACK_ARRAY(buffer, offset, m_gains, complex<double>); - MSH_PACK_ARRAY(buffer, offset, m_quality, double); + MSH_pack(buffer, offset, m_gains); + MSH_pack(buffer, offset, m_quality); memcpy((char*)buffer + offset, &m_done, sizeof(bool)); offset += sizeof(bool); unlock(); @@ -97,13 +97,13 @@ unsigned int AntennaGains::pack(void* buffer) return offset; } -unsigned int AntennaGains::unpack(void* buffer) +size_t AntennaGains::unpack(const char* buffer) { - unsigned int offset = 0; + size_t offset = 0; lock(); - MSH_UNPACK_ARRAY(buffer, offset, m_gains, complex<double>, 3); - MSH_UNPACK_ARRAY(buffer, offset, m_quality, double, 3); + MSH_unpack(buffer, offset, m_gains); + MSH_unpack(buffer, offset, m_quality); memcpy(&m_done, (char*)buffer + offset, sizeof(bool)); offset += sizeof(bool); unlock(); diff --git a/MAC/APL/PAC/CAL_Protocol/src/CAL_Protocol.prot b/MAC/APL/PAC/CAL_Protocol/src/CAL_Protocol.prot index 20252a785bf615e3c06914153fe4c0220d3458e4..4ef0065fe215be1d873719cacb0b0678a7550232 100644 --- a/MAC/APL/PAC/CAL_Protocol/src/CAL_Protocol.prot +++ b/MAC/APL/PAC/CAL_Protocol/src/CAL_Protocol.prot @@ -76,7 +76,7 @@ event = { }; param = { // subset of the receivers (2 receivers per antenna) name = "subset"; - type = "LOFAR::bitset<LOFAR::MAX_RCUS>"; + type = "bitset<LOFAR::MAX_RCUS>"; }; param = { // RCU control byte controls the setting of all @@ -88,7 +88,7 @@ event = { // TODO: add this parameter for faster calibration in the future // param = { // set of subbands // name = "subbandset"; -// type = "LOFAR::bitset<LOFAR::MAX_SUBBANDS>"; +// type = "bitset<LOFAR::MAX_SUBBANDS>"; // }; // nyquist_zone is deducted from RCUSettings // sampling_frequency and nyquist_zone determine the spectral window @@ -138,7 +138,7 @@ event = { }; param = { // set of subbands name = "subbandset"; - type = "LOFAR::bitset<LOFAR::MAX_SUBBANDS>"; + type = "bitset<LOFAR::MAX_SUBBANDS>"; }; }; diff --git a/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc b/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc index ebc83e898156e4c90f092476a4f77b49452934cd..ffa2cb924715f6c9bbab10825090ca43c52f52e4 100644 --- a/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc +++ b/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc @@ -30,7 +30,7 @@ #include <blitz/array.h> #include <sstream> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> #include <APL/RTCCommon/MarshallBlitz.h> #include <math.h> @@ -137,44 +137,44 @@ ostream& SpectralWindow::print(ostream& os) const } -unsigned int SpectralWindow::getSize() const +size_t SpectralWindow::getSize() const { - return MSH_STRING_SIZE(m_name) + + return MSH_size(m_name) + sizeof(m_sampling_freq) + sizeof(m_nyquist_zone) + sizeof(m_numsubbands) + sizeof(m_rcucontrol); } -unsigned int SpectralWindow::pack(void* buffer) const +size_t SpectralWindow::pack(char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_STRING(buffer, offset, m_name); - memcpy(((char*)buffer) + offset, &m_sampling_freq, sizeof(m_sampling_freq)); + MSH_pack(buffer, offset, m_name); + memcpy(buffer + offset, &m_sampling_freq, sizeof(m_sampling_freq)); offset += sizeof(m_sampling_freq); - memcpy(((char*)buffer) + offset, &m_nyquist_zone, sizeof(m_nyquist_zone)); + memcpy(buffer + offset, &m_nyquist_zone, sizeof(m_nyquist_zone)); offset += sizeof(m_nyquist_zone); - memcpy(((char*)buffer) + offset, &m_numsubbands, sizeof(m_numsubbands)); + memcpy(buffer + offset, &m_numsubbands, sizeof(m_numsubbands)); offset += sizeof(m_numsubbands); - memcpy(((char*)buffer) + offset, &m_rcucontrol, sizeof(m_rcucontrol)); + memcpy(buffer + offset, &m_rcucontrol, sizeof(m_rcucontrol)); offset += sizeof(m_rcucontrol); return offset; } -unsigned int SpectralWindow::unpack(void* buffer) +size_t SpectralWindow::unpack(const char* buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_STRING(buffer, offset, m_name); - memcpy(&m_sampling_freq, ((char*)buffer) + offset, sizeof(m_sampling_freq)); + MSH_unpack(buffer, offset, m_name); + memcpy(&m_sampling_freq, buffer + offset, sizeof(m_sampling_freq)); offset += sizeof(m_sampling_freq); - memcpy(&m_nyquist_zone, ((char*)buffer) + offset, sizeof(m_nyquist_zone)); + memcpy(&m_nyquist_zone, buffer + offset, sizeof(m_nyquist_zone)); offset += sizeof(m_nyquist_zone); - memcpy(&m_numsubbands, ((char*)buffer) + offset, sizeof(m_numsubbands)); + memcpy(&m_numsubbands, buffer + offset, sizeof(m_numsubbands)); offset += sizeof(m_numsubbands); - memcpy(&m_rcucontrol, ((char*)buffer) + offset, sizeof(m_rcucontrol)); + memcpy(&m_rcucontrol, buffer + offset, sizeof(m_rcucontrol)); offset += sizeof(m_rcucontrol); return offset; diff --git a/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc b/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc index b96f0d6131f1875c05883922a751e3f8aba18a5a..96a85a7f77c44ffe9538fd9fcbb911b648bfe171 100644 --- a/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc +++ b/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc @@ -26,7 +26,7 @@ #include <Common/LofarLogger.h> #include <Common/StringUtil.h> #include <Common/hexdump.h> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> #include <APL/RTCCommon/MarshallBlitz.h> using namespace std; @@ -197,65 +197,63 @@ void SubArray::clearDone() m_result[FRONT]->setDone(false); } -unsigned int SubArray::getSize() +size_t SubArray::getSize() const { return - MSH_STRING_SIZE(m_name) - + MSH_ARRAY_SIZE (m_geoloc, double) - + MSH_ARRAY_SIZE (m_pos, double) - + MSH_ARRAY_SIZE (m_rcuindex, int16) - + MSH_BITSET_SIZE(itsRCUmask) + MSH_size(m_name) + + MSH_size(m_geoloc) + + MSH_size(m_pos) + + MSH_size(m_rcuindex) + + MSH_size(itsRCUmask) + m_spw.getSize(); } -unsigned int SubArray::pack(void* buffer) +size_t SubArray::pack(char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_STRING(buffer, offset, m_name); - MSH_PACK_ARRAY(buffer, offset, m_geoloc, double); - MSH_PACK_ARRAY(buffer, offset, m_pos, double); - MSH_PACK_ARRAY(buffer, offset, m_rcuindex, int16); - MSH_PACK_BITSET(buffer, offset, itsRCUmask); - offset += m_spw.pack(((char*)buffer) + offset); + MSH_pack(buffer, offset, m_name); + MSH_pack(buffer, offset, m_geoloc); + MSH_pack(buffer, offset, m_pos); + MSH_pack(buffer, offset, m_rcuindex); + MSH_pack(buffer, offset, itsRCUmask); + offset += m_spw.pack(buffer + offset); return offset; } -unsigned int SubArray::unpack(void* buffer) +size_t SubArray::unpack(const char* buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_STRING(buffer, offset, m_name); - MSH_UNPACK_ARRAY(buffer, offset, m_geoloc, double, 1); - MSH_UNPACK_ARRAY(buffer, offset, m_pos, double, 3); - MSH_UNPACK_ARRAY(buffer, offset, m_rcuindex, int16, 2); - MSH_UNPACK_BITSET(buffer, offset, itsRCUmask); - offset += m_spw.unpack(((char*)buffer) + offset); + MSH_unpack(buffer, offset, m_name); + MSH_unpack(buffer, offset, m_geoloc); + MSH_unpack(buffer, offset, m_pos); + MSH_unpack(buffer, offset, m_rcuindex); + MSH_unpack(buffer, offset, itsRCUmask); + offset += m_spw.unpack(buffer + offset); return offset; } // -------------------- SubArrayMap -------------------- -unsigned int SubArrayMap::getSize() +size_t SubArrayMap::getSize() const { - unsigned int offset = 0; - MSH_SIZE_MAP_STRING_CLASSPTR(offset, (*this), SubArray); - return (offset); + return (MSH_size(*this)); } -unsigned int SubArrayMap::pack(void* buffer) +size_t SubArrayMap::pack(char* buffer) const { - unsigned int offset = 0; - MSH_PACK_MAP_STRING_CLASSPTR(buffer, offset, (*this), SubArray); + size_t offset = 0; + MSH_pack(buffer, offset, (*this)); return (offset); } -unsigned int SubArrayMap::unpack(void* buffer) +size_t SubArrayMap::unpack(const char* buffer) { - unsigned int offset = 0; - MSH_UNPACK_MAP_STRING_CLASSPTR(buffer, offset, (*this), SubArray); + size_t offset = 0; + MSH_unpack(buffer, offset, (*this)); return (offset); } diff --git a/MAC/APL/PAC/Cal_Server/src/ACMProxy.cc b/MAC/APL/PAC/Cal_Server/src/ACMProxy.cc index a7c79e975a7f95256befdc9a95a15094278ab154..8d92554e4c9606784868ca78db1c8487a8e573ea 100644 --- a/MAC/APL/PAC/Cal_Server/src/ACMProxy.cc +++ b/MAC/APL/PAC/Cal_Server/src/ACMProxy.cc @@ -256,8 +256,8 @@ GCFEvent::TResult ACMProxy::initializing(GCFEvent& e, GCFPortInterface& port) m_update_subband = 0; ss.subbands.setType(SubbandSelection::XLET); - ss.subbands().resize(1, 1); - ss.subbands() = m_request_subband; + ss.subbands.crosslets().resize(1, 1); + ss.subbands.crosslets() = m_request_subband; LOG_DEBUG_STR("REQ: XC subband " << m_request_subband << " @ " << ss.timestamp); m_rspdriver.send(ss); @@ -281,8 +281,8 @@ GCFEvent::TResult ACMProxy::initializing(GCFEvent& e, GCFPortInterface& port) } ss.subbands.setType(SubbandSelection::XLET); - ss.subbands().resize(1, 1); - ss.subbands() = m_request_subband; + ss.subbands.crosslets().resize(1, 1); + ss.subbands.crosslets() = m_request_subband; LOG_DEBUG_STR("REQ: XC subband " << m_request_subband << " @ " << ss.timestamp); port.send(ss); @@ -376,8 +376,8 @@ GCFEvent::TResult ACMProxy::receiving(GCFEvent& e, GCFPortInterface& port) } ss.subbands.setType(SubbandSelection::XLET); - ss.subbands().resize(1, 1); - ss.subbands() = m_request_subband; + ss.subbands.crosslets().resize(1, 1); + ss.subbands.crosslets() = m_request_subband; LOG_DEBUG_STR("REQ: XC subband " << m_request_subband << " @ " << ss.timestamp); port.send(ss); diff --git a/MAC/APL/PAC/IBS_Protocol/include/APL/IBS_Protocol/Beamlet2SubbandMap.h b/MAC/APL/PAC/IBS_Protocol/include/APL/IBS_Protocol/Beamlet2SubbandMap.h index 18483db4a3e09d1813a46b6745b267a03d4dca22..c2a297cc518c623770aff8bf183007d23c5517f3 100644 --- a/MAC/APL/PAC/IBS_Protocol/include/APL/IBS_Protocol/Beamlet2SubbandMap.h +++ b/MAC/APL/PAC/IBS_Protocol/include/APL/IBS_Protocol/Beamlet2SubbandMap.h @@ -25,13 +25,15 @@ #ifndef BEAMLET2SUBBANDMAP_H_ #define BEAMLET2SUBBANDMAP_H_ -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> #include <APL/RSP_Protocol/EPA_Protocol.ph> +#include <Common/LofarConstants.h> #include <Common/LofarTypes.h> +#include <Common/lofar_bitset.h> #include <Common/lofar_string.h> #include <Common/lofar_map.h> -#include <Common/lofar_bitset.h> +#include <boost/dynamic_bitset.hpp> namespace LOFAR { namespace IBS_Protocol { @@ -52,14 +54,14 @@ public: /*@{*/ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ // other methods bitset<MAX_SUBBANDS> getSubbandBitset() const; - bitset<MAX_BEAMLETS> getBeamletBitset() const; + boost::dynamic_bitset<> getBeamletBitset(const int maxBeamlets) const; ostream& print (ostream& os) const; diff --git a/MAC/APL/PAC/IBS_Protocol/include/APL/IBS_Protocol/Pointing.h b/MAC/APL/PAC/IBS_Protocol/include/APL/IBS_Protocol/Pointing.h index 67920bcff746c1907db7fe2ed9d1153991734164..e27c51ddb64e9ee4b39b4b0989fc1f9710cb9a07 100644 --- a/MAC/APL/PAC/IBS_Protocol/include/APL/IBS_Protocol/Pointing.h +++ b/MAC/APL/PAC/IBS_Protocol/include/APL/IBS_Protocol/Pointing.h @@ -71,9 +71,9 @@ public: /*@{*/ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PAC/IBS_Protocol/src/Beamlet2SubbandMap.cc b/MAC/APL/PAC/IBS_Protocol/src/Beamlet2SubbandMap.cc index b2aa681b1e582b11edeb97b62a032713e6b83c50..422106d49dbea966f8415ddf0ded0387d4c701c7 100644 --- a/MAC/APL/PAC/IBS_Protocol/src/Beamlet2SubbandMap.cc +++ b/MAC/APL/PAC/IBS_Protocol/src/Beamlet2SubbandMap.cc @@ -33,43 +33,43 @@ using namespace IBS_Protocol; using namespace std; using namespace blitz; -unsigned int Beamlet2SubbandMap::getSize() +size_t Beamlet2SubbandMap::getSize() const { // 1-dimensional array has 1 int32 for length // map is converted to array of uint16 of 2 * map.size() elements return (sizeof(int32) + (m_beamlet2subband.size() * sizeof(uint16) * 2)); } -unsigned int Beamlet2SubbandMap::pack (void* buffer) +size_t Beamlet2SubbandMap::pack (char* buffer) const { // the map is sent as a blitz array blitz::Array<uint16, 1> maparray; - unsigned int offset = 0; + size_t offset = 0; maparray.resize(m_beamlet2subband.size() * 2); // resize the array maparray = 0; // convert map to Blitz array - map<uint16, uint16>::iterator iter = m_beamlet2subband.begin(); - map<uint16, uint16>::iterator end = m_beamlet2subband.end(); + map<uint16, uint16>::const_iterator iter = m_beamlet2subband.begin(); + map<uint16, uint16>::const_iterator end = m_beamlet2subband.end(); int i = 0; for ( ; iter != end; ++iter, i+=2) { maparray(i) = iter->first; maparray(i+1) = iter->second; } - MSH_PACK_ARRAY(buffer, offset, maparray, uint16); + MSH_pack(buffer, offset, maparray); return offset; } -unsigned int Beamlet2SubbandMap::unpack(void *buffer) +size_t Beamlet2SubbandMap::unpack(const char *buffer) { // the map is received as a blitz array blitz::Array<uint16, 1> maparray; - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, maparray, uint16, 1); + MSH_unpack(buffer, offset, maparray); ASSERT(maparray.extent(firstDim) % 2 == 0); // convert Blitz array to map @@ -92,7 +92,12 @@ bitset<MAX_SUBBANDS> Beamlet2SubbandMap::getSubbandBitset() const map<uint16, uint16>::const_iterator iter = m_beamlet2subband.begin(); map<uint16, uint16>::const_iterator end = m_beamlet2subband.end(); while (iter != end) { - result.set(iter->second); + if (iter->second >= MAX_SUBBANDS) { + LOG_FATAL_STR("Subband " << iter->second << " is not allowed, returning incomplete bitset!"); + } + else { + result.set(iter->second); + } ++iter; } @@ -102,14 +107,20 @@ bitset<MAX_SUBBANDS> Beamlet2SubbandMap::getSubbandBitset() const // // returns a bitset in which the bits represent the used beamlets // -bitset<MAX_BEAMLETS> Beamlet2SubbandMap::getBeamletBitset() const +boost::dynamic_bitset<> Beamlet2SubbandMap::getBeamletBitset(const int maxBeamlets) const { - bitset<MAX_BEAMLETS> result; + boost::dynamic_bitset<> result; + result.resize(maxBeamlets); map<uint16, uint16>::const_iterator iter = m_beamlet2subband.begin(); map<uint16, uint16>::const_iterator end = m_beamlet2subband.end(); while (iter != end) { - result.set(iter->first); + if (iter->first >= maxBeamlets) { + LOG_FATAL_STR("Beamlet " << iter->first << " is not allowed, returning incomplete bitset!"); + } + else { + result.set(iter->first); + } ++iter; } @@ -128,7 +139,7 @@ ostream& Beamlet2SubbandMap::print (ostream& os) const return (os); map<uint16,uint16>::const_iterator iter; map<uint16,uint16>::const_iterator end = m_beamlet2subband.end(); - while (idx < elements && idx < MAX_BEAMLETS) { + while (idx < elements) { if (idx % MAX_ELEMENTS_PER_LINE == 0) { if (idx % (2*MAX_ELEMENTS_PER_LINE) == 0) { os << endl << formatString("[%d]: ", idx / (2*MAX_ELEMENTS_PER_LINE)); diff --git a/MAC/APL/PAC/IBS_Protocol/src/IBS_Protocol.prot b/MAC/APL/PAC/IBS_Protocol/src/IBS_Protocol.prot index 3b53ebb7bcf6b5a7994109d18701cf20d70470bb..75eb3dbaebf85a6f4a92d70035b52019973a5d7c 100644 --- a/MAC/APL/PAC/IBS_Protocol/src/IBS_Protocol.prot +++ b/MAC/APL/PAC/IBS_Protocol/src/IBS_Protocol.prot @@ -10,8 +10,8 @@ id = "(LOFAR::MACIO::F_APL_PROTOCOL+10)"; // specify extra include files // e.g. include = '<sys/time.h>'; -include = '<Common/lofar_bitset.h>'; include = '<Common/LofarConstants.h>'; +include = '<Common/lofar_bitset.h>'; include = '<APL/IBS_Protocol/Beamlet2SubbandMap.h>'; include = '<APL/IBS_Protocol/Pointing.h>'; include = '<APL/RTCCommon/Timestamp.h>'; @@ -148,7 +148,7 @@ event = { // NEW: so that BeamServer can check for ring inconsistancies. param = { // subset of the receivers (2 receivers per antenna) name = "rcumask"; - type = "LOFAR::bitset<LOFAR::MAX_RCUS>"; + type = "bitset<LOFAR::MAX_RCUS>"; }; param = { diff --git a/MAC/APL/PAC/IBS_Protocol/src/Pointing.cc b/MAC/APL/PAC/IBS_Protocol/src/Pointing.cc index dad0e744afced1536a69746d7c9b53287f9a0fe4..0d5c8f3d5e110901184d87df70a13e6538fd2a45 100644 --- a/MAC/APL/PAC/IBS_Protocol/src/Pointing.cc +++ b/MAC/APL/PAC/IBS_Protocol/src/Pointing.cc @@ -24,7 +24,7 @@ #include <Common/LofarLogger.h> #include <Common/LofarTypes.h> #include <APL/IBS_Protocol/Pointing.h> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> using namespace LOFAR; using namespace IBS_Protocol; @@ -92,26 +92,26 @@ ostream& Pointing::print(ostream& os) const // // getSize() // -unsigned int Pointing::getSize() +size_t Pointing::getSize() const { - return (sizeof(double) * 2) + itsTime.getSize() + + sizeof(uint) + MSH_STRING_SIZE(itsType); + return (sizeof(double) * 2) + itsTime.getSize() + + sizeof(uint) + MSH_size(itsType); } // // pack(buffer) // -unsigned int Pointing::pack (void* buffer) +size_t Pointing::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - memcpy((char*)buffer + offset, &itsAngle2Pi, sizeof(double)); + memcpy(buffer + offset, &itsAngle2Pi, sizeof(double)); offset += sizeof(double); - memcpy((char*)buffer + offset, &itsAnglePi, sizeof(double)); + memcpy(buffer + offset, &itsAnglePi, sizeof(double)); offset += sizeof(double); - offset += itsTime.pack((char*)buffer + offset); - memcpy((char*)buffer + offset, &itsDuration, sizeof(uint)); + offset += itsTime.pack(buffer + offset); + memcpy(buffer + offset, &itsDuration, sizeof(uint)); offset += sizeof(uint); - MSH_PACK_STRING(buffer, offset, itsType); + MSH_pack(buffer, offset, itsType); return (offset); } @@ -119,18 +119,18 @@ unsigned int Pointing::pack (void* buffer) // // unpack(buffer) // -unsigned int Pointing::unpack(void *buffer) +size_t Pointing::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - memcpy(&itsAngle2Pi, (char*)buffer + offset, sizeof(double)); + memcpy(&itsAngle2Pi, buffer + offset, sizeof(double)); offset += sizeof(double); - memcpy(&itsAnglePi, (char*)buffer + offset, sizeof(double)); + memcpy(&itsAnglePi, buffer + offset, sizeof(double)); offset += sizeof(double); - offset += itsTime.unpack((char*)buffer + offset); - memcpy(&itsDuration, (char*)buffer + offset, sizeof(uint)); + offset += itsTime.unpack(buffer + offset); + memcpy(&itsDuration, buffer + offset, sizeof(uint)); offset += sizeof(uint); - MSH_UNPACK_STRING(buffer , offset, itsType); + MSH_unpack(buffer , offset, itsType); return (offset); } diff --git a/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/AntennaGains.h b/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/AntennaGains.h index 676c34a3256d9323f48e1bb50aaa4bdbc88deee7..5f549a779416230e19bdd7f0ae210595c1146b20 100644 --- a/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/AntennaGains.h +++ b/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/AntennaGains.h @@ -82,9 +82,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack (void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/SpectralWindow.h b/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/SpectralWindow.h index 264a69438c789bdb3551715135389651078adb5d..8bb6d415e08d0eb54d679666d924ee898bdef160 100644 --- a/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/SpectralWindow.h +++ b/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/SpectralWindow.h @@ -70,9 +70,9 @@ public: /*@{*/ // marshalling methods - unsigned int getSize() const; - unsigned int pack (void* buffer) const; - unsigned int unpack (void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ // call for operator<< diff --git a/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/SubArray.h b/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/SubArray.h index d18176dadba3e311e9d0a59f440cc9e50966ab17..6344e2cc60021421926e8768ed7153329a555735 100644 --- a/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/SubArray.h +++ b/MAC/APL/PAC/ICAL_Protocol/include/APL/ICAL_Protocol/SubArray.h @@ -106,9 +106,9 @@ public: //@{ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack (void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} // call for operator<< @@ -144,9 +144,9 @@ class SubArrayMap : public map<string, SubArray*> public: //@{ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack (void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} }; diff --git a/MAC/APL/PAC/ICAL_Protocol/src/AntennaGains.cc b/MAC/APL/PAC/ICAL_Protocol/src/AntennaGains.cc index 0a3ef242b8a146749ec7fba865c68a95db85750d..e9cd9b4c57d2be09497cf3d15490637e32c5d267 100644 --- a/MAC/APL/PAC/ICAL_Protocol/src/AntennaGains.cc +++ b/MAC/APL/PAC/ICAL_Protocol/src/AntennaGains.cc @@ -68,29 +68,29 @@ AntennaGains* AntennaGains::clone() const return (theClone); } -unsigned int AntennaGains::getSize() +size_t AntennaGains::getSize() const { return - MSH_ARRAY_SIZE(m_gains, complex<double>) - + MSH_ARRAY_SIZE(m_quality, double); + MSH_size(m_gains) + + MSH_size(m_quality); } -unsigned int AntennaGains::pack(void* buffer) +size_t AntennaGains::pack(char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_gains, complex<double>); - MSH_PACK_ARRAY(buffer, offset, m_quality, double); + MSH_pack(buffer, offset, m_gains); + MSH_pack(buffer, offset, m_quality); return offset; } -unsigned int AntennaGains::unpack(void* buffer) +size_t AntennaGains::unpack(const char* buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_gains, complex<double>, 2); - MSH_UNPACK_ARRAY(buffer, offset, m_quality, double, 2); + MSH_unpack(buffer, offset, m_gains); + MSH_unpack(buffer, offset, m_quality); return offset; } diff --git a/MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc b/MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc index 449e40554bd0da1370c606c0f48947bc63a3e068..3b478a5d19777ec52fde9f9f958ec6a0370555c9 100644 --- a/MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc +++ b/MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc @@ -27,7 +27,7 @@ #include <APL/ICAL_Protocol/SpectralWindow.h> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> #include <APL/RTCCommon/MarshallBlitz.h> namespace LOFAR { @@ -104,39 +104,39 @@ ostream& SpectralWindow::print(ostream& os) const // // ---------- pack and unpack functions ---------- // -unsigned int SpectralWindow::getSize() const +size_t SpectralWindow::getSize() const { - return MSH_STRING_SIZE(itsName) + + return MSH_size(itsName) + sizeof(itsSamplingFreq) + sizeof(itsNyquistZone) + sizeof(itsLBAfilterOn); } -unsigned int SpectralWindow::pack(void* buffer) const +size_t SpectralWindow::pack(char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_STRING(buffer, offset, itsName); - memcpy(((char*)buffer) + offset, &itsSamplingFreq, sizeof(itsSamplingFreq)); + MSH_pack(buffer, offset, itsName); + memcpy(buffer + offset, &itsSamplingFreq, sizeof(itsSamplingFreq)); offset += sizeof(itsSamplingFreq); - memcpy(((char*)buffer) + offset, &itsNyquistZone, sizeof(itsNyquistZone)); + memcpy(buffer + offset, &itsNyquistZone, sizeof(itsNyquistZone)); offset += sizeof(itsNyquistZone); - memcpy(((char*)buffer) + offset, &itsLBAfilterOn, sizeof(itsLBAfilterOn)); + memcpy(buffer + offset, &itsLBAfilterOn, sizeof(itsLBAfilterOn)); offset += sizeof(itsLBAfilterOn); return offset; } -unsigned int SpectralWindow::unpack(void* buffer) +size_t SpectralWindow::unpack(const char* buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_STRING(buffer, offset, itsName); - memcpy(&itsSamplingFreq, ((char*)buffer) + offset, sizeof(itsSamplingFreq)); + MSH_unpack(buffer, offset, itsName); + memcpy(&itsSamplingFreq, buffer + offset, sizeof(itsSamplingFreq)); offset += sizeof(itsSamplingFreq); - memcpy(&itsNyquistZone, ((char*)buffer) + offset, sizeof(itsNyquistZone)); + memcpy(&itsNyquistZone, buffer + offset, sizeof(itsNyquistZone)); offset += sizeof(itsNyquistZone); - memcpy(&itsLBAfilterOn, ((char*)buffer) + offset, sizeof(itsLBAfilterOn)); + memcpy(&itsLBAfilterOn, buffer + offset, sizeof(itsLBAfilterOn)); offset += sizeof(itsLBAfilterOn); return offset; diff --git a/MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc b/MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc index a87d30d824e5fd2fe5bb69b9ce19a50ffba456fa..1c9646bd24671468609e02e458b3e5dd858833a4 100644 --- a/MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc +++ b/MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc @@ -27,7 +27,7 @@ #include <Common/hexdump.h> #include <ApplCommon/AntennaSets.h> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> #include <APL/RTCCommon/MarshallBlitz.h> #include <APL/ICAL_Protocol/SubArray.h> @@ -188,59 +188,57 @@ ostream& SubArray::print (ostream& os) const // // ---------- pack and unpack routines ---------- // -unsigned int SubArray::getSize() +size_t SubArray::getSize() const { return - MSH_STRING_SIZE(itsName) - + MSH_STRING_SIZE(itsAntennaSet) - + MSH_BITSET_SIZE(itsRCUmask) + MSH_size(itsName) + + MSH_size(itsAntennaSet) + + MSH_size(itsRCUmask) + itsSPW.getSize(); } -unsigned int SubArray::pack(void* buffer) +size_t SubArray::pack(char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_STRING(buffer, offset, itsName); - MSH_PACK_STRING(buffer, offset, itsAntennaSet); - MSH_PACK_BITSET(buffer, offset, itsRCUmask); - offset += itsSPW.pack(((char*)buffer) + offset); + MSH_pack(buffer, offset, itsName); + MSH_pack(buffer, offset, itsAntennaSet); + MSH_pack(buffer, offset, itsRCUmask); + offset += itsSPW.pack(buffer + offset); return offset; } -unsigned int SubArray::unpack(void* buffer) +size_t SubArray::unpack(const char* buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_STRING(buffer, offset, itsName); - MSH_UNPACK_STRING(buffer, offset, itsAntennaSet); - MSH_UNPACK_BITSET(buffer, offset, itsRCUmask); - offset += itsSPW.unpack(((char*)buffer) + offset); + MSH_unpack(buffer, offset, itsName); + MSH_unpack(buffer, offset, itsAntennaSet); + MSH_unpack(buffer, offset, itsRCUmask); + offset += itsSPW.unpack(buffer + offset); return offset; } // -------------------- SubArrayMap -------------------- -unsigned int SubArrayMap::getSize() +size_t SubArrayMap::getSize() const { - unsigned int offset = 0; - MSH_SIZE_MAP_STRING_CLASSPTR(offset, (*this), SubArray); - return (offset); + return MSH_size(*this); } -unsigned int SubArrayMap::pack(void* buffer) +size_t SubArrayMap::pack(char* buffer) const { - unsigned int offset = 0; - MSH_PACK_MAP_STRING_CLASSPTR(buffer, offset, (*this), SubArray); + size_t offset = 0; + MSH_pack(buffer, offset, (*this)); return (offset); } -unsigned int SubArrayMap::unpack(void* buffer) +size_t SubArrayMap::unpack(const char* buffer) { - unsigned int offset = 0; - MSH_UNPACK_MAP_STRING_CLASSPTR(buffer, offset, (*this), SubArray); + size_t offset = 0; + MSH_unpack(buffer, offset, (*this)); return (offset); } diff --git a/MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.h b/MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.h index dc471c6d7e2b687afdfbb3cda77b5db2795a2435..441936e8e9516a12ce8294b730e3f26075962c69 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.h +++ b/MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.h @@ -24,9 +24,10 @@ #define ANABEAMMGR_H_ #include <lofar_config.h> -#include <Common/lofar_string.h> +#include <Common/lofar_bitset.h> #include <Common/lofar_list.h> #include <Common/lofar_map.h> +#include <Common/lofar_string.h> #include <ApplCommon/StationConfig.h> #include <GCF/TM/GCF_PortInterface.h> #include <APL/RTCCommon/Timestamp.h> @@ -125,7 +126,7 @@ private: RTC::Timestamp itsTargetTime; // RCUs participating in the active beams - bitset<MAX_RCUS> itsActiveRCUs; + bitset<MAX_RCUS> itsActiveRCUs; // queue of future pointings as delivered by the user. map<string, AnalogueBeam> itsBeams; diff --git a/MAC/APL/PAC/ITRFBeamServer/src/AnalogueBeam.cc b/MAC/APL/PAC/ITRFBeamServer/src/AnalogueBeam.cc index 9e34d0a7b563dce4973e4b6e19ea546a3d1b6685..240ccf0fc5120734d62508927d1189b07c26fce2 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/AnalogueBeam.cc +++ b/MAC/APL/PAC/ITRFBeamServer/src/AnalogueBeam.cc @@ -46,10 +46,10 @@ using namespace RTC; // // AnalogueBeam(name, subarray, nrSubbands) // -AnalogueBeam::AnalogueBeam(const string& name, - const string& antennaSet, - const bitset<MAX_RCUS>& rcuMask, - uint rankNr) : +AnalogueBeam::AnalogueBeam(const string& name, + const string& antennaSet, + const bitset<MAX_RCUS>& rcuMask, + uint rankNr) : Beam (name, antennaSet, rcuMask), itsRankNr (rankNr) {} diff --git a/MAC/APL/PAC/ITRFBeamServer/src/AnalogueBeam.h b/MAC/APL/PAC/ITRFBeamServer/src/AnalogueBeam.h index 7352ae423b9042b4ed4bf46555c2cde0fca1776b..456c2ede321f911b9072cfb84c4fd648a79e2beb 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/AnalogueBeam.h +++ b/MAC/APL/PAC/ITRFBeamServer/src/AnalogueBeam.h @@ -24,6 +24,7 @@ #define ANALOGUE_BEAM_H_ #include <lofar_config.h> +#include <Common/lofar_bitset.h> #include "Beam.h" #include <blitz/array.h> diff --git a/MAC/APL/PAC/ITRFBeamServer/src/Beam.h b/MAC/APL/PAC/ITRFBeamServer/src/Beam.h index 51af32d53ce21118540b65af7d96d663f0817214..a425e676e50cc20e3a24b0de8e5368390b965cec 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/Beam.h +++ b/MAC/APL/PAC/ITRFBeamServer/src/Beam.h @@ -24,10 +24,10 @@ #define BEAM_H_ #include <lofar_config.h> -#include <Common/lofar_vector.h> -#include <Common/lofar_string.h> #include <Common/lofar_bitset.h> #include <Common/lofar_list.h> +#include <Common/lofar_string.h> +#include <Common/lofar_vector.h> #include <Common/LofarConstants.h> #include <APL/RTCCommon/Timestamp.h> #include <APL/IBS_Protocol/Pointing.h> diff --git a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc index f0a9d3c52850b59b310fbb81ff38f911882437e8..c9312cdeee4f7f0cae9b4ee199b6af75b54a83c1 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc +++ b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc @@ -24,6 +24,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> #include <Common/LofarLocators.h> +#include <Common/LofarBitModeInfo.h> #include <Common/lofar_complex.h> #include <Common/Version.h> #include <Common/ParameterSet.h> @@ -47,11 +48,13 @@ #include <sstream> #include <time.h> #include <fstream> +#include <bitset> #include <netinet/in.h> #include <blitz/array.h> using namespace blitz; +using namespace std; namespace LOFAR { using namespace RTC; using namespace IBS_Protocol; @@ -66,6 +69,8 @@ int gBeamformerGain = 0; // BeamServer::BeamServer(const string& name, long timestamp) : GCFTask((State)&BeamServer::con2rspdriver, name), + itsCurrentBitsPerSample (MAX_BITS_PER_SAMPLE), + itsCurrentMaxBeamlets (maxBeamlets(itsCurrentBitsPerSample)), itsNrLBAbeams (0), itsNrHBAbeams (0), itsListener (0), @@ -230,7 +235,7 @@ GCFEvent::TResult BeamServer::con2rspdriver(GCFEvent& event, GCFPortInterface& p // // askConfiguration(event, port) // -// Ask the RSPdriver what ahrdware is available +// Ask the RSPdriver what hardware is available // GCFEvent::TResult BeamServer::askConfiguration(GCFEvent& event, GCFPortInterface& port) { @@ -250,14 +255,9 @@ GCFEvent::TResult BeamServer::askConfiguration(GCFEvent& event, GCFPortInterface RSPGetconfigackEvent ack(event); // resize our array to the amount of current RCUs - itsMaxRCUs = ack.n_rcus; - LOG_INFO_STR("Station has " << itsMaxRCUs << " RCU's"); - - // initialize matrices - itsWeights.resize (itsMaxRCUs, MAX_BEAMLETS); - itsWeights16.resize (itsMaxRCUs, MAX_BEAMLETS); - itsWeights = complex<double>(0,0); - itsWeights16 = complex<int16_t>(0,0); + itsMaxRCUs = ack.n_rcus; + itsMaxRSPboards = ack.max_rspboards; + LOG_INFO_STR("Station has " << itsMaxRCUs << " RCU's and " << itsMaxRSPboards << " RSPBoards"); itsConnectTimer->cancelAllTimers(); TRAN(BeamServer::subscribeSplitter); @@ -301,10 +301,24 @@ GCFEvent::TResult BeamServer::subscribeSplitter(GCFEvent& event, GCFPortInterfac RSPSubsplitterEvent subSplitter; subSplitter.period = 1; itsRSPDriver->send(subSplitter); + itsConnectTimer->setTimer(5.0); + // wait for ack message + } + break; + + case RSP_SUBSPLITTERACK: { + itsConnectTimer->cancelAllTimers(); + RSPSubsplitterackEvent ack(event); + if (ack.status != RSP_SUCCESS) { + LOG_INFO("Could not get a subscription on the splitter, retry in 5 seconds"); + } + itsConnectTimer->setTimer(5.0); + // wait for update message. } break; case RSP_UPDSPLITTER: { + itsConnectTimer->cancelAllTimers(); RSPUpdsplitterEvent answer(event); if (answer.status != RSP_SUCCESS) { LOG_INFO("Could not get a subscription on the splitter, retry in 5 seconds"); @@ -316,8 +330,8 @@ GCFEvent::TResult BeamServer::subscribeSplitter(GCFEvent& event, GCFPortInterfac LOG_INFO_STR("The ringsplitter is " << (itsSplitterOn ? "ON" : "OFF")); _createBeamPool(); // (re)allocate memory for the beamlet mapping - itsConnectTimer->cancelAllTimers(); - TRAN(BeamServer::con2calserver); + TRAN(BeamServer::subscribeBitmode); +// TRAN(BeamServer::con2calserver); } break; @@ -348,6 +362,92 @@ GCFEvent::TResult BeamServer::subscribeSplitter(GCFEvent& event, GCFPortInterfac return (status); } +#if 1 +// +// subscribeBitmode(event, port) +// +// Take subscription on changes in the bitmode +// +GCFEvent::TResult BeamServer::subscribeBitmode(GCFEvent& event, GCFPortInterface& port) +{ + LOG_DEBUG_STR("subscribeBitmode:" << eventName(event) << "@" << port.getName()); + + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch(event.signal) { + case F_ENTRY: { + // send request for splitter info + LOG_INFO("Requesting a subscription on the bitmode"); + RSPSubbitmodeEvent subBitmode; + subBitmode.period = 1; + itsRSPDriver->send(subBitmode); + itsConnectTimer->setTimer(5.0); + // wait for update event. + } + break; + + case RSP_SUBBITMODEACK: { + itsConnectTimer->cancelAllTimers(); + RSPSubbitmodeackEvent ack(event); + if (ack.status != RSP_SUCCESS) { + LOG_INFO("Could not get a subscription on the bitmode, retry in 5 seconds"); + break; + } + itsConnectTimer->setTimer(5.0); + // wait for update event. + } + break; + + case RSP_UPDBITMODE: { + itsConnectTimer->cancelAllTimers(); + RSPUpdbitmodeEvent answer(event); + if (answer.status != RSP_SUCCESS) { + LOG_INFO("Could not get a subscription on the bitmode, retry in 5 seconds"); + itsConnectTimer->setTimer(5.0); + break; + } + + itsCurrentBitsPerSample = MIN_BITS_PER_SAMPLE; + for (uint i = 0; i < itsMaxRSPboards; i++) { + itsCurrentBitsPerSample = (answer.bits_per_sample[i] > itsCurrentBitsPerSample) ? answer.bits_per_sample[i] : itsCurrentBitsPerSample; + } + itsCurrentMaxBeamlets = maxBeamlets(itsCurrentBitsPerSample); + LOG_INFO_STR("The bitmode is " << itsCurrentBitsPerSample << " bits"); + + _createBeamPool(); // (re)allocate memory for the beamlet mapping + + TRAN(BeamServer::con2calserver); + } + break; + + case F_TIMER: { + LOG_INFO("Requesting a subscription on the bitmode again."); + RSPSubbitmodeEvent subBitmode; + subBitmode.period = 1; + itsRSPDriver->send(subBitmode); + } + break; + + case F_DISCONNECTED: { + port.close(); + if (&port == itsRSPDriver) { + LOG_WARN("Lost connection with the RSPDriver, going back to the reconnect state"); + itsConnectTimer->cancelAllTimers(); + TRAN(BeamServer::con2rspdriver); + } + } + break; + + default: + LOG_DEBUG("subscribeBitmode:default"); + status = GCFEvent::NOT_HANDLED; + break; + } + + return (status); +} +#endif + // // con2calserver(event, port) // @@ -571,6 +671,19 @@ GCFEvent::TResult BeamServer::enabled(GCFEvent& event, GCFPortInterface& port) } break; + case RSP_UPDBITMODE: { + RSPUpdbitmodeEvent answer(event); + // TODO: don't ignore status field! + itsCurrentBitsPerSample = MIN_BITS_PER_SAMPLE; + for (uint i = 0; i < itsMaxRSPboards; i++) { + itsCurrentBitsPerSample = (answer.bits_per_sample[i] > itsCurrentBitsPerSample) ? answer.bits_per_sample[i] : itsCurrentBitsPerSample; + } + itsCurrentMaxBeamlets = maxBeamlets(itsCurrentBitsPerSample); + LOG_INFO_STR("The bitmode changed to " << itsCurrentBitsPerSample << " bits"); + _createBeamPool(); + } + break; + // ---------- connection administration ---------- case F_DISCONNECTED: { if (&port == itsListener || &port == itsRSPDriver || &port == itsCalServer) { @@ -1051,7 +1164,7 @@ void BeamServer::_createBeamPool() itsBeamPool.clear(); // make a new one based on the current value of the splitter. - int nrBeamlets = (itsSplitterOn ? 2 : 1 ) * MAX_BEAMLETS; + int nrBeamlets = (itsSplitterOn ? 2 : 1 ) * itsCurrentMaxBeamlets; LOG_INFO_STR("Initializing space for " << nrBeamlets << " beamlets"); itsBeamletAllocation.clear(); itsBeamletAllocation.resize(nrBeamlets, BeamletAlloc_t(0,0.0)); @@ -1059,6 +1172,15 @@ void BeamServer::_createBeamPool() delete itsAnaBeamMgr; itsAnaBeamMgr = new AnaBeamMgr(itsMaxRCUs, (itsSplitterOn ? 2 : 1 )); ASSERTSTR(itsAnaBeamMgr, "Failed to create an Manager for the analogue beams."); + + // initialize matrices + int nPlanes = MAX_BITS_PER_SAMPLE / itsCurrentBitsPerSample; + int beamletsPerPlane = maxBeamletsPerPlane(itsCurrentBitsPerSample); + LOG_DEBUG(formatString("Size weights arrays set to %d x %d x %d", itsMaxRCUs, nPlanes, beamletsPerPlane)); + itsWeights.resize (itsMaxRCUs, nPlanes, beamletsPerPlane); + itsWeights16.resize (itsMaxRCUs, nPlanes, beamletsPerPlane); + itsWeights = complex<double>(0,0); + itsWeights16 = complex<int16_t>(0,0); } // @@ -1100,7 +1222,7 @@ DigitalBeam* BeamServer::checkBeam(GCFPortInterface* port, std::string name, std::string antennaSetName, IBS_Protocol::Beamlet2SubbandMap allocation, - LOFAR::bitset<LOFAR::MAX_RCUS> rcumask, + bitset<LOFAR::MAX_RCUS> rcumask, uint ringNr, uint rcuMode, int* beamError) @@ -1148,6 +1270,13 @@ DigitalBeam* BeamServer::checkBeam(GCFPortInterface* port, return (0); } + // nr of subbands should fit in the beamlet space. + if (allocation.getSubbandBitset().count() > itsCurrentMaxBeamlets) { + LOG_ERROR_STR("Too many subbands specified (" << allocation.getSubbandBitset().count() << ") only " + << itsCurrentMaxBeamlets << " allowed"); + return (0); + } + if (!_checkBeamlets(allocation, ringNr)) { LOG_ERROR_STR("Beamlets of beam " << name << " overlap with beamlets of other beams"); *beamError = IBS_BEAMALLOC_ERR; @@ -1218,7 +1347,7 @@ bool BeamServer::_checkBeamlets(IBS_Protocol::Beamlet2SubbandMap& allocation, // first check if the allocation is valid for ( ; iter != end; iter++) { // v--- beamletnumber - int index(ringNr * LOFAR::MAX_BEAMLETS + iter->first); + int index(ringNr * itsCurrentMaxBeamlets + iter->first); if (itsBeamletAllocation[index].subbandNr) { LOG_ERROR_STR("Beamlet " << iter->first << "(" << index << ") is already assigned to subband " << iter->second); @@ -1240,11 +1369,11 @@ void BeamServer::_allocBeamlets(IBS_Protocol::Beamlet2SubbandMap& allocation, map<uint16,uint16>::const_iterator iter = allocation().begin(); map<uint16,uint16>::const_iterator end = allocation().end(); for ( ; iter != end; iter++) { - itsBeamletAllocation[ringNr * LOFAR::MAX_BEAMLETS + iter->first].subbandNr = iter->second; + itsBeamletAllocation[ringNr * itsCurrentMaxBeamlets + iter->first].subbandNr = iter->second; // NOTE: we like to set the scaling for each beamlets here also but we need // the spectral window of the antenneSet for that. We will receive that info // from the CalServer in a later state and calc the scalings than. - itsBeamletAllocation[ringNr * LOFAR::MAX_BEAMLETS + iter->first].scaling = complex<double>(0.0, 0.0); + itsBeamletAllocation[ringNr * itsCurrentMaxBeamlets + iter->first].scaling = complex<double>(0.0, 0.0); } LOG_INFO_STR("Assignment of subbands to beamlets succesfull."); @@ -1267,7 +1396,7 @@ void BeamServer::_scaleBeamlets(IBS_Protocol::Beamlet2SubbandMap& allocation, for ( ; iter != end; iter++) { // first: beamletIndex, second: subbandnr double freq = spw.getSubbandFreq(iter->second); - int index = ringNr * LOFAR::MAX_BEAMLETS + iter->first; + int index = ringNr * itsCurrentMaxBeamlets + iter->first; itsBeamletAllocation[index].scaling = -2.0 * M_PI * freq * complex<double>(0.0,1.0) / speedOfLight; LOG_TRACE_OBJ_STR("scaling subband[" << itsBeamletAllocation[index].subbandNr << "]@beamlet[" << index << "] = " << itsBeamletAllocation[index].scaling << @@ -1287,8 +1416,8 @@ void BeamServer::_releaseBeamlets(IBS_Protocol::Beamlet2SubbandMap& allocation, map<uint16,uint16>::iterator iter = allocation().begin(); map<uint16,uint16>::iterator end = allocation().end(); for ( ; iter != end; iter++) { - itsBeamletAllocation[ringNr * LOFAR::MAX_BEAMLETS + iter->first].subbandNr = 0; - itsBeamletAllocation[ringNr * LOFAR::MAX_BEAMLETS + iter->first].scaling = complex<double>(0.0, 0.0); + itsBeamletAllocation[ringNr * itsCurrentMaxBeamlets + iter->first].subbandNr = 0; + itsBeamletAllocation[ringNr * itsCurrentMaxBeamlets + iter->first].scaling = complex<double>(0.0, 0.0); } LOG_INFO_STR("Assigned beamlets released succesfully."); @@ -1475,12 +1604,14 @@ void BeamServer::compute_weights(Timestamp weightTime) LOG_INFO_STR("Calculating weights for time " << weightTime); // reset all weights - LOG_DEBUG_STR("Weights array has size: " << itsWeights.extent(firstDim) << "x" << itsWeights.extent(secondDim)); - itsWeights(Range::all(), Range::all()) = 0.0; + LOG_DEBUG_STR("Weights array has size: " << itsWeights.extent(firstDim) << "x" << + itsWeights.extent(secondDim) << "x" << itsWeights.extent(thirdDim)); + itsWeights = 0.0; // get ptr to antennafield information AntennaField *gAntField = globalAntennaField(); + int beamletsPerPlane = maxBeamletsPerPlane(itsCurrentBitsPerSample); // Check both LBA and HBA antennas for (uint fieldNr = 0; fieldNr < 4; fieldNr++) { string fieldName; @@ -1552,7 +1683,7 @@ void BeamServer::compute_weights(Timestamp weightTime) sourceJ2000xyz(0,0), sourceJ2000xyz(0,1), sourceJ2000xyz(0,2))); // Note: Beamlet numbers depend on the ring. - int firstBeamlet(gAntField->ringNr(fieldName) * LOFAR::MAX_BEAMLETS); + int firstBeamlet(gAntField->ringNr(fieldName) * itsCurrentMaxBeamlets); LOG_DEBUG_STR("first beamlet of field " << fieldName << "=" << firstBeamlet); // Note: RCUallocation is stationbased, rest info is fieldbased, bitset<MAX_RCUS> RCUallocation(beamIter->second->rcuMask()); @@ -1566,7 +1697,9 @@ void BeamServer::compute_weights(Timestamp weightTime) // Note: weight is in-procduct for RCUpos and source Pos and depends on // the frequency of the subband. // - bitset<MAX_BEAMLETS> beamletAllocation = beamIter->second->allocation().getBeamletBitset(); + boost::dynamic_bitset<> beamletAllocation; + beamletAllocation.resize(itsCurrentMaxBeamlets); + beamletAllocation = beamIter->second->allocation().getBeamletBitset(itsCurrentMaxBeamlets); int nrBeamlets = beamletAllocation.size(); for (int beamlet = 0; beamlet < nrBeamlets; beamlet++) { if (!beamletAllocation.test(beamlet)) { @@ -1575,14 +1708,17 @@ void BeamServer::compute_weights(Timestamp weightTime) complex<double> CalFactor = _getCalFactor(beamIter->second->rcuMode(), rcu, itsBeamletAllocation[beamlet+firstBeamlet].subbandNr); - itsWeights(rcu, beamlet) = CalFactor * exp(itsBeamletAllocation[beamlet+firstBeamlet].scaling * - (rcuJ2000Pos((int)posIndex[rcu], 0) * sourceJ2000xyz(0,0) + - rcuJ2000Pos((int)posIndex[rcu], 1) * sourceJ2000xyz(0,1) + - rcuJ2000Pos((int)posIndex[rcu], 2) * sourceJ2000xyz(0,2))); + int bitPlane = beamlet / beamletsPerPlane; + itsWeights(rcu, bitPlane, beamlet % beamletsPerPlane) = + CalFactor * exp(itsBeamletAllocation[beamlet+firstBeamlet].scaling * + (rcuJ2000Pos((int)posIndex[rcu], 0) * sourceJ2000xyz(0,0) + + rcuJ2000Pos((int)posIndex[rcu], 1) * sourceJ2000xyz(0,1) + + rcuJ2000Pos((int)posIndex[rcu], 2) * sourceJ2000xyz(0,2))); // some debugging if (beamlet%100==0) { - LOG_DEBUG_STR("itsWeights(" << rcu << "," << beamlet << ")=" << itsWeights(rcu, beamlet) + LOG_DEBUG_STR("itsWeights(" << rcu << "," << bitPlane << "," << beamlet << ")=" + << itsWeights(rcu, bitPlane, beamlet) << " : rcuPos[" << posIndex[rcu] << "]=" << rcuJ2000Pos((int)posIndex[rcu],0) << " : CalFactor=" << CalFactor); } @@ -1616,8 +1752,9 @@ void BeamServer::send_weights(Timestamp time) sw.rcumask.set(i); } - sw.weights().resize(1, itsMaxRCUs, MAX_BEAMLETS); - sw.weights()(0, Range::all(), Range::all()) = itsWeights16; + int nPlanes = MAX_BITS_PER_SAMPLE / itsCurrentBitsPerSample; + sw.weights().resize(1, itsMaxRCUs, nPlanes, itsCurrentMaxBeamlets / nPlanes); + sw.weights()(0, Range::all(), Range::all(), Range::all()) = itsWeights16; LOG_INFO_STR("sending weights for interval " << time << " : " << time + (long)(itsComputeInterval-1)); @@ -1659,9 +1796,10 @@ void BeamServer::send_sbselection() // beam 1, then beam 0 is deallocated, thus there is a hole // of 64 beamlets before the beamlets of beam 1. // + int beamletsPerPlane = maxBeamletsPerPlane(itsCurrentBitsPerSample); ss.subbands.setType(SubbandSelection::BEAMLET); - ss.subbands().resize(1, MAX_BEAMLETS); - ss.subbands() = 0; + ss.subbands.beamlets().resize(1, MAX_BITS_PER_SAMPLE/itsCurrentBitsPerSample, beamletsPerPlane); + ss.subbands.beamlets() = 0; // reconstruct the selection Beamlet2SubbandMap selection; @@ -1682,23 +1820,23 @@ void BeamServer::send_sbselection() for ( ; iter != end; ++iter) { LOG_DEBUG(formatString("(%d,%d)", iter->first, iter->second)); - if (iter->first >= MAX_BEAMLETS) { - LOG_ERROR(formatString("SBSELECTION: invalid src index %d", iter->first)); + if (iter->first >= itsCurrentMaxBeamlets) { + LOG_ERROR(formatString("SBSELECTION: invalid src index %d (max=%d)", iter->first, itsCurrentMaxBeamlets)); continue; } if (iter->second >= MAX_SUBBANDS) { - LOG_ERROR(formatString("SBSELECTION: invalid tgt index %d", iter->second)); + LOG_ERROR(formatString("SBSELECTION: invalid tgt index %d (max=%d)", iter->second, MAX_SUBBANDS)); continue; } // same selection for x and y polarization - ss.subbands()(0, (int)iter->first) = iter->second; + ss.subbands.beamlets()(0, iter->first/beamletsPerPlane, iter->first%beamletsPerPlane) = iter->second; } if (selection().size()) { LOG_DEBUG_STR("Sending subbandselection for ring segment " << ringNr); - LOG_DEBUG_STR(ss.subbands()); + LOG_DEBUG_STR(ss.subbands.beamlets()); itsRSPDriver->send(ss); } else { diff --git a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h index e164fd849ada95db6f13f4804a1c2031f7e2b29c..589bedbcea0b861ff63f23bc2f180ec08d3631f5 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h +++ b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h @@ -23,10 +23,11 @@ #ifndef BEAMSERVER_H_ #define BEAMSERVER_H_ -#include <Common/lofar_string.h> -#include <Common/lofar_set.h> -#include <Common/lofar_map.h> +#include <Common/lofar_bitset.h> #include <Common/lofar_list.h> +#include <Common/lofar_map.h> +#include <Common/lofar_set.h> +#include <Common/lofar_string.h> #include <GCF/TM/GCF_Control.h> #include <APL/IBS_Protocol/IBS_Protocol.ph> #include <CASATools/CasaConverter.h> @@ -90,7 +91,7 @@ private: string name, string subarrayname, IBS_Protocol::Beamlet2SubbandMap allocation, - LOFAR::bitset<LOFAR::MAX_RCUS> rcumask, + bitset<LOFAR::MAX_RCUS> rcumask, uint ringNr, uint rcuMode, int* beamError); @@ -108,6 +109,9 @@ private: // Take a subscription on the splitter state. GCFEvent::TResult subscribeSplitter(GCFEvent& e, GCFPortInterface& p); + // Take a subscription on the bitmode + GCFEvent::TResult subscribeBitmode(GCFEvent& event, GCFPortInterface& port); + // Try to connect to the CalServer GCFEvent::TResult con2calserver(GCFEvent& e, GCFPortInterface& p); @@ -179,6 +183,13 @@ private: // ### data members ### + // 'constant' containing the current number of bits each datasample has. + // This value determines how many beamlets a RSPBoard produces (and how large some of + // our arrays become). The function maxBeamletsPerRSP in Common/LofarBitModeInfo.h calculates + // the maxBeamlets 'constant' we are used to work with before bitsperSample was a variable value. + int itsCurrentBitsPerSample; + int itsCurrentMaxBeamlets; + // BeamletAllocation typedef struct BeamletAllocation { int subbandNr; @@ -188,8 +199,8 @@ private: vector<BeamletAlloc_t> itsBeamletAllocation; // Weights array [MAX_RCUS, MAX_BEAMLETS] - blitz::Array<std::complex<double>, 2> itsWeights; - blitz::Array<std::complex<int16_t>, 2> itsWeights16; + blitz::Array<std::complex<double>, 3> itsWeights; + blitz::Array<std::complex<int16_t>, 3> itsWeights16; // RCU Allocations in the AntennaArrays. Remember that each RCU can participate // in more than one beam. @@ -229,6 +240,7 @@ private: // constants uint itsMaxRCUs; // + uint itsMaxRSPboards; // bool itsSetHBAEnabled; // bool itsSetWeightsEnabled; // bool itsSetSubbandsEnabled; // diff --git a/MAC/APL/PAC/ITRFBeamServer/src/DigitalBeam.cc b/MAC/APL/PAC/ITRFBeamServer/src/DigitalBeam.cc index 1926b2e6aa7210d55596d2ea2ac67ec9e028c8dc..e65040d7a874aa30b6a7c70351525030bb10829c 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/DigitalBeam.cc +++ b/MAC/APL/PAC/ITRFBeamServer/src/DigitalBeam.cc @@ -48,12 +48,12 @@ using namespace RTC; // // DigitalBeam(name, subarray, nrSubbands) // -DigitalBeam::DigitalBeam(const string& name, - const string& antennaSet, - const Beamlet2SubbandMap& allocation, - const bitset<MAX_RCUS>& rcuMask, - uint ringNr, - uint rcuMode) : +DigitalBeam::DigitalBeam(const string& name, + const string& antennaSet, + const Beamlet2SubbandMap& allocation, + const bitset<MAX_RCUS>& rcuMask, + uint ringNr, + uint rcuMode) : Beam (name, antennaSet, rcuMask), itsBeamletAllocation(allocation), itsRingNr (ringNr), diff --git a/MAC/APL/PAC/ITRFBeamServer/src/DigitalBeam.h b/MAC/APL/PAC/ITRFBeamServer/src/DigitalBeam.h index 9d446ee4c3bdda050f616d1315a8dc2e8326fe2b..0aba04f8cee0555c841222d79953fe515fb9352d 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/DigitalBeam.h +++ b/MAC/APL/PAC/ITRFBeamServer/src/DigitalBeam.h @@ -24,6 +24,7 @@ #define DIGITALBEAM_H_ #include <lofar_config.h> +#include <Common/lofar_bitset.h> #include <Common/lofar_string.h> #include <APL/RTCCommon/Timestamp.h> #include <APL/IBS_Protocol/Beamlet2SubbandMap.h> diff --git a/MAC/APL/PAC/ITRFBeamServer/src/beamctl.cc b/MAC/APL/PAC/ITRFBeamServer/src/beamctl.cc index 6a1ec202399385e59b1f25e1ecaf9ffbd2690717..1783817e5e69823e04f5080f6209d1889f0743fa 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/beamctl.cc +++ b/MAC/APL/PAC/ITRFBeamServer/src/beamctl.cc @@ -25,7 +25,7 @@ #include <Common/LofarLogger.h> #include <Common/Exception.h> #include <Common/ParameterSet.h> -#include <Common/lofar_bitset.h> +#include <Common/LofarBitModeInfo.h> #include <Common/lofar_string.h> #include <Common/lofar_list.h> #include <ApplCommon/AntennaSets.h> @@ -50,6 +50,7 @@ #define BEAMLET_RING_OFFSET 1000 using namespace blitz; +using namespace std; namespace LOFAR { using namespace RTC; using namespace CAL_Protocol; @@ -767,13 +768,14 @@ bool beamctl::parseOptions(int myArgc, char** myArgv) break; case 's': { - itsSubbands = strtolist(optarg, LOFAR::MAX_SUBBANDS); + itsSubbands = strtolist(optarg, MAX_SUBBANDS); cout << "subbands : "; printList(itsSubbands); } break; case 'b': { - itsBeamlets = strtolist(optarg, BEAMLET_RING_OFFSET + LOFAR::MAX_BEAMLETS); + // assume lowest bitmode, if this is not the case the BeamServer will complain... + itsBeamlets = strtolist(optarg, BEAMLET_RING_OFFSET + maxBeamlets(MIN_BITS_PER_SAMPLE)); cout << "beamlets : "; printList(itsBeamlets); } break; @@ -818,6 +820,10 @@ int main(int argc, char** argv) { GCFScheduler::instance()->init(argc, argv, "beamctl"); + ASSERTSTR(BEAMLET_RING_OFFSET > maxBeamlets(MIN_BITS_PER_SAMPLE), + formatString("(%d>%d) beamctl is not suitable for handling %d bit mode. Revise program.", + BEAMLET_RING_OFFSET, maxBeamlets(MIN_BITS_PER_SAMPLE), MIN_BITS_PER_SAMPLE)); + try { beamctl beamctlTask("beamctl"); beamctlTask.start(); diff --git a/MAC/APL/PAC/ITRFBeamServer/src/beamctl.h b/MAC/APL/PAC/ITRFBeamServer/src/beamctl.h index 490ce1ff4d99023665b87cb34b8aa34aa5a3c750..279cd8a14b1379af396a561b904def4d4af32642 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/beamctl.h +++ b/MAC/APL/PAC/ITRFBeamServer/src/beamctl.h @@ -62,12 +62,12 @@ public: private: // Return the seleted rcus as bitset<MAX_N_RCUS> - bool parseOptions(int myArgc, char** myArgv); - bool checkOptions(); - bitset<LOFAR::MAX_RCUS> getRCUMask() const; - list<int> strtolist(const char* str, int max) const; - void printList(list<int>& theList) const; - void usage() const; + bool parseOptions(int myArgc, char** myArgv); + bool checkOptions(); + bitset<MAX_RCUS> getRCUMask() const; + list<int> strtolist(const char* str, int max) const; + void printList(list<int>& theList) const; + void usage() const; void send_direction(double longitude, double latitude, const string& dirType, bool isAnalogue); // ports diff --git a/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.cc b/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.cc index 7171e75460002142b2265f034a346337ec09e1d7..9d6fa2cbb56ae20d33d992bd13a88c4f1f883f54 100644 --- a/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.cc +++ b/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.cc @@ -39,25 +39,25 @@ using namespace EPA_Protocol; namespace LOFAR { namespace SHM_Protocol { - unsigned int RspStatus::getSize() + size_t RspStatus::getSize() const { - return MSH_ARRAY_SIZE(m_board_status, EPA_Protocol::BoardStatus); + return MSH_size(m_board_status); } - unsigned int RspStatus::pack (void* buffer) + size_t RspStatus::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_board_status, EPA_Protocol::BoardStatus); + MSH_pack(buffer, offset, m_board_status); return offset; } - unsigned int RspStatus::unpack(void *buffer) + size_t RspStatus::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_board_status, EPA_Protocol::BoardStatus, 1); + MSH_unpack(buffer, offset, m_board_status); return offset; } diff --git a/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.h b/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.h index 41ee4d8f5e12d05a7e0c803683adead87d8fcb9c..fb0a1c3fcc23fbe128bf5a5968f053a2b0195e21 100644 --- a/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.h +++ b/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.h @@ -58,9 +58,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc b/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc index 824fa7a6b1c09767de78ecaf4cf75dae32b977f8..8b8e2339c4397309c0fe69f0d8b3ec7d9c342b3c 100644 --- a/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc +++ b/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc @@ -962,8 +962,7 @@ GCFEvent::TResult SHMSession::getAntennaCorrelation_state(GCFEvent& e, GCFPortIn //MAXMOD the constant SubbandSelection::XLET is defined in LOFAR/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h //LOG_DEBUG(formatString("MAXMOD SubbandSelection::XLET is %d",SubbandSelection::XLET)); setsubbands.subbands.setType(SubbandSelection::XLET); - - setsubbands.subbands().resize(1,1); + setsubbands.subbands.crosslets().resize(1,1); list<int> subbandlist; for (int rcu = 0; rcu < _nrOfRCUs / N_POL; rcu++){ //for (int rcu = 0; rcu < _nrOfRCUs ; rcu++){ @@ -971,12 +970,12 @@ GCFEvent::TResult SHMSession::getAntennaCorrelation_state(GCFEvent& e, GCFPortIn LOG_DEBUG(formatString("MAXMOD rcu = %d", rcu)); } LOG_DEBUG(formatString("MAXMOD subbands - type %d ",setsubbands.subbands.getType())); - LOG_DEBUG(formatString("MAXMOD subbands - first dim %d ",setsubbands.subbands().extent(firstDim))); - LOG_DEBUG(formatString("MAXMOD subbands - second dim %d ",setsubbands.subbands().extent(secondDim))); + LOG_DEBUG(formatString("MAXMOD subbands - first dim %d ",setsubbands.subbands.crosslets().extent(firstDim))); + LOG_DEBUG(formatString("MAXMOD subbands - second dim %d ",setsubbands.subbands.crosslets().extent(secondDim))); LOG_DEBUG_STR("itsRCU:" << string(setsubbands.rcumask.to_string<char,char_traits<char>,allocator<char> >())); std::list<int>::iterator it = subbandlist.begin(); - setsubbands.subbands() = (*it); + setsubbands.subbands.crosslets() = (*it); if (!_rspDriverPort.send(setsubbands)) { SEND_RESP_MSG((*pIn), AntennaCorrelationMatrixResponse, "NAK (lost connection to rsp driver)"); diff --git a/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.cc b/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.cc index 244a6824d77c155329aceaf51bba34e3a619b02a..d044dc6853af30586ee445440e40ee1f53ff3a24 100644 --- a/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.cc +++ b/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.cc @@ -32,25 +32,25 @@ using namespace blitz; namespace LOFAR { namespace SHM_Protocol { - unsigned int XCStatistics::getSize() + size_t XCStatistics::getSize() const { - return MSH_ARRAY_SIZE(m_xstatistics, complex<double>); + return MSH_size(m_xstatistics); } - unsigned int XCStatistics::pack (void* buffer) + size_t XCStatistics::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_xstatistics, complex<double>); + MSH_pack(buffer, offset, m_xstatistics); return offset; } - unsigned int XCStatistics::unpack(void *buffer) + size_t XCStatistics::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_xstatistics, complex<double>, 4); + MSH_unpack(buffer, offset, m_xstatistics); return offset; } diff --git a/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.h b/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.h index a572979255c3770bb3ca20d6fd380f55af43131d..c6ec991ed519bf1971bb168663f733d3282f4199 100644 --- a/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.h +++ b/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.h @@ -54,9 +54,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Driver/src/BMRead.cc b/MAC/APL/PIC/RSP_Driver/src/BMRead.cc new file mode 100644 index 0000000000000000000000000000000000000000..1f562604615018912a1782eb73b4486a1752f8c5 --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/BMRead.cc @@ -0,0 +1,108 @@ +//# BMRead.cc: implementation of the BMRead class +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: BMRead.cc 18124 2011-05-29 19:54:09Z schoenmakers $ + +#include <lofar_config.h> +#include <Common/LofarLogger.h> + +#include <APL/RSP_Protocol/RSP_Protocol.ph> +#include <APL/RSP_Protocol/EPA_Protocol.ph> +#include <APL/RTCCommon/PSAccess.h> +#include <blitz/array.h> + +#include "StationSettings.h" +#include "BMRead.h" +#include "Cache.h" + +using namespace blitz; +using namespace LOFAR; +using namespace RSP; +using namespace RTC; + +BMRead::BMRead(GCFPortInterface& board_port, int board_id) + : SyncAction(board_port, board_id, 1) +{ + memset(&itsHdr, 0, sizeof(MEPHeader)); +} + +BMRead::~BMRead() +{ +} + +void BMRead::sendrequest() +{ + if ((( Cache::getInstance().getBack().getVersions().bp()(getBoardId()).fpga_maj * 10) + + Cache::getInstance().getBack().getVersions().bp()(getBoardId()).fpga_min) < 74) { + LOG_DEBUG_STR(formatString("BMRead:: Firmware on board[%d], has NO bitmode support", getBoardId())); + Cache::getInstance().getState().bmState().unmodified(getBoardId()); + setContinue(true); // continue with next action + setFinished(); + } + else { + EPAReadEvent bmread; + bmread.hdr.set(MEPHeader::RSR_BEAMMODE_HDR, + MEPHeader::DST_RSP, + MEPHeader::READ ); + + itsHdr = bmread.hdr; + getBoardPort().send(bmread); + LOG_DEBUG_STR("BMRead::sendrequest() done"); + } +} + +void BMRead::sendrequest_status() +{ + /* intentionally left empty */ +} + +GCFEvent::TResult BMRead::handleack(GCFEvent& event, GCFPortInterface& /*port*/) +{ + if (EPA_RSR_BEAMMODE != event.signal) + { + LOG_WARN("BMRead::handleack: unexpected ack"); + return GCFEvent::NOT_HANDLED; + } + + // unpack bm message + EPARsrBeammodeEvent bm(event); + + LOG_DEBUG_STR(formatString("BM supported = %d", bm.beammode.bm_max)); + LOG_DEBUG_STR(formatString("BM selected = %d", bm.beammode.bm_select)); + + if (!bm.hdr.isValidAck(itsHdr)) + { + Cache::getInstance().getState().bmState().read_error(getBoardId()); + LOG_ERROR("BMRead::handleack: invalid ack"); + return GCFEvent::NOT_HANDLED; + } + + LOG_DEBUG("handleack"); + + LOG_DEBUG(formatString(">>>> BMRead(%s)", getBoardPort().getName().c_str())); + + Cache::getInstance().getBack().getBitModeInfo()()(getBoardId()).bm_select = bm.beammode.bm_select; + Cache::getInstance().getBack().getBitModeInfo()()(getBoardId()).bm_max = bm.beammode.bm_max; + + Cache::getInstance().getState().bmState().read_ack(getBoardId()); + + LOG_DEBUG_STR("BMRead::handleack() done"); + return GCFEvent::HANDLED; +} diff --git a/MAC/APL/PIC/RSP_Driver/src/BMRead.h b/MAC/APL/PIC/RSP_Driver/src/BMRead.h new file mode 100644 index 0000000000000000000000000000000000000000..959910abd3d8f978d3e2a94f4440e8377544738a --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/BMRead.h @@ -0,0 +1,68 @@ +//# -*- mode: c++ -*- +//# +//# BMRead.h: Synchronize subbands selection settings with RSP hardware. +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: BMRead.h 6853 2005-10-21 10:55:56Z wierenga $ + +#ifndef BMREAD_H_ +#define BMREAD_H_ + +#include <Common/LofarTypes.h> +#include <APL/RSP_Protocol/MEPHeader.h> + +#include "SyncAction.h" + +namespace LOFAR { + namespace RSP { + + class BMRead : public SyncAction + { + public: + /** + * Constructors for a BMRead object. + */ + BMRead(GCFPortInterface& board_port, int board_id); + + /* Destructor for BMRead. */ + virtual ~BMRead(); + + /** + * Read subband selection info. + */ + virtual void sendrequest(); + + /** + * Read the board status. + */ + virtual void sendrequest_status(); + + /** + * Handle the READRES message. + */ + virtual GCFEvent::TResult handleack(GCFEvent& event, GCFPortInterface& port); + + private: + EPA_Protocol::MEPHeader itsHdr; + }; + }; +}; + +#endif /* BMREAD_H_ */ diff --git a/MAC/APL/PIC/RSP_Driver/src/BMWrite.cc b/MAC/APL/PIC/RSP_Driver/src/BMWrite.cc new file mode 100644 index 0000000000000000000000000000000000000000..e884df65895bbfd7128da452e81e87b63a18f7ad --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/BMWrite.cc @@ -0,0 +1,114 @@ +//# BMWrite.cc: implementation of the BMWrite class +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: BMWrite.cc 18124 2011-05-29 19:54:09Z schoenmakers $ + +#include <lofar_config.h> +#include <Common/LofarLogger.h> + +#include <APL/RSP_Protocol/RSP_Protocol.ph> +#include <APL/RSP_Protocol/EPA_Protocol.ph> +#include <APL/RTCCommon/PSAccess.h> +#include <blitz/array.h> + +#include "StationSettings.h" +#include "BMWrite.h" +#include "Cache.h" + +#define N_RETRIES 3 + +using namespace blitz; +using namespace LOFAR; +using namespace RSP; +using namespace RTC; + +BMWrite::BMWrite(GCFPortInterface& board_port, int board_id) + : SyncAction(board_port, board_id, 1) +{ + memset(&itsHdr, 0, sizeof(MEPHeader)); +} + +BMWrite::~BMWrite() +{ + /* TODO: delete event? */ +} + +void BMWrite::sendrequest() +{ + if ((( Cache::getInstance().getBack().getVersions().bp()(getBoardId()).fpga_maj * 10) + + Cache::getInstance().getBack().getVersions().bp()(getBoardId()).fpga_min) < 74) { + LOG_DEBUG_STR(formatString("BMWrite:: Firmware on board[%d], has NO bitmode support", getBoardId())); + Cache::getInstance().getState().bmState().read_ack(getBoardId()); + setContinue(true); // continue with next action + setFinished(); + } + else { + + LOG_DEBUG(formatString(">>>> BMWrite(%s) boardId=%d", + getBoardPort().getName().c_str(), + getBoardId())); + + // skip update if the neither of the RCU's settings have been modified + if (RTC::RegisterState::WRITE != Cache::getInstance().getState().bmState().get(getBoardId())) { + Cache::getInstance().getState().bmState().unmodified(getBoardId()); + setContinue(true); + setFinished(); + return; + } + + // send subband select message + EPARsrBeammodeEvent bm; + bm.hdr.set(MEPHeader::RSR_BEAMMODE_HDR, + MEPHeader::DST_ALL); + + bm.beammode.bm_select = Cache::getInstance().getBack().getBitModeInfo()()(getBoardId()).bm_select; + + itsHdr = bm.hdr; +LOG_INFO_STR(bm); + getBoardPort().send(bm); + } +} + +void BMWrite::sendrequest_status() +{ + // intentionally left empty +} + +GCFEvent::TResult BMWrite::handleack(GCFEvent& event, GCFPortInterface& /*port*/) +{ + if (EPA_WRITEACK != event.signal) + { + LOG_WARN("BMWrite::handleack: unexpected ack"); + return GCFEvent::NOT_HANDLED; + } + + EPAWriteackEvent bm(event); + + if (!bm.hdr.isValidAck(itsHdr)) + { + Cache::getInstance().getState().bmState().write_error(getBoardId()); + LOG_ERROR("BMWrite::handleack: invalid ack"); + return GCFEvent::NOT_HANDLED; + } + + Cache::getInstance().getState().bmState().write_ack(getBoardId()); + + return GCFEvent::HANDLED; +} diff --git a/MAC/APL/PIC/RSP_Driver/src/BMWrite.h b/MAC/APL/PIC/RSP_Driver/src/BMWrite.h new file mode 100644 index 0000000000000000000000000000000000000000..cff5d3910cef7851e097c2166d8a9f33086b4d76 --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/BMWrite.h @@ -0,0 +1,68 @@ +//# -*- mode: c++ -*- +//# +//# BMWrite.h: Synchronize Bitmode settings with RSP hardware. +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: BMWrite.h 6853 2005-10-21 10:55:56Z wierenga $ + +#ifndef BMWRITE_H_ +#define BMWRITE_H_ + +#include <Common/LofarTypes.h> +#include <APL/RSP_Protocol/MEPHeader.h> + +#include "SyncAction.h" + +namespace LOFAR { + namespace RSP { + + class BMWrite : public SyncAction + { + public: + /** + * Constructors for a BMWrite object. + */ + BMWrite(GCFPortInterface& board_port, int board_id); + + /* Destructor for BMWrite. */ + virtual ~BMWrite(); + + /** + * Write subband selection info. + */ + virtual void sendrequest(); + + /** + * Read the board status. + */ + virtual void sendrequest_status(); + + /** + * Handle the READRES message. + */ + virtual GCFEvent::TResult handleack(GCFEvent& event, GCFPortInterface& port); + + private: + EPA_Protocol::MEPHeader itsHdr; + }; + }; +}; + +#endif /* BMWRITE_H_ */ diff --git a/MAC/APL/PIC/RSP_Driver/src/BWRead.cc b/MAC/APL/PIC/RSP_Driver/src/BWRead.cc index a59fae3a8d266ca4473bbf3f5048aa9cae2c7a42..a8d2f4266f0c173f855be06f5279fd7bacb024b1 100644 --- a/MAC/APL/PIC/RSP_Driver/src/BWRead.cc +++ b/MAC/APL/PIC/RSP_Driver/src/BWRead.cc @@ -42,8 +42,8 @@ using namespace RSP; using namespace EPA_Protocol; BWRead::BWRead(GCFPortInterface& board_port, int board_id, int blp, int regid) - : SyncAction(board_port, board_id, MEPHeader::BF_N_FRAGMENTS), - m_blp(blp), m_regid(regid), m_remaining(0), m_offset(0) + : SyncAction(board_port, board_id, MEPHeader::BF_N_FRAGMENTS*(MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE)), + m_blp(blp), m_regid(regid), itsBank(0), m_remaining(0), m_offset(0) { memset(&m_hdr, 0, sizeof(MEPHeader)); } @@ -54,8 +54,13 @@ BWRead::~BWRead() void BWRead::sendrequest() { + int activeBanks = (MAX_BITS_PER_SAMPLE / Cache::getInstance().getBack().getBitsPerSample()); + if (getCurrentIndex() >= (activeBanks*MEPHeader::BF_N_FRAGMENTS)) { + setContinue(true); + } uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + m_blp; - + itsBank = (getCurrentIndex() / MEPHeader::BF_N_FRAGMENTS) ; + if (m_regid < MEPHeader::BF_XROUT || m_regid > MEPHeader::BF_YIOUT) { LOG_FATAL("invalid regid"); @@ -63,37 +68,53 @@ void BWRead::sendrequest() } // reset m_offset and m_remaining for each register - if (0 == getCurrentIndex()) { + if (0 == (getCurrentIndex()%MEPHeader::BF_N_FRAGMENTS)) { m_remaining = MEPHeader::BF_XROUT_SIZE; // representative for XR, XI, YR, YI size m_offset = 0; } - LOG_DEBUG(formatString(">>>> BWRead(%s) global_blp=%d, regid=%d", + LOG_DEBUG(formatString(">>>> BWRead(%s) global_blp=%d, regid=%d, plane=%d", getBoardPort().getName().c_str(), global_blp, - m_regid)); + m_regid, + itsBank)); // send next BF configure message EPAReadEvent bfcoefs; size_t size = MIN(MEPHeader::FRAGMENT_SIZE, m_remaining); - switch (m_regid) - { + switch (m_regid) { case MEPHeader::BF_XROUT: - bfcoefs.hdr.set(MEPHeader::BF_XROUT_HDR, 1 << m_blp, - MEPHeader::READ, size, m_offset); + bfcoefs.hdr.set( MEPHeader::READ, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_XROUT+(itsBank*4), + size, + m_offset); break; case MEPHeader::BF_XIOUT: - bfcoefs.hdr.set(MEPHeader::BF_XIOUT_HDR, 1 << m_blp, - MEPHeader::READ, size, m_offset); + bfcoefs.hdr.set( MEPHeader::READ, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_XIOUT+(itsBank*4), + size, + m_offset); break; case MEPHeader::BF_YROUT: - bfcoefs.hdr.set(MEPHeader::BF_YROUT_HDR, 1 << m_blp, - MEPHeader::READ, size, m_offset); + bfcoefs.hdr.set( MEPHeader::READ, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_YROUT+(itsBank*4), + size, + m_offset); break; case MEPHeader::BF_YIOUT: - bfcoefs.hdr.set(MEPHeader::BF_YIOUT_HDR, 1 << m_blp, - MEPHeader::READ, size, m_offset); + bfcoefs.hdr.set( MEPHeader::READ, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_YIOUT+(itsBank*4), + size, + m_offset); break; } @@ -108,7 +129,7 @@ void BWRead::sendrequest_status() GCFEvent::TResult BWRead::handleack(GCFEvent& event, GCFPortInterface& /*port*/) { - if (EPA_BF_COEFS_READ != event.signal) + if ((event.signal < EPA_BF_COEFS_READ) || (event.signal > (EPA_BF_COEFS_READ+15))) { LOG_WARN("BWRead::handleack: unexpected ack"); return GCFEvent::NOT_HANDLED; @@ -144,7 +165,7 @@ GCFEvent::TResult BWRead::handleack(GCFEvent& event, GCFPortInterface& /*port*/) // substract cache contents from weights // if there is a difference, log a warning // - weights -= Cache::getInstance().getBack().getBeamletWeights()()(0, Range(global_blp * 2, global_blp * 2 + 1), target_range); + weights -= Cache::getInstance().getBack().getBeamletWeights()()(0, Range(global_blp * 2, global_blp * 2 + 1), itsBank, target_range); complex<int16> errorsum(sum(weights)); if (complex<int16>(0) != errorsum) @@ -156,11 +177,11 @@ GCFEvent::TResult BWRead::handleack(GCFEvent& event, GCFPortInterface& /*port*/) else { // X - Cache::getInstance().getBack().getBeamletWeights()()(0, global_blp * 2, target_range) + Cache::getInstance().getBack().getBeamletWeights()()(0, global_blp * 2, itsBank, target_range) = weights(Range::all(), 0); // Y - Cache::getInstance().getBack().getBeamletWeights()()(0, global_blp * 2 + 1, target_range) + Cache::getInstance().getBack().getBeamletWeights()()(0, global_blp * 2 + 1, itsBank, target_range) = weights(Range::all(), 1); } diff --git a/MAC/APL/PIC/RSP_Driver/src/BWRead.h b/MAC/APL/PIC/RSP_Driver/src/BWRead.h index 01077de2f407085743c380525ed7527a38929e1f..a72c381ade4cccc7b2334b5d6e4fc653dd40ae28 100644 --- a/MAC/APL/PIC/RSP_Driver/src/BWRead.h +++ b/MAC/APL/PIC/RSP_Driver/src/BWRead.h @@ -61,6 +61,7 @@ namespace LOFAR { private: int m_blp; int m_regid; + int itsBank; size_t m_remaining; // how much to read size_t m_offset; // where to read diff --git a/MAC/APL/PIC/RSP_Driver/src/BWWrite.cc b/MAC/APL/PIC/RSP_Driver/src/BWWrite.cc index 1976c5a068eac96eb9327ada6bf3f3adc758c84a..d04fd573c35be36fe1badc8b1fab65e59aa4bf84 100644 --- a/MAC/APL/PIC/RSP_Driver/src/BWWrite.cc +++ b/MAC/APL/PIC/RSP_Driver/src/BWWrite.cc @@ -45,9 +45,10 @@ using namespace RSP; using namespace EPA_Protocol; BWWrite::BWWrite(GCFPortInterface& board_port, int board_id, int blp, int regid) - : SyncAction(board_port, board_id, MEPHeader::BF_N_FRAGMENTS), - m_blp(blp), m_regid(regid), m_remaining(0), m_offset(0) + : SyncAction(board_port, board_id, MEPHeader::BF_N_FRAGMENTS*MAX_NR_BM_BANKS), + m_blp(blp), m_regid(regid), itsBank(0), itsActiveBanks(1), m_remaining(0), m_offset(0) { + memset(&m_hdr, 0, sizeof(MEPHeader)); } @@ -57,12 +58,23 @@ BWWrite::~BWWrite() void BWWrite::sendrequest() { - uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + m_blp; - + itsActiveBanks = (MAX_BITS_PER_SAMPLE / Cache::getInstance().getBack().getBitsPerSample()); + uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + m_blp; + if (getCurrentIndex() >= (itsActiveBanks*MEPHeader::BF_N_FRAGMENTS)) { + if (getCurrentIndex() == (MEPHeader::BF_N_FRAGMENTS*MAX_NR_BM_BANKS - 1)) { + Cache::getInstance().getState().bf().write_ack(global_blp * MEPHeader::N_PHASEPOL + m_regid); + } + setContinue(true); + return; + } + + + itsBank = (getCurrentIndex() / MEPHeader::BF_N_FRAGMENTS) ; + // no conditional, update every second // reset m_offset and m_remaining for each register - if (0 == getCurrentIndex()) { + if (0 == (getCurrentIndex()%MEPHeader::BF_N_FRAGMENTS)) { m_offset = MEPHeader::N_LOCAL_XLETS * MEPHeader::WEIGHT_SIZE; m_remaining = MEPHeader::BF_XROUT_SIZE - m_offset; // representative for XR, XI, YR, YI size } @@ -72,9 +84,6 @@ void BWWrite::sendrequest() exit(EXIT_FAILURE); } - LOG_DEBUG(formatString(">>>> BWWrite(%s) global_blp=%d, blp=%d, regid=%d, m_offset=%d, m_remaining=%d", - getBoardPort().getName().c_str(), global_blp, m_blp, m_regid, m_offset, m_remaining)); - // send next BF configure message EPABfCoefsWriteEvent bfcoefs; @@ -86,19 +95,46 @@ void BWWrite::sendrequest() switch (m_regid) { case MEPHeader::BF_XROUT: - bfcoefs.hdr.set(MEPHeader::BF_XROUT_HDR, 1 << m_blp, MEPHeader::WRITE, size, m_offset); + bfcoefs.hdr.set( MEPHeader::WRITE, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_XROUT+(itsBank*4), + size, + m_offset); break; case MEPHeader::BF_XIOUT: - bfcoefs.hdr.set(MEPHeader::BF_XIOUT_HDR, 1 << m_blp, MEPHeader::WRITE, size, m_offset); + bfcoefs.hdr.set( MEPHeader::WRITE, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_XIOUT+(itsBank*4), + size, + m_offset); break; case MEPHeader::BF_YROUT: - bfcoefs.hdr.set(MEPHeader::BF_YROUT_HDR, 1 << m_blp, MEPHeader::WRITE, size, m_offset); + bfcoefs.hdr.set( MEPHeader::WRITE, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_YROUT+(itsBank*4), + size, + m_offset); break; case MEPHeader::BF_YIOUT: - bfcoefs.hdr.set(MEPHeader::BF_YIOUT_HDR, 1 << m_blp, MEPHeader::WRITE, size, m_offset); + bfcoefs.hdr.set( MEPHeader::WRITE, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_YIOUT+(itsBank*4), + size, + m_offset); break; } - + +#if 0 + if (getBoardId() == 11) { + LOG_INFO_STR("BWWrite:board:" << getBoardId() << ",global_blp=" << (int)global_blp << ",bank=" << itsBank + << "," << bfcoefs.hdr); + } +#endif + // create blitz view om the weights in the bfcoefs message to be sent to the RSP hardware int nbeamlets_per_fragment = MEPHeader::N_BEAMLETS / MEPHeader::BF_N_FRAGMENTS; Array<complex<int16>, 2> weights(nbeamlets_per_fragment, N_POL); @@ -120,22 +156,23 @@ void BWWrite::sendrequest() ASSERT(MEPHeader::N_BEAMLETS % MEPHeader::BF_N_FRAGMENTS == 0); for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { - int hw_offset = lane; - int cache_offset = lane * (MEPHeader::N_BEAMLETS / MEPHeader::N_SERDES_LANES) + (getCurrentIndex() * nbeamlets_per_fragment / MEPHeader::N_SERDES_LANES); + int cache_offset = lane * (MEPHeader::N_BEAMLETS / MEPHeader::N_SERDES_LANES) + ((getCurrentIndex() % MEPHeader::BF_N_FRAGMENTS) * nbeamlets_per_fragment / MEPHeader::N_SERDES_LANES); Range hw_range(hw_offset, hw_offset + nbeamlets_per_fragment - MEPHeader::N_BLPS, MEPHeader::N_BLPS); Range cache_range(cache_offset, cache_offset + (nbeamlets_per_fragment / MEPHeader::N_SERDES_LANES) - 1, 1); - - LOG_DEBUG_STR("lane=" << lane); - LOG_DEBUG_STR("hw_range=" << hw_range); - LOG_DEBUG_STR("cache_range=" << cache_range); - +#if 0 + if (getBoardId() == 11) { + LOG_INFO_STR("board=" << getBoardId() << ",bank=" << itsBank << ",lane=" << lane + << (m_regid / 2 ? ",Y" : ",X") << (m_regid % 2 ? "I" : "R") + << ", hw_range=" << hw_range << ", cache_range=" << cache_range); + } +#endif // X = normal 0 - weights(hw_range, 0) = Cache::getInstance().getBack().getBeamletWeights()()(0, global_blp * 2, cache_range); + weights(hw_range, 0) = Cache::getInstance().getBack().getBeamletWeights()()(0, global_blp * 2, itsBank, cache_range); // Y = normal 1 - weights(hw_range, 1) = Cache::getInstance().getBack().getBeamletWeights()()(0, global_blp * 2 + 1, cache_range); + weights(hw_range, 1) = Cache::getInstance().getBack().getBeamletWeights()()(0, global_blp * 2 + 1, itsBank, cache_range); #if 0 mapped_index(hw_range, 0) = index(cache_range, 0); @@ -245,6 +282,7 @@ void BWWrite::sendrequest_status() GCFEvent::TResult BWWrite::handleack(GCFEvent& event, GCFPortInterface& /*port*/) { if (EPA_WRITEACK != event.signal) { + LOG_INFO_STR(formatString("event.signal=%d", event.signal)); LOG_WARN("BWWrite::handleack: unexpected ack"); return GCFEvent::NOT_HANDLED; } @@ -264,7 +302,7 @@ GCFEvent::TResult BWWrite::handleack(GCFEvent& event, GCFPortInterface& /*port*/ // // Last fragment signals completion // - if (MEPHeader::MEPHeader::BF_N_FRAGMENTS - 1 == getCurrentIndex()) { + if ((MEPHeader::BF_N_FRAGMENTS*itsActiveBanks-1) == getCurrentIndex()) { Cache::getInstance().getState().bf().write_ack(global_blp * MEPHeader::N_PHASEPOL + m_regid); } } diff --git a/MAC/APL/PIC/RSP_Driver/src/BWWrite.h b/MAC/APL/PIC/RSP_Driver/src/BWWrite.h index a1f8b450a527e7ee01cb9598824b1aa134fbf583..bc8a9c8dc723cda79103daecdb81df59fcc8addf 100644 --- a/MAC/APL/PIC/RSP_Driver/src/BWWrite.h +++ b/MAC/APL/PIC/RSP_Driver/src/BWWrite.h @@ -62,6 +62,8 @@ public: private: int m_blp; int m_regid; + int itsBank; + int itsActiveBanks; size_t m_remaining; // how much to write size_t m_offset; // where to write diff --git a/MAC/APL/PIC/RSP_Driver/src/BstRead.cc b/MAC/APL/PIC/RSP_Driver/src/BstRead.cc index 18ae05daff8ffea532bb1209a889f34e43ec0741..7f59eb6bb18c16f15fc91b993e9680a4541973c0 100644 --- a/MAC/APL/PIC/RSP_Driver/src/BstRead.cc +++ b/MAC/APL/PIC/RSP_Driver/src/BstRead.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/hexdump.h> #include <APL/RSP_Protocol/Statistics.h> #include <APL/RSP_Protocol/EPA_Protocol.ph> @@ -37,10 +38,12 @@ using namespace RSP; using namespace EPA_Protocol; using namespace RSP_Protocol; -BstRead::BstRead(GCFPortInterface& board_port, int board_id) - : SyncAction(board_port, board_id, MEPHeader::N_SERDES_LANES) +BstRead::BstRead(GCFPortInterface& board_port, int board_id, int lane_id) + : SyncAction(board_port, board_id, MEPHeader::N_SERDES_LANES) // MEPHeader::MAX_N_BANKS in new firmware { - memset(&m_hdr, 0, sizeof(MEPHeader)); + itsLaneId = lane_id; + itsRealLaneId = (lane_id < 10)?lane_id:(lane_id-10); + memset(&m_hdr, 0, sizeof(MEPHeader)); } BstRead::~BstRead() @@ -49,23 +52,48 @@ BstRead::~BstRead() void BstRead::sendrequest() { - EPAReadEvent bstread; - - Cache::getInstance().getState().bst().read(getBoardId()); - - bstread.hdr.set(MEPHeader::READ, - MEPHeader::DST_RSP, - MEPHeader::BST, - getCurrentIndex(), - MEPHeader::BST_POWER_SIZE); - - m_hdr = bstread.hdr; - getBoardPort().send(bstread); + if ((itsLaneId >= 10) && !Cache::getInstance().getBack().isSplitterActive()) { + setContinue(true); + return; + } + + if ((( Cache::getInstance().getBack().getVersions().bp()(getBoardId()).fpga_maj * 10) + + Cache::getInstance().getBack().getVersions().bp()(getBoardId()).fpga_min ) < 74) { + // if old firmware version do + if (getCurrentIndex() != itsRealLaneId) { + setContinue(true); + return; + } + } + else { + // if new firmware version do + if (getCurrentIndex() >= (MAX_BITS_PER_SAMPLE / Cache::getInstance().getBack().getBitsPerSample())) { + setContinue(true); + return; + } + } + + EPAReadEvent bstread; + + bstread.hdr.set(MEPHeader::READ, MEPHeader::DST_RSP, MEPHeader::BST, getCurrentIndex(), MEPHeader::BST_POWER_SIZE); + m_hdr = bstread.hdr; + getBoardPort().send(bstread); + +#if 0 +string s; +hexdump(s, (void*)&bstread, sizeof(bstread)); +LOG_INFO_STR("BSTREADREQUEST=" << s); +LOG_INFO(formatString("BSTREAD:board=%d,dstid=%d,pid=%d,regid=%d,offset=%d,payload=%d,seqnr=%d", getBoardId(), bstread.hdr.m_fields.addr.dstid, bstread.hdr.m_fields.addr.pid, bstread.hdr.m_fields.addr.regid, bstread.hdr.m_fields.offset, bstread.hdr.m_fields.payload_length, bstread.hdr.m_fields.seqnr)); + +if (getBoardId() == 11) { + LOG_INFO(formatString("BSTREAD:board=%d,dstid=%d,pid=%d,regid=%d,offset=%d,payload=%d,seqnr=%d", getBoardId(), bstread.hdr.m_fields.addr.dstid, bstread.hdr.m_fields.addr.pid, bstread.hdr.m_fields.addr.regid, bstread.hdr.m_fields.offset, bstread.hdr.m_fields.payload_length, bstread.hdr.m_fields.seqnr)); +} +#endif } void BstRead::sendrequest_status() { - // intentionally left empty + // intentionally left empty } /** @@ -75,65 +103,85 @@ void BstRead::sendrequest_status() BZ_DECLARE_FUNCTION_RET(convert_uint32_to_double, double) inline double convert_uint32_to_double(uint32 val) { - int64 val64; - - uint32 e = val & (1<<31); - uint32 s = val & (1<<30); - int32 m = val & ((1<<30)-1); - - if (s) m = m - (1<<30); - if (e) { - val64 = (int64)m << 23; - } else { - val64 = m; - } - - return (double)(val64); + int64 val64; + // check if extent bit(bit31) is high + if (val & (1 << 31)) { + // if extent = high, multiply mantissa(bit30..0) by 2^23 + val64 = (int64)(val & ~(1 << 31)) << 23; + } + else { + val64 = (int64)val; + } + +/* + uint32 e = val & (1<<31); + uint32 s = val & (1<<30); + int32 m = val & ((1<<30)-1); + + if (s) m = m - (1<<30); + if (e) { + val64 = (int64)m << 23); + } else { + val64 = m; + } +*/ + return (double)(val64); } GCFEvent::TResult BstRead::handleack(GCFEvent& event, GCFPortInterface& /*port*/) { - if (EPA_BST_STATS != event.signal) { - LOG_WARN("BstRead::handleack: unexpected ack"); - return GCFEvent::NOT_HANDLED; - } - - EPABstStatsEvent ack(event); - - if (!ack.hdr.isValidAck(m_hdr)) { - Cache::getInstance().getState().bst().read_error(getBoardId()); - LOG_ERROR("BstRead::handleack: invalid ack"); - return GCFEvent::NOT_HANDLED; - } - - LOG_DEBUG(formatString("BstRead::handleack: boardid=%d", getBoardId())); - - Range fragment_range(0, MEPHeader::N_DATA_SLOTS - 1); - fragment_range = fragment_range + (getCurrentIndex() * MEPHeader::N_DATA_SLOTS); - -// LOG_INFO_STR("fragment_range[" << getBoardId() << "," << getCurrentIndex() << "]=" << fragment_range); + if (EPA_BST_STATS != event.signal) { + LOG_WARN("BstRead::handleack: unexpected ack"); + return GCFEvent::NOT_HANDLED; + } + + EPABstStatsEvent ack(event); + + if (!ack.hdr.isValidAck(m_hdr)) { + Cache::getInstance().getState().bst().read_error(itsRealLaneId); + LOG_ERROR("BstRead::handleack: invalid ack"); + return GCFEvent::NOT_HANDLED; + } + + LOG_DEBUG(formatString("BstRead::handleack: boardid=%d lane=%d", getBoardId(), itsLaneId)); + + int swstart; + // In new firmware versions BST registers are used in a different way + if ((( Cache::getInstance().getBack().getVersions().bp()(getBoardId()).fpga_maj * 10) + + Cache::getInstance().getBack().getVersions().bp()(getBoardId()).fpga_min ) < 74) { + swstart = (itsRealLaneId * MEPHeader::N_BEAMLETS); + } + else { + swstart = (itsRealLaneId * MEPHeader::N_BEAMLETS) + (getCurrentIndex() * MEPHeader::N_DATA_SLOTS); + } + + Range fragment_range(swstart, swstart+MEPHeader::N_DATA_SLOTS-1); + + // normal set 0/1, if splitter active also 2/3 + int beamletsSet = (itsLaneId < 10)?0:2; - if (getCurrentIndex() != ack.hdr.m_fields.addr.regid) { - LOG_ERROR("invalid bst ack"); - return GCFEvent::HANDLED; - } + LOG_DEBUG_STR("fragment_range[" << getBoardId() << "," << getCurrentIndex() << "]=" << fragment_range); - Array<uint32, 2> stats((uint32*)&ack.stat, - shape((MEPHeader::BST_POWER_SIZE / sizeof(uint32)) / N_POL, N_POL), neverDeleteData); + if (getCurrentIndex() != ack.hdr.m_fields.addr.regid) { + LOG_ERROR("invalid bst ack"); + return GCFEvent::HANDLED; + } - Array<double, 2>& cache(Cache::getInstance().getBack().getBeamletStats()()); + Array<uint32, 2> stats((uint32*)&ack.stat, + shape((MEPHeader::BST_POWER_SIZE / sizeof(uint32)) / N_POL, N_POL), neverDeleteData); + LOG_DEBUG(formatString("real_lane=%d, beamletsSet=%d, swstart=%d", itsRealLaneId, beamletsSet, swstart)); + LOG_DEBUG_STR("stats:" << stats); + Array<double, 2>& cache(Cache::getInstance().getBack().getBeamletStats()()); - // x-pol beamlet statistics: copy and convert to double - cache(getBoardId() * 2, fragment_range) = - convert_uint32_to_double(stats(Range::all(), 0)); + // x-pol beamlet statistics: copy and convert to double + cache(beamletsSet, fragment_range) = + convert_uint32_to_double(stats(Range::all(), 0)); - // y-pol beamlet statistics: copy and convert to double - cache(getBoardId() * 2 + 1, fragment_range) = - convert_uint32_to_double(stats(Range::all(), 1)); + // y-pol beamlet statistics: copy and convert to double + cache(beamletsSet + 1, fragment_range) = + convert_uint32_to_double(stats(Range::all(), 1)); - if (getCurrentIndex() == MEPHeader::N_SERDES_LANES - 1) { - Cache::getInstance().getState().bst().read_ack(getBoardId()); - } + Cache::getInstance().getState().bst().read_ack(itsRealLaneId); - return GCFEvent::HANDLED; + return GCFEvent::HANDLED; } diff --git a/MAC/APL/PIC/RSP_Driver/src/BstRead.h b/MAC/APL/PIC/RSP_Driver/src/BstRead.h index 5f3f220c201d7d7102809bdc7ee8305c08794059..efbeb5d320e2754a86e84b343238c4fee4f7d442 100644 --- a/MAC/APL/PIC/RSP_Driver/src/BstRead.h +++ b/MAC/APL/PIC/RSP_Driver/src/BstRead.h @@ -38,7 +38,7 @@ namespace LOFAR { /** * Constructors for a BstRead object. */ - BstRead(GCFPortInterface& board_port, int board_id); + BstRead(GCFPortInterface& board_port, int board_id, int lane_id); /* Destructor for BstRead. */ virtual ~BstRead(); @@ -59,6 +59,9 @@ namespace LOFAR { virtual GCFEvent::TResult handleack(GCFEvent& event, GCFPortInterface& port); private: + int itsLaneId; + int itsRealLaneId; + EPA_Protocol::MEPHeader m_hdr; }; }; diff --git a/MAC/APL/PIC/RSP_Driver/src/CDOWrite.cc b/MAC/APL/PIC/RSP_Driver/src/CDOWrite.cc index e5f59990f3c9352451571f9f31dbc2972497c9a8..3eb7db5bed85c71a792a0b719b7aa5ac257525b1 100644 --- a/MAC/APL/PIC/RSP_Driver/src/CDOWrite.cc +++ b/MAC/APL/PIC/RSP_Driver/src/CDOWrite.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RSP_Protocol/EPA_Protocol.ph> @@ -79,7 +80,7 @@ void CDOWrite::setup_udpip_header(uint32 l_srcip, uint32 l_dstip) { uint32 payload_size = EPA_CEP_OUTPUT_HEADER_SIZE + (GET_CONFIG("RSPDriver.CDO_N_BLOCKS", i) - * (MEPHeader::N_PHASEPOL * GET_CONFIG("RSPDriver.CDO_N_BEAMLETS", i)) + * (MEPHeader::N_PHASEPOL * maxDataslotsPerRSP(Cache::getInstance().getBack().getBitsPerSample())) * EPA_CEP_BEAMLET_SIZE); // @@ -192,7 +193,9 @@ void CDOWrite::sendrequest() cdo.ffi = 0xDDCC; cdo.nof_blocks = GET_CONFIG("RSPDriver.CDO_N_BLOCKS", i); - cdo.nof_beamlets = GET_CONFIG("RSPDriver.CDO_N_BEAMLETS", i); + + //GET_CONFIG("RSPDriver.CDO_N_BEAMLETS", i); + cdo.nof_beamlets = maxDataslotsPerRSP(Cache::getInstance().getBack().getBitsPerSample()); if (output_lane >= 0) { diff --git a/MAC/APL/PIC/RSP_Driver/src/CMakeLists.txt b/MAC/APL/PIC/RSP_Driver/src/CMakeLists.txt index e6040942970e31b40a76e5db01321d4bfa0b19b0..a1a34da995fe4b54e6f45018f94b2a5ac25703fc 100644 --- a/MAC/APL/PIC/RSP_Driver/src/CMakeLists.txt +++ b/MAC/APL/PIC/RSP_Driver/src/CMakeLists.txt @@ -70,6 +70,9 @@ lofar_add_bin_program(RSPDriver GetDatastreamCmd.cc SetSwapxyCmd.cc GetSwapxyCmd.cc + SetBitModeCmd.cc + GetBitModeCmd.cc + UpdBitModeCmd.cc SyncAction.cc WriteReg.cc ReadReg.cc @@ -111,12 +114,7 @@ lofar_add_bin_program(RSPDriver SerdesRead.cc UpdSplitterCmd.cc LatencyRead.cc - CRSyncWrite.cc) + CRSyncWrite.cc + BMWrite.cc + BMRead.cc) -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/rspctl.conf.in - ${CMAKE_CURRENT_BINARY_DIR}/rspctl.conf) - -install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/rspctl.conf - DESTINATION etc) diff --git a/MAC/APL/PIC/RSP_Driver/src/Cache.cc b/MAC/APL/PIC/RSP_Driver/src/Cache.cc index a695219cd1ebbc71e1b632e7773b24e0d9253252..52e72fef4d92846a02916a345147f71027e5567f 100644 --- a/MAC/APL/PIC/RSP_Driver/src/Cache.cc +++ b/MAC/APL/PIC/RSP_Driver/src/Cache.cc @@ -24,6 +24,7 @@ #include <Common/LofarLogger.h> #include <Common/LofarConstants.h> #include <Common/lofar_bitset.h> +#include <Common/LofarBitModeInfo.h> #include "StationSettings.h" #include "Cache.h" @@ -60,31 +61,36 @@ CacheBuffer::CacheBuffer(Cache* cache) : m_cache(cache) m_clock = GET_CONFIG("RSPDriver.DEFAULT_SAMPLING_FREQUENCY", i); // print sizes of the cache - LOG_DEBUG_STR("m_beamletweights().size() =" << m_beamletweights().size() * sizeof(complex<int16>)); - LOG_DEBUG_STR("m_subbandselection().size() =" << m_subbandselection().size() * sizeof(uint16)); - LOG_DEBUG_STR("m_rcusettings().size() =" << m_rcusettings().size() * sizeof(uint8)); - LOG_DEBUG_STR("m_hbasettings().size() =" << m_hbasettings().size() * sizeof(uint8)); - LOG_DEBUG_STR("m_hbareadings().size() =" << m_hbareadings().size() * sizeof(uint8)); - LOG_DEBUG_STR("m_rsusettings().size() =" << m_rsusettings().size() * sizeof(uint8)); - LOG_DEBUG_STR("m_wgsettings().size() =" << m_wgsettings().size() * sizeof(WGSettings::WGRegisterType)); - LOG_DEBUG_STR("m_subbandstats().size() =" << m_subbandstats().size() * sizeof(uint16)); - LOG_DEBUG_STR("m_beamletstats().size() =" << m_beamletstats().size() * sizeof(double)); - LOG_DEBUG_STR("m_xcstats().size() =" << m_xcstats().size() * sizeof(complex<double>)); - LOG_DEBUG_STR("m_systemstatus.board().size() =" << m_systemstatus.board().size() * sizeof(EPA_Protocol::BoardStatus)); - LOG_DEBUG_STR("m_versions.bp().size() =" << m_versions.bp().size() * sizeof(EPA_Protocol::RSRVersion)); - LOG_DEBUG_STR("m_versions.ap().size() =" << m_versions.ap().size() * sizeof(EPA_Protocol::RSRVersion)); - LOG_DEBUG_STR("m_tdstatus.board().size() =" << m_tdstatus.board().size() * sizeof(EPA_Protocol::TDBoardStatus)); - LOG_DEBUG_STR("m_spustatus.subrack().size() =" << m_spustatus.subrack().size() * sizeof(EPA_Protocol::SPUBoardStatus)); - LOG_DEBUG_STR("m_tbbsettings().size() =" << m_tbbsettings().size() * sizeof(bitset<MEPHeader::N_SUBBANDS>)); - LOG_DEBUG_STR("m_bypasssettings().size() =" << m_bypasssettings().size() * sizeof(EPA_Protocol::DIAGBypass)); - LOG_DEBUG_STR("m_rawDataBlock.size() =" << ETH_DATA_LEN + sizeof (uint16)); - LOG_DEBUG_STR("m_SdsWriteBuffer.size() =" << sizeof(itsSdsWriteBuffer)); - LOG_DEBUG_STR("m_SdsReadBuffer.size() =" << sizeof(itsSdsReadBuffer)); - LOG_DEBUG_STR("m_latencys.size() =" << itsLatencys().size() * sizeof(EPA_Protocol::RADLatency)); + LOG_DEBUG_STR("m_beamletweights().size() =" << m_beamletweights().size() * sizeof(complex<int16>)); + LOG_DEBUG_STR("m_subbandselection.crosslets().size()=" << m_subbandselection.crosslets().size() * sizeof(uint16)); + LOG_DEBUG_STR("m_subbandselection.beamlets().size() =" << m_subbandselection.beamlets().size() * sizeof(uint16)); + LOG_DEBUG_STR("m_rcusettings().size() =" << m_rcusettings().size() * sizeof(uint8)); + LOG_DEBUG_STR("m_hbasettings().size() =" << m_hbasettings().size() * sizeof(uint8)); + LOG_DEBUG_STR("m_hbareadings().size() =" << m_hbareadings().size() * sizeof(uint8)); + LOG_DEBUG_STR("m_rsusettings().size() =" << m_rsusettings().size() * sizeof(uint8)); + LOG_DEBUG_STR("m_wgsettings().size() =" << m_wgsettings().size() * sizeof(WGSettings::WGRegisterType)); + LOG_DEBUG_STR("m_subbandstats().size() =" << m_subbandstats().size() * sizeof(uint16)); + LOG_DEBUG_STR("m_beamletstats().size() =" << m_beamletstats().size() * sizeof(double)); + LOG_DEBUG_STR("m_xcstats().size() =" << m_xcstats().size() * sizeof(complex<double>)); + LOG_DEBUG_STR("m_systemstatus.board().size() =" << m_systemstatus.board().size() * sizeof(EPA_Protocol::BoardStatus)); + LOG_DEBUG_STR("m_versions.bp().size() =" << m_versions.bp().size() * sizeof(EPA_Protocol::RSRVersion)); + LOG_DEBUG_STR("m_versions.ap().size() =" << m_versions.ap().size() * sizeof(EPA_Protocol::RSRVersion)); + LOG_DEBUG_STR("m_tdstatus.board().size() =" << m_tdstatus.board().size() * sizeof(EPA_Protocol::TDBoardStatus)); + LOG_DEBUG_STR("m_spustatus.subrack().size() =" << m_spustatus.subrack().size() * sizeof(EPA_Protocol::SPUBoardStatus)); + LOG_DEBUG_STR("m_tbbsettings().size() =" << m_tbbsettings().size() * sizeof(bitset<MEPHeader::N_SUBBANDS>)); + LOG_DEBUG_STR("m_bypasssettings().size() =" << m_bypasssettings().size() * sizeof(EPA_Protocol::DIAGBypass)); + LOG_DEBUG_STR("m_rawDataBlock.size() =" << ETH_DATA_LEN + sizeof (uint16)); + LOG_DEBUG_STR("m_SdsWriteBuffer.size() =" << sizeof(itsSdsWriteBuffer)); + LOG_DEBUG_STR("m_SdsReadBuffer.size() =" << sizeof(itsSdsReadBuffer)); + LOG_DEBUG_STR("m_latencys.size() =" << itsLatencys().size() * sizeof(EPA_Protocol::RADLatency)); + LOG_DEBUG_STR("itsSwappedXY.size() =" << itsSwappedXY.size()); + LOG_DEBUG_STR("itsBitsModeInfo.size() =" << itsBitModeInfo().size() * sizeof(EPA_Protocol::RSRBeamMode)); + LOG_DEBUG_STR("itsBitsPerSample.size() =" << sizeof(itsBitsPerSample)); LOG_INFO_STR(formatString("CacheBuffer size = %d bytes", m_beamletweights().size() - + m_subbandselection().size() + + m_subbandselection.crosslets().size() + + m_subbandselection.beamlets().size() + m_rcusettings().size() + m_hbasettings().size() + m_hbareadings().size() @@ -109,7 +115,8 @@ CacheBuffer::CacheBuffer(Cache* cache) : m_cache(cache) CacheBuffer::~CacheBuffer() { m_beamletweights().free(); - m_subbandselection().free(); + m_subbandselection.crosslets().free(); + m_subbandselection.beamlets().free(); m_rcusettings().free(); m_hbasettings().free(); m_hbareadings().free(); @@ -127,6 +134,7 @@ CacheBuffer::~CacheBuffer() m_tbbsettings().free(); m_bypasssettings().free(); itsLatencys().free(); + itsBitModeInfo().free(); } void CacheBuffer::reset(void) @@ -138,32 +146,55 @@ void CacheBuffer::reset(void) tv.tv_sec = 0; tv.tv_usec = 0; m_timestamp.set(tv); - m_beamletweights().resize(BeamletWeights::SINGLE_TIMESTEP, StationSettings::instance()->nrRcus(), MEPHeader::N_BEAMLETS); - m_beamletweights() = complex<int16>(0,0); - - m_subbandselection().resize(StationSettings::instance()->nrRcus(), MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS); - m_subbandselection() = 0; - + itsBitsPerSample = MAX_BITS_PER_SAMPLE; + + m_beamletweights().resize( BeamletWeights::SINGLE_TIMESTEP, + StationSettings::instance()->nrRcus(), + MAX_NR_BM_BANKS, + MEPHeader::N_BEAMLETS); + m_beamletweights() = complex<int16>(25,36); +// TODO remove this code!!! + for (int rcu = 0 ; rcu < StationSettings::instance()->nrRcus(); rcu++) { + int16 value=0; + for (int bank = 0; bank < (MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE); bank++) { + for (int beamlet = 0; beamlet < MEPHeader::N_BEAMLETS; beamlet++) { + m_beamletweights()(0,rcu,bank,beamlet)=complex<int16>(value++,bank+10); + } + } + } +//TODO + + m_subbandselection.crosslets().resize(StationSettings::instance()->nrRcus(), + (MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE), + MEPHeader::N_LOCAL_XLETS ); + m_subbandselection.crosslets() = 0; + m_subbandselection.beamlets().resize(StationSettings::instance()->nrRcus(), + (MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE), + MEPHeader::N_BEAMLETS ); + m_subbandselection.beamlets() = 0; + if (GET_CONFIG("RSPDriver.IDENTITY_WEIGHTS", i)) { // these weights ensure that the beamlet statistics // exactly match the subband statistics - m_beamletweights()(Range::all(), Range::all(), Range::all()) = complex<int16>(GET_CONFIG("RSPDriver.BF_GAIN", i), 0); + m_beamletweights() = complex<int16>(GET_CONFIG("RSPDriver.BF_GAIN", i), 0); // // Set default subband selection starting at RSPDriver.FIRST_SUBBAND // int firstSubband = GET_CONFIG("RSPDriver.FIRST_SUBBAND", i); - for (int rcu = 0; rcu < m_subbandselection().extent(firstDim); rcu++) { - for (int rsp = 0; rsp < 4; rsp++) { - int start(rsp*(MEPHeader::N_BEAMLETS/4)); - int stop (start+MAX_BEAMLETS_PER_RSP); - if (rcu==0) LOG_DEBUG_STR("start=" << start << ", stop=" << stop); - for (int sb = start; sb < stop; sb++) { - m_subbandselection()(rcu, sb + MEPHeader::N_LOCAL_XLETS) = (rcu%N_POL) + (sb*N_POL) + (firstSubband*2); - } // for sb - } // for rsp + for (int rcu = 0; rcu < m_subbandselection.beamlets().extent(firstDim); rcu++) { + for (int bank = 0; bank < (MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE); bank++) { + for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { + int start(lane*(MEPHeader::N_BEAMLETS/MEPHeader::N_SERDES_LANES)); + int stop (start + maxBeamletsPerRSP(itsBitsPerSample)); + if (rcu==0) LOG_DEBUG_STR("start=" << start << ", stop=" << stop); + for (int sb = start; sb < stop; sb++) { + m_subbandselection.beamlets()(rcu, bank, sb) = (rcu%N_POL) + (sb*N_POL) + (firstSubband*2); + } // for sb + } // for lane + } // for bank } // for rcu - LOG_DEBUG_STR("m_subbandsel(0): " << m_subbandselection()(0, Range::all())); + LOG_DEBUG_STR("m_subbandsel(0): " << m_subbandselection.beamlets()(0, Range::all(), Range::all())); } // if identity_weights // initialize RCU settings @@ -200,8 +231,11 @@ void CacheBuffer::reset(void) m_subbandstats().resize(StationSettings::instance()->nrRcus(), MEPHeader::N_SUBBANDS); m_subbandstats() = 0; - - m_beamletstats().resize(StationSettings::instance()->nrRspBoards() * N_POL, MEPHeader::N_BEAMLETS); + + // Number of cep streams -> in normal mode 4, in splitmode 8. + int maxStreams = 8; + m_beamletstats().resize((maxStreams/MEPHeader::N_SERDES_LANES) * N_POL, + (MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE) * MEPHeader::N_BEAMLETS); m_beamletstats() = 0; m_xcstats().resize(N_POL, N_POL, StationSettings::instance()->nrBlps(), StationSettings::instance()->nrBlps()); @@ -274,6 +308,14 @@ void CacheBuffer::reset(void) memset(&radlatencyinit, 0, sizeof(RADLatency)); itsLatencys() = radlatencyinit; itsSwappedXY.reset(); + + // BitMode + itsBitModeInfo().resize(StationSettings::instance()->nrRspBoards()); + RSRBeamMode bitmodeinfo; + bitmodeinfo.bm_select = 0; + bitmodeinfo.bm_max = 0; + itsBitModeInfo() = bitmodeinfo; + } diff --git a/MAC/APL/PIC/RSP_Driver/src/Cache.h b/MAC/APL/PIC/RSP_Driver/src/Cache.h index db3d826d0fc26c1abb23bd1bc4b2f62bd00fbc20..836c32930fa6c1a16045fb8fe7dab84c0fc517d7 100644 --- a/MAC/APL/PIC/RSP_Driver/src/Cache.h +++ b/MAC/APL/PIC/RSP_Driver/src/Cache.h @@ -28,6 +28,7 @@ #include <Common/LofarTypes.h> #include <Common/LofarConstants.h> #include <Common/lofar_bitset.h> + #include <blitz/array.h> #include <APL/RSP_Protocol/AllRegisterState.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> @@ -89,6 +90,7 @@ public: SerdesBuffer& getSdsWriteBuffer() { return (itsSdsWriteBuffer); } SerdesBuffer& getSdsReadBuffer(int rspBoardNr); Latency& getLatencys() { return (itsLatencys); } + BitmodeInfo& getBitModeInfo() { return (itsBitModeInfo); } bool isSplitterActive() { return(itsSplitterActive); } void setSplitterActive(bool active) { itsSplitterActive = active; } @@ -99,11 +101,15 @@ public: bool isSwappedXY(int antenna){ return (itsSwappedXY.test(antenna)); } void setSwappedXY(bitset<MAX_ANTENNAS> antennamask) { itsSwappedXY = antennamask; } bitset<MAX_ANTENNAS> getSwappedXY() { return(itsSwappedXY); } - + I2Cuser getI2Cuser() { return (itsI2Cuser); } void setI2Cuser(I2Cuser user) { itsI2Cuser = user; } + + int getBitsPerSample() { return itsBitsPerSample; } + void setBitsPerSample(int bits) { itsBitsPerSample = bits; } /*@}*/ - + + // update timestamp void setTimestamp(const RTC::Timestamp& timestamp); @@ -152,7 +158,9 @@ private: bool itsCepEnabled1; RSP_Protocol::Latency itsLatencys; bitset<MAX_ANTENNAS> itsSwappedXY; - + RSP_Protocol::BitmodeInfo itsBitModeInfo; + int itsBitsPerSample; + Cache* m_cache; // pointer to container }; diff --git a/MAC/APL/PIC/RSP_Driver/src/Command.h b/MAC/APL/PIC/RSP_Driver/src/Command.h index d6664cbb89d39ee050c215a6f2830538c4af4825..d0b8708a03dab7f622e258bd6b3888040ce616e3 100644 --- a/MAC/APL/PIC/RSP_Driver/src/Command.h +++ b/MAC/APL/PIC/RSP_Driver/src/Command.h @@ -49,10 +49,10 @@ public: // Currently the tv_usec part is always set to 0 irrespective // of the value passed in. Command() : - m_period(0), m_port(0), m_operation(READ), itsIsDelayed(false), itsIsPostponed(false), itsName("???") { } + m_period(0), m_port(0), m_operation(READ), itsIsDelayed(false), itsIsPostponed(false), itsName("???"), itsOrder(0) { } Command(const string& name, GCFPortInterface& port, Operation oper) : - m_period(0), m_port(&port), m_operation(oper), itsIsDelayed(false), itsIsPostponed(false), itsName(name) { } + m_period(0), m_port(&port), m_operation(oper), itsIsDelayed(false), itsIsPostponed(false), itsName(name), itsOrder(0) { } // Destructor for Command. virtual ~Command() { } @@ -124,6 +124,12 @@ public: const string& name() const { return (itsName); } /*@}*/ + /*@{*/ + // Accessor methods order + int order() const { return (itsOrder); } + void order(int anOrder) { itsOrder = anOrder; } + /*@}*/ + private: uint16 m_period; GCFEvent* m_event; @@ -132,6 +138,7 @@ private: bool itsIsDelayed; bool itsIsPostponed; string itsName; + int itsOrder; }; // Comparison function to order a priority_queue of Ptr<Command>* pointers @@ -141,6 +148,13 @@ struct Command_greater { { return x->getTimestamp() > y->getTimestamp(); } }; +// Comparison function to order a priority_queue of Ptr<Command>* pointers +// as it is used in the Scheduler class. +struct Command_order { + bool operator() (Ptr<Command>& x, Ptr<Command>& y) const + { return x->order() > y->order(); } +}; + }; // namespace RSP }; // namespace LOFAR diff --git a/MAC/APL/PIC/RSP_Driver/src/GetBitModeCmd.cc b/MAC/APL/PIC/RSP_Driver/src/GetBitModeCmd.cc new file mode 100644 index 0000000000000000000000000000000000000000..c44108c38e48bea795600e4acba3c81dcbc789f0 --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/GetBitModeCmd.cc @@ -0,0 +1,102 @@ +//# GetBitModeCmd.cc: implementation of the GetBitModeCmd class +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: GetBitModeCmd.cc 13440 2009-06-22 13:26:54Z donker $ + +#include <lofar_config.h> +#include <Common/LofarLogger.h> + +#include <APL/RSP_Protocol/RSP_Protocol.ph> + +#include <APL/RTCCommon/PSAccess.h> +#include <blitz/array.h> + +#include "StationSettings.h" +#include "GetBitModeCmd.h" + +using namespace blitz; +using namespace LOFAR; +using namespace RSP; +using namespace RSP_Protocol; +using namespace RTC; + +GetBitModeCmd::GetBitModeCmd(GCFEvent& event, GCFPortInterface& port, Operation oper) : + Command("GetBitMode", port, oper) +{ + itsEvent = new RSPGetbitmodeEvent(event); +} + +GetBitModeCmd::~GetBitModeCmd() +{ + delete itsEvent; +} + +void GetBitModeCmd::ack(CacheBuffer& cache) +{ + RSPGetbitmodeackEvent ack; + + ack.timestamp = getTimestamp(); + ack.status = RSP_SUCCESS; + for (int i = 0; i < StationSettings::instance()->nrRspBoards(); ++i) { + ack.bitmode_version[i] = cache.getBitModeInfo()()(i).bm_max; + + uint8 select = cache.getBitModeInfo()()(i).bm_select; + if (select == 0) { + ack.bits_per_sample[i] = 16; + } + else if (select == 1) { + ack.bits_per_sample[i] = 8; + } + else if (select == 2) { + ack.bits_per_sample[i] = 4; + } + } + getPort()->send(ack); +} + +void GetBitModeCmd::apply(CacheBuffer& /*cache*/, bool /*setModFlag*/) +{ + /* intentionally left empty */ +} + +void GetBitModeCmd::complete(CacheBuffer& cache) +{ + ack(cache); +} + +const RTC::Timestamp& GetBitModeCmd::getTimestamp() const +{ + return itsEvent->timestamp; +} + +void GetBitModeCmd::setTimestamp(const RTC::Timestamp& timestamp) +{ + itsEvent->timestamp = timestamp; +} + +bool GetBitModeCmd::validate() const +{ + return (true); +} + +bool GetBitModeCmd::readFromCache() const +{ + return itsEvent->cache; +} diff --git a/MAC/APL/PIC/RSP_Driver/src/GetBitModeCmd.h b/MAC/APL/PIC/RSP_Driver/src/GetBitModeCmd.h new file mode 100644 index 0000000000000000000000000000000000000000..3f9c21e59095192eccc72e69e36ebaf35580be5e --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/GetBitModeCmd.h @@ -0,0 +1,92 @@ +//# -*- mode: c++ -*- +//# +//# GetBitModeCmd.h: Beamformer Weights settings command. +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: GetBitModeCmd.h 13440 2009-06-22 13:26:54Z overeem $ + +#ifndef GETBITMODECMD_H_ +#define GETBITMODECMD_H_ + +#include "Command.h" +#include <APL/RSP_Protocol/RSP_Protocol.ph> + +#include <Common/LofarTypes.h> +#include <GCF/TM/GCF_Control.h> + +namespace LOFAR { + namespace RSP { + + class GetBitModeCmd : public Command + { + public: + /** + * Constructors for a GetBitModeCmd object. + */ + GetBitModeCmd(GCFEvent& event, GCFPortInterface& port, Operation oper); + + /* Destructor for GetBitModeCmd. */ + virtual ~GetBitModeCmd(); + + /** + * Acknowledge the command by sending the appropriate + * response on m_port. + */ + virtual void ack(CacheBuffer& cache); + + /** + * Make necessary changes to the cache for the next synchronization. + * Any changes will be sent to the RSP boards. + */ + virtual void apply(CacheBuffer& cache, bool setModFlag = true); + + /** + * Complete the command by sending the appropriate response on + * the m_answerport; + */ + virtual void complete(CacheBuffer& cache); + + /*@{*/ + /** + * get timestamp of the event + */ + virtual const RTC::Timestamp& getTimestamp() const; + virtual void setTimestamp(const RTC::Timestamp& timestamp); + /*@}*/ + + /** + * Validate the event that underlies the command. + */ + virtual bool validate() const; + + /** + * Return true if value should be read from cache. + */ + virtual bool readFromCache() const; + + private: + GetBitModeCmd(); + + RSPGetbitmodeEvent* itsEvent; + }; + }; +}; + +#endif /* GETBITMODECMD_H_ */ diff --git a/MAC/APL/PIC/RSP_Driver/src/GetStatsCmd.cc b/MAC/APL/PIC/RSP_Driver/src/GetStatsCmd.cc index 50655724626d59823aa80647aa33a49f393cb343..09258d77b96f4bea734440a4deee6d8ff1c68a24 100644 --- a/MAC/APL/PIC/RSP_Driver/src/GetStatsCmd.cc +++ b/MAC/APL/PIC/RSP_Driver/src/GetStatsCmd.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RTCCommon/PSAccess.h> @@ -61,9 +62,11 @@ void GetStatsCmd::ack(CacheBuffer& cache) ack.stats().resize(m_event->rcumask.count(), cache.getSubbandStats()().extent(secondDim)); } else { - ack.stats().resize(m_event->rcumask.count(), MAX_BEAMLETS); + ack.stats().resize(m_event->rcumask.count(), maxBeamlets(cache.getBitsPerSample())); } + int activePlanes = (MAX_BITS_PER_SAMPLE / cache.getBitsPerSample()); + unsigned int result_device = 0; for (unsigned int cache_device = 0; cache_device < m_n_devices; cache_device++) { if (m_event->rcumask[cache_device]) { @@ -75,20 +78,24 @@ void GetStatsCmd::ack(CacheBuffer& cache) case Statistics::BEAMLET_POWER: // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different // In other words: getBeamletWeights can contain more data than ack.weights - if (MEPHeader::N_BEAMLETS == MAX_BEAMLETS) { + if (MEPHeader::N_BEAMLETS == maxBeamlets(cache.getBitsPerSample())) { ack.stats()(result_device, Range::all()) = cache.getBeamletStats()()(cache_device, Range::all()); } else { - for (int rsp = 0; rsp < 4; rsp++) { - int swstart(rsp*MAX_BEAMLETS_PER_RSP); - int hwstart(rsp*MEPHeader::N_BEAMLETS/4); - ack.stats()(result_device, Range(swstart,swstart+MAX_BEAMLETS_PER_RSP-1)) = - cache.getBeamletStats()()(cache_device, Range(hwstart, hwstart+MAX_BEAMLETS_PER_RSP-1)); - if (cache_device == 0) { - LOG_DEBUG_STR("Getstats:move(" << hwstart << ".." << hwstart+MAX_BEAMLETS_PER_RSP << ") to (" - << swstart << ".." << swstart+MAX_BEAMLETS_PER_RSP << ")"); - } - } + for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { + for (int plane = 0; plane < activePlanes; plane++) { + int swstart(lane*maxBeamletsPerRSP(cache.getBitsPerSample()) + plane*maxDataslotsPerRSP(cache.getBitsPerSample())); + int hwstart(lane*MEPHeader::N_BEAMLETS + plane*MEPHeader::N_BEAMLETS/4); + + ack.stats()(result_device, Range(swstart,swstart+maxDataslotsPerRSP(cache.getBitsPerSample())-1)) = + cache.getBeamletStats()()(cache_device, Range(hwstart, hwstart+maxDataslotsPerRSP(cache.getBitsPerSample())-1)); + + if (cache_device == 0) { + LOG_DEBUG_STR("Getstats:move(" << hwstart << ".." << hwstart+maxDataslotsPerRSP(cache.getBitsPerSample()-1) << ") to (" + << swstart << ".." << swstart+maxDataslotsPerRSP(cache.getBitsPerSample()-1) << ")"); + } + } + } } LOG_DEBUG_STR("GetStats(cache[0]): " << cache.getBeamletStats()()(0,Range::all())); diff --git a/MAC/APL/PIC/RSP_Driver/src/GetSubbandsCmd.cc b/MAC/APL/PIC/RSP_Driver/src/GetSubbandsCmd.cc index faf275eb32937eff2c131edee08f7df9e82df5a0..7d9a87db63853cb3b0df6e7740090d078f336c00 100644 --- a/MAC/APL/PIC/RSP_Driver/src/GetSubbandsCmd.cc +++ b/MAC/APL/PIC/RSP_Driver/src/GetSubbandsCmd.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RTCCommon/PSAccess.h> @@ -55,15 +56,68 @@ void GetSubbandsCmd::ack(CacheBuffer& cache) ack.status = RSP_SUCCESS; Range src_range; + Range dst_range; + int input_rcu; + int nBanks = (MAX_BITS_PER_SAMPLE / cache.getBitsPerSample()); + switch (m_event->type) { case SubbandSelection::BEAMLET: - ack.subbands().resize(m_event->rcumask.count(), MAX_BEAMLETS); - src_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + MAX_BEAMLETS - 1); + ack.subbands.beamlets().resize(m_event->rcumask.count(), nBanks, maxBeamletsPerPlane(cache.getBitsPerSample())); + + input_rcu = 0; + for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { + if (m_event->rcumask[cache_rcu]) { + // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different + // In other words: getSubbandSelection can contain more data than ack.weights + int nrSubbands = ack.subbands.beamlets().extent(thirdDim); + int nrBlocks = MEPHeader::N_SERDES_LANES * nBanks; + + for (int block = 0; block < nrBlocks; block++) { + int swbank = block / MEPHeader::N_SERDES_LANES; + int swlane = block % MEPHeader::N_SERDES_LANES; + int hwbank = block % nBanks; + int hwlane = block / nBanks; + int swstart(swlane * maxDataslotsPerRSP(cache.getBitsPerSample())); + int hwstart(hwlane * (MEPHeader::N_BEAMLETS/MEPHeader::N_SERDES_LANES)); + int nrSubbands2move(MIN(nrSubbands-swstart, maxDataslotsPerRSP(cache.getBitsPerSample()))); + if (nrSubbands2move > 0) { + src_range = Range(hwstart, hwstart+nrSubbands2move-1); + dst_range = Range(swstart, swstart+nrSubbands2move-1); + //cache.getSubbandSelection().beamlets()(cache_rcu, hwbank, dst_range) = 0; + + ack.subbands.beamlets()(input_rcu, swbank, dst_range) = + cache.getSubbandSelection().beamlets()(cache_rcu, hwbank, src_range); //* (int)N_POL + (cache_rcu % N_POL) + + if (cache_rcu == 0) { + LOG_DEBUG_STR("SS:block=" << block << " move(" << hwstart << ".." << hwstart+nrSubbands2move << ") to (" + << swstart << ".." << swstart+nrSubbands2move << ")" + << " swbank:" << swbank << " swlane:" << swlane + << " hwbank:" << hwbank << " hwlane:" << hwlane); + } + } // subbands left + } // for each block + + LOG_DEBUG_STR("GetSubbands:beamlet(cache[0]): " << cache.getSubbandSelection().beamlets()(0, Range::all(), Range::all())); + input_rcu++; + } // if rcu selected + } // for each rcu break; case SubbandSelection::XLET: - ack.subbands().resize(m_event->rcumask.count(), MEPHeader::N_LOCAL_XLETS); - src_range = Range(0, MEPHeader::N_LOCAL_XLETS - 1); + ack.subbands.crosslets().resize(m_event->rcumask.count(), nBanks, MEPHeader::N_LOCAL_XLETS); + + input_rcu = 0; + for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { + if (m_event->rcumask[cache_rcu]) { + if (m_event->type == SubbandSelection::XLET) { + for (int bank = 0; bank < nBanks; bank++) { + ack.subbands.crosslets()(input_rcu, bank, Range::all()) = cache.getSubbandSelection().crosslets()(cache_rcu, bank, Range::all()); + } + } + LOG_DEBUG_STR("GetSubbands:crosslets(cache[0]): " << cache.getSubbandSelection().crosslets()(0, Range::all(), Range::all())); + input_rcu++; + } // if rcu selected + } // for each rcu break; default: @@ -71,32 +125,6 @@ void GetSubbandsCmd::ack(CacheBuffer& cache) exit(EXIT_FAILURE); break; } - - int result_rcu = 0; - for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { - if (m_event->rcumask[cache_rcu]) { - // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different - // In other words: getSubbandSelection can contain more data than ack.weights - if (MEPHeader::N_BEAMLETS == MAX_BEAMLETS || m_event->type == SubbandSelection::XLET) { - ack.subbands()(result_rcu, Range::all()) = cache.getSubbandSelection()()(cache_rcu, src_range); - } - else { - for (int rsp = 0; rsp < 4; rsp++) { - int swstart(rsp*MAX_BEAMLETS_PER_RSP); - int hwstart(MEPHeader::N_LOCAL_XLETS + rsp * (MEPHeader::N_BEAMLETS/4)); - ack.subbands()(result_rcu, Range(swstart,swstart+MAX_BEAMLETS_PER_RSP-1)) = - cache.getSubbandSelection()()(cache_rcu, Range(hwstart, hwstart+MAX_BEAMLETS_PER_RSP-1)); - if (cache_rcu == 0) { - LOG_DEBUG_STR("GetSubbands:move(" << hwstart << ".." << hwstart+MAX_BEAMLETS_PER_RSP << ") to (" - << swstart << ".." << swstart+MAX_BEAMLETS_PER_RSP << ")"); - } - } - } - LOG_DEBUG_STR("GetSubbands(cache[0]): " << cache.getSubbandSelection()()(0,Range::all())); - result_rcu++; - } // if rcu selected - } // for each rcu - getPort()->send(ack); } diff --git a/MAC/APL/PIC/RSP_Driver/src/GetWeightsCmd.cc b/MAC/APL/PIC/RSP_Driver/src/GetWeightsCmd.cc index efa415a078d20620a640ae09a7e7e4d2e3ef37a3..aad83b39e09c466f71fb329671fb6fd8fcd0b1e4 100644 --- a/MAC/APL/PIC/RSP_Driver/src/GetWeightsCmd.cc +++ b/MAC/APL/PIC/RSP_Driver/src/GetWeightsCmd.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RTCCommon/PSAccess.h> @@ -50,33 +51,51 @@ GetWeightsCmd::~GetWeightsCmd() void GetWeightsCmd::ack(CacheBuffer& cache) { RSPGetweightsackEvent ack; - + int nPlanes = (MAX_BITS_PER_SAMPLE / cache.getBitsPerSample()); + ack.timestamp = getTimestamp(); ack.status = RSP_SUCCESS; - ack.weights().resize(BeamletWeights::SINGLE_TIMESTEP, m_event->rcumask.count(), MAX_BEAMLETS); // 4 x 61 + ack.weights().resize(BeamletWeights::SINGLE_TIMESTEP, m_event->rcumask.count(), nPlanes, maxBeamletsPerPlane(cache.getBitsPerSample())); // 4 x 61 + + Range dst_range; + Range src_range; + int nBanks = (MAX_BITS_PER_SAMPLE / cache.getBitsPerSample()); - int result_rcu = 0; + int input_rcu = 0; + for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { if (m_event->rcumask[cache_rcu]) { // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different // In other words: getBeamletWeights can contain more data than ack.weights - if (MEPHeader::N_BEAMLETS == MAX_BEAMLETS) { - ack.weights()(0, result_rcu, Range::all()) = cache.getBeamletWeights()()(0, cache_rcu, Range::all()); - } - else { - for (int rsp = 0; rsp < 4; rsp++) { - int swstart(rsp*MAX_BEAMLETS_PER_RSP); - int hwstart(rsp*MEPHeader::N_BEAMLETS/4); - ack.weights()(0, result_rcu, Range(swstart,swstart+MAX_BEAMLETS_PER_RSP-1)) = cache.getBeamletWeights()()(0, cache_rcu, Range(hwstart, hwstart+MAX_BEAMLETS_PER_RSP-1)); - } - } - result_rcu++; + int nrBlocks = MEPHeader::N_SERDES_LANES * nBanks; + int dataslotsPerRSP = maxDataslotsPerRSP(cache.getBitsPerSample()); + for (int block = 0; block < nrBlocks; block++) { + int swbank = block / MEPHeader::N_SERDES_LANES; + int swlane = block % MEPHeader::N_SERDES_LANES; + int hwbank = block % nBanks; + int hwlane = block / nBanks; + int swstart(swlane * dataslotsPerRSP); + int hwstart(hwlane * (MEPHeader::N_BEAMLETS/MEPHeader::N_SERDES_LANES)); + src_range = Range(hwstart, hwstart+dataslotsPerRSP-1); + dst_range = Range(swstart, swstart+dataslotsPerRSP-1); + for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { + ack.weights()(0, input_rcu, swbank, dst_range) = + cache.getBeamletWeights()()(0, cache_rcu, hwbank, src_range); + if (lane == 0) { + LOG_DEBUG_STR("BF:block=" << block << " move(" << src_range << ") to (" << dst_range << ")" + << " swbank=" << swbank << " swlane=" << swlane + << " hwbank=" << hwbank << " hwlane=" << hwlane); + } + } // lanes + } // blocks + + + input_rcu++; if (cache_rcu ==0) { - LOG_DEBUG_STR("GetWeights(ack[0]): " << ack.weights()(0,0,Range::all())); + LOG_DEBUG_STR("GetWeights(ack[0]): " << ack.weights()(0,0,Range::all(),Range::all())); } } } - getPort()->send(ack); } diff --git a/MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc b/MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc index cae3ce16d2870d910919e8bb2c8a089950453415..dec6e27bafcbdedb18b2b8fd0bcd035dd3b9c45a 100644 --- a/MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc +++ b/MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc @@ -27,6 +27,7 @@ #include <Common/ParameterSet.h> #include <Common/Exception.h> #include <Common/Version.h> +#include <Common/LofarBitModeInfo.h> #include <ApplCommon/StationConfig.h> @@ -96,6 +97,9 @@ #include "GetDatastreamCmd.h" #include "SetSwapxyCmd.h" #include "GetSwapxyCmd.h" +#include "SetBitModeCmd.h" +#include "GetBitModeCmd.h" +#include "UpdBitModeCmd.h" #include "RSUWrite.h" #include "BSWrite.h" @@ -137,9 +141,12 @@ #include "RawBlockWrite.h" #include "LatencyRead.h" #include "TimestampWrite.h" +#include "BMWrite.h" +#include "BMRead.h" #include "RawEvent.h" #include "Sequencer.h" +#include "Cache.h" #include <RSP_Driver/Package__Version.h> #ifdef HAVE_UNISTD_H @@ -369,6 +376,7 @@ bool RSPDriver::isBoardPort(GCFPortInterface& port) * Order is: * - STATUS (RSP Status): read RSP status info // StatusRead * - VERSION (RSP Status): read RSP version info // VersionRead + * - BITMODE (RSP Status): read RSP nofbeam info // BMRead * - TDS: write TDS control settings // TDSResultWrite/TDSProtocolWrite * - TDSSTATUS: read TDS status // TDSStatusWrite/TDSStatusRead * - RSU: write RSU settings // RSUWrite @@ -408,6 +416,14 @@ void RSPDriver::addAllSyncActions() ASSERT(versionread); m_scheduler.addSyncAction(versionread); } + if (GET_CONFIG("RSPDriver.READ_BITMODE", i)) { + BMWrite* bitmodewrite = new BMWrite(m_boardPorts[boardid], boardid); + ASSERT(bitmodewrite); + m_scheduler.addSyncAction(bitmodewrite); + BMRead* bitmoderead = new BMRead(m_boardPorts[boardid], boardid); + ASSERT(bitmoderead); + m_scheduler.addSyncAction(bitmoderead); + } // Schedule register writes for soft PPS if configured. // @@ -483,10 +499,26 @@ void RSPDriver::addAllSyncActions() } if (GET_CONFIG("RSPDriver.READ_BST", i)) { - BstRead* bstread = 0; - bstread = new BstRead(m_boardPorts[boardid], boardid); - ASSERT(bstread); - m_scheduler.addSyncAction(bstread); + // check if board is used, and set lane + for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { + // read only BST from boards who output too CEP + // for Ring-0 + if (boardid == GET_CONFIG(formatString("RSPDriver.LANE_%02d_BLET_OUT", lane).c_str(), i)) { + LOG_DEBUG(formatString("add bstread for board %d, lane %d", boardid, lane)); + BstRead* bstread = 0; + bstread = new BstRead(m_boardPorts[boardid], boardid, lane); + ASSERT(bstread); + m_scheduler.addSyncAction(bstread); + } + // for Ring-1 + if (boardid == GET_CONFIG(formatString("RSPDriver.LANE_%02d_BLET_OUT", (10+lane)).c_str(), i)) { + LOG_DEBUG(formatString("add bstread for board %d, lane %d", boardid, (10+lane))); + BstRead* bstread = 0; + bstread = new BstRead(m_boardPorts[boardid], boardid, (10+lane)); + ASSERT(bstread); + m_scheduler.addSyncAction(bstread); + } + } } if (GET_CONFIG("RSPDriver.READ_XST", i)) { @@ -1036,6 +1068,10 @@ GCFEvent::TResult RSPDriver::enabled(GCFEvent& event, GCFPortInterface& port) case RSP_GETDATASTREAM: rsp_getDatastream(event,port); break; case RSP_SETSWAPXY: rsp_setswapxy(event,port); break; case RSP_GETSWAPXY: rsp_getswapxy(event,port); break; + case RSP_SETBITMODE: rsp_setBitMode(event,port); break; + case RSP_GETBITMODE: rsp_getBitMode(event,port); break; + case RSP_SUBBITMODE: rsp_subBitMode(event,port); break; + case RSP_UNSUBBITMODE: rsp_unsubBitMode(event,port); break; case F_TIMER: { if (&port == &m_boardPorts[0]) { @@ -1217,11 +1253,13 @@ void RSPDriver::rsp_setweights(GCFEvent& event, GCFPortInterface& port) if ((sw_event->weights().dimensions() != BeamletWeights::NDIM) || (sw_event->weights().extent(firstDim) < 1) || (sw_event->weights().extent(secondDim) > StationSettings::instance()->nrRcus()) - || (sw_event->weights().extent(thirdDim) != MAX_BEAMLETS)) { - LOG_ERROR(formatString("SETWEIGHTS: invalid parameter,weighs-size=(%d,%d,%d)", + || (sw_event->weights().extent(thirdDim) > (MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE)) + || (sw_event->weights().extent(fourthDim) != maxBeamletsPerBank(Cache::getInstance().getBack().getBitsPerSample()))) { + LOG_ERROR(formatString("SETWEIGHTS: invalid parameter,weighs-size=(%d,%d,%d,%d)", sw_event->weights().extent(firstDim), sw_event->weights().extent(secondDim), - sw_event->weights().extent(thirdDim))); + sw_event->weights().extent(thirdDim), + sw_event->weights().extent(fourthDim))); delete sw_event; @@ -1236,7 +1274,7 @@ void RSPDriver::rsp_setweights(GCFEvent& event, GCFPortInterface& port) Ptr<SetWeightsCmd> command = new SetWeightsCmd(*sw_event, port, Command::WRITE, timestep); //PD add base correction here - command->setWeights(sw_event->weights()(Range(timestep, timestep), Range::all(), Range::all())); + command->setWeights(sw_event->weights()(Range(timestep, timestep), Range::all(), Range::all(), Range::all())); // if weights for only one timestep are given (and the timestamp == Timestamp(0,0)) // then the weights may be applied immediately @@ -1301,8 +1339,10 @@ void RSPDriver::rsp_getsubbands(GCFEvent& event, GCFPortInterface& port) LOG_ERROR("GETSUBBANDS: invalid parameter"); RSPGetsubbandsackEvent ack; - ack.subbands().resize(1,1); - ack.subbands() = 0; + ack.subbands.crosslets().resize(1,1); + ack.subbands.crosslets() = 0; + ack.subbands.beamlets().resize(1,1); + ack.subbands.beamlets() = 0; ack.timestamp = Timestamp(0,0); ack.status = RSP_FAILURE; port.send(ack); @@ -1456,8 +1496,7 @@ void RSPDriver::rsp_subrcu(GCFEvent& event, GCFPortInterface& port) ack.handle = (memptr_t)&(*command); port.send(ack); - m_scheduler.enter(Ptr<Command>(&(*command)), - Scheduler::PERIODIC); + m_scheduler.enter(Ptr<Command>(&(*command)), Scheduler::PERIODIC); } // @@ -2482,6 +2521,98 @@ void RSPDriver::rsp_getDatastream(GCFEvent& event, GCFPortInterface& port) m_scheduler.enter(Ptr<Command>(&(*command))); } +// +// rsp_setBitMode(event, port) +// +void RSPDriver::rsp_setBitMode(GCFEvent& event, GCFPortInterface& port) +{ + Ptr<SetBitModeCmd> command = new SetBitModeCmd(event, port, Command::WRITE); + + if (!command->validate()) { + LOG_ERROR("SetBitMode: invalid parameter"); + + RSPSetbitmodeackEvent ack; + ack.timestamp = Timestamp(0,0); + ack.status = RSP_FAILURE; + port.send(ack); + return; + } + // command is ok, schedule it. + m_scheduler.enter(Ptr<Command>(&(*command))); +} + +// +// rsp_getDatastream(event, port) +// +void RSPDriver::rsp_getBitMode(GCFEvent& event, GCFPortInterface& port) +{ + Ptr<GetBitModeCmd> command = new GetBitModeCmd(event, port, Command::READ); + + if (!command->validate()) { + LOG_ERROR("GetBitMode: invalid parameter"); + + RSPGetbitmodeackEvent ack; + ack.timestamp = Timestamp(0,0); + ack.status = RSP_FAILURE; + port.send(ack); + return; + } + // command is ok, schedule it. + m_scheduler.enter(Ptr<Command>(&(*command))); +} + +// +// rsp_subBitMode(event, port) +// +void RSPDriver::rsp_subBitMode(GCFEvent& event, GCFPortInterface& port) +{ + // subscription is done by entering a UpdSplitterCmd in the periodic queue + Ptr<UpdBitModeCmd> command = new UpdBitModeCmd(event, port, Command::READ); + RSPSubbitmodeackEvent ack; + + if (!command->validate()) { + LOG_ERROR("SUBBITMODE: invalid parameter"); + + ack.timestamp = m_scheduler.getCurrentTime(); + ack.status = RSP_FAILURE; + ack.handle = 0; + + port.send(ack); + return; + } + else { + ack.timestamp = m_scheduler.getCurrentTime(); + ack.status = RSP_SUCCESS; + ack.handle = (memptr_t)&(*command); + port.send(ack); + } + + m_scheduler.enter(Ptr<Command>(&(*command)), Scheduler::PERIODIC); +} + +// +// rsp_unsubBitMode(event, port) +// +void RSPDriver::rsp_unsubBitMode(GCFEvent& event, GCFPortInterface& port) +{ + RSPUnsubbitmodeEvent unsub(event); + + RSPUnsubbitmodeackEvent ack; + ack.timestamp = m_scheduler.getCurrentTime(); + ack.status = RSP_FAILURE; + ack.handle = unsub.handle; + + if (m_scheduler.remove_subscription(port, unsub.handle) > 0) { + ack.status = RSP_SUCCESS; + } + else { + LOG_ERROR("UNSUBBITMODE: failed to remove subscription"); + } + + port.send(ack); +} + + } // namespace RSP } // namespace LOFAR diff --git a/MAC/APL/PIC/RSP_Driver/src/RSPDriver.conf.in b/MAC/APL/PIC/RSP_Driver/src/RSPDriver.conf.in index 09c27c49e65c344b2f2d5f76d78b540c195ed663..f892324b9d957aa93c452e8856be8431f9dd8319 100644 --- a/MAC/APL/PIC/RSP_Driver/src/RSPDriver.conf.in +++ b/MAC/APL/PIC/RSP_Driver/src/RSPDriver.conf.in @@ -231,6 +231,8 @@ RSPDriver.READWRITE_TDSSTATUS=1 RSPDriver.WRITE_TBB=1 RSPDriver.WRITE_SI=1 RSPDriver.READ_SI=1 +RSPDriver.READ_BITMODE=1 + # # TDS_CONTROL diff --git a/MAC/APL/PIC/RSP_Driver/src/RSPDriver.h b/MAC/APL/PIC/RSP_Driver/src/RSPDriver.h index d11ce8ea054a6493db43593c7fad315d6b422075..c1d3ff91a412e713477488136ffa57bbd35bef5f 100644 --- a/MAC/APL/PIC/RSP_Driver/src/RSPDriver.h +++ b/MAC/APL/PIC/RSP_Driver/src/RSPDriver.h @@ -170,6 +170,11 @@ public: void rsp_setswapxy(GCFEvent& event, GCFPortInterface& port); void rsp_getswapxy(GCFEvent& event, GCFPortInterface& port); + + void rsp_setBitMode(GCFEvent& event, GCFPortInterface &port); + void rsp_getBitMode(GCFEvent& event, GCFPortInterface &port); + void rsp_subBitMode(GCFEvent& event, GCFPortInterface &port); + void rsp_unsubBitMode(GCFEvent& event, GCFPortInterface &port); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Driver/src/RawEvent.cc b/MAC/APL/PIC/RSP_Driver/src/RawEvent.cc index f481b69fb66620a380f57c3c770ae41b5f7bf3b0..e8cd511db721b405edee96671d833e843c6ee737 100644 --- a/MAC/APL/PIC/RSP_Driver/src/RawEvent.cc +++ b/MAC/APL/PIC/RSP_Driver/src/RawEvent.cc @@ -67,11 +67,11 @@ static unsigned short signal_lut[MEPHeader::MAX_PID + 1][MEPHeader::MAX_REGID + EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x03 (RSR_NOFBEAM new in 8/4bit mode) */ + /* reg = 0x03 (RSR_BEAMMODE) */ { 0, EPA_READ, /* READ */ - EPA_WRITE, /* WRITE */ - EPA_READACK, /* READACK */ + EPA_RSR_BEAMMODE, /* WRITE */ + EPA_RSR_BEAMMODE, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, }, @@ -183,25 +183,25 @@ static unsigned short signal_lut[MEPHeader::MAX_PID + 1][MEPHeader::MAX_REGID + EPA_SS_SELECT, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x01 (Subband 1 Select parameters, new in 8/4bit mode) */ + /* reg = 0x01 (Subband Select parameters) */ { 0, EPA_READ, /* READ */ - EPA_SS_SELECT, /* WRITE */ - EPA_SS_SELECT, /* READACK */ + EPA_SS_SELECT+1, /* WRITE */ + EPA_SS_SELECT+1, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x02 (Subband 2 Select parameters, new in 8/4bit mode) */ + /* reg = 0x02 (Subband Select parameters) */ { 0, EPA_READ, /* READ */ - EPA_SS_SELECT, /* WRITE */ - EPA_SS_SELECT, /* READACK */ + EPA_SS_SELECT+2, /* WRITE */ + EPA_SS_SELECT+2, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x03 (Subband 3 Select parameters, new in 8/4bit mode) */ + /* reg = 0x03 (Subband Select parameters) */ { 0, EPA_READ, /* READ */ - EPA_SS_SELECT, /* WRITE */ - EPA_SS_SELECT, /* READACK */ + EPA_SS_SELECT+3, /* WRITE */ + EPA_SS_SELECT+3, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, }, @@ -218,106 +218,106 @@ static unsigned short signal_lut[MEPHeader::MAX_PID + 1][MEPHeader::MAX_REGID + /* reg = 0x01 (BF_XIOUT subband 0) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+1, /* WRITE */ + EPA_BF_COEFS_READ+1, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, /* reg = 0x02 (BF_YROUT subband 0) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+2, /* WRITE */ + EPA_BF_COEFS_READ+2, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, /* reg = 0x03 (BF_YIOUT subband 0) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+3, /* WRITE */ + EPA_BF_COEFS_READ+3, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x04 (BF_XROUT subband 1 new in 8/4bit mode) */ + /* reg = 0x04 (BF_XROUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+4, /* WRITE */ + EPA_BF_COEFS_READ+4, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x05 (BF_XIOUT subband 1 new in 8/4bit mode) */ + /* reg = 0x05 (BF_XIOUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+5, /* WRITE */ + EPA_BF_COEFS_READ+5, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x06 (BF_YROUT subband 1 new in 8/4bit mode) */ + /* reg = 0x06 (BF_YROUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+6, /* WRITE */ + EPA_BF_COEFS_READ+6, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x07 (BF_YIOUT subband 1 new in 8/4bit mode) */ + /* reg = 0x07 (BF_YIOUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+7, /* WRITE */ + EPA_BF_COEFS_READ+7, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x08 (BF_XROUT subband 2 new in 8/4bit mode) */ + /* reg = 0x08 (BF_XROUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+8, /* WRITE */ + EPA_BF_COEFS_READ+8, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x09 (BF_XIOUT subband 2 new in 8/4bit mode) */ + /* reg = 0x09 (BF_XIOUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+9, /* WRITE */ + EPA_BF_COEFS_READ+9, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x0A (BF_YROUT subband 2 new in 8/4bit mode) */ + /* reg = 0x0A (BF_YROUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+10, /* WRITE */ + EPA_BF_COEFS_READ+10, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x0B (BF_YIOUT subband 2 new in 8/4bit mode) */ + /* reg = 0x0B (BF_YIOUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+11, /* WRITE */ + EPA_BF_COEFS_READ+11, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x0C (BF_XROUT subband 3 new in 8/4bit mode) */ + /* reg = 0x0C (BF_XROUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_READ+12, /* WRITE */ + EPA_BF_COEFS_READ+12, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x0D (BF_XIOUT subband 3 new in 8/4bit mode) */ + /* reg = 0x0D (BF_XIOUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+13, /* WRITE */ + EPA_BF_COEFS_READ+13, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x0E (BF_YROUT subband 3 new in 8/4bit mode) */ + /* reg = 0x0E (BF_YROUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+14, /* WRITE */ + EPA_BF_COEFS_READ+14, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, - /* reg = 0x0F (BF_YIOUT subband 3 new in 8/4bit mode) */ + /* reg = 0x0F (BF_YIOUT) */ { 0, EPA_READ, /* READ */ - EPA_BF_COEFS_WRITE, /* WRITE */ - EPA_BF_COEFS_READ, /* READACK */ + EPA_BF_COEFS_WRITE+15, /* WRITE */ + EPA_BF_COEFS_READ+15, /* READACK */ EPA_WRITEACK, /* WRITEACK */ }, }, diff --git a/MAC/APL/PIC/RSP_Driver/src/SSRead.cc b/MAC/APL/PIC/RSP_Driver/src/SSRead.cc index 7edd1156afe877d8ce1fbced97c328d6b9347682..5ec208b33f03da165639ca7cb6e18c317e85dc91 100644 --- a/MAC/APL/PIC/RSP_Driver/src/SSRead.cc +++ b/MAC/APL/PIC/RSP_Driver/src/SSRead.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RSP_Protocol/EPA_Protocol.ph> @@ -38,9 +39,9 @@ using namespace RSP; using namespace RTC; SSRead::SSRead(GCFPortInterface& board_port, int board_id) - : SyncAction(board_port, board_id, NR_BLPS_PER_RSPBOARD) + : SyncAction(board_port, board_id, NR_BLPS_PER_RSPBOARD*(MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE)) { - memset(&m_hdr, 0, sizeof(MEPHeader)); + memset(&m_hdr, 0, sizeof(MEPHeader)); } SSRead::~SSRead() @@ -49,70 +50,96 @@ SSRead::~SSRead() void SSRead::sendrequest() { - EPAReadEvent ssread; - ssread.hdr.set(MEPHeader::SS_SELECT_HDR, 1 << getCurrentIndex(), - MEPHeader::READ); - - m_hdr = ssread.hdr; - getBoardPort().send(ssread); + EPAReadEvent ssread; + itsActivePlanes = (MAX_BITS_PER_SAMPLE / Cache::getInstance().getBack().getBitsPerSample()); + if (getCurrentIndex() >= (itsActivePlanes*NR_BLPS_PER_RSPBOARD)) { + setContinue(true); + return; + } + + int dstid = 1 << (getCurrentIndex() / itsActivePlanes); + int plane = getCurrentIndex() % itsActivePlanes; + + ssread.hdr.set(MEPHeader::READ, + dstid, + MEPHeader::SS, + MEPHeader::SS_SELECT+plane, + MEPHeader::SS_SELECT_SIZE); + + m_hdr = ssread.hdr; + getBoardPort().send(ssread); } void SSRead::sendrequest_status() { - /* intentionally left empty */ + /* intentionally left empty */ } GCFEvent::TResult SSRead::handleack(GCFEvent& event, GCFPortInterface& /*port*/) { - if (EPA_SS_SELECT != event.signal) - { - LOG_WARN("SSRead::handleack: unexpected ack"); - return GCFEvent::NOT_HANDLED; - } - - // unpack ss message - EPASsSelectEvent ss(event); - - uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + getCurrentIndex(); - if (!ss.hdr.isValidAck(m_hdr)) - { - Cache::getInstance().getState().ss().read_error(global_blp); - LOG_ERROR("SSRead::handleack: invalid ack"); - return GCFEvent::NOT_HANDLED; - } - - LOG_DEBUG("handleack"); - - LOG_DEBUG(formatString(">>>> SSRead(%s) global_blp=%d", - getBoardPort().getName().c_str(), global_blp)); - - // create array point to data in the response event - Array<uint16, 2> subbands((uint16*)&ss.subbands, - shape(MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS, N_POL), - neverDeleteData); - - if (0 == GET_CONFIG("RSPDriver.LOOPBACK_MODE", i)) - { - subbands(Range::all(), 0) -= Cache::getInstance().getBack().getSubbandSelection()()(global_blp * 2, Range::all()); - subbands(Range::all(), 1) -= Cache::getInstance().getBack().getSubbandSelection()()(global_blp * 2 + 1, Range::all()); - uint16 ssum = sum(subbands); - - if (0 != ssum) - { - LOG_WARN(formatString("LOOPBACK CHECK FAILED: SSRead mismatch (blp=%d, error=%d)", - global_blp, ssum)); - } - } - else - { - // copy into the cache - Cache::getInstance().getBack().getSubbandSelection()()(global_blp * 2, Range::all()) - = subbands(Range::all(), 0); // x - Cache::getInstance().getBack().getSubbandSelection()()(global_blp * 2 + 1, Range::all()) - = subbands(Range::all(), 1); // y - } - - Cache::getInstance().getState().ss().read_ack(global_blp); - - return GCFEvent::HANDLED; + if ((event.signal < EPA_SS_SELECT) || (event.signal > (EPA_SS_SELECT+3))) { + LOG_WARN("SSRead::handleack: unexpected ack"); + return GCFEvent::NOT_HANDLED; + } + + // unpack ss message + EPASsSelectEvent ss(event); + + uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + (getCurrentIndex()/itsActivePlanes); + if (!ss.hdr.isValidAck(m_hdr)) { + Cache::getInstance().getState().ss().read_error(global_blp); + LOG_ERROR("SSRead::handleack: invalid ack"); + return GCFEvent::NOT_HANDLED; + } + + LOG_DEBUG("handleack"); + + LOG_DEBUG(formatString(">>>> SSRead(%s) global_blp=%d", + getBoardPort().getName().c_str(), global_blp)); + + // create array point to data in the response event (format in 2 dims) + Array<uint16, 2> subbands((uint16*)&ss.subbands, + shape(MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS, N_POL), + neverDeleteData); + + Range hw_range; + // used plane + int plane = getCurrentIndex()%itsActivePlanes; + if (0 == GET_CONFIG("RSPDriver.LOOPBACK_MODE", i)) { + hw_range = Range(0, MEPHeader::N_LOCAL_XLETS - 1); + subbands(hw_range, 0) -= + Cache::getInstance().getBack().getSubbandSelection().crosslets()(global_blp * 2, plane, Range::all()); + subbands(hw_range, 1) -= + Cache::getInstance().getBack().getSubbandSelection().crosslets()(global_blp * 2 + 1, plane, Range::all()); + + hw_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS); + subbands(hw_range, 0) -= + Cache::getInstance().getBack().getSubbandSelection().beamlets()(global_blp * 2, plane, Range::all()); + subbands(hw_range, 1) -= + Cache::getInstance().getBack().getSubbandSelection().beamlets()(global_blp * 2 + 1, plane, Range::all()); + + uint16 ssum = sum(subbands); + + if (0 != ssum) { + LOG_WARN(formatString("LOOPBACK CHECK FAILED: SSRead mismatch (blp=%d, error=%d)", global_blp, ssum)); + } + } + else { + // copy into the cache + hw_range = Range(0, MEPHeader::N_LOCAL_XLETS - 1); + Cache::getInstance().getBack().getSubbandSelection().crosslets()(global_blp * 2, plane, Range::all()) + = subbands(hw_range, 0); // x + Cache::getInstance().getBack().getSubbandSelection().crosslets()(global_blp * 2 + 1, plane, Range::all()) + = subbands(hw_range, 1); // y + + hw_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS); + Cache::getInstance().getBack().getSubbandSelection().beamlets()(global_blp * 2, plane, Range::all()) + = subbands(hw_range, 0); // x + Cache::getInstance().getBack().getSubbandSelection().beamlets()(global_blp * 2 + 1, plane, Range::all()) + = subbands(hw_range, 1); // y + } + + Cache::getInstance().getState().ss().read_ack(global_blp); + + return GCFEvent::HANDLED; } diff --git a/MAC/APL/PIC/RSP_Driver/src/SSRead.h b/MAC/APL/PIC/RSP_Driver/src/SSRead.h index 2bbcf6fcd7c4c62ca13996a57d6d2fb54344fc57..e7f86498942e32c407c63a42e8af0f344b58a195 100644 --- a/MAC/APL/PIC/RSP_Driver/src/SSRead.h +++ b/MAC/APL/PIC/RSP_Driver/src/SSRead.h @@ -61,6 +61,7 @@ namespace LOFAR { private: EPA_Protocol::MEPHeader m_hdr; + int itsActivePlanes; }; }; }; diff --git a/MAC/APL/PIC/RSP_Driver/src/SSWrite.cc b/MAC/APL/PIC/RSP_Driver/src/SSWrite.cc index b27295fc2d76c48889049b4558108ae35c3262f8..e7c8aa3ca6a07798a1f8d8981916dd430f4f1fd1 100644 --- a/MAC/APL/PIC/RSP_Driver/src/SSWrite.cc +++ b/MAC/APL/PIC/RSP_Driver/src/SSWrite.cc @@ -40,111 +40,106 @@ using namespace RSP; using namespace RTC; SSWrite::SSWrite(GCFPortInterface& board_port, int board_id) - : SyncAction(board_port, board_id, NR_BLPS_PER_RSPBOARD) + : SyncAction(board_port, board_id, NR_BLPS_PER_RSPBOARD * (MAX_BITS_PER_SAMPLE / MIN_BITS_PER_SAMPLE)), + itsActiveBanks(1) + { - memset(&m_hdr, 0, sizeof(MEPHeader)); + memset(&m_hdr, 0, sizeof(MEPHeader)); } SSWrite::~SSWrite() { - /* TODO: delete event? */ + /* TODO: delete event? */ } void SSWrite::sendrequest() { - uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + getCurrentIndex(); - LOG_DEBUG(formatString(">>>> SSWrite(%s) global_blp=%d", - getBoardPort().getName().c_str(), - global_blp)); - - // mark modified - //Cache::getInstance().getState().ss().write_now(global_blp); - - // send subband select message - EPASsSelectEvent ss; - ss.hdr.set(MEPHeader::SS_SELECT_HDR, 1 << getCurrentIndex()); - - // create array to contain the subband selection - Array<uint16, 2> subbands((uint16*)&ss.subbands, - shape(MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS, N_POL), - neverDeleteData); - -#if 0 - Array<int, 2> index(MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS, N_POL); - Array<int, 2> mapped_index(MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS, N_POL); - - for (int beamlet = MEPHeader::N_LOCAL_XLETS; beamlet < MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS; beamlet++) { - for (int pol = 0; pol < N_POL; pol++) { - index(beamlet, pol) = beamlet * N_POL + pol; - } - } - mapped_index = 0; -#endif - - // copy crosslet selection - Range xlet_range(0, MEPHeader::N_LOCAL_XLETS-1); - subbands(xlet_range, 0) = Cache::getInstance().getBack().getSubbandSelection()()(global_blp * 2, xlet_range); // x - subbands(xlet_range, 1) = Cache::getInstance().getBack().getSubbandSelection()()(global_blp * 2 + 1, xlet_range); // y - - // - // copy the actual values from the cache - // Explain this in more detail - for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { - - int hw_offset = lane + MEPHeader::N_LOCAL_XLETS; - int cache_offset = (lane * (MEPHeader::N_BEAMLETS / MEPHeader::N_SERDES_LANES)) + MEPHeader::N_LOCAL_XLETS; - - // strided source range, stride = NR_BLPS_PER_RSPBOARD - Range hw_range(hw_offset, hw_offset + MEPHeader::N_BEAMLETS - MEPHeader::N_BLPS, MEPHeader::N_BLPS); - Range cache_range(cache_offset, cache_offset + (MEPHeader::N_BEAMLETS / MEPHeader::N_SERDES_LANES) - 1, 1); - - LOG_DEBUG_STR("lane=" << lane); - LOG_DEBUG_STR("hw_range=" << hw_range); - LOG_DEBUG_STR("cache_range=" << cache_range); - - subbands(hw_range, 0) = Cache::getInstance().getBack().getSubbandSelection()()(global_blp * 2, cache_range); // x - subbands(hw_range, 1) = Cache::getInstance().getBack().getSubbandSelection()()(global_blp * 2 + 1, cache_range); // y - -#if 0 - mapped_index(hw_range, 0) = index(cache_range, 0); - mapped_index(hw_range, 1) = index(cache_range, 1); -#endif - } - -#if 0 - LOG_DEBUG_STR("mapped_index=" << mapped_index); -#endif - - m_hdr = ss.hdr; - getBoardPort().send(ss); + itsActiveBanks = (MAX_BITS_PER_SAMPLE / Cache::getInstance().getBack().getBitsPerSample()); + if (getCurrentIndex() >= (itsActiveBanks*NR_BLPS_PER_RSPBOARD)) { + setContinue(true); + return; + } + + uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + (getCurrentIndex()/itsActiveBanks); + LOG_DEBUG(formatString(">>>> SSWrite(%s) global_blp=%d", getBoardPort().getName().c_str(), global_blp)); + + // mark modified + //Cache::getInstance().getState().ss().write_now(global_blp); + + // send subband select message + EPASsSelectEvent ss; + + int dstid = 1 << (getCurrentIndex() / itsActiveBanks); + // used bank + int bank = getCurrentIndex() % itsActiveBanks; + LOG_DEBUG(formatString("SSWRITE:board=%d, index=%d, globalblp=%d, dstID=%d, bank=%d, regid=%d", + getBoardId(), getCurrentIndex(), global_blp, dstid, bank, MEPHeader::SS_SELECT+bank)); + + ss.hdr.set( MEPHeader::WRITE, + dstid, + MEPHeader::SS, + MEPHeader::SS_SELECT+bank, + MEPHeader::SS_SELECT_SIZE); + + // create array to contain the subband selection + Array<uint16, 2> subbands((uint16*)&ss.subbands, + shape(MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS, N_POL), + neverDeleteData); + + // copy crosslet selection + Range xlet_range(0, MEPHeader::N_LOCAL_XLETS-1); + subbands(xlet_range, 0) = Cache::getInstance().getBack().getSubbandSelection().crosslets()(global_blp * 2, bank, xlet_range); // x + subbands(xlet_range, 1) = Cache::getInstance().getBack().getSubbandSelection().crosslets()(global_blp * 2 + 1, bank, xlet_range); // y + + // + // copy the actual values from the cache + // Explain this in more detail + for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { + + int hw_offset = lane + MEPHeader::N_LOCAL_XLETS; + int cache_offset = (lane * (MEPHeader::N_BEAMLETS / MEPHeader::N_SERDES_LANES)); + + // strided source range, stride = NR_BLPS_PER_RSPBOARD + Range hw_range(hw_offset, hw_offset + MEPHeader::N_BEAMLETS - MEPHeader::N_BLPS, MEPHeader::N_BLPS); + Range cache_range(cache_offset, cache_offset + (MEPHeader::N_BEAMLETS / MEPHeader::N_SERDES_LANES) - 1, 1); + + LOG_DEBUG_STR("lane=" << lane << ",hw_range=" << hw_range << ",cache_range=" << cache_range); + + subbands(hw_range, 0) = Cache::getInstance().getBack().getSubbandSelection().beamlets()(global_blp * 2, bank, cache_range); // x + subbands(hw_range, 1) = Cache::getInstance().getBack().getSubbandSelection().beamlets()(global_blp * 2 + 1, bank, cache_range); // y + } + + m_hdr = ss.hdr; +// LOG_INFO_STR("SUBBANDSELECT=" << subbands); + getBoardPort().send(ss); } void SSWrite::sendrequest_status() { - // intentionally left empty + // intentionally left empty } GCFEvent::TResult SSWrite::handleack(GCFEvent& event, GCFPortInterface& /*port*/) { - if (EPA_WRITEACK != event.signal) - { - LOG_WARN("SSWrite::handleack: unexpected ack"); - return GCFEvent::NOT_HANDLED; - } + if (EPA_WRITEACK != event.signal) { + LOG_WARN("SSWrite::handleack: unexpected ack"); + return GCFEvent::NOT_HANDLED; + } - EPAWriteackEvent ack(event); + EPAWriteackEvent ack(event); - uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + getCurrentIndex(); + uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + (getCurrentIndex()/itsActiveBanks); - if (!ack.hdr.isValidAck(m_hdr)) - { - Cache::getInstance().getState().ss().write_error(global_blp); + if (!ack.hdr.isValidAck(m_hdr)) { + Cache::getInstance().getState().ss().write_error(global_blp); - LOG_ERROR("SSWrite::handleack: invalid ack"); - return GCFEvent::NOT_HANDLED; - } + LOG_ERROR("SSWrite::handleack: invalid ack"); + return GCFEvent::NOT_HANDLED; + } + + if ((getCurrentIndex() % itsActiveBanks) == 0) { + Cache::getInstance().getState().ss().write_ack(global_blp); + } - Cache::getInstance().getState().ss().write_ack(global_blp); - - return GCFEvent::HANDLED; + return GCFEvent::HANDLED; } diff --git a/MAC/APL/PIC/RSP_Driver/src/SSWrite.h b/MAC/APL/PIC/RSP_Driver/src/SSWrite.h index 80defcc08ba706fc874bc432d2e4aeddaa071613..4d14c3b14d730cf97ac13d539992124cc5b99364 100644 --- a/MAC/APL/PIC/RSP_Driver/src/SSWrite.h +++ b/MAC/APL/PIC/RSP_Driver/src/SSWrite.h @@ -60,6 +60,8 @@ namespace LOFAR { virtual GCFEvent::TResult handleack(GCFEvent& event, GCFPortInterface& port); private: + int itsActiveBanks; + EPA_Protocol::MEPHeader m_hdr; }; }; diff --git a/MAC/APL/PIC/RSP_Driver/src/Scheduler.cc b/MAC/APL/PIC/RSP_Driver/src/Scheduler.cc index 68c866408a202a9fea5cc64c1cad7c064020e33c..bfbf09d3e69c8d7b953bd6ee763220a86a27682c 100644 --- a/MAC/APL/PIC/RSP_Driver/src/Scheduler.cc +++ b/MAC/APL/PIC/RSP_Driver/src/Scheduler.cc @@ -235,6 +235,42 @@ int Scheduler::pqueue_remove_commands(pqueue& pq, return count; } +// +// oqueue_remove_commands(pqueue, port, memptr) +// +int Scheduler::oqueue_remove_commands(oqueue& oq, + GCFPortInterface& port, + memptr_t handle) +{ + int count = 0; + + // copy oq + oqueue tmp(oq); + + // clear pq, it will be filled again in the next loop + while (!oq.empty()) { + oq.pop(); + } + + while (!tmp.empty()) { + // pop item from the queue + Ptr<Command> c = tmp.top(); + tmp.pop(); + + // if port matches, delete c, else push back onto pq + if ((c->getPort() == &port) && (0 == handle || &(*c) == (Command*)handle)) { + count++; + // don't push back on pq, c will be deleted when it goes out of scope + LOG_DEBUG_STR("Removing command '" << c->name() << "' from the queue"); + } + else { + oq.push(c); + } + } + + return count; +} + // // cancel(port) // @@ -246,7 +282,7 @@ int Scheduler::cancel(GCFPortInterface& port) count += pqueue_remove_commands(m_later_queue, port); count += pqueue_remove_commands(m_now_queue, port); count += pqueue_remove_commands(m_periodic_queue, port); - count += pqueue_remove_commands(m_done_queue, port); + count += oqueue_remove_commands(m_done_queue, port); return count; } @@ -260,7 +296,7 @@ int Scheduler::remove_subscription(GCFPortInterface& port, memptr_t handle) count += pqueue_remove_commands(m_later_queue, port, handle); count += pqueue_remove_commands(m_now_queue, port, handle); count += pqueue_remove_commands(m_periodic_queue, port, handle); - count += pqueue_remove_commands(m_done_queue, port, handle); + count += oqueue_remove_commands(m_done_queue, port, handle); return count; } @@ -407,6 +443,7 @@ void Scheduler::scheduleCommands() /* copy periodic commands to the now queue */ pqueue pq = m_periodic_queue; + int orderNr(0); while (!pq.empty()) { Ptr<Command> command = pq.top(); @@ -425,6 +462,7 @@ void Scheduler::scheduleCommands() if (command->getTimestamp() <= m_current_time + (long)scheduling_offset) { LOG_DEBUG_STR("scheduling periodic command '" << command->name() << "' with time=" << command->getTimestamp()); + command->order(orderNr++); m_now_queue.push(command); } diff --git a/MAC/APL/PIC/RSP_Driver/src/Scheduler.h b/MAC/APL/PIC/RSP_Driver/src/Scheduler.h index 614067ba26e38f6524f391f401151c499a92d090..7035f13812abbf9161cb186fbf79eabc972b3019 100644 --- a/MAC/APL/PIC/RSP_Driver/src/Scheduler.h +++ b/MAC/APL/PIC/RSP_Driver/src/Scheduler.h @@ -89,9 +89,11 @@ public: private: // Private types. typedef std::priority_queue<Ptr<Command>, std::vector<Ptr<Command> >, RSP::Command_greater> pqueue; + typedef std::priority_queue<Ptr<Command>, std::vector<Ptr<Command> >, RSP::Command_order> oqueue; // Private helper methods. int pqueue_remove_commands(pqueue& p, GCFPortInterface& port, memptr_t handle = 0); + int oqueue_remove_commands(oqueue& p, GCFPortInterface& port, memptr_t handle = 0); // Constants from the config file converted to the correct type. static int SYNC_INTERVAL_INT; @@ -110,7 +112,7 @@ private: pqueue m_later_queue; // commands to be exec later pqueue m_periodic_queue; // commands to be executed peiodically pqueue m_now_queue; // filled every second from later and periodic queue - pqueue m_done_queue; // commands that wait for cache switching + oqueue m_done_queue; // commands that wait for cache switching pqueue itsDelayedResponseQueue; // commands that wait for two cache switchings std::map< GCFPortInterface*, std::vector<SyncAction*> > m_syncactions; diff --git a/MAC/APL/PIC/RSP_Driver/src/SetBitModeCmd.cc b/MAC/APL/PIC/RSP_Driver/src/SetBitModeCmd.cc new file mode 100644 index 0000000000000000000000000000000000000000..69a22a63963efd9a0d46a5f40a33a42913bd196c --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/SetBitModeCmd.cc @@ -0,0 +1,124 @@ +//# SetBitModeCmd.cc: implementation of the SetBitModeCmd class +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: SetBitModeCmd.cc 18124 2011-05-29 19:54:09Z donker $ + +#include <lofar_config.h> +#include <Common/LofarLogger.h> + +#include <APL/RSP_Protocol/RSP_Protocol.ph> +#include <APL/RTCCommon/PSAccess.h> +#include <blitz/array.h> + +#include "StationSettings.h" +#include "SetBitModeCmd.h" +#include "Sequencer.h" +#include "Cache.h" + +using namespace blitz; +using namespace LOFAR; +using namespace RSP; +using namespace RSP_Protocol; +using namespace RTC; + +SetBitModeCmd::SetBitModeCmd(GCFEvent& event, GCFPortInterface& port, Operation oper) : + Command("SetBitMode", port, oper) +{ + itsEvent = new RSPSetbitmodeEvent(event); +} + +SetBitModeCmd::~SetBitModeCmd() +{ + delete itsEvent; +} + +void SetBitModeCmd::ack(CacheBuffer& /*cache*/) +{ + RSPSetbitmodeackEvent ack; + + ack.timestamp = getTimestamp(); + ack.status = RSP_SUCCESS; + + getPort()->send(ack); +} + +void SetBitModeCmd::apply(CacheBuffer& cache, bool setModFlag) +{ + int select; + + LOG_INFO_STR(formatString("Setting bitmode to %d bits @ ", itsEvent->bits_per_sample) << getTimestamp()); + + switch (itsEvent->bits_per_sample) { + case 16: + select = 0; + break; + case 8: + select = 1; + break; + case 4: + select = 2; + break; + default: + return; + break; + } + + cache.setBitsPerSample(itsEvent->bits_per_sample); + + for (int i = 0; i < StationSettings::instance()->nrRspBoards(); ++i) { + if (itsEvent->rspmask.test(i)) { + cache.getBitModeInfo()()(i).bm_select = (uint8)select; + if (setModFlag) { + cache.getCache().getState().bmState().write(i); + cache.getCache().getState().cdo().write(2*i); + cache.getCache().getState().cdo().write(2*i+1); + } + } + } +} + +void SetBitModeCmd::complete(CacheBuffer& /*cache*/) +{ +} + +const Timestamp& SetBitModeCmd::getTimestamp() const +{ + return itsEvent->timestamp; +} + +void SetBitModeCmd::setTimestamp(const Timestamp& timestamp) +{ + itsEvent->timestamp = timestamp; +} + +bool SetBitModeCmd::validate() const +{ + // check if BP version of all boards >= 7.4 + for (int i = 0; i < StationSettings::instance()->nrRspBoards(); ++i) { + if (((Cache::getInstance().getBack().getVersions().bp()(i).fpga_maj * 10) + + Cache::getInstance().getBack().getVersions().bp()(i).fpga_min) < 74) { + LOG_WARN_STR(formatString("Wrong firmware version on board[%d], NO bitmode support", i)); + return(false); + } + } + return (16 == itsEvent->bits_per_sample || + 8 == itsEvent->bits_per_sample || + 4 == itsEvent->bits_per_sample); +} diff --git a/MAC/APL/PIC/RSP_Driver/src/SetBitModeCmd.h b/MAC/APL/PIC/RSP_Driver/src/SetBitModeCmd.h new file mode 100644 index 0000000000000000000000000000000000000000..a4b322ac73a982d24c7fc886ba97c60f6be6471d --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/SetBitModeCmd.h @@ -0,0 +1,87 @@ +//# -*- mode: c++ -*- +//# +//# SetBitModeCmd.h: Set bits per sample of RSP boards to 16, 8 or 4bit. +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: SetBitModeCmd.h 8231 2006-04-28 08:53:22Z donker $ + +#ifndef SETBITMODECMD_H_ +#define SETBITMODECMD_H_ + +#include "Command.h" +#include <APL/RSP_Protocol/RSP_Protocol.ph> + +#include <Common/LofarTypes.h> +#include <GCF/TM/GCF_Control.h> + +namespace LOFAR { + namespace RSP { + + class SetBitModeCmd : public Command + { + public: + /** + * Constructors for a SetBitModeCmd object. + */ + SetBitModeCmd(GCFEvent& event, GCFPortInterface& port, Operation oper); + + /* Destructor for SetBitModeCmd. */ + virtual ~SetBitModeCmd(); + + /** + * Acknowledge the command by sending the appropriate + * response on m_port. + */ + virtual void ack(CacheBuffer& cache); + + /** + * Make necessary changes to the cache for the next synchronization. + * Any changes will be sent to the RSP boards. + */ + virtual void apply(CacheBuffer& cache, bool setModFlag = true); + + /** + * Complete the command by sending the appropriate response on + * the m_answerport; + */ + virtual void complete(CacheBuffer& cache); + + /*@{*/ + /** + * get timestamp of the event + */ + virtual const RTC::Timestamp& getTimestamp() const; + virtual void setTimestamp(const RTC::Timestamp& timestamp); + /*@}*/ + + /** + * Validate the event that underlies the command. + */ + virtual bool validate() const; + + private: + SetBitModeCmd(); + + RSPSetbitmodeEvent* itsEvent; + }; + }; +}; + +#endif /* SETBITMODECMD_H_ */ diff --git a/MAC/APL/PIC/RSP_Driver/src/SetSubbandsCmd.cc b/MAC/APL/PIC/RSP_Driver/src/SetSubbandsCmd.cc index fe0b2ddf27cf1e5fecd66532e9b1d6b01808f028..51e3c9bf711ae2679badbc7da3fdfdcf47ef06f0 100644 --- a/MAC/APL/PIC/RSP_Driver/src/SetSubbandsCmd.cc +++ b/MAC/APL/PIC/RSP_Driver/src/SetSubbandsCmd.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RTCCommon/PSAccess.h> @@ -36,6 +37,29 @@ using namespace RSP; using namespace RSP_Protocol; using namespace RTC; +// BITMODE 16 +// bank 0: +// lane 0 lane 1 lane 2 lane 3 +// 0,1 122,123 244,245 366,367 +// 2,3 124,125 246,247 368,369 +// .. .. .. .. +// 120,121 242,243 364,365, 486,487 +// +// BITMODE 8 +// bank 0: +// lane 0 lane 1 lane 2 lane 3 +// 0,1 244,245 488,489 732,733 +// 2,3 246,247 490,491 734,735 +// .. .. .. .. +// 120,121 364,365 608,609, 852,853 +// +// bank 1: +// lane 0 lane 1 lane 2 lane 3 +// 122,123 366,367 610,611 854,855 +// 124,125 368,369 612,613 856,857 +// .. .. .. .. +// 242,243 486,487 730,731 974,975 + SetSubbandsCmd::SetSubbandsCmd(GCFEvent& event, GCFPortInterface& port, Operation oper) : Command("SetSubbands", port, oper) { @@ -64,42 +88,46 @@ void SetSubbandsCmd::apply(CacheBuffer& cache, bool /*setModFlag*/) Range dst_range; Range src_range; + int nBanks = (MAX_BITS_PER_SAMPLE / cache.getBitsPerSample()); switch (m_event->subbands.getType()) { case SubbandSelection::BEAMLET: { //dst_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS - 1); - dst_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + m_event->subbands().extent(secondDim) - 1); + dst_range = Range(0, m_event->subbands.beamlets().extent(thirdDim) - 1); for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { if (m_event->rcumask[cache_rcu]) { // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different // In other words: getSubbandSelection can contain more data than m_event->subbands - if (MEPHeader::N_BEAMLETS == MAX_BEAMLETS) { - cache.getSubbandSelection()()(cache_rcu, dst_range) = 0; - cache.getSubbandSelection()()(cache_rcu, dst_range) = m_event->subbands()(0, Range::all()) * (int)N_POL + (cache_rcu % N_POL); - } - else { - int nr_subbands = m_event->subbands().extent(secondDim); - for (int rsp = 0; rsp < 4; rsp++) { - int swstart(rsp*MAX_BEAMLETS_PER_RSP); - int hwstart(MEPHeader::N_LOCAL_XLETS + rsp * (MEPHeader::N_BEAMLETS/4)); - int nrSubbands2move(MIN(nr_subbands-swstart, MAX_BEAMLETS_PER_RSP)); - if (nrSubbands2move > 0) { - dst_range = Range(hwstart, hwstart+nrSubbands2move-1); - src_range = Range(swstart, swstart+nrSubbands2move-1); - cache.getSubbandSelection()()(cache_rcu, dst_range) = 0; - cache.getSubbandSelection()()(cache_rcu, dst_range) = m_event->subbands()(0, src_range) * (int)N_POL + (cache_rcu % N_POL); - if (cache_rcu == 0) { - LOG_DEBUG_STR("Setsubbands:move(" << swstart << ".." << swstart+nrSubbands2move << ") to (" - << hwstart << ".." << hwstart+nrSubbands2move << ")"); - } - } // subbands left - } // for each rsp-slice - } // difference in max'en + + int nrSubbands = m_event->subbands.beamlets().extent(thirdDim); + int nrBlocks = MEPHeader::N_SERDES_LANES * nBanks; + for (int block = 0; block < nrBlocks; block++) { + int swbank = block / MEPHeader::N_SERDES_LANES; + int swlane = block % MEPHeader::N_SERDES_LANES; + int hwbank = block % nBanks; + int hwlane = block / nBanks; + int swstart(swlane * maxDataslotsPerRSP(cache.getBitsPerSample())); + int hwstart(hwlane * (MEPHeader::N_BEAMLETS/MEPHeader::N_SERDES_LANES)); + int nrSubbands2move(MIN(nrSubbands-swstart, maxDataslotsPerRSP(cache.getBitsPerSample()))); + if (nrSubbands2move > 0) { + dst_range = Range(hwstart, hwstart+nrSubbands2move-1); + src_range = Range(swstart, swstart+nrSubbands2move-1); + cache.getSubbandSelection().beamlets()(cache_rcu, hwbank, dst_range) = 0; + cache.getSubbandSelection().beamlets()(cache_rcu, hwbank, dst_range) = + m_event->subbands.beamlets()(0, swbank, src_range) * (int)N_POL + (cache_rcu % N_POL); + if (cache_rcu == 0) { + LOG_DEBUG_STR("SS:block=" << block << " move(" << swstart << ".." << swstart+nrSubbands2move << ") to (" + << hwstart << ".." << hwstart+nrSubbands2move << ")" + << " swbank:" << swbank << " swlane:" << swlane + << " hwbank:" << hwbank << " hwlane:" << hwlane); + } + } // subbands left + } // for each block if (cache_rcu == 0) { - LOG_DEBUG_STR("m_event->subbands() = " << m_event->subbands()); - LOG_DEBUG_STR("cache->subbands(0) = " << cache.getSubbandSelection()()(0,Range::all())); + LOG_DEBUG_STR("m_event->subbands.beamlets() = " << m_event->subbands.beamlets()); + LOG_DEBUG_STR("cache->subbands.beamlets(0) = " << cache.getSubbandSelection().beamlets()(0, Range::all(), Range::all())); } } // if rcu selected } // for each rcu @@ -110,10 +138,11 @@ void SetSubbandsCmd::apply(CacheBuffer& cache, bool /*setModFlag*/) dst_range = Range(0, MEPHeader::N_LOCAL_XLETS - 1); for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { if (m_event->rcumask[cache_rcu]) { - cache.getSubbandSelection()()(cache_rcu, dst_range) = 0; - cache.getSubbandSelection()()(cache_rcu, dst_range) = m_event->subbands()(0,0) * N_POL + (cache_rcu % N_POL); - - LOG_DEBUG_STR("m_event->subbands() = " << m_event->subbands()); + for (int bank = 0; bank < nBanks; bank++) { + cache.getSubbandSelection().crosslets()(cache_rcu, bank, dst_range) = 0; + cache.getSubbandSelection().crosslets()(cache_rcu, bank, dst_range) = m_event->subbands.crosslets()(0,0,0) * N_POL + (cache_rcu % N_POL); + } + LOG_DEBUG_STR("m_event->subbands.crosslets() = " << m_event->subbands.crosslets()); } } } @@ -148,30 +177,41 @@ bool SetSubbandsCmd::validate() const switch (m_event->subbands.getType()) { case SubbandSelection::BEAMLET: - if (m_event->subbands().extent(secondDim) <= MEPHeader::N_BEAMLETS) valid = true; + if ( (m_event->subbands.beamlets().extent(thirdDim) <= MEPHeader::N_BEAMLETS) + && (3 == m_event->subbands.beamlets().dimensions()) + && (1 == m_event->subbands.beamlets().extent(firstDim))) { + valid = true; + } break; case SubbandSelection::XLET: - if (1 == m_event->subbands().extent(secondDim)) valid = true; + if ( (1 == m_event->subbands.crosslets().extent(thirdDim)) + && (3 == m_event->subbands.crosslets().dimensions()) + && (1 == m_event->subbands.crosslets().extent(firstDim))) { + valid = true; + } break; default: - LOG_WARN("invalid SubbandSelection type"); + LOG_WARN("invalid SubbandSelection type or dimensions"); break; } // return true when everything is right - if ((m_event->rcumask.count() <= (unsigned int)StationSettings::instance()->nrRcus()) - && (2 == m_event->subbands().dimensions()) - && (1 == m_event->subbands().extent(firstDim)) && valid) { + if ( (m_event->rcumask.count() <= (unsigned int)StationSettings::instance()->nrRcus()) + && valid) { return (true); } // show our validation values. - LOG_DEBUG(formatString("cmd rcumask.count = %d",m_event->rcumask.count())); - LOG_DEBUG(formatString("nr Rcus = %d",StationSettings::instance()->nrRcus())); - LOG_DEBUG(formatString("first dim = %d",m_event->subbands().extent(firstDim))); - LOG_DEBUG(formatString("second dim = %d",m_event->subbands().extent(secondDim))); + LOG_DEBUG(formatString("cmd rcumask.count = %d",m_event->rcumask.count())); + LOG_DEBUG(formatString("nr Rcus = %d",StationSettings::instance()->nrRcus())); + LOG_DEBUG(formatString("first dim crosslets = %d",m_event->subbands.crosslets().extent(firstDim))); + LOG_DEBUG(formatString("second dim crosslets = %d",m_event->subbands.crosslets().extent(secondDim))); + LOG_DEBUG(formatString("thirth dim crosslets = %d",m_event->subbands.crosslets().extent(thirdDim))); + LOG_DEBUG(formatString("first dim beamlets = %d",m_event->subbands.beamlets().extent(firstDim))); + LOG_DEBUG(formatString("second dim beamlets = %d",m_event->subbands.beamlets().extent(secondDim))); + LOG_DEBUG(formatString("thirth dim beamlets = %d",m_event->subbands.beamlets().extent(thirdDim))); return (false); } diff --git a/MAC/APL/PIC/RSP_Driver/src/SetWeightsCmd.cc b/MAC/APL/PIC/RSP_Driver/src/SetWeightsCmd.cc index 46403926c11f83285c20edc1c0f77890d7c2bcfe..86a5466ebc1459df8dc767196b385b86412cef26 100644 --- a/MAC/APL/PIC/RSP_Driver/src/SetWeightsCmd.cc +++ b/MAC/APL/PIC/RSP_Driver/src/SetWeightsCmd.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RTCCommon/PSAccess.h> @@ -56,7 +57,7 @@ void SetWeightsCmd::setWeights(Array<complex<int16>, BeamletWeights::NDIM> weigh { RSPSetweightsEvent* event = static_cast<RSPSetweightsEvent*>(m_event); - event->weights().resize(BeamletWeights::SINGLE_TIMESTEP, event->rcumask.count(), weights.extent(thirdDim)); + event->weights().resize(BeamletWeights::SINGLE_TIMESTEP, event->rcumask.count(), weights.extent(thirdDim) ,weights.extent(fourthDim)); event->weights() = weights; } @@ -73,27 +74,42 @@ void SetWeightsCmd::ack(CacheBuffer& /*cache*/) void SetWeightsCmd::apply(CacheBuffer& cache, bool setModFlag) { int input_rcu = 0; + int nBanks = (MAX_BITS_PER_SAMPLE / cache.getBitsPerSample()); + + Range src_range; + Range dst_range; + for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { if (m_event->rcumask[cache_rcu]) { // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different // In other words: getBeamletWeights can contain more data than ack.weights - if (MEPHeader::N_BEAMLETS == MAX_BEAMLETS) { - cache.getBeamletWeights()()(0, cache_rcu, Range::all()) = m_event->weights()(0, input_rcu, Range::all()); - } - else { - for (int rsp = 0; rsp < 4; rsp++) { - int swstart(rsp*MAX_BEAMLETS_PER_RSP); - int hwstart(rsp*MEPHeader::N_BEAMLETS/4); - cache.getBeamletWeights()()(0, cache_rcu, Range(hwstart, hwstart+MAX_BEAMLETS_PER_RSP-1)) = - m_event->weights()(0, input_rcu, Range(swstart,swstart+MAX_BEAMLETS_PER_RSP-1)); - } - } + int nrBlocks = MEPHeader::N_SERDES_LANES * nBanks; + int dataslotsPerRSP = maxDataslotsPerRSP(cache.getBitsPerSample()); + for (int block = 0; block < nrBlocks; block++) { + int swbank = block / MEPHeader::N_SERDES_LANES; + int swlane = block % MEPHeader::N_SERDES_LANES; + int hwbank = block % nBanks; + int hwlane = block / nBanks; + int swstart(swlane * dataslotsPerRSP); + int hwstart(hwlane * (MEPHeader::N_BEAMLETS/MEPHeader::N_SERDES_LANES)); + dst_range = Range(hwstart, hwstart+dataslotsPerRSP-1); + src_range = Range(swstart, swstart+dataslotsPerRSP-1); + for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { + cache.getBeamletWeights()()(0, cache_rcu, hwbank, dst_range) = + m_event->weights()(0, input_rcu, swbank, src_range); + if (lane == 0) { + LOG_DEBUG_STR("BF:block=" << block << " move(" << src_range << ") to (" << dst_range << ")" + << " swbank=" << swbank << " swlane=" << swlane + << " hwbank=" << hwbank << " hwlane=" << hwlane); + } + } // lanes + } // blocks if (setModFlag) { cache.getCache().getState().bf().write(cache_rcu * MEPHeader::N_PHASE); cache.getCache().getState().bf().write(cache_rcu * MEPHeader::N_PHASE + 1); if (cache_rcu == 0) { - LOG_DEBUG_STR("SetWeights(cache[0]): " << cache.getBeamletWeights()()(0,0,Range::all())); + LOG_DEBUG_STR("SetWeights(cache[0]): " << cache.getBeamletWeights()()(0,0,Range::all(),Range::all())); } } diff --git a/MAC/APL/PIC/RSP_Driver/src/SyncAction.h b/MAC/APL/PIC/RSP_Driver/src/SyncAction.h index 5be5271ae2d7e2ffa1752db05a08c8662c900e4c..c8f97d8c4ba48ce4a8c1bdc7ae7faa7f3035fbe7 100644 --- a/MAC/APL/PIC/RSP_Driver/src/SyncAction.h +++ b/MAC/APL/PIC/RSP_Driver/src/SyncAction.h @@ -86,9 +86,10 @@ namespace LOFAR { /*@}*/ /** - * Get index of current local index + * Set/Get index of current local index */ int getCurrentIndex() const { return m_current_index; } + void setNumIndices(int n_indices) { m_n_indices = n_indices; } int getNumIndices() const { return m_n_indices; } /** diff --git a/MAC/APL/PIC/RSP_Driver/src/UpdBitModeCmd.cc b/MAC/APL/PIC/RSP_Driver/src/UpdBitModeCmd.cc new file mode 100644 index 0000000000000000000000000000000000000000..ce7ba2295efebadc9303465e17385c2f39c165d8 --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/UpdBitModeCmd.cc @@ -0,0 +1,107 @@ +//# UpdBitModeCmd.cc: implementation of the UpdBitModeCmd class +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: UpdBitModeCmd.cc 13440 2009-06-22 13:26:54Z overeem $ + +#include <lofar_config.h> +#include <Common/LofarLogger.h> + +#include <APL/RSP_Protocol/RSP_Protocol.ph> +#include <APL/RTCCommon/PSAccess.h> +#include <blitz/array.h> + +#include "StationSettings.h" +#include "UpdBitModeCmd.h" + +using namespace blitz; +using namespace LOFAR; +using namespace RSP; +using namespace RSP_Protocol; +using namespace RTC; + +UpdBitModeCmd::UpdBitModeCmd(GCFEvent& event, GCFPortInterface& port, Operation oper) : + Command("SubBitMode", port, oper), + itsEvent(0), + itsCurrentBitsPerSample(0) +{ + itsEvent = new RSPSubbitmodeEvent(event); + + setPeriod(itsEvent->period); +} + +UpdBitModeCmd::~UpdBitModeCmd() +{ + delete itsEvent; +} + +void UpdBitModeCmd::ack(CacheBuffer& /*cache*/) +{ + // intentionally left empty +} + +void UpdBitModeCmd::apply(CacheBuffer& /*cache*/, bool /*setModFlag*/) +{ + // no-op +} + +void UpdBitModeCmd::complete(CacheBuffer& cache) +{ + if (cache.getBitsPerSample() != itsCurrentBitsPerSample) { + + RSPUpdbitmodeEvent ack; + + ack.timestamp = getTimestamp(); + ack.status = RSP_SUCCESS; + ack.handle = (memptr_t)this; // opaque pointer used to refer to the subscription + + for (int i = 0; i < StationSettings::instance()->nrRspBoards(); ++i) { + ack.bitmode_version[i] = cache.getBitModeInfo()()(i).bm_max; + + uint8 select = cache.getBitModeInfo()()(i).bm_select; + if (select == 0) { + ack.bits_per_sample[i] = 16; + } + else if (select == 1) { + ack.bits_per_sample[i] = 8; + } + else if (select == 2) { + ack.bits_per_sample[i] = 4; + } + } + getPort()->send(ack); + } + + itsCurrentBitsPerSample = cache.getBitsPerSample(); +} + +const Timestamp& UpdBitModeCmd::getTimestamp() const +{ + return itsEvent->timestamp; +} + +void UpdBitModeCmd::setTimestamp(const Timestamp& timestamp) +{ + itsEvent->timestamp = timestamp; +} + +bool UpdBitModeCmd::validate() const +{ + return (true); +} diff --git a/MAC/APL/PIC/RSP_Driver/src/UpdBitModeCmd.h b/MAC/APL/PIC/RSP_Driver/src/UpdBitModeCmd.h new file mode 100644 index 0000000000000000000000000000000000000000..99ef4331301e93610699399e079207ec6450ef62 --- /dev/null +++ b/MAC/APL/PIC/RSP_Driver/src/UpdBitModeCmd.h @@ -0,0 +1,88 @@ +//# -*- mode: c++ -*- +//# +//# UpdBitModeCmd.h: +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: UpdBitModeCmd.h 9379 2006-10-04 15:00:52Z donker $ + +#ifndef UPDBITMODECMD_H_ +#define UPDBITMODECMD_H_ + +#include "Command.h" +#include <APL/RSP_Protocol/RSP_Protocol.ph> + +#include <Common/LofarTypes.h> +#include <GCF/TM/GCF_Control.h> + +namespace LOFAR { + namespace RSP { + + class UpdBitModeCmd : public Command + { + public: + /** + * Constructors for a UpdBitModeCmd object. + */ + UpdBitModeCmd(GCFEvent& event, GCFPortInterface& port, Operation oper); + + /* Destructor for UpdBitModeCmd. */ + virtual ~UpdBitModeCmd(); + + /** + * Acknowledge the command by sending the appropriate + * response on m_port. + */ + virtual void ack(CacheBuffer& cache); + + /** + * Make necessary changes to the cache for the next synchronization. + * Any changes will be sent to the RSP boards. + */ + virtual void apply(CacheBuffer& cache, bool setModFlag = true); + + /** + * Complete the command by sending the appropriate response on + * the m_answerport; + */ + virtual void complete(CacheBuffer& cache); + + /*@{*/ + /** + * get timestamp of the event + */ + virtual const RTC::Timestamp& getTimestamp() const; + virtual void setTimestamp(const RTC::Timestamp& timestamp); + /*@}*/ + + /** + * Range check the parameters of the event. + */ + virtual bool validate() const; + + private: + UpdBitModeCmd(); + + RSPSubbitmodeEvent* itsEvent; + uint16 itsCurrentBitsPerSample; + }; + }; +}; + +#endif /* UPDBITMODECMD_H_ */ diff --git a/MAC/APL/PIC/RSP_Driver/src/UpdStatsCmd.cc b/MAC/APL/PIC/RSP_Driver/src/UpdStatsCmd.cc index 6794cb55d4882f7922479ae5287d1c651cb33aa5..a4043280e498e02f484b4e78fe2e8e2ad9afcc1e 100644 --- a/MAC/APL/PIC/RSP_Driver/src/UpdStatsCmd.cc +++ b/MAC/APL/PIC/RSP_Driver/src/UpdStatsCmd.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RTCCommon/PSAccess.h> @@ -40,8 +41,12 @@ UpdStatsCmd::UpdStatsCmd(GCFEvent& event, GCFPortInterface& port, Operation oper Command("SubStats", port, oper) { m_event = new RSPSubstatsEvent(event); - m_n_devices = ((m_event->type <= Statistics::SUBBAND_POWER) ? NR_BLPS_PER_RSPBOARD : 1) - * StationSettings::instance()->nrRspBoards() * N_POL; + if (m_event->type == Statistics::SUBBAND_POWER) { + m_n_devices = NR_BLPS_PER_RSPBOARD * StationSettings::instance()->nrRspBoards() * N_POL; + } + else { + m_n_devices = 2 * N_POL; + } setPeriod(m_event->period); } @@ -74,12 +79,14 @@ void UpdStatsCmd::complete(CacheBuffer& cache) ack.stats().resize(m_event->rcumask.count(), cache.getSubbandStats()().extent(secondDim)); } else { - ack.stats().resize(m_event->rcumask.count(), MAX_BEAMLETS); + ack.stats().resize(m_event->rcumask.count(), maxBeamlets(cache.getBitsPerSample())); } - + + int activePlanes = (MAX_BITS_PER_SAMPLE / cache.getBitsPerSample()); + unsigned int result_device = 0; for (unsigned int cache_device = 0; cache_device < m_n_devices; cache_device++) { - if (m_event->rcumask[cache_device]) { + if (m_event->rcumask.test(cache_device)) { switch (m_event->type) { case Statistics::SUBBAND_POWER: ack.stats()(result_device, Range::all()) = cache.getSubbandStats()()(cache_device, Range::all()); @@ -88,22 +95,26 @@ void UpdStatsCmd::complete(CacheBuffer& cache) case Statistics::BEAMLET_POWER: // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different // In other words: getBeamletWeights can contain more data than ack.weights - if (MEPHeader::N_BEAMLETS == MAX_BEAMLETS) { + if (MEPHeader::N_BEAMLETS == maxBeamlets(cache.getBitsPerSample())) { ack.stats()(result_device, Range::all()) = cache.getBeamletStats()()(cache_device, Range::all()); } else { - for (int rsp = 0; rsp < 4; rsp++) { - int swstart(rsp*MAX_BEAMLETS_PER_RSP); - int hwstart(rsp*MEPHeader::N_BEAMLETS/4); - ack.stats()(result_device, Range(swstart,swstart+MAX_BEAMLETS_PER_RSP-1)) = - cache.getBeamletStats()()(cache_device, Range(hwstart, hwstart+MAX_BEAMLETS_PER_RSP-1)); - if (cache_device == 0) { - LOG_DEBUG_STR("Getstats:move(" << hwstart << ".." << hwstart+MAX_BEAMLETS_PER_RSP << ") to (" - << swstart << ".." << swstart+MAX_BEAMLETS_PER_RSP << ")"); - } - } + for (int lane = 0; lane < MEPHeader::N_SERDES_LANES; lane++) { + for (int plane = 0; plane < activePlanes; plane++) { + int swstart((lane*maxBeamletsPerRSP(cache.getBitsPerSample())) + (plane*maxDataslotsPerRSP(cache.getBitsPerSample()))); + int hwstart((lane*MEPHeader::N_BEAMLETS) + (plane*MEPHeader::N_BEAMLETS/4)); + ack.stats()(result_device, Range(swstart,swstart+maxDataslotsPerRSP(cache.getBitsPerSample())-1)) = + cache.getBeamletStats()()(cache_device, Range(hwstart, hwstart+maxDataslotsPerRSP(cache.getBitsPerSample())-1)); + if (cache_device == 0) { + LOG_DEBUG_STR("Getstats:move(" << hwstart << ".." << hwstart+maxDataslotsPerRSP(cache.getBitsPerSample())-1 << ") to (" + << swstart << ".." << swstart+maxDataslotsPerRSP(cache.getBitsPerSample())-1 << ")"); + } + } + } + } + if (cache_device == 0) { + LOG_DEBUG_STR("GetStats(cache[0]): " << cache.getBeamletStats()()(0,Range::all())); } - LOG_DEBUG_STR("GetStats(cache[0]): " << cache.getBeamletStats()()(0,Range::all())); break; diff --git a/MAC/APL/PIC/RSP_Driver/src/UpdSubbandsCmd.cc b/MAC/APL/PIC/RSP_Driver/src/UpdSubbandsCmd.cc index 0604f6f51c03972e9676d9c98323a9d72246e832..712b455b5b692bcf1ff96d45a4ab70957967c796 100644 --- a/MAC/APL/PIC/RSP_Driver/src/UpdSubbandsCmd.cc +++ b/MAC/APL/PIC/RSP_Driver/src/UpdSubbandsCmd.cc @@ -22,6 +22,7 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RTCCommon/PSAccess.h> @@ -89,15 +90,70 @@ void UpdSubbandsCmd::complete(CacheBuffer& cache) // Note: XLETS are allocated at the first 8 registers in the subbands // area. The beamlets are located behind it. Range src_range; + int result_rcu; + int nPlanes = (MAX_BITS_PER_SAMPLE / cache.getBitsPerSample()); + switch (m_event->type) { case SubbandSelection::BEAMLET: - ack.subbands().resize(m_event->rcumask.count(), MAX_BEAMLETS); - src_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + MAX_BEAMLETS - 1); + ack.subbands.crosslets().resize(1,1); + ack.subbands.crosslets() = 0; + ack.subbands.setType(SubbandSelection::BEAMLET); + ack.subbands.beamlets().resize(m_event->rcumask.count(), LOFAR::maxBeamlets(cache.getBitsPerSample())); + src_range = Range(0, LOFAR::maxBeamlets(cache.getBitsPerSample()) - 1); + // loop over RCU's to get the results. + result_rcu = 0; + for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { + if (m_event->rcumask[cache_rcu]) { + // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different + // In other words: getSubbandSelection can contain more data than ack.weights + if (MEPHeader::N_BEAMLETS == LOFAR::maxBeamlets(cache.getBitsPerSample())) { + ack.subbands.beamlets()(result_rcu, 0, Range::all()) = cache.getSubbandSelection().beamlets()(cache_rcu, 0, src_range); + } + else { + for (int plane = 0; plane < nPlanes; plane++) { + for (int rsp = 0; rsp < MEPHeader::N_SERDES_LANES; rsp++) { + int swstart(rsp * LOFAR::maxDataslotsPerRSP(cache.getBitsPerSample())); + int hwstart(rsp * (MEPHeader::N_BEAMLETS/MEPHeader::N_SERDES_LANES)); + ack.subbands.beamlets()(result_rcu, plane, Range(swstart,swstart+LOFAR::maxDataslotsPerRSP(cache.getBitsPerSample())-1)) = + cache.getSubbandSelection().beamlets()(cache_rcu, plane, Range(hwstart, hwstart+LOFAR::maxDataslotsPerRSP(cache.getBitsPerSample())-1)); + if (cache_rcu == 0) { + LOG_DEBUG_STR("UpdSubbands:beamlet:move(" << hwstart << ".." << hwstart+LOFAR::maxDataslotsPerRSP(cache.getBitsPerSample()) << ") to (" + << swstart << ".." << swstart+LOFAR::maxDataslotsPerRSP(cache.getBitsPerSample()) << ")"); + } + } + } + } + result_rcu++; + + if (cache_rcu == 0) { + LOG_DEBUG_STR("m_event->subbands.beamlets() = " << ack.subbands.beamlets()); + LOG_DEBUG_STR("cache->subbands().beamlets() = " << cache.getSubbandSelection().beamlets()); + } + } + } break; case SubbandSelection::XLET: - ack.subbands().resize(m_event->rcumask.count(), MEPHeader::N_LOCAL_XLETS); + ack.subbands.beamlets().resize(1,1); + ack.subbands.beamlets() = 0; + ack.subbands.setType(SubbandSelection::XLET); + ack.subbands.crosslets().resize(m_event->rcumask.count(), MEPHeader::N_LOCAL_XLETS); src_range = Range(0, MEPHeader::N_LOCAL_XLETS - 1); + // loop over RCU's to get the results. + result_rcu = 0; + for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { + if (m_event->rcumask[cache_rcu]) { + if (m_event->type == SubbandSelection::XLET) { + ack.subbands.crosslets()(result_rcu, Range::all()) = cache.getSubbandSelection().crosslets()(cache_rcu, src_range); + } + result_rcu++; + + if (cache_rcu == 0) { + LOG_DEBUG_STR("m_event->subbands.crosslets() = " << ack.subbands.crosslets()); + LOG_DEBUG_STR("cache->subbands().crosslets() = " << cache.getSubbandSelection().crosslets()); + } + } + } break; default: @@ -105,7 +161,7 @@ void UpdSubbandsCmd::complete(CacheBuffer& cache) exit(EXIT_FAILURE); break; } - +/* // loop over RCU's to get the results. int result_rcu = 0; for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { @@ -113,18 +169,18 @@ void UpdSubbandsCmd::complete(CacheBuffer& cache) if (m_event->rcumask[cache_rcu]) { // NOTE: MEPHeader::N_BEAMLETS = 4x62 but userside MAX_BEAMLETS may be different // In other words: getSubbandSelection can contain more data than ack.weights - if (MEPHeader::N_BEAMLETS == MAX_BEAMLETS || m_event->type == SubbandSelection::XLET) { + if (MEPHeader::N_BEAMLETS == LOFAR::maxBeamlets(cache.getBitsPerSample()) || m_event->type == SubbandSelection::XLET) { ack.subbands()(result_rcu, Range::all()) = cache.getSubbandSelection()()(cache_rcu, src_range); } else { for (int rsp = 0; rsp < 4; rsp++) { - int swstart(rsp*MAX_BEAMLETS_PER_RSP); + int swstart(rsp*LOFAR::maxBeamletsPerRSP(cache.getBitsPerSample())); int hwstart(MEPHeader::N_LOCAL_XLETS + rsp * (MEPHeader::N_BEAMLETS/4)); - ack.subbands()(result_rcu, Range(swstart,swstart+MAX_BEAMLETS_PER_RSP-1)) = - cache.getSubbandSelection()()(cache_rcu, Range(hwstart, hwstart+MAX_BEAMLETS_PER_RSP-1)); + ack.subbands()(result_rcu, Range(swstart,swstart+LOFAR::maxBeamletsPerRSP(cache.getBitsPerSample())-1)) = + cache.getSubbandSelection()()(cache_rcu, Range(hwstart, hwstart+LOFAR::maxBeamletsPerRSP(cache.getBitsPerSample())-1)); if (cache_rcu == 0) { - LOG_DEBUG_STR("UpdSubbands:move(" << hwstart << ".." << hwstart+MAX_BEAMLETS_PER_RSP << ") to (" - << swstart << ".." << swstart+MAX_BEAMLETS_PER_RSP << ")"); + LOG_DEBUG_STR("UpdSubbands:move(" << hwstart << ".." << hwstart+LOFAR::maxBeamletsPerRSP(cache.getBitsPerSample()) << ") to (" + << swstart << ".." << swstart+LOFAR::maxBeamletsPerRSP(cache.getBitsPerSample()) << ")"); } } } @@ -136,7 +192,7 @@ void UpdSubbandsCmd::complete(CacheBuffer& cache) } } } - +*/ // Finally send the answer getPort()->send(ack); } diff --git a/MAC/APL/PIC/RSP_Driver/src/XWWrite.cc b/MAC/APL/PIC/RSP_Driver/src/XWWrite.cc index 1c400f0917afa594bec5af03374f6c3d6b4c7d7e..020885f58f0d0b00294b21fd22be837fdfa5b6ae 100644 --- a/MAC/APL/PIC/RSP_Driver/src/XWWrite.cc +++ b/MAC/APL/PIC/RSP_Driver/src/XWWrite.cc @@ -44,8 +44,8 @@ using namespace RSP; using namespace EPA_Protocol; XWWrite::XWWrite(GCFPortInterface& board_port, int board_id, int blp, int regid) - : SyncAction(board_port, board_id, 1), - m_blp(blp), m_regid(regid), m_remaining(0), m_offset(0) + : SyncAction(board_port, board_id, (MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE)), + m_blp(blp), m_regid(regid), itsPlane(0), m_remaining(0), m_offset(0) { memset(&m_hdr, 0, sizeof(MEPHeader)); } @@ -56,7 +56,14 @@ XWWrite::~XWWrite() void XWWrite::sendrequest() { + int activePlanes = (MAX_BITS_PER_SAMPLE / Cache::getInstance().getBack().getBitsPerSample()); + if (getCurrentIndex() >= activePlanes) { + setContinue(true); + return; + } + uint8 global_blp = (getBoardId() * NR_BLPS_PER_RSPBOARD) + m_blp; + itsPlane = getCurrentIndex(); if (m_regid < MEPHeader::BF_XROUT || m_regid > MEPHeader::BF_YIOUT) { @@ -76,20 +83,36 @@ void XWWrite::sendrequest() switch (m_regid) { case MEPHeader::BF_XROUT: - bfcoefs.hdr.set(MEPHeader::BF_XROUT_HDR, 1 << m_blp, - MEPHeader::WRITE, size, m_offset); + bfcoefs.hdr.set( MEPHeader::WRITE, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_XROUT+(itsPlane*4), + size, + m_offset); break; case MEPHeader::BF_XIOUT: - bfcoefs.hdr.set(MEPHeader::BF_XIOUT_HDR, 1 << m_blp, - MEPHeader::WRITE, size, m_offset); + bfcoefs.hdr.set( MEPHeader::WRITE, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_XIOUT+(itsPlane*4), + size, + m_offset); break; case MEPHeader::BF_YROUT: - bfcoefs.hdr.set(MEPHeader::BF_YROUT_HDR, 1 << m_blp, - MEPHeader::WRITE, size, m_offset); + bfcoefs.hdr.set( MEPHeader::WRITE, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_YROUT+(itsPlane*4), + size, + m_offset); break; case MEPHeader::BF_YIOUT: - bfcoefs.hdr.set(MEPHeader::BF_YIOUT_HDR, 1 << m_blp, - MEPHeader::WRITE, size, m_offset); + bfcoefs.hdr.set( MEPHeader::WRITE, + 1 << m_blp, + MEPHeader::BF, + MEPHeader::BF_YIOUT+(itsPlane*4), + size, + m_offset); break; } diff --git a/MAC/APL/PIC/RSP_Driver/src/XWWrite.h b/MAC/APL/PIC/RSP_Driver/src/XWWrite.h index 51c657a49f34e8c955c652c8c891be5e65014a1b..605b96a277202e069e1f27f18762a3782eb93034 100644 --- a/MAC/APL/PIC/RSP_Driver/src/XWWrite.h +++ b/MAC/APL/PIC/RSP_Driver/src/XWWrite.h @@ -61,6 +61,7 @@ namespace LOFAR { private: int m_blp; int m_regid; + int itsPlane; size_t m_remaining; // how much to write size_t m_offset; // where to write diff --git a/MAC/APL/PIC/RSP_Driver/src/rspctl.cc b/MAC/APL/PIC/RSP_Driver/src/rspctl.cc index a03a0698706bb5bb8eaa0fecb3009a3e17d86173..f4e3f512853c982043bee64b7dd2368015f3b0fb 100644 --- a/MAC/APL/PIC/RSP_Driver/src/rspctl.cc +++ b/MAC/APL/PIC/RSP_Driver/src/rspctl.cc @@ -104,9 +104,11 @@ do { \ #define DEFAULT_SAMPLE_FREQUENCY 160.0e6 double gSampleFrequency = DEFAULT_SAMPLE_FREQUENCY; bool g_getclock = false; -bool gSplitterOn = false; +bool gSplitterOn = false; bool gHasSplitter = false; bool gClockChanged = false; +bool gBitmodeChanged = false; +bool gSplitterChanged = false; #define PAIR 2 @@ -167,8 +169,11 @@ inline double blitz_angle(complex<double> val) return atan(val.imag() / val.real()) * 180.0 / M_PI; } -WeightsCommand::WeightsCommand(GCFPortInterface& port) : Command(port), m_type(WeightsCommand::COMPLEX), - itsStage(0) +WeightsCommand::WeightsCommand(GCFPortInterface& port, const int bitsPerSample) : + Command (port), + m_type (WeightsCommand::COMPLEX), + itsStage (0), + itsBitsPerSample(bitsPerSample) { } @@ -194,28 +199,33 @@ void WeightsCommand::send() RSPSetweightsEvent setweights; setweights.timestamp = Timestamp(0,0); setweights.rcumask = getRCUMask(); - logMessage(cerr,formatString("rcumask.count()=%d",setweights.rcumask.count())); - setweights.weights().resize(1, setweights.rcumask.count(), MAX_BEAMLETS); + + int nBanks = (MAX_BITS_PER_SAMPLE / itsBitsPerSample); + setweights.weights().resize(1, setweights.rcumask.count(), nBanks, maxBeamletsPerBank(itsBitsPerSample)); - bitset<MAX_BEAMLETS> beamlet_mask = getBEAMLETSMask(); + //bitset<maxBeamlets(bitsPerSample)> beamlet_mask = getBEAMLETSMask(); + boost::dynamic_bitset<> beamlet_mask = getBEAMLETSMask(itsBitsPerSample); // -1 < m_value <= 1 complex<double> value = m_value; value *= (1<<14); // -.99999 should become -16383 and 1 should become 16384 setweights.weights() = itsWeights; int rcunr = 0; + int max_beamlets = maxBeamlets(itsBitsPerSample); for (int rcu = 0; rcu < MAX_RCUS; rcu++) { if (setweights.rcumask.test(rcu)) { - for (int beamlet = 0; beamlet < MAX_BEAMLETS; beamlet++) { + for (int beamlet = 0; beamlet < max_beamlets; beamlet++) { if (beamlet_mask.test(beamlet)) { - setweights.weights()(0,rcunr,beamlet) = complex<int16>((int16)value.real(), (int16)value.imag()); // complex<int16>((int16)value,0); + int plane = beamlet / maxBeamletsPerBank(itsBitsPerSample); + int beamletnr = beamlet % maxBeamletsPerBank(itsBitsPerSample); + setweights.weights()(0,rcunr,plane,beamletnr) = complex<int16>((int16)value.real(), (int16)value.imag()); + //setweights.weights()(0,rcunr,plane,beamletnr) = complex<int16>(10+plane, beamletnr); // for testing } - } + } // beamlet rcunr++; } - - } + } // rcu m_rspport.send(setweights); } break; @@ -232,7 +242,8 @@ GCFEvent::TResult WeightsCommand::ack(GCFEvent& e) case RSP_GETWEIGHTSACK: { RSPGetweightsackEvent ack(e); bitset<MAX_RCUS> mask = getRCUMask(); - itsWeights.resize(1, mask.count(), MAX_BEAMLETS); + int nPlanes = (MAX_BITS_PER_SAMPLE / itsBitsPerSample); + itsWeights.resize(1, mask.count(), nPlanes, maxBeamletsPerBank(itsBitsPerSample)); itsWeights = complex<int16>(0,0); itsWeights = ack.weights(); @@ -249,12 +260,12 @@ GCFEvent::TResult WeightsCommand::ack(GCFEvent& e) for (int rcuout = 0; rcuout < get_ndevices(); rcuout++) { if (mask[rcuout]) { std::ostringstream logStream; - logStream << ack.weights()(0, rcuin++, Range::all()); + logStream << ack.weights()(0, rcuin++, Range::all(), Range::all()); logMessage(cout,formatString("RCU[%2d].weights=%s", rcuout,logStream.str().c_str())); } } } else { - blitz::Array<complex<double>, 3> ackweights; + blitz::Array<complex<double>, 4> ackweights; ackweights.resize(ack.weights().shape()); // convert to amplitude and angle @@ -264,7 +275,7 @@ GCFEvent::TResult WeightsCommand::ack(GCFEvent& e) for (int rcuout = 0; rcuout < get_ndevices(); rcuout++) { if (mask[rcuout]) { std::ostringstream logStream; - logStream << ackweights(0, rcuin++, Range::all()); + logStream << ackweights(0, rcuin++, Range::all(), Range::all()); logMessage(cout,formatString("RCU[%2d].weights=%s", rcuout,logStream.str().c_str())); } } @@ -299,7 +310,10 @@ GCFEvent::TResult WeightsCommand::ack(GCFEvent& e) } -SubbandsCommand::SubbandsCommand(GCFPortInterface& port) : Command(port), m_type(0) +SubbandsCommand::SubbandsCommand(GCFPortInterface& port, const int bitsPerSample) : + Command (port), + m_type (0), + itsBitsPerSample(bitsPerSample) { } @@ -323,40 +337,49 @@ void SubbandsCommand::send() setsubbands.rcumask = getRCUMask(); setsubbands.subbands.setType(m_type); - logMessage(cerr,formatString("rcumask.count()=%d",setsubbands.rcumask.count())); - + logMessage(cerr,formatString("rcumask.count()=%d",setsubbands.rcumask.count())); + + if (m_subbandlist.size() > maxBeamlets(itsBitsPerSample)) { + logMessage(cerr,"Error: too many subbands selected"); + exit(EXIT_FAILURE); + } + + int nPlanes = (MAX_BITS_PER_SAMPLE / itsBitsPerSample); + // if only 1 subband selected, apply selection to all switch (m_type) { - - case SubbandSelection::BEAMLET: - { - if (1 == m_subbandlist.size()) { - setsubbands.subbands().resize(1, MAX_BEAMLETS); - std::list<int>::iterator it = m_subbandlist.begin(); - setsubbands.subbands() = (*it); - } else { - setsubbands.subbands().resize(1, m_subbandlist.size()); - - int i = 0; - std::list<int>::iterator it; - for (it = m_subbandlist.begin(); it != m_subbandlist.end(); it++, i++) - { - if (i >= MAX_BEAMLETS) break; - setsubbands.subbands()(0, i) = (*it); - } + case SubbandSelection::BEAMLET: { + if (1 == m_subbandlist.size()) { + setsubbands.subbands.beamlets().resize(1, nPlanes, maxBeamletsPerBank(itsBitsPerSample)); + std::list<int>::iterator it = m_subbandlist.begin(); + setsubbands.subbands.beamlets() = (*it); + } else { + setsubbands.subbands.beamlets().resize(1, nPlanes, maxBeamletsPerBank(itsBitsPerSample)); + setsubbands.subbands.beamlets() = 0; + int i = 0; + int max_beamlets = maxBeamlets(itsBitsPerSample); + std::list<int>::iterator it; + for (it = m_subbandlist.begin(); it != m_subbandlist.end(); it++, i++) { + if (i >= max_beamlets) { + break; + } + int plane = i / maxBeamletsPerBank(itsBitsPerSample); + int subbandnr = i % maxBeamletsPerBank(itsBitsPerSample); + setsubbands.subbands.beamlets()(0, plane, subbandnr) = (*it); + } #if 0 - for (; i < MAX_BEAMLETS; i++) { - setsubbands.subbands()(0, i) = 0; + for (; i < maxBeamlets(bitsPerSample); i++) { + setsubbands.subbands.beamlets()(0, Range::all(), i) = 0; } #endif - } + } } break; - case SubbandSelection::XLET: { - setsubbands.subbands().resize(1,1); - std::list<int>::iterator it = m_subbandlist.begin(); - setsubbands.subbands() = (*it); + case SubbandSelection::XLET: { + setsubbands.subbands.crosslets().resize(1, 1, 1); + std::list<int>::iterator it = m_subbandlist.begin(); + setsubbands.subbands.crosslets() = (*it); } break; @@ -386,15 +409,15 @@ GCFEvent::TResult SubbandsCommand::ack(GCFEvent& e) if (RSP_SUCCESS == ack.status) { int rcuin = 0; for (int rcuout = 0; rcuout < get_ndevices(); rcuout++) { - if (mask[rcuout]) { std::ostringstream logStream; - logStream << ack.subbands()(rcuin++, Range::all()); - if (SubbandSelection::BEAMLET == m_type) { - logMessage(cout,formatString("RCU[%2d].subbands=%s", rcuout,logStream.str().c_str())); - } else { - logMessage(cout,formatString("RCU[%2d].xcsubbands=%s", rcuout,logStream.str().c_str())); - } + if (SubbandSelection::BEAMLET == m_type) { + logStream << ack.subbands.beamlets()(rcuin++, Range::all(), Range::all()); + logMessage(cout,formatString("RCU[%2d].subbands=%s", rcuout,logStream.str().c_str())); + } else { + logStream << ack.subbands.crosslets()(rcuin++, Range::all(), Range::all()); + logMessage(cout,formatString("RCU[%2d].xcsubbands=%s", rcuout,logStream.str().c_str())); + } } } } @@ -504,7 +527,6 @@ GCFEvent::TResult RCUCommand::ack(GCFEvent& e) // Swap X Y on RCU - SWAPXYCommand::SWAPXYCommand(GCFPortInterface& port) : Command(port) { } @@ -589,6 +611,93 @@ GCFEvent::TResult SWAPXYCommand::ack(GCFEvent& e) return status; } +// Swap X Y on RCU +BitmodeCommand::BitmodeCommand(GCFPortInterface& port) : Command(port) +{ +} + +void BitmodeCommand::send() +{ + if (getMode()) { + // GET + RSPGetbitmodeEvent getbitmode; + getbitmode.timestamp = Timestamp(0,0); + getbitmode.cache = true; + + m_rspport.send(getbitmode); + } + else { + // SET + RSPSetbitmodeEvent setbitmode; + setbitmode.timestamp = Timestamp(0,0); + setbitmode.rspmask = getRSPMask(); + setbitmode.bits_per_sample = bitmode(); + m_rspport.send(setbitmode); + } +} + +GCFEvent::TResult BitmodeCommand::ack(GCFEvent& e) +{ + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch (e.signal) { + case RSP_GETBITMODEACK: { + RSPGetbitmodeackEvent ack(e); + + std::ostringstream msg; + msg << "setbitmodeack.timestamp=" << ack.timestamp; + logMessage(cout, msg.str()); + msg.seekp(0); + + if (ack.status != RSP_SUCCESS) { + logMessage(cerr, "Error: RSP_GETBitMode command failed."); + break; + } + + // print bitmode settings + cout << "board :version :mode\n"; + for (int rsp = 0; rsp < get_ndevices(); rsp++) { + if (getRSPMask().test(rsp)) { + switch (ack.bitmode_version[rsp]) { + case 0: + cout << formatString("RSP[%02u]: 16 : %2d\n", rsp, ack.bits_per_sample[rsp]); + break; + case 1: + cout << formatString("RSP[%02u]: 16/8 : %2d\n", rsp, ack.bits_per_sample[rsp]); + break; + case 2: + cout << formatString("RSP[%02u]: 16/8/4 : %2d\n", rsp, ack.bits_per_sample[rsp]); + break; + default: break; + } + } + } + } + break; + + case RSP_SETBITMODEACK: { + RSPSetbitmodeackEvent ack(e); + + std::ostringstream msg; + msg << "setbitmodeack.timestamp=" << ack.timestamp; + logMessage(cout, msg.str()); + + if (RSP_SUCCESS != ack.status) { + logMessage(cerr, "Error: RSP_SETBitMode command failed."); + } + } + break; + + default: + status = GCFEvent::NOT_HANDLED; + break; + } + + GCFScheduler::instance()->stop(); + + return status; +} + HBACommand::HBACommand(GCFPortInterface& port) : Command(port) { @@ -1917,9 +2026,10 @@ StatisticsBaseCommand::StatisticsBaseCommand(GCFPortInterface& port) : Command(p { } -StatisticsCommand::StatisticsCommand(GCFPortInterface& port) : StatisticsBaseCommand(port), - m_type(Statistics::SUBBAND_POWER), - m_stats() +StatisticsCommand::StatisticsCommand(GCFPortInterface& port, const int bitsPerSample) : StatisticsBaseCommand(port), + m_type (Statistics::SUBBAND_POWER), + m_stats (), + itsBitsPerSample(bitsPerSample) { } @@ -1963,7 +2073,15 @@ void StatisticsCommand::stop() void StatisticsCommand::capture_statistics(Array<double, 2>& stats, const Timestamp& timestamp) { - if (0 == m_nseconds) { + if (sum(m_stats.shape()) != sum(stats.shape())) { + gBitmodeChanged = true; + } + + if (gBitmodeChanged) { // force start at new cycle + m_nseconds = 0; + } + + if (m_nseconds == 0) { // initialize values array m_stats.resize(stats.shape()); m_stats = 0.0; @@ -1988,8 +2106,9 @@ void StatisticsCommand::capture_statistics(Array<double, 2>& stats, const Timest } LOG_DEBUG_STR("statistics update at " << timestamp); - - if(m_duration == 0) { + + if (m_duration == 0) { + //cout << m_stats << endl; plot_statistics(m_stats, timestamp); } else { @@ -2013,10 +2132,9 @@ void StatisticsCommand::plot_statistics(Array<double, 2>& stats, const Timestamp static gnuplot_ctrl* handle = 0; static gnuplot_ctrl* handle2 = 0; - int n_freqbands = stats.extent(secondDim); + int x_range = stats.extent(secondDim); int n_firstIndex = stats.extent(firstDim); bitset<MAX_RCUS> mask = getRCUMask(); - char plotcmd[256]; int startrcu; int stoprcu; @@ -2035,7 +2153,7 @@ void StatisticsCommand::plot_statistics(Array<double, 2>& stats, const Timestamp gClockChanged = false; } #endif - + if (!handle) { handle = gnuplot_init(); if (!handle) return; @@ -2051,7 +2169,7 @@ void StatisticsCommand::plot_statistics(Array<double, 2>& stats, const Timestamp break; case Statistics::BEAMLET_POWER: gnuplot_cmd(handle, "set xlabel \"Beamlet index\"\n"); - gnuplot_cmd(handle, "set xrange [0:%d]\n", MAX_BEAMLETS); + gnuplot_cmd(handle, "set xrange [0:%d]\n", x_range); break; } } @@ -2070,6 +2188,11 @@ void StatisticsCommand::plot_statistics(Array<double, 2>& stats, const Timestamp gnuplot_cmd(handle, "set xrange [0:%f]\n", gSampleFrequency / 2.0); } + // Redefine xrange when bitmode changed. + if (gBitmodeChanged && (m_type == Statistics::BEAMLET_POWER)) { + gnuplot_cmd(handle, "set xrange [0:%d]\n", x_range); + } + gnuplot_cmd(handle, plotcmd); gnuplot_cmd(handle, "plot "); @@ -2077,12 +2200,17 @@ void StatisticsCommand::plot_statistics(Array<double, 2>& stats, const Timestamp int count = 0; startrcu = 0; - if (gSplitterOn) { - stoprcu = get_ndevices() / 2; - } - else { - stoprcu = get_ndevices(); - } + if (m_type == Statistics::SUBBAND_POWER) { + if (gSplitterOn) { + stoprcu = get_ndevices() / 2; + } + else { + stoprcu = get_ndevices(); + } + } + else { + stoprcu = get_ndevices() / 2; + } for (int rcuout = startrcu; rcuout < stoprcu; rcuout++) { if (mask[rcuout]) { @@ -2093,11 +2221,11 @@ void StatisticsCommand::plot_statistics(Array<double, 2>& stats, const Timestamp switch (m_type) { case Statistics::SUBBAND_POWER: gnuplot_cmd(handle, "\"-\" using (%.1f/%.1f*$1):(10*log10($2)) title \"(RCU=%d)\" with steps ", - gSampleFrequency, n_freqbands*2.0, rcuout); + gSampleFrequency, x_range*2.0, rcuout); break; case Statistics::BEAMLET_POWER: - gnuplot_cmd(handle, "\"-\" using (1.0*$1):(10*log10($2)) title \"Beamlet Power (RSP board %d, %c)\" with steps ", - (rcuout/2), (rcuout%2?'Y':'X')); + gnuplot_cmd(handle, "\"-\" using (1.0*$1):(10*log10($2)) title \"Beamlet Power (%c)\" with steps ", + (rcuout%2?'Y':'X')); break; default: logMessage(cerr,"Error: invalid m_type"); @@ -2106,14 +2234,9 @@ void StatisticsCommand::plot_statistics(Array<double, 2>& stats, const Timestamp } } } + //stats = stats + 1; // too show zeros in log10() gnuplot_cmd(handle, "\n"); - - if (gSplitterOn) { - gnuplot_write_matrix(handle, stats(Range(0,(n_firstIndex/2)-1), Range::all())); - } - else { - gnuplot_write_matrix(handle, stats); - } + gnuplot_write_matrix(handle, stats(Range(0, count-1), Range::all())); // if splitter is now OFF but the second screen is still shown, remove this window if (handle2 && !gSplitterOn) { @@ -2123,68 +2246,82 @@ void StatisticsCommand::plot_statistics(Array<double, 2>& stats, const Timestamp // if Splitter is active plot another graphics if (gSplitterOn) { - if (!handle2) { - handle2 = gnuplot_init(); - if (!handle2) return; - - gnuplot_cmd(handle2, "set grid x y\n"); - gnuplot_cmd(handle2, "set ylabel \"dB\"\n"); - gnuplot_cmd(handle2, "set yrange [0:160]\n"); - - switch (m_type) { - case Statistics::SUBBAND_POWER: - gnuplot_cmd(handle2, "set xlabel \"Frequency (Hz)\"\n"); - gnuplot_cmd(handle2, "set xrange [0:%f]\n", gSampleFrequency / 2.0); - break; - case Statistics::BEAMLET_POWER: - gnuplot_cmd(handle2, "set xlabel \"Beamlet index\"\n"); - gnuplot_cmd(handle2, "set xrange [0:%d]\n", MAX_BEAMLETS); - break; - } - } - - time_t seconds = timestamp.sec(); - strftime(plotcmd, 255, "set title \"Ring 1 %s - %a, %d %b %Y %H:%M:%S %z\"\n", gmtime(&seconds)); - - // Redefine xrange when clock changed. - if (gClockChanged && (m_type == Statistics::SUBBAND_POWER)) { - gnuplot_cmd(handle2, "set xrange [0:%f]\n", gSampleFrequency / 2.0); - } - - gnuplot_cmd(handle2, plotcmd); - - gnuplot_cmd(handle2, "plot "); - // splot devices - int count = 0; - startrcu = get_ndevices() / 2; stoprcu = get_ndevices(); - + int rcuCount = 0; for (int rcuout = startrcu; rcuout < stoprcu; rcuout++) { if (mask[rcuout]) { - if (count > 0) - gnuplot_cmd(handle2, ","); - count++; - - switch (m_type) { - case Statistics::SUBBAND_POWER: - gnuplot_cmd(handle2, "\"-\" using (%.1f/%.1f*$1):(10*log10($2)) title \"(RCU=%d)\" with steps ", - gSampleFrequency, n_freqbands*2.0, rcuout); - break; - case Statistics::BEAMLET_POWER: - gnuplot_cmd(handle2, "\"-\" using (1.0*$1):(10*log10($2)) title \"Beamlet Power (RSP board %d, %c)\" with steps ", - (rcuout/2), (rcuout%2?'Y':'X')); - break; - default: - logMessage(cerr,"Error: invalid m_type"); - exit(EXIT_FAILURE); - break; - } + rcuCount++; } } - gnuplot_cmd(handle2, "\n"); - - gnuplot_write_matrix(handle2, stats(Range((n_firstIndex/2),n_firstIndex-1), Range::all())); + if (rcuCount > 0) { + if (!handle2) { + handle2 = gnuplot_init(); + if (!handle2) return; + + gnuplot_cmd(handle2, "set grid x y\n"); + gnuplot_cmd(handle2, "set ylabel \"dB\"\n"); + gnuplot_cmd(handle2, "set yrange [0:160]\n"); + + switch (m_type) { + case Statistics::SUBBAND_POWER: + gnuplot_cmd(handle2, "set xlabel \"Frequency (Hz)\"\n"); + gnuplot_cmd(handle2, "set xrange [0:%f]\n", gSampleFrequency / 2.0); + break; + case Statistics::BEAMLET_POWER: + gnuplot_cmd(handle2, "set xlabel \"Beamlet index\"\n"); + gnuplot_cmd(handle2, "set xrange [0:%d]\n", x_range); + break; + } + } + + time_t seconds = timestamp.sec(); + strftime(plotcmd, 255, "set title \"Ring 1 %s - %a, %d %b %Y %H:%M:%S %z\"\n", gmtime(&seconds)); + + // Redefine xrange when clock changed. + if (gClockChanged && (m_type == Statistics::SUBBAND_POWER)) { + gnuplot_cmd(handle2, "set xrange [0:%f]\n", gSampleFrequency / 2.0); + } + + // Redefine xrange when bitmode changed. + if (gBitmodeChanged && (m_type == Statistics::BEAMLET_POWER)) { + gnuplot_cmd(handle2, "set xrange [0:%d]\n", x_range); + } + + gnuplot_cmd(handle2, plotcmd); + + gnuplot_cmd(handle2, "plot "); + // splot devices + int count = 0; + + startrcu = get_ndevices() / 2; + stoprcu = get_ndevices(); + + for (int rcuout = startrcu; rcuout < stoprcu; rcuout++) { + if (mask[rcuout]) { + if (count > 0) + gnuplot_cmd(handle2, ","); + count++; + + switch (m_type) { + case Statistics::SUBBAND_POWER: + gnuplot_cmd(handle2, "\"-\" using (%.1f/%.1f*$1):(10*log10($2)) title \"(RCU=%d)\" with steps ", + gSampleFrequency, x_range*2.0, rcuout); + break; + case Statistics::BEAMLET_POWER: + gnuplot_cmd(handle2, "\"-\" using (1.0*$1):(10*log10($2)) title \"Beamlet Power (%c)\" with steps ", + (rcuout%2?'Y':'X')); + break; + default: + logMessage(cerr,"Error: invalid m_type"); + exit(EXIT_FAILURE); + break; + } + } + } + gnuplot_cmd(handle2, "\n"); + gnuplot_write_matrix(handle2, stats(Range((n_firstIndex/2),(n_firstIndex/2)+count-1), Range::all())); + } } } @@ -2552,17 +2689,18 @@ GCFEvent::TResult LatencyCommand::ack(GCFEvent& e) // RSPCtl::RSPCtl(string name, int argc, char** argv) : GCFTask((State)&RSPCtl::initial, name), - itsCommand (0), - m_nrcus (0), - m_nrspboards (0), - itsNantennas (0), - m_argc (argc), - m_argv (argv), - m_instancenr (-1), - itsNeedClockOnce(false), - itsNeedClock (false), - itsNeedSplitter (false), - m_subclock (*itsRSPDriver) + itsCommand (0), + m_nrcus (0), + m_nrspboards (0), + itsNantennas (0), + itsNbitsPerSample(MAX_BITS_PER_SAMPLE), + m_argc (argc), + m_argv (argv), + m_instancenr (-1), + itsNeedClockOnce (false), + itsNeedClock (false), + itsNeedSplitter (false), + m_subclock (*itsRSPDriver) { registerProtocol(RSP_PROTOCOL, RSP_PROTOCOL_STRINGS); @@ -2585,13 +2723,17 @@ RSPCtl::~RSPCtl() GCFEvent::TResult RSPCtl::initial(GCFEvent& e, GCFPortInterface& port) { LOG_DEBUG_STR ("initial:" << eventName(e) << "@" << port.getName()); - GCFEvent::TResult status = GCFEvent::HANDLED; switch(e.signal) { case F_INIT: break; case F_ENTRY: { + if (m_argc == 1) { + usage(false); + exit(EXIT_FAILURE); + } + // setup a connection with the RSPDriver if (!itsRSPDriver->isConnected()) { itsRSPDriver->autoOpen(3,0,1); // try 3 times at 1 second interval @@ -2621,8 +2763,22 @@ GCFEvent::TResult RSPCtl::initial(GCFEvent& e, GCFPortInterface& port) m_nrspboards = ack.n_rspboards; m_maxrspboards = ack.max_rspboards; gHasSplitter = ack.hasSplitter; - LOG_DEBUG_STR(formatString("n_rcus =%d",m_nrcus)); + LOG_DEBUG_STR(formatString("n_rcus =%d",m_nrcus)); LOG_DEBUG_STR(formatString("n_rspboards=%d of %d", m_nrspboards, m_maxrspboards)); + RSPGetbitmodeEvent getBitmode; + itsRSPDriver->send(getBitmode); + } + break; + + case RSP_GETBITMODEACK: { + RSPGetbitmodeackEvent ack(e); + // bitmode can be configured per RSPboard (although never used). Use highest value of the boards + // because that is supported by all. + itsNbitsPerSample = MIN_BITS_PER_SAMPLE; + for (int i = 0; i < m_nrspboards; i++) { + itsNbitsPerSample = (ack.bits_per_sample[i] > itsNbitsPerSample) ? ack.bits_per_sample[i] : itsNbitsPerSample; + } + LOG_DEBUG_STR(formatString("bits/sample=%d", itsNbitsPerSample)); // connected to RSPDriver, parse the arguments if (!(itsCommand = parse_options(m_argc, m_argv))) { @@ -2645,11 +2801,10 @@ GCFEvent::TResult RSPCtl::initial(GCFEvent& e, GCFPortInterface& port) break; default: - status = GCFEvent::NOT_HANDLED; - break; + return(GCFEvent::NOT_HANDLED); } - return status; + return (GCFEvent::HANDLED); } // @@ -2682,6 +2837,9 @@ GCFEvent::TResult RSPCtl::getClock(GCFEvent& e, GCFPortInterface& port) if (itsNeedSplitter) { TRAN(RSPCtl::sub2Splitter); } + else if (itsNeedBitmode) { + TRAN(RSPCtl::sub2Bitmode); + } else { TRAN(RSPCtl::doCommand); } @@ -2741,6 +2899,9 @@ GCFEvent::TResult RSPCtl::sub2Clock(GCFEvent& e, GCFPortInterface& port) if (itsNeedSplitter) { TRAN(RSPCtl::sub2Splitter); } + else if (itsNeedBitmode) { + TRAN(RSPCtl::sub2Bitmode); + } else { TRAN(RSPCtl::doCommand); } @@ -2795,6 +2956,67 @@ GCFEvent::TResult RSPCtl::sub2Splitter(GCFEvent& e, GCFPortInterface& port) RSPUpdsplitterEvent updateEvent(e); gSplitterOn = updateEvent.splitter[0]; logMessage(cerr, formatString("The splitter is currently %s", gSplitterOn ? "ON" : "OFF")); + if (itsNeedBitmode) { + TRAN(RSPCtl::sub2Bitmode); + } + else { + TRAN(RSPCtl::doCommand); + } + } + break; + + case F_DISCONNECTED: { + port.close(); + logMessage(cerr,formatString("Error: port '%s' disconnected.",port.getName().c_str())); + exit(EXIT_FAILURE); + } + break; + + default: + status = GCFEvent::NOT_HANDLED; + break; + } + + return status; +} + +// +// sub2Bitmode(event, port) +// +GCFEvent::TResult RSPCtl::sub2Bitmode(GCFEvent& e, GCFPortInterface& port) +{ + LOG_DEBUG_STR ("sub2Bitmode:" << eventName(e) << "@" << port.getName()); + + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch (e.signal) { + case F_ENTRY: { + logMessage(cerr, "Taking subscription on the bitmode"); + RSPSubbitmodeEvent subEvent; + subEvent.timestamp = Timestamp(0,0); + subEvent.period = 1; // check for change every second + itsRSPDriver->send(subEvent); + } + break; + + case RSP_SUBBITMODEACK: { + RSPSubbitmodeackEvent answer(e); + if (answer.status != RSP_SUCCESS) { + logMessage(cerr, "Subscription on the bitmode failed."); + exit(EXIT_FAILURE); + } + // wait for update event + } + break; + + case RSP_UPDBITMODE: { + RSPUpdbitmodeEvent update(e); + itsNbitsPerSample = MIN_BITS_PER_SAMPLE; + for (int i = 0; i < m_nrspboards; i++) { + itsNbitsPerSample = (update.bits_per_sample[i] > itsNbitsPerSample) ? + update.bits_per_sample[i] : itsNbitsPerSample; + } + logMessage(cerr, formatString("The bitmode is currently %d", itsNbitsPerSample)); TRAN(RSPCtl::doCommand); } break; @@ -2874,9 +3096,13 @@ GCFEvent::TResult RSPCtl::doCommand(GCFEvent& e, GCFPortInterface& port) case RSP_GETDATASTREAMACK: case RSP_SETSWAPXYACK: case RSP_GETSWAPXYACK: + case RSP_SETBITMODEACK: + case RSP_GETBITMODEACK: status = itsCommand->ack(e); // handle the acknowledgement gClockChanged = false; + gBitmodeChanged = false; + gSplitterChanged = false; break; case RSP_UPDCLOCK: { @@ -2890,10 +3116,23 @@ GCFEvent::TResult RSPCtl::doCommand(GCFEvent& e, GCFPortInterface& port) case RSP_UPDSPLITTER: { RSPUpdsplitterEvent updateEvent(e); gSplitterOn = updateEvent.splitter[0]; + gSplitterChanged = true; logMessage(cerr, formatString("NOTE: The splitter switched to %s", gSplitterOn ? "ON" : "OFF")); } break; + case RSP_UPDBITMODE: { + RSPUpdbitmodeEvent update(e); + itsNbitsPerSample = MIN_BITS_PER_SAMPLE; + for (int i = 0; i < m_nrspboards; i++) { + itsNbitsPerSample = (update.bits_per_sample[i] > itsNbitsPerSample) ? + update.bits_per_sample[i] : itsNbitsPerSample; + } + gBitmodeChanged = true; + logMessage(cerr, formatString("NOTE: The bitmode switched to %d", itsNbitsPerSample)); + } + break; + default: logMessage(cerr,formatString("Error: unhandled event %s.", eventName(e).c_str())); GCFScheduler::instance()->stop(); @@ -3015,6 +3254,7 @@ static void usage(bool exportMode) cout << "rspctl --splitter[=0|1] # set or get the status of the Serdes splitter" << endl; cout << "rspctl --datastream[=0|1|2|3] # set or get the status of data stream to cep" << endl; cout << "rspctl --swapxy[=0|1] [--select=<set>] # set or get the status of xy swap, 0=normal, 1=swapped" << endl; + cout << "rspctl --bitmode[=4|8|16] # set or get the number of bits per sample" << endl; if (exportMode) { cout << endl; cout << "--- Raw register control -------------------------------------------------------------------------------------" << endl; @@ -3050,7 +3290,8 @@ Command* RSPCtl::parse_options(int argc, char** argv) select.push_back(i); beamlets.clear(); - for (int i = 0; i < MAX_BEAMLETS; ++i) + int max_beamlets = maxBeamlets(itsNbitsPerSample); + for (int i = 0; i < max_beamlets; ++i) beamlets.push_back(i); optind = 0; // reset option parsing @@ -3087,6 +3328,7 @@ Command* RSPCtl::parse_options(int argc, char** argv) { "wgmode", required_argument, 0, 'G' }, { "hbadelays", optional_argument, 0, 'H' }, { "specinv", optional_argument, 0, 'I' }, + { "bitmode", optional_argument, 0, 'K' }, { "latency", no_argument, 0, 'L' }, { "phase", required_argument, 0, 'P' }, { "tdstatus", no_argument, 0, 'Q' }, @@ -3107,7 +3349,7 @@ Command* RSPCtl::parse_options(int argc, char** argv) realDelays = false; while (1) { int option_index = 0; - int c = getopt_long(argc, argv, "a::b:c::d:e::f:g::hi:l:m:n:p::qr::s::t::vw::xy:z::A:BC::D:E::G:H::I::LP:QR::ST::VX1:2:", long_options, &option_index); + int c = getopt_long(argc, argv, "a::b:c::d:e::g::hi:l:m:n:p::qr::s::t::vw::xy:z::A:BC::D:E::G:H::I::K::LP:QR::ST::VXY::Z::1:2:", long_options, &option_index); if (c == -1) // end of argument list reached? break; @@ -3136,7 +3378,7 @@ Command* RSPCtl::parse_options(int argc, char** argv) logMessage(cerr,"Error: 'command' argument should come before --beamlets argument"); exit(EXIT_FAILURE); } - beamlets = strtolist(optarg, MAX_BEAMLETS); + beamlets = strtolist(optarg, maxBeamlets(itsNbitsPerSample)); if (beamlets.empty()) { logMessage(cerr,"Error: invalid or missing '--beamlets' option"); exit(EXIT_FAILURE); @@ -3151,7 +3393,7 @@ Command* RSPCtl::parse_options(int argc, char** argv) { if (command) delete command; - WeightsCommand* weightscommand = new WeightsCommand(*itsRSPDriver); + WeightsCommand* weightscommand = new WeightsCommand(*itsRSPDriver, itsNbitsPerSample); weightscommand->setType(WeightsCommand::COMPLEX); command = weightscommand; @@ -3175,7 +3417,7 @@ Command* RSPCtl::parse_options(int argc, char** argv) { if (command) delete command; - WeightsCommand* weightscommand = new WeightsCommand(*itsRSPDriver); + WeightsCommand* weightscommand = new WeightsCommand(*itsRSPDriver, itsNbitsPerSample); weightscommand->setType(WeightsCommand::ANGLE); command = weightscommand; @@ -3206,10 +3448,10 @@ Command* RSPCtl::parse_options(int argc, char** argv) { if (command) delete command; - SubbandsCommand* subbandscommand = new SubbandsCommand(*itsRSPDriver); + SubbandsCommand* subbandscommand = new SubbandsCommand(*itsRSPDriver, itsNbitsPerSample); subbandscommand->setType(SubbandSelection::BEAMLET); - command = subbandscommand; + command->set_ndevices(m_nrcus); if (optarg) { @@ -3472,22 +3714,48 @@ Command* RSPCtl::parse_options(int argc, char** argv) } break; + case 'K': // bitmode + { + if (command) + delete command; + BitmodeCommand* bitmodecommand = new BitmodeCommand(*itsRSPDriver); + command = bitmodecommand; + + command->set_ndevices(m_nrspboards); + select.clear(); + for (int i = 0; i < m_nrspboards; ++i) { + select.push_back(i); + } + + if (optarg) { + bitmodecommand->setMode(false); + unsigned long bitmode = strtoul(optarg, 0, 0); + if (bitmode != 4 && bitmode != 8 && bitmode != 16) { + logMessage(cerr, formatString("Error: bitmode value can only be 4, 8 or 16, not %ld", bitmode)); + } + bitmodecommand->bitmode(bitmode); + } + } break; + case 't': // --statistics { if (command) delete command; - StatisticsCommand* statscommand = new StatisticsCommand(*itsRSPDriver); + StatisticsCommand* statscommand = new StatisticsCommand(*itsRSPDriver, itsNbitsPerSample); command = statscommand; command->set_ndevices(m_nrcus); - + + itsNeedSplitter = true; + if (optarg) { if (!strcmp(optarg, "subband")) { statscommand->setType(Statistics::SUBBAND_POWER); } else if (!strcmp(optarg, "beamlet")) { - command->set_ndevices(m_nrspboards * N_POL); + // 2 = number of cep streams, normal 1, in splitted mode 2 + command->set_ndevices(2 * N_POL); statscommand->setType(Statistics::BEAMLET_POWER); - itsNeedSplitter = true; + itsNeedBitmode = true; } else { logMessage(cerr, formatString("Error: invalid statistics type %s", optarg)); exit(EXIT_FAILURE); @@ -3518,7 +3786,7 @@ Command* RSPCtl::parse_options(int argc, char** argv) { if (command) delete command; - SubbandsCommand* subbandscommand = new SubbandsCommand(*itsRSPDriver); + SubbandsCommand* subbandscommand = new SubbandsCommand(*itsRSPDriver, itsNbitsPerSample); subbandscommand->setType(SubbandSelection::XLET); command = subbandscommand; diff --git a/MAC/APL/PIC/RSP_Driver/src/rspctl.conf.in b/MAC/APL/PIC/RSP_Driver/src/rspctl.conf.in deleted file mode 100644 index f568ebf4c38220e8663c4abf2042dfac3d12728a..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSP_Driver/src/rspctl.conf.in +++ /dev/null @@ -1,5 +0,0 @@ -# -# Configuration of the RSPCtl communication ports. -# -mac.ns.RSPCtl.server.type=TCP -mac.top.RSPCtl.server.remoteservice=RSPDriver:acceptor_v3 diff --git a/MAC/APL/PIC/RSP_Driver/src/rspctl.h b/MAC/APL/PIC/RSP_Driver/src/rspctl.h index 4e3d4ec5f69ce3f1cdb64d172d136a1d9fba0c40..76f28e4b78eaa7e70d83579996006179f06287ca 100644 --- a/MAC/APL/PIC/RSP_Driver/src/rspctl.h +++ b/MAC/APL/PIC/RSP_Driver/src/rspctl.h @@ -28,6 +28,7 @@ #include <Common/lofar_bitset.h> #include <Common/lofar_list.h> #include <Common/LofarConstants.h> +#include <Common/LofarBitModeInfo.h> #include <APL/RSP_Protocol/RSP_Protocol.ph> #include <APL/RSP_Protocol/EPA_Protocol.ph> @@ -39,6 +40,7 @@ #include <complex> #include <blitz/array.h> +#include <boost/dynamic_bitset.hpp> namespace LOFAR { using GCF::TM::GCFTask; @@ -106,14 +108,15 @@ public: } // Get the mask (N_BEAMLETS bits). - bitset<MAX_BEAMLETS> getBEAMLETSMask() const { - bitset<MAX_BEAMLETS> mask; - + boost::dynamic_bitset<> getBEAMLETSMask(int bitsPerSample) const { + int max_beamlets = maxBeamlets(bitsPerSample); + boost::dynamic_bitset<> mask(max_beamlets); mask.reset(); std::list<int>::const_iterator it; for (it = m_beamlets.begin(); it != m_beamlets.end(); ++it) { - if (*it < MAX_BEAMLETS) + if (*it < max_beamlets) { mask.set(*it); + } } return mask; } @@ -207,7 +210,7 @@ public: COMPLEX = 1, ANGLE, }; - WeightsCommand(GCFPortInterface& port); + WeightsCommand(GCFPortInterface& port, int bitsPerSample); virtual ~WeightsCommand() {} virtual void send(); virtual GCFEvent::TResult ack(GCFEvent& e); @@ -219,7 +222,8 @@ private: std::complex<double> m_value; int m_type; int itsStage; - blitz::Array<std::complex<int16>, 3> itsWeights; + blitz::Array<std::complex<int16>, 4> itsWeights; + int itsBitsPerSample; }; // @@ -228,7 +232,7 @@ private: class SubbandsCommand : public Command { public: - SubbandsCommand(GCFPortInterface& port); + SubbandsCommand(GCFPortInterface& port, int bitsPerSample); virtual ~SubbandsCommand() {} virtual void send(); virtual GCFEvent::TResult ack(GCFEvent& e); @@ -241,6 +245,7 @@ public: private: std::list<int> m_subbandlist; int m_type; + int itsBitsPerSample; }; // @@ -305,8 +310,6 @@ private: }; - - // // class RSUCommand // @@ -441,7 +444,7 @@ protected: class StatisticsCommand : public StatisticsBaseCommand { public: - StatisticsCommand(GCFPortInterface& port); + StatisticsCommand(GCFPortInterface& port, const int bitsPerSample); virtual ~StatisticsCommand() {} virtual void send(); virtual void stop(); @@ -456,6 +459,7 @@ public: private: uint8 m_type; blitz::Array<double, 2> m_stats; + int itsBitsPerSample; }; // @@ -611,6 +615,27 @@ private: bool itsStream1On; }; +// +// class BitmodeCommand +// +class BitmodeCommand : public Command +{ +public: + BitmodeCommand(GCFPortInterface& port); + virtual ~BitmodeCommand() {} + virtual void send(); + virtual GCFEvent::TResult ack(GCFEvent& e); + void bitmode(const int bitmode) { itsBitmode = bitmode; } + uint bitmode() const { return itsBitmode; } + vector<uint> getBitmode() const { return(itsBitmodeArray); } + vector<uint> getBitVersion() const { return(itsBitVersionArray); } +private: + uint itsBitmode; + vector<uint> itsBitmodeArray; + vector<uint> itsBitVersionArray; +}; + + // // class RegisterStateCommand // @@ -734,6 +759,9 @@ public: // Get a subscription on the splitter state. GCFEvent::TResult sub2Splitter(GCFEvent& e, GCFPortInterface &p); + // Get a subscription on the bitmode state. + GCFEvent::TResult sub2Bitmode(GCFEvent& e, GCFPortInterface &p); + // In this state the command is sent and the acknowledge handled. Any relevant output is printed. GCFEvent::TResult doCommand(GCFEvent& e, GCFPortInterface &p); @@ -757,6 +785,7 @@ private: int m_nrspboards; int m_maxrspboards; int itsNantennas; + int itsNbitsPerSample; // commandline parameters int m_argc; @@ -768,6 +797,7 @@ private: bool itsNeedClockOnce; // getClock bool itsNeedClock; // subClock bool itsNeedSplitter; // subSplitter + bool itsNeedBitmode; // subBitmode SubClockCommand m_subclock; // always subscribe to clock updates }; diff --git a/MAC/APL/PIC/RSP_Driver/test/RSPTest.cc b/MAC/APL/PIC/RSP_Driver/test/RSPTest.cc index 9c9326e1448f90b08b9760ee76405c86ebfa3007..4cadff8edd9f75d1506d8685848275adf2c0a21b 100644 --- a/MAC/APL/PIC/RSP_Driver/test/RSPTest.cc +++ b/MAC/APL/PIC/RSP_Driver/test/RSPTest.cc @@ -365,12 +365,12 @@ GCFEvent::TResult RSPTest::test005(GCFEvent& e, GCFPortInterface& port) ss.subbands.setType(SubbandSelection::BEAMLET); - ss.subbands().resize(1, 10); // 10 subbands selected + ss.subbands.beamlets().resize(1, 10); // 10 subbands selected - LOG_INFO_STR("dim subbands=" << ss.subbands().dimensions()); + LOG_INFO_STR("dim subbands=" << ss.subbands.beamlets().dimensions()); // set all values to 0x77 - ss.subbands() = 0x77; + ss.subbands.beamlets() = 0x77; TESTC_ABORT(m_server.send(ss), RSPTest::final); } @@ -495,7 +495,8 @@ GCFEvent::TResult RSPTest::test007(GCFEvent& e, GCFPortInterface& port) TESTC_ABORT(ack.status == RSP_SUCCESS, RSPTest::final); LOG_INFO_STR("ack.time=" << ack.timestamp); - LOG_INFO_STR("subbands=" << ack.subbands()); + LOG_INFO_STR("subbands.crosslets=" << ack.subbands.crosslets()); + LOG_INFO_STR("subbands.beamlets =" << ack.subbands.beamlets()); TRAN(RSPTest::test008); } @@ -1031,7 +1032,8 @@ GCFEvent::TResult RSPTest::test013(GCFEvent& e, GCFPortInterface& port) TESTC_ABORT(upd.status == RSP_SUCCESS, RSPTest::final); LOG_INFO_STR("upd.time=" << upd.timestamp); LOG_INFO_STR("upd.handle=" << upd.handle); - LOG_INFO_STR("upd.subbands=" << upd.subbands()); + LOG_INFO_STR("upd.subbands.crosslets=" << upd.subbands.crosslets()); + LOG_INFO_STR("upd.subbands.beamlets =" << upd.subbands.beamlets()); if (updcount++ > 2) // two seconds { diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/AllRegisterState.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/AllRegisterState.h index e8a5e94e32b6f3eae74ad06d004012e222ed2a87..a3334af0aff49defe6c6ef375fd7f1e5cb03423e 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/AllRegisterState.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/AllRegisterState.h @@ -67,7 +67,7 @@ public: rsuclear_state.resize(nrRspBoards); diagwgsettings_state.resize(nrRcus * EPA_Protocol::MEPHeader::N_DIAG_WG_REGISTERS); sst_state.resize(nrBlps * EPA_Protocol::MEPHeader::SST_N_FRAGMENTS); - bst_state.resize(nrRspBoards); + bst_state.resize(EPA_Protocol::MEPHeader::N_SERDES_LANES); xst_state.resize(nrRspBoards * EPA_Protocol::MEPHeader::XST_NR_STATS); cdo_state.resize(nrRspBoards * EPA_Protocol::MEPHeader::N_CDO_REGISTERS); bs_state.resize(nrBlps); @@ -85,6 +85,7 @@ public: rawdataread_state.resize(nrRspBoards); itsSerdesWriteState.resize(nrRspBoards); itsSerdesReadState.resize(nrRspBoards); + itsBitModeWriteState.resize(nrRspBoards); ts_state.resize(nrRspBoards); } @@ -123,8 +124,9 @@ public: rawdataread_state.reset(); itsSerdesWriteState.reset(); itsSerdesReadState.reset(); - ts_state.reset(); - + itsBitModeWriteState.reset(); + ts_state.reset(); + sys_state.read(); bf_state.write(); ss_state.write(); @@ -153,6 +155,7 @@ public: rawdataread_state.check(); itsSerdesWriteState.check(); itsSerdesReadState.check(); + itsBitModeWriteState.check(); ts_state.write(); } @@ -188,6 +191,7 @@ public: rawdataread_state.check(); itsSerdesWriteState.check(); itsSerdesReadState.check(); + itsBitModeWriteState.check(); ts_state.write(); // always write timestamp } @@ -223,7 +227,9 @@ public: rawdataread_state.clear(); itsSerdesWriteState.clear(); itsSerdesReadState.clear(); + itsBitModeWriteState.clear(); ts_state.clear(); + } // @@ -263,15 +269,16 @@ public: out << "SerdesRead "; itsSerdesReadState.print(out); out << "RawDataBlock(write) "; rawdatawrite_state.print(out); out << "RawDataBlock(read) "; rawdataread_state.print(out); + out << "Bitmode Status (w) "; itsBitModeWriteState.print(out); out << "Timestamp "; ts_state.print(out); out << endl; } /*@{*/ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ public: @@ -306,6 +313,8 @@ public: RTC::RegisterState& rawdataread() { return rawdataread_state; } RTC::RegisterState& sbwState() { return itsSerdesWriteState; } RTC::RegisterState& sbrState() { return itsSerdesReadState; } + RTC::RegisterState& bmState() { return itsBitModeWriteState; } + /*@}*/ @@ -339,6 +348,7 @@ private: RTC::RegisterState rawdataread_state; // Read userdefined datablock RTC::RegisterState itsSerdesWriteState; // Writing Serdes registers RTC::RegisterState itsSerdesReadState; // Reading Serdes registers + RTC::RegisterState itsBitModeWriteState; // RSR Bitmode register state RTC::RegisterState ts_state; // RSR Timestamp register state int m_nrcus; diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BeamletWeights.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BeamletWeights.h index 667572c5acbedbd5fc06919dc96a51763b7dd759..ead025fed00bcefa31e45ca08ecd56256baacd94 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BeamletWeights.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BeamletWeights.h @@ -49,7 +49,7 @@ namespace LOFAR { /* Destructor for BeamletWeights. */ virtual ~BeamletWeights() {} - static const int NDIM = 3; // dimension (N_POL) REMOVED, now using rcumask + static const int NDIM = 4; // dimension (N_POL) REMOVED, now using rcumask /* get reference to the weights array */ blitz::Array<std::complex<int16>, NDIM>& operator()(); @@ -59,9 +59,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: @@ -69,8 +69,8 @@ namespace LOFAR { * The beamlet weights. * Dimension 1: nr_timesteps (>1) * Dimension 2: count(rcumask) - * Dimension 3: N_BEAMLETS - * REMOVED Dimension 4, now using rcumask... + * Dimension 3: number of banks + * Dimension 4: N_BEAMLETS */ blitz::Array<std::complex<int16>, NDIM> m_weights; }; diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Bitmode.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Bitmode.h new file mode 100644 index 0000000000000000000000000000000000000000..3540baf31be8354c96efb393edda1449c52401f4 --- /dev/null +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Bitmode.h @@ -0,0 +1,83 @@ +//# -*- mode: c++ -*- +//# +//# Bitmode.h: FPGA firmware version information from the RSP board. +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: Bitmode.h 21314 2012-06-26 14:01:44Z overeem $ + +#ifndef BITMODE_H_ +#define BITMODE_H_ + +#include <APL/RTCCommon/MarshallBlitz.h> +#include <APL/RSP_Protocol/EPA_Protocol.ph> + +#include <complex> +#include <string> +#include <blitz/array.h> +#include <Common/LofarTypes.h> + +namespace LOFAR { + namespace RSP_Protocol { + + class BitmodeInfo + { + public: + /** + * Constructors for a Bitmode object. + */ + BitmodeInfo() { } + + /* Destructor for Bitmode. */ + virtual ~BitmodeInfo() {} + + /*@{*/ + /** + * Member accessor functions. + */ + blitz::Array<EPA_Protocol::RSRBeamMode, 1>& operator()(); + /*@}*/ + + public: + /*@{*/ + /** + * marshalling methods + */ + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); + /*@}*/ + + private: + /** + * Bitmode + * + * Dimensions of the arrays are: + * - itsBitmodeInfo [N_RSPBOARDS] + */ + blitz::Array<EPA_Protocol::RSRBeamMode, 1> itsBitmodeInfo; + }; + + inline blitz::Array<EPA_Protocol::RSRBeamMode, 1>& BitmodeInfo::operator()() { + return (itsBitmodeInfo); + } + }; +}; // namespace LOFAR + +#endif /* BITMODE_H_ */ diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h index 4de4e92aac599714fde611466f8dd36490361015..c8811409b9b142a42a2f16a7ec2366d3817a1340 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h @@ -70,9 +70,9 @@ public: // // marshalling methods // - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); //@} private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/CMakeLists.txt b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/CMakeLists.txt index 5bed0c46996cff8e49f1eef153896c02fe592cf9..7234b233123fe93e5b75ae9af1b70e1cafcc9c5e 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/CMakeLists.txt +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/CMakeLists.txt @@ -19,7 +19,8 @@ set(inst_HEADERS Versions.h WGSettings.h XCStatistics.h - Latency.h) + Latency.h + Bitmode.h) # Add definition of include path suffix definition, because the header files # reside in a non-standard location. diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/EPADefinitions.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/EPADefinitions.h index 8b80d72ebd0e9263be271c823b3a4307946307cb..76339fff77829ef13c89396376ce2b2a6e6849ff 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/EPADefinitions.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/EPADefinitions.h @@ -157,6 +157,16 @@ typedef struct RSRVersion // total size 2 bytes uint8 fpga_maj :4; // FPGA firmware version (major) }; +// +// RSR(0x01) 0x03: get nofbeam +// +typedef struct RSRNofbeam // total size 1 byte +{ + uint8 select :4; // select mode, 0=16bit 1=8bit 2=4bit + uint8 bitmode :3; // firmware version, 1=16bit 2=16/8bit 4=16/8/4bit + uint8 rounding :1; // rounding(not used yet) +}; + // // RSU(0x02) 0x01: read/write flash // @@ -260,7 +270,7 @@ typedef struct DIAGSelftest // total size 1 byte }; // -// SS(0x04) 0x00: Subband selection +// SS(0x04) 0x00(0x01-0x03): Subband selection // typedef struct SubbandSelect // total size (4+54) * 4 for FTS2 test (232) // total size (4+210) * 4 final (856) @@ -274,7 +284,7 @@ typedef struct SubbandSelect // total size (4+54) * 4 for FTS2 test (232) }; // -// BF(0x05) 0x00-0x03: Coefficients for XR,XI,YR,YI output +// BF(0x05) 0x00-0x03(0x04-0x0f): Coefficients for XR,XI,YR,YI output // typedef struct BeamletWeights // total size 8 x 128 - 1024 { diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/HBASettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/HBASettings.h index 0de7b401ac9325c5c0b226d166821ebd6458fac4..df19c5d1bde2c9e9f0aba0703dd895e60ead90a0 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/HBASettings.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/HBASettings.h @@ -51,9 +51,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Latency.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Latency.h index 9b867dbcf92936b39abc0f7cb303b464169c7a25..3016483f69fe47bcb61ef03681a9edd226e36afc 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Latency.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Latency.h @@ -58,9 +58,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPData.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPData.h index 04201c6fb1db9a057b97e9bb5840c2e3e545b74c..1eb9afe7d33cf9963c6dc2502afff75affde38e1 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPData.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPData.h @@ -44,9 +44,9 @@ public: /*@{*/ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPHeader.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPHeader.h index f11db5c0e431f76a8c79005379bcc6ebe6ede667..7f361bdcc790f02bba289c878baa5e47cf7164e5 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPHeader.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPHeader.h @@ -124,6 +124,7 @@ public: static const uint8 RSR_STATUS = 0x00; static const uint8 RSR_VERSION = 0x01; static const uint8 RSR_TIMESTAMP = 0x02; + static const uint8 RSR_BEAMMODE = 0x03; static const uint8 RSU_FLASHRW = 0x01; static const uint8 RSU_FLASHERASE = 0x02; @@ -139,11 +140,31 @@ public: static const uint8 DIAG_SELFTEST = 0x06; static const uint8 SS_SELECT = 0x00; + //static const uint8 SS_SELECT_0 = 0x00; + //static const uint8 SS_SELECT_1 = 0x01; + //static const uint8 SS_SELECT_2 = 0x02; + //static const uint8 SS_SELECT_3 = 0x03; static const uint8 BF_XROUT = 0x00; static const uint8 BF_XIOUT = 0x01; static const uint8 BF_YROUT = 0x02; static const uint8 BF_YIOUT = 0x03; + //static const uint8 BF_XROUT_0 = 0x00; + //static const uint8 BF_XIOUT_0 = 0x01; + //static const uint8 BF_YROUT_0 = 0x02; + //static const uint8 BF_YIOUT_0 = 0x03; + //static const uint8 BF_XROUT_1 = 0x04; + //static const uint8 BF_XIOUT_1 = 0x05; + //static const uint8 BF_YROUT_1 = 0x06; + //static const uint8 BF_YIOUT_1 = 0x07; + //static const uint8 BF_XROUT_2 = 0x08; + //static const uint8 BF_XIOUT_2 = 0x09; + //static const uint8 BF_YROUT_2 = 0x0a; + //static const uint8 BF_YIOUT_2 = 0x0b; + //static const uint8 BF_XROUT_3 = 0x0c; + //static const uint8 BF_XIOUT_3 = 0x0d; + //static const uint8 BF_YROUT_3 = 0x0e; + //static const uint8 BF_YIOUT_3 = 0x0f; static const uint8 BST_POWER_LANE_0 = 0x00; static const uint8 BST_POWER_LANE_1 = 0x01; @@ -226,6 +247,7 @@ public: static const uint16 N_BEAMLETS = N_SERDES_LANES * N_DATA_SLOTS; static const uint16 XLET_SIZE = N_POL * sizeof(std::complex<uint32>); static const uint16 WEIGHT_SIZE = N_POL * sizeof(std::complex<uint16>); + static const uint16 MAX_N_BANKS = 4; // TBB related constants static const uint16 TBB_MAXPAYLOADSIZE = 1948; // available TBB payload bytes @@ -239,6 +261,7 @@ public: static const uint16 RSR_STATUS_SIZE = 252; static const uint16 RSR_VERSION_SIZE = 2; static const uint16 RSR_TIMESTAMP_SIZE = 4; + static const uint16 RSR_BEAMMODE_SIZE = 2; static const uint16 RSU_FLASHRW_SIZE = 1024; static const uint16 RSU_FLASHERASE_SIZE = 1; @@ -253,7 +276,7 @@ public: static const uint16 DIAG_RESULTS_SIZE = 4096; // also 8192 ? static const uint16 DIAG_SELFTEST_SIZE = 4; - static const uint16 SS_SELECT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * N_POL * sizeof(uint16); // = 960? + static const uint16 SS_SELECT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * N_POL * sizeof(uint16); // = 1008 static const uint16 BF_XROUT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * WEIGHT_SIZE; static const uint16 BF_XIOUT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * WEIGHT_SIZE; @@ -311,9 +334,9 @@ public: /*@{*/ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ // MEP 4.x header fields @@ -363,6 +386,7 @@ public: static const FieldsType RSR_STATUS_HDR; static const FieldsType RSR_VERSION_HDR; static const FieldsType RSR_TIMESTAMP_HDR; + static const FieldsType RSR_BEAMMODE_HDR; static const FieldsType RSU_FLASHRW_HDR; static const FieldsType RSU_FLASHERASE_HDR; @@ -378,12 +402,32 @@ public: static const FieldsType DIAG_SELFTEST_HDR; static const FieldsType SS_SELECT_HDR; + //static const FieldsType SS_SELECT_HDR_0; + //static const FieldsType SS_SELECT_HDR_1; + //static const FieldsType SS_SELECT_HDR_2; + //static const FieldsType SS_SELECT_HDR_3; static const FieldsType BF_XROUT_HDR; static const FieldsType BF_XIOUT_HDR; static const FieldsType BF_YROUT_HDR; static const FieldsType BF_YIOUT_HDR; - + //static const FieldsType BF_XROUT_HDR_0; + //static const FieldsType BF_XIOUT_HDR_0; + //static const FieldsType BF_YROUT_HDR_0; + //static const FieldsType BF_YIOUT_HDR_0; + //static const FieldsType BF_XROUT_HDR_1; + //static const FieldsType BF_XIOUT_HDR_1; + //static const FieldsType BF_YROUT_HDR_1; + //static const FieldsType BF_YIOUT_HDR_1; + //static const FieldsType BF_XROUT_HDR_2; + //static const FieldsType BF_XIOUT_HDR_2; + //static const FieldsType BF_YROUT_HDR_2; + //static const FieldsType BF_YIOUT_HDR_2; + //static const FieldsType BF_XROUT_HDR_3; + //static const FieldsType BF_XIOUT_HDR_3; + //static const FieldsType BF_YROUT_HDR_3; + //static const FieldsType BF_YIOUT_HDR_3; + static const FieldsType BST_POWER_HDR; static const FieldsType SST_POWER_HDR; @@ -424,8 +468,19 @@ public: static const FieldsType RSP_RAWDATA_READ; /*@}*/ + // Output function for operator << + ostream& print (ostream& os) const; + }; +// +// operator << +// +inline ostream& operator<< (ostream& os, const MEPHeader& hdr) +{ + return (hdr.print(os)); +} + }; // namespace EPA_PROTOCOL }; // namespace LOFAR diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RCUSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RCUSettings.h index 67886f22ea824293990522af006e9e9f515bae8e..5c882fddec71d25dd221993f51680e2f6e09e9c3 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RCUSettings.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RCUSettings.h @@ -282,9 +282,9 @@ public: public: /*@{*/ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RSUSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RSUSettings.h index ef158b9c613142236b6d6635746330ebeb057326..e2c9905fd70efede0f3b228cb2aa4350cc3e6db8 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RSUSettings.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RSUSettings.h @@ -99,9 +99,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SPUStatus.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SPUStatus.h index 226ffd93de18819dd3e738e77b3e12e817a6bbe7..172762c4df3e59cad7f11ef2c609cc49675568b7 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SPUStatus.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SPUStatus.h @@ -46,9 +46,9 @@ public: blitz::Array<EPA_Protocol::SPUBoardStatus, 1>& subrack(); // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); private: // SPU status fields. (note there is only 1 SPU per subrack) diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Statistics.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Statistics.h index a37223cb95d94c83462f11eacd5f772d516ba5d1..f4769f42beefd9c7e7e2e9cd4e4264a3ff8817d8 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Statistics.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Statistics.h @@ -72,9 +72,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: @@ -82,7 +82,7 @@ namespace LOFAR { * Statistics * Dimensions are: (N_DEVICES, N_SUBBANDS); * - * N_DEVICES == N_RSPBOARDS * N_POL for beamlet statistics + * N_DEVICES == 2 * N_POL for beamlet statistics (2 *) for splitter * N_DEVICES == N_RSPBOARDS * N_BLPS * N_POL for subband statistics * */ diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h index 7a2c0039728c25275540ef9dea652eef4f477c5a..d06d32fddbec37e7d27004778185fb5d506046a3 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h @@ -66,9 +66,11 @@ namespace LOFAR { virtual ~SubbandSelection() {} /** - * Return the subbands array. + * Return the crosslet or beamlet array. */ - blitz::Array<uint16, 2>& operator()(); + blitz::Array<uint16, 3>& crosslets(); + blitz::Array<uint16, 3>& beamlets(); + /** * Return type of selection. @@ -87,22 +89,27 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: /** * Subband selection array. * dim 1 = n_rcus (== 1 on SETSUBBANDS, == count(rcumask) on GETSUBBANDS_ACK) - * dim 2 = n_beamlets (if type == BEAMLET) - * dim 2 = 1 (if type == XLET) + * dim 2 = number of planes (16bit = 1plane, 8bit=2planes, 4bit=4planes) + * dim 3 = n_beamlets (if type == BEAMLET) + * dim 3 = 1 (if type == XLET) */ - blitz::Array<uint16, 2> m_subbands; + blitz::Array<uint16, 3> itsCrosslets; + blitz::Array<uint16, 3> itsBeamlets; uint16 m_type; // type of subband selection (BEAMLET or XLET) }; + + inline blitz::Array<uint16, 3>& SubbandSelection::crosslets() { return itsCrosslets; } + inline blitz::Array<uint16, 3>& SubbandSelection::beamlets() { return itsBeamlets; } }; }; // namespace LOFAR diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SystemStatus.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SystemStatus.h index f447cce637ff0eada85fb8801277b26b4767792a..33881a17897038e42809d8a1f84af8453c962be8 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SystemStatus.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SystemStatus.h @@ -58,9 +58,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TBBSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TBBSettings.h index 0d28e4280ab237ca1a24e30cf0da5e134259ba07..26f64ec8f7252ee74fec164084a6a9d84b6fa559 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TBBSettings.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TBBSettings.h @@ -50,9 +50,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TDStatus.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TDStatus.h index 5cd703b275a52086faa033b8ca494c58c0c95eb0..2b8c60504a5d271cf8fd537a873301b56cbd4253 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TDStatus.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TDStatus.h @@ -58,9 +58,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Versions.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Versions.h index fbcfc7092c611af2e1affff06fc14f1a145d7b45..63c1210ba1c4faca2499c3d953f2b515a65b6103 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Versions.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Versions.h @@ -58,9 +58,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/WGSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/WGSettings.h index e00593210c1a16b9bc9803a63136b5cfdaa6735b..06fbc6f76110a78eb075f4e83cef39b759088bfa 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/WGSettings.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/WGSettings.h @@ -89,9 +89,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/XCStatistics.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/XCStatistics.h index 25020cadc69e5f26d4d00c350d9d067e4a09b24f..dfc9906488287fe765d112edf8aed566b9b198cc 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/XCStatistics.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/XCStatistics.h @@ -54,9 +54,9 @@ namespace LOFAR { /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: diff --git a/MAC/APL/PIC/RSP_Protocol/src/AllRegisterState.cc b/MAC/APL/PIC/RSP_Protocol/src/AllRegisterState.cc index ad3a1959a3a3ce673bd1aa0557093b461f0118d1..ca8af3e4356b6d880285d7d5246ad8f5069b4f6b 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/AllRegisterState.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/AllRegisterState.cc @@ -31,7 +31,7 @@ using namespace blitz; using namespace LOFAR; using namespace RSP_Protocol; -unsigned int AllRegisterState::getSize() +size_t AllRegisterState::getSize() const { return sys_state.getSize() @@ -62,79 +62,82 @@ unsigned int AllRegisterState::getSize() + rawdatawrite_state.getSize() + rawdataread_state.getSize() + itsSerdesWriteState.getSize() - + itsSerdesReadState.getSize(); + + itsSerdesReadState.getSize() + + itsBitModeWriteState.getSize(); } -unsigned int AllRegisterState::pack (void* buffer) +size_t AllRegisterState::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - offset += sys_state.pack((char*)buffer + offset); - offset += bf_state.pack((char*)buffer + offset); - offset += ss_state.pack((char*)buffer + offset); - offset += rcusettings_state.pack((char*)buffer + offset); - offset += rcuprotocol_state.pack((char*)buffer + offset); - offset += itsRcuReadState.pack((char*)buffer + offset); - offset += hbaprotocol_state.pack((char*)buffer + offset); - offset += rsuclear_state.pack((char*)buffer + offset); - offset += diagwgsettings_state.pack((char*)buffer + offset); - offset += sst_state.pack((char*)buffer + offset); - offset += bst_state.pack((char*)buffer + offset); - offset += xst_state.pack((char*)buffer + offset); - offset += cdo_state.pack((char*)buffer + offset); - offset += bs_state.pack((char*)buffer + offset); - offset += tdclear_state.pack((char*)buffer + offset); - offset += tdwrite_state.pack((char*)buffer + offset); - offset += tdread_state.pack((char*)buffer + offset); - offset += rad_state.pack((char*)buffer + offset); - offset += itsCRstate.pack((char*)buffer + offset); - offset += ts_state.pack((char*)buffer + offset); - offset += tdstatuswrite_state.pack((char*)buffer + offset); - offset += tdstatusread_state.pack((char*)buffer + offset); - offset += tbbsettings_state.pack((char*)buffer + offset); - offset += tbbbandsel_state.pack((char*)buffer + offset); - offset += bypasssettings_state.pack((char*)buffer + offset); - offset += rawdatawrite_state.pack((char*)buffer + offset); - offset += rawdataread_state.pack((char*)buffer + offset); - offset += itsSerdesWriteState.pack((char*)buffer + offset); - offset += itsSerdesReadState.pack((char*)buffer + offset); + offset += sys_state.pack(buffer + offset); + offset += bf_state.pack(buffer + offset); + offset += ss_state.pack(buffer + offset); + offset += rcusettings_state.pack(buffer + offset); + offset += rcuprotocol_state.pack(buffer + offset); + offset += itsRcuReadState.pack(buffer + offset); + offset += hbaprotocol_state.pack(buffer + offset); + offset += rsuclear_state.pack(buffer + offset); + offset += diagwgsettings_state.pack(buffer + offset); + offset += sst_state.pack(buffer + offset); + offset += bst_state.pack(buffer + offset); + offset += xst_state.pack(buffer + offset); + offset += cdo_state.pack(buffer + offset); + offset += bs_state.pack(buffer + offset); + offset += tdclear_state.pack(buffer + offset); + offset += tdwrite_state.pack(buffer + offset); + offset += tdread_state.pack(buffer + offset); + offset += rad_state.pack(buffer + offset); + offset += itsCRstate.pack(buffer + offset); + offset += ts_state.pack(buffer + offset); + offset += tdstatuswrite_state.pack(buffer + offset); + offset += tdstatusread_state.pack(buffer + offset); + offset += tbbsettings_state.pack(buffer + offset); + offset += tbbbandsel_state.pack(buffer + offset); + offset += bypasssettings_state.pack(buffer + offset); + offset += rawdatawrite_state.pack(buffer + offset); + offset += rawdataread_state.pack(buffer + offset); + offset += itsSerdesWriteState.pack(buffer + offset); + offset += itsSerdesReadState.pack(buffer + offset); + offset += itsBitModeWriteState.pack(buffer + offset); return (offset); } -unsigned int AllRegisterState::unpack(void *buffer) +size_t AllRegisterState::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - offset += sys_state.unpack((char*)buffer + offset); - offset += bf_state.unpack((char*)buffer + offset); - offset += ss_state.unpack((char*)buffer + offset); - offset += rcusettings_state.unpack((char*)buffer + offset); - offset += rcuprotocol_state.unpack((char*)buffer + offset); - offset += itsRcuReadState.unpack((char*)buffer + offset); - offset += hbaprotocol_state.unpack((char*)buffer + offset); - offset += rsuclear_state.unpack((char*)buffer + offset); - offset += diagwgsettings_state.unpack((char*)buffer + offset); - offset += sst_state.unpack((char*)buffer + offset); - offset += bst_state.unpack((char*)buffer + offset); - offset += xst_state.unpack((char*)buffer + offset); - offset += cdo_state.unpack((char*)buffer + offset); - offset += bs_state.unpack((char*)buffer + offset); - offset += tdclear_state.unpack((char*)buffer + offset); - offset += tdwrite_state.unpack((char*)buffer + offset); - offset += tdread_state.unpack((char*)buffer + offset); - offset += rad_state.unpack((char*)buffer + offset); - offset += itsCRstate.unpack((char*)buffer + offset); - offset += ts_state.unpack((char*)buffer + offset); - offset += tdstatuswrite_state.unpack((char*)buffer + offset); - offset += tdstatusread_state.unpack((char*)buffer + offset); - offset += tbbsettings_state.unpack((char*)buffer + offset); - offset += tbbbandsel_state.unpack((char*)buffer + offset); - offset += bypasssettings_state.unpack((char*)buffer + offset); - offset += rawdatawrite_state.unpack((char*)buffer + offset); - offset += rawdataread_state.unpack((char*)buffer + offset); - offset += itsSerdesWriteState.unpack((char*)buffer + offset); - offset += itsSerdesReadState.unpack((char*)buffer + offset); + offset += sys_state.unpack(buffer + offset); + offset += bf_state.unpack(buffer + offset); + offset += ss_state.unpack(buffer + offset); + offset += rcusettings_state.unpack(buffer + offset); + offset += rcuprotocol_state.unpack(buffer + offset); + offset += itsRcuReadState.unpack(buffer + offset); + offset += hbaprotocol_state.unpack(buffer + offset); + offset += rsuclear_state.unpack(buffer + offset); + offset += diagwgsettings_state.unpack(buffer + offset); + offset += sst_state.unpack(buffer + offset); + offset += bst_state.unpack(buffer + offset); + offset += xst_state.unpack(buffer + offset); + offset += cdo_state.unpack(buffer + offset); + offset += bs_state.unpack(buffer + offset); + offset += tdclear_state.unpack(buffer + offset); + offset += tdwrite_state.unpack(buffer + offset); + offset += tdread_state.unpack(buffer + offset); + offset += rad_state.unpack(buffer + offset); + offset += itsCRstate.unpack(buffer + offset); + offset += ts_state.unpack(buffer + offset); + offset += tdstatuswrite_state.unpack(buffer + offset); + offset += tdstatusread_state.unpack(buffer + offset); + offset += tbbsettings_state.unpack(buffer + offset); + offset += tbbbandsel_state.unpack(buffer + offset); + offset += bypasssettings_state.unpack(buffer + offset); + offset += rawdatawrite_state.unpack(buffer + offset); + offset += rawdataread_state.unpack(buffer + offset); + offset += itsSerdesWriteState.unpack(buffer + offset); + offset += itsSerdesReadState.unpack(buffer + offset); + offset += itsBitModeWriteState.unpack(buffer + offset); return (offset); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/BeamletWeights.cc b/MAC/APL/PIC/RSP_Protocol/src/BeamletWeights.cc index 3dc8eff081d7215590cedbe6995f794cc493597f..6353876de2f985363ea6e40ad63d9916096b208e 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/BeamletWeights.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/BeamletWeights.cc @@ -31,25 +31,21 @@ using namespace blitz; using namespace LOFAR; using namespace RSP_Protocol; -unsigned int BeamletWeights::getSize() +size_t BeamletWeights::getSize() const { - return MSH_ARRAY_SIZE(m_weights, complex<int16>); + return MSH_size(m_weights); } -unsigned int BeamletWeights::pack (void* buffer) +size_t BeamletWeights::pack (char* buffer) const { - unsigned int offset = 0; - - MSH_PACK_ARRAY(buffer, offset, m_weights, complex<int16>); - + size_t offset = 0; + MSH_pack(buffer, offset, m_weights); return offset; } -unsigned int BeamletWeights::unpack(void *buffer) +size_t BeamletWeights::unpack(const char *buffer) { - unsigned int offset = 0; - - MSH_UNPACK_ARRAY(buffer, offset, m_weights, complex<int16>, NDIM); - + size_t offset = 0; + MSH_unpack(buffer, offset, m_weights); return offset; } diff --git a/JAVA/CEP/jParmFacade/include/jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jCommon.h b/MAC/APL/PIC/RSP_Protocol/src/Bitmode.cc similarity index 54% rename from JAVA/CEP/jParmFacade/include/jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jCommon.h rename to MAC/APL/PIC/RSP_Protocol/src/Bitmode.cc index 06f4db63f238535e7ee175d98001e65d420f5637..df959cbbbc5f24754f2f21c11d4712e10a71a056 100644 --- a/JAVA/CEP/jParmFacade/include/jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jCommon.h +++ b/MAC/APL/PIC/RSP_Protocol/src/Bitmode.cc @@ -1,7 +1,6 @@ -//# jCommon.h: Holds common objects, methods that aren't auto -//# generated by javah +//# Bitmode.h: implementation of the Bitmode class //# -//# Copyright (C) 2002-2005 +//# Copyright (C) 2002-2004 //# ASTRON (Netherlands Foundation for Research in Astronomy) //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl //# @@ -19,16 +18,38 @@ //# along with this program; if not, write to the Free Software //# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //# +//# $Id: Bitmode.cc 21314 2012-06-26 14:01:44Z overeem $ -#ifndef LOFAR_JPARMFACADE_COMMON_H -#define LOFAR_JPARMFACADE_COMMON_H +#include <lofar_config.h> +#include <Common/LofarLogger.h> -// \file -// Holds common objects, methods that aren't autogenerated by javah -// -//# Never #include <config.h> or #include <lofar_config.h> in a header file! -//# Includes -#include <jni.h> -void setParmDBConnection(JNIEnv *env, jobject callerObject); +#include <APL/RSP_Protocol/Bitmode.h> +#include <APL/RTCCommon/MarshallBlitz.h> -#endif +using namespace std; +using namespace blitz; +using namespace LOFAR; +using namespace RSP_Protocol; + +size_t BitmodeInfo::getSize() const +{ + return MSH_size(itsBitmodeInfo); +} + +size_t BitmodeInfo::pack (char* buffer) const +{ + size_t offset = 0; + + MSH_pack(buffer, offset, itsBitmodeInfo); + + return offset; +} + +size_t BitmodeInfo::unpack(const char *buffer) +{ + size_t offset = 0; + + MSH_unpack(buffer, offset, itsBitmodeInfo); + + return offset; +} diff --git a/MAC/APL/PIC/RSP_Protocol/src/BypassSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/BypassSettings.cc index 6d2422a964e03b8905f816f39141f0d9113cfc81..c541468c006db08e75b123beb71c782f1ee80055 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/BypassSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/BypassSettings.cc @@ -32,26 +32,22 @@ namespace LOFAR { namespace RSP_Protocol { -unsigned int BypassSettings::getSize() +size_t BypassSettings::getSize() const { - return MSH_ARRAY_SIZE(m_registers, BypassSettings::Control); + return MSH_size(m_registers); } -unsigned int BypassSettings::pack (void* buffer) +size_t BypassSettings::pack (char* buffer) const { - unsigned int offset = 0; - - MSH_PACK_ARRAY(buffer, offset, m_registers, BypassSettings::Control); - + size_t offset = 0; + MSH_pack(buffer, offset, m_registers); return offset; } -unsigned int BypassSettings::unpack(void *buffer) +size_t BypassSettings::unpack(const char *buffer) { - unsigned int offset = 0; - - MSH_UNPACK_ARRAY(buffer, offset, m_registers, BypassSettings::Control, 1); - + size_t offset = 0; + MSH_unpack(buffer, offset, m_registers); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/CMakeLists.txt b/MAC/APL/PIC/RSP_Protocol/src/CMakeLists.txt index c86ea01c1cd562dc9835e43bc1f486f09b40de4b..766054399d51edb6a7ea0c1efee350e9f4c9e050 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/CMakeLists.txt +++ b/MAC/APL/PIC/RSP_Protocol/src/CMakeLists.txt @@ -31,7 +31,8 @@ lofar_add_library(rsp_protocol TDStatus.cc Versions.cc WGSettings.cc - XCStatistics.cc) + XCStatistics.cc + Bitmode.cc) add_dependencies(rsp_protocol RSP_Protocol-EPA_Protocol diff --git a/MAC/APL/PIC/RSP_Protocol/src/EPA_Protocol.prot b/MAC/APL/PIC/RSP_Protocol/src/EPA_Protocol.prot index ae04565179bc3fb2ccf53c82223d6b28e01c9bb1..ba578862d1254cb0c77422e63a9bc8627f00a064 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/EPA_Protocol.prot +++ b/MAC/APL/PIC/RSP_Protocol/src/EPA_Protocol.prot @@ -188,6 +188,12 @@ prelude = << PRELUDE_END uint8 fpga_maj :4; // FPGA firmware version (major) }; + struct RSRBeamMode + { + uint8 bm_max; // bitmode supported by hardware 0=16bit 1=8bit 2=4bit (read only!) + uint8 bm_select; // select bitmode, 0=16bit 1=8bit 2=4bit + }; + struct RSUReconfig { uint8 page :3; // page selection @@ -501,6 +507,22 @@ event = { }; }; +event = { + noheader; + signal = RSR_BEAMMODE; + dir = INOUT; // read-write register + param = { + name = "hdr"; + type = "MEPHeader"; + userdefined; + }; + param = { + name = "beammode"; + type = "struct RSRBeamMode"; + }; +}; + + event = { noheader; signal = RSU_FLASHRW; diff --git a/MAC/APL/PIC/RSP_Protocol/src/HBASettings.cc b/MAC/APL/PIC/RSP_Protocol/src/HBASettings.cc index aa191f78bb56944e8bcc10ccc4060f79435ebde7..15711809913095f3d0d7765a95c89c2f7789062a 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/HBASettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/HBASettings.cc @@ -31,25 +31,25 @@ using namespace blitz; using namespace LOFAR; using namespace RSP_Protocol; -unsigned int HBASettings::getSize() +size_t HBASettings::getSize() const { - return MSH_ARRAY_SIZE(m_delay, uint8); + return MSH_size(m_delay); } -unsigned int HBASettings::pack (void* buffer) +size_t HBASettings::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_delay, uint8); + MSH_pack(buffer, offset, m_delay); return offset; } -unsigned int HBASettings::unpack(void *buffer) +size_t HBASettings::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_delay, uint8, 2); + MSH_unpack(buffer, offset, m_delay); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/Latency.cc b/MAC/APL/PIC/RSP_Protocol/src/Latency.cc index a8c39ac1a279e7f9dbca571c03a20d7797be7d40..ff17619d5c93a50ad1031865949d5b2715aec398 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/Latency.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/Latency.cc @@ -36,25 +36,25 @@ using namespace LOFAR; using namespace RSP_Protocol; using namespace EPA_Protocol; -unsigned int Latency::getSize() +size_t Latency::getSize() const { - return MSH_ARRAY_SIZE(itsLatency, EPA_Protocol::RADLatency); + return MSH_size(itsLatency); } -unsigned int Latency::pack (void* buffer) +size_t Latency::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, itsLatency, EPA_Protocol::RADLatency); + MSH_pack(buffer, offset, itsLatency); return offset; } -unsigned int Latency::unpack(void *buffer) +size_t Latency::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, itsLatency, EPA_Protocol::RADLatency, 1); + MSH_unpack(buffer, offset, itsLatency); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/MEPData.cc b/MAC/APL/PIC/RSP_Protocol/src/MEPData.cc index 2bf7cb2bb1795b078df988f38b17a174e86b68f7..d472a08c6f377d916316082521a3723127f8de87 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/MEPData.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/MEPData.cc @@ -31,21 +31,20 @@ using namespace LOFAR; using namespace EPA_Protocol; using namespace std; -unsigned int MEPData::getSize() +size_t MEPData::getSize() const { return m_count; } -unsigned int MEPData::pack (void* buffer) +size_t MEPData::pack (char* buffer) const { memcpy(buffer, m_dataptr, m_count); return m_count; } -unsigned int MEPData::unpack(void* buffer) +size_t MEPData::unpack(const char* buffer) { - if (m_count && m_dataptr) - { + if (m_count && m_dataptr) { memcpy(m_dataptr, buffer, m_count); } return m_count; diff --git a/MAC/APL/PIC/RSP_Protocol/src/MEPHeader.cc b/MAC/APL/PIC/RSP_Protocol/src/MEPHeader.cc index a06058ec8a23e9451db45214987971d060b3788a..b4df565b19899976762a63ccbce7444851b6da99 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/MEPHeader.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/MEPHeader.cc @@ -37,6 +37,7 @@ using namespace std; const MEPHeader::FieldsType MEPHeader::RSR_STATUS_HDR = { READ, 0, 0, { DST_RSP, RSR, RSR_STATUS }, 0, RSR_STATUS_SIZE, 0, 0 }; const MEPHeader::FieldsType MEPHeader::RSR_VERSION_HDR = { READ, 0, 0, { DST_RSP, RSR, RSR_VERSION }, 0, RSR_VERSION_SIZE, 0, 0 }; const MEPHeader::FieldsType MEPHeader::RSR_TIMESTAMP_HDR = { WRITE, 0, 0, { DST_RSP, RSR, RSR_TIMESTAMP }, 0, RSR_TIMESTAMP_SIZE, 0, 0 }; +const MEPHeader::FieldsType MEPHeader::RSR_BEAMMODE_HDR = { WRITE, 0, 0, { DST_RSP, RSR, RSR_BEAMMODE }, 0, RSR_BEAMMODE_SIZE, 0, 0 }; const MEPHeader::FieldsType MEPHeader::RSU_FLASHRW_HDR = { WRITE, 0, 0, { DST_RSP, RSU, RSU_FLASHRW }, 0, RSU_FLASHRW_SIZE, 0, 0 }; const MEPHeader::FieldsType MEPHeader::RSU_FLASHERASE_HDR = { WRITE, 0, 0, { DST_RSP, RSU, RSU_FLASHERASE }, 0, RSU_FLASHERASE_SIZE, 0, 0 }; @@ -51,12 +52,32 @@ const MEPHeader::FieldsType MEPHeader::DIAG_BYPASS_HDR = { WRITE, 0, 0, { const MEPHeader::FieldsType MEPHeader::DIAG_RESULTS_HDR = { READ, 0, 0, { DST_BLP0, DIAG, DIAG_RESULTS }, 0, DIAG_RESULTS_SIZE, 0, 0 }; const MEPHeader::FieldsType MEPHeader::DIAG_SELFTEST_HDR = { WRITE, 0, 0, { DST_RSP , DIAG, DIAG_SELFTEST }, 0, DIAG_SELFTEST_SIZE, 0, 0 }; -const MEPHeader::FieldsType MEPHeader::SS_SELECT_HDR = { WRITE, 0, 0, { DST_BLP0, SS, SS_SELECT }, 0, SS_SELECT_SIZE, 0, 0 }; - -const MEPHeader::FieldsType MEPHeader::BF_XROUT_HDR = { WRITE, 0, 0, { DST_BLP0, BF, BF_XROUT }, 0, BF_XROUT_SIZE, 0, 0 }; -const MEPHeader::FieldsType MEPHeader::BF_XIOUT_HDR = { WRITE, 0, 0, { DST_BLP0, BF, BF_XIOUT }, 0, BF_XIOUT_SIZE, 0, 0 }; -const MEPHeader::FieldsType MEPHeader::BF_YROUT_HDR = { WRITE, 0, 0, { DST_BLP0, BF, BF_YROUT }, 0, BF_YROUT_SIZE, 0, 0 }; -const MEPHeader::FieldsType MEPHeader::BF_YIOUT_HDR = { WRITE, 0, 0, { DST_BLP0, BF, BF_YIOUT }, 0, BF_YIOUT_SIZE, 0, 0 }; +const MEPHeader::FieldsType MEPHeader::SS_SELECT_HDR = { WRITE, 0, 0, { DST_BLP0, SS, SS_SELECT } , 0, SS_SELECT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::SS_SELECT_HDR_0 = { WRITE, 0, 0, { DST_BLP0, SS, SS_SELECT_0 }, 0, SS_SELECT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::SS_SELECT_HDR_1 = { WRITE, 0, 0, { DST_BLP0, SS, SS_SELECT_1 }, 0, SS_SELECT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::SS_SELECT_HDR_2 = { WRITE, 0, 0, { DST_BLP0, SS, SS_SELECT_2 }, 0, SS_SELECT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::SS_SELECT_HDR_3 = { WRITE, 0, 0, { DST_BLP0, SS, SS_SELECT_3 }, 0, SS_SELECT_SIZE, 0, 0 }; + +const MEPHeader::FieldsType MEPHeader::BF_XROUT_HDR = { WRITE, 0, 0, { DST_BLP0, BF, BF_XROUT }, 0, BF_XROUT_SIZE, 0, 0 }; +const MEPHeader::FieldsType MEPHeader::BF_XIOUT_HDR = { WRITE, 0, 0, { DST_BLP0, BF, BF_XIOUT }, 0, BF_XIOUT_SIZE, 0, 0 }; +const MEPHeader::FieldsType MEPHeader::BF_YROUT_HDR = { WRITE, 0, 0, { DST_BLP0, BF, BF_YROUT }, 0, BF_YROUT_SIZE, 0, 0 }; +const MEPHeader::FieldsType MEPHeader::BF_YIOUT_HDR = { WRITE, 0, 0, { DST_BLP0, BF, BF_YIOUT }, 0, BF_YIOUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_XROUT_HDR_0 = { WRITE, 0, 0, { DST_BLP0, BF, BF_XROUT_0 }, 0, BF_XROUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_XIOUT_HDR_0 = { WRITE, 0, 0, { DST_BLP0, BF, BF_XIOUT_0 }, 0, BF_XIOUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_YROUT_HDR_0 = { WRITE, 0, 0, { DST_BLP0, BF, BF_YROUT_0 }, 0, BF_YROUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_YIOUT_HDR_0 = { WRITE, 0, 0, { DST_BLP0, BF, BF_YIOUT_0 }, 0, BF_YIOUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_XROUT_HDR_1 = { WRITE, 0, 0, { DST_BLP0, BF, BF_XROUT_1 }, 0, BF_XROUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_XIOUT_HDR_1 = { WRITE, 0, 0, { DST_BLP0, BF, BF_XIOUT_1 }, 0, BF_XIOUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_YROUT_HDR_1 = { WRITE, 0, 0, { DST_BLP0, BF, BF_YROUT_1 }, 0, BF_YROUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_YIOUT_HDR_1 = { WRITE, 0, 0, { DST_BLP0, BF, BF_YIOUT_1 }, 0, BF_YIOUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_XROUT_HDR_2 = { WRITE, 0, 0, { DST_BLP0, BF, BF_XROUT_2 }, 0, BF_XROUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_XIOUT_HDR_2 = { WRITE, 0, 0, { DST_BLP0, BF, BF_XIOUT_2 }, 0, BF_XIOUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_YROUT_HDR_2 = { WRITE, 0, 0, { DST_BLP0, BF, BF_YROUT_2 }, 0, BF_YROUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_YIOUT_HDR_2 = { WRITE, 0, 0, { DST_BLP0, BF, BF_YIOUT_2 }, 0, BF_YIOUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_XROUT_HDR_3 = { WRITE, 0, 0, { DST_BLP0, BF, BF_XROUT_3 }, 0, BF_XROUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_XIOUT_HDR_3 = { WRITE, 0, 0, { DST_BLP0, BF, BF_XIOUT_3 }, 0, BF_XIOUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_YROUT_HDR_3 = { WRITE, 0, 0, { DST_BLP0, BF, BF_YROUT_3 }, 0, BF_YROUT_SIZE, 0, 0 }; +//const MEPHeader::FieldsType MEPHeader::BF_YIOUT_HDR_3 = { WRITE, 0, 0, { DST_BLP0, BF, BF_YIOUT_3 }, 0, BF_YIOUT_SIZE, 0, 0 }; const MEPHeader::FieldsType MEPHeader::BST_POWER_HDR = { READ, 0, 0, { DST_RSP, BST, BST_POWER_LANE_0 }, 0, BST_POWER_SIZE, 0, 0 }; @@ -97,18 +118,18 @@ const MEPHeader::FieldsType MEPHeader::RAD_LATENCY_HDR = { READ , 0, 0, { const MEPHeader::FieldsType MEPHeader::RSP_RAWDATA_WRITE = { WRITE, 0, 0, { 0xABBA, 0xBB, 0xAA }, 0xEFFE, 0xEBBE, 0x3412, 0 }; const MEPHeader::FieldsType MEPHeader::RSP_RAWDATA_READ = { READ , 0, 0, { 0xABBA, 0xBB, 0xAA }, 0xEFFE, 0xEBBE, 0x3412, 0 }; -unsigned int MEPHeader::getSize() +size_t MEPHeader::getSize() const { return MEPHeader::SIZE; } -unsigned int MEPHeader::pack (void* buffer) +size_t MEPHeader::pack (char* buffer) const { memcpy(buffer, &(this->m_fields), MEPHeader::SIZE); return MEPHeader::SIZE; } -unsigned int MEPHeader::unpack(void *buffer) +size_t MEPHeader::unpack(const char *buffer) { memcpy(&(this->m_fields), buffer, MEPHeader::SIZE); return MEPHeader::SIZE; @@ -183,7 +204,7 @@ bool MEPHeader::isValidAck(const MEPHeader& reqhdr) * if it is a WRITEACK, or SIZE + payload_length if it is a * READACK. */ - return ( + if ( ( (READACK == this->m_fields.type && reqhdr.m_fields.type == READ) || (WRITEACK == this->m_fields.type && reqhdr.m_fields.type == WRITE) ) && (0 == this->m_fields.status) && @@ -195,6 +216,20 @@ bool MEPHeader::isValidAck(const MEPHeader& reqhdr) (this->m_fields.addr.regid == reqhdr.m_fields.addr.regid) && (this->m_fields.offset == reqhdr.m_fields.offset) && (this->m_fields.payload_length == reqhdr.m_fields.payload_length) - ); + ) { + return (true); + } + LOG_ERROR_STR("this:" << *this << "\nthat:" << reqhdr); + return (false); } +// +// print (os) +// +ostream& MEPHeader::print(ostream& os) const +{ + os << "hdr[type=" << (int)m_fields.type << ",status=" << (int)m_fields.status << ",framelen=" << m_fields.frame_length; + os << ",dstid=" << m_fields.addr.dstid << ",pid=" << (int)m_fields.addr.pid << ",regid=" << (int)m_fields.addr.regid; + os << ",offset=" << m_fields.offset << ",payloadlen=" << m_fields.payload_length << ",seqnr=" << m_fields.seqnr << "]"; + return (os); +} diff --git a/MAC/APL/PIC/RSP_Protocol/src/RCUSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/RCUSettings.cc index 0f3fdd882cc9601dc20120166ea4b6aba825950b..b3aa0a8eaba34f61dd81ede0028a9724f4c1f55f 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/RCUSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/RCUSettings.cc @@ -75,25 +75,25 @@ int RCUSettings::Control::getNyquistZone() const return retval; } -unsigned int RCUSettings::getSize() +size_t RCUSettings::getSize() const { - return MSH_ARRAY_SIZE(m_registers, RCUSettings::Control); + return MSH_size(m_registers); } -unsigned int RCUSettings::pack (void* buffer) +size_t RCUSettings::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_registers, RCUSettings::Control); + MSH_pack(buffer, offset, m_registers); return offset; } -unsigned int RCUSettings::unpack(void *buffer) +size_t RCUSettings::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_registers, RCUSettings::Control, 1); + MSH_unpack(buffer, offset, m_registers); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/RSP_Protocol.prot b/MAC/APL/PIC/RSP_Protocol/src/RSP_Protocol.prot index 61defafcaf5080199bd9e589c89e2a150a238893..75092c73c786c468c9b1dd74ffa2a00ddbc11cd7 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/RSP_Protocol.prot +++ b/MAC/APL/PIC/RSP_Protocol/src/RSP_Protocol.prot @@ -33,6 +33,7 @@ include = '<APL/RSP_Protocol/Versions.h>'; include = '<APL/RSP_Protocol/WGSettings.h>'; include = '<APL/RSP_Protocol/XCStatistics.h>'; include = '<APL/RSP_Protocol/Latency.h>'; +include = '<APL/RSP_Protocol/Bitmode.h>'; prelude = << PRELUDE_END @@ -187,7 +188,17 @@ static const int RSP_RAW_BLOCK_SIZE = 1480; // GETDATASTREAM (timestamp, cache) // GETDATASTREAMACK (timestamp, status, switch_on) -// 120 commands +// SETBITMODE (timestamp, bitmode); +// SETBITMODEACK (timestamp, status); +// GETBITMODE (timestamp); +// GETBITMODEACK (timestamp, status, bitmode); +// SUBBITMODE (timestamp, period) +// SUBBITMODEACK (timestamp, status, handle) +// UPDBITMODE (timestamp, status, handle, bitmode) +// UNSUBBITMODE (handle) +// UNSUBBITMODEACK (timestamp, status, handle) + +// 129 commands PRELUDE_END; @@ -2089,7 +2100,7 @@ event = { }; }; -// GETSPLITTER(timestamp, rspmask, cache); +// GETSPLITTER(timestamp, cache); event = { signal = GETSPLITTER; dir = IN; @@ -2104,7 +2115,7 @@ event = { }; }; -// GETSPLITTERACK(timestamp, status, splitters) +// GETSPLITTERACK(timestamp, status, splitter) event = { signal = GETSPLITTERACK; dir = OUT; @@ -2311,3 +2322,171 @@ event = { }; }; + +// bitmode info +// 16 = 16bit +// 8 = 8bit +// 4 = 4bit +// SETBITMODE (timestamp, bits_per_sample); +event = { + signal = SETBITMODE; + dir = IN; + param = { + name = "timestamp"; + type = "RTC::Timestamp"; + userdefined; + }; + param = { + name = "rspmask"; + type = "bitset<MAX_N_RSPBOARDS>"; + }; + param = { + name = "bits_per_sample"; + type = "uint16"; + }; +}; + +// SETBITMODEACK(timestamp, status); +event = { + signal = SETBITMODEACK; + dir = OUT; + param = { + name = "timestamp"; + type = "RTC::Timestamp"; + userdefined; + }; + param = { + name = "status"; + type = "int16"; + }; +}; + +// GETBITMODE(timestamp, cache); +event = { + signal = GETBITMODE; + dir = IN; + param = { + name = "timestamp"; + type = "RTC::Timestamp"; + userdefined; + }; + param = { + name = "cache"; + type = "uint8"; + }; +}; + +// GETBITMODEACK(timestamp, status, bitmode_version, bits_per_sample) +event = { + signal = GETBITMODEACK; + dir = OUT; + param = { + name = "timestamp"; + type = "RTC::Timestamp"; + userdefined; + }; + param = { + name = "status"; + type = "int16"; + }; + param = { + name = "bitmode_version"; + type = "uint16[MAX_N_RSPBOARDS]"; + }; + param = { + name = "bits_per_sample"; + type = "uint16[MAX_N_RSPBOARDS]"; + }; +}; + +// SUBBITMODE(timestamp, period) +event = { + signal = SUBBITMODE; + dir = IN; + param = { + name = "timestamp"; + type = "RTC::Timestamp"; + userdefined; + }; + param = { + name = "period"; + type = "uint16"; + }; +}; + +// SUBBITMODEACK(timestamp, status, handle) +event = { + signal = SUBBITMODEACK; + dir = OUT; + param = { + name = "timestamp"; + type = "RTC::Timestamp"; + userdefined; + }; + param = { + name = "status"; + type = "int16"; + }; + param = { + name = "handle"; + type = "memptr_t"; + }; +}; + +// UPDBITMODE(timestamp, status, handle, bitmode_version, bits_per_sample) +event = { + signal = UPDBITMODE; + dir = OUT; + param = { + name = "timestamp"; + type = "RTC::Timestamp"; + userdefined; + }; + param = { + name = "status"; + type = "int16"; + }; + param = { + name = "handle"; + type = "memptr_t"; + }; + param = { + name = "bitmode_version"; + type = "uint16[MAX_N_RSPBOARDS]"; + }; + param = { + name = "bits_per_sample"; + type = "uint16[MAX_N_RSPBOARDS]"; + }; +}; + +// UNSUBBITMODE(handle) +event = { + signal = UNSUBBITMODE; + dir = IN; + param = { + name = "handle"; + type = "memptr_t"; + }; +}; + +// UNSUBBITMODEACK (timestamp, status, handle) +event = { + signal = UNSUBBITMODEACK; + dir = OUT; + param = { + name = "timestamp"; + type = "RTC::Timestamp"; + userdefined; + }; + param = { + name = "status"; + type = "int16"; + }; + param = { + name = "handle"; + type = "memptr_t"; + }; +}; + + diff --git a/MAC/APL/PIC/RSP_Protocol/src/RSUSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/RSUSettings.cc index 8e253f442076fba94ae70e33eb8da56c7fdf144d..e8073f662bc83938e89955080da48d9564a9e25e 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/RSUSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/RSUSettings.cc @@ -32,25 +32,25 @@ using namespace LOFAR; using namespace RSP_Protocol; -unsigned int RSUSettings::getSize() +size_t RSUSettings::getSize() const { - return MSH_ARRAY_SIZE(m_registers, RSUSettings::ResetControl); + return MSH_size(m_registers); } -unsigned int RSUSettings::pack (void* buffer) +size_t RSUSettings::pack (char * buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_registers, RSUSettings::ResetControl); + MSH_pack(buffer, offset, m_registers); return offset; } -unsigned int RSUSettings::unpack(void *buffer) +size_t RSUSettings::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_registers, RSUSettings::ResetControl, 1); + MSH_unpack(buffer, offset, m_registers); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/SPUStatus.cc b/MAC/APL/PIC/RSP_Protocol/src/SPUStatus.cc index a34fa83874ee15e41d609eb9ff3223d643910bed..4bc185ba6e4eff730435dde76fb23535e6c890b6 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/SPUStatus.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/SPUStatus.cc @@ -36,25 +36,25 @@ using namespace LOFAR; using namespace RSP_Protocol; using namespace EPA_Protocol; -unsigned int SPUStatus::getSize() +size_t SPUStatus::getSize() const { - return MSH_ARRAY_SIZE(itsSPUStatus, EPA_Protocol::SPUBoardStatus); + return MSH_size(itsSPUStatus); } -unsigned int SPUStatus::pack (void* buffer) +size_t SPUStatus::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, itsSPUStatus, EPA_Protocol::SPUBoardStatus); + MSH_pack(buffer, offset, itsSPUStatus); return offset; } -unsigned int SPUStatus::unpack(void *buffer) +size_t SPUStatus::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, itsSPUStatus, EPA_Protocol::SPUBoardStatus, 1); + MSH_unpack(buffer, offset, itsSPUStatus); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/Statistics.cc b/MAC/APL/PIC/RSP_Protocol/src/Statistics.cc index ca6fb71dbff5151cb5587a6a9b33fc0d101ab28b..91b0b9d48b943e556e65117ab928a774532bdeaa 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/Statistics.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/Statistics.cc @@ -31,25 +31,25 @@ using namespace blitz; using namespace LOFAR; using namespace RSP_Protocol; -unsigned int Statistics::getSize() +size_t Statistics::getSize() const { - return MSH_ARRAY_SIZE(m_statistics, double); + return MSH_size(m_statistics); } -unsigned int Statistics::pack (void* buffer) +size_t Statistics::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_statistics, double); + MSH_pack(buffer, offset, m_statistics); return offset; } -unsigned int Statistics::unpack(void *buffer) +size_t Statistics::unpack(const char*buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_statistics, double, 2); + MSH_unpack(buffer, offset, m_statistics); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/SubbandSelection.cc b/MAC/APL/PIC/RSP_Protocol/src/SubbandSelection.cc index 9ff35ef7658d54c6590ede101accbd01b9880c41..e5b11c6dfe8021bc62bd3fac5bbee1c53ddde268 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/SubbandSelection.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/SubbandSelection.cc @@ -33,36 +33,39 @@ using namespace blitz; using namespace LOFAR; using namespace RSP_Protocol; -unsigned int SubbandSelection::getSize() +size_t SubbandSelection::getSize() const { - return MSH_ARRAY_SIZE(m_subbands, uint16) + sizeof(uint16); + cout << itsCrosslets.dimensions() << "; " << itsCrosslets.size() << endl; + cout << itsBeamlets.dimensions() << "; " << itsBeamlets.size() << endl; + + return MSH_size(itsCrosslets) + + MSH_size(itsBeamlets) + + sizeof(uint16); } -unsigned int SubbandSelection::pack(void* buffer) +size_t SubbandSelection::pack(char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_subbands, uint16); - memcpy((char*)buffer + offset, &m_type, sizeof(uint16)); + MSH_pack(buffer, offset, itsCrosslets); + MSH_pack(buffer, offset, itsBeamlets); + memcpy(buffer + offset, &m_type, sizeof(uint16)); offset += sizeof(uint16); return offset; } -unsigned int SubbandSelection::unpack(void *buffer) +size_t SubbandSelection::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_subbands, uint16, 2); - memcpy(&m_type, (char*)buffer + offset, sizeof(uint16)); + MSH_unpack(buffer, offset, itsCrosslets); + MSH_unpack(buffer, offset, itsBeamlets); + memcpy(&m_type, buffer + offset, sizeof(uint16)); offset += sizeof(uint16); return offset; } -Array<uint16,2>& SubbandSelection::operator()() -{ - return m_subbands; -} diff --git a/MAC/APL/PIC/RSP_Protocol/src/SystemStatus.cc b/MAC/APL/PIC/RSP_Protocol/src/SystemStatus.cc index 4a951af2c2381152d9b5c505680483e32ceb3384..a68bd1f8ed5e41b454c612f4cb78c204dffd1570 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/SystemStatus.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/SystemStatus.cc @@ -36,25 +36,25 @@ using namespace LOFAR; using namespace RSP_Protocol; using namespace EPA_Protocol; -unsigned int SystemStatus::getSize() +size_t SystemStatus::getSize() const { - return MSH_ARRAY_SIZE(m_board_status, EPA_Protocol::BoardStatus); + return MSH_size(m_board_status); } -unsigned int SystemStatus::pack (void* buffer) +size_t SystemStatus::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_board_status, EPA_Protocol::BoardStatus); + MSH_pack(buffer, offset, m_board_status); return offset; } -unsigned int SystemStatus::unpack(void *buffer) +size_t SystemStatus::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_board_status, EPA_Protocol::BoardStatus, 1); + MSH_unpack(buffer, offset, m_board_status); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/TBBSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/TBBSettings.cc index 0041fcc55be51b9becadef3c3805dd1f0f6b11af..0ce0dad106113a98d5b96df862f12e25a840211b 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/TBBSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/TBBSettings.cc @@ -31,25 +31,25 @@ using namespace blitz; using namespace LOFAR; using namespace RSP_Protocol; -unsigned int TBBSettings::getSize() +size_t TBBSettings::getSize() const { - return MSH_ARRAY_SIZE(m_bandsel, bitset<MEPHeader::N_SUBBANDS>); + return MSH_size(m_bandsel); } -unsigned int TBBSettings::pack (void* buffer) +size_t TBBSettings::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_bandsel, bitset<MEPHeader::N_SUBBANDS>); + MSH_pack(buffer, offset, m_bandsel); return offset; } -unsigned int TBBSettings::unpack(void *buffer) +size_t TBBSettings::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_bandsel, bitset<MEPHeader::N_SUBBANDS>, 1); + MSH_unpack(buffer, offset, m_bandsel); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/TDStatus.cc b/MAC/APL/PIC/RSP_Protocol/src/TDStatus.cc index ea425cd3b0d49d61b265ff54073a272e519f2c2b..6fe844f89bc5b82144ba545eda8af3863d42f010 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/TDStatus.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/TDStatus.cc @@ -36,25 +36,25 @@ using namespace LOFAR; using namespace RSP_Protocol; using namespace EPA_Protocol; -unsigned int TDStatus::getSize() +size_t TDStatus::getSize() const { - return MSH_ARRAY_SIZE(m_board_status, EPA_Protocol::TDBoardStatus); + return MSH_size(m_board_status); } -unsigned int TDStatus::pack (void* buffer) +size_t TDStatus::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_board_status, EPA_Protocol::TDBoardStatus); + MSH_pack(buffer, offset, m_board_status); return offset; } -unsigned int TDStatus::unpack(void *buffer) +size_t TDStatus::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_board_status, EPA_Protocol::TDBoardStatus, 1); + MSH_unpack(buffer, offset, m_board_status); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/Versions.cc b/MAC/APL/PIC/RSP_Protocol/src/Versions.cc index e8b1f126ffe40c0acdb4be91c478380d5f732767..0a022b0d76ad95c0bda4dcfc7e7787088e1b1d86 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/Versions.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/Versions.cc @@ -31,29 +31,29 @@ using namespace blitz; using namespace LOFAR; using namespace RSP_Protocol; -unsigned int Versions::getSize() +size_t Versions::getSize() const { return - MSH_ARRAY_SIZE(m_bp_versions, EPA_Protocol::RSRVersion) - + MSH_ARRAY_SIZE(m_ap_versions, EPA_Protocol::RSRVersion); + MSH_size(m_bp_versions) + + MSH_size(m_ap_versions); } -unsigned int Versions::pack (void* buffer) +size_t Versions::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_bp_versions, EPA_Protocol::RSRVersion); - MSH_PACK_ARRAY(buffer, offset, m_ap_versions, EPA_Protocol::RSRVersion); + MSH_pack(buffer, offset, m_bp_versions); + MSH_pack(buffer, offset, m_ap_versions); return offset; } -unsigned int Versions::unpack(void *buffer) +size_t Versions::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_bp_versions, EPA_Protocol::RSRVersion, 1); - MSH_UNPACK_ARRAY(buffer, offset, m_ap_versions, EPA_Protocol::RSRVersion, 1); + MSH_unpack(buffer, offset, m_bp_versions); + MSH_unpack(buffer, offset, m_ap_versions); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/WGSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/WGSettings.cc index db7cfa624973253c566e43f60f713a1c7f923275..4336bc9a1d825c917215b9863051870157f9c104 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/WGSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/WGSettings.cc @@ -97,25 +97,25 @@ void WGSettings::initWaveformPresets() LOG_DEBUG_STR("ramp=" << WGSettings::m_presets(PRESET_RAMP, Range::all())); } -unsigned int WGSettings::getSize() +size_t WGSettings::getSize() const { - return MSH_ARRAY_SIZE(m_registers, WGRegisterType); + return MSH_size(m_registers); } -unsigned int WGSettings::pack (void* buffer) +size_t WGSettings::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_registers, WGRegisterType); + MSH_pack(buffer, offset, m_registers); return offset; } -unsigned int WGSettings::unpack(void *buffer) +size_t WGSettings::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_registers, WGRegisterType, 1); + MSH_unpack(buffer, offset, m_registers); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/XCStatistics.cc b/MAC/APL/PIC/RSP_Protocol/src/XCStatistics.cc index 84ffde4214684866fed91b2a4b3e60ca7a354143..fa75352da97e9d61d7712160163d5923d39b73db 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/XCStatistics.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/XCStatistics.cc @@ -31,25 +31,25 @@ using namespace blitz; using namespace LOFAR; using namespace RSP_Protocol; -unsigned int XCStatistics::getSize() +size_t XCStatistics::getSize() const { - return MSH_ARRAY_SIZE(m_xstatistics, complex<double>); + return MSH_size(m_xstatistics); } -unsigned int XCStatistics::pack (void* buffer) +size_t XCStatistics::pack (char* buffer) const { - unsigned int offset = 0; + size_t offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_xstatistics, complex<double>); + MSH_pack(buffer, offset, m_xstatistics); return offset; } -unsigned int XCStatistics::unpack(void *buffer) +size_t XCStatistics::unpack(const char *buffer) { - unsigned int offset = 0; + size_t offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_xstatistics, complex<double>, 4); + MSH_unpack(buffer, offset, m_xstatistics); return offset; } diff --git a/MAC/APL/RTCCommon/include/APL/RTCCommon/MarshallBlitz.h b/MAC/APL/RTCCommon/include/APL/RTCCommon/MarshallBlitz.h index 383b3201fc3b079cc30915622407558228a2dca7..257d885b605c565e3a2cbb790b086a700fdf0622 100644 --- a/MAC/APL/RTCCommon/include/APL/RTCCommon/MarshallBlitz.h +++ b/MAC/APL/RTCCommon/include/APL/RTCCommon/MarshallBlitz.h @@ -30,48 +30,50 @@ #include <cstring> // SIZE blitz::array<...> -#define MSH_ARRAY_SIZE(array, datatype) \ - (((array).dimensions()*sizeof(int32)) + ((array).size() * sizeof(datatype))) +template<typename T, int N> size_t MSH_size( const blitz::Array<T,N> &array ) +{ + return array.dimensions() * sizeof(LOFAR::int32) + array.size() * sizeof(T); +} // PACK blitz::array<...> // first copy the dimensions of the array, then the array itself. -#define MSH_PACK_ARRAY(bufptr, offset, array, datatype) \ -do { \ - for (int dim = blitz::firstDim; dim < blitz::firstDim + (array).dimensions(); dim++) { \ - int32 extent = (array).extent(dim); \ - memcpy(((char*)(bufptr)) + (offset), &extent, sizeof(int32)); \ - offset += sizeof(int32); \ - } \ - \ - if ((array).numElements() > 0) { \ - if ((array).isStorageContiguous()) { \ - memcpy(((char*)(bufptr)) + (offset), (array).data(), (array).size() * sizeof(datatype)); \ - offset += (array).size() * sizeof(datatype); \ - } \ - else { \ - LOG_FATAL("array must be contiguous"); \ - exit(EXIT_FAILURE); \ - } \ - } \ -} while (0) +template<typename T, int N> void MSH_pack( char *bufptr, size_t &offset, const blitz::Array<T,N> &array ) +{ + for (int dim = blitz::firstDim; dim < blitz::firstDim + N; dim++) { + LOFAR::int32 extent = array.extent(dim); + memcpy(bufptr + offset, &extent, sizeof(LOFAR::int32)); + offset += sizeof(LOFAR::int32); + } + + if ((array).numElements() > 0) { + if ((array).isStorageContiguous()) { + memcpy(bufptr + offset, array.data(), array.size() * sizeof(T)); + offset += array.size() * sizeof(T); + } + else { + LOG_FATAL("array must be contiguous"); + exit(EXIT_FAILURE); + } + } +} // UNPACK blitz::array<...> -#define MSH_UNPACK_ARRAY(bufptr, offset, array, datatype, dims) \ -do { \ - blitz::TinyVector<int, (dims)> extent; \ - \ - for (int dim = blitz::firstDim; dim < blitz::firstDim + (dims); dim++) { \ - int32 extenttmp = array.extent(dim); \ - memcpy(&extenttmp, ((char*)(bufptr)) + (offset), sizeof(int32)); \ - offset += sizeof(int32); \ - extent(dim - blitz::firstDim) = extenttmp; \ - } \ - \ - /* resize the array to the correct size */ \ - array.resize(extent); \ - \ - memcpy(array.data(), ((char*)(bufptr)) + (offset), array.size() * sizeof(datatype)); \ - offset += array.size() * sizeof(datatype); \ -} while (0) +template<typename T, int N> void MSH_unpack( const char *bufptr, size_t &offset, blitz::Array<T,N> &array ) +{ + blitz::TinyVector<int, N> extent; -#endif /* MARSHALLING_H_ */ + for (int dim = blitz::firstDim; dim < blitz::firstDim + N; dim++) { + LOFAR::int32 extenttmp = array.extent(dim); + memcpy(&extenttmp, bufptr + offset, sizeof(LOFAR::int32)); + offset += sizeof(LOFAR::int32); + extent(dim - blitz::firstDim) = extenttmp; + } + + /* resize the array to the correct size */ + array.resize(extent); + + memcpy(array.data(), bufptr + offset, array.size() * sizeof(T)); + offset += array.size() * sizeof(T); +} + +#endif /* MARSHALLBLITZ_H_ */ diff --git a/MAC/APL/RTCCommon/include/APL/RTCCommon/NsTimestamp.h b/MAC/APL/RTCCommon/include/APL/RTCCommon/NsTimestamp.h index a0a3e6effcd13609b54e1fed1ef7a8e02176b96b..97cea6c185bf00dcf71a05704999a7549a110093 100644 --- a/MAC/APL/RTCCommon/include/APL/RTCCommon/NsTimestamp.h +++ b/MAC/APL/RTCCommon/include/APL/RTCCommon/NsTimestamp.h @@ -96,9 +96,9 @@ public: /*@{*/ // marshalling methods - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize(); + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: @@ -194,24 +194,24 @@ inline bool NsTimestamp::operator!=(const NsTimestamp& rhs) const inline long NsTimestamp::sec() const { return itsSec; } inline long NsTimestamp::nsec() const { return itsNsec; } -inline unsigned int NsTimestamp::getSize() +inline size_t NsTimestamp::getSize() { return (2 * sizeof(int64)); } -inline unsigned int NsTimestamp::pack (void* __buffer) +inline size_t NsTimestamp::pack (char* __buffer) const { - uint32 __valSize(sizeof(int64)); + size_t __valSize(sizeof(int64)); memcpy(__buffer, &itsSec, __valSize); memcpy((char*)__buffer+__valSize, &itsNsec, __valSize); return (2*__valSize); } -inline unsigned int NsTimestamp::unpack(void *__buffer) +inline size_t NsTimestamp::unpack(const char *__buffer) { - uint32 __valSize(sizeof(int64)); + size_t __valSize(sizeof(int64)); memcpy(&itsSec, __buffer, __valSize); - memcpy(&itsNsec, (char*)__buffer+__valSize, __valSize); + memcpy(&itsNsec, __buffer + __valSize, __valSize); return (2*__valSize); } diff --git a/MAC/APL/RTCCommon/include/APL/RTCCommon/RegisterState.h b/MAC/APL/RTCCommon/include/APL/RTCCommon/RegisterState.h index 296bbd0c626e5573383658141d50d7eb1ce0d7ca..90078e734a9914090364a9f0181571192d84f1f3 100644 --- a/MAC/APL/RTCCommon/include/APL/RTCCommon/RegisterState.h +++ b/MAC/APL/RTCCommon/include/APL/RTCCommon/RegisterState.h @@ -129,19 +129,19 @@ public: RegisterState& operator=(const RegisterState& state); /* marshalling methods */ - unsigned int getSize() { - return MSH_ARRAY_SIZE(m_state, State); + size_t getSize() const { + return MSH_size(m_state); } - unsigned int pack(void* buffer) { - unsigned int offset = 0; - MSH_PACK_ARRAY(buffer, offset, m_state, State); + size_t pack(char* buffer) const { + size_t offset = 0; + MSH_pack(buffer, offset, m_state); return offset; } - unsigned int unpack(void* buffer) { - unsigned int offset = 0; - MSH_UNPACK_ARRAY(buffer, offset, m_state, State, 1); + size_t unpack(const char* buffer) { + size_t offset = 0; + MSH_unpack(buffer, offset, m_state); return offset; } diff --git a/MAC/APL/RTCCommon/include/APL/RTCCommon/Timestamp.h b/MAC/APL/RTCCommon/include/APL/RTCCommon/Timestamp.h index c0caca1d0e85dd8435feaf93de5ce2f2f7bea6c1..c4be06cd248d58c2b423a70d03941f0b1f3719b1 100644 --- a/MAC/APL/RTCCommon/include/APL/RTCCommon/Timestamp.h +++ b/MAC/APL/RTCCommon/include/APL/RTCCommon/Timestamp.h @@ -131,9 +131,9 @@ public: /** * marshalling methods */ - unsigned int getSize(); - unsigned int pack (void* buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); /*@}*/ private: @@ -156,18 +156,18 @@ private: } inline void Timestamp::get(struct timeval *tv) const { if (tv) *tv = m_tv; } - inline unsigned int Timestamp::getSize() + inline size_t Timestamp::getSize() const { return sizeof(struct timeval); } - inline unsigned int Timestamp::pack (void* buffer) + inline size_t Timestamp::pack (char* buffer) const { memcpy(buffer, &m_tv, sizeof(struct timeval)); return sizeof(struct timeval); } - inline unsigned int Timestamp::unpack(void *buffer) + inline size_t Timestamp::unpack(const char *buffer) { memcpy(&m_tv, buffer, sizeof(struct timeval)); return sizeof(struct timeval); diff --git a/MAC/APL/RTCCommon/test/tMarshallBlitz.cc b/MAC/APL/RTCCommon/test/tMarshallBlitz.cc index 3896de521cc909b0577c84af469ef3daebf1f6a9..9ed18a6ccce83e6aa122efc528313a270e7dcf21 100644 --- a/MAC/APL/RTCCommon/test/tMarshallBlitz.cc +++ b/MAC/APL/RTCCommon/test/tMarshallBlitz.cc @@ -37,7 +37,7 @@ int main (int, char* argv[]) INIT_LOGGER(argv[0]); char buf[4096]; - int offset(0); + size_t offset(0); // blitz array <double> blitz::Array<double, 2> ba1(2,4); @@ -47,34 +47,34 @@ int main (int, char* argv[]) 40, 41; cout << "Testing blitz::Array<double, 2>" << ba1 << endl; - cout << "size = " << MSH_ARRAY_SIZE(ba1, double) << endl; + cout << "size = " << MSH_size(ba1) << endl; bzero(buf, 4096); offset = 0; - MSH_PACK_ARRAY(buf, offset, ba1, double); + MSH_pack(buf, offset, ba1); cout << "packed:" << endl; hexdump(buf, offset); blitz::Array<double, 2> ba2(2,4); offset = 0; - MSH_UNPACK_ARRAY(buf, offset, ba2, double, 2); + MSH_unpack(buf, offset, ba2); cout << "unpacked: " << ba2 << endl; // blitz array <int> blitz::Array<int, 2> emptyArr; cout << "Testing EMPTY blitz::Array<int, 2>" << emptyArr << endl; - cout << "size = " << MSH_ARRAY_SIZE(emptyArr, int) << endl; + cout << "size = " << MSH_size(emptyArr) << endl; bzero(buf, 4096); offset = 0; - MSH_PACK_ARRAY(buf, offset, emptyArr, int); + MSH_pack(buf, offset, emptyArr); cout << "packed:" << endl; hexdump(buf, offset); blitz::Array<int, 2> empty2; offset = 0; - MSH_UNPACK_ARRAY(buf, offset, empty2, int, 2); + MSH_unpack(buf, offset, empty2); cout << "unpacked: " << empty2 << endl; return (0); diff --git a/MAC/APL/StationCU/src/BeamControl/PVSSDatapointDefs.h b/MAC/APL/StationCU/src/BeamControl/PVSSDatapointDefs.h index 3ddc45b8e81a8ca449815e983a20b63f95bf8f2f..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/StationCU/src/BeamControl/PVSSDatapointDefs.h +++ b/MAC/APL/StationCU/src/BeamControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v1.0 on Wed Feb 4 15:00:05 UTC 2009 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,12 +25,15 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" -#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" #define PN_OBS_CLAIM_PERIOD "claimPeriod" #define PN_OBS_PREPARE_PERIOD "preparePeriod" #define PN_OBS_START_TIME "startTime" @@ -54,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -61,24 +55,88 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" +#define PN_OBSCTRL_COMMAND "command" + +// InputBuffer +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" +#define PST_INPUT_BUFFER "InputBuffer" +#define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" +#define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" +#define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" +#define PN_IPB_STREAM0_REJECTED "stream0.rejected" +#define PN_IPB_STREAM1_BLOCKS_IN "stream1.blocksIn" +#define PN_IPB_STREAM1_PERC_BAD "stream1.percBad" +#define PN_IPB_STREAM1_REJECTED "stream1.rejected" +#define PN_IPB_STREAM2_BLOCKS_IN "stream2.blocksIn" +#define PN_IPB_STREAM2_PERC_BAD "stream2.percBad" +#define PN_IPB_STREAM2_REJECTED "stream2.rejected" +#define PN_IPB_STREAM3_BLOCKS_IN "stream3.blocksIn" +#define PN_IPB_STREAM3_PERC_BAD "stream3.percBad" +#define PN_IPB_STREAM3_REJECTED "stream3.rejected" +#define PN_IPB_LATE "late" +#define PN_IPB_IO_TIME "IOTime" + +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" -// OnlineControl -#define PSN_ONLINE_CONTROL "LOFAR_ObsSW_@observation@_OnlineControl" -#define PST_ONLINE_CONTROL "OnlineControl" +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" -// Correlator -#define PSN_CORRELATOR "LOFAR_ObsSW_@observation@_OnlineControl_Correlator" -#define PST_CORRELATOR "Correlator" +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" -// StorageAppl -#define PSN_STORAGE_APPL "LOFAR_ObsSW_@observation@_OnlineControl_StorageAppl" -#define PST_STORAGE_APPL "StorageAppl" +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -88,8 +146,8 @@ #define PN_CAB_FRONT_FAN_OUTER "frontFanOuter" #define PN_CAB_FRONT_AIRFLOW "frontAirflow" #define PN_CAB_BACK_DOOR_OPEN "backDoorOpen" -#define PN_CAB_BACKT_FAN_INNER "backtFanInner" -#define PN_CAB_BACKT_FAN_OUTER "backtFanOuter" +#define PN_CAB_BACK_FAN_INNER "backFanInner" +#define PN_CAB_BACK_FAN_OUTER "backFanOuter" #define PN_CAB_BACK_AIRFLOW "backAirflow" #define PN_CAB_TEMP_ALARM "tempAlarm" #define PN_CAB_HUMIDITY_ALARM "humidityAlarm" @@ -135,7 +193,10 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" +#define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" #define PN_RSP__ETHERNET_STATUS_CHILD_STATE "Ethernet.status.childState" #define PN_RSP__ETHERNET_STATUS_MESSAGE "Ethernet.status.message" @@ -216,10 +277,15 @@ #define PN_RCU_TRIGGER_FILTER "Trigger.filter" #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -247,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -260,10 +382,12 @@ #define PST_HARDWARE_MONITOR "HardwareMonitor" #define PN_HWM_RSP_CONNECTED "RSP.connected" #define PN_HWM_TBB_CONNECTED "TBB.connected" +#define PN_HWM_EC_CONNECTED "EC.connected" // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -280,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -300,6 +413,9 @@ #define PN_OBS_NAME "name" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" @@ -336,5 +452,6 @@ #define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" #define PN_TBC_TRIGGER_FLAGS "trigger.flags" #define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" #endif diff --git a/MAC/APL/StationCU/src/CalibrationControl/PVSSDatapointDefs.h b/MAC/APL/StationCU/src/CalibrationControl/PVSSDatapointDefs.h index 3ddc45b8e81a8ca449815e983a20b63f95bf8f2f..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/StationCU/src/CalibrationControl/PVSSDatapointDefs.h +++ b/MAC/APL/StationCU/src/CalibrationControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v1.0 on Wed Feb 4 15:00:05 UTC 2009 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,12 +25,15 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" -#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" #define PN_OBS_CLAIM_PERIOD "claimPeriod" #define PN_OBS_PREPARE_PERIOD "preparePeriod" #define PN_OBS_START_TIME "startTime" @@ -54,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -61,24 +55,88 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" +#define PN_OBSCTRL_COMMAND "command" + +// InputBuffer +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" +#define PST_INPUT_BUFFER "InputBuffer" +#define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" +#define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" +#define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" +#define PN_IPB_STREAM0_REJECTED "stream0.rejected" +#define PN_IPB_STREAM1_BLOCKS_IN "stream1.blocksIn" +#define PN_IPB_STREAM1_PERC_BAD "stream1.percBad" +#define PN_IPB_STREAM1_REJECTED "stream1.rejected" +#define PN_IPB_STREAM2_BLOCKS_IN "stream2.blocksIn" +#define PN_IPB_STREAM2_PERC_BAD "stream2.percBad" +#define PN_IPB_STREAM2_REJECTED "stream2.rejected" +#define PN_IPB_STREAM3_BLOCKS_IN "stream3.blocksIn" +#define PN_IPB_STREAM3_PERC_BAD "stream3.percBad" +#define PN_IPB_STREAM3_REJECTED "stream3.rejected" +#define PN_IPB_LATE "late" +#define PN_IPB_IO_TIME "IOTime" + +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" -// OnlineControl -#define PSN_ONLINE_CONTROL "LOFAR_ObsSW_@observation@_OnlineControl" -#define PST_ONLINE_CONTROL "OnlineControl" +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" -// Correlator -#define PSN_CORRELATOR "LOFAR_ObsSW_@observation@_OnlineControl_Correlator" -#define PST_CORRELATOR "Correlator" +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" -// StorageAppl -#define PSN_STORAGE_APPL "LOFAR_ObsSW_@observation@_OnlineControl_StorageAppl" -#define PST_STORAGE_APPL "StorageAppl" +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -88,8 +146,8 @@ #define PN_CAB_FRONT_FAN_OUTER "frontFanOuter" #define PN_CAB_FRONT_AIRFLOW "frontAirflow" #define PN_CAB_BACK_DOOR_OPEN "backDoorOpen" -#define PN_CAB_BACKT_FAN_INNER "backtFanInner" -#define PN_CAB_BACKT_FAN_OUTER "backtFanOuter" +#define PN_CAB_BACK_FAN_INNER "backFanInner" +#define PN_CAB_BACK_FAN_OUTER "backFanOuter" #define PN_CAB_BACK_AIRFLOW "backAirflow" #define PN_CAB_TEMP_ALARM "tempAlarm" #define PN_CAB_HUMIDITY_ALARM "humidityAlarm" @@ -135,7 +193,10 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" +#define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" #define PN_RSP__ETHERNET_STATUS_CHILD_STATE "Ethernet.status.childState" #define PN_RSP__ETHERNET_STATUS_MESSAGE "Ethernet.status.message" @@ -216,10 +277,15 @@ #define PN_RCU_TRIGGER_FILTER "Trigger.filter" #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -247,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -260,10 +382,12 @@ #define PST_HARDWARE_MONITOR "HardwareMonitor" #define PN_HWM_RSP_CONNECTED "RSP.connected" #define PN_HWM_TBB_CONNECTED "TBB.connected" +#define PN_HWM_EC_CONNECTED "EC.connected" // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -280,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -300,6 +413,9 @@ #define PN_OBS_NAME "name" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" @@ -336,5 +452,6 @@ #define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" #define PN_TBC_TRIGGER_FLAGS "trigger.flags" #define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" #endif diff --git a/MAC/APL/StationCU/src/ClockControl/ClockControl.cc b/MAC/APL/StationCU/src/ClockControl/ClockControl.cc index 248b860a697cbf4d7661d74188321578d5bac264..65423c1a9819c24a473a806d47a3c1f706de91ae 100644 --- a/MAC/APL/StationCU/src/ClockControl/ClockControl.cc +++ b/MAC/APL/StationCU/src/ClockControl/ClockControl.cc @@ -49,6 +49,31 @@ namespace LOFAR { using namespace APLCommon; namespace StationCU { + +static string bitmodeVersionString(uint16 version) +{ + switch(version) { + case 0: return "16"; + case 1: return "16/8"; + case 2: return "16/8/4"; + default: return "??"; + } +} + +static bool bitmodeSupported(unsigned bitmode, uint16 version) +{ + if (bitmode == 16) + return true; + + if (bitmode == 8) + return version >= 1; + + if (bitmode == 4) + return version >= 2; + + return false; +} + // static pointer to this object for signal handler static ClockControl* thisClockControl = 0; @@ -63,7 +88,12 @@ ClockControl::ClockControl(const string& cntlrName) : itsTimerPort (0), itsRSPDriver (0), itsCommandPort (0), - itsClock (0) + itsNrRSPs (0), + + // we need default values to push in case the boards are set to 0 + itsClock (200), + itsBitmode (16), + itsBitmodeVersion (0) { LOG_TRACE_OBJ_STR (cntlrName << " construction"); LOG_INFO(Version::getInfo<StationCUVersion>("ClockControl")); @@ -92,6 +122,10 @@ ClockControl::ClockControl(const string& cntlrName) : registerProtocol (DP_PROTOCOL, DP_PROTOCOL_STRINGS); registerProtocol (RSP_PROTOCOL, RSP_PROTOCOL_STRINGS); registerProtocol (CLOCK_PROTOCOL, CLOCK_PROTOCOL_STRINGS); + + StationConfig sc; + + itsNrRSPs = sc.nrRSPs; } @@ -103,6 +137,7 @@ ClockControl::~ClockControl() LOG_TRACE_OBJ_STR (getName() << " destruction"); cancelClockSubscription(); // tell RSPdriver to stop sending updates. + cancelBitmodeSubscription(); // tell RSPdriver to stop sending updates. cancelSplitterSubscription(); // tell RSPdriver to stop sending updates. if (itsCommandPort) { @@ -161,7 +196,7 @@ void ClockControl::_databaseEventHandler(GCFEvent& event) if (strstr(dpEvent.DPname.c_str(), PN_CLC_REQUESTED_CLOCK) != 0) { GCFPVInteger* clockObj = (GCFPVInteger*)dpEvent.value._pValue; - int32 newClock = clockObj->getValue(); + uint32 newClock = clockObj->getValue(); if (newClock != itsClock) { itsClock = newClock; LOG_DEBUG_STR("Received clock change from PVSS, clock is now " << itsClock); @@ -170,6 +205,18 @@ void ClockControl::_databaseEventHandler(GCFEvent& event) } break; } + + if (strstr(dpEvent.DPname.c_str(), PN_CLC_REQUESTED_BITMODE) != 0) { + GCFPVInteger* bitmodeObj = (GCFPVInteger*)dpEvent.value._pValue; + int32 newBitmode = bitmodeObj->getValue(); + if (newBitmode != itsBitmode) { + itsBitmode = newBitmode; + LOG_DEBUG_STR("Received bitmode change from PVSS, bitmode is now " << itsBitmode); + TRAN(ClockControl::setBitmode_state); + // sendBitmodeSetting(); + } + break; + } LOG_WARN_STR("Got VCHANGEMSG signal from unknown property " << dpEvent.DPname); } @@ -240,16 +287,24 @@ GCFEvent::TResult ClockControl::initial_state(GCFEvent& event, case DP_SUBSCRIBED: { DPSubscribedEvent dpEvent(event); string propSetName(createPropertySetName(PSN_CLOCK_CONTROL, getName())); - propSetName += "." PN_CLC_REQUESTED_CLOCK; - if (dpEvent.DPname.find(propSetName) != string::npos) { + + if (dpEvent.DPname.find(propSetName + "." PN_CLC_REQUESTED_CLOCK) != string::npos) { GCFPVInteger clockVal; itsOwnPropertySet->getValue(PN_CLC_REQUESTED_CLOCK, clockVal); itsClock = clockVal.getValue(); LOG_INFO_STR("Requested clock is " << itsClock); + } - LOG_DEBUG ("Going to connect2RSP state"); - TRAN(ClockControl::connect2RSP_state); // go to next state. + if (dpEvent.DPname.find(propSetName + "." PN_CLC_REQUESTED_BITMODE) != string::npos) { + GCFPVInteger bitmodeVal; + itsOwnPropertySet->getValue(PN_CLC_REQUESTED_BITMODE, bitmodeVal); + itsBitmode = bitmodeVal.getValue(); + LOG_INFO_STR("Requested bitmode is " << itsBitmode); } + + LOG_DEBUG ("Going to connect2RSP state"); + TRAN(ClockControl::connect2RSP_state); // go to next state. + break; } break; @@ -325,6 +380,45 @@ GCFEvent::TResult ClockControl::connect2RSP_state(GCFEvent& event, // the stationController is the owner of this value. itsOwnPropertySet->setValue(PN_CLC_REQUESTED_CLOCK,GCFPVInteger(itsClock)); } + + requestBitmodeSetting(); // ask value of bitmode: will result in RSP_GETBITMODEACK + } + break; + + case RSP_GETBITMODEACK: { + RSPGetbitmodeackEvent ack(event); + if (ack.status != RSP_SUCCESS) { + LOG_ERROR ("Bitmode could not be get. Ignoring that for now."); + } + else { + bool success = true; + + for (unsigned i = 0; i < itsNrRSPs; i++) { + if (ack.bits_per_sample[i] != ack.bits_per_sample[0]) { + LOG_ERROR_STR("Mixed bit modes not supported: RSP board " << i << " is in " << ack.bits_per_sample[i] << " bit mode, but board 0 is in " << ack.bits_per_sample[0] << " bit mode"); + success = false; + break; + } + + if (ack.bitmode_version[i] != ack.bitmode_version[0]) { + LOG_ERROR_STR("Mixed bit mode support not supported: RSP board " << i << " supports modes " << bitmodeVersionString(ack.bitmode_version[i]) << ", but board 0 supports modes " << bitmodeVersionString(ack.bitmode_version[0])); + success = false; + break; + } + } + + if (success) { + itsBitmode = ack.bits_per_sample[0]; + itsBitmodeVersion = ack.bitmode_version[0]; + + LOG_INFO_STR("RSP says bitmode is " << itsBitmode << " bits, and supports modes " << bitmodeVersionString(itsBitmodeVersion) << ". Adopting those values."); + itsOwnPropertySet->setValue(PN_CLC_ACTUAL_BITMODE,GCFPVInteger(itsBitmode)); + // Note: only here I am allowed to change the value of the requested bitmode. Normally + // the stationController is the owner of this value. + itsOwnPropertySet->setValue(PN_CLC_REQUESTED_BITMODE,GCFPVInteger(itsBitmode)); + } + } + TRAN(ClockControl::startListener_state); // go to next state. } break; @@ -476,6 +570,8 @@ GCFEvent::TResult ClockControl::subscribeSplitter_state(GCFEvent& event, case CLKCTRL_GET_CLOCK: case CLKCTRL_SET_CLOCK: + case CLKCTRL_GET_BITMODE: + case CLKCTRL_SET_BITMODE: case CLKCTRL_GET_SPLITTERS: case CLKCTRL_SET_SPLITTERS: LOG_INFO_STR("Postponing event " << eventName(event) << " till next state"); @@ -531,7 +627,7 @@ GCFEvent::TResult ClockControl::subscribeClock_state(GCFEvent& event, itsClockSubscription = ack.handle; LOG_INFO("Subscription on the clock successful. going to operational mode"); itsOwnPropertySet->setValue(PN_CLC_ACTUAL_CLOCK,GCFPVInteger(itsClock)); - TRAN(ClockControl::active_state); // go to next state. + TRAN(ClockControl::subscribeBitmode_state); // go to next state. } break; @@ -541,6 +637,8 @@ GCFEvent::TResult ClockControl::subscribeClock_state(GCFEvent& event, case CLKCTRL_GET_CLOCK: case CLKCTRL_SET_CLOCK: + case CLKCTRL_GET_BITMODE: + case CLKCTRL_SET_BITMODE: case CLKCTRL_GET_SPLITTERS: case CLKCTRL_SET_SPLITTERS: case RSP_UPDSPLITTER: @@ -606,6 +704,8 @@ GCFEvent::TResult ClockControl::setClock_state(GCFEvent& event, case CLKCTRL_GET_CLOCK: case CLKCTRL_SET_CLOCK: + case CLKCTRL_GET_BITMODE: + case CLKCTRL_SET_BITMODE: case CLKCTRL_GET_SPLITTERS: case CLKCTRL_SET_SPLITTERS: case RSP_UPDCLOCK: @@ -621,6 +721,142 @@ GCFEvent::TResult ClockControl::setClock_state(GCFEvent& event, return (status); } +// +// subscribeBitmode_state(event, port) +// +// Take subscription on bitmode modifications +// +GCFEvent::TResult ClockControl::subscribeBitmode_state(GCFEvent& event, + GCFPortInterface& port) +{ + LOG_DEBUG_STR ("subscribeBitmode:" << eventName(event) << "@" << port.getName()); + + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch (event.signal) { + case F_EXIT: + break; + + case F_ENTRY: + case F_TIMER: + itsOwnPropertySet->setValue(PN_FSM_CURRENT_ACTION,GCFPVString("Subscribe to bitmode")); + requestBitmodeSubscription(); // will result in RSP_SUBBITMODEACK; + break; + + case F_DISCONNECTED: + _disconnectedHandler(port); // might result in transition to connect_state + break; + + case F_ACCEPT_REQ: + _acceptRequestHandler(port); + break; + + case RSP_SUBBITMODEACK: { + RSPSubbitmodeackEvent ack(event); + if (ack.status != RSP_SUCCESS) { + LOG_WARN ("Could not get subscription on bitmode, retry in 2 seconds."); + itsOwnPropertySet->setValue(PN_FSM_ERROR, GCFPVString("subscribe failed")); + itsTimerPort->setTimer(2.0); + break; + } + itsBitmodeSubscription = ack.handle; + LOG_INFO("Subscription on the bitmode successful. going to operational mode"); + itsOwnPropertySet->setValue(PN_CLC_ACTUAL_BITMODE,GCFPVInteger(itsBitmode)); + TRAN(ClockControl::active_state); // go to next state. + } + break; + + case DP_CHANGED: + _databaseEventHandler(event); + break; + + case CLKCTRL_GET_CLOCK: + case CLKCTRL_SET_CLOCK: + case CLKCTRL_GET_BITMODE: + case CLKCTRL_SET_BITMODE: + case CLKCTRL_GET_SPLITTERS: + case CLKCTRL_SET_SPLITTERS: + case RSP_UPDSPLITTER: + case RSP_UPDBITMODE: + LOG_INFO_STR("Postponing event " << eventName(event) << " till next state"); + return (GCFEvent::NEXT_STATE); + + default: + LOG_DEBUG_STR ("subscribeBitmode, default"); + status = defaultMessageHandling(event, port); + break; + } + + return (status); +} + + +// +// setBitmode_state(event, port) +// +// Set samplebitmode from RSP driver +// +GCFEvent::TResult ClockControl::setBitmode_state(GCFEvent& event, + GCFPortInterface& port) +{ + LOG_DEBUG_STR ("setBitmode:" << eventName(event) << "@" << port.getName()); + + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch (event.signal) { + case F_ENTRY: + case F_TIMER: + itsOwnPropertySet->setValue(PN_FSM_CURRENT_ACTION,GCFPVString("Set bitmode")); + sendBitmodeSetting(); // will result in RSP_SETBITMODEACK; + break; + + case F_DISCONNECTED: + _disconnectedHandler(port); // might result in transition to connect_state + break; + + case F_ACCEPT_REQ: + _acceptRequestHandler(port); + break; + + case RSP_SETBITMODEACK: { + RSPSetbitmodeackEvent ack(event); + if (ack.status != RSP_SUCCESS) { + LOG_ERROR_STR ("Bitmode could not be set to " << itsBitmode << ", retry in 5 seconds."); + itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("bitmodeset error")); + itsTimerPort->setTimer(5.0); + break; + } + LOG_INFO_STR ("StationBitmode is set to " << itsBitmode << ", going to operational state"); + itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("")); + itsOwnPropertySet->setValue(PN_CLC_ACTUAL_BITMODE,GCFPVInteger(itsBitmode)); + TRAN(ClockControl::active_state); // go to next state. + break; + } + + case DP_CHANGED: + _databaseEventHandler(event); + break; + + case CLKCTRL_GET_CLOCK: + case CLKCTRL_SET_CLOCK: + case CLKCTRL_GET_BITMODE: + case CLKCTRL_SET_BITMODE: + case CLKCTRL_GET_SPLITTERS: + case CLKCTRL_SET_SPLITTERS: + case RSP_UPDBITMODE: + case RSP_UPDSPLITTER: + LOG_INFO_STR("Postponing event " << eventName(event) << " till next state"); + return (GCFEvent::NEXT_STATE); + + default: + LOG_DEBUG_STR ("setBitmode, default"); + status = defaultMessageHandling(event, port); + break; + } + + return (status); +} + // @@ -667,8 +903,7 @@ GCFEvent::TResult ClockControl::setSplitters_state(GCFEvent& event, // update our admin itsSplitters.reset(); if (itsSplitterRequest) { - StationConfig sc; - for (int i = 0; i < sc.nrRSPs; i++) { + for (unsigned i = 0; i < itsNrRSPs; i++) { itsSplitters.set(i); } } @@ -682,6 +917,8 @@ GCFEvent::TResult ClockControl::setSplitters_state(GCFEvent& event, case CLKCTRL_GET_CLOCK: case CLKCTRL_SET_CLOCK: + case CLKCTRL_GET_BITMODE: + case CLKCTRL_SET_BITMODE: case CLKCTRL_GET_SPLITTERS: case CLKCTRL_SET_SPLITTERS: case RSP_UPDCLOCK: @@ -750,7 +987,7 @@ GCFEvent::TResult ClockControl::active_state(GCFEvent& event, GCFPortInterface& break; } - if ((int32) updateEvent.clock != itsClock) { + if (updateEvent.clock != itsClock) { LOG_ERROR_STR ("CLOCK WAS CHANGED TO " << updateEvent.clock << " BY SOMEONE WHILE CLOCK SHOULD BE " << itsClock << ". CHANGING CLOCK BACK."); itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("Clock unallowed changed")); @@ -763,6 +1000,63 @@ GCFEvent::TResult ClockControl::active_state(GCFEvent& event, GCFPortInterface& } break; + case RSP_UPDBITMODE: { + RSPUpdbitmodeEvent updateEvent(event); + + // was the update even succesful? + if (updateEvent.status != RSP_SUCCESS) { + LOG_WARN ("Received an INVALID bitmode update, WHAT IS THE BITMODE?"); + itsOwnPropertySet->setValue(PN_FSM_ERROR, GCFPVString("getbitmode failed")); + break; + } + + bool retry = false; + for (unsigned i = 0; i < itsNrRSPs; i++) { + // 0 bits indicates the bit mode could not be set + if (updateEvent.bits_per_sample[i] == 0) { + LOG_ERROR_STR ("StationBitmode has stopped on board " << i << " (and possibly others)! Going to setBitmode state to try to solve the problem"); + itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("Bitmode stopped")); + + retry = true; + break; + } + + // we don't allow a mix of bit modes from the boards + if (updateEvent.bits_per_sample[i] != updateEvent.bits_per_sample[0]) { + LOG_ERROR_STR("Mixed bit modes not supported: RSP board " << i << " is in " << updateEvent.bits_per_sample[i] << " bit mode, but board 0 is in " << updateEvent.bits_per_sample[0] << " bit mode, going to setBitmode state to try to solve the problem"); + itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("boards report mixed bit modes")); + + retry = true; + break; + } + } + + if (retry) { + TRAN(ClockControl::setBitmode_state); + break; + } + + // because we don't allow mixed bit modes, we can simply use the first one + uint16 bitmode = updateEvent.bits_per_sample[0]; + + if (itsBitmode == 0) { // my bitmode still uninitialized? + LOG_INFO_STR("My bitmode is still not initialized. StationBitmode is " << bitmode << " adopting this value"); + itsBitmode = bitmode; + break; + } else if (bitmode != itsBitmode) { + LOG_ERROR_STR ("BITMODE WAS CHANGED TO " << bitmode << + " BY SOMEONE WHILE BITMODE SHOULD BE " << itsBitmode << ". CHANGING BITMODE BACK."); + itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("Bitmode unallowed changed")); + + TRAN (ClockControl::setBitmode_state); + break; + } else { + // when update.bits_per_sample==itsBitmode ignore it, we probable caused it ourselves. + LOG_DEBUG_STR("Event.bits_per_sample[0..n] = " << bitmode << ", myBitmode = " << itsBitmode); + } + } + break; + case RSP_UPDSPLITTER: { RSPUpdsplitterEvent update(event); itsOwnPropertySet->setValue(PN_FSM_ERROR,GCFPVString("")); @@ -793,17 +1087,59 @@ GCFEvent::TResult ClockControl::active_state(GCFEvent& event, GCFPortInterface& case CLKCTRL_SET_CLOCK: { CLKCTRLSetClockEvent request(event); CLKCTRLSetClockAckEvent response; + if (request.clock != 160 && request.clock != 200) { - LOG_DEBUG_STR("Received request to change the clock to invalid value " << request.clock); + LOG_ERROR_STR("Received request to change the clock to invalid value " << request.clock); response.status = CLKCTRL_CLOCKFREQ_ERR; - port.send(response); - break; - } - response.status = CLKCTRL_NO_ERR; - LOG_INFO_STR("Received request to change the clock to " << request.clock << " MHz."); - itsOwnPropertySet->setValue(PN_CLC_REQUESTED_CLOCK,GCFPVInteger(request.clock)); - itsClock = request.clock; - TRAN(ClockControl::setClock_state); + } else { + LOG_INFO_STR("Received request to change the clock to " << request.clock << " MHz."); + response.status = CLKCTRL_NO_ERR; + + itsOwnPropertySet->setValue(PN_CLC_REQUESTED_CLOCK,GCFPVInteger(request.clock)); + + if (itsClock == request.clock) { + LOG_INFO_STR("Clock was already set to " << itsClock << "."); + } else { + itsClock = request.clock; + TRAN(ClockControl::setClock_state); + } + } + + port.send(response); + } + break; + + case CLKCTRL_GET_BITMODE: { + CLKCTRLGetBitmodeAckEvent answer; + answer.bits_per_sample = itsBitmode; + port.send(answer); + } + break; + + case CLKCTRL_SET_BITMODE: { + CLKCTRLSetBitmodeEvent request(event); + CLKCTRLSetBitmodeAckEvent response; + + if (request.bits_per_sample != 16 && request.bits_per_sample != 8 && request.bits_per_sample != 4) { + LOG_ERROR_STR("Received request to change the bitmode to invalid value " << request.bits_per_sample); + response.status = CLKCTRL_INVALIDBITMODE_ERR; + } else if (!bitmodeSupported(request.bits_per_sample, itsBitmodeVersion)) { + LOG_ERROR_STR("Received request to change the bitmode to unsupported value " << request.bits_per_sample << " (supported is " << bitmodeVersionString(itsBitmodeVersion) << ")"); + response.status = CLKCTRL_INVALIDBITMODE_ERR; + } else { + LOG_INFO_STR("Received request to change the bitmode to " << request.bits_per_sample << " bit."); + response.status = CLKCTRL_NO_ERR; + + itsOwnPropertySet->setValue(PN_CLC_REQUESTED_BITMODE,GCFPVInteger(request.bits_per_sample)); + + if (itsBitmode == request.bits_per_sample) { + LOG_INFO_STR("Bitmode was already set to " << itsBitmode << "."); + } else { + itsBitmode = request.bits_per_sample; + TRAN(ClockControl::setBitmode_state); + } + } + port.send(response); } break; @@ -820,6 +1156,7 @@ GCFEvent::TResult ClockControl::active_state(GCFEvent& event, GCFPortInterface& LOG_INFO_STR("Received request to switch the splitters " << (request.splittersOn ? "ON" : "OFF")); itsSplitterRequest = request.splittersOn; TRAN (ClockControl::setSplitters_state); + CLKCTRLSetSplittersAckEvent response; response.status = CLKCTRL_NO_ERR; port.send(response); @@ -921,6 +1258,67 @@ void ClockControl::sendClockSetting() itsRSPDriver->send(msg); } + +// +// requestBitmodeSubscription() +// +void ClockControl::requestBitmodeSubscription() +{ + LOG_INFO ("Taking subscription on bitmode settings"); + + RSPSubbitmodeEvent msg; +// msg.timestamp = 0; + msg.period = 1; // let RSPdriver check every second + itsRSPDriver->send(msg); +} + +// +// cancelBitmodeSubscription() +// +void ClockControl::cancelBitmodeSubscription() +{ + LOG_INFO ("Canceling subscription on bitmode settings"); + + RSPUnsubbitmodeEvent msg; + msg.handle = itsBitmodeSubscription; + itsBitmodeSubscription = 0; + itsRSPDriver->send(msg); +} + +// +// requestBitmodeSetting() +// +void ClockControl::requestBitmodeSetting() +{ + LOG_INFO ("Asking RSPdriver current bitmode setting"); + + RSPGetbitmodeEvent msg; + msg.timestamp = RTC::Timestamp(0,0); + msg.cache = 1; + itsRSPDriver->send(msg); +} + + +// +// sendBitmodeSetting() +// +void ClockControl::sendBitmodeSetting() +{ + LOG_INFO_STR ("Setting stationBitmode to " << itsBitmode << " bit"); + + RSPSetbitmodeEvent msg; + bitset<MAX_N_RSPBOARDS> mask; + + // select all RSP boards + for (unsigned i = 0; i < itsNrRSPs; i++) + mask.set(i); + + msg.timestamp = RTC::Timestamp(0,0); + msg.rspmask = mask; + msg.bits_per_sample = itsBitmode; + itsRSPDriver->send(msg); +} + // // requestSplitterSubscription() // diff --git a/MAC/APL/StationCU/src/ClockControl/ClockControl.h b/MAC/APL/StationCU/src/ClockControl/ClockControl.h index 05da958f69d1ec919ec43887f4ff83833d3918be..7ea9e075bf03124dfc8cc62596865850a2011b30 100644 --- a/MAC/APL/StationCU/src/ClockControl/ClockControl.h +++ b/MAC/APL/StationCU/src/ClockControl/ClockControl.h @@ -73,10 +73,12 @@ private: GCFEvent::TResult connect2RSP_state (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult startListener_state (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult subscribeClock_state (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult subscribeBitmode_state (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult subscribeSplitter_state (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult active_state (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult defaultMessageHandling (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult setClock_state (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult setBitmode_state (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult setSplitters_state (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult finishing_state (GCFEvent& e, GCFPortInterface& p); @@ -92,6 +94,10 @@ private: void cancelClockSubscription(); void requestClockSetting(); void sendClockSetting(); + void requestBitmodeSubscription(); + void cancelBitmodeSubscription(); + void requestBitmodeSetting(); + void sendBitmodeSetting(); void requestSplitterSubscription(); void cancelSplitterSubscription(); void requestSplitterSetting(); @@ -117,8 +123,14 @@ private: uint32 itsInstanceNr; time_t itsStartTime; // timestamp the controller was started + unsigned itsNrRSPs; + void* itsClockSubscription; - int32 itsClock; + uint32 itsClock; // 200 or 160 + + void* itsBitmodeSubscription; + uint16 itsBitmode; // 16 or 8 or 4 + uint16 itsBitmodeVersion; // supported bitmode: 0 = 16, 1 = 16/8, 2 = 16/8/4 bool itsSplitterRequest; bitset<MAX_RSPBOARDS> itsSplitters; diff --git a/MAC/APL/StationCU/src/ClockControl/PVSSDatapointDefs.h b/MAC/APL/StationCU/src/ClockControl/PVSSDatapointDefs.h index 3ddc45b8e81a8ca449815e983a20b63f95bf8f2f..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/StationCU/src/ClockControl/PVSSDatapointDefs.h +++ b/MAC/APL/StationCU/src/ClockControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v1.0 on Wed Feb 4 15:00:05 UTC 2009 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,12 +25,15 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" -#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" #define PN_OBS_CLAIM_PERIOD "claimPeriod" #define PN_OBS_PREPARE_PERIOD "preparePeriod" #define PN_OBS_START_TIME "startTime" @@ -54,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -61,24 +55,88 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" +#define PN_OBSCTRL_COMMAND "command" + +// InputBuffer +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" +#define PST_INPUT_BUFFER "InputBuffer" +#define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" +#define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" +#define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" +#define PN_IPB_STREAM0_REJECTED "stream0.rejected" +#define PN_IPB_STREAM1_BLOCKS_IN "stream1.blocksIn" +#define PN_IPB_STREAM1_PERC_BAD "stream1.percBad" +#define PN_IPB_STREAM1_REJECTED "stream1.rejected" +#define PN_IPB_STREAM2_BLOCKS_IN "stream2.blocksIn" +#define PN_IPB_STREAM2_PERC_BAD "stream2.percBad" +#define PN_IPB_STREAM2_REJECTED "stream2.rejected" +#define PN_IPB_STREAM3_BLOCKS_IN "stream3.blocksIn" +#define PN_IPB_STREAM3_PERC_BAD "stream3.percBad" +#define PN_IPB_STREAM3_REJECTED "stream3.rejected" +#define PN_IPB_LATE "late" +#define PN_IPB_IO_TIME "IOTime" + +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" -// OnlineControl -#define PSN_ONLINE_CONTROL "LOFAR_ObsSW_@observation@_OnlineControl" -#define PST_ONLINE_CONTROL "OnlineControl" +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" -// Correlator -#define PSN_CORRELATOR "LOFAR_ObsSW_@observation@_OnlineControl_Correlator" -#define PST_CORRELATOR "Correlator" +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" -// StorageAppl -#define PSN_STORAGE_APPL "LOFAR_ObsSW_@observation@_OnlineControl_StorageAppl" -#define PST_STORAGE_APPL "StorageAppl" +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -88,8 +146,8 @@ #define PN_CAB_FRONT_FAN_OUTER "frontFanOuter" #define PN_CAB_FRONT_AIRFLOW "frontAirflow" #define PN_CAB_BACK_DOOR_OPEN "backDoorOpen" -#define PN_CAB_BACKT_FAN_INNER "backtFanInner" -#define PN_CAB_BACKT_FAN_OUTER "backtFanOuter" +#define PN_CAB_BACK_FAN_INNER "backFanInner" +#define PN_CAB_BACK_FAN_OUTER "backFanOuter" #define PN_CAB_BACK_AIRFLOW "backAirflow" #define PN_CAB_TEMP_ALARM "tempAlarm" #define PN_CAB_HUMIDITY_ALARM "humidityAlarm" @@ -135,7 +193,10 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" +#define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" #define PN_RSP__ETHERNET_STATUS_CHILD_STATE "Ethernet.status.childState" #define PN_RSP__ETHERNET_STATUS_MESSAGE "Ethernet.status.message" @@ -216,10 +277,15 @@ #define PN_RCU_TRIGGER_FILTER "Trigger.filter" #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -247,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -260,10 +382,12 @@ #define PST_HARDWARE_MONITOR "HardwareMonitor" #define PN_HWM_RSP_CONNECTED "RSP.connected" #define PN_HWM_TBB_CONNECTED "TBB.connected" +#define PN_HWM_EC_CONNECTED "EC.connected" // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -280,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -300,6 +413,9 @@ #define PN_OBS_NAME "name" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" @@ -336,5 +452,6 @@ #define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" #define PN_TBC_TRIGGER_FLAGS "trigger.flags" #define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" #endif diff --git a/MAC/APL/StationCU/src/ClockControl/clkctl.cc b/MAC/APL/StationCU/src/ClockControl/clkctl.cc index 8b01db1c409d29887fd2fb8f5849d3ab780bdaab..a325cf7c1f7a003342ed32aba1fe9bb5713ce5aa 100644 --- a/MAC/APL/StationCU/src/ClockControl/clkctl.cc +++ b/MAC/APL/StationCU/src/ClockControl/clkctl.cc @@ -72,7 +72,7 @@ GCFEvent::TResult ClkCtl::doCommand(GCFEvent& event, GCFPortInterface& port) case CLKCTRL_GET_CLOCK_ACK: { CLKCTRLGetClockAckEvent ack(event); - cout << "Clock is set to " << ack.clock << "MHz" << endl; + cout << "Clock is set to " << ack.clock << " MHz" << endl; GCFScheduler::instance()->stop(); } break; @@ -83,6 +83,20 @@ GCFEvent::TResult ClkCtl::doCommand(GCFEvent& event, GCFPortInterface& port) GCFScheduler::instance()->stop(); } break; + + case CLKCTRL_GET_BITMODE_ACK: { + CLKCTRLGetBitmodeAckEvent ack(event); + cout << "Bitmode is set to " << ack.bits_per_sample << " bit" << endl; + GCFScheduler::instance()->stop(); + } + break; + + case CLKCTRL_SET_BITMODE_ACK: { + CLKCTRLSetBitmodeAckEvent ack(event); + cout << "Setting the bitmode was " << ((ack.status == CLKCTRL_NO_ERR) ? "" : "NOT ") << "succesful" << endl; + GCFScheduler::instance()->stop(); + } + break; case CLKCTRL_GET_SPLITTERS_ACK: { CLKCTRLGetSplittersAckEvent ack(event); @@ -109,6 +123,8 @@ GCFEvent* ClkCtl::parseOptions(int argc, char** argv) static struct option long_options[] = { { "getclock", no_argument, 0, 'c' }, { "setclock", required_argument, 0, 'C' }, + { "getbitmode", no_argument, 0, 'b' }, + { "setbitmode", required_argument, 0, 'B' }, { "getsplitters", no_argument, 0, 's' }, { "setsplitters", required_argument, 0, 'S' }, { "help", no_argument, 0, 'h' }, @@ -117,7 +133,7 @@ GCFEvent* ClkCtl::parseOptions(int argc, char** argv) optind = 0; int option_index = 0; - int c = getopt_long(argc, argv, "cC:sS:h", long_options, &option_index); + int c = getopt_long(argc, argv, "cC:bB:sS:h", long_options, &option_index); if (c == -1) { return(0); } @@ -134,6 +150,17 @@ GCFEvent* ClkCtl::parseOptions(int argc, char** argv) } break; + case 'b': + return(new CLKCTRLGetBitmodeEvent()); + break; + + case 'B': { + CLKCTRLSetBitmodeEvent* event = new CLKCTRLSetBitmodeEvent(); + event->bits_per_sample = atoi(optarg); + return(event); + } + break; + case 's': return (new CLKCTRLGetSplittersEvent()); break; @@ -161,6 +188,8 @@ void ClkCtl::doHelp() cout << "clkctl syntax:" << endl; cout << "clkctl --getclock" << endl; cout << "clkctl --setclock=160|200" << endl; + cout << "clkctl --getbitmode" << endl; + cout << "clkctl --setbitmode=4|8|16" << endl; cout << "clkctl --getsplitters" << endl; cout << "clkctl --setsplitters=0|1" << endl; cout << endl; diff --git a/MAC/APL/StationCU/src/ClockProtocol/Clock_Protocol.prot b/MAC/APL/StationCU/src/ClockProtocol/Clock_Protocol.prot index 050a2ad4902a587dab2eca9e6beb9137a31ad99b..711f6ae7f1775b79ca8dc1b8089eb7257756eeda 100644 --- a/MAC/APL/StationCU/src/ClockProtocol/Clock_Protocol.prot +++ b/MAC/APL/StationCU/src/ClockProtocol/Clock_Protocol.prot @@ -43,6 +43,11 @@ prelude = << PRELUDE_END // SET_CLOCK (int clock) // SET_CLOCK_ACK (int status) // +// GET_BITMODE () +// GET_BITMODE_ACK (int bitmode) +// SET_BITMODE (int bitmode) +// SET_BITMODE_ACK (int status) +// // GET_SPLITTERS () // GET_SPLITTERS_ACK (bitset splitters) // SET_SPLITTERS (bool splittersOn) @@ -59,6 +64,10 @@ error = { id = CLOCKFREQ; msg = "Invalid clock frequency specified, only 160 and 200 MHz are allowed"; }; +error = { + id = INVALIDBITMODE; + msg = "Invalid bit mode specified, only 4, 8 and 16 are allowed"; +}; error = { id = SPLITTERS; msg = "Trouble setting the splitters"; @@ -115,6 +124,50 @@ event = { }; }; +// +// GET_BITMODE +// +event = { + signal = GET_BITMODE; + dir = IN; // from client to server +}; + +// +// GET_BITMODE_ACK +// +event = { + signal = GET_BITMODE_ACK; + dir = OUT; + param = { + name = "bits_per_sample"; + type = "uint32"; + }; +}; + +// +// SET_BITMODE +// +event = { + signal = SET_BITMODE; + dir = IN; + param = { + name = "bits_per_sample"; + type = "uint32"; + }; +}; + +// +// SET_BITMODE_ACK +// +event = { + signal = SET_BITMODE_ACK; + dir = OUT; + param = { + name = "status"; + type = "uint32"; + }; +}; + // // GET_SPLITTERS // diff --git a/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc index ce344654eff95c7ff1e3e7d01b56ae74f304599e..f2934a228ad9991a50d0eb34f628c8b132664392 100644 --- a/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc +++ b/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc @@ -255,12 +255,8 @@ GCFEvent::TResult ECMonitor::createPropertySets(GCFEvent& event, GCFPortInterfac // resize vectors. itsCabs.resize (itsNrCabs, 0); - string mainDB(PVSSinfo::getMainDBName()+":"); - string stationNameMask(mainDB+createPropertySetName(PSN_STATION, getName())); -// LOG_DEBUG_STR("stationNameMask=" << stationNameMask); - string PSname(formatString(stationNameMask.c_str(), 0)); -// LOG_DEBUG_STR("PSname=" << PSname); - itsStation = new RTDBPropertySet(PSname, PST_STATION, PSAT_WO | PSAT_CW, this); + string PSname(createPropertySetName(PSN_STATION_INFO, getName())); + itsStation = new RTDBPropertySet(PSname, PST_STATION_INFO, PSAT_WO | PSAT_CW, this); itsStation->setConfirmation(false); string cabNameMask(createPropertySetName(PSN_CABINET, getName())); @@ -526,10 +522,10 @@ GCFEvent::TResult ECMonitor::askStatus(GCFEvent& event, GCFPortInterface& port) } bState = (sts_stat.power & STS_POWER48_ON); - itsStation->setValue(PN_STS_POWER48_ON, GCFPVBool(bState), 0.0, false); + itsStation->setValue(PN_STI_POWER48_ON, GCFPVBool(bState), 0.0, false); bState = (sts_stat.power & STS_POWER220_ON); - itsStation->setValue(PN_STS_POWER220_ON, GCFPVBool(bState), 0.0, false); + itsStation->setValue(PN_STI_POWER220_ON, GCFPVBool(bState), 0.0, false); //bState = (sts_stat.lightning & STS_LIGHTNING); //itsStation->setValue(PN_STS_LIGHTNING, GCFPVBool(bState), 0.0, false); diff --git a/MAC/APL/StationCU/src/HardwareMonitor/PVSSDatapointDefs.h b/MAC/APL/StationCU/src/HardwareMonitor/PVSSDatapointDefs.h index 6cb9a56637b40cf1db0fbe4912dd8035d51caac7..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/StationCU/src/HardwareMonitor/PVSSDatapointDefs.h +++ b/MAC/APL/StationCU/src/HardwareMonitor/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v2.0 on Mon Apr 26 01:38:02 UTC 2010 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,6 +25,10 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" @@ -53,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -60,24 +55,24 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" - -// Adder -#define PSN_ADDER "@adder@" -#define PST_ADDER "Adder" -#define PN_ADD_DROPPING "dropping" -#define PN_ADD_NR_BLOCKS_DROPPED "nrBlocksDropped" -#define PN_ADD_LOG_LINE "logLine" +#define PN_OBSCTRL_COMMAND "command" // InputBuffer -#define PSN_INPUT_BUFFER "@inputbuffer@" +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" #define PST_INPUT_BUFFER "InputBuffer" #define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" #define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" #define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" #define PN_IPB_STREAM0_REJECTED "stream0.rejected" @@ -93,12 +88,55 @@ #define PN_IPB_LATE "late" #define PN_IPB_IO_TIME "IOTime" -// Storage -#define PSN_STORAGE "@storage@" -#define PST_STORAGE "Storage" -#define PN_STR_TIME "time" -#define PN_STR_COUNT "count" -#define PN_STR_DROPPED "dropped" +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" + +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" + +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -155,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -273,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -291,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -307,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -328,6 +414,8 @@ #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" #define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" diff --git a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc index 1952c85252e9d83a6fe0dd7ee066a63242222eac..524673d378e04ad939d05e874b3863e973fcf496 100644 --- a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc +++ b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc @@ -55,11 +55,14 @@ namespace LOFAR { ActiveObs::ActiveObs(const string& name, State initial, ParameterSet* thePS, + const string& LBAbitmapString, + const string& HBAbitmapString, bool hasSplitters, GCFTask& task) : GCFTask (initial, string("ActiveObs:") + name), itsStopTimerID (0), - itsPropSetTimer (new GCFTimerPort(task, name)), + itsPropSetTimer (new GCFTimerPort(task, name)), // must use 'name' because F_TIMER events receive + itsGuardTimer (new GCFTimerPort(task, name)), // in StationControl task. Needed for routing. itsName (name), itsTask (&task), itsInstanceNr (getInstanceNr(name)), @@ -76,7 +79,9 @@ ActiveObs::ActiveObs(const string& name, itsInstanceNr, itsObsPar.obsID)), itsReadyFlag (false), itsReqState (CTState::NOSTATE), - itsCurState (CTState::NOSTATE) + itsCurState (CTState::NOSTATE), + itsLBAs (LBAbitmapString), + itsHBAs (HBAbitmapString) { if (thePS->isDefined("Observation.TBB.TBBsetting[0].filter0_coeff0")) { LOG_INFO("Observation also uses the TB boards"); @@ -105,7 +110,7 @@ ActiveObs::~ActiveObs() GCFEvent::TResult ActiveObs::initial(GCFEvent& event, GCFPortInterface& /*port*/) { - LOG_DEBUG(formatString("%s:initial - %04X", itsName.c_str(), event.signal)); + LOG_DEBUG(formatString("%s:initial - %s", itsName.c_str(), eventName(event).c_str())); GCFEvent::TResult status = GCFEvent::HANDLED; @@ -152,7 +157,7 @@ GCFEvent::TResult ActiveObs::initial(GCFEvent& event, break; default: - LOG_DEBUG_STR ("initial, default"); + LOG_DEBUG_STR(itsName << ":inital default: " << eventName(event)); status = GCFEvent::NOT_HANDLED; break; } @@ -166,16 +171,16 @@ GCFEvent::TResult ActiveObs::initial(GCFEvent& event, // GCFEvent::TResult ActiveObs::starting(GCFEvent& event, GCFPortInterface& port) { - LOG_DEBUG(formatString("%s:starting - %04X", itsName.c_str(), event.signal)); + LOG_DEBUG(formatString("%s:starting - %s", itsName.c_str(), eventName(event).c_str())); switch (event.signal) { case F_ENTRY: { - // first make a mapping of the receivers that are used. - // the StationController already modified the set to reflect the available receivers - // So askfor this 'core' set by passed zeros. - // the receiver bitmap can be derived from the RCUset. + // First make a mapping of the receivers that are used. + // The StationController already modified the set to reflect the available receivers + // So askfor this 'core' set by passing zeros in the getRCUbitset function. StationConfig config; bitset<MAX_RCUS> theRCUs(itsObsPar.getRCUbitset(0, 0, "")); + // The receiver bitmap can be derived from the RCUset. string rbm; rbm.resize(MAX_RCUS, '0'); for (int i = 0; i < MAX_RCUS; i++) { @@ -185,6 +190,8 @@ GCFEvent::TResult ActiveObs::starting(GCFEvent& event, GCFPortInterface& port) } LOG_INFO_STR("Setting receiverBitMap of DP:" << itsObsPar.realPVSSdatapoint << "." << PN_OBS_RECEIVER_BITMAP << "to " << theRCUs); itsPropertySet->setValue(PN_OBS_RECEIVER_BITMAP,GCFPVString (rbm)); + itsPropertySet->setValue(PN_OBS_LBA_BITMAP,GCFPVString (itsLBAs)); + itsPropertySet->setValue(PN_OBS_HBA_BITMAP,GCFPVString (itsHBAs)); itsPropertySet->setValue(PN_OBS_CLAIM_NAME, GCFPVString(formatString("LOFAR_ObsSW_Observation%d", itsObsPar.obsID))); @@ -214,6 +221,7 @@ GCFEvent::TResult ActiveObs::starting(GCFEvent& event, GCFPortInterface& port) } itsCurState = CTState::CONNECT; + itsGuardTimer->setTimer(10.0); // max wait 10 seconds for connections. } break; @@ -237,11 +245,18 @@ GCFEvent::TResult ActiveObs::starting(GCFEvent& event, GCFPortInterface& port) if (itsBeamCntlrReady && itsCalCntlrReady && (itsUsesTBB == itsTBBCntlrReady)) { LOG_INFO_STR("Connected to all controllers, going to connected state"); itsCurState = CTState::CONNECTED; + itsGuardTimer->cancelAllTimers(); TRAN(ActiveObs::connected); } } break; + case F_TIMER: + LOG_FATAL_STR((!itsCalCntlrReady ? "Calibration" : (!itsBeamCntlrReady ? "Beam" : "TBB")) << "Controller did not start, aborting observation"); + TRAN(ActiveObs::stopping); + break; + + case CONTROL_QUIT: TRAN(ActiveObs::stopping); break; @@ -254,8 +269,12 @@ GCFEvent::TResult ActiveObs::starting(GCFEvent& event, GCFPortInterface& port) } break; + case F_EXIT: + itsGuardTimer->cancelAllTimers(); + break; + default: - LOG_DEBUG_STR(itsName << ":default(" << F_EVT_PROTOCOL(event) << "," << F_EVT_SIGNAL(event) << ")"); + LOG_DEBUG_STR(itsName << ":starting default: " << eventName(event) << "@" << port.getName()); return(GCFEvent::NOT_HANDLED); break; } @@ -269,7 +288,7 @@ GCFEvent::TResult ActiveObs::starting(GCFEvent& event, GCFPortInterface& port) // GCFEvent::TResult ActiveObs::connected(GCFEvent& event, GCFPortInterface& port) { - LOG_DEBUG_STR(itsName << ":connected"); + LOG_DEBUG_STR(itsName << ":connected - " << eventName(event) << "@" << port.getName()); switch (event.signal) { case F_ENTRY: @@ -303,6 +322,7 @@ GCFEvent::TResult ActiveObs::connected(GCFEvent& event, GCFPortInterface& port) ChildControl::instance()-> requestState(CTState::CLAIMED, itsTBBCntlrName, 0, CNTLRTYPE_NO_TYPE); } // will result in CONTROL_CLAIMED + itsGuardTimer->setTimer(10.0); // max wait 10 seconds for answers. } break; @@ -326,11 +346,17 @@ GCFEvent::TResult ActiveObs::connected(GCFEvent& event, GCFPortInterface& port) if (itsBeamCntlrReady && itsCalCntlrReady && (itsUsesTBB == itsTBBCntlrReady)) { LOG_INFO("All controllers are ready, going to standby mode"); itsCurState = CTState::CLAIMED; + itsGuardTimer->cancelAllTimers(); TRAN(ActiveObs::standby); } } break; + case F_TIMER: + LOG_FATAL_STR((!itsCalCntlrReady ? "Calibration" : (!itsBeamCntlrReady ? "Beam" : "TBB")) << "Controller did not reached claim state, aborting observation"); + TRAN(ActiveObs::stopping); + break; + case CONTROL_QUIT: TRAN(ActiveObs::stopping); break; @@ -343,8 +369,12 @@ GCFEvent::TResult ActiveObs::connected(GCFEvent& event, GCFPortInterface& port) } break; + case F_EXIT: + itsGuardTimer->cancelAllTimers(); + break; + default: - LOG_DEBUG_STR(itsName << ":default(" << F_EVT_PROTOCOL(event) << "," << F_EVT_SIGNAL(event) << ")"); + LOG_DEBUG_STR(itsName << ":connected default: " << eventName(event) << "@" << port.getName()); return(GCFEvent::NOT_HANDLED); break; } @@ -358,7 +388,7 @@ GCFEvent::TResult ActiveObs::connected(GCFEvent& event, GCFPortInterface& port) // GCFEvent::TResult ActiveObs::standby(GCFEvent& event, GCFPortInterface& port) { - LOG_DEBUG_STR(itsName << ":standby"); + LOG_DEBUG_STR(itsName << ":standby - " << eventName(event) << "@" << port.getName()); switch (event.signal) { case F_ENTRY: @@ -374,11 +404,13 @@ GCFEvent::TResult ActiveObs::standby(GCFEvent& event, GCFPortInterface& port) LOG_INFO_STR("Asking " << itsCalCntlrName << " to calibrate the subarray"); ChildControl::instance()->requestState(CTState::PREPARED, itsCalCntlrName, 0, CNTLRTYPE_NO_TYPE); // will result in CONTROL_PREPARED + itsGuardTimer->setTimer(10.0); // max wait 10 seconds answer } break; case CONTROL_PREPARED: { CONTROLPreparedEvent msg(event); + itsGuardTimer->cancelAllTimers(); if (msg.cntlrName == itsCalCntlrName) { if (msg.result != CT_RESULT_NO_ERROR) { LOG_ERROR_STR("Calibration of subarray FAILED with error " << msg.result); @@ -388,6 +420,7 @@ GCFEvent::TResult ActiveObs::standby(GCFEvent& event, GCFPortInterface& port) itsCalCntlrReady = true; ChildControl::instance()->requestState(CTState::PREPARED, itsBeamCntlrName, 0, CNTLRTYPE_NO_TYPE); // will result in another CONTROL_PREPARED + itsGuardTimer->setTimer(10.0); // max wait 10 seconds answer } else if (msg.cntlrName == itsBeamCntlrName) { if (msg.result != CT_RESULT_NO_ERROR) { @@ -397,16 +430,18 @@ GCFEvent::TResult ActiveObs::standby(GCFEvent& event, GCFPortInterface& port) LOG_INFO_STR("BeamController has started the beam, asking TBBCtlr to prepare TBBs"); itsBeamCntlrReady = true; ChildControl::instance()->requestState(CTState::PREPARED, itsTBBCntlrName, 0, CNTLRTYPE_NO_TYPE); + itsGuardTimer->setTimer(10.0); // max wait 10 seconds answer } else if (msg.cntlrName == itsTBBCntlrName) { if (msg.result != CT_RESULT_NO_ERROR) { LOG_ERROR_STR("Start of TBB failed with error, " << msg.result << ". CONTINUING OBSERVATION WITHOUT TBB."); itsUsesTBB = false; - break; } - LOG_INFO_STR("TBBController has started the beam"); - itsTBBCntlrReady = true; + else { + LOG_INFO_STR("TBBController has started the beam"); + itsTBBCntlrReady = true; + } } else { ASSERTSTR(false, "Received claimed event of unknown controller: " << msg.cntlrName); @@ -415,11 +450,17 @@ GCFEvent::TResult ActiveObs::standby(GCFEvent& event, GCFPortInterface& port) if (itsBeamCntlrReady && itsCalCntlrReady && (itsUsesTBB == itsTBBCntlrReady)) { LOG_INFO("Both controllers are ready, going to operational mode"); itsCurState = CTState::PREPARED; + itsGuardTimer->cancelAllTimers(); TRAN(ActiveObs::operational); } } break; + case F_TIMER: + LOG_FATAL_STR((!itsCalCntlrReady ? "Calibration" : (!itsBeamCntlrReady ? "Beam" : "TBB")) << "Controller did not reach prepared state, aborting observation"); + TRAN(ActiveObs::stopping); + break; + case CONTROL_QUIT: TRAN(ActiveObs::stopping); break; @@ -432,8 +473,12 @@ GCFEvent::TResult ActiveObs::standby(GCFEvent& event, GCFPortInterface& port) } break; + case F_EXIT: + itsGuardTimer->cancelAllTimers(); + break; + default: - LOG_DEBUG_STR(itsName << ":default(" << F_EVT_PROTOCOL(event) << "," << F_EVT_SIGNAL(event) << ")"); + LOG_DEBUG_STR(itsName << ":standby default: " << eventName(event) << "@" << port.getName()); return(GCFEvent::NOT_HANDLED); break; } @@ -447,7 +492,7 @@ GCFEvent::TResult ActiveObs::standby(GCFEvent& event, GCFPortInterface& port) // GCFEvent::TResult ActiveObs::operational(GCFEvent& event, GCFPortInterface& port) { - LOG_DEBUG_STR(itsName << ":operational"); + LOG_DEBUG_STR(itsName << ":operational - " << eventName(event) << "@" << port.getName()); switch (event.signal) { case F_ENTRY: @@ -558,7 +603,7 @@ GCFEvent::TResult ActiveObs::operational(GCFEvent& event, GCFPortInterface& port break; default: - LOG_DEBUG_STR(itsName << ":default(" << eventName(event) << ")"); + LOG_DEBUG_STR(itsName << ":operational default: " << eventName(event) << "@" << port.getName()); return(GCFEvent::NOT_HANDLED); break; } @@ -572,7 +617,7 @@ GCFEvent::TResult ActiveObs::operational(GCFEvent& event, GCFPortInterface& port // GCFEvent::TResult ActiveObs::stopping(GCFEvent& event, GCFPortInterface& /*port*/) { - LOG_DEBUG_STR(itsName << ":stopping"); + LOG_DEBUG(formatString("%s:stopping - %s", itsName.c_str(), eventName(event).c_str())); switch (event.signal) { case F_ENTRY: { @@ -597,9 +642,16 @@ GCFEvent::TResult ActiveObs::stopping(GCFEvent& event, GCFPortInterface& /*port* } LOG_INFO_STR(itsName << ": in 'stopping-mode' until controllers are down"); + itsGuardTimer->setTimer(10.0); } break; + case F_TIMER: + LOG_ERROR_STR("Aborting while not all controllers reported successful shutdown!"); + itsCurState = CTState::QUITED; + itsReadyFlag = true; + break; + case CONTROL_QUITED: { CONTROLQuitedEvent msg(event); if (msg.cntlrName == itsCalCntlrName) { @@ -621,12 +673,13 @@ GCFEvent::TResult ActiveObs::stopping(GCFEvent& event, GCFPortInterface& /*port* LOG_INFO_STR("All controllers are down, informing stationControl task"); itsCurState = CTState::QUITED; itsReadyFlag = true; + itsGuardTimer->cancelAllTimers(); } } break; default: - LOG_DEBUG_STR(itsName << ":default(" << F_EVT_PROTOCOL(event) << "," << F_EVT_SIGNAL(event) << ")"); + LOG_DEBUG_STR(itsName << ":stopping default: " << eventName(event)); return(GCFEvent::NOT_HANDLED); break; } diff --git a/MAC/APL/StationCU/src/StationControl/ActiveObs.h b/MAC/APL/StationCU/src/StationControl/ActiveObs.h index 318da49f4f495f188bc41f2af4ff81b9337ede07..3363d6c49e9ecba35f3bcdfa501c0e813e863d5b 100644 --- a/MAC/APL/StationCU/src/StationControl/ActiveObs.h +++ b/MAC/APL/StationCU/src/StationControl/ActiveObs.h @@ -63,6 +63,8 @@ public: ActiveObs (const string& name, State initial, ParameterSet* aPS, + const string& LBAbitmap, + const string& HBAbitmap, bool hasSplitters, GCFTask& task); virtual ~ActiveObs(); @@ -95,6 +97,8 @@ private: RTDBPropertySet* itsPropertySet; GCFTimerPort* itsPropSetTimer; + GCFTimerPort* itsGuardTimer; + string itsName; GCFTask* itsTask; int32 itsInstanceNr; @@ -109,6 +113,8 @@ private: bool itsReadyFlag; CTState::CTstateNr itsReqState; CTState::CTstateNr itsCurState; + string itsLBAs; + string itsHBAs; }; //# diff --git a/MAC/APL/StationCU/src/StationControl/PVSSDatapointDefs.h b/MAC/APL/StationCU/src/StationControl/PVSSDatapointDefs.h index cbd965ef734851eac9ee2fe781706f559b0efca9..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/StationCU/src/StationControl/PVSSDatapointDefs.h +++ b/MAC/APL/StationCU/src/StationControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v1.0 on Thu Mar 19 14:56:58 UTC 2009 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,12 +25,15 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" -#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" #define PN_OBS_CLAIM_PERIOD "claimPeriod" #define PN_OBS_PREPARE_PERIOD "preparePeriod" #define PN_OBS_START_TIME "startTime" @@ -54,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -61,24 +55,88 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" +#define PN_OBSCTRL_COMMAND "command" + +// InputBuffer +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" +#define PST_INPUT_BUFFER "InputBuffer" +#define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" +#define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" +#define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" +#define PN_IPB_STREAM0_REJECTED "stream0.rejected" +#define PN_IPB_STREAM1_BLOCKS_IN "stream1.blocksIn" +#define PN_IPB_STREAM1_PERC_BAD "stream1.percBad" +#define PN_IPB_STREAM1_REJECTED "stream1.rejected" +#define PN_IPB_STREAM2_BLOCKS_IN "stream2.blocksIn" +#define PN_IPB_STREAM2_PERC_BAD "stream2.percBad" +#define PN_IPB_STREAM2_REJECTED "stream2.rejected" +#define PN_IPB_STREAM3_BLOCKS_IN "stream3.blocksIn" +#define PN_IPB_STREAM3_PERC_BAD "stream3.percBad" +#define PN_IPB_STREAM3_REJECTED "stream3.rejected" +#define PN_IPB_LATE "late" +#define PN_IPB_IO_TIME "IOTime" + +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" -// OnlineControl -#define PSN_ONLINE_CONTROL "LOFAR_ObsSW_@observation@_OnlineControl" -#define PST_ONLINE_CONTROL "OnlineControl" +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" -// Correlator -#define PSN_CORRELATOR "LOFAR_ObsSW_@observation@_OnlineControl_Correlator" -#define PST_CORRELATOR "Correlator" +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" -// StorageAppl -#define PSN_STORAGE_APPL "LOFAR_ObsSW_@observation@_OnlineControl_StorageAppl" -#define PST_STORAGE_APPL "StorageAppl" +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -135,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -217,10 +277,15 @@ #define PN_RCU_TRIGGER_FILTER "Trigger.filter" #define PN_RCU_TRIGGER_WINDOW "Trigger.window" #define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" -#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" -#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" -#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" -#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" +#define PN_RCU_TRIGGER_TRIGGER_MODE "Trigger.triggerMode" +#define PN_RCU_TRIGGER_FILTER0_COEFF0 "Trigger.filter0.coeff0" +#define PN_RCU_TRIGGER_FILTER0_COEFF1 "Trigger.filter0.coeff1" +#define PN_RCU_TRIGGER_FILTER0_COEFF2 "Trigger.filter0.coeff2" +#define PN_RCU_TRIGGER_FILTER0_COEFF3 "Trigger.filter0.coeff3" +#define PN_RCU_TRIGGER_FILTER1_COEFF0 "Trigger.filter1.coeff0" +#define PN_RCU_TRIGGER_FILTER1_COEFF1 "Trigger.filter1.coeff1" +#define PN_RCU_TRIGGER_FILTER1_COEFF2 "Trigger.filter1.coeff2" +#define PN_RCU_TRIGGER_FILTER1_COEFF3 "Trigger.filter1.coeff3" // TBBoard #define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" @@ -248,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -266,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -282,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -302,6 +413,9 @@ #define PN_OBS_NAME "name" #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" @@ -338,5 +452,6 @@ #define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" #define PN_TBC_TRIGGER_FLAGS "trigger.flags" #define PN_TBC_TRIGGER_TABLE "trigger.table" +#define PN_TBC_TRIGGER_MISSED "trigger.missed" #endif diff --git a/MAC/APL/StationCU/src/StationControl/StationControl.cc b/MAC/APL/StationCU/src/StationControl/StationControl.cc index a385c05b0dbb9caaf1f1b282914046ef511c8685..26f69d44602708016157ffdf4039fff306a4d8b7 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControl.cc +++ b/MAC/APL/StationCU/src/StationControl/StationControl.cc @@ -27,11 +27,13 @@ #include <Common/LofarLogger.h> #include <Common/LofarLocators.h> #include <Common/LofarConstants.h> +#include <Common/StreamUtil.h> #include <Common/SystemUtil.h> #include <Common/Version.h> #include <ApplCommon/LofarDirs.h> #include <ApplCommon/StationConfig.h> #include <ApplCommon/StationInfo.h> +#include <ApplCommon/AntennaSets.h> #include <Common/ParameterSet.h> #include <GCF/PVSS/GCF_PVTypes.h> @@ -124,8 +126,8 @@ StationControl::StationControl(const string& cntlrName) : itsRCUmask.reset(); itsTBmask.reset(); - LOG_DEBUG_STR("sizeof itsLBArcumask: " << itsLBArcumask.size()); - LOG_DEBUG_STR("sizeof itsHBArcumask: " << itsHBArcumask.size()); + LOG_DEBUG_STR("sizeof itsLBAmask: " << itsLBAmask.size()); + LOG_DEBUG_STR("sizeof itsHBAmask: " << itsHBAmask.size()); LOG_DEBUG_STR("sizeof itsRCUmask: " << itsRCUmask.size()); LOG_DEBUG_STR("sizeof itsTBmask: " << itsTBmask.size()); } @@ -238,27 +240,51 @@ GCFEvent::TResult StationControl::initial_state(GCFEvent& event, itsClockPSinitialized = true; LOG_DEBUG ("Attached to external propertySets"); + // Obtain initial clock value GCFPVInteger clockVal; itsClockPropSet->getValue(PN_CLC_REQUESTED_CLOCK, clockVal); if (clockVal.getValue() != 0) { itsClock = clockVal.getValue(); - LOG_DEBUG_STR("Clock in PVSS has value: " << itsClock); + LOG_INFO_STR("Clock in PVSS has value: " << itsClock); } else { // try actual clock itsClockPropSet->getValue(PN_CLC_ACTUAL_CLOCK, clockVal); if (clockVal.getValue() == 0) { - // both DB values are 0, fall back to 160 - LOG_DEBUG("Clock settings in the database are all 0, setting 160 as default"); - itsClock = 160; + // both DB values are 0, fall back to 200 + LOG_WARN("Clock settings in the database are all 0, setting 200 as default"); + itsClock = 200; itsClockPropSet->setValue(PN_CLC_REQUESTED_CLOCK, GCFPVInteger(itsClock)); } else { itsClock = clockVal.getValue(); - LOG_DEBUG_STR("Actual clock in PVSS has value: " << itsClock << " applying that value"); + LOG_INFO_STR("Actual clock in PVSS has value: " << itsClock << " applying that value"); itsClockPropSet->setValue(PN_CLC_REQUESTED_CLOCK, clockVal); } } + + // Obtain initial bitmode value + GCFPVInteger bitmodeVal; + itsClockPropSet->getValue(PN_CLC_REQUESTED_BITMODE, bitmodeVal); + if (bitmodeVal.getValue() != 0) { + itsBitmode = bitmodeVal.getValue(); + LOG_INFO_STR("Bitmode in PVSS has value: " << itsBitmode); + } + else { + // try actual bitmode + itsClockPropSet->getValue(PN_CLC_ACTUAL_BITMODE, bitmodeVal); + if (bitmodeVal.getValue() == 0) { + // both DB values are 0, fall back to 16 + LOG_WARN("Bitmode settings in the database are all 0, setting 16 as default"); + itsBitmode = 16; + itsClockPropSet->setValue(PN_CLC_REQUESTED_BITMODE, GCFPVInteger(itsBitmode)); + } + else { + itsBitmode = bitmodeVal.getValue(); + LOG_INFO_STR("Actual bitmode in PVSS has value: " << itsBitmode << " applying that value"); + itsClockPropSet->setValue(PN_CLC_REQUESTED_BITMODE, bitmodeVal); + } + } LOG_DEBUG ("Going to connect state to attach to ClockController"); TRAN(StationControl::connect_state); // go to next state. @@ -443,6 +469,10 @@ GCFEvent::TResult StationControl::subscribe2HWstates(GCFEvent& event, GCFPortInt TRAN(StationControl::operational_state); // go to next state. } break; + + case DP_CHANGED: + _databaseEventHandler(event); + break; default: status = GCFEvent::NOT_HANDLED; @@ -499,6 +529,10 @@ GCFEvent::TResult StationControl::subscribe2Splitters(GCFEvent& event, GCFPortIn LOG_INFO("Going to operational mode"); TRAN(StationControl::operational_state); // go to next state. break; + + case DP_CHANGED: + _databaseEventHandler(event); + break; default: status = GCFEvent::NOT_HANDLED; @@ -573,6 +607,14 @@ GCFEvent::TResult StationControl::operational_state(GCFEvent& event, GCFPortInte LOG_TRACE_FLOW("Dispatch to observation FSM's"); theObs->second->doEvent(event, port); LOG_TRACE_FLOW("Back from dispatch"); + + // check if observation is still running after this timer. + if (theObs->second->curState() == CTState::QUITED && theObs->second->isReady()) { + sendControlResult(*itsParentPort, CONTROL_QUIT, theObs->second->getName(), CT_RESULT_LOST_CONNECTION); + LOG_DEBUG_STR("Removing " << theObs->second->getName() << " from the administration due to premature quit"); + delete theObs->second; + itsObsMap.erase(theObs); + } } break; @@ -660,7 +702,7 @@ GCFEvent::TResult StationControl::operational_state(GCFEvent& event, GCFPortInte // check if all actions for this event are finished. vector<ChildControl::StateInfo> cntlrStates = itsChildControl->getPendingRequest("", treeID); -LOG_TRACE_FLOW_STR("There are " << cntlrStates.size() << " busy controllers"); + LOG_TRACE_FLOW_STR("There are " << cntlrStates.size() << " busy controllers"); if (cntlrStates.empty()) { // no pending requests? Ready. if (event.signal != CONTROL_QUITED) { sendControlResult(*itsParentPort, event.signal, cntlrName, CT_RESULT_NO_ERROR); @@ -704,7 +746,6 @@ LOG_TRACE_FLOW_STR("There are " << cntlrStates.size() << " busy controllers"); return (status); } - // // startObservation_state(event,port) // @@ -714,36 +755,20 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor { LOG_DEBUG_STR("startObservation: " << eventName(event) << "@" << port.getName()); + /* + * Several parts of the station (clock, splitters, bitmode..) need to be configured in sequence, and can take + * a while to stabilise. This is implemented by sequencing the station configuration in using F_TIMER. Every time + * the timer is triggered, the next configuration step is performed, after which an ACK event defers back to the + * timer to perform the next step. + */ + switch (event.signal) { case CONTROL_CLAIM: { - // Clock changes are done in the claim state and require an extra action - if (itsClock != itsStartingObs->second->obsPar()->sampleClock) { - // Check if all others obs are down otherwise we may not switch the clock - CONTROLCommonEvent ObsEvent(event); // we just need the name - uint16 instanceNr = getInstanceNr(ObsEvent.cntlrName); - OTDBtreeIDType treeID = getObservationNr(ObsEvent.cntlrName); - string cntlrName = controllerName(CNTLRTYPE_STATIONCTRL, instanceNr, treeID); - if (itsObsMap.size() != 1) { - LOG_FATAL_STR("Need to switch the clock to " << itsStartingObs->second->obsPar()->sampleClock << - " for observation " << treeID << " but there are still " << itsObsMap.size()-1 << - " other observations running at clockspeed" << itsClock << "."); - _abortObservation(itsStartingObs); - itsStartingObs = itsObsMap.end(); - TRAN(StationControl::operational_state); - break; - } - // its OK to switch te clock - itsClock = itsStartingObs->second->obsPar()->sampleClock; - LOG_DEBUG_STR ("Changing clock to " << itsClock); - CLKCTRLSetClockEvent setClock; - setClock.clock = itsClock; - itsClkCtrlPort->send(setClock); // results in CLKCTRL_SET_CLOCK_ACK - itsClockPropSet->setValue(PN_CLC_REQUESTED_CLOCK,GCFPVInteger(itsClock)); - } - else { - LOG_INFO_STR("new observation also uses clock " << itsClock); - itsTimerPort->setTimer(0.0); // goto set splitter section - } + // defer the setup to the timer event + itsSetupSequence = 0; + + itsTimerPort->setTimer(0.0); + break; } break; @@ -758,31 +783,24 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor } // clock was set succesfully, give clock 5 seconds to stabilize LOG_INFO("Stationclock is changed, waiting 5 seconds to let the clock stabilize"); + itsTimerPort->setTimer(5.0); } break; - case F_TIMER: { - StationConfig sc; - if (!sc.hasSplitters) { - LOG_INFO_STR("Ignoring splitter settings because we don't have splitters"); - // finally send a CLAIM event to the observation - LOG_TRACE_FLOW("Dispatch CLAIM event to observation FSM's."); - CONTROLClaimEvent claimEvent; - itsStartingObs->second->doEvent(claimEvent, port); - - LOG_INFO("Going back to operational state."); + case CLKCTRL_SET_BITMODE_ACK: { + CLKCTRLSetBitmodeAckEvent ack(event); + if (ack.status != CLKCTRL_NO_ERR) { + LOG_FATAL_STR("Unable to set the bitmode to " << itsBitmode << "."); + _abortObservation(itsStartingObs); itsStartingObs = itsObsMap.end(); TRAN(StationControl::operational_state); break; } + // bitmode was set succesfully + LOG_INFO("Stationbitmode is changed"); - // set the splitters in the right state. - bool splitterState = itsStartingObs->second->obsPar()->splitterOn; - LOG_DEBUG_STR ("Setting the splitters to " << (splitterState ? "ON" : "OFF")); - CLKCTRLSetSplittersEvent setEvent; - setEvent.splittersOn = splitterState; - itsClkCtrlPort->send(setEvent); // will result in CLKCTRL_SET_SPLITTERS_ACK + itsTimerPort->setTimer(0.0); } break; @@ -791,23 +809,107 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor bool splitterState = itsStartingObs->second->obsPar()->splitterOn; if (ack.status != CLKCTRL_NO_ERR) { LOG_FATAL_STR("Unable to set the splittters to " << (splitterState ? "ON" : "OFF")); - _abortObservation(itsStartingObs); - itsStartingObs = itsObsMap.end(); - TRAN(StationControl::operational_state); - break; - } - - itsSplitters = splitterState; - sleep (2); // give splitters time to stabilize. - - // finally send a CLAIM event to the observation - LOG_TRACE_FLOW("Dispatch CLAIM event to observation FSM's"); - CONTROLClaimEvent claimEvent; - itsStartingObs->second->doEvent(claimEvent, port); - - LOG_INFO("Going back to operational state"); - itsStartingObs = itsObsMap.end(); - TRAN(StationControl::operational_state); + } else { + itsSplitters = splitterState; + } + + // give splitters time to stabilize. + itsTimerPort->setTimer(2.0); + } + break; + + case F_TIMER: { + switch (itsSetupSequence++) { + case 0: { + // Set the clock + if (itsClock != itsStartingObs->second->obsPar()->sampleClock) { + // Check if all others obs are down otherwise we may not switch the clock + if (itsObsMap.size() != 1) { + CONTROLCommonEvent ObsEvent(event); // we just need the name + OTDBtreeIDType treeID = getObservationNr(ObsEvent.cntlrName); + + LOG_FATAL_STR("Need to switch the clock to " << itsStartingObs->second->obsPar()->sampleClock << + " for observation " << treeID << " but there are still " << itsObsMap.size()-1 << + " other observations running at clockspeed" << itsClock << "."); + _abortObservation(itsStartingObs); + itsStartingObs = itsObsMap.end(); + TRAN(StationControl::operational_state); + break; + } + // its OK to switch te clock + itsClock = itsStartingObs->second->obsPar()->sampleClock; + LOG_DEBUG_STR ("Changing clock to " << itsClock); + CLKCTRLSetClockEvent setClock; + setClock.clock = itsClock; + itsClkCtrlPort->send(setClock); // results in CLKCTRL_SET_CLOCK_ACK + itsClockPropSet->setValue(PN_CLC_REQUESTED_CLOCK,GCFPVInteger(itsClock)); + } + else { + LOG_INFO_STR("new observation also uses clock " << itsClock); + itsTimerPort->setTimer(0.0); + } + } + + case 1: { + // Set the splitters + StationConfig sc; + if (!sc.hasSplitters) { + LOG_INFO_STR("Ignoring splitter settings because we don't have splitters"); + + itsTimerPort->setTimer(0.0); + break; + } + + // set the splitters in the right state. + bool splitterState = itsStartingObs->second->obsPar()->splitterOn; + LOG_DEBUG_STR ("Setting the splitters to " << (splitterState ? "ON" : "OFF")); + CLKCTRLSetSplittersEvent setEvent; + setEvent.splittersOn = splitterState; + itsClkCtrlPort->send(setEvent); // will result in CLKCTRL_SET_SPLITTERS_ACK + } + + case 2: { + // Set the bit mode + if (itsBitmode != itsStartingObs->second->obsPar()->bitsPerSample) { + // Check if all others obs are down otherwise we may not switch the bitmode + if (itsObsMap.size() != 1) { + CONTROLCommonEvent ObsEvent(event); // we just need the name + OTDBtreeIDType treeID = getObservationNr(ObsEvent.cntlrName); + + LOG_FATAL_STR("Need to switch the bitmode to " << itsStartingObs->second->obsPar()->bitsPerSample << + " for observation " << treeID << " but there are still " << itsObsMap.size()-1 << + " other observations running at bitmodespeed" << itsBitmode << "."); + _abortObservation(itsStartingObs); + itsStartingObs = itsObsMap.end(); + TRAN(StationControl::operational_state); + break; + } + + // its OK to switch the bitmode + itsBitmode = itsStartingObs->second->obsPar()->bitsPerSample; + LOG_DEBUG_STR ("Changing bitmode to " << itsBitmode); + CLKCTRLSetBitmodeEvent setBitmode; + setBitmode.bits_per_sample = itsBitmode; + itsClkCtrlPort->send(setBitmode); // results in CLKCTRL_SET_BITMODE_ACK + itsClockPropSet->setValue(PN_CLC_REQUESTED_BITMODE,GCFPVInteger(itsBitmode)); + } + else { + LOG_INFO_STR("new observation also uses bitmode " << itsBitmode); + itsTimerPort->setTimer(0.0); + } + } + + default: { + // finally send a CLAIM event to the observation + LOG_TRACE_FLOW("Dispatch CLAIM event to observation FSM's"); + CONTROLClaimEvent claimEvent; + itsStartingObs->second->doEvent(claimEvent, port); + + LOG_INFO("Going back to operational state"); + itsStartingObs = itsObsMap.end(); + TRAN(StationControl::operational_state); + } + } } break; @@ -893,18 +995,32 @@ void StationControl::_databaseEventHandler(GCFEvent& event) DPChangedEvent dpEvent(event); if (strstr(dpEvent.DPname.c_str(), PN_CLC_REQUESTED_CLOCK) != 0) { itsClock = ((GCFPVInteger*)(dpEvent.value._pValue))->getValue(); - LOG_DEBUG_STR("Received (requested)clock change from PVSS, clock is now " << itsClock); + LOG_INFO_STR("Received (requested)clock change from PVSS, clock is now " << itsClock); break; } - // during startup we adopt the value set by the Clockcontroller. + // during startup we adopt the value set by the ClockController. if (strstr(dpEvent.DPname.c_str(), PN_CLC_ACTUAL_CLOCK) != 0) { itsClock = ((GCFPVInteger*)(dpEvent.value._pValue))->getValue(); - LOG_DEBUG_STR("Received (actual)clock change from PVSS, clock is now " << itsClock); + LOG_INFO_STR("Received (actual)clock change from PVSS, bitmode is now " << itsClock); _abortObsWithWrongClock(); break; } + if (strstr(dpEvent.DPname.c_str(), PN_CLC_REQUESTED_BITMODE) != 0) { + itsBitmode = ((GCFPVInteger*)(dpEvent.value._pValue))->getValue(); + LOG_INFO_STR("Received (requested)bitmode change from PVSS, bitmode is now " << itsBitmode); + break; + } + + // during startup we adopt the value set by the ClockController. + if (strstr(dpEvent.DPname.c_str(), PN_CLC_ACTUAL_BITMODE) != 0) { + itsBitmode = ((GCFPVInteger*)(dpEvent.value._pValue))->getValue(); + LOG_INFO_STR("Received (actual)bitmode change from PVSS, bitmode is now " << itsBitmode); + _abortObsWithWrongBitmode(); + break; + } + // don't watch state and error fields. if ((strstr(dpEvent.DPname.c_str(), PN_OBJ_STATE) != 0) || (strstr(dpEvent.DPname.c_str(), PN_FSM_ERROR) != 0) || @@ -927,6 +1043,7 @@ void StationControl::_handleQueryEvent(GCFEvent& event) { LOG_TRACE_FLOW_STR ("_handleQueryEvent:" << eventName(event)); + // Check for errors DPQueryChangedEvent DPevent(event); if (DPevent.result != SA_NO_ERROR) { LOG_ERROR_STR("PVSS reported error " << DPevent.result << " for a query " << @@ -934,6 +1051,7 @@ void StationControl::_handleQueryEvent(GCFEvent& event) return; } + // Remember Query ID if not done before. if (!itsStateQryID) { itsStateQryID = DPevent.QryID; } @@ -941,6 +1059,7 @@ void StationControl::_handleQueryEvent(GCFEvent& event) // The selected datapoints are delivered with full PVSS names, like: // CS001:LOFAR_PIC_Cabinet0_Subrack0_RSPBoard0_RCU5.status.state // CS001:LOFAR_PIC_Cabinet0_Subrack0_RSPBoard0.splitterOn + // CS001:LOFAR_PIC_LBA000.status.state // Each event may contain more than one DP. int nrDPs = ((GCFPVDynArr*)(DPevent.DPnames._pValue))->getValue().size(); GCFPVDynArr* DPnames = (GCFPVDynArr*)(DPevent.DPnames._pValue); @@ -957,14 +1076,65 @@ void StationControl::_handleQueryEvent(GCFEvent& event) LOG_DEBUG_STR("QryUpdate: DP=" << nameStr << ", value=" << newState); + // test for LBA + if ((pos = nameStr.find("PIC_LBA")) != string::npos) { + uint antNr; + if (sscanf(nameStr.substr(pos).c_str(), "PIC_LBA%u.status.state", &antNr) != 1) { + LOG_ERROR_STR("Cannot determine address of " << nameStr << + ". AVAILABILITY OF ANTENNA'S MIGHT NOT BE UP TO DATE ANYMORE"); + continue; + } + if (antNr >= itsNrLBAs) { + LOG_ERROR_STR("LBA antenna number " << antNr << " is out of range!!!"); + continue; + } + + LOG_INFO_STR("New state of LBA " << antNr << " is " << newState); + // LBA's in de mode OFF and OPERATIONAL may be used in observations. + if (newState == modeOff || newState == modeOperational) { + itsLBAmask.set(antNr); + } + else { // all other modes + itsLBAmask.reset(antNr); + } + } // PIC_LBA + + // test for HBA + if ((pos = nameStr.find("PIC_HBA")) != string::npos) { + uint antNr; + if (sscanf(nameStr.substr(pos).c_str(), "PIC_HBA%u.status.state", &antNr) != 1) { + LOG_ERROR_STR("Cannot determine address of " << nameStr << + ". AVAILABILITY OF ANTENNA'S MIGHT NOT BE UP TO DATE ANYMORE"); + continue; + } + if (antNr >= itsNrHBAs) { + LOG_ERROR_STR("HBA antenna number " << antNr << " is out of range!!!"); + continue; + } + + LOG_INFO_STR("New state of HBA " << antNr << " is " << newState); + // HBA's in de mode OFF and OPERATIONAL may be used in observations. + if (newState == modeOff || newState == modeOperational) { + itsHBAmask.set(antNr); + } + else { // all other modes + itsHBAmask.reset(antNr); + } + } // PIC_HBA + // test for RCU if ((pos = nameStr.find("_RCU")) != string::npos) { - int rcu; - if (sscanf(nameStr.substr(pos).c_str(), "_RCU%d.status.state", &rcu) != 1) { + uint rcu; + if (sscanf(nameStr.substr(pos).c_str(), "_RCU%u.status.state", &rcu) != 1) { LOG_ERROR_STR("Cannot determine address of " << nameStr << ". AVAILABILITY OF ANTENNA'S MIGHT NOT BE UP TO DATE ANYMORE"); continue; } + if (rcu >= itsNrRCUs) { + LOG_ERROR_STR("RCU number " << rcu << " is out of range!!!"); + continue; + } + LOG_INFO_STR("New state of RCU " << rcu << " is " << newState); // RCU's in de mode OFF and OPERATIONAL may be used in observations. if (newState == modeOff || newState == modeOperational) { @@ -973,22 +1143,24 @@ void StationControl::_handleQueryEvent(GCFEvent& event) else { // all other modes itsRCUmask.reset(rcu); } - } + } // _RCU // test for RSPBoard else if ((pos = nameStr.find("_RSPBoard")) != string::npos) { - int rsp; + uint rsp; if (nameStr.find(".status.state") != string::npos) { - if (sscanf(nameStr.substr(pos).c_str(), "_RSPBoard%d.status.state", &rsp) == 1) { + if (sscanf(nameStr.substr(pos).c_str(), "_RSPBoard%u.status.state", &rsp) == 1) { + if (rsp >= itsNrRSPs) { + LOG_ERROR_STR("RSP board number " << rsp << " is out of range!!!"); + continue; + } LOG_INFO_STR("New state of RSPBoard " << rsp << " is " << newState); int rcubase = rsp * NR_RCUS_PER_RSPBOARD; for (int i = 0; i < NR_RCUS_PER_RSPBOARD; i++) { if (newState != RTDB_OBJ_STATE_OPERATIONAL) { itsRCUmask.reset(rcubase + i); } - else { - itsRCUmask.set(rcubase + i); - } + // no else: never mark an RCU operational on the state of an RSPBoard. } } } @@ -998,7 +1170,11 @@ void StationControl::_handleQueryEvent(GCFEvent& event) itsSplitterQryID = DPevent.QryID; } - if (sscanf(nameStr.substr(pos).c_str(), "_RSPBoard%d.splitterOn", &rsp) == 1) { + if (sscanf(nameStr.substr(pos).c_str(), "_RSPBoard%u.splitterOn", &rsp) == 1) { + if (rsp >= itsNrRSPs) { + LOG_ERROR_STR("RSP boardnumber " << rsp << " is out of range!!!"); + continue; + } if (itsSplitters[rsp] != (newState ? true : false)) { LOG_INFO_STR("New setting of splitter " << rsp << " is " << (newState ? "on" : "off")); if (newState) { @@ -1015,16 +1191,20 @@ void StationControl::_handleQueryEvent(GCFEvent& event) ". STATE OF ANTENNA'S OR SPLITTERS MIGHT NOT BE UP TO DATE ANYMORE"); continue; } - } + } // _RSPBoard // test for TBBoard else if ((pos = nameStr.find("_TBBoard")) != string::npos) { - int tbb; - if (sscanf(nameStr.substr(pos).c_str(), "_TBBoard%d.status.state", &tbb) != 1) { + uint tbb; + if (sscanf(nameStr.substr(pos).c_str(), "_TBBoard%u.status.state", &tbb) != 1) { LOG_ERROR_STR("Cannot determine address of " << nameStr << ". AVAILABILITY OF TBBOARD'S MIGHT NOT BE UP TO DATE ANYMORE"); continue; } + if (tbb >= itsNrTBBs) { + LOG_ERROR_STR("TB boardnumber " << tbb << " is out of range!!!"); + continue; + } LOG_INFO_STR("New state of TBBoard " << tbb << " is " << newState); if (newState != RTDB_OBJ_STATE_OPERATIONAL) { itsTBmask.reset(tbb); @@ -1032,14 +1212,17 @@ void StationControl::_handleQueryEvent(GCFEvent& event) else { itsTBmask.set(tbb); } - } + } // _TBBoard else { LOG_DEBUG_STR("State of unknown component received: " << nameStr); } } // for - _updateAntennaMasks(); // translate new RCU mask to the LBA and HBA masks. + if (itsHasSplitters && itsSplitters.count() != 0 && itsSplitters.count() != itsNrRSPs) { + LOG_WARN_STR("Not all splitters have the same state! " << itsSplitters); + // TODO: ring some bells in the Navigator? + } } @@ -1085,16 +1268,49 @@ uint16 StationControl::_addObservation(const string& name) // As base we use the definition of the AntennaSetsfile which we limit to the // receivers specified by the user (if any). Finally we can optionally correct // this set with the 'realtime' availability of the receivers. - StationConfig config; - Observation::RCUset_t definedReceivers = itsAntSet->RCUallocation(theObs.antennaSet); - Observation::RCUset_t userReceivers = theObs.getRCUbitset(config.nrLBAs, config.nrHBAs, theObs.antennaSet); - Observation::RCUset_t realReceivers = definedReceivers & userReceivers; + StationConfig config; + bool onLBAField(itsAntSet->usesLBAfield(theObs.antennaSet)); + RCUmask_t definedReceivers = (onLBAField ? itsAntSet->LBAallocation(theObs.antennaSet) + : itsAntSet->HBAallocation(theObs.antennaSet)); + RCUmask_t userReceivers = theObs.getRCUbitset(config.nrLBAs, config.nrHBAs, theObs.antennaSet); + RCUmask_t realReceivers = definedReceivers & userReceivers; LOG_DEBUG_STR("definedReceivers =" << definedReceivers); LOG_DEBUG_STR("userReceivers =" << userReceivers); LOG_DEBUG_STR("def&userReceivers=" << realReceivers); + // Before optionally applying the current hardware status make bitmap strings for PVSS. + string LBAbitmap; + string HBAbitmap; + LBAbitmap.resize(config.nrLBAs,'0'); + HBAbitmap.resize(config.nrHBAs,'0'); + if (onLBAField) { + for (int i(0); i < config.nrLBAs; i++) { + if (realReceivers[2*i] || realReceivers[2*i+1]) { + LBAbitmap[i] ='1'; + } + } + } + else { + for (int i(0); i < config.nrHBAs; i++) { + if (realReceivers[2*i] || realReceivers[2*i+1]) { + HBAbitmap[i] ='1'; + } + } + } + // apply the current state of the hardware to the desired selection when user likes that. if (itsUseHWinfo) { - realReceivers &= itsRCUmask; + vector<int> *mappingPtr = onLBAField ? &itsLBAmapping : &itsHBAmapping; + AntennaMask_t antBitSet = onLBAField ? itsLBAmask : itsHBAmask; + for (int rcu = 0; rcu < MAX_RCUS; rcu++) { + int idx((*mappingPtr)[rcu]); + if (!realReceivers[rcu] || idx<0 || !antBitSet[idx] || !itsRCUmask[rcu]) { + realReceivers.reset(rcu); + if (idx >= 0 && !antBitSet[idx]) { + LOG_INFO_STR("Rejecting RCU " << rcu << " because Antenna is out of order"); + } + } + } +LOG_DEBUG_STR("final receivers =" << realReceivers); // Write the corrected set back into the ParameterSetfile. string prefix = theObsPS.locateModule("Observation") + "Observation."; // save original under different name (using 'replace' is 'add' w. simplified testing) @@ -1110,7 +1326,7 @@ LOG_DEBUG_STR("def&userReceivers=" << realReceivers); // create an activeObservation object that will manage the child controllers. - ActiveObs* theNewObs = new ActiveObs(name, (State)&ActiveObs::initial, &theObsPS, itsHasSplitters, *this); + ActiveObs* theNewObs = new ActiveObs(name, (State)&ActiveObs::initial, &theObsPS, LBAbitmap, HBAbitmap, itsHasSplitters, *this); if (!theNewObs) { LOG_FATAL_STR("Unable to create the Observation '" << name << "'"); return (CT_RESULT_UNSPECIFIED); @@ -1167,6 +1383,25 @@ void StationControl::_abortObsWithWrongClock() } } +// +// _abortObsWithWrongBitmode() +// +void StationControl::_abortObsWithWrongBitmode() +{ + LOG_DEBUG_STR("Checking if all observations use bitmode " << itsBitmode); + + ObsIter iter = itsObsMap.begin(); + ObsIter end = itsObsMap.end(); + while (iter != end) { + if (iter->second->obsPar()->bitsPerSample != itsBitmode) { + LOG_FATAL_STR("Aborting observation " << getObservationNr(iter->second->getName()) << + " because the bitmode was (manually?) changed!"); + _abortObservation(iter); + } + ++iter; + } +} + // // _initAntennaMasks // @@ -1175,27 +1410,48 @@ void StationControl::_abortObsWithWrongClock() void StationControl::_initAntennaMasks() { // reset all variables - itsLBArcumask.reset(); - itsHBArcumask.reset(); + itsLBAmask.reset(); + itsHBAmask.reset(); // Adopt values from RemoteStation.conf StationConfig SC; - itsNrRSPboards = SC.nrRSPs; - itsNrLBAs = SC.nrLBAs; - itsNrHBAs = SC.nrHBAs; + itsNrRSPs = SC.nrRSPs; + itsNrTBBs = SC.nrRSPs; + itsNrLBAs = SC.nrLBAs; + itsNrHBAs = SC.nrHBAs; + itsNrRCUs = SC.nrRSPs * NR_RCUS_PER_RSPBOARD; itsHasSplitters= SC.hasSplitters; - ASSERTSTR (2*itsNrLBAs <= itsLBArcumask.size() && - 2*itsNrHBAs <= itsHBArcumask.size(), "Number of antennas exceed expected count"); - - // set the right bits. - for (uint i = 0; i < itsNrLBAs; i++) { - itsLBArcumask.set(2*i); - itsLBArcumask.set(2*i+1); - } - for (uint i = 0; i < itsNrHBAs; i++) { - itsHBArcumask.set(2*i); - itsHBArcumask.set(2*i+1); + ASSERTSTR (itsNrLBAs <= itsLBAmask.size() && + itsNrHBAs <= itsHBAmask.size(), "Number of antennas exceed expected count"); + + // Setup mapping from LBA antennas and HBA antennas to RCU numbers. + // itsxBAmapping(antNr,*) contains the + itsLBAmapping.resize(MAX_RCUS, -1); // 192 + itsHBAmapping.resize(MAX_RCUS, -1); + for (int ant = 0; ant < (int)MAX_ANTENNAS; ant++) { + if (ant < (int)itsNrHBAs) { + itsHBAmapping[N_POL*ant] = ant; + itsHBAmapping[N_POL*ant+1] = ant; + } + if (ant < (int)itsNrLBAs) { + if (ant > (int)itsNrRSPs * (int)NR_ANTENNAS_PER_RSPBOARD) { + itsLBAmapping[N_POL*ant+1 - (NR_RCUS_PER_RSPBOARD*itsNrRSPs)] = ant; + itsLBAmapping[N_POL*ant - (NR_RCUS_PER_RSPBOARD*itsNrRSPs)] = ant; + } + else { + itsLBAmapping[N_POL*ant] = ant; + itsLBAmapping[N_POL*ant+1] = ant; + } + } + } + { stringstream oss; + writeVector(oss, itsLBAmapping); + LOG_DEBUG_STR("LBAmap: " << oss.str()); + } + { stringstream oss; + writeVector(oss, itsHBAmapping); + LOG_DEBUG_STR("HBAmap: " << oss.str()); } // The masks are now initialized with the static information. The _handleQueryEvent routine @@ -1203,51 +1459,6 @@ void StationControl::_initAntennaMasks() // correct and latest state. } -// -// _updateAntennaMasks() -// -// Translates the RCU mask to the LBA and HBA masks. -// This routine is familiar with mapping of the antennas on the RCU's. -// -void StationControl::_updateAntennaMasks() -{ - // setup constants - bool doubleMappedLBA (itsNrLBAs > (itsNrRSPboards * NR_ANTENNAS_PER_RSPBOARD)); - int doubleMapRCUoffset (itsNrRSPboards * NR_RCUS_PER_RSPBOARD); - - // Note: the definition in StationControl.h and the ASSERT in _initAntennaMasks assure - // that we never exceed the boundaries of the bitmaps here. - for (int rcu = 0; rcu < MAX_RCUS/2 ; rcu+=2) { - if (itsRCUmask[rcu] && itsRCUmask[rcu+1]) { // X and Y - itsLBArcumask.set(rcu); - itsLBArcumask.set(rcu+1); - if (doubleMappedLBA) { - itsLBArcumask.set(doubleMapRCUoffset+rcu); - itsLBArcumask.set(doubleMapRCUoffset+rcu+1); - } - itsHBArcumask.set(rcu); - itsHBArcumask.set(rcu+1); - } - else { - itsLBArcumask.reset(rcu); - itsLBArcumask.reset(rcu+1); - if (doubleMappedLBA) { - itsLBArcumask.reset(doubleMapRCUoffset+rcu); - itsLBArcumask.reset(doubleMapRCUoffset+rcu+1); - } - itsHBArcumask.reset(rcu); - itsHBArcumask.reset(rcu+1); - } - } - LOG_DEBUG_STR("itsRCU:" << string(itsRCUmask.to_string<char,char_traits<char>,allocator<char> >())); - LOG_DEBUG_STR("itsLBA:" << string(itsLBArcumask.to_string<char,char_traits<char>,allocator<char> >())); - LOG_DEBUG_STR("itsHBA:" << string(itsHBArcumask.to_string<char,char_traits<char>,allocator<char> >())); - - if (itsHasSplitters && itsSplitters.count() != 0 && itsSplitters.count() != itsNrRSPboards) { - LOG_WARN_STR("Not all splitters have the same state! " << itsSplitters); - // TODO: ring some bells in the Navigator? - } -} // // _searchObsByTimerID(timerID) diff --git a/MAC/APL/StationCU/src/StationControl/StationControl.h b/MAC/APL/StationCU/src/StationControl/StationControl.h index 342cada054c447335efe9c557d3bcf235f626511..b5eef6b10eed442e898b91757fcae7d167783df7 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControl.h +++ b/MAC/APL/StationCU/src/StationControl/StationControl.h @@ -31,6 +31,7 @@ #include <Common/LofarConstants.h> #include <ApplCommon/Observation.h> #include <ApplCommon/AntennaSets.h> +#include <ApplCommon/StationDatatypes.h> //# ACC Includes #include <Common/ParameterSet.h> @@ -96,11 +97,11 @@ private: // helper methods void _initAntennaMasks (); - void _updateAntennaMasks (); void _updateObsListInPVSS (); uint16 _addObservation (const string& name); void _abortObservation (ObsIter theObs); void _abortObsWithWrongClock(); + void _abortObsWithWrongBitmode(); void _disconnectedHandler (GCFPortInterface& port); void _databaseEventHandler(GCFEvent& event); void _handleQueryEvent (GCFEvent& event); @@ -137,21 +138,27 @@ private: uint32 itsInstanceNr; time_t itsStartTime; // timestamp the controller was started int32 itsClock; + int32 itsBitmode; map<string, ActiveObs*> itsObsMap; // current running observations ObsIter itsStartingObs; // the Obs that is being started is this moment. // Availability information of Antenna's and circuit boards. bool itsUseHWinfo; - bitset<MAX_RCUS> itsLBArcumask; - bitset<MAX_RCUS> itsHBArcumask; - bitset<MAX_RCUS> itsRCUmask; + RCUmask_t itsRCUmask; + AntennaMask_t itsLBAmask; + AntennaMask_t itsHBAmask; bitset<MAX_RCUS / NR_RCUS_PER_TBBOARD> itsTBmask; uint32 itsNrLBAs; uint32 itsNrHBAs; - uint32 itsNrRSPboards; + uint32 itsNrRCUs; + uint32 itsNrRSPs; + uint32 itsNrTBBs; bool itsHasSplitters; bitset<MAX_RSPBOARDS> itsSplitters; // On or Off. + vector<int> itsLBAmapping; + vector<int> itsHBAmapping; + unsigned itsSetupSequence; }; };//StationCU diff --git a/MAC/APL/StationCU/src/StationControl/StationControlMain.cc b/MAC/APL/StationCU/src/StationControl/StationControlMain.cc index 9773aeab40014c879ed669504914f30d1c0996ac..38ff113ea9e627c501b9ae2e5eaa6a946e4f8969 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControlMain.cc +++ b/MAC/APL/StationCU/src/StationControl/StationControlMain.cc @@ -22,7 +22,6 @@ //# #include <lofar_config.h> #include <Common/LofarLogger.h> -#include <Common/Exception.h> #include <Common/SystemUtil.h> #include <APL/APLCommon/ChildControl.h> #include <APL/APLCommon/ParentControl.h> @@ -34,9 +33,6 @@ using namespace LOFAR::GCF::TM; using namespace LOFAR::APLCommon; using namespace LOFAR::StationCU; -// Use a terminate handler that can produce a backtrace. -Exception::TerminateHandler t(Exception::terminate); - int main(int argc, char* argv[]) { using LOFAR::basename; diff --git a/MAC/APL/StationCU/src/TBBControl/PVSSDatapointDefs.h b/MAC/APL/StationCU/src/TBBControl/PVSSDatapointDefs.h index 6cb9a56637b40cf1db0fbe4912dd8035d51caac7..9f83a52dda5186c04b67baafe90c3bd19e564dce 100644 --- a/MAC/APL/StationCU/src/TBBControl/PVSSDatapointDefs.h +++ b/MAC/APL/StationCU/src/TBBControl/PVSSDatapointDefs.h @@ -1,4 +1,4 @@ -// This file was generated by create_db_files v2.0 on Mon Apr 26 01:38:02 UTC 2010 +// This file was generated by create_db_files v2.0 on Tue Oct 9 13:22:37 UTC 2012 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H @@ -15,18 +15,6 @@ #define PN_OBJ_MESSAGE "object.message" #define PN_OBJ_LEAF "object.leaf" -// Station -#define PSN_STATION "LOFAR_PIC_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - -// Station -#define PSN_STATION "LOFAR_PermSW_@ring@_@station@" -#define PST_STATION "Station" -#define PN_STS_POWER48_ON "power48On" -#define PN_STS_POWER220_ON "power220On" - // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" #define PST_MAC_SCHEDULER "MACScheduler" @@ -37,6 +25,10 @@ #define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" #define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" +// CRTriggerControl +#define PSN_CR_TRIGGER_CONTROL "LOFAR_PermSW_CRTriggerControl" +#define PST_CR_TRIGGER_CONTROL "CRTriggerControl" + // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" @@ -53,6 +45,9 @@ #define PN_OBS_SAMPLE_CLOCK "sampleClock" #define PN_OBS_RUN_STATE "runState" #define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_PROCESS_TYPE "processType" +#define PN_OBS_PROCESS_SUBTYPE "processSubtype" +#define PN_OBS_STRATEGY "strategy" #define PN_OBS_STATION_LIST "stationList" #define PN_OBS_INPUT_NODE_LIST "inputNodeList" #define PN_OBS_BGL_NODE_LIST "BGLNodeList" @@ -60,24 +55,24 @@ #define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" #define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" #define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" #define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" +#define PN_OBS_TIED_ARRAY_BEAMS_BEAM_INDEX "TiedArrayBeams.beamIndex" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE1 "TiedArrayBeams.angle1" +#define PN_OBS_TIED_ARRAY_BEAMS_ANGLE2 "TiedArrayBeams.angle2" +#define PN_OBS_TIED_ARRAY_BEAMS_DIRECTION_TYPE "TiedArrayBeams.directionType" +#define PN_OBS_TIED_ARRAY_BEAMS_DISPERSION "TiedArrayBeams.dispersion" +#define PN_OBS_TIED_ARRAY_BEAMS_COHERENT "TiedArrayBeams.coherent" // ObservationControl #define PSN_OBSERVATION_CONTROL "LOFAR_ObsSW_@observation@_ObservationControl" #define PST_OBSERVATION_CONTROL "ObservationControl" - -// Adder -#define PSN_ADDER "@adder@" -#define PST_ADDER "Adder" -#define PN_ADD_DROPPING "dropping" -#define PN_ADD_NR_BLOCKS_DROPPED "nrBlocksDropped" -#define PN_ADD_LOG_LINE "logLine" +#define PN_OBSCTRL_COMMAND "command" // InputBuffer -#define PSN_INPUT_BUFFER "@inputbuffer@" +#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" #define PST_INPUT_BUFFER "InputBuffer" #define PN_IPB_STATION_NAME "stationName" +#define PN_IPB_OBSERVATION_NAME "observationName" #define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" #define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" #define PN_IPB_STREAM0_REJECTED "stream0.rejected" @@ -93,12 +88,55 @@ #define PN_IPB_LATE "late" #define PN_IPB_IO_TIME "IOTime" -// Storage -#define PSN_STORAGE "@storage@" -#define PST_STORAGE "Storage" -#define PN_STR_TIME "time" -#define PN_STR_COUNT "count" -#define PN_STR_DROPPED "dropped" +// Adder +#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" +#define PST_ADDER "Adder" +#define PN_ADD_DROPPING "dropping" +#define PN_ADD_DROPPED "dropped" +#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" +#define PN_ADD_DATA_PRODUCT "dataProduct" +#define PN_ADD_FILE_NAME "fileName" +#define PN_ADD_LOCUS_NODE "locusNode" +#define PN_ADD_WRITER "writer" +#define PN_ADD_DIRECTORY "directory" +#define PN_ADD_OBSERVATION_NAME "observationName" + +// Writer +#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" +#define PST_WRITER "Writer" +#define PN_WTR_WRITTEN "written" +#define PN_WTR_DROPPED "dropped" +#define PN_WTR_FILE_NAME "fileName" +#define PN_WTR_DATA_RATE "dataRate" +#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" +#define PN_WTR_OBSERVATION_NAME "observationName" + +// IONode +#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" +#define PST_IO_NODE "IONode" +#define PN_ION_STATION0 "station0" +#define PN_ION_IP0 "IP0" +#define PN_ION_MAC0 "MAC0" +#define PN_ION_STATION1 "station1" +#define PN_ION_IP1 "IP1" +#define PN_ION_MAC1 "MAC1" +#define PN_ION_USE2ND_STATION "use2ndStation" +#define PN_ION_USED_STATION "usedStation" +#define PN_ION_USEDIP "usedIP" +#define PN_ION_USEDMAC "usedMAC" + +// LocusNode +#define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" +#define PST_LOCUS_NODE "LocusNode" +#define PN_LCN_FREE "free" +#define PN_LCN_TOTAL "total" +#define PN_LCN_CLAIMED "claimed" + +// CEPHardwareMonitor +#define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" +#define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" +#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -155,6 +193,8 @@ #define PN_RSP_VOLTAGE25 "voltage25" #define PN_RSP_VOLTAGE33 "voltage33" #define PN_RSP_VERSION "version" +#define PN_RSP_BITMODE "bitmode" +#define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" #define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" @@ -273,6 +313,62 @@ #define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" #define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" +// LBAAntenna +#define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" +#define PST_LBA_ANTENNA "LBAAntenna" + +// HBAAntenna +#define PSN_HBA_ANTENNA "LOFAR_PIC_@hbaantenna@" +#define PST_HBA_ANTENNA "HBAAntenna" + +// StationInfo +#define PSN_STATION_INFO "LOFAR_PIC_StationInfo" +#define PST_STATION_INFO "StationInfo" +#define PN_STI_STATIONID "stationID" +#define PN_STI_N_RSP_BOARDS "N_RSPBoards" +#define PN_STI_N_TB_BOARDS "N_TBBoards" +#define PN_STI_N_LBAS "N_LBAS" +#define PN_STI_N_HBAS "N_HBAS" +#define PN_STI_HBA__SPLIT "HBA_Split" +#define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_POWER48_ON "power48On" +#define PN_STI_POWER220_ON "power220On" +#define PN_STI_CABINET_X "Cabinet.X" +#define PN_STI_CABINET_Y "Cabinet.Y" +#define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_CENTERX "HBA.centerX" +#define PN_STI_HBA_CENTERY "HBA.centerY" +#define PN_STI_HBA_CENTERZ "HBA.centerZ" +#define PN_STI_HBA_HBA0_CENTERX "HBA.HBA0.centerX" +#define PN_STI_HBA_HBA0_CENTERY "HBA.HBA0.centerY" +#define PN_STI_HBA_HBA0_CENTERZ "HBA.HBA0.centerZ" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_X "HBA.HBA0.NormalVector.X" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Y "HBA.HBA0.NormalVector.Y" +#define PN_STI_HBA_HBA0__NORMAL_VECTOR_Z "HBA.HBA0.NormalVector.Z" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_X "HBA.HBA0.RotationMatrix.X" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Y "HBA.HBA0.RotationMatrix.Y" +#define PN_STI_HBA_HBA0__ROTATION_MATRIX_Z "HBA.HBA0.RotationMatrix.Z" +#define PN_STI_HBA_HBA0_ROTATION "HBA.HBA0.rotation" +#define PN_STI_HBA_HBA1_CENTERX "HBA.HBA1.centerX" +#define PN_STI_HBA_HBA1_CENTERY "HBA.HBA1.centerY" +#define PN_STI_HBA_HBA1_CENTERZ "HBA.HBA1.centerZ" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_X "HBA.HBA1.NormalVector.X" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Y "HBA.HBA1.NormalVector.Y" +#define PN_STI_HBA_HBA1__NORMAL_VECTOR_Z "HBA.HBA1.NormalVector.Z" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_X "HBA.HBA1.RotationMatrix.X" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" +#define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" +#define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_CENTERX "LBA.centerX" +#define PN_STI_LBA_CENTERY "LBA.centerY" +#define PN_STI_LBA_CENTERZ "LBA.centerZ" +#define PN_STI_LBA__NORMAL_VECTOR_X "LBA.NormalVector.X" +#define PN_STI_LBA__NORMAL_VECTOR_Y "LBA.NormalVector.Y" +#define PN_STI_LBA__NORMAL_VECTOR_Z "LBA.NormalVector.Z" +#define PN_STI_LBA__ROTATION_MATRIX_X "LBA.RotationMatrix.X" +#define PN_STI_LBA__ROTATION_MATRIX_Y "LBA.RotationMatrix.Y" +#define PN_STI_LBA__ROTATION_MATRIX_Z "LBA.RotationMatrix.Z" + // LogProcessor #define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" #define PST_LOG_PROCESSOR "LogProcessor" @@ -291,6 +387,7 @@ // SoftwareMonitor #define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" #define PST_SOFTWARE_MONITOR "SoftwareMonitor" +#define PN_SWM_SW_LEVEL "SWLevel" // SHMInfoServer #define PSN_SHM_INFO_SERVER "LOFAR_PermSW_SHMInfoServer" @@ -307,19 +404,8 @@ #define PN_CLC_CONNECTED "connected" #define PN_CLC_REQUESTED_CLOCK "requestedClock" #define PN_CLC_ACTUAL_CLOCK "actualClock" - -// Antenna -#define PSN_ANTENNA "@antenna@" -#define PST_ANTENNA "Antenna" -#define PN_ANT_STATUS_STATE "status.state" -#define PN_ANT_STATUS_CHILD_STATE "status.childState" -#define PN_ANT_STATUS_MESSAGE "status.message" -#define PN_ANT_STATUS_LEAF "status.leaf" -#define PN_ANT_RCUX "RCUX" -#define PN_ANT_RCUY "RCUY" -#define PN_ANT_DELTAX "deltaX" -#define PN_ANT_DELTAY "deltaY" -#define PN_ANT_DELTAH "deltaH" +#define PN_CLC_REQUESTED_BITMODE "requestedBitmode" +#define PN_CLC_ACTUAL_BITMODE "actualBitmode" // StnObservation #define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" @@ -328,6 +414,8 @@ #define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" #define PN_OBS_CLAIM_NAME "claim.name" #define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_HBA_BITMAP "HBABitmap" +#define PN_OBS_LBA_BITMAP "LBABitmap" // BeamControl #define PSN_BEAM_CONTROL "LOFAR_ObsSW_@observation@_BeamControl" diff --git a/MAC/Deployment/data/Coordinates/ETRF_FILES/FI609/FI609-antenna-positions-etrs.csv b/MAC/Deployment/data/Coordinates/ETRF_FILES/FI609/FI609-antenna-positions-etrs.csv index 3e0733d8994bbb1c6cfa4a0a0b3e90648007d394..827fccfaaccfd89b95bea91bf8a6f2a23c52690d 100644 --- a/MAC/Deployment/data/Coordinates/ETRF_FILES/FI609/FI609-antenna-positions-etrs.csv +++ b/MAC/Deployment/data/Coordinates/ETRF_FILES/FI609/FI609-antenna-positions-etrs.csv @@ -1,4 +1,52 @@ NAME,ETRS-X,ETRS-Y,ETRS-Z,STATION-P,STATION-Q,STATION-R,RCU-X,RCU-Y +L0,2136833.225,810088.740,5935285.279,-0.000,-0.000,0.000,0,1 +L1,2136832.313,810091.120,5935285.283,2.481,0.583,0.000,2,3 +L2,2136830.780,810089.246,5935286.085,0.798,2.499,0.000,4,5 +L3,2136831.746,810086.726,5935286.081,-1.830,1.881,0.000,6,7 +L4,2136834.138,810086.358,5935285.276,-2.483,-0.584,0.000,8,9 +L5,2136835.671,810088.232,5935284.474,-0.800,-2.500,0.000,10,11 +L6,2136834.705,810090.754,5935284.477,1.829,-1.882,0.000,12,13 +L7,2136832.683,810083.046,5935286.245,-5.609,1.479,0.000,14,15 +L8,2136836.307,810083.846,5935284.841,-5.247,-2.473,0.000,16,17 +L9,2136838.490,810086.934,5935283.641,-2.432,-5.268,0.000,18,19 +L10,2136838.208,810090.869,5935283.209,1.523,-5.597,0.000,20,21 +L11,2136835.595,810093.806,5935283.745,4.763,-3.308,0.000,22,23 +L12,2136831.874,810094.373,5935284.999,5.775,0.529,0.000,24,25 +L13,2136828.784,810092.304,5935286.384,4.085,4.118,0.000,26,27 +L14,2136827.774,810088.567,5935287.252,0.482,5.779,0.000,28,29 +L15,2136829.313,810084.910,5935287.197,-3.347,4.738,0.000,30,31 +L16,2136827.496,810082.000,5935288.242,-6.028,7.119,0.000,32,33 +L17,2136830.196,810079.620,5935287.599,-8.725,4.649,0.000,34,35 +L18,2136834.881,810078.577,5935286.065,-10.326,-0.128,0.000,36,37 +L19,2136840.678,810082.158,5935283.506,-7.454,-6.816,0.000,38,39 +L20,2136842.220,810084.841,5935282.591,-4.966,-8.870,-0.000,40,41 +L21,2136842.709,810089.042,5935281.847,-0.838,-10.055,-0.000,42,43 +L22,2136840.820,810092.856,5935282.005,3.190,-8.670,-0.000,44,45 +L23,2136836.624,810096.732,5935282.980,7.556,-4.860,-0.000,46,47 +L24,2136832.390,810098.564,5935284.246,9.890,-0.684,0.000,48,49 +L25,2136828.407,810097.589,5935285.802,9.396,3.674,0.000,50,51 +L26,2136826.172,810094.571,5935287.011,6.657,6.514,0.000,52,53 +L27,2136824.745,810090.073,5935288.131,2.346,8.735,0.001,54,55 +L28,2136825.278,810085.457,5935288.566,-2.318,8.909,0.001,56,57 +L29,2136825.444,810077.480,5935289.588,-10.287,10.004,0.001,58,59 +L30,2136828.421,810075.211,5935288.832,-12.904,7.225,0.000,60,61 +L31,2136831.364,810074.934,5935287.817,-13.534,4.164,0.000,62,63 +L32,2136838.625,810076.703,5935284.980,-12.643,-3.780,0.000,64,65 +L33,2136841.406,810076.073,5935284.071,-13.605,-6.614,-0.000,66,67 +L34,2136844.576,810082.556,5935282.059,-7.525,-10.993,-0.000,68,69 +L35,2136845.569,810087.431,5935281.043,-2.787,-12.817,-0.000,70,71 +L36,2136846.854,810092.459,5935279.901,2.069,-14.974,-0.000,72,73 +L37,2136844.379,810094.649,5935280.489,4.550,-12.711,-0.000,74,75 +L38,2136841.244,810098.162,5935281.134,8.426,-9.963,-0.000,76,77 +L39,2136835.339,810101.550,5935282.786,12.511,-4.272,0.000,78,79 +L40,2136832.799,810102.379,5935283.582,13.642,-1.723,0.000,80,81 +L41,2136828.030,810100.946,5935285.482,12.787,3.538,0.000,82,83 +L42,2136824.136,810100.694,5935286.909,13.004,7.686,0.000,84,85 +L43,2136820.365,810093.032,5935289.296,5.821,12.886,0.001,86,87 +L44,2136820.109,810089.105,5935289.920,1.938,13.781,0.001,88,89 +L45,2136820.680,810083.676,5935290.452,-3.540,14.045,0.001,90,91 +L46,2136830.755,810101.266,5935284.464,12.779,0.611,0.000,92,93 +L47,2136827.708,810078.052,5935288.701,-9.988,7.525,0.000,94,95 H0,2136799.803,810023.941,5935308.107,-13.251,22.953,-0.003,0,1 H1,2136801.609,810028.590,5935306.831,-8.836,20.306,-0.002,2,3 H2,2136803.417,810033.240,5935305.554,-4.419,17.658,-0.002,4,5 @@ -47,3 +95,5 @@ H44,2136831.357,810036.614,5935295.106,-4.412,-12.362,0.002,88,89 H45,2136833.163,810041.264,5935293.829,0.005,-15.009,0.002,90,91 H46,2136836.777,810050.561,5935291.276,8.835,-20.305,0.002,92,93 H47,2136838.585,810055.210,5935290.000,13.251,-22.953,0.002,94,95 +CLBA,2136833.225,810088.740,5935285.279,-0.000,-0.000,0.000,-1,-1 +CHBA,2136819.1940,810039.5757,5935299.0536,0.0,0.0,0.0,-1,-1 \ No newline at end of file diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/FI609/FI609-lba-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/FI609/FI609-lba-solution.lisp new file mode 100644 index 0000000000000000000000000000000000000000..35a8cdddd56a2ef37bfcdcdc2d18abf6d56a2738 --- /dev/null +++ b/MAC/Deployment/data/Coordinates/vectors-and-matrices/FI609/FI609-lba-solution.lisp @@ -0,0 +1,12 @@ +(discarded-points + NIL) +(reduced-chi-squared 0.0001834637936724027) +(normal-vector (0.3339713 0.1266377 0.9340375)) +(normal-vector-uncertainties (0.0000048 0.0000048 0.0000018)) +(normal-vector-direction-uncertainties-arcsec :max 0.99 :rms 0.84 :avg 0.78) +(reference-point :etrs (2136833.225 810088.740 5935285.279) + :station-pqr (0.0 0.0 0.0)) +(station-pqr-to-etrs-matrix + #2A((-0.14881611950056886 -0.9307614981005229 0.3339712506046932) + (0.9855896003619196 -0.11214285543458863 0.1266377496381268) + (-0.08041705189339096 0.3480043298992806 0.9340375175206446))) diff --git a/MAC/Deployment/data/OTDB/Calibration.comp b/MAC/Deployment/data/OTDB/Calibration.comp index 34cf0b14c889d51f7fed5f8043e67780be788544..376a8ce1e4a9d793a95ab486158a8f7517982a07 100644 --- a/MAC/Deployment/data/OTDB/Calibration.comp +++ b/MAC/Deployment/data/OTDB/Calibration.comp @@ -8,5 +8,5 @@ node Calibration 4.0.0 development 'node constraint' "Calibration pipeline" # name dir. type unit prun. vm value constr. descr. #-------------------------------------------------------------------------------------------------------- -par CalibratorSource I text - 100 0 '' - "Calibrator source for generation of instrument model" - +par CalibratorSource I text - 100 0 '' - "Calibrator source for generation of instrument model" +par SkyModel I text - 100 0 '' - "User-supplied sky model for generic calibration pipeline" diff --git a/MAC/Deployment/data/OTDB/DPPP.comp b/MAC/Deployment/data/OTDB/DPPP.comp index 3925183493698ae8ea794f62a3ec341af6656de4..0519a9ecec20dfc53c34eca3edfacd67cec3659d 100644 --- a/MAC/Deployment/data/OTDB/DPPP.comp +++ b/MAC/Deployment/data/OTDB/DPPP.comp @@ -128,6 +128,9 @@ uses Options 4.0.0 development 1 'Solver configuration' node demixer 4.0.0 development 'node constraint' "Demix" par type I text - 10 0 "demixer" - "Type of the demixer, do not change" +par baseline I text - 10 0 "" - "Baselines to be demixed" +par blrange I vdbl - 10 0 "" - "Vector of ranges of baseline lengths (in m) to be demixed" +par corrtype I ptext - 10 0 "auto|cross;cross" - "correlation type to demix? Must be auto, cross, or an empty string." par freqstep I int - 10 0 1 - "Number of channels to average in result." par timestep I int - 10 0 1 - "Number of time slots to average in result." par demixfreqstep I int - 10 0 1 - "Number of channels to average in demixing." diff --git a/MAC/Deployment/data/OTDB/Observation.comp b/MAC/Deployment/data/OTDB/Observation.comp index c3b44af35990c035bb0e676a88a4c3c6430a7413..d6cfab5dc00bd91213f6bf2e53624c091452ff23 100644 --- a/MAC/Deployment/data/OTDB/Observation.comp +++ b/MAC/Deployment/data/OTDB/Observation.comp @@ -28,6 +28,7 @@ par nrTBBSettings I int - 10 100 0 par nrBeamformers I int - 10 100 0 - 'Number of beamformers in this observation' par nrPolarisations I pint - 10 100 '1|2;2' - 'Number of polarisations to use in this observation' par nrSlotsInFrame I int - 10 100 61 - '???' +par nrBitsPerSample I pint - 10 0 '16|8|4;16' - 'sample size in bits' par referencePhaseCenter I vdbl - 10 100 '[3826577.110, 461022.900, 5064892.758]' - 'Constant value: phase center of LOFAR' par existingStations I vtext - 10 100 '["CS001","CS002","CS003","CS004","CS005","CS006","CS007","CS011","CS013","CS017","CS021","CS024","CS026","CS028","CS030","CS031","CS101","CS103","CS201","CS301","CS302","CS401","CS501","RS106","RS205","RS208","RS306","RS307","RS406","RS503","DE601","DE602","DE603","DE604","DE605","FR606","UK608"]' - 'Constant value: stations that can be used' par existingAntennaFields I vtext - 10 100 '["LBA","HBA","HBA0","HBA1"]' - 'Constant value: names of all antennafields' diff --git a/MAC/Deployment/data/OTDB/PreProcessing.comp b/MAC/Deployment/data/OTDB/PreProcessing.comp new file mode 100644 index 0000000000000000000000000000000000000000..addc5245bd77cfbec9fa916f2cfe731148656a49 --- /dev/null +++ b/MAC/Deployment/data/OTDB/PreProcessing.comp @@ -0,0 +1,13 @@ +# -- PreProcessing-- +# +# $Id$ +# +# name vers qual constr. descr. +#-------------------------------------------------------------------------------------------------------- +node PreProcessing 4.0.0 development 'node constraint' "Settings for the pre-processing pipelines" + +# name dir. type unit prun. vm value constr. descr. +#-------------------------------------------------------------------------------------------------------- +par demix_always I vtext - 100 0 [] - "List of sources that must always be demixed" +par demix_if_needed I vtext - 100 0 [] - "List of sources that will only be demixed if needed, based on some heuristics" + diff --git a/MAC/Deployment/data/OTDB/PythonControl.comp b/MAC/Deployment/data/OTDB/PythonControl.comp index 41b69d5f6db46230c8b1dd44b6a4fd9faab9ba5f..25af7db496270a2f0b142aa160305b39323ef878 100644 --- a/MAC/Deployment/data/OTDB/PythonControl.comp +++ b/MAC/Deployment/data/OTDB/PythonControl.comp @@ -24,5 +24,5 @@ uses AWimager 4.0.0 development 1 "awimager" uses GSM 4.0.0 development 1 "GSM" uses BDSM 4.0.0 development 1 "BDSM" uses Calibration 4.0.0 development 1 "Calibration" - +uses PreProcessing 4.0.0 development 1 "Pre-processing" diff --git a/MAC/Deployment/data/OTDB/createPICfile b/MAC/Deployment/data/OTDB/createPICfile index 262d150f8fc97ca6a579bf02e52804c1e32da6a9..299d2b2445c618b2df1530a2b0bbe8c618eee060 100755 --- a/MAC/Deployment/data/OTDB/createPICfile +++ b/MAC/Deployment/data/OTDB/createPICfile @@ -64,6 +64,21 @@ def expandCabinetMarker(dataPoint, nrRSP): print "21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet))+".status.state" +def expandLBAMarker(dataPoint, nrLBA): + """ + Expands the lines that only contain the @lbaantenna@ marker with all cabinet numbers + """ + for lba in range(0, nrLBA): + print "21 "+dataPoint.replace("@lbaantenna@","LBA%03d"%lba)+".status.state" + +def expandHBAMarker(dataPoint, nrHBA): + """ + Expands the lines that only contain the @hbaantenna@ marker with all cabinet numbers + """ + for lba in range(0, nrHBA): + print "21 "+dataPoint.replace("@hbaantenna@","HBA%02d"%lba)+".status.state" + + # MAIN # all the files we are using @@ -78,11 +93,11 @@ parser.add_option("-l", "--local", action="store_true", dest="isLocal", default= (options, args) = parser.parse_args() if (options.isLocal): - PVSSbasefile= "../PVSS/PVSSDataPoints.base" + PVSSbasefile= "../PVSS/data/PVSSDataPoints.base" StationFile = "../StaticMetaData/StationInfo.dat" ControlFile = "../StaticMetaData/ControlInfo.dat" - RingFile = "../PVSS/Rings.list" - ClusterFile = "../PVSS/Clusters.list" + RingFile = "../PVSS/data/Rings.list" + ClusterFile = "../PVSS/data/Clusters.list" else: PVSSbasefile= "/opt/lofar/pvss/dpdef/PVSSDataPoints.base" StationFile = "/opt/lofar/etc/StationInfo.dat" @@ -205,6 +220,10 @@ for line in filledLine.findall(open(StationFile).read()): expandSubrackMarker(prefix+line, int(nrRSP)) elif line.find("@cabinet@") >= 0: expandCabinetMarker(prefix+line, int(nrRSP)) + elif line.find("@lbaantenna@") >= 0: + expandLBAMarker(prefix+line, int(nrLBA)) + elif line.find("@hbaantenna@") >= 0: + expandHBAMarker(prefix+line, int(nrHBA)) # for all expandable lines # Permanent software on the stations diff --git a/MAC/Deployment/data/OTDB/create_OTDB_comps b/MAC/Deployment/data/OTDB/create_OTDB_comps index 60af1571b0e1bb8b96b77f4cd9dc0da0516d7ee5..cf7b0d70fdfc3d03d3b126f94645bde8ecb3a6e2 100755 --- a/MAC/Deployment/data/OTDB/create_OTDB_comps +++ b/MAC/Deployment/data/OTDB/create_OTDB_comps @@ -246,7 +246,7 @@ echo "# Generated file !!!" >Stations.list if [ "${INDIR}" = "." ]; then wdir="../StaticMetaData" otdbdir="." - pvssdir="../PVSS" + pvssdir="../PVSS/data" else wdir="/opt/lofar/etc" otdbdir="/opt/lofar/etc/otdb" diff --git a/MAC/Deployment/data/PVSS/License/471_3031_2_Astron_Gen_II_2_311.log b/MAC/Deployment/data/PVSS/License/471_3031_2_Astron_Gen_II_2_311.log new file mode 100644 index 0000000000000000000000000000000000000000..49fbf91ae450e860ea75d36893016cb295bd9c8f --- /dev/null +++ b/MAC/Deployment/data/PVSS/License/471_3031_2_Astron_Gen_II_2_311.log @@ -0,0 +1,31 @@ + +--------------------------------------------------- +[license] +code = "RS305C 70099091807" +version = 30800002 +sn = "471_3031_2_Astron_Gen_II_2_311/1" +date = 2012.10.11;09:46:36,000 +comment = "Remote Station RS305" +expire = 0000.00.00;00:00:00,000 +redundancy = 0 +ui = 2 +para = 1 +dde = 5 +event = 1 +ios = 4000 +ssi = 0 +api = 80 +excelreport = 5 + http = 0 + infoserver = 1000 + comcenter = 5 +maintenance = 1 + scheduler = 1 + recipe = 1 +distributed = 255 + uifix = 0 + parafix = 0 + pararemote = 0 + ctrlext = 1 + update = 0 + diff --git a/MAC/Deployment/data/PVSS/License/Astron_Central_1_shield.txt b/MAC/Deployment/data/PVSS/License/Astron_Central_1_shield.txt index 0f5595ea711b6dcf5d01af0fcc9befb7f9d3facf..8beb1c99acbcbbe6e4101b445db3fd5f29ab8535 100644 --- a/MAC/Deployment/data/PVSS/License/Astron_Central_1_shield.txt +++ b/MAC/Deployment/data/PVSS/License/Astron_Central_1_shield.txt @@ -1,28 +1,29 @@ [license] -code = "dongleHost 40316486309" -version = 30800002 -sn = "471_3031_1_Astron_Gen_I_1_38" -expire = 0000.00.00;00:00:00,000 -redundancy = 1 -ui = 15 -para = 4 -dde = 5 -event = 1 -ios = 100000 -ssi = 0 -api = 80 -excelreport = 5 - http = 15 - infoserver = 5000 - comcenter = 5 -maintenance = 0 - scheduler = 0 -distributed = 255 - uifix = 0 - parafix = 0 - pararemote = 0 - ctrlext = 1 - update = 0 -licenseMax = 8 -licenseLeft = 5 +#hw = 00825320842 +code = "dongleHost 50202878741" +version = 31100002 +sn = "471_3031_1_Astron_Gen_I_2_311" +expire = 0000.00.00;00:00:00,000 +redundancy = 1 +ui = 15 +para = 4 +dde = 5 +event = 1 +api = 80 +excelreport = 5 +http = 15 +infoserver = 5000 +ios = 100000 +comcenter = 5 +maintenance = 0 +scheduler = 0 +ssi = 0 +distributed = 255 +uifix = 0 +parafix = 0 +pararemote = 0 +ctrlext = 1 +update = 0 +licenseMax = 8 +licenseLeft = 8 diff --git a/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt b/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt index b7b3fbf49ece1730c6db966ccc99a2599db25067..d8932c70f5be4ec96d749fd14bd114ca1dca2fd7 100644 --- a/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt +++ b/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt @@ -1,7 +1,7 @@ [license] -code = "dongleHost 30533373122" -version = 30800002 -sn = "471_3031_2_Astron_Gen_II_1_38" +code = "dongleHost 60318387154" +version = 31100002 +sn = "471_3031_2_Astron_Gen_II_2_311" expire = 0000.00.00;00:00:00,000 redundancy = 0 ui = 2 @@ -12,18 +12,18 @@ ios = 4000 ssi = 0 api = 80 excelreport = 5 - http = 0 - infoserver = 1000 - comcenter = 5 +http = 0 +infoserver = 1000 +comcenter = 5 maintenance = 1 - scheduler = 1 - recipe = 1 +scheduler = 1 +recipe = 1 distributed = 255 - uifix = 0 - parafix = 0 - pararemote = 0 - ctrlext = 1 - update = 0 +uifix = 0 +parafix = 0 +pararemote = 0 +ctrlext = 1 +update = 0 licenseMax = 100 -licenseLeft = 46 +licenseLeft = 96 diff --git a/MAC/Deployment/data/PVSS/License/PVSStoolLicense.exe b/MAC/Deployment/data/PVSS/License/PVSStoolLicense.exe index dc235473152cd21d5af222f4ece828bd6c9d5f5d..2da1cf71dd55af267aac7f02cbee00f4a2a60a17 100755 Binary files a/MAC/Deployment/data/PVSS/License/PVSStoolLicense.exe and b/MAC/Deployment/data/PVSS/License/PVSStoolLicense.exe differ diff --git a/MAC/Deployment/data/PVSS/License/RS305C_option.txt b/MAC/Deployment/data/PVSS/License/RS305C_option.txt new file mode 100644 index 0000000000000000000000000000000000000000..964db037acf78de582615b05451878133e86948a --- /dev/null +++ b/MAC/Deployment/data/PVSS/License/RS305C_option.txt @@ -0,0 +1,29 @@ +[license] +code = "RS305C 61412543354" +version = 31100002 +comment = "Remote Station RS305" +sn = "471_3031_2_Astron_Gen_II_2_311" +expire = 0000.00.00;00:00:00,000 +redundancy = 0 +ui = 2 +para = 1 +dde = 5 +event = 1 +api = 80 +excelreport = 5 +http = 0 +infoserver = 1000 +ios = 4000 +comcenter = 5 +maintenance = 1 +scheduler = 1 +ssi = 0 +recipe = 1 +distributed = 255 +uifix = 0 +parafix = 0 +pararemote = 0 +ctrlext = 1 +update = 0 + + diff --git a/MAC/Deployment/data/PVSS/License/shield.RS305C.txt b/MAC/Deployment/data/PVSS/License/shield.RS305C.txt new file mode 100644 index 0000000000000000000000000000000000000000..adda3be8c1466c9e0620c5e5ef17181f7c3eb6bf --- /dev/null +++ b/MAC/Deployment/data/PVSS/License/shield.RS305C.txt @@ -0,0 +1,29 @@ +[license] +code = "RS305C 20354947138" +version = 31100002 +sn = "471_3031_2_Astron_Gen_II_2_311/4" +date = 2012.10.26;11:45:21,000 +comment = "Remote Station RS305" +expire = 0000.00.00;00:00:00,000 +redundancy = 0 +ui = 2 +para = 1 +dde = 5 +event = 1 +ios = 4000 +ssi = 0 +api = 80 +excelreport = 5 +http = 0 +infoserver = 1000 +comcenter = 5 +maintenance = 1 +scheduler = 1 +recipe = 1 +distributed = 255 +uifix = 0 +parafix = 0 +pararemote = 0 +ctrlext = 1 +update = 0 + diff --git a/MAC/Deployment/data/PVSS/License/shield_471_3031_1_Astron_Gen_I_2_311.txt b/MAC/Deployment/data/PVSS/License/shield_471_3031_1_Astron_Gen_I_2_311.txt deleted file mode 100644 index 6bfaa53e2559fa91f0443f6e4448b9538da58be4..0000000000000000000000000000000000000000 --- a/MAC/Deployment/data/PVSS/License/shield_471_3031_1_Astron_Gen_I_2_311.txt +++ /dev/null @@ -1,29 +0,0 @@ -[license] -#hw = 00825320842 -code = "dongleHost 50202878741" -version = 31100002 -sn = "471_3031_1_Astron_Gen_I_2_311" -expire = 0000.00.00;00:00:00,000 -redundancy = 1 -ui = 15 -para = 4 -dde = 5 -event = 1 -api = 80 -excelreport = 5 -http = 15 -infoserver = 5000 -ios = 100000 -comcenter = 5 -maintenance = 0 -scheduler = 0 -ssi = 0 -distributed = 255 -uifix = 0 -parafix = 0 -pararemote = 0 -ctrlext = 1 -update = 0 -licenseMax = 8 -licenseLeft = 8 - diff --git a/MAC/Deployment/data/PVSS/License/shield_471_3031_2_Astron_Gen_II_2_311.txt b/MAC/Deployment/data/PVSS/License/shield_471_3031_2_Astron_Gen_II_2_311.txt deleted file mode 100644 index 24d3b1007cd1d9c3c0f8f5b513704b8b0802cc44..0000000000000000000000000000000000000000 --- a/MAC/Deployment/data/PVSS/License/shield_471_3031_2_Astron_Gen_II_2_311.txt +++ /dev/null @@ -1,30 +0,0 @@ -[license] -#hw = 12831493085 -code = "dongleHost 40337353363" -version = 31100002 -sn = "471_3031_2_Astron_Gen_II_2_311" -expire = 0000.00.00;00:00:00,000 -redundancy = 0 -ui = 2 -para = 1 -dde = 5 -event = 1 -api = 80 -excelreport = 5 -http = 0 -infoserver = 1000 -ios = 4000 -comcenter = 5 -maintenance = 1 -scheduler = 1 -ssi = 0 -recipe = 1 -distributed = 255 -uifix = 0 -parafix = 0 -pararemote = 0 -ctrlext = 1 -update = 0 -licenseMax = 100 -licenseLeft = 100 - diff --git a/MAC/Deployment/data/PVSS/data/Adder.dpdef b/MAC/Deployment/data/PVSS/data/Adder.dpdef index d5bba9c187cef2edb368a64665b31428db3b4b9e..cc7152416bc03dbca5e0142bae69c3ee2ccac11c 100644 --- a/MAC/Deployment/data/PVSS/data/Adder.dpdef +++ b/MAC/Deployment/data/PVSS/data/Adder.dpdef @@ -1,8 +1,10 @@ # Adder -dropping bool +dropping bool dropped int dataProductType string +dataProduct string fileName string -locusNode string +locusNode int +writer int directory string observationName string diff --git a/MAC/Deployment/data/PVSS/data/BGPAppl.dpdef b/MAC/Deployment/data/PVSS/data/BGPAppl.dpdef index 7837587885222d7df52b592180a69e645b3fa965..75c6e2843ddae629d7a8091225e3152683da93fa 100644 --- a/MAC/Deployment/data/PVSS/data/BGPAppl.dpdef +++ b/MAC/Deployment/data/PVSS/data/BGPAppl.dpdef @@ -1,6 +1,7 @@ -ioNodeList intArr -locusNodeList stringArr +ioNodeList intArr adderList stringArr -writerList stringArr -dataProductList stringArr -dataProductTypeList stringArr +# the next lists will be in adder.dpdef as from release 1.8 +locusNodeList stringArr +writerList stringArr +dataProductList stringArr +dataProductTypeList stringArr \ No newline at end of file diff --git a/MAC/Deployment/data/PVSS/data/CEPHardwareMonitor.dpdef b/MAC/Deployment/data/PVSS/data/CEPHardwareMonitor.dpdef new file mode 100644 index 0000000000000000000000000000000000000000..0298855bb6e3abcd8d24bccba853ec1ba45269e8 --- /dev/null +++ b/MAC/Deployment/data/PVSS/data/CEPHardwareMonitor.dpdef @@ -0,0 +1,4 @@ +# CEPHardwareMonitor +# +BGP.connected bool +Cluster.connected bool diff --git a/MAC/Deployment/data/PVSS/data/ClockControl.dpdef b/MAC/Deployment/data/PVSS/data/ClockControl.dpdef index 6ef73feb64bfe4267e3eb89f0d4771fa6ff0c160..19378adf572bccec3eeaa962035ab3852ae4b021 100644 --- a/MAC/Deployment/data/PVSS/data/ClockControl.dpdef +++ b/MAC/Deployment/data/PVSS/data/ClockControl.dpdef @@ -2,3 +2,5 @@ connected bool requestedClock int actualClock int +requestedBitmode int +actualBitmode int diff --git a/MAC/Deployment/data/PVSS/data/MCUbase.dpdef b/MAC/Deployment/data/PVSS/data/MCUbase.dpdef index fc188996d98210d904e92e1239a4df2839c478ff..c7bb910c2f4e1a698db7bf21568cfa9063736dd6 100644 --- a/MAC/Deployment/data/PVSS/data/MCUbase.dpdef +++ b/MAC/Deployment/data/PVSS/data/MCUbase.dpdef @@ -1,3 +1,4 @@ +======= # MainCU specific PVSS Database types # DpType @@ -118,13 +119,16 @@ NavPanelConfig.NavPanelConfig 1# BGPRack_Hardware 9# OSRack_Hardware 9# BGPMidplane_Hardware 9# - OSSubcluster_Hardware 9# BGPAppl_Processes 9# CEPHardwareMonitor_Processes 9# BGPProc_Processes 9# StnLOFAR_Observations 9# StnLOFAR_Reports 9# StnLOFAR_Alerts 9# + HBAAntenna_Hardware 9# + IONode_Hardware 9# + IONode_Processes 9# + PythonControl_Processes 9# TypeName NavigatorUserSaves.NavigatorUserSaves 1# @@ -158,7 +162,7 @@ DpName TypeName __navigator Navigator root NavPanelConfig __gcf_cwd GCFWatchDog -rootsaves NavigatorUserSaves +rootSaves NavigatorUserSaves _CtrlDebug_CTRL_5 _CtrlDebug _CtrlDebug_CTRL_6 _CtrlDebug _CtrlDebug_CTRL_7 _CtrlDebug @@ -200,7 +204,7 @@ root.CalServer_Processes NavPanelConfig "Processes/CalServer.pnl" root.BeamServer_Processes NavPanelConfig "Processes/BeamServer.pnl" root.SHMInfoServer_Processes NavPanelConfig "Processes/SHMInfoServer.pnl" root.Observation_Observations NavPanelConfig "Observations/Observation_overview.pnl" -root.Ring_Hardware NavPanelConfig "Hardware/LOFAR_Europe.pnl:LOFAR_PIC_Europe", "Hardware/LOFAR_Remote.pnl:LOFAR_PIC_Remote", "Hardware/LOFAR_Core.pnl:LOFAR_PIC_Core" +root.Ring_Hardware NavPanelConfig "main.pnl:LOFAR_PIC_Europe", "Hardware/LOFAR_Europe.pnl:LOFAR_PIC_Europe", "Hardware/LOFAR_Remote.pnl:LOFAR_PIC_Remote", "Hardware/LOFAR_Core.pnl:LOFAR_PIC_Core" root.LOFAR_Alerts NavPanelConfig "Alerts/lofar_alarms.pnl" root.LOFAR_Reports NavPanelConfig "Reports/LOFAR_Reports_main.pnl" root.CEPLOFAR_Processes NavPanelConfig "Processes/CEP_Processes.pnl" @@ -208,10 +212,14 @@ root.CEPPIC_Hardware NavPanelConfig "Hardware/CEP.pnl" root.BGPRack_Hardware NavPanelConfig "Hardware/CEP_BGPRack_detailed.pnl" root.OSRack_Hardware NavPanelConfig "Hardware/CEP_OSRack_detailed.pnl" root.BGPMidplane_Hardware NavPanelConfig "Hardware/CEP_Midplane.pnl" -root.OSSubcluster_Hardware NavPanelConfig "Hardware/CEP_OSSubcluster.pnl" root.BGPAppl_Processes NavPanelConfig "Processes/BGPAppl.pnl" root.CEPHardwareMonitor_Processes NavPanelConfig "Processes/CEPHardwareMonitor.pnl" root.BGPProc_Processes NavPanelConfig "Processes/BGPProc.pnl" +root.HBAAntenna_Hardware NavPanelConfig "Hardware/HBAAntenna.pnl" +root.IONode_Hardware NavPanelConfig "Hardware/CEP_IONode.pnl" +root.IONode_Processes NavPanelConfig "Processes/CEP_IONodeProcesses.pnl" +root.CEPlogProcessor_Processes NavPanelConfig "Processes/CEPlogProcessor.pnl" +root.PythonControl_Processes NavPanelConfig "Processes/PythonControl.pnl" rootSaves.Queries.Query NavigatorUserSaves "SELECT '_original.._value' FROM 'LOFAR_PIC*.status.state' REMOTE ALL WHERE '_original.._value' >= 20 AND '_original.._value' < 30", "SELECT '_original.._value' FROM 'LOFAR_PIC*.status.state' REMOTE ALL WHERE '_original.._value' >= 30 AND '_original.._value' < 40", "SELECT '_original.._value' FROM 'LOFAR_PIC*.status.state' REMOTE ALL WHERE '_original.._value' >= 40 AND '_original.._value' < 50", "SELECT '_original.._value' FROM 'LOFAR_PIC*.status.state' REMOTE ALL WHERE '_original.._value' >= 50 AND '_original.._value' < 60" rootSaves.Queries.Short NavigatorUserSaves "All hardware in Maintenance", "All hardware in Test", "All hardware in Suspicious", "All hardware in Alarm" diff --git a/MAC/Deployment/data/PVSS/data/Observation.dpdef b/MAC/Deployment/data/PVSS/data/Observation.dpdef index d177f846026b6662da58fc373f7cf5cf2291fdd1..23463e0cf1d8107338f89f49231311817f1fac1a 100644 --- a/MAC/Deployment/data/PVSS/data/Observation.dpdef +++ b/MAC/Deployment/data/PVSS/data/Observation.dpdef @@ -12,6 +12,9 @@ receiverList string sampleClock int runState string measurementSet string +processType string +processSubtype string +strategy string stationList string inputNodeList string diff --git a/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base b/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base index 9074c5c3e92d8d28c4b13734a5a79694d9188192..d7ebb363914233dbd41e6fac09a91b27d68fd3c9 100644 --- a/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base +++ b/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base @@ -20,7 +20,7 @@ LOFAR - M N LOFAR PIC - M N LOFAR_PIC Ring - M N LOFAR_PIC_@ring@ -Station STS M Y LOFAR_PIC_@ring@_@station@ +Station - M Y LOFAR_PIC_@ring@_@station@ WAN - M N LOFAR_PIC_WAN WANarea - M N LOFAR_PIC_WAN_@wan@ Switch - M Y LOFAR_PIC_WAN_@wan@_@switch@ @@ -28,7 +28,7 @@ PermSW - M N LOFAR_PermSW RTDBPort - M N CRTriggerPort # Note: the next 4 lines are neccesary for PVSS2SAS to create the PIC tree. Ring - M N LOFAR_PermSW_@ring@ -Station STS M Y LOFAR_PermSW_@ring@_@station@ +Station - M Y LOFAR_PermSW_@ring@_@station@ Cluster - M N LOFAR_PermSW_@cluster@ Node - M Y LOFAR_PermSW_@cluster@_@node@ Daemons - M N LOFAR_PermSW_Daemons @@ -62,7 +62,7 @@ IONode ION C Y LOFAR_PIC_BGP_@midplane@_@ionode@ OSRack - C N LOFAR_PIC_@osrack@ LocusNode LCN C Y LOFAR_PIC_@osrack@_@locusnode@ CEPPermSW - C N LOFAR_PermSW -CEPHardwareMonitor CHM C Y LOFAR_PermSW_HardwareMonitor +CEPHardwareMonitor CHM C Y LOFAR_PermSW_CEPHardwareMonitor SoftwareMonitor - C Y LOFAR_PermSW_SoftwareMonitor Daemons - C N LOFAR_PermSW_Daemons PVSS00pmon - C Y LOFAR_PermSW_Daemons_PVSS00pmon @@ -87,7 +87,7 @@ RCU RCU S N LOFAR_PIC_@cabinet@_@subrack@_@RSPBoard@_@rcu@ TBBoard TBB S Y LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@ LBAAntenna LBA S N LOFAR_PIC_@lbaantenna@ HBAAntenna HBA S N LOFAR_PIC_@hbaantenna@ -StationInfo - S Y LOFAR_PIC_StationInfo +StationInfo STI S Y LOFAR_PIC_StationInfo StnPermSW - S N LOFAR_PermSW # Note: the next 2 lines are neccesary for PVSS2SAS to create the PIC tree. Cluster - S N LOFAR_PermSW_@cluster@ diff --git a/MAC/Deployment/data/PVSS/data/RSPBoard.dpdef b/MAC/Deployment/data/PVSS/data/RSPBoard.dpdef index ba7397cd98b5e998a3b675362f9306700d6ffc2a..05135b04192729c503bfe8751564a02686e952de 100644 --- a/MAC/Deployment/data/PVSS/data/RSPBoard.dpdef +++ b/MAC/Deployment/data/PVSS/data/RSPBoard.dpdef @@ -2,6 +2,8 @@ voltage12 float voltage25 float voltage33 float version string +bitmode int +bitmodeCapability int alert int splitterOn int Ethernet.status :ObjectStatus diff --git a/MAC/Deployment/data/PVSS/data/SoftwareMonitor.dpdef b/MAC/Deployment/data/PVSS/data/SoftwareMonitor.dpdef new file mode 100644 index 0000000000000000000000000000000000000000..a051033b4a0135169431203ab0f33d3157c608c7 --- /dev/null +++ b/MAC/Deployment/data/PVSS/data/SoftwareMonitor.dpdef @@ -0,0 +1,2 @@ +# SoftwareMonitor +SWLevel int diff --git a/MAC/Deployment/data/PVSS/data/Station.dpdef b/MAC/Deployment/data/PVSS/data/Station.dpdef deleted file mode 100644 index 77c09bc0bb5e92b91e125a402fb04a6d67a26ebf..0000000000000000000000000000000000000000 --- a/MAC/Deployment/data/PVSS/data/Station.dpdef +++ /dev/null @@ -1,5 +0,0 @@ -# Station -# -power48On bool -power220On bool - diff --git a/MAC/Deployment/data/PVSS/data/StationInfo.dpdef b/MAC/Deployment/data/PVSS/data/StationInfo.dpdef index a9d495292f14e99ad3ac102f62e9cd3ef9668eb0..2549833daf4bafb7e41387fe52f9188a7819d105 100644 --- a/MAC/Deployment/data/PVSS/data/StationInfo.dpdef +++ b/MAC/Deployment/data/PVSS/data/StationInfo.dpdef @@ -5,6 +5,10 @@ N_LBAS int N_HBAS int HBA_Split bool wide_LBAS bool +power48On bool +power220On bool +datastream0 bool +datastream1 bool Cabinet.X float Cabinet.Y float Cabinet.Z float diff --git a/MAC/Deployment/data/PVSS/data/StnObservation.dpdef b/MAC/Deployment/data/PVSS/data/StnObservation.dpdef index 9d213e2143e473ded3af648a62069cd91c767a48..a20fd24d3ba4aae11cf13540f62e284043aae86e 100644 --- a/MAC/Deployment/data/PVSS/data/StnObservation.dpdef +++ b/MAC/Deployment/data/PVSS/data/StnObservation.dpdef @@ -1,5 +1,5 @@ name string claim :Claim receiverBitmap string -HBAbitmap string -LBAbitmap string +HBABitmap string +LBABitmap string diff --git a/MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf b/MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf index 57ae1d4274b1c044306842b68d8956c308795810..1835b96fc23a018a55d408d17697eba33cd48fcd 100644 --- a/MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf +++ b/MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf @@ -1,227 +1,227 @@ # # AntennaPositions for DE601 -# ITRF2005 target_date = 2012.5 -# Created: 2012-01-24 14:49:41 +# IGS08 measurement date 2012-05-30 +# Created: 2012-09-03 15:56:36 # NORMAL_VECTOR LBA -3 [ 0.631139 0.075776 0.771960 ] +3 [ 0.6328271882340650 0.0780991312002186 0.7703442292333122 ] ROTATION_MATRIX LBA 3 x 3 [ - -0.1194530000 -0.7664170000 0.6311390000 - 0.9928400000 -0.0923420000 0.0757770000 - 0.0002040000 0.6356720000 0.7719590000 + -0.1214634322601195 -0.7647321881206433 0.6328271882340650 + 0.9925955422980562 -0.0928219139137982 0.0780991312002186 + -0.0008509016506948 0.6376274560819920 0.7703442292333122 ] LBA -3 [ 4034036.395510000 487026.791083000 4900279.047 ] +3 [ 4034038.256327 487026.578711 4900280.346094 ] 96 x 2 x 3 [ - -5.283000 -12.310000 5.535000 -5.283000 -12.310000 5.535000 - -9.277000 -5.631001 8.142000 -9.277000 -5.631001 8.142000 - -8.284000 -12.058000 7.964000 -8.284000 -12.058000 7.964000 --11.799000 -6.449001 10.284000 -11.799000 -6.449001 10.284000 - 4.631000 19.175001 -5.680000 4.631000 19.175001 -5.680000 - 1.120000 23.908000 -3.276000 1.120000 23.908000 -3.276000 - 10.718000 21.431001 -10.880000 10.718000 21.431001 -10.880000 - 8.655000 25.765001 -9.621000 8.655000 25.765001 -9.621000 - -7.792000 -17.357000 8.085000 -7.792000 -17.357000 8.085000 - -5.652000 -23.938000 6.985000 -5.652000 -23.938000 6.985000 - -8.125000 -26.191000 9.229000 -8.125000 -26.191000 9.229000 --11.092000 -24.343001 11.473000 -11.092000 -24.343001 11.473000 - 1.099000 4.375000 -1.331000 1.099000 4.375000 -1.331000 - -2.960000 2.384000 2.185000 -2.960000 2.384000 2.185000 - -4.506000 5.270000 3.164000 -4.506000 5.270000 3.164000 - -2.448000 9.094000 1.104000 -2.448000 9.094000 1.104000 - -7.252000 5.674000 5.370000 -7.252000 5.674000 5.370000 - -9.562000 1.818999 7.640000 -9.562000 1.818999 7.640000 --11.936000 10.083999 8.765000 -11.936000 10.083999 8.765000 --14.520000 7.011999 11.181000 -14.520000 7.011999 11.181000 - 15.278000 -9.444998 -11.560000 15.278000 -9.444998 -11.560000 - 13.623000 -18.024999 -9.361000 13.623000 -18.024999 -9.361000 - 21.915000 -13.609998 -16.576990 21.915000 -13.609998 -16.576990 - 16.310000 -22.827998 -11.084000 16.310000 -22.827998 -11.084000 - 0.692000 -13.503000 0.767000 0.692000 -13.503000 0.767000 - -1.600000 -16.217000 2.910000 -1.600000 -16.217000 2.910000 - 3.265000 -16.394999 -1.051000 3.265000 -16.394999 -1.051000 - 4.489000 -20.225999 -1.674000 4.489000 -20.225999 -1.674000 - 14.811000 6.202002 -12.724000 14.811000 6.202002 -12.724000 - 16.927000 8.834002 -14.714000 16.927000 8.834002 -14.714000 - 19.746000 -0.605998 -16.087000 19.746000 -0.605998 -16.087000 - 22.919000 3.514002 -19.087990 22.919000 3.514002 -19.087990 --12.694000 13.910999 9.007000 -12.694000 13.910999 9.007000 --10.578000 19.695999 6.705000 -10.578000 19.695999 6.705000 --15.802000 27.354999 10.221000 -15.802000 27.354999 10.221000 --18.392000 22.015999 12.866000 -18.392000 22.015999 12.866000 - 4.801000 2.949001 -4.217000 4.801000 2.949001 -4.217000 - 3.261000 8.433001 -3.499000 3.261000 8.433001 -3.499000 - 7.681000 4.213001 -6.697000 7.681000 4.213001 -6.697000 - 7.290000 7.903001 -6.741000 7.290000 7.903001 -6.741000 --16.847000 -12.226001 14.983000 -16.847000 -12.226001 14.983000 --18.686000 -2.335001 15.510000 -18.686000 -2.335001 15.510000 --22.770000 -9.405002 19.548000 -22.770000 -9.405002 19.548000 --23.601000 1.090998 19.192000 -23.601000 1.090998 19.192000 - 5.346000 -3.562999 -4.020000 5.346000 -3.562999 -4.020000 - 8.348000 -2.726999 -6.557000 8.348000 -2.726999 -6.557000 - 5.668000 -8.348999 -3.810000 5.668000 -8.348999 -3.810000 - 9.460000 -6.722999 -7.072000 9.460000 -6.722999 -7.072000 - -0.494000 17.569000 -1.331000 -0.494000 17.569000 -1.331000 - 15.817000 -2.771998 -12.660000 15.817000 -2.771998 -12.660000 - -0.540000 28.513000 -2.374000 -0.540000 28.513000 -2.374000 - -7.889000 19.900000 4.486000 -7.889000 19.900000 4.486000 - 8.210000 -23.674999 -4.376000 8.210000 -23.674999 -4.376000 - 24.219000 -6.743998 -19.138990 24.219000 -6.743998 -19.138990 - -8.444000 27.458000 4.194000 -8.444000 27.458000 4.194000 - 0.652000 7.756000 -1.299000 0.652000 7.756000 -1.299000 --16.589000 -19.124001 15.453000 -16.589000 -19.124001 15.453000 - 9.354000 -17.049999 -5.966000 9.354000 -17.049999 -5.966000 - -2.634000 -19.827000 4.111000 -2.634000 -19.827000 4.111000 - 20.886000 13.069002 -18.369000 20.886000 13.069002 -18.369000 - 13.120000 -0.397999 -10.689000 13.120000 -0.397999 -10.689000 - 9.507000 -13.233999 -6.468000 9.507000 -13.233999 -6.468000 --15.373000 -2.025001 12.770000 -15.373000 -2.025001 12.770000 - -5.265000 -0.674000 4.372000 -5.265000 -0.674000 4.372000 - 3.325000 13.951001 -4.096000 3.325000 13.951001 -4.096000 - -2.693000 -6.971000 2.891000 -2.693000 -6.971000 2.891000 - 13.954000 13.371001 -12.730000 13.954000 13.371001 -12.730000 - 10.561000 7.401001 -9.367000 10.561000 7.401001 -9.367000 - 1.612000 -24.018000 1.053000 1.612000 -24.018000 1.053000 - -0.508000 -25.785000 2.960000 -0.508000 -25.785000 2.960000 - 1.098000 -4.952000 -0.409000 1.098000 -4.952000 -0.409000 --13.483000 -10.591001 12.071000 -13.483000 -10.591001 12.071000 - 9.972000 0.178001 -8.172000 9.972000 0.178001 -8.172000 - -6.224000 15.125000 3.596000 -6.224000 15.125000 3.596000 - 6.067000 13.718001 -6.315000 6.067000 13.718001 -6.315000 - -5.662000 27.602000 1.905000 -5.662000 27.602000 1.905000 - 0.189000 -9.917000 0.824000 0.189000 -9.917000 0.824000 - 12.441000 -5.395999 -9.640000 12.441000 -5.395999 -9.640000 --10.720000 -17.640001 10.507000 -10.720000 -17.640001 10.507000 --19.034000 6.023999 14.970000 -19.034000 6.023999 14.970000 --13.252000 2.430999 10.596000 -13.252000 2.430999 10.596000 - -1.803000 21.652000 -0.663000 -1.803000 21.652000 -0.663000 - -8.941000 9.680000 6.355000 -8.941000 9.680000 6.355000 - -2.694000 -3.355000 2.535000 -2.694000 -3.355000 2.535000 - 19.547000 -9.261998 -15.069990 19.547000 -9.261998 -15.069990 - 4.018000 -0.348999 -3.251000 4.018000 -0.348999 -3.251000 - 16.196000 22.425002 -15.458000 16.196000 22.425002 -15.458000 - 11.739000 15.420001 -11.122000 11.739000 15.420001 -11.122000 - -7.878000 -0.990000 6.540000 -7.878000 -0.990000 6.540000 --23.226000 11.893998 17.818000 -23.226000 11.893998 17.818000 - -4.861000 -8.855000 4.849000 -4.861000 -8.855000 4.849000 - 10.658000 -24.627999 -6.284000 10.658000 -24.627999 -6.284000 --16.419000 13.017999 12.141000 -16.419000 13.017999 12.141000 - 2.430000 -8.065000 -1.191000 2.430000 -8.065000 -1.191000 - 5.988000 -11.835999 -3.728000 5.988000 -11.835999 -3.728000 - -3.519000 12.299000 1.664000 -3.519000 12.299000 1.664000 + -5.288327 -12.331211 5.533406 -5.288327 -12.331211 5.533406 + -9.261827 -5.633711 8.166406 -9.261827 -5.633711 8.166406 + -8.262327 -12.055711 7.971406 -8.262327 -12.055711 7.971406 +-11.768577 -6.434961 10.300156 -11.768577 -6.434961 10.300156 + 4.649173 19.186039 -5.691844 4.649173 19.186039 -5.691844 + 1.107173 23.921039 -3.256344 1.107173 23.921039 -3.256344 + 10.762173 21.388039 -10.930594 10.762173 21.388039 -10.930594 + 8.632423 25.778539 -9.759094 8.632423 25.778539 -9.759094 + -7.774577 -17.368461 8.080906 -7.774577 -17.368461 8.080906 + -5.667577 -23.900711 6.986406 -5.667577 -23.900711 6.986406 + -8.161145 -26.170756 9.251638 -8.161145 -26.170756 9.251638 +-11.074077 -24.306961 11.491156 -11.074077 -24.306961 11.491156 + 1.071923 4.389789 -1.357594 1.071923 4.389789 -1.357594 + -2.965327 2.415039 2.190656 -2.965327 2.415039 2.190656 + -4.502577 5.269789 3.207656 -4.502577 5.269789 3.207656 + -2.438327 9.113039 1.129406 -2.438327 9.113039 1.129406 + -7.223077 5.675289 5.390156 -7.223077 5.675289 5.390156 + -9.550577 1.830289 7.642906 -9.550577 1.830289 7.642906 +-11.915827 10.094789 8.781406 -11.915827 10.094789 8.781406 +-14.516827 7.013289 11.183656 -14.516827 7.013289 11.183656 + 15.283173 -9.441961 -11.572094 15.283173 -9.441961 -11.572094 + 13.571923 -17.998711 -9.390594 13.571923 -17.998711 -9.390594 + 21.859423 -13.623961 -16.604844 21.859423 -13.623961 -16.604844 + 16.311673 -22.825211 -11.106094 16.311673 -22.825211 -11.106094 + 0.673173 -13.470711 0.741656 0.673173 -13.470711 0.741656 + -1.618577 -16.208961 2.890156 -1.618577 -16.208961 2.890156 + 3.265923 -16.408211 -1.048344 3.265923 -16.408211 -1.048344 + 4.469423 -20.213961 -1.672594 4.469423 -20.213961 -1.672594 + 14.821173 6.170289 -12.725594 14.821173 6.170289 -12.725594 + 16.900173 8.819039 -14.721094 16.900173 8.819039 -14.721094 + 19.779923 -0.611211 -16.055844 19.779923 -0.611211 -16.055844 + 22.894423 3.520539 -19.073094 22.894423 3.520539 -19.073094 +-12.694577 13.948289 9.041656 -12.694577 13.948289 9.041656 +-10.543577 19.729539 6.727656 -10.543577 19.729539 6.727656 +-15.811077 27.358039 10.260406 -15.811077 27.358039 10.260406 +-18.369577 21.993289 12.902156 -18.369577 21.993289 12.902156 + 4.764173 2.932039 -4.243094 4.764173 2.932039 -4.243094 + 3.246203 8.369065 -3.522420 3.246203 8.369065 -3.522420 + 7.678423 4.164789 -6.719344 7.678423 4.164789 -6.719344 + 7.266423 7.887289 -6.746844 7.266423 7.887289 -6.746844 +-16.824577 -12.222211 15.032906 -16.824577 -12.222211 15.032906 +-18.612827 -2.337711 15.565156 -18.612827 -2.337711 15.565156 +-22.703619 -9.423919 19.600780 -22.703619 -9.423919 19.600780 +-23.549827 1.104039 19.256406 -23.549827 1.104039 19.256406 + 5.315923 -3.566461 -4.033094 5.315923 -3.566461 -4.033094 + 8.342673 -2.749211 -6.575844 8.342673 -2.749211 -6.575844 + 5.661173 -8.334211 -3.804344 5.661173 -8.334211 -3.804344 + 9.471923 -6.760211 -7.059094 9.471923 -6.760211 -7.059094 + -0.494577 17.580539 -1.320594 -0.494577 17.580539 -1.320594 + 15.834423 -2.775461 -12.626594 15.834423 -2.775461 -12.626594 + -0.545577 28.476539 -2.405344 -0.545577 28.476539 -2.405344 + -7.834827 19.906039 4.530656 -7.834827 19.906039 4.530656 + 8.189173 -23.683711 -4.404594 8.189173 -23.683711 -4.404594 + 24.212923 -6.743461 -19.154344 24.212923 -6.743461 -19.154344 + -8.428577 27.454039 4.223906 -8.428577 27.454039 4.223906 + 0.604423 7.736289 -1.277844 0.604423 7.736289 -1.277844 +-16.543327 -19.122461 15.513656 -16.543327 -19.122461 15.513656 + 9.311423 -17.052961 -5.978094 9.311423 -17.052961 -5.978094 + -2.680077 -19.839461 4.092656 -2.680077 -19.839461 4.092656 + 20.838423 13.066789 -18.439844 20.838423 13.066789 -18.439844 + 13.107923 -0.402711 -10.680094 13.107923 -0.402711 -10.680094 + 9.504923 -13.248461 -6.469344 9.504923 -13.248461 -6.469344 +-15.326077 -2.024461 12.764406 -15.326077 -2.024461 12.764406 + -5.265077 -0.691211 4.379906 -5.265077 -0.691211 4.379906 + 3.317673 13.969539 -4.109594 3.317673 13.969539 -4.109594 + -2.714327 -6.955961 2.874406 -2.714327 -6.955961 2.874406 + 13.910673 13.407039 -12.797594 13.910673 13.407039 -12.797594 + 10.516173 7.414789 -9.405844 10.516173 7.414789 -9.405844 + 1.575173 -24.009711 1.036156 1.575173 -24.009711 1.036156 + -0.540327 -25.800461 2.968906 -0.540327 -25.800461 2.968906 + 1.110423 -4.963461 -0.397094 1.110423 -4.963461 -0.397094 +-13.439077 -10.609961 12.127656 -13.439077 -10.609961 12.127656 + 9.960173 0.184039 -8.197344 9.960173 0.184039 -8.197344 + -6.190827 15.126039 3.632156 -6.190827 15.126039 3.632156 + 6.033673 13.740539 -6.350594 6.033673 13.740539 -6.350594 + -5.658577 27.625789 1.904656 -5.658577 27.625789 1.904656 + 0.180673 -9.929211 0.815656 0.180673 -9.929211 0.815656 + 12.453673 -5.400961 -9.629594 12.453673 -5.400961 -9.629594 +-10.715077 -17.645461 10.488156 -10.715077 -17.645461 10.488156 +-19.002077 6.028789 15.011906 -19.002077 6.028789 15.011906 +-13.244327 2.434289 10.636656 -13.244327 2.434289 10.636656 + -1.783077 21.665539 -0.643594 -1.783077 21.665539 -0.643594 + -8.925077 9.693039 6.384406 -8.925077 9.693039 6.384406 + -2.693077 -3.358711 2.511406 -2.693077 -3.358711 2.511406 + 19.545173 -9.294211 -15.090094 19.545173 -9.294211 -15.090094 + 3.993673 -0.342961 -3.286594 3.993673 -0.342961 -3.286594 + 16.160173 22.501789 -15.589844 16.160173 22.501789 -15.589844 + 11.706423 15.359289 -11.183844 11.706423 15.359289 -11.183844 + -7.867827 -0.989211 6.529156 -7.867827 -0.989211 6.529156 +-23.202577 11.917539 17.899656 -23.202577 11.917539 17.899656 + -4.880327 -8.855461 4.823156 -4.880327 -8.855461 4.823156 + 10.653673 -24.621711 -6.307594 10.653673 -24.621711 -6.307594 +-16.401577 13.002539 12.172406 -16.401577 13.002539 12.172406 + 2.428173 -8.072961 -1.199094 2.428173 -8.072961 -1.199094 + 6.019923 -11.860711 -3.713094 6.019923 -11.860711 -3.713094 + -3.493827 12.332789 1.679906 -3.493827 12.332789 1.679906 ] NORMAL_VECTOR HBA -3 [ 0.631204 0.076214 0.771864 ] +3 [ 0.6315838091894460 0.0768144370032466 0.7714929904002105 ] ROTATION_MATRIX HBA 3 x 3 [ - -0.1197220000 -0.7663210000 0.6312040000 - 0.9928070000 -0.0923300000 0.0762140000 - -0.0001250000 0.6357880000 0.7718640000 + -0.1198066951176159 -0.7659948264431504 0.6315838091894460 + 0.9927969402960025 -0.0919453659417217 0.0768144370032466 + -0.0007688587789930 0.6362373578658382 0.7714929904002105 ] HBA -3 [ 4034099.839510000 487013.425089000 4900229.635 ] +3 [ 4034101.521943 487012.756515 4900230.499386 ] 96 x 2 x 3 [ - 21.111010 -14.583999 -15.823000 21.111010 -14.583999 -15.823000 - 21.493010 -9.511999 -16.636000 21.493010 -9.511999 -16.636000 - 21.874010 -4.439999 -17.448000 21.874010 -4.439999 -17.448000 - 22.255010 0.633001 -18.261000 22.255010 0.633001 -18.261000 - 22.636010 5.705002 -19.073000 22.636010 5.705002 -19.073000 - 16.753010 -18.848999 -11.838000 16.753010 -18.848999 -11.838000 - 17.134010 -13.776999 -12.651000 17.134010 -13.776999 -12.651000 - 17.516010 -8.703999 -13.463000 17.516010 -8.703999 -13.463000 - 17.897010 -3.631999 -14.276000 17.897010 -3.631999 -14.276000 - 18.278010 1.440001 -15.088000 18.278010 1.440001 -15.088000 - 18.659010 6.512001 -15.901000 18.659010 6.512001 -15.901000 - 19.041000 11.584001 -16.714000 19.041000 11.584001 -16.714000 - 12.395010 -23.113999 -7.853000 12.395010 -23.113999 -7.853000 - 12.776010 -18.040999 -8.666000 12.776010 -18.040999 -8.666000 - 13.157010 -12.968999 -9.478000 13.157010 -12.968999 -9.478000 - 13.539010 -7.896999 -10.291000 13.539010 -7.896999 -10.291000 - 13.920010 -2.824999 -11.104000 13.920010 -2.824999 -11.104000 - 14.301010 2.247001 -11.916000 14.301010 2.247001 -11.916000 - 14.682000 7.319001 -12.729000 14.682000 7.319001 -12.729000 - 15.064000 12.391001 -13.541000 15.064000 12.391001 -13.541000 - 15.445000 17.463001 -14.354000 15.445000 17.463001 -14.354000 - 8.418010 -22.306000 -4.681000 8.418010 -22.306000 -4.681000 - 8.799010 -17.234000 -5.494000 8.799010 -17.234000 -5.494000 - 9.180010 -12.162000 -6.306000 9.180010 -12.162000 -6.306000 - 9.562010 -7.090000 -7.119000 9.562010 -7.090000 -7.119000 - 9.943010 -2.018000 -7.931000 9.943010 -2.018000 -7.931000 - 10.324000 3.054000 -8.744000 10.324000 3.054000 -8.744000 - 10.705000 8.126001 -9.556000 10.705000 8.126001 -9.556000 - 11.087000 13.198001 -10.369000 11.087000 13.198001 -10.369000 - 11.468000 18.271001 -11.181000 11.468000 18.271001 -11.181000 - 4.441010 -21.499000 -1.509000 4.441010 -21.499000 -1.509000 - 4.822010 -16.427000 -2.321000 4.822010 -16.427000 -2.321000 - 5.203010 -11.355000 -3.134000 5.203010 -11.355000 -3.134000 - 5.585010 -6.283000 -3.946000 5.585010 -6.283000 -3.946000 - 5.966010 -1.211000 -4.759000 5.966010 -1.211000 -4.759000 - 6.347000 3.861000 -5.571000 6.347000 3.861000 -5.571000 - 6.728000 8.934000 -6.384000 6.728000 8.934000 -6.384000 - 7.110000 14.006000 -7.196000 7.110000 14.006000 -7.196000 - 7.491000 19.078000 -8.009000 7.491000 19.078000 -8.009000 - 0.464010 -20.692000 1.664000 0.464010 -20.692000 1.664000 - 0.845010 -15.620000 0.851000 0.845010 -15.620000 0.851000 - 1.227010 -10.548000 0.039000 1.227010 -10.548000 0.039000 - 1.608010 -5.476000 -0.774000 1.608010 -5.476000 -0.774000 - 1.989000 -0.403000 -1.586000 1.989000 -0.403000 -1.586000 - 2.370000 4.669000 -2.399000 2.370000 4.669000 -2.399000 - 2.751000 9.741000 -3.211000 2.751000 9.741000 -3.211000 - 3.133000 14.813000 -4.024000 3.133000 14.813000 -4.024000 - 3.514000 19.885000 -4.836000 3.514000 19.885000 -4.836000 - -3.512990 -19.885001 4.836000 -3.512990 -19.885001 4.836000 - -3.131990 -14.813001 4.024000 -3.131990 -14.813001 4.024000 - -2.749990 -9.740001 3.211000 -2.749990 -9.740001 3.211000 - -2.368990 -4.668001 2.399000 -2.368990 -4.668001 2.399000 - -1.988000 0.403999 1.586000 -1.988000 0.403999 1.586000 - -1.607000 5.475999 0.774000 -1.607000 5.475999 0.774000 - -1.226000 10.548000 -0.039000 -1.226000 10.548000 -0.039000 - -0.844000 15.620000 -0.851000 -0.844000 15.620000 -0.851000 - -0.463000 20.692000 -1.664000 -0.463000 20.692000 -1.664000 - -7.489990 -19.077001 8.009000 -7.489990 -19.077001 8.009000 - -7.108990 -14.005001 7.196000 -7.108990 -14.005001 7.196000 - -6.726990 -8.933001 6.384000 -6.726990 -8.933001 6.384000 - -6.346000 -3.861001 5.571000 -6.346000 -3.861001 5.571000 - -5.965000 1.210999 4.759000 -5.965000 1.210999 4.759000 - -5.584000 6.282999 3.946000 -5.584000 6.282999 3.946000 - -5.202000 11.354999 3.134000 -5.202000 11.354999 3.134000 - -4.821000 16.426999 2.321000 -4.821000 16.426999 2.321000 - -4.440000 21.498999 1.509000 -4.440000 21.498999 1.509000 --11.466990 -18.270001 11.181000 -11.466990 -18.270001 11.181000 --11.085990 -13.198001 10.369000 -11.085990 -13.198001 10.369000 --10.704000 -8.126001 9.556000 -10.704000 -8.126001 9.556000 --10.323000 -3.054001 8.744000 -10.323000 -3.054001 8.744000 - -9.942000 2.017999 7.931000 -9.942000 2.017999 7.931000 - -9.561000 7.089999 7.119000 -9.561000 7.089999 7.119000 - -9.179000 12.161999 6.306000 -9.179000 12.161999 6.306000 - -8.798000 17.234999 5.494000 -8.798000 17.234999 5.494000 - -8.417000 22.306999 4.681000 -8.417000 22.306999 4.681000 --15.443990 -17.463002 14.354000 -15.443990 -17.463002 14.354000 --15.062990 -12.391002 13.541000 -15.062990 -12.391002 13.541000 --14.681000 -7.319002 12.729000 -14.681000 -7.319002 12.729000 --14.300000 -2.247002 11.916000 -14.300000 -2.247002 11.916000 --13.919000 2.824998 11.104000 -13.919000 2.824998 11.104000 --13.538000 7.897998 10.291000 -13.538000 7.897998 10.291000 --13.156000 12.969998 9.478000 -13.156000 12.969998 9.478000 --12.775000 18.041999 8.666000 -12.775000 18.041999 8.666000 --12.394000 23.113999 7.853000 -12.394000 23.113999 7.853000 --19.040000 -11.584002 16.714000 -19.040000 -11.584002 16.714000 --18.658000 -6.512002 15.901000 -18.658000 -6.512002 15.901000 --18.277000 -1.439002 15.088000 -18.277000 -1.439002 15.088000 --17.896000 3.632998 14.276000 -17.896000 3.632998 14.276000 --17.515000 8.704998 13.463000 -17.515000 8.704998 13.463000 --17.133000 13.776998 12.651000 -17.133000 13.776998 12.651000 --16.752000 18.848998 11.838000 -16.752000 18.848998 11.838000 --22.635000 -5.704002 19.073000 -22.635000 -5.704002 19.073000 --22.254000 -0.632002 18.261000 -22.254000 -0.632002 18.261000 --21.873000 4.439998 17.448000 -21.873000 4.439998 17.448000 --21.492000 9.511998 16.636000 -21.492000 9.511998 16.636000 --21.110000 14.583998 15.823000 -21.110000 14.583998 15.823000 + 20.808479 -15.324466 -15.498846 20.808479 -15.324466 -15.498846 + 21.305081 -10.285305 -16.398255 21.305081 -10.285305 -16.398255 + 21.801824 -5.241538 -17.294490 21.801824 -5.241538 -17.294490 + 22.288301 -0.198961 -18.196896 22.288301 -0.198961 -18.196896 + 22.775773 4.841546 -19.095841 22.775773 4.841546 -19.095841 + 16.351177 -19.412627 -11.455059 16.351177 -19.412627 -11.455059 + 16.851951 -14.368606 -12.354852 16.851951 -14.368606 -12.354852 + 17.343349 -9.320202 -13.254484 17.343349 -9.320202 -13.254484 + 17.842190 -4.274015 -14.158761 17.842190 -4.274015 -14.158761 + 18.326034 0.760223 -15.062858 18.326034 0.760223 -15.062858 + 18.827076 5.786030 -15.955155 18.827076 5.786030 -15.955155 + 19.317226 10.839638 -16.857749 19.317226 10.839638 -16.857749 + 11.894171 -23.508046 -7.425116 11.894171 -23.508046 -7.425116 + 12.394382 -18.456602 -8.331916 12.394382 -18.456602 -8.331916 + 12.897795 -13.395951 -9.235428 12.897795 -13.395951 -9.235428 + 13.392010 -8.355224 -10.119179 13.392010 -8.355224 -10.119179 + 13.874891 -3.311264 -11.016649 13.874891 -3.311264 -11.016649 + 14.359303 1.721462 -11.921558 14.359303 1.721462 -11.921558 + 14.855389 6.744568 -12.817716 14.855389 6.744568 -12.817716 + 15.351266 11.786073 -13.719430 15.351266 11.786073 -13.719430 + 15.833928 16.807357 -14.644782 15.833928 16.807357 -14.644782 + 7.934101 -22.553366 -4.270667 7.934101 -22.553366 -4.270667 + 8.436837 -17.502379 -5.176291 8.436837 -17.502379 -5.176291 + 8.934489 -12.440964 -6.091835 8.934489 -12.440964 -6.091835 + 9.440178 -7.394897 -6.979949 9.440178 -7.394897 -6.979949 + 9.928057 -2.358390 -7.882481 9.928057 -2.358390 -7.882481 + 10.417418 2.678927 -8.790594 10.417418 2.678927 -8.790594 + 10.901779 7.690834 -9.671504 10.901779 7.690834 -9.671504 + 11.383709 12.720639 -10.561304 11.383709 12.720639 -10.561304 + 11.888060 17.759934 -11.479011 11.888060 17.759934 -11.479011 + 3.983606 -21.599638 -1.127306 3.983606 -21.599638 -1.127306 + 4.469868 -16.549885 -2.015333 4.469868 -16.549885 -2.015333 + 4.962695 -11.471812 -2.927748 4.962695 -11.471812 -2.927748 + 5.466034 -6.433081 -3.830345 5.466034 -6.433081 -3.830345 + 5.965158 -1.412706 -4.735029 5.965158 -1.412706 -4.735029 + 6.448966 3.622535 -5.627056 6.448966 3.622535 -5.627056 + 6.932810 8.641480 -6.515978 6.932810 8.641480 -6.515978 + 7.425252 13.669809 -7.409707 7.425252 13.669809 -7.409707 + 7.925429 18.716368 -8.322290 7.925429 18.716368 -8.322290 + 0.023795 -20.661062 2.035743 0.023795 -20.661062 2.035743 + 0.506525 -15.605252 1.134160 0.506525 -15.605252 1.134160 + 1.002034 -10.534865 0.228568 1.002034 -10.534865 0.228568 + 1.491319 -5.480243 -0.670336 1.491319 -5.480243 -0.670336 + 1.978009 -0.460087 -1.574472 1.978009 -0.460087 -1.574472 + 2.471231 4.571114 -2.468265 2.471231 4.571114 -2.468265 + 2.950101 9.595565 -3.353625 2.950101 9.595565 -3.353625 + 3.449482 14.629253 -4.253460 3.449482 14.629253 -4.253460 + 3.949740 19.678057 -5.194628 3.949740 19.678057 -5.194628 + -3.954338 -19.713572 5.203984 -3.954338 -19.713572 5.203984 + -3.467550 -14.630971 4.296010 -3.467550 -14.630971 4.296010 + -2.969333 -9.564829 3.368020 -2.969333 -9.564829 3.368020 + -2.466625 -4.524140 2.460979 -2.466625 -4.524140 2.460979 + -1.964282 0.492650 1.563702 -1.964282 0.492650 1.563702 + -1.470498 5.519490 0.663385 -1.470498 5.519490 0.663385 + -0.986156 10.537807 -0.216855 -0.986156 10.537807 -0.216855 + -0.515216 15.563102 -1.104598 -0.515216 15.563102 -1.104598 + -0.048741 20.637184 -2.040557 -0.048741 20.637184 -2.040557 + -7.912010 -18.767008 8.358321 -7.912010 -18.767008 8.358321 + -7.427551 -13.702011 7.446257 -7.427551 -13.702011 7.446257 + -6.936950 -8.613499 6.531688 -6.936950 -8.613499 6.531688 + -6.432243 -3.567135 5.626633 -6.432243 -3.567135 5.626633 + -5.943853 1.451367 4.724607 -5.943853 1.451367 4.724607 + -5.456656 6.482695 3.827574 -5.456656 6.482695 3.827574 + -4.966912 11.489009 2.936708 -4.966912 11.489009 2.936708 + -4.470352 16.524891 2.032155 -4.470352 16.524891 2.032155 + -4.000854 21.587351 1.086924 -4.000854 21.587351 1.086924 +-11.876298 -17.808153 11.486245 -11.876298 -17.808153 11.486245 +-11.392820 -12.772782 10.588491 -11.392820 -12.772782 10.588491 +-10.906784 -7.686076 9.686815 -10.906784 -7.686076 9.686815 +-10.402393 -2.626532 8.775978 -10.402393 -2.626532 8.775978 + -9.901055 2.408071 7.866547 -9.901055 2.408071 7.866547 + -9.417383 7.427636 6.978004 -9.417383 7.427636 6.978004 + -8.934581 12.446144 6.080149 -8.934581 12.446144 6.080149 + -8.437507 17.502856 5.159731 -8.437507 17.502856 5.159731 + -7.961876 22.534184 4.230484 -7.961876 22.534184 4.230484 +-15.838315 -16.853924 14.637251 -15.838315 -16.853924 14.637251 +-15.352842 -11.832189 13.739050 -15.352842 -11.832189 13.739050 +-14.868224 -6.735355 12.820044 -14.868224 -6.735355 12.820044 +-14.369331 -1.664459 11.915128 -14.369331 -1.664459 11.915128 +-13.872101 3.346689 11.015968 -13.872101 3.346689 11.015968 +-13.397229 8.346846 10.136363 -13.397229 8.346846 10.136363 +-12.904699 13.405618 9.225228 -12.904699 13.405618 9.225228 +-12.394594 18.470053 8.290242 -12.394594 18.470053 8.290242 +-11.898727 23.504826 7.374869 -11.898727 23.504826 7.374869 +-19.300405 -10.875471 16.865419 -19.300405 -10.875471 16.865419 +-18.820482 -5.810455 15.955754 -18.820482 -5.810455 15.955754 +-18.336559 -0.726159 15.059094 -18.336559 -0.726159 15.059094 +-17.844674 4.299220 14.166271 -17.844674 4.299220 14.166271 +-17.351938 9.290226 13.270936 -17.351938 9.290226 13.270936 +-16.843463 14.361521 12.345023 -16.843463 14.361521 12.345023 +-16.365340 19.423544 11.404411 -16.365340 19.423544 11.404411 +-22.771571 -4.893640 19.095772 -22.771571 -4.893640 19.095772 +-22.292085 0.196370 18.197106 -22.292085 0.196370 18.197106 +-21.792245 5.232651 17.305845 -21.792245 5.232651 17.305845 +-21.303653 10.242335 16.408825 -21.303653 10.242335 16.408825 +-20.818984 15.294047 15.499783 -20.818984 15.294047 15.499783 ] diff --git a/MAC/Deployment/data/StaticMetaData/AntennaFields/FI609-AntennaField.conf b/MAC/Deployment/data/StaticMetaData/AntennaFields/FI609-AntennaField.conf index ba34a01ebf569e645d492b5efccb5c0ce2a6ff43..f0c2e0907cebb8bb86062419f1862e3bdba8d1fc 100644 --- a/MAC/Deployment/data/StaticMetaData/AntennaFields/FI609-AntennaField.conf +++ b/MAC/Deployment/data/StaticMetaData/AntennaFields/FI609-AntennaField.conf @@ -1,118 +1,70 @@ # # AntennaPositions for FI609 -# ITRF2005 target_date = 2012.5 -# Created: 2012-07-16 19:53:21 +# ITRF2005 target_date = 2013.5 +# Created: 2012-10-09 13:53:51 # NORMAL_VECTOR LBA -3 [ 0.598753 0.072099 0.797682 ] +3 [ 0.333971 0.126638 0.934037 ] ROTATION_MATRIX LBA 3 x 3 [ - -0.1195950000 -0.7919540000 0.5987530000 - 0.9928230000 -0.0954190000 0.0720990000 - 0.0000330000 0.6030780000 0.7976820000 + -0.1488160000 -0.9307610000 0.3339710000 + 0.9855900000 -0.1121430000 0.1266380000 + -0.0804170000 0.3480040000 0.9340380000 ] LBA -3 [ 3829261.424550000 469162.284861000 5062137.310 ] -96 x 2 x 3 [ - 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - -2.019000 -0.243000 1.538000 -2.019000 -0.243000 1.538000 - -1.338000 2.105000 0.814000 -1.338000 2.105000 0.814000 - 0.800000 2.363000 -0.814000 0.800000 2.363000 -0.814000 - 2.019000 0.243000 -1.538000 2.019000 0.243000 -1.538000 - 1.338000 -2.105000 -0.814000 1.338000 -2.105000 -0.814000 - -0.800000 -2.363000 0.814000 -0.800000 -2.363000 0.814000 - 4.079000 2.490000 -3.287000 4.079000 2.490000 -3.287000 - 4.553000 -1.450000 -3.287000 4.553000 -1.450000 -3.287000 - 2.897000 -4.710000 -1.749000 2.897000 -4.710000 -1.749000 - -0.114000 -5.767000 0.607000 -0.114000 -5.767000 0.607000 - -3.073000 -4.125000 2.679000 -3.073000 -4.125000 2.679000 - -4.593000 -0.553001 3.498000 -4.593000 -0.553001 3.498000 - -3.965000 3.276999 2.680000 -3.965000 3.276999 2.680000 - -1.481000 5.575000 0.607000 -1.481000 5.575000 0.607000 - 1.696000 5.264000 -1.749000 1.696000 5.264000 -1.749000 - 3.325000 8.094000 -3.227000 3.325000 8.094000 -3.227000 - 5.895000 6.174000 -4.983000 5.895000 6.174000 -4.983000 - 8.055000 1.789000 -6.208000 8.055000 1.789000 -6.208000 - 7.100000 -5.296000 -4.851000 7.100000 -5.296000 -4.851000 - 5.558000 -7.771000 -3.469000 5.558000 -7.771000 -3.469000 - 2.574000 -9.698000 -1.056000 2.574000 -9.698000 -1.056000 - -0.823000 -9.088000 1.439000 -0.823000 -9.088000 1.439000 - -4.947000 -6.164001 4.270000 -4.947000 -6.164001 4.270000 - -7.561000 -2.503001 5.902000 -7.561000 -2.503001 5.902000 - -8.010000 1.856999 5.845000 -8.010000 1.856999 5.845000 - -6.423000 5.147999 4.356000 -6.423000 5.147999 4.356000 - -3.496000 8.124999 1.890000 -3.496000 8.124999 1.890000 - 0.098000 9.160000 -0.901000 0.098000 9.160000 -0.901000 - 6.085000 11.711000 -5.626000 6.085000 11.711000 -5.626000 - 8.653000 9.473001 -7.351000 8.653000 9.473001 -7.351000 - 9.729000 6.591001 -7.898000 9.729000 6.591001 -7.898000 - 10.555000 -1.357999 -7.800000 10.555000 -1.357999 -7.800000 - 11.846000 -3.957999 -8.534000 11.846000 -3.957999 -8.534000 - 7.953000 -9.375000 -5.122000 7.953000 -9.375000 -5.122000 - 4.619000 -12.043000 -2.378000 4.619000 -12.043000 -2.378000 - 1.254000 -15.057000 0.420000 1.254000 -15.057000 0.420000 - -1.108000 -13.300000 2.034000 -1.108000 -13.300000 2.034000 - -4.648000 -11.324001 4.512000 -4.648000 -11.324001 4.512000 - -8.914000 -6.506001 7.279000 -8.914000 -6.506001 7.279000 --10.281000 -4.219001 8.099000 -10.281000 -4.219001 8.099000 --10.622000 1.094999 7.874000 -10.622000 1.094999 7.874000 --11.584000 5.119999 8.232000 -11.584000 5.119999 8.232000 - -6.993000 11.547999 4.205000 -6.993000 11.547999 4.205000 - -4.144000 13.144999 1.922000 -4.144000 13.144999 1.922000 - 0.066000 14.419000 -1.353000 0.066000 14.419000 -1.353000 --46.335000 17.673996 33.182000 -46.335000 17.673996 33.182000 - 11.383990 57.565001 -13.748000 11.383990 57.565001 -13.748000 - 2.611000 17.408000 -3.533000 2.611000 17.408000 -3.533000 - 4.638000 19.009000 -5.200000 4.638000 19.009000 -5.200000 - 14.358000 8.711001 -11.565000 14.358000 8.711001 -11.565000 - 15.030000 -7.363999 -10.616000 15.030000 -7.363999 -10.616000 - 13.860000 -11.972999 -9.321000 13.860000 -11.972999 -9.321000 - 5.393000 -17.343000 -2.480000 5.393000 -17.343000 -2.480000 - -5.242000 -16.244001 5.403000 -5.242000 -16.244001 5.403000 --11.414000 -13.831001 9.818000 -11.414000 -13.831001 9.818000 --14.458000 0.234999 10.831000 -14.458000 0.234999 10.831000 --14.758000 8.385999 10.320000 -14.758000 8.385999 10.320000 - -9.310000 15.253999 5.609000 -9.310000 15.253999 5.609000 - -8.039000 23.172999 3.939000 -8.039000 23.172999 3.939000 - 2.247000 24.576000 -3.908000 2.247000 24.576000 -3.908000 - 11.966000 19.631001 -10.756000 11.966000 19.631001 -10.756000 - 15.751000 15.269001 -13.203000 15.751000 15.269001 -13.203000 - 19.928000 8.381001 -15.716000 19.928000 8.381001 -15.716000 - 18.162000 -8.927999 -12.826000 18.162000 -8.927999 -12.826000 - 15.488000 -15.960999 -10.183000 15.488000 -15.960999 -10.183000 - 7.405000 -24.872000 -3.310000 7.405000 -24.872000 -3.310000 - -3.977000 -24.282001 5.180000 -3.977000 -24.282001 5.180000 --11.131000 -21.194001 10.271000 -11.131000 -21.194001 10.271000 --16.975000 -11.649002 13.794000 -16.975000 -11.649002 13.794000 --21.572000 3.661998 15.861000 -21.572000 3.661998 15.861000 --15.823000 19.435998 10.120000 -15.823000 19.435998 10.120000 --11.836000 32.002999 5.991000 -11.836000 32.002999 5.991000 - 0.101000 31.247000 -2.900000 0.101000 31.247000 -2.900000 - 11.458000 26.949001 -11.036000 11.458000 26.949001 -11.036000 - 17.292000 23.246001 -15.080000 17.292000 23.246001 -15.080000 - 24.497000 6.208002 -18.949000 24.497000 6.208002 -18.949000 - 26.158000 -11.760998 -18.572000 26.158000 -11.760998 -18.572000 - 21.558000 -22.275998 -14.168000 21.558000 -22.275998 -14.168000 - 14.462000 -24.832999 -8.611000 14.462000 -24.832999 -8.611000 - 5.553000 -33.729000 -1.119000 5.553000 -33.729000 -1.119000 - -9.613000 -30.959001 10.014000 -9.613000 -30.959001 10.014000 --15.886000 -26.187002 14.291000 -15.886000 -26.187002 14.291000 --24.716000 -14.105002 19.827000 -24.716000 -14.105002 19.827000 --25.169000 -5.898002 19.425000 -25.169000 -5.898002 19.425000 --24.556000 14.570998 17.115000 -24.556000 14.570998 17.115000 --20.355000 18.467998 13.610000 -20.355000 18.467998 13.610000 --23.588000 23.474998 15.584000 -23.588000 23.474998 15.584000 - 3.630000 41.115000 -6.441000 3.630000 41.115000 -6.441000 - 21.736000 27.821002 -18.830000 21.736000 27.821002 -18.830000 - 31.775000 11.529002 -24.893000 31.775000 11.529002 -24.893000 - 32.237000 -4.510997 -23.790000 32.237000 -4.510997 -23.790000 - 11.012000 -39.388999 -4.705000 11.012000 -39.388999 -4.705000 - -6.724000 -34.986001 8.209000 -6.724000 -34.986001 8.209000 --19.713000 -31.887002 17.679000 -19.713000 -31.887002 17.679000 --30.445000 9.700997 21.975000 -30.445000 9.700997 21.975000 +3 [ 2136832.728720000 810088.928305000 5935285.442 ] +48 x 2 x 3 [ + 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 + -0.912000 2.380000 0.004000 -0.912000 2.380000 0.004000 + -2.445000 0.506000 0.806000 -2.445000 0.506000 0.806000 + -1.479000 -2.014000 0.802000 -1.479000 -2.014000 0.802000 + 0.913000 -2.382000 -0.003000 0.913000 -2.382000 -0.003000 + 2.446000 -0.508000 -0.805000 2.446000 -0.508000 -0.805000 + 1.480000 2.014000 -0.802000 1.480000 2.014000 -0.802000 + -0.542000 -5.694000 0.966000 -0.542000 -5.694000 0.966000 + 3.082000 -4.894000 -0.438000 3.082000 -4.894000 -0.438000 + 5.265000 -1.806000 -1.638000 5.265000 -1.806000 -1.638000 + 4.983000 2.129000 -2.070000 4.983000 2.129000 -2.070000 + 2.370000 5.066000 -1.534000 2.370000 5.066000 -1.534000 + -1.351000 5.633000 -0.280000 -1.351000 5.633000 -0.280000 + -4.441000 3.563999 1.105000 -4.441000 3.563999 1.105000 + -5.451000 -0.173001 1.973000 -5.451000 -0.173001 1.973000 + -3.912000 -3.830001 1.918000 -3.912000 -3.830001 1.918000 + -5.729000 -6.740001 2.963000 -5.729000 -6.740001 2.963000 + -3.029000 -9.120000 2.320000 -3.029000 -9.120000 2.320000 + 1.656000 -10.163000 0.786000 1.656000 -10.163000 0.786000 + 7.453000 -6.582000 -1.773000 7.453000 -6.582000 -1.773000 + 8.995000 -3.898999 -2.688000 8.995000 -3.898999 -2.688000 + 9.484000 0.302001 -3.432000 9.484000 0.302001 -3.432000 + 7.595000 4.116000 -3.274000 7.595000 4.116000 -3.274000 + 3.399000 7.992000 -2.299000 3.399000 7.992000 -2.299000 + -0.835000 9.824000 -1.033000 -0.835000 9.824000 -1.033000 + -4.818000 8.848999 0.523000 -4.818000 8.848999 0.523000 + -7.053000 5.830999 1.732000 -7.053000 5.830999 1.732000 + -8.480000 1.332999 2.852000 -8.480000 1.332999 2.852000 + -7.947000 -3.283001 3.287000 -7.947000 -3.283001 3.287000 + -7.781000 -11.260001 4.309000 -7.781000 -11.260001 4.309000 + -4.804000 -13.529001 3.553000 -4.804000 -13.529001 3.553000 + -1.861000 -13.806000 2.538000 -1.861000 -13.806000 2.538000 + 5.400000 -12.037000 -0.299000 5.400000 -12.037000 -0.299000 + 8.181000 -12.666999 -1.208000 8.181000 -12.666999 -1.208000 + 11.351000 -6.183999 -3.220000 11.351000 -6.183999 -3.220000 + 12.344000 -1.308999 -4.236000 12.344000 -1.308999 -4.236000 + 13.629000 3.719001 -5.378000 13.629000 3.719001 -5.378000 + 11.154000 5.909001 -4.790000 11.154000 5.909001 -4.790000 + 8.019000 9.422001 -4.145000 8.019000 9.422001 -4.145000 + 2.114000 12.810000 -2.493000 2.114000 12.810000 -2.493000 + -0.426000 13.639000 -1.697000 -0.426000 13.639000 -1.697000 + -5.195000 12.205999 0.203000 -5.195000 12.205999 0.203000 + -9.089000 11.953999 1.630000 -9.089000 11.953999 1.630000 +-12.860000 4.291999 4.017000 -12.860000 4.291999 4.017000 +-13.116000 0.364999 4.641000 -13.116000 0.364999 4.641000 +-12.545000 -5.064001 5.173000 -12.545000 -5.064001 5.173000 + -2.470000 12.526000 -0.815000 -2.470000 12.526000 -0.815000 + -5.517000 -10.688001 3.422000 -5.517000 -10.688001 3.422000 ] NORMAL_VECTOR HBA @@ -126,54 +78,54 @@ ROTATION_MATRIX HBA ] HBA -3 [ 2136818.263510000 810038.592116000 5935299.531 ] +3 [ 2136818.697730000 810039.764004000 5935299.217 ] 48 x 2 x 3 [ --18.938810 -14.472459 8.734270 -18.938810 -14.472459 8.734270 --17.132810 -9.823459 7.458270 -17.132810 -9.823459 7.458270 --15.324810 -5.173459 6.181270 -15.324810 -5.173459 6.181270 --13.518810 -0.525459 4.905270 -13.518810 -0.525459 4.905270 - -9.903810 8.772542 2.352270 -9.903810 8.772542 2.352270 - -8.096810 13.420542 1.075270 -8.096810 13.420542 1.075270 - -4.481820 22.718542 -1.477730 -4.481820 22.718542 -1.477730 - -2.675820 27.366542 -2.753730 -2.675820 27.366542 -2.753730 --14.435810 -16.585459 7.410270 -14.435810 -16.585459 7.410270 --12.628810 -11.937459 6.134270 -12.628810 -11.937459 6.134270 --10.820810 -7.288458 4.858270 -10.820810 -7.288458 4.858270 - -9.014810 -2.639458 3.581270 -9.014810 -2.639458 3.581270 - -5.399810 6.657542 1.028270 -5.399810 6.657542 1.028270 - -3.592810 11.307542 -0.247730 -3.592810 11.307542 -0.247730 - 0.021190 20.604542 -2.800730 0.021190 20.604542 -2.800730 - 1.828180 25.253543 -4.077730 1.828180 25.253543 -4.077730 - -9.931810 -18.700458 6.087270 -9.931810 -18.700458 6.087270 - -8.124810 -14.052458 4.810270 -8.124810 -14.052458 4.810270 - -6.317810 -9.402458 3.534270 -6.317810 -9.402458 3.534270 - -4.510810 -4.753458 2.257270 -4.510810 -4.753458 2.257270 - -0.896810 4.543542 -0.295730 -0.896810 4.543542 -0.295730 - 0.910190 9.192543 -1.571730 0.910190 9.192543 -1.571730 - 4.525190 18.489543 -4.124730 4.525190 18.489543 -4.124730 - 6.331190 23.138543 -5.401730 6.331190 23.138543 -5.401730 - -5.427810 -20.814458 4.763270 -5.427810 -20.814458 4.763270 - -3.621810 -16.165458 3.487270 -3.621810 -16.165458 3.487270 - -1.813810 -11.516458 2.210270 -1.813810 -11.516458 2.210270 - -0.007810 -6.868457 0.934270 -0.007810 -6.868457 0.934270 - 3.607190 2.428543 -1.618730 3.607190 2.428543 -1.618730 - 5.414190 7.078543 -2.895730 5.414190 7.078543 -2.895730 - 9.028190 16.375543 -5.448730 9.028190 16.375543 -5.448730 - 10.835190 21.024543 -6.724730 10.835190 21.024543 -6.724730 - -0.924810 -22.928458 3.439270 -0.924810 -22.928458 3.439270 - 0.882190 -18.280457 2.163270 0.882190 -18.280457 2.163270 - 2.689190 -13.630457 0.886270 2.689190 -13.630457 0.886270 - 4.496190 -8.982457 -0.389730 4.496190 -8.982457 -0.389730 - 8.111190 0.315543 -2.943730 8.111190 0.315543 -2.943730 - 9.918190 4.963543 -4.219730 9.918190 4.963543 -4.219730 - 13.532190 14.261544 -6.772730 13.532190 14.261544 -6.772730 - 15.340190 18.910544 -8.049730 15.340190 18.910544 -8.049730 - 3.579190 -25.042457 2.115270 3.579190 -25.042457 2.115270 - 5.386190 -20.393457 0.839270 5.386190 -20.393457 0.839270 - 7.193190 -15.745457 -0.437730 7.193190 -15.745457 -0.437730 - 9.001190 -11.096457 -1.713730 9.001190 -11.096457 -1.713730 - 12.615190 -1.799456 -4.266730 12.615190 -1.799456 -4.266730 - 14.421190 2.850544 -5.543730 14.421190 2.850544 -5.543730 - 18.035190 12.147544 -8.096730 18.035190 12.147544 -8.096730 - 19.843190 16.796544 -9.372730 19.843190 16.796544 -9.372730 +-19.391000 -15.634702 9.053400 -19.391000 -15.634702 9.053400 +-17.585000 -10.985702 7.777400 -17.585000 -10.985702 7.777400 +-15.777000 -6.335702 6.500400 -15.777000 -6.335702 6.500400 +-13.971000 -1.687702 5.224400 -13.971000 -1.687702 5.224400 +-10.356000 7.610299 2.671400 -10.356000 7.610299 2.671400 + -8.549000 12.258299 1.394400 -8.549000 12.258299 1.394400 + -4.934010 21.556299 -1.158600 -4.934010 21.556299 -1.158600 + -3.128010 26.204299 -2.434600 -3.128010 26.204299 -2.434600 +-14.888000 -17.747702 7.729400 -14.888000 -17.747702 7.729400 +-13.081000 -13.099702 6.453400 -13.081000 -13.099702 6.453400 +-11.273000 -8.450701 5.177400 -11.273000 -8.450701 5.177400 + -9.467000 -3.801701 3.900400 -9.467000 -3.801701 3.900400 + -5.852000 5.495299 1.347400 -5.852000 5.495299 1.347400 + -4.045000 10.145299 0.071400 -4.045000 10.145299 0.071400 + -0.431010 19.442300 -2.481600 -0.431010 19.442300 -2.481600 + 1.375990 24.091300 -3.758600 1.375990 24.091300 -3.758600 +-10.384000 -19.862701 6.406400 -10.384000 -19.862701 6.406400 + -8.577000 -15.214701 5.129400 -8.577000 -15.214701 5.129400 + -6.770000 -10.564701 3.853400 -6.770000 -10.564701 3.853400 + -4.963000 -5.915701 2.576400 -4.963000 -5.915701 2.576400 + -1.349000 3.381299 0.023400 -1.349000 3.381299 0.023400 + 0.458000 8.030300 -1.252600 0.458000 8.030300 -1.252600 + 4.073000 17.327300 -3.805600 4.073000 17.327300 -3.805600 + 5.878990 21.976300 -5.082600 5.878990 21.976300 -5.082600 + -5.880000 -21.976701 5.082400 -5.880000 -21.976701 5.082400 + -4.074000 -17.327701 3.806400 -4.074000 -17.327701 3.806400 + -2.266000 -12.678701 2.529400 -2.266000 -12.678701 2.529400 + -0.460000 -8.030700 1.253400 -0.460000 -8.030700 1.253400 + 3.155000 1.266300 -1.299600 3.155000 1.266300 -1.299600 + 4.962000 5.916300 -2.576600 4.962000 5.916300 -2.576600 + 8.576000 15.213300 -5.129600 8.576000 15.213300 -5.129600 + 10.383000 19.862300 -6.405600 10.383000 19.862300 -6.405600 + -1.377000 -24.090701 3.758400 -1.377000 -24.090701 3.758400 + 0.430000 -19.442700 2.482400 0.430000 -19.442700 2.482400 + 2.237000 -14.792700 1.205400 2.237000 -14.792700 1.205400 + 4.044000 -10.144700 -0.070600 4.044000 -10.144700 -0.070600 + 7.659000 -0.846700 -2.624600 7.659000 -0.846700 -2.624600 + 9.466000 3.801300 -3.900600 9.466000 3.801300 -3.900600 + 13.080000 13.099301 -6.453600 13.080000 13.099301 -6.453600 + 14.888000 17.748301 -7.730600 14.888000 17.748301 -7.730600 + 3.127000 -26.204700 2.434400 3.127000 -26.204700 2.434400 + 4.934000 -21.555700 1.158400 4.934000 -21.555700 1.158400 + 6.741000 -16.907700 -0.118600 6.741000 -16.907700 -0.118600 + 8.549000 -12.258700 -1.394600 8.549000 -12.258700 -1.394600 + 12.163000 -2.961699 -3.947600 12.163000 -2.961699 -3.947600 + 13.969000 1.688301 -5.224600 13.969000 1.688301 -5.224600 + 17.583000 10.985301 -7.777600 17.583000 10.985301 -7.777600 + 19.391000 15.634301 -9.053600 19.391000 15.634301 -9.053600 ] diff --git a/MAC/Deployment/data/StaticMetaData/AntennaFields/RS305-AntennaField.conf b/MAC/Deployment/data/StaticMetaData/AntennaFields/RS305-AntennaField.conf new file mode 100644 index 0000000000000000000000000000000000000000..733ed4df00c8d0edd1592ea7887f7bce524ed47c --- /dev/null +++ b/MAC/Deployment/data/StaticMetaData/AntennaFields/RS305-AntennaField.conf @@ -0,0 +1,179 @@ +# +# AntennaPositions for RS305 +# ITRF2005 target_date = 2012.5 +# Created: 2012-10-10 14:47:46 +# + +NORMAL_VECTOR LBA +3 [ 0.598460 0.072037 0.797907 ] + +ROTATION_MATRIX LBA +3 x 3 [ + -0.1195790000 -0.7921780000 0.5984600000 + 0.9928250000 -0.0954460000 0.0720370000 + 0.0000540000 0.6027800000 0.7979070000 +] + +LBA +3 [ 3828720.758730000 454781.410823000 5063851.082 ] +96 x 2 x 3 [ + 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 + -2.020000 -0.243000 1.537000 -2.020000 -0.243000 1.537000 + -1.338000 2.105000 0.814000 -1.338000 2.105000 0.814000 + 0.800000 2.363000 -0.814000 0.800000 2.363000 -0.814000 + 2.020000 0.243000 -1.537000 2.020000 0.243000 -1.537000 + 1.338000 -2.105000 -0.814000 1.338000 -2.105000 -0.814000 + -0.800000 -2.363000 0.814000 -0.800000 -2.363000 0.814000 + -2.079000 5.305000 1.080000 -2.079000 5.305000 1.080000 + 1.078000 5.547000 -1.310000 1.078000 5.547000 -1.310000 + 3.731000 3.192001 -3.087000 3.731000 3.192001 -3.087000 + 4.638000 -0.655999 -3.420000 4.638000 -0.655999 -3.420000 + 3.375000 -4.195999 -2.153000 3.375000 -4.195999 -2.153000 + 0.533000 -5.774000 0.121000 0.533000 -5.774000 0.121000 + -2.559000 -4.649000 2.339000 -2.559000 -4.649000 2.339000 + -4.454000 -1.349000 3.462000 -4.454000 -1.349000 3.462000 + -4.264000 2.582000 2.965000 -4.264000 2.582000 2.965000 + -6.571000 4.864000 4.489000 -6.571000 4.864000 4.489000 + -5.076000 7.897000 3.095000 -5.076000 7.897000 3.095000 + -1.592000 10.199000 0.274000 -1.592000 10.199000 0.274000 + 4.122000 8.378001 -3.848000 4.122000 8.378001 -3.848000 + 6.141000 6.235001 -5.169000 6.141000 6.235001 -5.169000 + 7.747000 2.346001 -6.022000 7.747000 2.346001 -6.022000 + 7.321000 -1.833999 -5.326000 7.321000 -1.833999 -5.326000 + 5.050000 -6.713999 -3.182000 5.050000 -6.713999 -3.182000 + 2.158000 -9.647000 -0.747000 2.158000 -9.647000 -0.747000 + -1.340000 -9.818000 1.892000 -1.340000 -9.818000 1.892000 + -4.015000 -7.547000 3.693000 -4.015000 -7.547000 3.693000 + -6.465000 -3.634000 5.177000 -6.465000 -3.634000 5.177000 + -7.366000 0.937000 5.440000 -7.366000 0.937000 5.440000 + -9.531000 8.626999 6.370000 -9.531000 8.626999 6.370000 + -7.782000 11.628000 4.787000 -7.782000 11.628000 4.787000 + -5.484000 12.712000 2.966000 -5.484000 12.712000 2.966000 + 0.889000 13.034000 -1.844000 0.889000 13.034000 -1.844000 + 2.955000 14.411000 -3.518000 2.955000 14.411000 -3.518000 + 7.385000 9.079001 -6.358000 7.385000 9.079001 -6.358000 + 9.593000 4.685001 -7.618000 9.593000 4.685001 -7.618000 + 12.081000 0.224001 -9.082000 12.081000 0.224001 -9.082000 + 10.713000 -2.563999 -7.804000 10.713000 -2.563999 -7.804000 + 9.193000 -6.800999 -6.281000 9.193000 -6.800999 -6.281000 + 5.401000 -11.688999 -2.996000 5.401000 -11.688999 -2.996000 + 3.589000 -13.188999 -1.501000 3.589000 -13.188999 -1.501000 + -0.677000 -13.141000 1.694000 -0.677000 -13.141000 1.694000 + -3.894000 -13.982000 4.183000 -3.894000 -13.982000 4.183000 + -9.151000 -7.688001 7.557000 -9.151000 -7.688001 7.557000 +-10.488000 -3.995001 8.227000 -10.488000 -3.995001 8.227000 +-11.593000 1.364999 8.572000 -11.593000 1.364999 8.572000 + 25.915000 -46.067998 -15.278000 25.915000 -46.067998 -15.278000 +-35.656000 -29.798003 29.434000 -35.656000 -29.798003 29.434000 +-14.045000 4.802999 10.101000 -14.045000 4.802999 10.101000 +-15.371000 7.471999 10.854000 -15.371000 7.471999 10.854000 + -7.278000 18.670000 3.773000 -7.278000 18.670000 3.773000 + 5.633000 18.079001 -5.857000 5.633000 18.079001 -5.857000 + 9.361000 16.209001 -8.485000 9.361000 16.209001 -8.485000 + 13.839000 5.179001 -10.847000 13.839000 5.179001 -10.847000 + 13.159000 -7.978999 -9.150000 13.159000 -7.978999 -9.150000 + 11.337000 -15.456999 -7.108000 11.337000 -15.456999 -7.108000 + 0.088000 -17.999000 1.559000 0.088000 -17.999000 1.559000 + -6.459000 -17.647000 6.438000 -6.459000 -17.647000 6.438000 +-12.085000 -10.246001 9.989000 -12.085000 -10.246001 9.989000 +-18.476000 -7.958001 14.576000 -18.476000 -7.958001 14.576000 +-19.801000 4.986999 14.401000 -19.801000 4.986999 14.401000 +-16.011000 16.658999 10.504000 -16.011000 16.658999 10.504000 +-12.576000 20.989999 7.538000 -12.576000 20.989999 7.538000 + -7.119010 25.583000 3.030000 -7.119010 25.583000 3.030000 + 6.829000 21.843001 -7.094000 6.829000 21.843001 -7.094000 + 12.535000 17.884001 -11.016000 12.535000 17.884001 -11.016000 + 19.854000 7.016002 -15.524000 19.854000 7.016002 -15.524000 + 19.597000 -7.116998 -14.056000 19.597000 -7.116998 -14.056000 + 17.252000 -15.759998 -11.516000 17.252000 -15.759998 -11.516000 + 9.690000 -22.191999 -5.264000 9.690000 -22.191999 -5.264000 + -2.531000 -26.560000 4.296000 -2.531000 -26.560000 4.296000 +-15.323000 -17.992001 13.117000 -15.323000 -17.992001 13.117000 +-25.501000 -11.904002 20.202000 -25.501000 -11.904002 20.202000 +-25.122000 2.905998 18.580000 -25.122000 2.905998 18.580000 +-21.884000 16.676998 14.908000 -21.884000 16.676998 14.908000 +-19.020010 23.618999 12.133000 -19.020010 23.618999 12.133000 + -5.459010 31.084000 1.288000 -5.459010 31.084000 1.288000 + 8.954000 31.557001 -9.565000 8.954000 31.557001 -9.565000 + 17.496000 24.887002 -15.370000 17.496000 24.887002 -15.370000 + 19.687000 15.816002 -16.194000 19.687000 15.816002 -16.194000 + 27.009000 3.920003 -20.611000 27.009000 3.920003 -20.611000 + 25.073000 -14.735998 -17.475000 25.073000 -14.735998 -17.475000 + 21.357000 -22.127998 -14.021000 21.357000 -22.127998 -14.021000 + 11.812000 -32.058999 -5.965000 11.812000 -32.058999 -5.965000 + 5.223000 -31.892999 -1.038000 5.223000 -31.892999 -1.038000 +-11.245000 -29.310001 11.080000 -11.245000 -29.310001 11.080000 +-14.457000 -23.728001 12.986000 -14.457000 -23.728001 12.986000 +-18.421000 -27.311001 16.282000 -18.421000 -27.311001 16.282000 +-33.123000 8.182997 24.104990 -33.123000 8.182997 24.104990 +-22.782010 29.564998 14.418000 -22.782010 29.564998 14.418000 + -9.876010 40.628999 3.739000 -9.876010 40.628999 3.739000 + 3.009990 39.778000 -5.849000 3.009990 39.778000 -5.849000 + 31.454000 10.221003 -24.515000 31.454000 10.221003 -24.515000 + 28.255000 -11.492997 -20.155000 28.255000 -11.492997 -20.155000 + 26.012000 -27.405998 -17.036000 26.012000 -27.405998 -17.036000 + -7.217000 -37.082000 8.761000 -7.217000 -37.082000 8.761000 +] + +NORMAL_VECTOR HBA +3 [ 0.598753 0.072099 0.797682 ] + +ROTATION_MATRIX HBA +3 x 3 [ + -0.1195950000 -0.7919540000 0.5987530000 + 0.9928230000 -0.0954190000 0.0720990000 + 0.0000330000 0.6030780000 0.7976820000 +] + +HBA +3 [ 3828732.711740000 454692.403824000 5063850.315 ] +48 x 2 x 3 [ +-15.478010 -2.278001 11.824000 -15.478010 -2.278001 11.824000 +-14.521010 2.646999 10.661000 -14.521010 2.646999 10.661000 +-13.565010 7.571999 9.498000 -13.565010 7.571999 9.498000 +-12.608010 12.496999 8.334000 -12.608010 12.496999 8.334000 +-11.466000 -3.737001 8.944000 -11.466000 -3.737001 8.944000 +-10.509010 1.186999 7.781000 -10.509010 1.186999 7.781000 + -9.553010 6.111999 6.618000 -9.553010 6.111999 6.618000 + -8.596010 11.037000 5.455000 -8.596010 11.037000 5.455000 + -9.367000 -15.048000 8.391000 -9.367000 -15.048000 8.391000 + -8.411000 -10.123000 7.228000 -8.411000 -10.123000 7.228000 + -7.453000 -5.198000 6.064000 -7.453000 -5.198000 6.064000 + -6.497000 -0.273000 4.901000 -6.497000 -0.273000 4.901000 + -5.540010 4.652000 3.738000 -5.540010 4.652000 3.738000 + -4.584010 9.576000 2.575000 -4.584010 9.576000 2.575000 + -3.626010 14.501000 1.411000 -3.626010 14.501000 1.411000 + -2.669010 19.426000 0.248000 -2.669010 19.426000 0.248000 + -5.355000 -16.507000 5.512000 -5.355000 -16.507000 5.512000 + -4.398000 -11.582000 4.348000 -4.398000 -11.582000 4.348000 + -3.441000 -6.657000 3.185000 -3.441000 -6.657000 3.185000 + -2.484000 -1.733000 2.021000 -2.484000 -1.733000 2.021000 + -1.528000 3.192000 0.858000 -1.528000 3.192000 0.858000 + -0.571010 8.117000 -0.305000 -0.571010 8.117000 -0.305000 + 0.385990 13.042000 -1.469000 0.385990 13.042000 -1.469000 + 1.342990 17.967000 -2.632000 1.342990 17.967000 -2.632000 + -1.343000 -17.967000 2.632000 -1.343000 -17.967000 2.632000 + -0.386000 -13.042000 1.469000 -0.386000 -13.042000 1.469000 + 0.571000 -8.117000 0.305000 0.571000 -8.117000 0.305000 + 1.528000 -3.192000 -0.858000 1.528000 -3.192000 -0.858000 + 2.484000 1.733001 -2.021000 2.484000 1.733001 -2.021000 + 3.440990 6.657001 -3.185000 3.440990 6.657001 -3.185000 + 4.397990 11.582001 -4.348000 4.397990 11.582001 -4.348000 + 5.354990 16.507001 -5.512000 5.354990 16.507001 -5.512000 + 2.669000 -19.425999 -0.248000 2.669000 -19.425999 -0.248000 + 3.626000 -14.500999 -1.411000 3.626000 -14.500999 -1.411000 + 4.584000 -9.575999 -2.575000 4.584000 -9.575999 -2.575000 + 5.540000 -4.651999 -3.738000 5.540000 -4.651999 -3.738000 + 6.497000 0.273001 -4.901000 6.497000 0.273001 -4.901000 + 7.453000 5.198001 -6.064000 7.453000 5.198001 -6.064000 + 8.410990 10.123001 -7.228000 8.410990 10.123001 -7.228000 + 9.366990 15.048001 -8.391000 9.366990 15.048001 -8.391000 + 8.596000 -11.036999 -5.455000 8.596000 -11.036999 -5.455000 + 9.553000 -6.111999 -6.618000 9.553000 -6.111999 -6.618000 + 10.509000 -1.186999 -7.781000 10.509000 -1.186999 -7.781000 + 11.466000 3.737001 -8.944000 11.466000 3.737001 -8.944000 + 12.608000 -12.496999 -8.334000 12.608000 -12.496999 -8.334000 + 13.565000 -7.571999 -9.498000 13.565000 -7.571999 -9.498000 + 14.521000 -2.646998 -10.661000 14.521000 -2.646998 -10.661000 + 15.478000 2.278002 -11.824000 15.478000 2.278002 -11.824000 +] diff --git a/MAC/Deployment/data/StaticMetaData/Attenuation/Attenuation.conf b/MAC/Deployment/data/StaticMetaData/Attenuation/Attenuation.conf new file mode 100644 index 0000000000000000000000000000000000000000..f9f3b63cbfd9eab463e44f10db9160c14641d69b --- /dev/null +++ b/MAC/Deployment/data/StaticMetaData/Attenuation/Attenuation.conf @@ -0,0 +1,17 @@ +# +# Attenuation.conf +# +# This file contains the attenuations of the various coaxcables for each rcumode. +# The line of RCUmode 0 is used to define the cablelengths. +# +#Rcumode 50m 80m 85m 115m 130m +#--------------------------------------------------- +0 50 80 85 115 130 +1 -2.05 -3.32 -3.53 -4.74 -5.40 +2 -2.05 -3.32 -3.53 -4.74 -5.40 +3 -2.05 -3.32 -3.53 -4.74 -5.40 +4 -2.05 -3.32 -3.53 -4.74 -5.40 +5 -3.64 -5.87 -6.22 -8.35 -9.52 +6 -4.24 -6.82 -7.21 -9.70 -11.06 +7 -4.46 -7.19 -7.58 -10.18 -11.61 + diff --git a/MAC/Deployment/data/StaticMetaData/Attenuation/DE601-Attenuation.conf b/MAC/Deployment/data/StaticMetaData/Attenuation/DE601-Attenuation.conf new file mode 100644 index 0000000000000000000000000000000000000000..bfa4ff11f4de08c1f9dcaa16419336c8d2946359 --- /dev/null +++ b/MAC/Deployment/data/StaticMetaData/Attenuation/DE601-Attenuation.conf @@ -0,0 +1,17 @@ +# +# Attenuation.conf +# +# This file contains the attenuations of the various coaxcables for each rcumode. +# The line of RCUmode 0 is used to define the cablelengths. +# Note: All HBA Attenuations are corrected for the Older RCU with 1dB Att. step +#Rcumode 50m 80m 85m 115m 130m +#--------------------------------------------------- +0 50 80 85 115 130 +1 -0.51 -0.83 -0.88 -1.18 -1.35 +2 -0.51 -0.83 -0.88 -1.18 -1.35 +3 -0.51 -0.83 -0.88 -1.18 -1.35 +4 -0.51 -0.83 -0.88 -1.18 -1.35 +5 -0.91 -1.47 -1.55 -2.09 -2.38 +6 -1.06 -1.71 -1.80 -2.43 -2.77 +7 -1.12 -1.78 -1.90 -2.55 -2.90 + diff --git a/MAC/Deployment/data/StaticMetaData/Attenuation/FI609-Attenuation.conf b/MAC/Deployment/data/StaticMetaData/Attenuation/FI609-Attenuation.conf new file mode 100644 index 0000000000000000000000000000000000000000..314afd729aeafc81de1de2df8afe3c74b2633f5f --- /dev/null +++ b/MAC/Deployment/data/StaticMetaData/Attenuation/FI609-Attenuation.conf @@ -0,0 +1,17 @@ +# +# Attenuation.conf +# +# This file contains the attenuations of the various coaxcables for each rcumode. +# The line of RCUmode 0 is used to define the cablelengths. +# +#Rcumode 120m 80m 85m 115m 130m +#--------------------------------------------------- +0 50 80 85 115 130 +1 -4.85 -3.32 -3.53 -4.74 -5.40 +2 -4.85 -3.32 -3.53 -4.74 -5.40 +3 -4.85 -3.32 -3.53 -4.74 -5.40 +4 -4.85 -3.32 -3.53 -4.74 -5.40 +5 -8.55 -5.87 -6.22 -8.35 -9.52 +6 -9.92 -6.82 -7.21 -9.70 -11.06 +7 -10.42 -7.19 -7.58 -10.18 -11.61 + diff --git a/MAC/Deployment/data/StaticMetaData/CableDelays/DE601-CableDelays.conf b/MAC/Deployment/data/StaticMetaData/CableDelays/DE601-CableDelays.conf index 710f529400d83e25d2754ca5a9b532e8843a8be2..6ec609c96590c2169053cf3d0bf27cce29362f05 100644 --- a/MAC/Deployment/data/StaticMetaData/CableDelays/DE601-CableDelays.conf +++ b/MAC/Deployment/data/StaticMetaData/CableDelays/DE601-CableDelays.conf @@ -1,7 +1,4 @@ # -# CableDelays.conf for DE601 -# -# # Effelsberg CableDelays.conf # # 2009 Oct 12 James M Anderson --- MPIfR Created based on default @@ -11,6 +8,50 @@ # account for the cable delay of the patch # cables within the electronics cabinet. # Also, are the LBH cables all 130 m? +# +# 2012 Sept 14 Menno Norden --- Astron correction applied to rev14249 +# 2012 October 16 Norden-Wucknitz Checked on Tiles +# +# Original file: DE601-CableDelays.conf-rev14249.svn000.tmp.conf +# Modifications: http://www.astro.uni-bonn.de/~wucknitz/wiki/doku.php/lbg:single:start?&#effelsberg_cable_lengths_hba +# HBA +##RCUnr len delay corrected +##---------------------------------------------------- +#6 130 530.6981 115 ok +#7 130 530.6981 115 ok +#8 130 530.6981 115 ok +#9 130 530.6981 115 ok +#10 115 465.4000 85 ok +#11 115 465.6000 85 ok +#22 130 530.6981 115 ok +#23 130 530.6981 115 ok +#40 130 530.6981 115 ok +#41 130 530.6981 115 ok +#74 115 465.5254 130 ok +#75 115 465.5254 130 ok +#76 115 465.5254 130 ok +#77 115 465.5254 130 ok +#92 115 465.5000 130 ok +#93 115 465.5000 130 ok +#94 115 465.5000 130 ok +#95 115 465.5000 130 ok +#164 85 342.5133 115 ok +#165 85 342.5133 115 ok +# +# Two antennas 58-59,86-87 have been wrong in rev14249 and are correct now +# +#58 130 530.6981 115 ok +#59 130 530.6981 115 ok +#86 115 ok +#87 115 ok +# +# Two antennas 92-95 have been wrong and are still wrong +# Note Menno: I assume 115m when 130m is wrong (please check!!) +# +#92 130 530.6981 130 ok +#93 130 530.6981 130 ok +#94 130 530.6981 130 ok +#95 130 530.6981 130 ok # # This file contains for each input of each RCU the delay the length of the cable # connected to itadds to the signal path. @@ -21,8 +62,8 @@ # 50m 199.2573 # 80m 326.9640 # 85m 342.5133 -# 115m 465.5254 -# 130m 530.6981 +# 115m 465.5254 +# 130m 530.6981 # # LBL LBH HBA #RCUnr len delay len delay len delay @@ -33,12 +74,12 @@ 3 130 530.6981 130 530.6981 115 465.5000 4 130 530.6981 130 530.6981 115 465.5000 5 130 530.6981 130 530.6981 115 465.5000 -6 130 530.6981 130 530.6981 130 530.6981 -7 130 530.6981 130 530.6981 130 530.6981 -8 130 530.6981 130 530.6981 130 530.6981 -9 130 530.6981 130 530.6981 130 530.6981 -10 130 530.6981 130 530.6981 115 465.4000 -11 130 530.6981 130 530.6981 115 465.6000 +6 130 530.6981 130 530.6981 115 465.5000 +7 130 530.6981 130 530.6981 115 465.5000 +8 130 530.6981 130 530.6981 115 465.5000 +9 130 530.6981 130 530.6981 115 465.4000 +10 130 530.6981 130 530.6981 85 342.4000 +11 130 530.6981 130 530.6981 85 342.6000 12 130 530.6981 130 530.6981 115 465.2000 13 130 530.6981 130 530.6981 115 465.5000 14 130 530.6981 130 530.6981 115 466.0000 @@ -49,8 +90,8 @@ 19 130 530.6981 130 530.6981 115 465.5000 20 130 530.6981 130 530.6981 115 465.5000 21 130 530.6981 130 530.6981 115 465.6000 -22 130 530.6981 130 530.6981 130 530.6981 -23 130 530.6981 130 530.6981 130 530.6981 +22 130 530.6981 130 530.6981 115 465.6000 +23 130 530.6981 130 530.6981 115 465.4000 24 130 530.6981 130 530.6981 85 342.5000 25 130 530.6981 130 530.6981 85 342.6000 26 130 530.6981 130 530.6981 85 342.5000 @@ -67,8 +108,8 @@ 37 130 530.6981 130 530.6981 115 465.5000 38 130 530.6981 130 530.6981 115 465.5000 39 130 530.6981 130 530.6981 115 465.5000 -40 130 530.6981 130 530.6981 130 530.6981 -41 130 530.6981 130 530.6981 130 530.6981 +40 130 530.6981 130 530.6981 115 465.5000 +41 130 530.6981 130 530.6981 115 465.5000 42 130 530.6981 130 530.6981 85 342.3000 43 130 530.6981 130 530.6981 85 342.5000 44 130 530.6981 130 530.6981 85 342.6000 @@ -85,8 +126,8 @@ 55 130 530.6981 130 530.6981 115 465.5000 56 130 530.6981 130 530.6981 115 465.5000 57 130 530.6981 130 530.6981 115 465.5000 -58 130 530.6981 130 530.6981 115 465.5254 -59 130 530.6981 130 530.6981 115 465.5254 +58 130 530.6981 130 530.6981 115 465.5000 +59 130 530.6981 130 530.6981 115 465.5000 60 130 530.6981 130 530.6981 85 342.3000 61 130 530.6981 130 530.6981 85 342.5000 62 130 530.6981 130 530.6981 85 342.6000 @@ -101,10 +142,10 @@ 71 130 530.6981 130 530.6981 115 465.5000 72 130 530.6981 130 530.6981 115 465.5000 73 130 530.6981 130 530.6981 115 465.4000 -74 130 530.6981 130 530.6981 115 465.5254 -75 130 530.6981 130 530.6981 115 465.5254 -76 130 530.6981 130 530.6981 115 465.5254 -77 130 530.6981 130 530.6981 115 465.5254 +74 130 530.6981 130 530.6981 130 519.8000 +75 130 530.6981 130 530.6981 130 519.7000 +76 130 530.6981 130 530.6981 130 519.6000 +77 130 530.6981 130 530.6981 130 519.8000 78 130 530.6981 130 530.6981 85 342.5000 79 130 530.6981 130 530.6981 85 342.5000 80 130 530.6981 130 530.6981 85 342.5000 @@ -113,16 +154,16 @@ 83 130 530.6981 130 530.6981 85 342.5000 84 130 530.6981 130 530.6981 85 342.5000 85 130 530.6981 130 530.6981 85 342.4000 -86 130 530.6981 130 530.6981 115 465.5254 -87 130 530.6981 130 530.6981 115 465.5254 +86 130 530.6981 130 530.6981 115 465.5000 +87 130 530.6981 130 530.6981 115 465.5000 88 130 530.6981 130 530.6981 115 465.5000 89 130 530.6981 130 530.6981 115 465.5000 90 130 530.6981 130 530.6981 115 465.5000 91 130 530.6981 130 530.6981 115 465.5000 -92 130 530.6981 130 530.6981 115 465.5000 -93 130 530.6981 130 530.6981 115 465.5000 -94 130 530.6981 130 530.6981 115 465.5000 -95 130 530.6981 130 530.6981 115 465.5000 +92 130 530.6981 130 530.6981 130 519.6000 +93 130 530.6981 130 530.6981 130 519.6000 +94 130 530.6981 130 530.6981 130 519.6000 +95 130 530.6981 130 530.6981 130 519.6000 96 130 530.6981 130 530.6981 85 342.5000 97 130 530.6981 130 530.6981 85 342.5000 98 130 530.6981 130 530.6981 85 342.5000 @@ -191,8 +232,8 @@ 161 130 530.6981 130 530.6981 85 342.5000 162 130 530.6981 130 530.6981 85 342.5000 163 130 530.6981 130 530.6981 85 342.5000 -164 130 530.6981 130 530.6981 85 342.5133 -165 130 530.6981 130 530.6981 85 342.5133 +164 130 530.6981 130 530.6981 115 465.5000 +165 130 530.6981 130 530.6981 115 465.4000 166 130 530.6981 130 530.6981 115 465.4000 167 130 530.6981 130 530.6981 115 465.5000 168 130 530.6981 130 530.6981 85 342.4000 diff --git a/MAC/Deployment/data/StaticMetaData/CableDelays/FI609-CableDelays.conf b/MAC/Deployment/data/StaticMetaData/CableDelays/FI609-CableDelays.conf index af96f02e144ae7cb4d32553022cd9cfdd66825f9..d08c9c2d4352689ec8ebef372156faaeac379776 100644 --- a/MAC/Deployment/data/StaticMetaData/CableDelays/FI609-CableDelays.conf +++ b/MAC/Deployment/data/StaticMetaData/CableDelays/FI609-CableDelays.conf @@ -1,8 +1,9 @@ +# CableDelays.conf KAIRA (FI609) # -# CableDelays.conf KAIRA +# Derek McKay-Bukowski, SGO, 2012-09-27 # -# This file contains for each input of each RCU the delay the length of the cable -# connected to it adds to the signal path. +# This file contains for each input of each RCU the delay the length of +# the cable connected to it adds to the signal path. # # Lenghts are in meters, delays are in ns. # @@ -13,102 +14,126 @@ # 115m 465.5254 # 130m 530.6981 # +# 50m cables are formed from an 80m cable, joined with half of a second +# 80m cable. Joins for these cables are located in the LBA cable +# mausoleum. +# +# HBA cable delays are based on the nominal cable length values (from +# the cable barcodes). LBA values are based on a combination of bar +# codes and the measured group delays of the 40m extension components. +# +# +# +# ACHTUNG!!! +# +# There is currently no 50m column in Attenuation.conf. Additionally, +# the software can only cope +# with three LBA cable values. This will require some hacking... +# *ahem* modification by Menno to +# make this work. Thus, in the interim, we shall use 115m attenuations +# for the 50m cables +# (although the cable delay lengths themselves will still be the +# correct values for teh 50m +# length. +# +# +# # LBL LBH HBA -#RCUnr len delay len delay len delay +#RCUnr len delay len delay len delay #----------------------------------------------------------------------- -0 0 0.0 0 0.0 85 342.5133 -1 0 0.0 0 0.0 85 342.5133 -2 0 0.0 0 0.0 85 342.5133 -3 0 0.0 0 0.0 85 342.5133 -4 0 0.0 0 0.0 85 342.5133 -5 0 0.0 0 0.0 85 342.5133 -6 0 0.0 0 0.0 85 342.5133 -7 0 0.0 0 0.0 85 342.5133 -8 0 0.0 0 0.0 85 342.5133 -9 0 0.0 0 0.0 85 342.5133 -10 0 0.0 0 0.0 85 342.5133 -11 0 0.0 0 0.0 85 342.5133 -12 0 0.0 0 0.0 115 465.5254 -13 0 0.0 0 0.0 115 465.5254 -14 0 0.0 0 0.0 115 465.5254 -15 0 0.0 0 0.0 115 465.5254 -16 0 0.0 0 0.0 85 342.5133 -17 0 0.0 0 0.0 85 342.5133 -18 0 0.0 0 0.0 85 342.5133 -19 0 0.0 0 0.0 85 342.5133 -20 0 0.0 0 0.0 85 342.5133 -21 0 0.0 0 0.0 85 342.5133 -22 0 0.0 0 0.0 85 342.5133 -23 0 0.0 0 0.0 85 342.5133 -24 0 0.0 0 0.0 85 342.5133 -25 0 0.0 0 0.0 85 342.5133 -26 0 0.0 0 0.0 115 465.5254 -27 0 0.0 0 0.0 115 465.5254 -28 0 0.0 0 0.0 115 465.5254 -29 0 0.0 0 0.0 115 465.5254 -30 0 0.0 0 0.0 115 465.5254 -31 0 0.0 0 0.0 115 465.5254 -32 0 0.0 0 0.0 85 342.5133 -33 0 0.0 0 0.0 85 342.5133 -34 0 0.0 0 0.0 85 342.5133 -35 0 0.0 0 0.0 85 342.5133 -36 0 0.0 0 0.0 85 342.5133 -37 0 0.0 0 0.0 85 342.5133 -38 0 0.0 0 0.0 85 342.5133 -39 0 0.0 0 0.0 85 342.5133 -40 0 0.0 0 0.0 115 465.5254 -41 0 0.0 0 0.0 115 465.5254 -42 0 0.0 0 0.0 115 465.5254 -43 0 0.0 0 0.0 115 465.5254 -44 0 0.0 0 0.0 115 465.5254 -45 0 0.0 0 0.0 115 465.5254 -46 0 0.0 0 0.0 115 465.5254 -47 0 0.0 0 0.0 115 465.5254 -48 0 0.0 0 0.0 85 342.5133 -49 0 0.0 0 0.0 85 342.5133 -50 0 0.0 0 0.0 85 342.5133 -51 0 0.0 0 0.0 85 342.5133 -52 0 0.0 0 0.0 85 342.5133 -53 0 0.0 0 0.0 85 342.5133 -54 0 0.0 0 0.0 85 342.5133 -55 0 0.0 0 0.0 85 342.5133 -56 0 0.0 0 0.0 115 465.5254 -57 0 0.0 0 0.0 115 465.5254 -58 0 0.0 0 0.0 115 465.5254 -59 0 0.0 0 0.0 115 465.5254 -60 0 0.0 0 0.0 115 465.5254 -61 0 0.0 0 0.0 115 465.5254 -62 0 0.0 0 0.0 115 465.5254 -63 0 0.0 0 0.0 115 465.5254 -64 0 0.0 0 0.0 85 342.5133 -65 0 0.0 0 0.0 85 342.5133 -66 0 0.0 0 0.0 85 342.5133 -67 0 0.0 0 0.0 85 342.5133 -68 0 0.0 0 0.0 85 342.5133 -69 0 0.0 0 0.0 85 342.5133 -70 0 0.0 0 0.0 115 465.5254 -71 0 0.0 0 0.0 115 465.5254 -72 0 0.0 0 0.0 115 465.5254 -73 0 0.0 0 0.0 115 465.5254 -74 0 0.0 0 0.0 115 465.5254 -75 0 0.0 0 0.0 115 465.5254 -76 0 0.0 0 0.0 115 465.5254 -77 0 0.0 0 0.0 115 465.5254 -78 0 0.0 0 0.0 115 465.5254 -79 0 0.0 0 0.0 115 465.5254 -80 0 0.0 0 0.0 85 342.5133 -81 0 0.0 0 0.0 85 342.5133 -82 0 0.0 0 0.0 85 342.5133 -83 0 0.0 0 0.0 85 342.5133 -84 0 0.0 0 0.0 115 465.5254 -85 0 0.0 0 0.0 115 465.5254 -86 0 0.0 0 0.0 115 465.5254 -87 0 0.0 0 0.0 115 465.5254 -88 0 0.0 0 0.0 115 465.5254 -89 0 0.0 0 0.0 115 465.5254 -90 0 0.0 0 0.0 115 465.5254 -91 0 0.0 0 0.0 115 465.5254 -92 0 0.0 0 0.0 115 465.5254 -93 0 0.0 0 0.0 115 465.5254 -94 0 0.0 0 0.0 115 465.5254 -95 0 0.0 0 0.0 115 465.5254 \ No newline at end of file +0 115 465.60 115 465.60 85 342.40 +1 115 465.60 115 465.60 85 342.40 +2 115 465.60 115 465.60 85 342.70 +3 115 465.60 115 465.60 85 342.40 +4 115 465.60 115 465.60 85 342.60 +5 115 465.60 115 465.60 85 342.40 +6 115 465.60 115 465.60 85 342.50 +7 115 465.60 115 465.60 85 342.40 +8 115 465.40 115 465.40 85 342.60 +9 115 465.60 115 465.60 85 342.40 +10 50 483.60 50 483.60 85 342.50 +11 50 483.80 50 483.80 85 342.50 +12 50 477.70 50 477.70 115 465.60 +13 50 478.70 50 478.70 115 465.50 +14 115 465.60 115 465.60 115 465.60 +15 115 465.60 115 465.60 115 465.60 +16 115 465.60 115 465.60 85 342.60 +17 115 465.60 115 465.60 85 342.40 +18 50 478.70 50 478.70 85 342.60 +19 50 477.70 50 477.70 85 342.00 +20 50 482.70 50 482.70 85 342.60 +21 50 483.80 50 483.80 85 342.40 +22 50 478.70 50 478.70 85 342.30 +23 50 477.70 50 477.70 85 342.40 +24 50 478.80 50 478.80 85 342.50 +25 50 478.70 50 478.70 85 342.40 +26 115 465.60 115 465.60 115 465.50 +27 115 465.60 115 465.60 115 465.40 +28 115 465.50 115 465.50 115 465.60 +29 115 465.50 115 465.50 115 465.50 +30 115 465.60 115 465.60 115 465.50 +31 115 465.60 115 465.60 115 465.60 +32 115 465.60 115 465.60 85 342.40 +33 115 465.60 115 465.60 85 342.40 +34 115 465.60 115 465.60 85 342.60 +35 115 465.60 115 465.60 85 342.40 +36 115 465.60 115 465.60 85 342.40 +37 115 465.60 115 465.60 85 342.40 +38 50 477.80 50 477.80 85 342.40 +39 50 477.80 50 477.80 85 342.40 +40 50 478.50 50 478.50 115 465.60 +41 50 478.70 50 478.70 115 465.60 +42 50 482.80 50 482.80 115 465.50 +43 50 482.80 50 482.80 115 465.70 +44 50 483.70 50 483.70 115 465.50 +45 50 482.80 50 482.80 115 465.40 +46 50 477.70 50 477.70 115 465.60 +47 50 478.70 50 478.70 115 465.40 +48 50 483.10 50 483.10 85 342.20 +49 50 482.70 50 482.70 85 342.30 +50 50 478.80 50 478.80 85 342.70 +51 50 478.80 50 478.80 85 342.40 +52 50 478.80 50 478.80 85 342.40 +53 50 477.80 50 477.80 85 342.40 +54 115 465.60 115 465.60 85 342.40 +55 115 465.60 115 465.60 85 342.50 +56 115 465.60 115 465.60 115 465.60 +57 115 465.60 115 465.60 115 465.50 +58 80 320.60 80 320.60 115 465.60 +59 80 319.70 80 319.70 115 465.50 +60 115 465.60 115 465.60 115 465.60 +61 115 465.60 115 465.60 115 465.50 +62 115 465.60 115 465.60 115 465.50 +63 115 465.60 115 465.60 115 465.50 +64 50 478.70 50 478.70 85 342.60 +65 50 477.80 50 477.80 85 342.40 +66 50 478.80 50 478.80 85 342.40 +67 50 478.70 50 478.70 85 342.10 +68 50 478.70 50 478.70 85 342.60 +69 50 478.70 50 478.70 85 342.50 +70 50 482.80 50 482.80 115 465.60 +71 50 483.80 50 483.80 115 465.60 +72 130 518.70 130 518.70 115 465.60 +73 130 519.00 130 519.00 115 465.40 +74 50 482.70 50 482.70 115 465.50 +75 50 482.70 50 482.70 115 465.50 +76 130 519.30 130 519.30 115 465.50 +77 130 519.10 130 519.10 115 465.50 +78 50 482.70 50 482.70 115 465.50 +79 50 483.60 50 483.60 115 465.40 +80 50 482.70 50 482.70 85 342.60 +81 50 483.80 50 483.80 85 342.30 +82 50 478.80 50 478.80 85 342.60 +83 50 478.80 50 478.80 85 342.50 +84 50 478.70 50 478.70 115 465.60 +85 50 478.70 50 478.70 115 465.40 +86 115 465.60 115 465.60 115 465.60 +87 115 465.60 115 465.60 115 465.50 +88 115 465.60 115 465.60 115 465.60 +89 115 465.40 115 465.40 115 465.50 +90 80 326.80 80 326.80 115 465.50 +91 80 326.90 80 326.90 115 465.40 +92 50 477.80 50 477.80 115 465.60 +93 50 477.80 50 477.80 115 465.60 +94 115 465.60 115 465.60 115 465.40 +95 115 465.60 115 465.60 115 465.60 diff --git a/MAC/Deployment/data/StaticMetaData/CableDelays/RS210-CableDelays.conf b/MAC/Deployment/data/StaticMetaData/CableDelays/RS210-CableDelays.conf new file mode 100644 index 0000000000000000000000000000000000000000..e62d82268aab13b27b21a19030ca733f62769b06 --- /dev/null +++ b/MAC/Deployment/data/StaticMetaData/CableDelays/RS210-CableDelays.conf @@ -0,0 +1,114 @@ +# +# CableDelays.conf RS210 +# +# This file contains for each input of each RCU the delay the length of the cable +# connected to it adds to the signal path. +# +# Lenghts are in meters, delays are in ns. +# +# Note: The first order values are: +# 50m 199.2573 +# 80m 326.9640 +# 85m 342.5133 +# 115m 465.5254 +# 130m 530.6981 +# +# LBL LBH HBA +#RCUnr len delay len delay len delay +#----------------------------------------------------------------------- +0 80 326.9640 80 326.9640 115 465.5254 +1 80 326.9640 80 326.9640 115 465.5254 +2 80 326.9640 80 326.9640 115 465.5254 +3 80 326.9640 80 326.9640 115 465.5254 +4 80 326.9640 80 326.9640 115 465.5254 +5 80 326.9640 80 326.9640 115 465.5254 +6 115 465.5254 80 326.9640 115 465.5254 +7 115 465.5254 80 326.9640 115 465.5254 +8 115 465.5254 80 326.9640 115 465.5254 +9 115 465.5254 80 326.9640 115 465.5254 +10 115 465.5254 80 326.9640 115 465.5254 +11 115 465.5254 80 326.9640 115 465.5254 +12 80 326.9640 80 326.9640 115 465.5254 +13 80 326.9640 80 326.9640 115 465.5254 +14 80 326.9640 80 326.9640 115 465.5254 +15 80 326.9640 80 326.9640 115 465.5254 +16 80 326.9640 80 326.9640 85 342.5133 +17 80 326.9640 80 326.9640 85 342.5133 +18 80 326.9640 115 465.5254 85 342.5133 +19 80 326.9640 115 465.5254 85 342.5133 +20 80 326.9640 80 326.9640 115 465.5254 +21 80 326.9640 80 326.9640 115 465.5254 +22 80 326.9640 80 326.9640 115 465.5254 +23 80 326.9640 80 326.9640 115 465.5254 +24 80 326.9640 80 326.9640 115 465.5254 +25 80 326.9640 80 326.9640 115 465.5254 +26 80 326.9640 80 326.9640 115 465.5254 +27 80 326.9640 80 326.9640 115 465.5254 +28 80 326.9640 80 326.9640 115 465.5254 +29 80 326.9640 80 326.9640 115 465.5254 +30 80 326.9640 80 326.9640 115 465.5254 +31 80 326.9640 80 326.9640 115 465.5254 +32 115 465.5254 80 326.9640 85 342.5133 +33 115 465.5254 80 326.9640 85 342.5133 +34 115 465.5254 80 326.9640 85 342.5133 +35 115 465.5254 80 326.9640 85 342.5133 +36 115 465.5254 80 326.9640 85 342.5133 +37 115 465.5254 80 326.9640 85 342.5133 +38 115 465.5254 80 326.9640 85 342.5133 +39 115 465.5254 80 326.9640 85 342.5133 +40 80 326.9640 115 465.5254 115 465.5254 +41 80 326.9640 115 465.5254 115 465.5254 +42 80 326.9640 115 465.5254 115 465.5254 +43 80 326.9640 115 465.5254 115 465.5254 +44 80 326.9640 80 326.9640 115 465.5254 +45 80 326.9640 80 326.9640 115 465.5254 +46 80 326.9640 80 326.9640 115 465.5254 +47 80 326.9640 80 326.9640 115 465.5254 +48 80 326.9640 80 326.9640 85 342.5133 +49 80 326.9640 80 326.9640 85 342.5133 +50 80 326.9640 80 326.9640 85 342.5133 +51 80 326.9640 80 326.9640 85 342.5133 +52 80 326.9640 80 326.9640 85 342.5133 +53 80 326.9640 80 326.9640 85 342.5133 +54 80 326.9640 80 326.9640 85 342.5133 +55 80 326.9640 80 326.9640 85 342.5133 +56 115 465.5254 80 326.9640 85 342.5133 +57 115 465.5254 80 326.9640 85 342.5133 +58 115 465.5254 80 326.9640 115 465.5254 +59 115 465.5254 80 326.9640 115 465.5254 +60 115 465.5254 80 326.9640 115 465.5254 +61 115 465.5254 80 326.9640 115 465.5254 +62 115 465.5254 80 326.9640 115 465.5254 +63 115 465.5254 80 326.9640 115 465.5254 +64 115 465.5254 80 326.9640 85 342.5133 +65 115 465.5254 80 326.9640 85 342.5133 +66 115 465.5254 80 326.9640 85 342.5133 +67 115 465.5254 80 326.9640 85 342.5133 +68 115 465.5254 115 465.5254 85 342.5133 +69 115 465.5254 115 465.5254 85 342.5133 +70 80 326.9640 115 465.5254 85 342.5133 +71 80 326.9640 115 465.5254 85 342.5133 +72 80 326.9640 80 326.9640 85 342.5133 +73 80 326.9640 80 326.9640 85 342.5133 +74 80 326.9640 80 326.9640 85 342.5133 +75 80 326.9640 80 326.9640 85 342.5133 +76 80 326.9640 80 326.9640 85 342.5133 +77 80 326.9640 80 326.9640 85 342.5133 +78 80 326.9640 80 326.9640 115 465.5254 +79 80 326.9640 80 326.9640 115 465.5254 +80 80 326.9640 80 326.9640 85 342.5133 +81 80 326.9640 80 326.9640 85 342.5133 +82 80 326.9640 80 326.9640 85 342.5133 +83 80 326.9640 80 326.9640 85 342.5133 +84 115 465.5254 80 326.9640 85 342.5133 +85 115 465.5254 80 326.9640 85 342.5133 +86 115 465.5254 80 326.9640 85 342.5133 +87 115 465.5254 80 326.9640 85 342.5133 +88 115 465.5254 80 326.9640 85 342.5133 +89 115 465.5254 80 326.9640 85 342.5133 +90 115 465.5254 80 326.9640 85 342.5133 +91 115 465.5254 80 326.9640 85 342.5133 +92 115 465.5254 80 326.9640 85 342.5133 +93 115 465.5254 80 326.9640 85 342.5133 +94 80 326.9640 115 465.5254 85 342.5133 +95 80 326.9640 115 465.5254 85 342.5133 diff --git a/MAC/Deployment/data/StaticMetaData/CableDelays/RS305-CableDelays.conf b/MAC/Deployment/data/StaticMetaData/CableDelays/RS305-CableDelays.conf new file mode 100644 index 0000000000000000000000000000000000000000..a8caac10f43441af31c6307d3c321a54d3d0d2f6 --- /dev/null +++ b/MAC/Deployment/data/StaticMetaData/CableDelays/RS305-CableDelays.conf @@ -0,0 +1,114 @@ +# +# CableDelays.conf RS305 +# +# This file contains for each input of each RCU the delay the length of the cable +# connected to it adds to the signal path. +# +# Lenghts are in meters, delays are in ns. +# +# Note: The first order values are: +# 50m 199.2573 +# 80m 326.9640 +# 85m 342.5133 +# 115m 465.5254 +# 130m 530.6981 +# +# LBL LBH HBA +#RCUnr len delay len delay len delay +#----------------------------------------------------------------------- +0 80 326.9640 80 326.9640 85 342.5133 +1 80 326.9640 80 326.9640 85 342.5133 +2 80 326.9640 80 326.9640 85 342.5133 +3 80 326.9640 80 326.9640 85 342.5133 +4 115 465.5254 80 326.9640 85 342.5133 +5 115 465.5254 80 326.9640 85 342.5133 +6 115 465.5254 80 326.9640 85 342.5133 +7 115 465.5254 80 326.9640 85 342.5133 +8 115 465.5254 80 326.9640 85 342.5133 +9 115 465.5254 80 326.9640 85 342.5133 +10 80 326.9640 80 326.9640 85 342.5133 +11 80 326.9640 80 326.9640 85 342.5133 +12 80 326.9640 80 326.9640 85 342.5133 +13 80 326.9640 80 326.9640 85 342.5133 +14 80 326.9640 115 465.5254 85 342.5133 +15 80 326.9640 115 465.5254 85 342.5133 +16 50 199.2573 80 326.9640 115 465.5254 +17 50 199.2573 80 326.9640 115 465.5254 +18 80 326.9640 80 326.9640 115 465.5254 +19 80 326.9640 80 326.9640 115 465.5254 +20 80 326.9640 80 326.9640 85 342.5133 +21 80 326.9640 80 326.9640 85 342.5133 +22 80 326.9640 80 326.9640 85 342.5133 +23 80 326.9640 80 326.9640 85 342.5133 +24 80 326.9640 80 326.9640 85 342.5133 +25 80 326.9640 80 326.9640 85 342.5133 +26 115 465.5254 80 326.9640 85 342.5133 +27 115 465.5254 80 326.9640 85 342.5133 +28 115 465.5254 80 326.9640 85 342.5133 +29 115 465.5254 80 326.9640 85 342.5133 +30 115 465.5254 80 326.9640 85 342.5133 +31 115 465.5254 80 326.9640 85 342.5133 +32 115 465.5254 80 326.9640 115 465.5254 +33 115 465.5254 80 326.9640 115 465.5254 +34 115 465.5254 80 326.9640 115 465.5254 +35 115 465.5254 80 326.9640 115 465.5254 +36 80 326.9640 80 326.9640 115 465.5254 +37 80 326.9640 80 326.9640 115 465.5254 +38 80 326.9640 115 465.5254 85 342.5133 +39 80 326.9640 115 465.5254 85 342.5133 +40 80 326.9640 80 326.9640 85 342.5133 +41 80 326.9640 80 326.9640 85 342.5133 +42 50 199.2573 80 326.9640 85 342.5133 +43 50 199.2573 80 326.9640 85 342.5133 +44 50 199.2573 80 326.9640 85 342.5133 +45 50 199.2573 80 326.9640 85 342.5133 +46 80 326.9640 80 326.9640 85 342.5133 +47 80 326.9640 80 326.9640 85 342.5133 +48 80 326.9640 80 326.9640 115 465.5254 +49 80 326.9640 80 326.9640 115 465.5254 +50 80 326.9640 80 326.9640 115 465.5254 +51 80 326.9640 80 326.9640 115 465.5254 +52 115 465.5254 80 326.9640 115 465.5254 +53 115 465.5254 80 326.9640 115 465.5254 +54 115 465.5254 80 326.9640 115 465.5254 +55 115 465.5254 80 326.9640 115 465.5254 +56 115 465.5254 80 326.9640 85 342.5133 +57 115 465.5254 80 326.9640 85 342.5133 +58 115 465.5254 80 326.9640 85 342.5133 +59 115 465.5254 80 326.9640 85 342.5133 +60 115 465.5254 80 326.9640 85 342.5133 +61 115 465.5254 80 326.9640 85 342.5133 +62 115 465.5254 80 326.9640 85 342.5133 +63 115 465.5254 80 326.9640 85 342.5133 +64 115 465.5254 115 465.5254 115 465.5254 +65 115 465.5254 115 465.5254 115 465.5254 +66 80 326.9640 115 465.5254 115 465.5254 +67 80 326.9640 115 465.5254 115 465.5254 +68 80 326.9640 115 465.5254 115 465.5254 +69 80 326.9640 115 465.5254 115 465.5254 +70 50 199.2573 80 326.9640 115 465.5254 +71 50 199.2573 80 326.9640 115 465.5254 +72 50 199.2573 80 326.9640 115 465.5254 +73 50 199.2573 80 326.9640 115 465.5254 +74 50 199.2573 80 326.9640 85 342.5133 +75 50 199.2573 80 326.9640 85 342.5133 +76 50 199.2573 80 326.9640 85 342.5133 +77 50 199.2573 80 326.9640 85 342.5133 +78 80 326.9640 80 326.9640 85 342.5133 +79 80 326.9640 80 326.9640 85 342.5133 +80 115 465.5254 50 199.2573 115 465.5254 +81 115 465.5254 50 199.2573 115 465.5254 +82 115 465.5254 50 199.2573 115 465.5254 +83 115 465.5254 50 199.2573 115 465.5254 +84 115 465.5254 50 199.2573 115 465.5254 +85 115 465.5254 50 199.2573 115 465.5254 +86 115 465.5254 80 326.9640 115 465.5254 +87 115 465.5254 80 326.9640 115 465.5254 +88 115 465.5254 80 326.9640 115 465.5254 +89 115 465.5254 80 326.9640 115 465.5254 +90 80 326.9640 80 326.9640 115 465.5254 +91 80 326.9640 80 326.9640 115 465.5254 +92 80 326.9640 80 326.9640 115 465.5254 +93 80 326.9640 80 326.9640 115 465.5254 +94 50 199.2573 80 326.9640 115 465.5254 +95 50 199.2573 80 326.9640 115 465.5254 diff --git a/MAC/Deployment/data/StaticMetaData/ControlInfo.dat b/MAC/Deployment/data/StaticMetaData/ControlInfo.dat index 0f8caeffff5517028170381dc817baaa19f4b06a..207dd24f166013e02ff256aafc6a98a854b47433 100644 --- a/MAC/Deployment/data/StaticMetaData/ControlInfo.dat +++ b/MAC/Deployment/data/StaticMetaData/ControlInfo.dat @@ -3,7 +3,7 @@ # # $Id: $ # -# name IPaddress MACaddress +# Name IPaddress MACaddress #------------------------------------------ MCU001 10.144.0.2 00:30:48:2d:00:f6 SAS001 10.144.0.3 00:30:48:79:1c:f4 diff --git a/MAC/Deployment/data/StaticMetaData/RSPConnections_CCU.dat b/MAC/Deployment/data/StaticMetaData/RSPConnections_CCU.dat index 95e948bad9c502765c88c6e3bff0d9b27cf81499..ea13c6236effe5303092a18aa171d81e4f9f7d6e 100755 --- a/MAC/Deployment/data/StaticMetaData/RSPConnections_CCU.dat +++ b/MAC/Deployment/data/StaticMetaData/RSPConnections_CCU.dat @@ -54,10 +54,10 @@ CS011 RSP_0 R00-M1-N09-J00 10.170.0.165 00:14:5E:7D:95:52 CS011 RSP_0 R01-M1-N09-J00 10.170.1.165 00:14:5E:7D:34:09 CS011 RSP_1 R00-M0-N09-J00 10.170.0.37 00:14:5E:7D:08:51 CS011 RSP_1 R01-M0-N09-J00 10.170.1.37 00:14:5E:7D:93:1E -CS013 RSP_0 R00-M0-N04-J00 10.170.0.17 00:14:5E:7D:18:17 -CS013 RSP_0 R01-M0-N04-J00 10.170.1.17 00:14:5E:7D:96:38 -CS013 RSP_1 R00-M0-N04-J01 10.170.0.18 00:14:5E:7D:18:18 -CS013 RSP_1 R01-M0-N04-J01 10.170.1.18 00:14:5E:7D:96:39 +CS013 RSP_0 R00-M0-N10-J01 10.170.0.42 00:14:5E:7D:1C:0A +CS013 RSP_0 R01-M0-N10-J01 10.170.1.42 00:14:5E:7D:92:AF +CS013 RSP_1 R00-M0-N14-J01 10.170.0.58 00:14:5E:7D:94:7B +CS013 RSP_1 R01-M0-N14-J01 10.170.1.58 00:14:5E:7D:1C:CC CS017 RSP_0 R00-M1-N08-J00 10.170.0.161 00:14:5E:7D:94:46 CS017 RSP_0 R01-M1-N08-J00 10.170.1.161 00:14:5E:7D:8D:02 CS017 RSP_1 R00-M0-N08-J00 10.170.0.33 00:14:5E:7D:95:58 diff --git a/MAC/Deployment/data/StaticMetaData/RSPConnections_local.dat b/MAC/Deployment/data/StaticMetaData/RSPConnections_local.dat index 9995472bb426cc7710d6576059df6e9ceda63ed0..811e3d332284e5a7947efbb1eab8c9e7e5ffdae7 100644 --- a/MAC/Deployment/data/StaticMetaData/RSPConnections_local.dat +++ b/MAC/Deployment/data/StaticMetaData/RSPConnections_local.dat @@ -9,10 +9,10 @@ # Station_lane DestIP DestMAC alias #------------------------------------------------- -DE601_00 10.211.1.3 00:26:6C:FB:79:69 lofar1a -DE601_01 10.212.1.3 00:26:6C:FC:CC:31 lofar2a -DE601_02 10.213.1.3 00:A0:D1:EC:75:69 lofar3a -DE601_03 10.214.1.3 00:A0:D1:EC:76:85 lofar4a +DE601_00 10.211.1.2 00:30:48:34:74:5F lofar1 +DE601_01 10.212.1.2 00:30:48:34:74:73 lofar2 +DE601_02 10.213.1.2 00:30:48:34:74:69 lofar3 +DE601_03 10.214.1.2 00:30:48:BB:90:2F lofar4 DE602_00 10.170.0.182 00:12:F2:C6:C1:00 R00-BG1-DE602 DE602_01 10.170.0.182 00:12:F2:C6:C1:00 R00-BG1-DE602 diff --git a/MAC/Deployment/data/StaticMetaData/RSPDriver.conf.tmpl b/MAC/Deployment/data/StaticMetaData/RSPDriver.conf.tmpl index 6107bf58cb71392664fdeb863d4bd33597e6855a..01205d2e03ed7fa075468af141d6cddab169b240 100644 --- a/MAC/Deployment/data/StaticMetaData/RSPDriver.conf.tmpl +++ b/MAC/Deployment/data/StaticMetaData/RSPDriver.conf.tmpl @@ -195,7 +195,7 @@ RSPDriver.IGNORE_REMOTE_DATA=0 # RSPDriver.CDO_ENABLE=1 RSPDriver.CDO_N_BLOCKS=16 -RSPDriver.CDO_N_BEAMLETS=61 +#RSPDriver.CDO_N_BEAMLETS=61 RSPDriver.FB_ENABLE=1 # @@ -270,6 +270,7 @@ RSPDriver.WRITE_SI=1 RSPDriver.READ_SI=1 RSPDriver.SPLITTER=1 RSPDriver.READ_LATENCY=1 +RSPDriver.READ_BITMODE=1 # # TDS_CONTROL diff --git a/MAC/Deployment/data/StaticMetaData/StationInfo.dat b/MAC/Deployment/data/StaticMetaData/StationInfo.dat index 665da06653f1ea3816a8a77809e8425f361f4fd3..545c16af6cb9a5a2b2a3510cf4b5460b4a2d4ca3 100644 --- a/MAC/Deployment/data/StaticMetaData/StationInfo.dat +++ b/MAC/Deployment/data/StaticMetaData/StationInfo.dat @@ -178,7 +178,7 @@ SE607 207 E 11.9302386 57.3990617 50.34 24 12 96 96 N # Chillbolton UK608 208 E -1.4342539 51.1439472 137.66 24 12 96 96 No No # Finland -FI609 209 E 20.7609103 69.0714225 533.25 12 6 0 48 No No +FI609 209 E 20.7609103 69.0714225 533.25 12 6 48 48 No No ## 210 - 255 ## diff --git a/MAC/Deployment/data/StaticMetaData/TBBConnections.dat b/MAC/Deployment/data/StaticMetaData/TBBConnections.dat index 0447550cb9d61998f1c283b3473f4552e45af18f..7eb12b46e5c4b81aab9d49b262e69a3e8711ad5a 100644 --- a/MAC/Deployment/data/StaticMetaData/TBBConnections.dat +++ b/MAC/Deployment/data/StaticMetaData/TBBConnections.dat @@ -55,6 +55,7 @@ RS207 TBB_0 locus050 RS208 TBB_0 locus051 RS210 TBB_0 locus052 # +RS305 TBB_0 locus082 RS306 TBB_0 locus053 RS307 TBB_0 locus054 RS308 TBB_0 locus055 diff --git a/MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf b/MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf index c320242428196f23d760b568674b28c87b7f8ca6..2c4cf5bbce08da3ee7dd17f82f5210f99ce6fb92 100644 --- a/MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf +++ b/MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf @@ -1,23 +1,24 @@ # # HBADeltas for DE601 -# Created: 2012-01-24 14:49:41 +# Created: 2012-09-03 15:56:36 +# based on IGS08 measurement data taken on 2012-05-30 # HBADeltas 16 x 3 [ - 1.263 -2.184 -0.817 - 0.301 -1.953 -0.053 - -0.661 -1.722 0.711 - -1.623 -1.490 1.475 - 1.383 -0.959 -1.036 - 0.421 -0.728 -0.272 - -0.541 -0.497 0.492 - -1.503 -0.266 1.255 - 1.503 0.266 -1.255 - 0.541 0.497 -0.492 - -0.421 0.728 0.272 - -1.383 0.959 1.036 - 1.623 1.490 -1.475 - 0.661 1.722 -0.711 - -0.301 1.953 0.053 - -1.263 2.184 0.817 + 1.26258 -2.18428 -0.81613 + 0.30089 -1.95269 -0.05191 + -0.66079 -1.72111 0.71232 + -1.62247 -1.48952 1.47654 + 1.38254 -0.95968 -1.03627 + 0.42086 -0.72809 -0.27204 + -0.54082 -0.49651 0.49218 + -1.50250 -0.26492 1.25640 + 1.50250 0.26492 -1.25640 + 0.54082 0.49651 -0.49218 + -0.42086 0.72809 0.27204 + -1.38254 0.95968 1.03627 + 1.62247 1.48952 -1.47654 + 0.66079 1.72111 -0.71232 + -0.30089 1.95269 0.05191 + -1.26258 2.18428 0.81613 ] diff --git a/MAC/Deployment/data/StaticMetaData/iHBADeltas/FI609-iHBADeltas.conf b/MAC/Deployment/data/StaticMetaData/iHBADeltas/FI609-iHBADeltas.conf new file mode 100644 index 0000000000000000000000000000000000000000..b51f7a53be1b04e8c3271dbf05358b6b80bb0918 --- /dev/null +++ b/MAC/Deployment/data/StaticMetaData/iHBADeltas/FI609-iHBADeltas.conf @@ -0,0 +1,23 @@ +# +# HBADeltas for FI609 +# Created: 2012-08-08 06:35:00, manually rotated by 90 degrees by IV +# +HBADeltas +16 x 3 [ + 0.980 -2.464 -0.017 + -0.113 -1.949 0.305 + -1.206 -1.436 0.626 + -2.299 -0.921 0.948 + 1.420 -1.336 -0.327 + 0.327 -0.821 -0.005 + -0.766 -0.307 0.316 + -1.860 0.207 0.637 + 1.860 -0.207 -0.637 + 0.766 0.307 -0.316 + -0.327 0.821 0.005 + -1.420 1.336 0.327 + 2.299 0.921 -0.948 + 1.206 1.436 -0.626 + 0.113 1.949 -0.305 + -0.980 2.464 0.017 +] diff --git a/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS305-iHBADeltas.conf b/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS305-iHBADeltas.conf new file mode 100644 index 0000000000000000000000000000000000000000..e1dd8dfd99b27f6c4690eb9492419ecf8e534e21 --- /dev/null +++ b/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS305-iHBADeltas.conf @@ -0,0 +1,23 @@ +# +# HBADeltas for RS305 +# Created: 2012-10-10 14:47:46 +# +HBADeltas +16 x 3 [ + -1.809 -1.262 1.472 + -1.577 -0.066 1.190 + -1.345 1.129 0.907 + -1.112 2.324 0.625 + -0.835 -1.616 0.773 + -0.603 -0.421 0.491 + -0.371 0.775 0.208 + -0.139 1.970 -0.074 + 0.139 -1.970 0.074 + 0.371 -0.775 -0.208 + 0.603 0.421 -0.491 + 0.835 1.616 -0.773 + 1.112 -2.324 -0.625 + 1.345 -1.129 -0.907 + 1.577 0.066 -1.190 + 1.809 1.262 -1.472 +] diff --git a/MAC/GCF/PVSS/src/PVSSinfo.cc b/MAC/GCF/PVSS/src/PVSSinfo.cc index 52ec199299c3e57f53da32d459ea7e6f3809c33e..4e6c890b8689cde3871a3a651eb608a12fe2e26f 100644 --- a/MAC/GCF/PVSS/src/PVSSinfo.cc +++ b/MAC/GCF/PVSS/src/PVSSinfo.cc @@ -105,11 +105,11 @@ bool PVSSinfo::propExists(const string& dpeName) if (Manager::getId(dpePvssName, dpId) == PVSS_FALSE) { LOG_TRACE_VAR_STR("propExists(" << dpeName << "): FALSE"); - return false; + return (false); } LOG_TRACE_VAR_STR("propExists(" << dpeName << "): OK"); - return true; + return (true); } // @@ -121,11 +121,11 @@ bool PVSSinfo::typeExists (const string& dpTypeName) DpTypeId dpTypeId; if (Manager::getTypeId(pvssTypeName, dpTypeId) != PVSS_TRUE) { LOG_TRACE_VAR_STR("typeExists(" << dpTypeName << "): FALSE"); - return (true); + return (false); } LOG_TRACE_VAR_STR("typeExists(" << dpTypeName << "): OK"); - return (false); + return (true); } // diff --git a/MAC/MACIO/include/MACIO/CMakeLists.txt b/MAC/MACIO/include/MACIO/CMakeLists.txt index 03b459cc0d2899a2de5c922e733b20443c97ce25..ec01b8fb9f165cdb7163955053a82f098ac0298b 100644 --- a/MAC/MACIO/include/MACIO/CMakeLists.txt +++ b/MAC/MACIO/include/MACIO/CMakeLists.txt @@ -6,7 +6,7 @@ set(inst_HEADERS GCF_Event.h KVTLogger.h MACServiceInfo.h - Marshalling.h + Marshalling.tcc ProtocolDefs.h StringVector.h DoubleVector.h diff --git a/MAC/MACIO/include/MACIO/DoubleVector.h b/MAC/MACIO/include/MACIO/DoubleVector.h index b103bcbbc1d06839b840a7f187db1401d10d1343..15021737497923c4c53f65a1fcb79ccc55b3254b 100644 --- a/MAC/MACIO/include/MACIO/DoubleVector.h +++ b/MAC/MACIO/include/MACIO/DoubleVector.h @@ -30,7 +30,6 @@ //# Includes #include <Common/lofar_vector.h> #include <Common/StreamUtil.h> -#include <MACIO/Marshalling.h> // Avoid 'using namespace' in headerfiles @@ -48,9 +47,9 @@ public: DoubleVector() {}; ~DoubleVector() {}; - unsigned int getSize(); - unsigned int pack (void *buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char *buffer) const; + size_t unpack(char *buffer); ostream& print (ostream& os) const; vector<double>& operator()() @@ -64,26 +63,24 @@ private: // @} // getSize() -inline unsigned int DoubleVector::getSize() +inline size_t DoubleVector::getSize() const { - unsigned int offset = 0; - MSH_SIZE_VECTOR_DOUBLE(offset, theVector); - return (offset); + return (MSH_size(theVector)); } // pack() -inline unsigned int DoubleVector::pack(void *buffer) +inline size_t DoubleVector::pack(char *buffer) const { - unsigned int offset = 0; - MSH_PACK_VECTOR_DOUBLE(buffer, offset, theVector); + size_t offset = 0; + MSH_pack(buffer, offset, theVector); return (offset); } // unpack() -inline unsigned int DoubleVector::unpack(void *buffer) +inline size_t DoubleVector::unpack(char *buffer) { - unsigned int offset = 0; - MSH_UNPACK_VECTOR_DOUBLE(buffer, offset, theVector); + size_t offset = 0; + MSH_unpack(buffer, offset, theVector); return (offset); } diff --git a/MAC/MACIO/include/MACIO/Marshalling.h b/MAC/MACIO/include/MACIO/Marshalling.h deleted file mode 100644 index 73f173286114fca5069849bd0f96eb046e10cbfc..0000000000000000000000000000000000000000 --- a/MAC/MACIO/include/MACIO/Marshalling.h +++ /dev/null @@ -1,244 +0,0 @@ -//# -*- mode: c++ -*- -//# -//# Marshalling.h: Macros for packing/unpacking some classes -//# -//# Copyright (C) 2002-2004 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# -//# $Id$ - -#ifndef MACIO_MARSHALLING_H_ -#define MACIO_MARSHALLING_H_ - -#include <Common/LofarTypes.h> -#include <Common/lofar_string.h> -#include <Common/lofar_bitset.h> -#include <Common/lofar_map.h> - -// SIZE string -#define MSH_STRING_SIZE(stdstring) \ - (sizeof(uint32) + (stdstring).size() * sizeof(char)) - -// PACK string -#define MSH_PACK_STRING(bufptr, offset, stdstring) \ -do { \ - /* pack stdstring with length */ \ - uint32 size = (stdstring).size() * sizeof(char); \ - memcpy(((char*)(bufptr)) + (offset), &size, sizeof(size)); \ - offset += sizeof(size); \ - memcpy(((char*)(bufptr)) + (offset), (stdstring).c_str(), size * sizeof(char)); \ - offset += size * sizeof(char); \ -} while (0) - -// UNPACK string -#define MSH_UNPACK_STRING(bufptr, offset, stdstring) \ -do { \ - uint32 size = 0; \ - memcpy(&size, ((char*)(bufptr)) + (offset), sizeof(size)); \ - offset += sizeof(size); \ - char stringbuf[size + 1]; \ - memcpy(stringbuf, ((char*)(bufptr)) + (offset), size * sizeof(char)); \ - stringbuf[size] = '\0'; \ - (stdstring) = string(stringbuf); /* cast to std::string */ \ - offset += size * sizeof(char); \ -} while (0) - -// SIZE bitset<...> -#define MSH_BITSET_SIZE(bset) sizeof(bset) - -// PACK bitset<...> -#define MSH_PACK_BITSET(buffer, offset, bset) \ -do { \ - memcpy(((char*)(buffer))+(offset), &(bset), sizeof(bset)); \ - offset += sizeof(bset); \ -} while(0) - -// UNPACK bitset<...> -#define MSH_UNPACK_BITSET(buffer,offset,bset) \ -do { \ - memcpy(&bset, ((char*)(buffer))+(offset), sizeof(bset)); \ - offset += sizeof(bset); \ -} while(0) - -// SIZE map<string, class_with_getSize> -#define MSH_SIZE_MAP_STRING_CLASS(sizevar, themap, datatype) \ -do { \ - sizevar = sizeof(int32); \ - map<string, datatype>::iterator iter = themap.begin(); \ - map<string, datatype>::iterator end = themap.end(); \ - while (iter != end) { \ - sizevar += MSH_STRING_SIZE(iter->first); \ - sizevar += iter->second.getSize(); \ - iter++; \ - } \ -} while (0) - - -// PACK map<string, class_with_pack> -#define MSH_PACK_MAP_STRING_CLASS(bufptr, offset, themap, datatype) \ -do { \ - int32 nrElem = themap.size(); \ - memcpy(((char*)(bufptr)) + (offset), &nrElem, sizeof(int32)); \ - offset += sizeof(int32); \ - \ - map<string, datatype>::iterator iter = themap.begin(); \ - map<string, datatype>::iterator end = themap.end(); \ - while (iter != end) { \ - MSH_PACK_STRING(bufptr, offset, iter->first); \ - offset += iter->second.pack(bufptr + offset); \ - iter++; \ - } \ -} while (0) - -// UNPACK map<string, class_with_unpack> -#define MSH_UNPACK_MAP_STRING_CLASS(bufptr, offset, themap, datatype) \ -do { \ - int32 nrElem = 0; \ - memcpy(&nrElem, ((char*)(bufptr)) + (offset), sizeof(nrElem)); \ - offset += sizeof(nrElem); \ - \ - for (int elem = 0; elem < nrElem; elem++) { \ - string elem1; \ - MSH_UNPACK_STRING(bufptr, offset, elem1); \ - offset += themap[elem1].unpack(bufptr + offset); \ - } \ -} while (0) - -// SIZE map<string, ptr2class_with_getSize> -#define MSH_SIZE_MAP_STRING_CLASSPTR(sizevar, themap, datatype) \ -do { \ - sizevar = sizeof(int32); \ - map<string, datatype*>::iterator iter = themap.begin(); \ - map<string, datatype*>::iterator end = themap.end(); \ - while (iter != end) { \ - sizevar += MSH_STRING_SIZE(iter->first); \ - sizevar += iter->second->getSize(); \ - iter++; \ - } \ -} while (0) - - -// PACK map<string, ptr2class_with_pack> -#define MSH_PACK_MAP_STRING_CLASSPTR(bufptr, offset, themap, datatype) \ -do { \ - int32 nrElem = themap.size(); \ - memcpy(((char*)(bufptr)) + (offset), &nrElem, sizeof(int32)); \ - offset += sizeof(int32); \ - \ - map<string, datatype*>::iterator iter = themap.begin(); \ - map<string, datatype*>::iterator end = themap.end(); \ - while (iter != end) { \ - MSH_PACK_STRING(bufptr, offset, iter->first); \ - offset += iter->second->pack((char*)bufptr + offset); \ - iter++; \ - } \ -} while (0) - -// UNPACK map<string, ptr2class_with_unpack> -#define MSH_UNPACK_MAP_STRING_CLASSPTR(bufptr, offset, themap, datatype) \ -do { \ - int32 nrElem = 0; \ - memcpy(&nrElem, ((char*)(bufptr)) + (offset), sizeof(nrElem)); \ - offset += sizeof(nrElem); \ - \ - for (int elem = 0; elem < nrElem; elem++) { \ - string elem1; \ - MSH_UNPACK_STRING(bufptr, offset, elem1); \ - themap[elem1] = new datatype; \ - offset += themap[elem1]->unpack((char*)bufptr + offset); \ - } \ -} while (0) - -// SIZE vector<string>> -#define MSH_SIZE_VECTOR_STRING(sizevar, thevector) \ -do { \ - sizevar = sizeof(int32); \ - vector<string>::iterator iter = thevector.begin(); \ - vector<string>::iterator end = thevector.end(); \ - while (iter != end) { \ - sizevar += MSH_STRING_SIZE(*iter); \ - iter++; \ - } \ -} while (0) - - -// PACK vector<string> -#define MSH_PACK_VECTOR_STRING(bufptr, offset, thevector) \ -do { \ - int32 nrElem = thevector.size(); \ - memcpy(((char*)(bufptr)) + (offset), &nrElem, sizeof(int32)); \ - offset += sizeof(int32); \ - \ - vector<string>::iterator iter = thevector.begin(); \ - vector<string>::iterator end = thevector.end(); \ - while (iter != end) { \ - MSH_PACK_STRING(bufptr, offset, *iter); \ - iter++; \ - } \ -} while (0) - -// UNPACK vector<string> -#define MSH_UNPACK_VECTOR_STRING(bufptr, offset, thevector) \ -do { \ - int32 nrElem = 0; \ - memcpy(&nrElem, ((char*)(bufptr)) + (offset), sizeof(nrElem)); \ - offset += sizeof(nrElem); \ - \ - for (int elem = 0; elem < nrElem; elem++) { \ - string elem1; \ - MSH_UNPACK_STRING(bufptr, offset, elem1); \ - thevector.push_back(elem1); \ - } \ -} while (0) - -// SIZE vector<double>> -#define MSH_SIZE_VECTOR_DOUBLE(sizevar, thevector) \ -do { \ - sizevar = sizeof(int32) + thevector.size() * sizeof(double); \ -} while (0) - - -// PACK vector<double> -#define MSH_PACK_VECTOR_DOUBLE(bufptr, offset, thevector) \ -do { \ - int32 nrElem = thevector.size(); \ - memcpy(((char*)(bufptr)) + (offset), &nrElem, sizeof(int32)); \ - offset += sizeof(int32); \ - \ - for (int idx=0; idx < nrElem; idx++) { \ - memcpy(((char*)(bufptr)) + (offset), &(thevector[idx]), sizeof(double)); \ - offset += sizeof(double); \ - } \ -} while (0) - -// UNPACK vector<double> -#define MSH_UNPACK_VECTOR_DOUBLE(bufptr, offset, thevector) \ -do { \ - int32 nrElem = 0; \ - memcpy(&nrElem, ((char*)(bufptr)) + (offset), sizeof(nrElem)); \ - offset += sizeof(nrElem); \ - \ - for (int elem = 0; elem < nrElem; elem++) { \ - double elem1; \ - memcpy(&elem1, ((char*)(bufptr)) + (offset), sizeof(elem1)); \ - thevector.push_back(elem1); \ - offset += sizeof(double); \ - } \ -} while (0) - -#endif /* MARSHALLING_H_ */ diff --git a/MAC/MACIO/include/MACIO/Marshalling.tcc b/MAC/MACIO/include/MACIO/Marshalling.tcc new file mode 100644 index 0000000000000000000000000000000000000000..bc6a6c75f751fe2981a6bfeee642acff966ff614 --- /dev/null +++ b/MAC/MACIO/include/MACIO/Marshalling.tcc @@ -0,0 +1,237 @@ +//# -*- mode: c++ -*- +//# +//# Marshalling.h: Macros for packing/unpacking some classes +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: Marshalling.h 19796 2012-01-17 10:06:03Z overeem $ + +#ifndef MACIO_MARSHALLING_TCC_ +#define MACIO_MARSHALLING_TCC_ + +#include <Common/LofarTypes.h> +#include <Common/lofar_bitset.h> +#include <Common/lofar_map.h> +#include <Common/lofar_string.h> +#include <Common/lofar_vector.h> +#include <boost/dynamic_bitset.hpp> +#include <sstream> + +using namespace LOFAR; + +// Basic template +template<typename T> inline size_t MSH_size(const T &tVar) +{ + return (sizeof(tVar)); +} + +template<typename T> inline void MSH_pack(char *bufPtr, size_t &offset, const T &tVar) +{ + size_t size = MSH_size(tVar); + memcpy(bufPtr + offset, &tVar, size); + offset += size; +} + +template<typename T> inline void MSH_unpack(const char *bufPtr, size_t &offset, T &tVar) +{ + size_t size = MSH_size(tVar); + memcpy(&tVar, bufPtr + offset, size); + offset += size; +} + +// Specialistion for string +template<> inline size_t MSH_size<string>(const string &tVar) +{ + return (sizeof(int32) + tVar.size() + sizeof(char)); +} + +template <> inline void MSH_pack<string>(char *bufPtr, size_t &offset, const string &tVar) +{ + int32 nrChars = tVar.size(); + memcpy(bufPtr + offset, &nrChars, sizeof(nrChars)); + offset += sizeof(nrChars); + memcpy(bufPtr + offset, tVar.data(), nrChars); + offset += nrChars; + memset(bufPtr + offset, 0, 1); + offset++; +} + +template<> inline void MSH_unpack<string>(const char *bufPtr, size_t &offset, string &tVar) +{ + int32 nrChars; + memcpy(&nrChars, bufPtr + offset, sizeof(nrChars)); + offset += sizeof(nrChars); + tVar= string(bufPtr+offset); + offset += nrChars + 1; +} + +// Specialistion for boost::dynamic_bitset +template<> inline size_t MSH_size<boost::dynamic_bitset<> >(const boost::dynamic_bitset<> &tVar) +{ + return (sizeof(int32) + tVar.size() + sizeof(char)); +} + +// Specialisation for boost::dynamic_bitset +template <> inline void MSH_pack<boost::dynamic_bitset<> >(char *bufPtr, size_t &offset, const boost::dynamic_bitset<> &tVar) +{ + int32 nrBits = tVar.size(); + memcpy(bufPtr + offset, &nrBits, sizeof(nrBits)); + offset += sizeof(nrBits); + stringstream tmpbuf(stringstream::in | stringstream::out); + tmpbuf << tVar; + memcpy(bufPtr + offset, tmpbuf.str().data(), nrBits); + offset += nrBits; + memset(bufPtr + offset, 0, 1); + offset++; +} + +template<> void inline MSH_unpack<boost::dynamic_bitset<> >(const char *bufPtr, size_t &offset, boost::dynamic_bitset<> &tVar) +{ + int32 nrBits; + memcpy(&nrBits, bufPtr + offset, sizeof(nrBits)); + offset += sizeof(nrBits); +// tVar << std::string(bufPtr+offset); + tVar = boost::dynamic_bitset<>(string(bufPtr+offset)); + offset += nrBits + 1; +} + +// basics for vector<T> +template<typename T> size_t MSH_size(const vector<T> &tVar) +{ + size_t sizevar = sizeof(int32); + typename vector<T>::const_iterator iter = tVar.begin(); + typename vector<T>::const_iterator end = tVar.end(); + while (iter != end) { + sizevar += MSH_size(*iter); + iter++; + } + return (sizevar); +} + +template<typename T> void MSH_pack(char *bufPtr, size_t &offset, const vector<T> &tVar) +{ + int32 nrElem = tVar.size(); + memcpy((char*)bufPtr + offset, &nrElem, sizeof(int32)); + offset += sizeof(int32); + + typename vector<T>::const_iterator iter = tVar.begin(); + typename vector<T>::const_iterator end = tVar.end(); + while (iter != end) { + MSH_pack(bufPtr, offset, *iter); + iter++; + } +} + +template<typename T> void MSH_unpack(const char* bufPtr, size_t &offset, vector<T> &tVar) +{ + int32 nrElem = 0; + memcpy(&nrElem, (char*)bufPtr + offset, sizeof(nrElem)); + offset += sizeof(nrElem); + + for (int elem = 0; elem < nrElem; elem++) { + T elem1; + MSH_unpack(bufPtr, offset, elem1); + tVar.push_back(elem1); + } +} + +// basics for map<string,T*> +template<typename T> size_t MSH_size(const map<string,T*> &tVar) +{ + size_t sizevar = sizeof(int32); + typename map<string,T*>::const_iterator iter = tVar.begin(); + typename map<string,T*>::const_iterator end = tVar.end(); + while (iter != end) { + sizevar += MSH_size(iter->first) + iter->second->getSize(); + iter++; + } + return (sizevar); +} + +template<typename T> void MSH_pack(char *bufPtr, size_t &offset, const map<string,T*> &tVar) +{ + int32 nrElem = tVar.size(); + memcpy((char*)bufPtr + offset, &nrElem, sizeof(int32)); + offset += sizeof(int32); + + typename map<string,T*>::const_iterator iter = tVar.begin(); + typename map<string,T*>::const_iterator end = tVar.end(); + while (iter != end) { + MSH_pack(bufPtr, offset, iter->first); + offset += iter->second->pack(bufPtr + offset); + iter++; + } +} + +template<typename T> void MSH_unpack(const char* bufPtr, size_t &offset, map<string,T*> &tVar) +{ + int32 nrElem = 0; + memcpy(&nrElem, (char*)bufPtr + offset, sizeof(nrElem)); + offset += sizeof(nrElem); + + for (int elem = 0; elem < nrElem; elem++) { + string elem1; + MSH_unpack(bufPtr, offset, elem1); + tVar[elem1] = new T; + offset += tVar[elem1]->unpack(bufPtr + offset); + } +} + +// basics for map<string,T> +template<typename T> size_t MSH_size(const map<string,T> &tVar) +{ + size_t sizevar = sizeof(int32); + typename map<string,T>::const_iterator iter = tVar.begin(); + typename map<string,T>::const_iterator end = tVar.end(); + while (iter != end) { + sizevar += MSH_size(iter->first) + iter->second.getSize(); + iter++; + } + return (sizevar); +} + +template<typename T> void MSH_pack(char *bufPtr, size_t &offset, const map<string,T> &tVar) +{ + int32 nrElem = tVar.size(); + memcpy((char*)bufPtr + offset, &nrElem, sizeof(int32)); + offset += sizeof(int32); + + typename map<string,T>::const_iterator iter = tVar.begin(); + typename map<string,T>::const_iterator end = tVar.end(); + while (iter != end) { + MSH_pack(bufPtr, offset, iter->first); + offset += iter->second.pack(bufPtr + offset); + iter++; + } +} + +template<typename T> void MSH_unpack(const char* bufPtr, size_t &offset, map<string,T> &tVar) +{ + int32 nrElem = 0; + memcpy(&nrElem, (char*)bufPtr + offset, sizeof(nrElem)); + offset += sizeof(nrElem); + + for (int elem = 0; elem < nrElem; elem++) { + string elem1; + MSH_unpack(bufPtr, offset, elem1); + offset += tVar[elem1].unpack(bufPtr + offset); + } +} + +#endif /* MARSHALLING_H_ */ diff --git a/MAC/MACIO/include/MACIO/ProtocolDefs.h b/MAC/MACIO/include/MACIO/ProtocolDefs.h index 7bc148bcc65150a95f99d185b03694de320c0144..ea155c1b8be847cc12bbc9ae5e581d153803958a 100644 --- a/MAC/MACIO/include/MACIO/ProtocolDefs.h +++ b/MAC/MACIO/include/MACIO/ProtocolDefs.h @@ -28,9 +28,18 @@ namespace LOFAR { namespace MACIO { -/** - * Macro to encode an event's signal from the signal id, protocal an in/out direction - */ +// +// +-------------------------------++-------------------------------+ +// | O | I | p | p | p | p | p | p || m | m | m | m | m | m | m | m | +// +-------------------------------++-------------------------------+ +// +// O : out going message +// I : incoming message +// p : protocol number (0..63) +// m : messagenumber (0..255) +// + +// Macro to encode an event's signal from the signal id, protocal an in/out direction #define F_SIGNAL(prot, sig, inout) ( (((unsigned short)(inout) & 0x3) << 14) \ | (((unsigned short)(prot) & 0x3f) << 8) \ | ((unsigned short)(sig) & 0xff) \ @@ -41,9 +50,7 @@ namespace LOFAR { #define F_ERR_PROTOCOL(errID) ( ((unsigned short)(errID) / 100) & 0x3f ) #define F_ERR_NR(errID) ( (unsigned short)(errID) % 100 ) -/** - * Define different types of signals - */ +// Define different types of signals #define F_IN 0x01 #define F_OUT 0x02 #define F_INOUT (F_IN | F_OUT) diff --git a/MAC/MACIO/include/MACIO/StringVector.h b/MAC/MACIO/include/MACIO/StringVector.h index 09c8942a7d663209377c4fa9cc9abc78ead151d8..1b2d5634e7590d2f5936ed7ae5a41c849ac98299 100644 --- a/MAC/MACIO/include/MACIO/StringVector.h +++ b/MAC/MACIO/include/MACIO/StringVector.h @@ -30,8 +30,8 @@ //# Includes #include <Common/lofar_string.h> #include <Common/lofar_vector.h> +#include <MACIO/Marshalling.tcc> #include <Common/StreamUtil.h> -#include <MACIO/Marshalling.h> // Avoid 'using namespace' in headerfiles @@ -49,9 +49,9 @@ public: StringVector() {}; ~StringVector() {}; - unsigned int getSize(); - unsigned int pack (void *buffer); - unsigned int unpack(void *buffer); + size_t getSize() const; + size_t pack (char *buffer) const; + size_t unpack(char *buffer); ostream& print (ostream& os) const; vector<string>& operator()() @@ -66,26 +66,24 @@ private: // @} // getSize() -inline unsigned int StringVector::getSize() +inline size_t StringVector::getSize() const { - unsigned int offset = 0; - MSH_SIZE_VECTOR_STRING(offset, theVector); - return (offset); + return (MSH_size(theVector)); } // pack() -inline unsigned int StringVector::pack(void *buffer) +inline size_t StringVector::pack(char *buffer) const { - unsigned int offset = 0; - MSH_PACK_VECTOR_STRING(buffer, offset, theVector); + size_t offset = 0; + MSH_pack(buffer, offset, theVector); return (offset); } // unpack() -inline unsigned int StringVector::unpack(void *buffer) +inline size_t StringVector::unpack(char *buffer) { - unsigned int offset = 0; - MSH_UNPACK_VECTOR_STRING(buffer, offset, theVector); + size_t offset = 0; + MSH_unpack(buffer, offset, theVector); return (offset); } diff --git a/MAC/MACIO/test/tMarshalling.cc b/MAC/MACIO/test/tMarshalling.cc index 6742cd644c5b8d777d1b33acafa5b10ca1bbdf89..c9d5b748b3518fcdd3a7deb41da70962dc407355 100644 --- a/MAC/MACIO/test/tMarshalling.cc +++ b/MAC/MACIO/test/tMarshalling.cc @@ -29,11 +29,12 @@ #include <Common/lofar_map.h> #include <Common/lofar_vector.h> #include <Common/hexdump.h> -#include <MACIO/Marshalling.h> +#include <MACIO/Marshalling.tcc> #include "tMarshalling.h" using namespace LOFAR; +using namespace std; namespace LOFAR { @@ -42,28 +43,28 @@ SubArray::SubArray(int i, double d, string s) : { } -unsigned int SubArray::getSize() { - return (sizeof(int) + sizeof(double) + MSH_STRING_SIZE(someString)); +size_t SubArray::getSize() const { + return (sizeof(int) + sizeof(double) + MSH_size(someString)); } -unsigned int SubArray::pack(void* buffer) { - unsigned int offset = 0; - memcpy(((char*)(buffer)+offset), &someInt, sizeof(int)); +size_t SubArray::pack(char* buffer) const { + size_t offset = 0; + memcpy(buffer+offset, &someInt, sizeof(int)); offset += sizeof (int); - memcpy(((char*)(buffer)+offset), &someDouble, sizeof(double)); + memcpy(buffer+offset, &someDouble, sizeof(double)); offset += sizeof (double); - MSH_PACK_STRING(buffer, offset, someString); + MSH_pack(buffer, offset, someString); return (offset); } -unsigned int SubArray::unpack(void* buffer) { - unsigned int offset = 0; - memcpy(&someInt, ((char*)(buffer))+offset, sizeof(int)); +size_t SubArray::unpack(const char* buffer) { + size_t offset = 0; + memcpy(&someInt, buffer+offset, sizeof(int)); offset += sizeof(int); - memcpy(&someDouble, ((char*)(buffer))+offset, sizeof(double)); + memcpy(&someDouble, buffer+offset, sizeof(double)); offset += sizeof(double); - MSH_UNPACK_STRING(buffer, offset, someString); + MSH_unpack(buffer, offset, someString); return (offset); } @@ -72,28 +73,28 @@ SubArrayNC::SubArrayNC(int i, double d, string s) : { } -unsigned int SubArrayNC::getSize() { - return (sizeof(int) + sizeof(double) + MSH_STRING_SIZE(someString)); +size_t SubArrayNC::getSize() const { + return (sizeof(int) + sizeof(double) + MSH_size(someString)); } -unsigned int SubArrayNC::pack(void* buffer) { - unsigned int offset = 0; - memcpy(((char*)(buffer)+offset), &someInt, sizeof(int)); +size_t SubArrayNC::pack(char* buffer) const { + size_t offset = 0; + memcpy(buffer+offset, &someInt, sizeof(int)); offset += sizeof (int); - memcpy(((char*)(buffer)+offset), &someDouble, sizeof(double)); + memcpy(buffer+offset, &someDouble, sizeof(double)); offset += sizeof (double); - MSH_PACK_STRING(buffer, offset, someString); + MSH_pack(buffer, offset, someString); return (offset); } -unsigned int SubArrayNC::unpack(void* buffer) { - unsigned int offset = 0; - memcpy(&someInt, ((char*)(buffer))+offset, sizeof(int)); +size_t SubArrayNC::unpack(const char* buffer) { + size_t offset = 0; + memcpy(&someInt, buffer+offset, sizeof(int)); offset += sizeof(int); - memcpy(&someDouble, ((char*)(buffer))+offset, sizeof(double)); + memcpy(&someDouble, buffer+offset, sizeof(double)); offset += sizeof(double); - MSH_UNPACK_STRING(buffer, offset, someString); + MSH_unpack(buffer, offset, someString); return (offset); } @@ -105,51 +106,80 @@ int main (int /*argc*/, char** /*argv[]*/) // string test string tstString("Dit is een teststring"); cout << "Testing string: " << tstString << endl; - - cout << "size = " << MSH_STRING_SIZE(tstString) << endl; + cout << "size = " << MSH_size(tstString) << endl; char buf[4096]; - int32 offset(0); - MSH_PACK_STRING(buf, offset, tstString); + size_t offset1(0); + MSH_pack(buf, offset1, tstString); cout << "packed: " << endl; - hexdump(buf, offset); + hexdump(buf, offset1); string newString; - offset = 0; - MSH_UNPACK_STRING(buf, offset, newString); + size_t offset2(0); + MSH_unpack(buf, offset2, newString); cout << "unpacked: " << newString << endl; + ASSERTSTR (offset1 == offset2 && tstString == newString, "Failure 1 in strings"); + - // bitmap test1 - bitset<32> bs1; + // bitset test1 + LOFAR::bitset<35> bs1; bs1.reset(); bs1.set(0); bs1.set(5); bs1.set(20); - cout << "Testing bitset<32>" << bs1 << endl; - - cout << "size = " << MSH_BITSET_SIZE(bs1) << endl; + cout << "Testing bitset<35>: " << bs1 << endl; + cout << "size = " << MSH_size(bs1) << endl; bzero(buf, 4096); - offset = 0; - MSH_PACK_BITSET(buf, offset, bs1); + offset1 = 0; + MSH_pack(buf, offset1, bs1); cout << "packed:" << endl; - hexdump(buf, offset); + hexdump(buf, offset1); - bitset<32> bs2; - offset = 0; - MSH_UNPACK_BITSET(buf, offset, bs2); + LOFAR::bitset<35> bs2; + offset2 = 0; + MSH_unpack(buf, offset2, bs2); + cout << "size = " << offset2 << endl; cout << "unpacked: " << bs2 << endl; + ASSERTSTR (offset1 == offset2, "Failure in offset var of bitsets"); + ASSERTSTR (bs1 == bs2, "Failure in bitsets"); + + + // dynamic bitmap + boost::dynamic_bitset<> dbs1(25); + dbs1.set(0); + dbs1.set(5); + dbs1.set(6); + dbs1.set(20); + cout << "Testing dynamic_bitset<25>" << endl << dbs1 << endl; + cout << "size = " << MSH_size(dbs1) << endl; + + bzero(buf, 4096); + offset1 = 0; + MSH_pack(&buf[0], offset1, dbs1); + cout << "packed:" << endl; + hexdump(buf, offset1); + + boost::dynamic_bitset<> dbs2; + offset2 = 0; + MSH_unpack(&buf[0], offset2, dbs2); + cout << "unpacked: " << dbs2 << endl; + cout << "size = " << dbs2.size() << endl; + cout << "offset1 = " << offset1 << endl; + cout << "offset2 = " << offset2 << endl; + ASSERTSTR (offset1 == offset2 && dbs1 == dbs2, "Failure in dynamic bitsets"); + // SubArray SubArray SA1(25, 3.14, "stringetje"); cout << "Testing SubArray class:" << SA1.someInt << "," << SA1.someDouble << "," << SA1.someString << endl; - unsigned int size(SA1.getSize()); + size_t size(SA1.getSize()); cout << "size = " << size << endl; bzero(buf, 4096); - offset = 0; + size_t offset = 0; SA1.pack(buf); cout << "packed:" << endl; hexdump(buf, size); @@ -161,6 +191,7 @@ int main (int /*argc*/, char** /*argv[]*/) << "," << SA2.someString << endl; + // map<string, subArray> map<string, SubArray> ms1; ms1["eerste_item"] = SubArray(25, 3.14, "stringetje"); @@ -174,19 +205,21 @@ int main (int /*argc*/, char** /*argv[]*/) iter++; } - unsigned int mapsize; - MSH_SIZE_MAP_STRING_CLASS(mapsize, ms1, SubArray); + size_t mapsize; + mapsize = MSH_size(ms1); +// MSH_SIZE_MAP_STRING_CLASS(mapsize, ms1, SubArray); cout << "size = " << mapsize << endl; bzero(buf, 4096); offset = 0; - MSH_PACK_MAP_STRING_CLASS(buf, offset, ms1, SubArray); + MSH_pack(buf, offset, ms1); +// MSH_PACK_MAP_STRING_CLASS(buf, offset, ms1, SubArray); cout << "packed:" << endl; hexdump(buf, mapsize); map<string, SubArray> ms2; offset = 0; - MSH_UNPACK_MAP_STRING_CLASS(buf, offset, ms2, SubArray); + MSH_unpack(buf, offset, ms2); cout << "Unpacked map<string, SubArray>: " << endl; map<string, SubArray>::iterator iter2 = ms2.begin(); map<string, SubArray>::iterator end2 = ms2.end(); @@ -210,19 +243,19 @@ int main (int /*argc*/, char** /*argv[]*/) iternc++; } - unsigned int mapncsize; - MSH_SIZE_MAP_STRING_CLASSPTR(mapncsize, msanc1, SubArrayNC); + size_t mapncsize; + mapncsize = MSH_size(msanc1); cout << "size = " << mapncsize << endl; bzero(buf, 4096); offset = 0; - MSH_PACK_MAP_STRING_CLASSPTR(buf, offset, msanc1, SubArrayNC); + MSH_pack(buf, offset, msanc1); cout << "packed:" << endl; hexdump(buf, mapncsize); map<string, SubArrayNC*> msanc2; offset = 0; - MSH_UNPACK_MAP_STRING_CLASSPTR(buf, offset, msanc2, SubArrayNC); + MSH_unpack(buf, offset, msanc2); cout << "Unpacked map<string, SubArrayNC*>: " << endl; iternc = msanc2.begin(); endnc = msanc2.end(); @@ -248,19 +281,19 @@ int main (int /*argc*/, char** /*argv[]*/) itersv++; } - unsigned int svsize; - MSH_SIZE_VECTOR_STRING(svsize, sv1); + size_t svsize; + svsize = MSH_size(sv1); cout << "size = " << svsize << endl; bzero(buf, 4096); - offset = 0; - MSH_PACK_VECTOR_STRING(buf, offset, sv1); + offset1 = 0; + MSH_pack(buf, offset1, sv1); cout << "packed:" << endl; hexdump(buf, svsize); vector<string> sv2; - offset = 0; - MSH_UNPACK_VECTOR_STRING(buf, offset, sv2); + offset2 = 0; + MSH_unpack(buf, offset2, sv2); cout << "Unpacked vector<string>" << endl; itersv = sv2.begin(); endsv = sv2.end(); @@ -270,6 +303,8 @@ int main (int /*argc*/, char** /*argv[]*/) i++; itersv++; } + ASSERTSTR (offset1 == offset2 && sv1 == sv2, "Failure in vector<string>"); + // vector<double> vector<double> dv1; @@ -286,19 +321,19 @@ int main (int /*argc*/, char** /*argv[]*/) iterdv++; } - unsigned int dvsize; - MSH_SIZE_VECTOR_DOUBLE(dvsize, dv1); + size_t dvsize; + dvsize = MSH_size(dv1); cout << "size = " << dvsize << endl; bzero(buf, 4096); offset = 0; - MSH_PACK_VECTOR_DOUBLE(buf, offset, dv1); + MSH_pack(buf, offset, dv1); cout << "packed:" << endl; hexdump(buf, dvsize); vector<double> dv2; offset = 0; - MSH_UNPACK_VECTOR_DOUBLE(buf, offset, dv2); + MSH_unpack(buf, offset, dv2); cout << "Unpacked vector<double>" << endl; iterdv = dv2.begin(); enddv = dv2.end(); @@ -308,6 +343,5 @@ int main (int /*argc*/, char** /*argv[]*/) i++; iterdv++; } - - return (0); + ASSERTSTR (offset1 == offset2 && dv1 == dv2, "Failure in vector<double>"); } diff --git a/MAC/MACIO/test/tMarshalling.h b/MAC/MACIO/test/tMarshalling.h index c8acab445f96fda48fe5fbf85c2c91356da0bbdb..89ff7e5cb46a629c6b5a311c242b1d4ce74e961d 100644 --- a/MAC/MACIO/test/tMarshalling.h +++ b/MAC/MACIO/test/tMarshalling.h @@ -18,7 +18,7 @@ //# along with this program; if not, write to the Free Software //# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //# -//# $Id$ +//# $Id: tMarshalling.h 11023 2008-03-18 08:07:14Z overeem $ #ifndef RTC_TMARSHALLING_H #define RTC_TMARSHALLING_H @@ -51,9 +51,9 @@ public: SubArray(int i, double d, string s); SubArray() {}; - unsigned int getSize(); - unsigned int pack(void* buffer); - unsigned int unpack(void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); }; class SubArrayNC @@ -65,9 +65,9 @@ public: SubArrayNC(int i, double d, string s); SubArrayNC() {}; - unsigned int getSize(); - unsigned int pack(void* buffer); - unsigned int unpack(void* buffer); + size_t getSize() const; + size_t pack (char* buffer) const; + size_t unpack(const char *buffer); private: // prevent copy SubArrayNC(const SubArrayNC&); diff --git a/MAC/Navigator2/panels/Hardware/CEP.pnl b/MAC/Navigator2/panels/Hardware/CEP.pnl index 1f5a9caca46651208935ab55c7de31c735f29c76..e082a0a7a6b3391471f525d52377d05a721a43b1 100644 --- a/MAC/Navigator2/panels/Hardware/CEP.pnl +++ b/MAC/Navigator2/panels/Hardware/CEP.pnl @@ -19,7 +19,6 @@ void prepareHardwareList() { // For this panel CEP should be selectable so we get them for the treelist dynAppend(g_stationList,navFunct_bareDBName(sysName)); - DebugN(\"g_stat: \"+g_stationList); // For this panel BGPRacks and BGPMidplanes should be selectable so we get them for the treelist // BGPRacks first @@ -49,8 +48,6 @@ void prepareHardwareList() { dynAppend(g_BGPRackList,b); } } - DebugN(\"bgp: \"+g_BGPRackList); - DebugN(\"mid: \"+g_BGPMidplaneList); // For this panel OSRacks and OSSubclusters should be selectable so we get them for the treelist // OSRacks first diff --git a/MAC/Navigator2/panels/Hardware/CEP_BGPRack_detailed.pnl b/MAC/Navigator2/panels/Hardware/CEP_BGPRack_detailed.pnl index e32a6e5e91577b66e6a8785966bfe2ef9696d752..af049719bb7773c8bb69296f9e81be5a8b16f931 100644 --- a/MAC/Navigator2/panels/Hardware/CEP_BGPRack_detailed.pnl +++ b/MAC/Navigator2/panels/Hardware/CEP_BGPRack_detailed.pnl @@ -16,8 +16,8 @@ PANEL,-1 -1 1011 662 N "_3DFace" 0 setValue(\"selfState.light\",\"toolTipText\",baseDP); if(dpExists(baseDP + \".BGPSwitch\")) { - dpConnect(\"controlBGP\", baseDP + \".bgpSwitch:_online.._value\", - baseDP + \".bgpSwitch:_online.._invalid\"); + dpConnect(\"controlBGP\", baseDP + \".BGPSwitch:_online.._value\", + baseDP + \".BGPSwitch:_online.._invalid\"); if (!navFunct_dpReachable(baseDP)) { controlIOnode(\"\",false,\"\",true); } @@ -234,4 +234,4 @@ LANG:1 6 Layer8 "objects\\Hardware\\CEP_Midplane_small.pnl" 408 540 T 88 1 0 1 5 -6 1 "$BGPMidplaneNr""0" -0 +0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/Hardware/CEP_IONode.pnl b/MAC/Navigator2/panels/Hardware/CEP_IONode.pnl new file mode 100644 index 0000000000000000000000000000000000000000..efea0504f6dbeea5bef9275743b1592a4a9b55aa --- /dev/null +++ b/MAC/Navigator2/panels/Hardware/CEP_IONode.pnl @@ -0,0 +1,784 @@ +V 11 +1 +LANG:1 10 CEP_IONode +PANEL,-1 -1 1011 745 N "_3DFace" 0 +"main() +{ + // Initialise the Panel + navPanel_initPanel(\"fw_viewBox\"); + + baseDP = g_currentDatapoint; + + dyn_string dpAr= strsplit(dpSubStr(g_currentDatapoint,DPSUB_DP),\"_\"); + if (strpos(dpAr[dynlen(dpAr)],\"IONode\") > -1) { + ioNr = substr(dpAr[dynlen(dpAr)],6,strlen(dpAr[dynlen(dpAr)])); + } else { + LOG_ERROR(\"CEP_IONode.pnl:Initialize|No IONode found in currentDatapoint.\"); + } + + + if(dpExists(baseDP + \".usedStation\")) { + dpConnect(\"controlIOnode\", baseDP + \".station0:_online.._value\", + baseDP + \".IP0:_online.._value\", + baseDP + \".MAC0:_online.._value\", + baseDP + \".station1:_online.._value\", + baseDP + \".IP1:_online.._value\", + baseDP + \".MAC1:_online.._value\", + baseDP + \".MACForeign:_online.._value\", + baseDP + \".usedStation:_online.._value\", + baseDP + \".usedIP:_online.._value\", + baseDP + \".usedMAC:_online.._value\", + baseDP + \".use2ndStation:_online.._value\", + CEPDBName + \"LOFAR_PIC_BGP.BGPSwitch:_online.._value\", + baseDP + \".usedStation:_online.._invalid\"); + if (!navFunct_dpReachable(baseDP)) { + controlIOnode(\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",true); + } + } + + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + + // connect for selfUpdates + showSelfState(baseDP); + + reload(); +} + +void controlIOnode(string dp1, string station0, + string dp2, string ipAddress0, + string dp3, string macAddress0, + string dp4, string station1, + string dp5, string ipAddress1, + string dp6, string macAddress1, + string dp7, string macForeign, + string dp8, string station, + string dp9, string ipAddress, + string dp10, string macAddress, + string dp11, bool use2ndStation, + string dp12, bool bgpSwitch, + string dp13, bool invalid) { + + string nodeName = navFunct_DPName2CEPName(baseDP); + setValue(\"nodeName\",\"text\",\"Node: \"+nodeName); + + if (!invalid) { + setValue(\"ip0_text\",\"text\",ipAddress0); + setValue(\"mac0_text\",\"text\",macAddress0); + setValue(\"station0_text\",\"text\",station0); + setValue(\"ip1_text\",\"text\",ipAddress1); + setValue(\"mac1_text\",\"text\",macAddress1); + setValue(\"macForeign0_text\",\"text\",macForeign); + setValue(\"macForeign1_text\",\"text\",macForeign); + setValue(\"station1_text\",\"text\",station1); + setValue(\"ip_text\",\"text\",ipAddress); + setValue(\"mac_text\",\"text\",macAddress); + setValue(\"station_text\",\"text\",station); + if (bgpSwitch) { + BGPline0.visible(false); + BGPline1.visible(true); + } else { + BGPline0.visible(true); + BGPline1.visible(false); + } + } else { + setValue(\"ip0_text\",\"text\",\"???????\"); + setValue(\"mac0_text\",\"text\",\"???????\"); + setValue(\"station0_text\",\"text\",\"?????\"); + setValue(\"ip1_text\",\"text\",\"???????\"); + setValue(\"mac1_text\",\"text\",\"???????\"); + setValue(\"macForeign0_text\",\"text\",\"???????\"); + setValue(\"macForeign1_text\",\"text\",\"???????\"); + setValue(\"station1_text\",\"text\",\"?????\"); + setValue(\"ip_text\",\"text\",\"???????\"); + setValue(\"mac_text\",\"text\",\"???????\"); + setValue(\"station_text\",\"text\",\"?????\"); + BGPline0.visible(false); + BGPline1.visible(false); + } +} + +void prepareHardwareList() { + // set the hardware selectable items + dynAppend(g_stationList,navFunct_bareDBName(sysName)); + dynAppend(g_IONodeList,ioNr); + +} + +// +// Callback for dpConnect to action point. +// If there is an action required this point will tell so +// +void doAction(string aDP, string anAction) { + LOG_DEBUG(\"CEP_IONode.pnl:doAction| Action required. found: \" + anAction); + // split action into essentials + dyn_string actionString; + if (!navFunct_splitAction(anAction,actionString)) { + return; + } + + LOG_DEBUG(\"CEP_IONode.pnl:doAction|found actionString: \" + actionString); + + // Reload + if (actionString[1] == \"Reload\") { + reload(); + } else if (actionString[1] == \"DistChanged\") { + // for dist system bound hardware only, if the distsystem went offline we need to replace + // the screen with a broken connection screen. + if (!g_initializing) { + + // check if this syst is in the connectionlist and down + int iPos=dynContains(g_connections[\"NAME\"],sysName); + if (iPos > 0) { + if (!g_connections[\"UP\"][iPos]) { + navPanel_setEvent(\"invalid DP\",\"ChangePanel\"); + } + } + } + return; + } +} + +void reload() { + + navFunct_clearGlobalLists(); + + // set the hardware selectable items for this screen + prepareHardwareList(); + + // set panel to ready + g_objectReady=true; + + + // trigger that the panel values are calculated and ready + navPanel_setEvent(\"CEP_IONode.pnl\",\"Update\"); + +} +" 0 + E E E E 1 -1 -1 0 188 128 +""0 1 +E "#uses \"navPanel.ctl\" +string baseDP = \"\"; +int ioNr = -1; + +" 0 + 2 +"CBRef" "1" +"EClose" E +"" +1 +DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 +LAYER, 0 +1 +LANG:1 6 Layer1 +6 658 +"childStateBorder" +"" +1 500 80 E E E 1 E 1 E N {0,0,0} E N "_3DFace" E E + E E +77 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 3 1 2 1 E 1.723518850987432 0 0.5840455840455839 -181.6517055655296 118.3190883190883 1 E 117 20 674 722 +2 917 +"nodeName" +"" +1 350 100 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(); +}" 0 + "main() +{ + dblClick(); +}" 0 + +78 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E "main() +{ + click(); +}" 0 + 0 1 1 2 1 E U 1 E 350 100 567 124 +0 2 2 "0s" 0 0 0 192 0 0 350 100 1 +1 +LANG:1 33 MS Shell Dlg,14,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 20 Node: R00-M0-N00-J00 +1 954 1 "" 1 +0 +2 919 +"PRIMITIVE_TEXT1" +"" +1 82 172 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +80 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 82 172 279 191 +0 2 2 "0s" 0 0 0 192 0 0 82 172 1 +1 +LANG:1 35 MS Shell Dlg 2,12,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 24 Possible Configurations: +2 920 +"PRIMITIVE_TEXT2" +"" +1 600 160 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +81 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 600 160 781 179 +0 2 2 "0s" 0 0 0 192 0 0 600 160 1 +1 +LANG:1 35 MS Shell Dlg 2,12,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 21 Chosen Configuration: +6 921 +"RECTANGLE1" +"" +1 130 200 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E + E E +82 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 0.9310344827586207 0 0.8 -59.03448275862068 51.99999999999999 1 E 130 200 420 360 +2 922 +"PRIMITIVE_TEXT3" +"" +1 72 252 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +83 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 72 252 90 268 +0 2 2 "0s" 0 0 0 192 0 0 72 252 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 3 Ip: +2 923 +"PRIMITIVE_TEXT4" +"" +1 72 222 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +84 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 72 222 124 238 +0 2 2 "0s" 0 0 0 192 0 0 72 222 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 8 Station: +2 924 +"PRIMITIVE_TEXT5" +"" +1 72 282 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +85 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 72 282 103 298 +0 2 2 "0s" 0 0 0 192 0 0 72 282 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 4 Mac: +14 925 +"station0_text" +"" +1 162 219 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +86 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 160 217 314 240 +2 "0s" 0 0 0 0 0 -1 E E E +14 926 +"ip0_text" +"" +1 162 249 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +87 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 160 247 314 270 +2 "0s" 0 0 0 0 0 -1 E E E +14 927 +"mac0_text" +"" +1 162 279 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +88 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 160 277 314 300 +2 "0s" 0 0 0 0 0 -1 E E E +2 928 +"PRIMITIVE_TEXT6" +"" +1 32 252 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +89 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 32 252 42 275 +0 2 2 "0s" 0 0 0 192 0 0 32 252 1 +1 +LANG:1 35 MS Shell Dlg 2,14,-1,5,50,0,0,0,0,0 +0 1 +LANG:1 1 0 +6 929 +"RECTANGLE2" +"" +1 130 200 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E + E E +90 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 0.9310344827586207 0 0.8125 -59.03448275862068 227.5 1 E 130 200 420 360 +2 930 +"PRIMITIVE_TEXT7" +"" +1 72 430 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +91 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 72 430 90 446 +0 2 2 "0s" 0 0 0 192 0 0 72 430 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 3 Ip: +2 931 +"PRIMITIVE_TEXT8" +"" +1 72 400 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +92 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 72 400 124 416 +0 2 2 "0s" 0 0 0 192 0 0 72 400 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 8 Station: +2 932 +"PRIMITIVE_TEXT9" +"" +1 72 460 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +93 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 72 460 103 476 +0 2 2 "0s" 0 0 0 192 0 0 72 460 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 4 Mac: +14 933 +"station1_text" +"" +1 162 400 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +94 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 160 398 314 421 +2 "0s" 0 0 0 0 0 -1 E E E +14 934 +"ip1_text" +"" +1 162 430 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +95 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 160 428 314 451 +2 "0s" 0 0 0 0 0 -1 E E E +14 935 +"mac1_text" +"" +1 162 460 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +96 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 160 458 314 481 +2 "0s" 0 0 0 0 0 -1 E E E +2 936 +"PRIMITIVE_TEXT10" +"" +1 32 430 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +97 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 32 430 42 453 +0 2 2 "0s" 0 0 0 192 0 0 32 430 1 +1 +LANG:1 35 MS Shell Dlg 2,14,-1,5,50,0,0,0,0,0 +0 1 +LANG:1 1 1 +6 937 +"RECTANGLE3" +"" +1 130 200 E E E 0 E 1 E N {0,0,0} E N "_Transparent" E E + E E +98 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 0.9310344827586207 0 0.625 558.9655172413793 185 1 E 130 200 420 360 +2 938 +"PRIMITIVE_TEXT11" +"" +1 690 350 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +99 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 690 350 708 366 +0 2 2 "0s" 0 0 0 192 0 0 690 350 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 3 Ip: +2 939 +"PRIMITIVE_TEXT12" +"" +1 690 320 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +100 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 690 320 742 336 +0 2 2 "0s" 0 0 0 192 0 0 690 320 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 8 Station: +2 940 +"PRIMITIVE_TEXT13" +"" +1 690 380 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +101 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 690 380 721 396 +0 2 2 "0s" 0 0 0 192 0 0 690 380 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 4 Mac: +14 941 +"station_text" +"" +1 780 317 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +102 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 778 315 932 338 +2 "0s" 0 0 0 0 0 -1 E E E +14 942 +"ip_text" +"" +1 780 347 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +103 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 778 345 932 368 +2 "0s" 0 0 0 0 0 -1 E E E +14 943 +"mac_text" +"" +1 780 377 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +104 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 778 375 932 398 +2 "0s" 0 0 0 0 0 -1 E E E +4 945 +"BGPline0" +"" +1 350 280 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E + E E +106 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 3 1 2 1 E 350 280 660 360 +4 948 +"BGPline1" +"" +1 350.0000000000001 460 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E + E E +109 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 3 1 2 1 E 350 460 660 360 +2 950 +"PRIMITIVE_TEXT14" +"" +1 72 313 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +110 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 72 313 124 329 +0 2 2 "0s" 0 0 0 192 0 0 72 313 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 8 Foreign: +14 951 +"macForeign0_text" +"" +1 162 310 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +111 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 160 308 314 331 +2 "0s" 0 0 0 0 0 -1 E E E +2 952 +"PRIMITIVE_TEXT15" +"" +1 72 493 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +112 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 72 493 124 509 +0 2 2 "0s" 0 0 0 192 0 0 72 493 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 8 Foreign: +14 953 +"macForeign1_text" +"" +1 162 490 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +113 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 +0 160 488 314 511 +2 "0s" 0 0 0 0 0 -1 E E E +0 +LAYER, 1 +1 +LANG:1 6 Layer2 +0 +LAYER, 2 +1 +LANG:1 6 Layer3 +0 +LAYER, 3 +1 +LANG:1 6 Layer4 +0 +LAYER, 4 +1 +LANG:1 6 Layer5 +0 +LAYER, 5 +1 +LANG:1 6 Layer6 +0 +LAYER, 6 +1 +LANG:1 6 Layer7 +0 +LAYER, 7 +1 +LANG:1 6 Layer8 +0 +3 1 "selfState" -1 +"objects\\lofar_self_state.pnl" 7 8 T 79 1 0 1 50 130 +0 +0 diff --git a/MAC/Navigator2/panels/Hardware/CEP_Midplane.pnl b/MAC/Navigator2/panels/Hardware/CEP_Midplane.pnl index 989b602eb6224faa4880d2a7d774c440b84b2617..709a7921c66b947cef76b37d979d094239bfc2d0 100644 --- a/MAC/Navigator2/panels/Hardware/CEP_Midplane.pnl +++ b/MAC/Navigator2/panels/Hardware/CEP_Midplane.pnl @@ -1,4 +1,4 @@ -V 10 +V 11 1 LANG:1 7 Station PANEL,-1 -1 1011 745 N "_3DFace" 0 @@ -679,135 +679,135 @@ LAYER, 7 1 LANG:1 6 Layer8 0 -3 3 "PANEL_REF4" +3 3 "PANEL_REF4" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 30 T 13 1 0 1 61 6.00000000000016 1 "$nodeNr""31" -3 4 "PANEL_REF5" +3 4 "PANEL_REF5" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 50 T 14 1 0 1 61 7.00000000000016 1 "$nodeNr""30" -3 5 "PANEL_REF6" +3 5 "PANEL_REF6" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 70 T 15 1 0 1 61 8.00000000000016 1 "$nodeNr""29" -3 6 "PANEL_REF7" +3 6 "PANEL_REF7" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 90 T 16 1 0 1 61 9.00000000000016 1 "$nodeNr""28" -3 7 "PANEL_REF8" +3 7 "PANEL_REF8" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 110 T 17 1 0 1 61 10.00000000000016 1 "$nodeNr""27" -3 8 "PANEL_REF9" +3 8 "PANEL_REF9" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 140 T 18 1 0 1 61 1.00000000000016 1 "$nodeNr""26" -3 9 "PANEL_REF10" +3 9 "PANEL_REF10" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 160 T 19 1 0 1 61 2.00000000000016 1 "$nodeNr""25" -3 10 "PANEL_REF11" +3 10 "PANEL_REF11" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 180 T 20 1 0 1 61 3.00000000000016 1 "$nodeNr""24" -3 11 "PANEL_REF12" +3 11 "PANEL_REF12" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 200 T 21 1 0 1 61 4.00000000000016 1 "$nodeNr""23" -3 12 "PANEL_REF13" +3 12 "PANEL_REF13" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 220 T 22 1 0 1 61 5.00000000000016 1 "$nodeNr""22" -3 13 "PANEL_REF14" +3 13 "PANEL_REF14" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 30 T 23 1 0 1 61 216.0000000000001 1 "$nodeNr""21" -3 14 "PANEL_REF15" +3 14 "PANEL_REF15" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 220 T 24 1.003584229390681 0 1 60.67741935483869 47.00000000000016 1 "$nodeNr""20" -3 15 "PANEL_REF16" +3 15 "PANEL_REF16" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 70 T 25 1 0 1 61 218.0000000000001 1 "$nodeNr""19" -3 16 "PANEL_REF17" +3 16 "PANEL_REF17" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 90 T 26 1 0 1 61 219.0000000000001 1 "$nodeNr""18" -3 17 "PANEL_REF18" +3 17 "PANEL_REF18" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 110 T 27 1 0 1 61 220.0000000000001 1 "$nodeNr""17" -3 18 "PANEL_REF19" +3 18 "PANEL_REF19" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 140 T 28 1 0 1 61 211.0000000000001 1 "$nodeNr""16" -3 19 "PANEL_REF20" +3 19 "PANEL_REF20" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 160 T 29 1 0 1 61 212.0000000000001 1 "$nodeNr""15" -3 20 "PANEL_REF21" +3 20 "PANEL_REF21" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 180 T 30 1 0 1 61 213.0000000000001 1 "$nodeNr""14" -3 21 "PANEL_REF22" +3 21 "PANEL_REF22" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 200 T 31 1 0 1 61 214.0000000000001 1 "$nodeNr""13" -3 22 "PANEL_REF23" +3 22 "PANEL_REF23" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 220 T 32 1 0 1 61 215.0000000000001 1 "$nodeNr""12" -3 23 "PANEL_REF24" +3 23 "PANEL_REF24" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 220 T 33 1 0 1 61 257.0000000000002 1 "$nodeNr""10" -3 24 "PANEL_REF25" +3 24 "PANEL_REF25" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 30 T 34 1 0 1 61 426.0000000000002 1 "$nodeNr""11" -3 25 "PANEL_REF26" +3 25 "PANEL_REF26" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 70 T 35 1 0 1 61 428.0000000000002 1 "$nodeNr""9" -3 26 "PANEL_REF27" +3 26 "PANEL_REF27" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 90 T 36 1 0 1 61 429.0000000000002 1 "$nodeNr""8" -3 27 "PANEL_REF28" +3 27 "PANEL_REF28" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 110 T 37 1 0 1 61 430.0000000000002 1 "$nodeNr""7" -3 28 "PANEL_REF29" +3 28 "PANEL_REF29" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 140 T 38 1 0 1 61 421.0000000000002 1 "$nodeNr""6" -3 29 "PANEL_REF30" +3 29 "PANEL_REF30" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 160 T 39 1 0 1 61 422.0000000000002 1 "$nodeNr""5" -3 30 "PANEL_REF31" +3 30 "PANEL_REF31" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 180 T 40 1 0 1 61 423.0000000000002 1 "$nodeNr""4" -3 31 "PANEL_REF32" +3 31 "PANEL_REF32" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 200 T 41 1 0 1 61 424.0000000000002 1 "$nodeNr""3" -3 32 "PANEL_REF33" +3 32 "PANEL_REF33" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 220 T 42 1 0 1 61 425.0000000000002 1 "$nodeNr""2" -3 33 "PANEL_REF34" +3 33 "PANEL_REF34" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 220 T 43 1 0 1 61 467.0000000000002 1 "$nodeNr""0" -3 34 "PANEL_REF35" +3 34 "PANEL_REF35" -1 "objects\\Hardware\\CEP_IONode_small.pnl" 90 30 T 44 1 0 1 61 636.0000000000001 1 "$nodeNr""1" -3 69 "PANEL_REF70" +3 69 "PANEL_REF70" -1 "objects\\Hardware\\midplane_small.pnl" 360 20 T 78 1 0 1 -98 -8.000000000000043 0 -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/Hardware/LOFAR_Core.pnl b/MAC/Navigator2/panels/Hardware/LOFAR_Core.pnl index f41c8441c0ddde59e8b30a4e88a1fa009a726f1d..6614ef60ea5cb3b63f7ee80788df21e0443a261f 100644 --- a/MAC/Navigator2/panels/Hardware/LOFAR_Core.pnl +++ b/MAC/Navigator2/panels/Hardware/LOFAR_Core.pnl @@ -1,7 +1,7 @@ -V 10 +V 11 1 LANG:1 8 (NoName) -PANEL,-1 -1 1077 780 N "_3DFace" 0 +PANEL,-1 -1 1077 790 N "_3DFace" 0 "main() { // Initialise the Panel @@ -278,100 +278,100 @@ LAYER, 7 1 LANG:1 6 Layer8 0 -3 13 "PANEL_REF14" +3 13 "PANEL_REF14" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 34 0.7424242424242424 0 0.7407407407407407 88.17799150929585 -22.85844132607411 1 "$Station""CS002" -3 20 "PANEL_REF21" +3 20 "PANEL_REF21" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 42 0.7424242424242424 0 0.7407407407407407 78.17799150929585 -52.85844132607411 1 "$Station""CS003" -3 21 "PANEL_REF22" +3 21 "PANEL_REF22" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 43 0.7424242424242424 0 0.7407407407407407 78.17799150929585 -2.8584413260741 1 "$Station""CS004" -3 22 "PANEL_REF23" +3 22 "PANEL_REF23" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7072354607860037 98.17799150929591 24.00673939508379 1 "$Station""CS005" -3 23 "PANEL_REF24" +3 23 "PANEL_REF24" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 45 0.7424242424242424 0 0.7407407407407407 118.1779915092959 -12.8584413260741 1 "$Station""CS006" -3 24 "PANEL_REF25" +3 24 "PANEL_REF25" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 46 0.7424242424242424 0 0.7407407407407407 108.1779915092959 -32.8584413260741 1 "$Station""CS007" -3 25 "PANEL_REF26" +3 25 "PANEL_REF26" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 47 0.7424242424242424 0 0.7407407407407407 298.1779915092959 37.14155867392589 1 "$Station""CS201" -3 26 "PANEL_REF27" +3 26 "PANEL_REF27" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 48 0.7424242424242424 0 0.7407407407407407 68.17799150929585 247.1415586739259 1 "$Station""CS301" -3 27 "PANEL_REF28" +3 27 "PANEL_REF28" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 49 0.7424242424242424 0 0.7407407407407407 558.1779915092959 -62.85844132607414 1 "$Station""CS103" -3 28 "PANEL_REF29" +3 28 "PANEL_REF29" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 50 0.7424242424242424 0 0.7407407407407407 -21.82200849070415 -92.8584413260741 1 "$Station""CS021" -3 29 "PANEL_REF30" +3 29 "PANEL_REF30" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 51 0.7424242424242424 0 0.7407407407407407 -41.82200849070415 -232.8584413260741 1 "$Station""CS030" -3 30 "PANEL_REF31" +3 30 "PANEL_REF31" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 52 0.7424242424242424 0 0.7407407407407407 -121.8220084907042 17.14155867392589 1 "$Station""CS401" -3 31 "PANEL_REF32" +3 31 "PANEL_REF32" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 53 0.7424242424242424 0 0.7407407407407407 -51.82200849070415 57.14155867392589 1 "$Station""CS032" -3 34 "PANEL_REF35" +3 34 "PANEL_REF35" -1 "objects\\Hardware\\Station_small.pnl" 457 486 T 55 0.7424242424242424 0 0.7407407407407407 -201.8220084907042 337.1415586739259 1 "$Station""CS302" -3 35 "PANEL_REF36" +3 35 "PANEL_REF36" -1 "objects\\Hardware\\Station_small.pnl" 417 67 T 56 0.7241379310344828 0 0.7241379310344828 65.80907546226885 -21.08747626186907 1 "$Station""CS501" -3 38 "PANEL_REF39" +3 38 "PANEL_REF39" -1 "objects\\Hardware\\Station_small.pnl" 617 167 T 59 0.7241379310344828 0 0.7241379310344828 150.9814892553723 6.49873063468263 1 "$Station""CS101" -3 43 "PANEL_REF44" +3 43 "PANEL_REF44" -1 "objects\\Hardware\\Station_small.pnl" 577 317 T 64 0.7241379310344828 0 0.7241379310344828 139.9470064967516 87.87804097951025 1 "$Station""CS017" -3 44 "PANEL_REF45" +3 44 "PANEL_REF45" -1 "objects\\Hardware\\Station_small.pnl" 657 307 T 65 0.7241379310344828 0 0.7241379310344828 152.015972013993 75.1194202898551 1 "$Station""CS026" -3 49 "PANEL_REF50" +3 49 "PANEL_REF50" -1 "objects\\Hardware\\Station_small.pnl" 447 447 T 70 0.7241379310344828 0 0.7241379310344828 84.0849375312344 123.7401099450276 1 "$Station""CS001" -3 50 "PANEL_REF51" +3 50 "PANEL_REF51" -1 "objects\\Hardware\\Station_small.pnl" 527 527 T 71 0.7241379310344828 0 0.7241379310344828 116.1539030484758 155.8090754622688 1 "$Station""CS024" -3 51 "PANEL_REF52" -"objects/Hardware\\Station_small.pnl" 487 357 T 71 0.7241379310344828 0 0.7241379310344828 135.1400566383475 99.40935056281384 +3 51 "PANEL_REF52" -1 +"objects\\Hardware\\Station_small.pnl" 487 357 T 71 0.7241379310344828 0 0.7241379310344828 135.1400566383475 99.40935056281384 1 "$Station""CS011" -3 52 "PANEL_REF53" -"objects/Hardware\\Station_small.pnl" 387 257 T 72 0.7241379310344828 0 0.7241379310344828 107.5538497417958 71.8231436662621 +3 52 "PANEL_REF53" -1 +"objects\\Hardware\\Station_small.pnl" 387 257 T 72 0.7241379310344828 0 0.7241379310344828 107.5538497417958 71.8231436662621 1 "$Station""CS013" -3 53 "PANEL_REF54" -"objects/Hardware\\Station_small.pnl" 517 47 T 73 0.7241379310344828 0 0.7241379310344828 143.3952823588206 13.39528235882057 +3 53 "PANEL_REF54" -1 +"objects\\Hardware\\Station_small.pnl" 517 47 T 73 0.7241379310344828 0 0.7241379310344828 143.3952823588206 13.39528235882057 1 "$Station""CS028" -3 54 "PANEL_REF55" -"objects/Hardware\\Station_small.pnl" 277 257 T 74 0.7241379310344828 0 0.7241379310344828 77.20902215558886 71.82314366626211 +3 54 "PANEL_REF55" -1 +"objects\\Hardware\\Station_small.pnl" 277 257 T 74 0.7241379310344828 0 0.7241379310344828 77.20902215558886 71.82314366626211 1 "$Station""CS031" -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/Observations/Observation_overview.pnl b/MAC/Navigator2/panels/Observations/Observation_overview.pnl index fbe72e211da6d8658112c291f87def7db2e108c3..267c55bc28a5dc384325db2f85f3e776925217e3 100644 --- a/MAC/Navigator2/panels/Observations/Observation_overview.pnl +++ b/MAC/Navigator2/panels/Observations/Observation_overview.pnl @@ -1,7 +1,7 @@ V 11 1 LANG:1 0 -PANEL,-1 -1 995 561 N "_3DFace" 0 +PANEL,-1 -1 995 747 N "_3DFace" 0 "main() { // Initialise the Panel @@ -32,6 +32,9 @@ PANEL,-1 -1 995 561 N "_3DFace" 0 baseDP + \".inputNodeList\", baseDP + \".BGLNodeList\", baseDP + \".storageNodeList\", + baseDP + \".processType\", + baseDP + \".processSubtype\", + baseDP + \".strategy\", baseDP + \".Beams.directionType\", baseDP + \".Beams.angle1\", baseDP + \".Beams.angle2\", @@ -41,7 +44,7 @@ PANEL,-1 -1 995 561 N "_3DFace" 0 LOG_ERROR(\"Observation_overview.pnl:main|Couldn't connect to : \"+baseDP); } if (!navFunct_dpReachable(baseDP)) { - updateObservationControl(\"\",0,\"\",0,\"\",\"\",\"\",\"\",\"\",\"\",0,\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",makeDynString(),\"\",makeDynFloat(), + updateObservationControl(\"\",0,\"\",0,\"\",\"\",\"\",\"\",\"\",\"\",0,\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",makeDynString(),\"\",makeDynFloat(), \"\",makeDynFloat(),\"\",makeDynString(),\"\",true); } } else { @@ -60,6 +63,9 @@ PANEL,-1 -1 995 561 N "_3DFace" 0 setValue(\"inputNodeListText\", \"backCol\", \"Lofar_dpdoesnotexist\"); setValue(\"BGLNodeListText\", \"backCol\", \"Lofar_dpdoesnotexist\"); setValue(\"runStateText\", \"backCol\", \"Lofar_dpdoesnotexist\"); + setValue(\"processTypeText\", \"backCol\", \"Lofar_dpdoesnotexist\"); + setValue(\"processSubTypeText\", \"backCol\", \"Lofar_dpdoesnotexist\"); + setValue(\"strategy\", \"backCol\", \"Lofar_dpdoesnotexist\"); setValue(\"storageNodeListText\", \"backCol\", \"Lofar_dpdoesnotexist\"); } @@ -80,12 +86,15 @@ updateObservationControl(string dp1, int claimPeriod, string dp12,string inputNodeList, string dp13,string BGLNodeList, string dp14,string storageNodeList, - string dp15,dyn_string directionType, - string dp16,dyn_float angle1, - string dp17,dyn_float angle2, - string dp18,dyn_string subbandList, - string dp19,string runState, - string dp20, bool invalid) + string dp15,string processType, + string dp16,string processSubtype, + string dp17,string strategy, + string dp18,dyn_string directionType, + string dp19,dyn_float angle1, + string dp20,dyn_float angle2, + string dp21,dyn_string subbandList, + string dp22,string runState, + string dp23, bool invalid) { LOG_TRACE(\"Observation_overview.pnl:updateObservationControl|entered\"); beamTable.deleteAllLines(); @@ -115,6 +124,9 @@ updateObservationControl(string dp1, int claimPeriod, setValue(\"inputNodeListText\", \"text\", inputNodeList); setValue(\"BGLNodeListText\", \"text\", BGLNodeList); setValue(\"storageNodeListText\", \"text\", storageNodeList); + setValue(\"processTypeText\", \"text\", processType); + setValue(\"processSubtypeText\", \"text\", processSubtype); + setValue(\"strategyText\", \"text\", strategy); setValue(\"runStateText\", \"text\", runState); for (int i=1; i<= dynlen(directionType); i++) { @@ -145,6 +157,9 @@ updateObservationControl(string dp1, int claimPeriod, setValue(\"inputNodeListText\", \"backCol\", SymbolCol); setValue(\"BGLNodeListText\", \"backCol\", SymbolCol); setValue(\"storageNodeListText\", \"backCol\", SymbolCol); + setValue(\"processTypeText\", \"backCol\", SymbolCol); + setValue(\"processSubtypeText\", \"backCol\", SymbolCol); + setValue(\"strategyText\", \"backCol\", SymbolCol); setValue(\"runStateText\", \"backCol\", SymbolCol); } @@ -244,7 +259,7 @@ LANG:1 14 Antenna Array: 14 2 "antennaArrayText" "" -1 102 72 E E E 1 E 1 E N "_WindowText" E N "_Window" E E +1 114.449594438007 72 E E E 1 E 1 E N "_WindowText" E N "_Window" E E E E 5 0 0 0 0 0 E E E @@ -255,7 +270,7 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 117 128 984 149 +0 117 128 352 149 2 "0s" 0 0 0 0 0 -1 E E E 25 3 "beamTable" @@ -356,7 +371,7 @@ LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 2 6 "PRIMITIVE_TEXT11" "" -1 395 64 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E +1 396 40 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E E E 13 0 0 0 0 0 E E E @@ -366,8 +381,8 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 395 66 456 79 -0 2 2 "0s" 0 0 0 192 0 0 395 66 1 +E E 0 1 1 2 1 E U 1 E 396 42 457 55 +0 2 2 "0s" 0 0 0 192 0 0 396 42 1 1 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 0 1 @@ -375,7 +390,7 @@ LANG:1 10 Stop Time: 14 7 "stopTimeText" "" -1 469 64 E E E 1 E 1 E N "_WindowText" E N "_Window" E E +1 470 40 E E E 1 E 1 E N "_WindowText" E N "_Window" E E E E 15 0 0 0 0 0 E E E @@ -386,7 +401,7 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 467 62 701 83 +0 468 38 702 59 2 "0s" 0 0 0 0 0 -1 E E E 2 8 "PRIMITIVE_TEXT12" @@ -426,7 +441,7 @@ LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 2 10 "PRIMITIVE_TEXT13" "" -1 369 86 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E +1 370 62 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E E E 21 0 0 0 0 0 E E E @@ -436,8 +451,8 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 369 88 457 101 -0 2 2 "0s" 0 0 0 192 0 0 369 88 1 +E E 0 1 1 2 1 E U 1 E 370 64 458 77 +0 2 2 "0s" 0 0 0 192 0 0 370 64 1 1 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 0 1 @@ -445,7 +460,7 @@ LANG:1 15 Prepare Period: 14 11 "preparePeriodText" "" -1 469 86 E E E 1 E 1 E N "_WindowText" E N "_Window" E E +1 470 62 E E E 1 E 1 E N "_WindowText" E N "_Window" E E E E 23 0 0 0 0 0 E E E @@ -456,7 +471,7 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 467 84 701 105 +0 468 60 702 81 2 "0s" 0 0 0 0 0 -1 E E E 2 12 "PRIMITIVE_TEXT14" @@ -496,7 +511,7 @@ LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 2 14 "PRIMITIVE_TEXT15" "" -1 751 108 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E +1 711 64 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E E E 29 0 0 0 0 0 E E E @@ -506,8 +521,8 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 751 110 826 123 -0 2 2 "0s" 0 0 0 192 0 0 751 110 1 +E E 0 1 1 2 1 E U 1 E 711 66 786 79 +0 2 2 "0s" 0 0 0 192 0 0 711 66 1 1 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 0 1 @@ -515,7 +530,7 @@ LANG:1 12 NyquistZone: 14 15 "nyquistzoneText" "" -1 836.7391304347826 110 E E E 1 E 1 E N "_WindowText" E N "_Window" E E +1 798.7391304347826 64 E E E 1 E 1 E N "_WindowText" E N "_Window" E E E E 31 0 0 0 0 0 E E E @@ -526,12 +541,12 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 835 106 869 127 +0 797 60 831 81 2 "0s" 0 0 0 0 0 -1 E E E 2 16 "PRIMITIVE_TEXT16" "" -1 -3791.477835200918 -1240 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E +1 -7378.867681650218 -1812 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E E E 33 0 0 0 0 0 E E E @@ -541,7 +556,7 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1.263157894736842 0 1 -588.3684210526316 -262 1 E 752 372 829 385 +E E 0 1 1 2 1 E 1.263157894736842 0 1 -587.3684210526316 -286 1 E 752 372 829 385 0 2 2 "0s" 0 0 0 192 0 0 752 372 1 1 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 @@ -550,7 +565,7 @@ LANG:1 12 SampleClock: 14 17 "sampleClockText" "" -1 468.9999999999999 106 E E E 1 E 1 E N "_WindowText" E N "_Window" E E +1 469.9999999999999 82 E E E 1 E 1 E N "_WindowText" E N "_Window" E E E E 35 0 0 0 0 0 E E E @@ -561,7 +576,7 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 467 106 701 127 +0 468 82 702 103 2 "0s" 0 0 0 0 0 -1 E E E 2 18 "PRIMITIVE_TEXT17" @@ -795,7 +810,7 @@ LANG:1 12 Observation: 13 31 "Abort_Observation" "" -1 6 490 E E E 0 E 0 E N "_ButtonText" E N "_Button" E E +1 10 710 E E E 0 E 0 E N "_ButtonText" E N "_Button" E E E E 61 0 0 0 0 0 E E E @@ -806,7 +821,7 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 4 488 128 514 +0 8 708 132 734 T 1 @@ -838,7 +853,7 @@ dyn_errClass err; 2 32 "PRIMITIVE_TEXT23" "" -1 710 64 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E +1 711 40 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E E E 63 0 0 0 0 0 E E E @@ -848,8 +863,8 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 710 66 762 79 -0 2 2 "0s" 0 0 0 192 0 0 710 66 1 +E E 0 1 1 2 1 E U 1 E 711 42 763 55 +0 2 2 "0s" 0 0 0 192 0 0 711 42 1 1 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 0 1 @@ -857,7 +872,7 @@ LANG:1 9 runState: 14 33 "runStateText" "" -1 786 64 E E E 1 E 1 E N "_WindowText" E N "_Window" E E +1 799 40 E E E 1 E 1 E N "_WindowText" E N "_Window" E E E E 65 0 0 0 0 0 E E E @@ -868,7 +883,112 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 784 62 982 83 +0 797 38 981 59 +2 "0s" 0 0 0 0 0 -1 E E E +2 34 +"PRIMITIVE_TEXT24" +"" +1 712 106 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +66 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 1 E 712 108 763 121 +0 2 2 "0s" 0 0 0 192 0 0 712 108 1 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 +LANG:1 9 Strategy: +14 35 +"strategyText" +"" +1 798.4173913043478 108 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +67 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 798 104 984 125 +2 "0s" 0 0 0 0 0 -1 E E E +2 36 +"PRIMITIVE_TEXT25" +"" +1 -7378.867681650218 -1768 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +68 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1.263157894736842 0 1 -587.3684210526316 -264 1 E 752 372 828 385 +0 2 2 "0s" 0 0 0 192 0 0 752 372 1 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 +LANG:1 12 processType: +14 37 +"processTypeText" +"" +1 469.9999999999999 104 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +69 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 468 104 702 125 +2 "0s" 0 0 0 0 0 -1 E E E +2 40 +"PRIMITIVE_TEXT27" +"" +1 -7378.867681650218 -1720 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +72 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1.263157894736842 0 1 -587.3684210526316 -240 1 E 752 372 846 385 +0 2 2 "0s" 0 0 0 192 0 0 752 372 1 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 +LANG:1 15 processSubtype: +14 41 +"processSubtypeText" +"" +1 489.9999999999999 128 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +73 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 488 128 702 149 2 "0s" 0 0 0 0 0 -1 E E E 0 LAYER, 1 @@ -899,4 +1019,4 @@ LAYER, 7 1 LANG:1 0 0 -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/Processes/BGPAppl.pnl b/MAC/Navigator2/panels/Processes/BGPAppl.pnl index ac44aa055af01851fa026defa97cb691b083e4e6..cc2979f753b30a079657b595630bdef2304eb3c1 100644 --- a/MAC/Navigator2/panels/Processes/BGPAppl.pnl +++ b/MAC/Navigator2/panels/Processes/BGPAppl.pnl @@ -12,24 +12,28 @@ PANEL,-1 -1 1013 750 N "_3DFace" 0 - // determine if we have an observation name in the DP, if so strip it and get the real name to be included in the toplabel + // determine if we have an observation name in the DP, if so strip it and get the real name to be included in the toplabel string bareDP=dpSubStr(baseDP,DPSUB_DP); - + // The BGPappl belonging by an observation contains : + // ioNodeList (all IoNodes involved, each ionode is connected to a station, obtainable via ionode#.usedStation) + // and all of the next lists are contained per ionode in a [,,,] list + // locusNodeList [x,x,x] list all used locusNodes per ionode + // adderList [x,x,x] adders per ionode + // writerList [x,x,x] writers per ionode + // dataProductList [x,x,x] dataproducts per ionode + // dataProductTypeList [x,x,x] dataproductTypes per ionode + // check if the requiered datapoint for this view are enabled and accessible if (dpExists(baseDP + \".ioNodeList\")) { if (dpConnect(\"updateBGPAppl\", baseDP + \".ioNodeList\", - baseDP + \".locusNodeList\", baseDP + \".adderList\", - baseDP + \".writerList\", - baseDP + \".dataProductList\", - baseDP + \".dataProductTypeList\", baseDP + \".ioNodeList:_online.._invalid\") == -1) { LOG_ERROR(\"BGPAppl.pnl:main|Couldn'tconnect to: \"+baseDP); } if (!navFunct_dpReachable(baseDP)) { - updateBGPAppl(\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",true); + updateBGPAppl(\"\",makeDynString(\"\"),\"\",makeDynString(\"\"),true); } } else { LOG_ERROR(\"BGPAppl.pnl:main|Couldn't find DP to connect to: \"+baseDP); @@ -39,13 +43,9 @@ PANEL,-1 -1 1013 750 N "_3DFace" 0 reload(); } -updateBGPAppl(string dp1,dyn_int ionodeList, - string dp2,dyn_string locusNodeList, - string dp3,dyn_string adderList, - string dp4,dyn_string writerList, - string dp5,dyn_string dataProductList, - string dp6,dyn_string dataProductTypeList, - string dp7, bool invalid) +updateBGPAppl(string dp1,dyn_string ioNodeList, + string dp2,dyn_string adderList, + string dp3, bool invalid) { LOG_TRACE(\"BGPAppl.pnl:updateBGPAppl|entered\"); string SymbolCol=\"_Window\"; @@ -55,25 +55,23 @@ updateBGPAppl(string dp1,dyn_int ionodeList, SymbolCol=\"Lofar_dpOffline\"; } } - - + dyn_string stations; + // clear stationtable stationTable.deleteAllLines(); - dynClear(stationList); - - // loop over nr of stations to fill table - for (int i = 1; i <= dynlen(ionodeList); i++) { - - // update stations based inputbuffers and adders - stationTable.appendLine(\"ioNode\",ionodeList[i], - \"adders\",adderList[i], - \"writers\",writerList[i], - \"locusNodes\",locusNodeList[i], - \"dataProducts\",dataProductList[i], - \"type\",dataProductTypeList[i]); + // loop over nr of ionodes to fill table + for (int i = 1; i <= dynlen(ioNodeList); i++) { + string station; + + dpGet(navFunct_IONode2DPName(ioNodeList[i])+\".usedStation\",station); + dynAppend(stations,station); + // update stationTable + stationTable.appendLine(\"Station\",station,\"IONode\",ioNodeList[i],\"Adders\",adderList[i]); } + stationList = stations; + nodeList = ioNodeList; // set the observation selectable items prepareProcesses(); @@ -88,7 +86,7 @@ void prepareProcesses() { dynAppend(g_processesList,baseDP); // append all involved stations for (int i=1; i <= dynlen(stationList); i++) { - dynAppend(result,baseDP+\",BGLProc->\"+stationList[i]+\",\"+baseDP+\"_BGPProc#\"+stationList[i]); + dynAppend(result,baseDP+\",BGLProc->\"+stationList[i]+\",\"+baseDP+\"_BGPProc#\"+nodeList[i]); } dynAppend(g_processesList,baseDP+\"_BGPProc\"); @@ -153,7 +151,39 @@ string baseDP=\"\"; string database=\"\"; string observation=\"\"; string observationName = \"\"; -dyn_string stationList; +dyn_string stationList=\"\"; +dyn_string nodeList=\"\"; +bool bDoubleClicked = false; + +// routine for single mouse click +void click(int row) { + // set delay in case double click was meant + delay(0, 100); + if (!bDoubleClicked) { + string station = stationTable.cellValueRC(row,\"Station\"); + navPanel_setEvent(station,\"EventClick\"); + } +} + +// routine for double mouse click +void dblClick(int row) { + // indicate this is a doubleClick + bDoubleClicked = true; + + string IONode = stationTable.cellValueRC(row,\"IONode\"); + if (IONode != \"\") { + string selection = baseDP+\"_BGPProc#\"+IONode; + navPanel_setEvent(selection,\"ChangePanel\"); + } + // set delay to avoid click event will be triggered + delay(0, 500); + bDoubleClicked = false; +} + +// routine for right mouse click +void rClick(int row) { + navPanel_setEvent(\"BGPAppl\",\"EventRightClick\"); +} " 0 2 "CBRef" "1" @@ -200,8 +230,16 @@ LANG:1 0 25 42 "stationTable" "" -1 20 320 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 30 360 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main(int row, string column) +{ + rClick(row); +}" 0 + "main(int row, string column) +{ + dblClick(row); +}" 0 + 12 0 0 0 0 0 E E E 0 @@ -211,48 +249,57 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 18 318 1002 622 -EE 1 0 1 6 0 "ioNode" 4 1 0 "s" 1 -LANG:1 6 ioNode -E -1 -LANG:1 0 - -45 "adders" 10 1 0 "s" 1 -LANG:1 6 adders -E -1 -LANG:1 0 - -100 "writers" 10 1 0 "s" 1 -LANG:1 7 writers -E -1 -LANG:1 0 +0 28 358 422 712 +"main() +{ + stationTable.tableMode(TABLE_SELECT_BROWSE); + + // connect for highlight mechanism + dpConnect( \"bgpapplCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" ); +} -100 "locusNodes" 27 1 0 "s" 1 -LANG:1 10 locusNodes +void bgpapplCallback(string dp1, bool aTrig) { + + LOG_DEBUG(\"Observation_small.pnl:bgpapplCallback|ObjectTrigger Callback on: \"+dp1+\" trigger: \"+aTrig); + LOG_DEBUG(\"Observation_small.pnl:bgpapplCallback|Found highlight : \" + highlight + \" BGPAppl\"); + int lineNr=-1; + for (int i=0; i< stationTable.lineCount(); i++) { + stationTable.currentCell(i,0); + if (dynContains(highlight,stationTable.cellValueRC(i,\"Station\"))) { + stationTable.cellBackCol(\"Lofar_highLight\"); + lineNr=i; + } else { + stationTable.cellBackCol(\"white\"); + } + } +}" 0 +"main(int row, string column, string value) +{ + click(row); +}" 0 + 1 0 1 3 0 "Station" 10 1 0 "s" 1 +LANG:1 7 Station E 1 LANG:1 0 -255 "dataProducts" 33 1 0 "s" 1 -LANG:1 12 dataProducts +100 "IONode" 7 1 0 "[2d,False,False,ALIGNMENT_BEGINNING,False]" 1 +LANG:1 6 IONode E 1 LANG:1 0 -305 "type" 10 1 0 "s" 1 -LANG:1 4 type +75 "Adders" 21 1 0 "s" 1 +LANG:1 6 Adders E 1 LANG:1 0 -98 +200 14 14 10 10 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 0 1 1 1 7 +0 0 1 0 1 7 1 0 0 LAYER, 1 diff --git a/MAC/Navigator2/panels/Processes/BGPProc.pnl b/MAC/Navigator2/panels/Processes/BGPProc.pnl new file mode 100644 index 0000000000000000000000000000000000000000..3b6239a7018c35db4a209173be0792dfdef8c20e --- /dev/null +++ b/MAC/Navigator2/panels/Processes/BGPProc.pnl @@ -0,0 +1,928 @@ +V 11 +1 +LANG:1 7 Station +PANEL,-1 -1 1020 698 N "_3DFace" 0 +"main() +{ + // Initialise the Panel + navPanel_initPanel(\"fw_viewBox\"); + strModuleName = myModuleName(); + baseDP = g_currentDatapoint; + + if(dpExists(sysName+\"LOFAR_PIC_BGP.BGPSwitch\")) { + dpConnect(\"switchBGP\", sysName+\"LOFAR_PIC_BGP.BGPSwitch:_online.._value\", + sysName+\"LOFAR_PIC_BGP.BGPSwitch:_online.._invalid\"); + if (!navFunct_dpReachable(sysName+\"LOFAR_PIC_BGP.BGPSwitch\")) { + controlBGP(\"\",false,\"\",true); + } + } +} + +void switchBGP(string dp1, bool bgpswitch, + string dp2, bool invalid) { + + if (!invalid) { + reload(); + } +} + +void prepareProcesses() { + dyn_string result; + // here we need to add the Inputbuffer, adders and the writers that are part of this screen + // so we need to determine all the databasePoints for these processes + + inputBufferDP = sysName+\"LOFAR_PermSW_PSIONode\"+navFunct_formatInt(ioNode,99)+\"_InputBuffer\"; + adderDP = sysName+\"LOFAR_ObsSW_OSIONode\"+navFunct_formatInt(ioNode,99)+\"_Adder\"; + dynAppend(result,\",InputBuffer,\"+inputBufferDP); + dynAppend(g_processesList,inputBufferDP); + dynClear(writers); + dynClear(locusNodes); + for (int i = 1; i <= dynlen(adders); i++ ) { + dynAppend(result,\",Adder\"+adders[i]+\",\"+adderDP+adders[i]); + dynAppend(g_processesList,adderDP+adders[i]); + int l; + int w; + bool invalid=true; + if (dpGet(adderDP+adders[i]+\".locusNode\",l,adderDP+adders[i]+\".locusNode:_online.._invalid\",invalid) >= 0) { + if (!invalid) dynAppend(locusNodes,l); + } + if (dpGet(adderDP+adders[i]+\".writer\",w,adderDP+adders[i]+\".writer:_online.._invalid\",invalid) >= 0) { + if (!invalid) dynAppend(writers,w); + } + } + for (int i = 1; i <= dynlen(writers); i++ ) { + string writerDP=sysName+\"LOFAR_ObsSW_OSLocusNode\"+navFunct_formatInt(locusNodes[i],999)+\"_Writer\"+navFunct_formatInt(writers[i],99); + dynAppend(result,\",Writer\"+navFunct_formatInt(writers[i],99)+\",\"+writerDP); + dynAppend(g_processesList,writerDP); + } + + + // write result to the db so various panels can reset themselves + dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".processesList\",result); + + LOG_DEBUG(\"BGPProc.pnl:prepareProcesses|processList found: \"+ result); + +} + +// +// Callback for dpConnect to action point. +// If there is an action required this point will tell so +// +void doAction(string aDP, string anAction) { + LOG_DEBUG(\"BGPProcr.pnl:doAction| Action required. found: \" + anAction); + // split action into essentials + dyn_string actionString; + if (!navFunct_splitAction(anAction,actionString)) { + return; + } + + LOG_DEBUG(\"BGPProc.pnl:doAction|found actionString: \" + actionString); + + // Reload + if (actionString[1] == \"Reload\") { + reload(); + } +} + +void reload() { + + string var = \"\"; + // get the saved panelparams for this panel + if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + \".panelParamList\")) { + dpGet(DPNAME_NAVIGATOR + g_navigatorID + \".panelParamList\",var); + // empty the paramList + dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".panelParamList\",\"\"); + } else { + LOG_WARN(\"BGPProc.pnl:main| Error: no dp \" + DPNAME_NAVIGATOR + g_navigatorID+\".panelParamList\"); + } + + // get BGLAppl path to obtain the lists + BGLApplDP = navFunct_getPathLessOne(baseDP); + + // if var is empty something went wrong (maybe back and fort between other panel, so the panelParamlist was emptied) + // in that case we jump back to the prior screen + + if (var == \"\" && ioNode == -1) { + g_currentDatapoint = BGLApplDP; + navPanel_setEvent(\"BGPProc\",\"ChangePanel\"); + } + + if (ioNode == -1) { + ioNode = (int)var; + } + + + + + if ( dpExists(BGLApplDP+\".ioNodeList\") ) { + dpGet(BGLApplDP+\".ioNodeList\",ioNodeList); + } else { + LOG_ERROR(\"BGPProc.pnl:main|Error getting ioNodeList value\"); + } + + if ( dpExists(BGLApplDP+\".adderList\") ) { + dpGet(BGLApplDP+\".adderList\",adderList); + } else { + LOG_ERROR(\"BGPProc.pnl:main|Error getting adderList value\"); + } + LOG_DEBUG(\"BGPProc.pnl:main|selected ioNode: \"+ioNode); + LOG_DEBUG(\"BGPProc.pnl:main|ioNodeList: \"+ioNodeList); + LOG_DEBUG(\"BGPProc.pnl:main|adderList: \"+adderList); + + + // get position of ioNode in dynArray to see what writers and adders belong to this screen + int idx = dynContains(ioNodeList,ioNode); + if (idx > 0) { + adders=navFunct_listToDynString(adderList[idx]); + } else { + LOG_ERROR(\"BGPProc.pnl:main|ERROR: ionode not in ioNodeList !!!\"); + } + LOG_DEBUG(\"BGPProc.pnl:main|adders: \"+adders); + + // In the database we can find the IONode involved + nodeDP = navFunct_IONode2DPName(ioNode); + string nodeName = navFunct_DPName2CEPName(nodeDP); + + LOG_DEBUG(\"BGPProc.pnl:main|nodeName working: \"+nodeName); + + redraw(); + + // if no match found we have an error + if (nodeName == \"\" ) { + LOG_ERROR(\"BGPProc.pnl:main| ERROR no IONode-name found, can't view running processes\"); + } else { + + // we have to set the stripped inputBuffer List and Adder List here. + // Since this is the Survey mode we only need one InputBuffer and one Adder + dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName\",\"CircularBuffer\", + DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.paramList\",makeDynString(ioNode)); + + + + setValue(\"ionodeLabel\",\"text\",\"IONode: \"+nodeName); + setValue(\"ionodeLabel\",\"toolTipText\",nodeDP); + + } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + + // connect for selfUpdates + showSelfState(baseDP); + + + navFunct_clearGlobalLists(); + + // set the hardware selectable items for this screen + prepareProcesses(); + + // set panel to ready + g_objectReady=true; + + // trigger that the panel values are calculated and ready + navPanel_setEvent(\"BGPProc.pnl\",\"Update\"); + +} + + " 0 + E E E E 1 -1 -1 0 0 0 +""0 1 +E "#uses \"navPanel.ctl\" +string baseDP = \"\"; +string BGLApplDP = \"\"; + +int ioNode = -1; +string nodeDP=\"\"; +string inputBufferDP=\"\"; +string adderDP=\"\"; + +dyn_string ioNodeList; +dyn_string adderList; + +dyn_string adders=\"\"; +dyn_string writers=\"\"; +dyn_string locusNodes=\"\"; + +dyn_string refNames; +string strModuleName; +bool bDoubleClicked = false; + +// routine for single mouse click +void click(string dp) { + // set delay in case double click was meant + delay(0, 100); + if (!bDoubleClicked) { + navPanel_setEvent(\"BGPProc.pnl\",\"EventClick\"); + } +} + +// routine for double mouse click +void dblClick(string dp) { + // indicate this is a doubleClick + bDoubleClicked = true; + + if (dpExists(dp) ) { + LOG_DEBUG(\"BGPProc.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+dp); + g_currentDatapoint=dp; + navPanel_setEvent(\"BGPProc.pnl\",\"ChangePanel\"); + } + // set delay to avoid click event will be triggered + delay(0, 500); + bDoubleClicked = false; +} + +// routine for right mouse click +void rClick(string dp) { + navPanel_setEvent(\"BGPProc.pnl\",\"EventRightClick\"); +} +void clearRefNames() { + // remove all symbols because new ones will be added + for (int i=1; i <= dynlen(refNames); i++) { + removeSymbol(strModuleName,\"\",refNames[i]); + } + dynClear(refNames); +} + + +void redraw() { + LOG_TRACE(\"BGPProc.pnl:redraw\"); + string addPanelName = \"objects/Processes/adder.pnl\"; + + // clear old refNames if available + if (dynlen(refNames) > 0) { + clearRefNames(); + } + + // now start adding adders to panel + int ref = 1; + for (int i = 1; i <= dynlen(adders); i++ ) { + LOG_TRACE(\"BGPProc.pnl:redraw|Adding adder: \" + adders[i]); + refNames[ref]=\"adder\"+(ref); + + if ( addSymbol( strModuleName, // Stay in this modul + \"\", // Name of this panel + addPanelName, // Panel to add + refNames[ref], // Ref of the addedPanel + makeDynString( \"$adderNumber:\" + adders[i] , // Define all $values + \"$nodeDP:\" + nodeDP), // + -17, // Xpos of the AddedSymbol + 350+((i-1)*30), // Ypos of the AddedSymbol + 0, // angle + 1 ,1 // zoomX , zoomY + ) < 0 ) { + LOG_ERROR(\"BGPProc.pnl:redraw|Error Appending adder : \" + i + \" in this panel.\"); + } + ref++; + } +} +" 0 + 2 +"CBRef" "1" +"EClose" E +"" +1 +DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 +LAYER, 0 +1 +LANG:1 6 Layer1 +6 273 +"ionode_highLight" +"" +1 240 10 E E E 1 E 0 E N "_Transparent" E N "Lofar_highLight" E E + "main() +{ + rClick(nodeDP); +}" 0 + "main() +{ + dblClick(nodeDP); +}" 0 + +48 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +"main() +{ + dpConnect( \"ionodeCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" ); +} + +void ionodeCallback(string dp1, bool aTrig) { + + LOG_DEBUG(\"BGPProc.pnl:ionodeCallback|ObjectTrigger Callback on: \"+dp1+\" trigger: \"+aTrig); + LOG_DEBUG(\"BGPProc.pnl:ionodeCallback|Found highlight : \" + highlight + \" Looking for ionode: \"+nodeDP); + bool bHighlight=false; + if (dynContains(highlight,nodeDP)) { + bHighlight=true; + } + LOG_DEBUG(\"BGPProc.pnl:ionodeCallback|Highlight request: \"+bHighlight); + ionode_highLight.visible = bHighlight; + +} + +" 0 + "main() +{ + click(nodeDP); +}" 0 + 0 1 1 2 1 E 1 0 1 144 -228 1 E 30 230 251 264 +6 0 +"RECTANGLE1" +"" +1 40 110 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E + E E +3 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1.048387096774194 0 0.5609756097560976 68.06451612903223 -21.70731707317073 1 E 40 110 660 520 +6 1 +"RECTANGLE2" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +4 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 50 -208 1 E 740 230 789 279 +2 2 +"PRIMITIVE_TEXT1" +"" +1 864 2 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +5 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 1 E 864 2 949 15 +0 2 2 "0s" 0 0 0 192 0 0 864 2 1 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 +LANG:1 12 ComputeNodes +2 3 +"ionodeLabel" +"" +1 180 10 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(nodeDP); +}" 0 + "main() +{ + dblClick(nodeDP); +}" 0 + +6 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E "main() +{ + click(nodeDP); +}" 0 + 0 1 1 2 1 E U 1 E 180 10 387 30 +0 2 2 "0s" 0 0 0 192 0 0 180 10 1 +1 +LANG:1 33 MS Shell Dlg,-1,16,5,75,0,0,0,0,0 +0 1 +LANG:1 22 IONode: R00-M0-N00-J00 +6 5 +"RECTANGLE19" +"" +1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E + E E +8 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 180 90 2 1 0 "pictures/arrowRight.gif" 4294967295 E 570 30 619 79 +6 6 +"RECTANGLE20" +"" +1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E + E E +9 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +2 +"dashclr"N "_Transparent" +"rotatefill" "r" +E E 0 1 1 2 1 E -0.01886456694761347 -0.9998220482235222 0.9998220482235222 -0.01886456694761347 770.758141713434 840.464504495836 2 1 0 "pictures/arrowLeft.gif" 4294967295 E 570 30 619 79 +1 274 0 "" 1 +0 +6 9 +"RECTANGLE23" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +11 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 100 -208 1 E 740 230 789 279 +6 10 +"RECTANGLE24" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +12 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 150 -208 1 E 740 230 789 279 +6 11 +"RECTANGLE25" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +13 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 200 -208 1 E 740 230 789 279 +6 12 +"RECTANGLE26" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +14 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 50 -158 1 E 740 230 789 279 +6 13 +"RECTANGLE27" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +15 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 100 -158 1 E 740 230 789 279 +6 14 +"RECTANGLE28" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +16 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 150 -158 1 E 740 230 789 279 +6 15 +"RECTANGLE29" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +17 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 200 -158 1 E 740 230 789 279 +6 16 +"RECTANGLE30" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +18 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 50 -108 1 E 740 230 789 279 +6 17 +"RECTANGLE31" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +19 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 100 -108 1 E 740 230 789 279 +6 18 +"RECTANGLE32" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +20 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 150 -108 1 E 740 230 789 279 +6 19 +"RECTANGLE33" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +21 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 200 -108 1 E 740 230 789 279 +6 20 +"RECTANGLE34" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +22 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 50 -58 1 E 740 230 789 279 +6 21 +"RECTANGLE35" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +23 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 100 -58 1 E 740 230 789 279 +6 22 +"RECTANGLE36" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +24 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 150 -58 1 E 740 230 789 279 +6 23 +"RECTANGLE37" +"" +1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E + E E +25 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 200 -58 1 E 740 230 789 279 +1 275 1 "" 285 +0 +1 276 1 "" 226 +0 +1 277 1 "" 229 +0 +1 278 1 "" 234 +0 +1 279 1 "" 235 +0 +1 280 1 "" 236 +0 +1 281 1 "" 237 +0 +1 282 1 "" 238 +0 +1 283 1 "" 239 +0 +1 284 1 "" 240 +0 +1 285 1 "" 241 +0 +1 286 1 "" 242 +0 +1 287 1 "" 243 +0 +1 288 1 "" 244 +0 +1 289 1 "" 245 +0 +1 290 1 "" 246 +0 +1 291 1 "" 247 +0 +1 292 1 "51" 1 +0 +1 293 1 "" 249 +0 +1 294 1 "" 250 +0 +1 295 1 "" 251 +0 +1 296 1 "" 252 +0 +1 297 1 "" 253 +0 +1 298 1 "" 254 +0 +1 299 1 "" 255 +0 +1 300 1 "" 261 +0 +1 301 1 "" 262 +0 +1 302 1 "" 263 +0 +1 303 1 "" 264 +0 +1 304 1 "" 265 +0 +1 305 1 "" 279 +0 +1 306 1 "" 280 +0 +1 307 1 "" 281 +0 +1 308 1 "" 282 +0 +1 309 1 "" 283 +0 +1 310 1 "" 290 +0 +1 311 1 "" 291 +0 +1 312 1 "" 292 +0 +6 112 +"RECTANGLE38" +"" +1 40 110 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E + E E +29 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1.451612903225807 0 1 41.93548387096772 160 1 E 40 110 660 520 +2 156 +"PRIMITIVE_TEXT19" +"" +1 105 350.0000000000001 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +30 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 105 350.0000000000001 117 363 +0 2 2 "0s" 0 0 0 192 0 0 105 350.0000000000001 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 2 Nr +2 157 +"PRIMITIVE_TEXT20" +"" +1 120 350.0000000000001 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +31 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 120 350.0000000000001 144 363 +0 2 2 "0s" 0 0 0 192 0 0 120 350.0000000000001 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 4 Stat +2 158 +"PRIMITIVE_TEXT21" +"" +1 150 350.0000000000001 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +32 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 150 350.0000000000001 177 363 +0 2 2 "0s" 0 0 0 192 0 0 150 350.0000000000001 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 4 Drop +2 159 +"PRIMITIVE_TEXT22" +"" +1 200 350.0000000000001 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +33 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 200 350.0000000000001 248 363 +0 2 2 "0s" 0 0 0 192 0 0 200 350.0000000000001 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 7 Dropped +2 160 +"PRIMITIVE_TEXT23" +"" +1 308 350.0000000000001 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +34 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 308 350.0000000000001 336 363 +0 2 2 "0s" 0 0 0 192 0 0 308 350.0000000000001 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 5 Error +2 161 +"PRIMITIVE_TEXT24" +"" +1 430 350.0000000000001 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +35 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 430 350.0000000000001 509 363 +0 2 2 "0s" 0 0 0 192 0 0 430 350.0000000000001 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 13 CurrentAction +2 162 +"PRIMITIVE_TEXT25" +"" +1 560 350.0000000000001 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +36 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 560 350.0000000000001 627 363 +0 2 2 "0s" 0 0 0 192 0 0 560 350.0000000000001 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 10 logMessage +2 235 +"PRIMITIVE_TEXT26" +"" +1 110 310 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +46 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 110 310 162 326 +0 2 2 "0s" 0 0 0 192 0 0 110 310 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 7 Adders: +0 +LAYER, 1 +1 +LANG:1 6 Layer2 +0 +LAYER, 2 +1 +LANG:1 6 Layer3 +0 +LAYER, 3 +1 +LANG:1 6 Layer4 +0 +LAYER, 4 +1 +LANG:1 6 Layer5 +0 +LAYER, 5 +1 +LANG:1 6 Layer6 +0 +LAYER, 6 +1 +LANG:1 6 Layer7 +0 +LAYER, 7 +1 +LANG:1 6 Layer8 +0 +3 0 "selfState" -1 +"objects\\lofar_self_state.pnl" 678 158 T 0 1 0 1 -540 -150 +0 +3 1 "PANEL_REF53" -1 +"objects\\Processes\\circularBuffer.pnl" 90 160 T 1 1 0 1 -100 -110 +0 +0 diff --git a/MAC/Navigator2/panels/Processes/BGPProc_mainloader.pnl b/MAC/Navigator2/panels/Processes/BGPProc_mainloader.pnl deleted file mode 100644 index 11ecf5e8b164e780aab30e6f5b5d19a6c6a6e66f..0000000000000000000000000000000000000000 --- a/MAC/Navigator2/panels/Processes/BGPProc_mainloader.pnl +++ /dev/null @@ -1,169 +0,0 @@ -V 10 -1 -LANG:1 7 Station -PANEL,-1 -1 980 746 N "_3DFace" 0 -"main() -{ - // Initialise the Panel - navPanel_initPanel(\"fw_viewBox\"); - - baseDP = g_currentDatapoint; - string strModuleName = myModuleName(); - string addPanelName = \"\"; - dyn_string addPanelValues = makeDynString(); - - // get the saved panelparams for this panel - string var=\"\"; - if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + \".panelParamList\")) { - dpGet(DPNAME_NAVIGATOR + g_navigatorID + \".panelParamList\",var); - // empty the paramList - dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".panelParamList\",\"\"); - } else { - LOG_WARN(\"navCtrl.ctl:navCtrl_handleLocatorEvent| Error: no dp \" + DPNAME_NAVIGATOR + g_navigatorID+\".panelParamList\"); - } - - // get BGLAppl path to obtain the inputbufferList and the outputbufferList - BGLApplDP = navFunct_getPathLessOne(baseDP); - - dyn_string stationList; - dyn_string inputBufferList; - dyn_string adderList; - - - if ( dpExists(BGLApplDP+\".inputBufferList\") ) { - dpGet(BGLApplDP+\".inputBufferList\",inputBufferList); - } else { - LOG_ERROR(\"BGPProc_mainloader.pnl:main|Error getting inputBufferList value\"); - } - - if ( dpExists(BGLApplDP+\".adderList\") ) { - dpGet(BGLApplDP+\".adderList\",adderList); - } else { - LOG_ERROR(\"BGPProc_mainloader.pnl:main|Error getting adderList value\"); - } - - if ( dpExists(BGLApplDP+\".stationList\") ) { - dpGet(BGLApplDP+\".stationList\",stationList); - } else { - LOG_ERROR(\"BGPProc_mainloader.pnl:main|Error getting stationList value\"); - } - - addPanelName=\"objects/Processes/BGPProc.pnl\"; - dynClear(addPanelValues); - dynAppend(addPanelValues,\"$stationList:\"+stationList); - dynAppend(addPanelValues,\"$inputBufferList:\"+inputBufferList); - dynAppend(addPanelValues,\"$adderList:\"+adderList); - dynAppend(addPanelValues,\"$station:\"+var); - - if ( addSymbol( strModuleName, // Stay in this module - \"\", // Name of this panel - addPanelName, // Panel to add - \"BGPProc\", // Ref of the addedPanel - addPanelValues, // Define all $values of particular addedpanel - 0, // Xpos of the AddedSymbol - 0, // Ypos of the AddedSymbol - 0, // angle - 1, // zoomX, - 1 // zoomY - ) < 0 ) { - LOG_ERROR(\"BGPProc_mainloader.pnl:main|Error Appending \"+addPanelName +\" : \" + getLastError()); - } - - reload(); - -} - -void prepareProcesses() { - dyn_string result; - - dynAppend(result,\",BGPProc,\"+baseDP); - dynAppend(g_processesList,baseDP); - - - // write result to the db so various panels can reset themselves - dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".processesList\",result); - - LOG_DEBUG(\"BGPProc_mainloader.pnl:prepareProcesses|processList found: \"+ result); - -} - -// -// Callback for dpConnect to action point. -// If there is an action required this point will tell so -// -void doAction(string aDP, string anAction) { - LOG_DEBUG(\"BGPProc_mainloader.pnl:doAction| Action required. found: \" + anAction); - // split action into essentials - dyn_string actionString; - if (!navFunct_splitAction(anAction,actionString)) { - return; - } - - LOG_DEBUG(\"BGPProc_mainloader.pnl:doAction|found actionString: \" + actionString); - - // Reload - if (actionString[1] == \"Reload\") { - reload(); - } -} - -void reload() { - - navFunct_clearGlobalLists(); - - // set the hardware selectable items for this screen - prepareProcesses(); - - // set panel to ready - g_objectReady=true; - - // trigger that the panel values are calculated and ready - navPanel_setEvent(\"BGPProc_mainloader.pnl\",\"Update\"); - -} - - " 0 - E E E E 1 -1 -1 0 0 0 -""0 1 -E "#uses \"navPanel.ctl\" -string baseDP = \"\"; -string BGLApplDP = \"\";" 0 - 2 -"CBRef" "1" -"EClose" E -"" -1 -DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 -LAYER, 0 -1 -LANG:1 6 Layer1 -0 -LAYER, 1 -1 -LANG:1 6 Layer2 -0 -LAYER, 2 -1 -LANG:1 6 Layer3 -0 -LAYER, 3 -1 -LANG:1 6 Layer4 -0 -LAYER, 4 -1 -LANG:1 6 Layer5 -0 -LAYER, 5 -1 -LANG:1 6 Layer6 -0 -LAYER, 6 -1 -LANG:1 6 Layer7 -0 -LAYER, 7 -1 -LANG:1 6 Layer8 -0 -0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/Processes/CEP_IONodeProcesses.pnl b/MAC/Navigator2/panels/Processes/CEP_IONodeProcesses.pnl new file mode 100644 index 0000000000000000000000000000000000000000..8a6864685f965c28d57fdd7aceb0491a58226669 --- /dev/null +++ b/MAC/Navigator2/panels/Processes/CEP_IONodeProcesses.pnl @@ -0,0 +1,408 @@ +V 11 +1 +LANG:1 10 CEP_IONode +PANEL,-1 -1 1073 754 N "_3DFace" 0 +"main() +{ + // Initialise the Panel + navPanel_initPanel(\"fw_viewBox\"); + strModuleName = myModuleName(); + baseDP = g_currentDatapoint; + nodeDP = baseDP; + + dyn_string dpAr= strsplit(dpSubStr(g_currentDatapoint,DPSUB_DP),\"_\"); + if (strpos(dpAr[dynlen(dpAr)],\"IONode\") > -1) { + ioNode = substr(dpAr[dynlen(dpAr)],6,strlen(dpAr[dynlen(dpAr)])); + } else { + LOG_ERROR(\"CEP_IONodeProcesses.pnl:Initialize|No IONode found in currentDatapoint.\"); + } + + inputBufferDP = sysName+\"LOFAR_PermSW_PSIONode\"+navFunct_formatInt(ioNode,99)+\"_InputBuffer\"; + adderDP = sysName+\"LOFAR_ObsSW_OSIONode\"+navFunct_formatInt(ioNode,99)+\"_Adder\"; + + reload(); + + +} + +void prepareProcesses() { + dyn_string result; + // here we need to add the Inputbuffer, adders and the locusnodes that are part of this screen + // so we need to determine all the databasePoints for these processes + + dynAppend(result,\",InputBuffer,\"+inputBufferDP); + dynAppend(g_processesList,inputBufferDP); + + dynClear(writers); + dynClear(locusNodes); + for (int i = 0; i < 10; i++ ) { + dynAppend(result,\",Adder\"+i+\",\"+adderDP+i); + dynAppend(g_processesList,adderDP+i); + int l; + int w; + bool invalid=true; + if (dpGet(adderDP+i+\".locusNode\",l,adderDP+i+\".locusNode:_online.._invalid\",invalid) >= 0) { + if (!invalid) dynAppend(locusNodes,l); + } + if (dpGet(adderDP+i+\".writer\",w,adderDP+i+\".writer:_online.._invalid\",invalid) >= 0) { + if (!invalid) dynAppend(writers,w); + } + } + for (int i = 1; i <= dynlen(writers); i++ ) { + string writerDP=sysName+\"LOFAR_ObsSW_OSLocusNode\"+navFunct_formatInt(locusNodes[i],999)+\"_Writer\"+navFunct_formatInt(writers[i],99); + dynAppend(result,\",Writer\"+navFunct_formatInt(writers[i],99)+\",\"+writerDP); + dynAppend(g_processesList,writerDP); + } + + // write result to the db so various panels can reset themselves + dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".processesList\",result); + + LOG_DEBUG(\"CEP_IONodeProcesses.pnl:prepareProcesses|processList found: \"+ result); + +} + +// +// Callback for dpConnect to action point. +// If there is an action required this point will tell so +// +void doAction(string aDP, string anAction) { + LOG_DEBUG(\"CEP_IONodeProcesses.pnl:doAction| Action required. found: \" + anAction); + // split action into essentials + dyn_string actionString; + if (!navFunct_splitAction(anAction,actionString)) { + return; + } + + LOG_DEBUG(\"CEP_IONodeProcesses.pnl:doAction|found actionString: \" + actionString); + + // Reload + if (actionString[1] == \"Reload\") { + reload(); + } +} + +void reload() { + + // get the name of the selected station + string dp = nodeDP+\".usedStation\"; + if (dpExists(dp) ){ + dpGet(dp,station); + } else { + LOG_ERROR(\"CEP_IONodeProcesses.pnl:main|ERROR DP does not exist: \"+dp); + return; + } + + stationDP=station+\":\"; + + // In the database we can find the IONode involved + string nodeName = navFunct_DPName2CEPName(nodeDP); + + LOG_DEBUG(\"CEP_IONodeProcesses.pnl:main|nodeName working: \"+nodeName); + + redraw(); + + // if no match found we have an error + if (nodeName == \"\" || station == \"\") { + LOG_ERROR(\"CEP_IONodeProcesses.pnl:main| ERROR no station or IONode-name found, can't view running processes\"); + } else { + + // we have to set the stripped inputBuffer List and Adder List here. + // Since this is the Survey mode we only need one InputBuffer and one Adder + dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName\",\"CircularBuffer\", + DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.paramList\",makeDynString(ioNode)); + + + LOG_DEBUG(\"CEP_IONodeProcesses.pnl:main|Station: \"+station); + + setValue(\"ionodeLabel\",\"text\",\"IONode: \"+nodeName); + setValue(\"stationLabel\",\"text\",station); + setValue(\"ionodeLabel\",\"toolTipText\",nodeDP); + setValue(\"stationLabel\",\"toolTipText\",stationDP); + + } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + + + // start the logging process + // navPanel_showLogging(baseDP); + + // connect for selfUpdates + showSelfState(baseDP); + + + + + + navFunct_clearGlobalLists(); + + // set the hardware selectable items for this screen + prepareProcesses(); + + // set panel to ready + g_objectReady=true; + + // trigger that the panel values are calculated and ready + navPanel_setEvent(\"CEP_IONodeProcesses.pnl\",\"Update\"); + +} + + " 0 + E E E E 1 -1 -1 0 188 128 +""0 1 +E "#uses \"navPanel.ctl\" +string baseDP = \"\"; + +string station; +int ioNode; +string nodeDP=\"\"; +string inputBufferDP=\"\"; +string adderDP=\"\"; +string stationDP=\"\"; + +string locusNode; + + +dyn_string refNames; +dyn_string writers; +dyn_string locusNodes; + +string strModuleName; +bool bDoubleClicked = false; + +// routine for single mouse click +void click(string dp) { + // set delay in case double click was meant + delay(0, 100); + if (!bDoubleClicked) { + navPanel_setEvent(\"CEP_IONodeProcesses.pnl\",\"EventClick\"); + } +} + +// routine for double mouse click +void dblClick(string dp) { + // indicate this is a doubleClick + bDoubleClicked = true; + + if (dpExists(dp) ) { + LOG_DEBUG(\"CEP_IONodeProcesses.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+dp); + g_currentDatapoint=dp; + navPanel_setEvent(\"CEP_IONodeProcesses.pnl\",\"ChangePanel\"); + } + // set delay to avoid click event will be triggered + delay(0, 500); + bDoubleClicked = false; +} + +// routine for right mouse click +void rClick(string dp) { + navPanel_setEvent(\"CEP_IONodeProcesses.pnl\",\"EventRightClick\"); +} +void clearRefNames() { + // remove all symbols because new ones will be added + for (int i=1; i <= dynlen(refNames); i++) { + removeSymbol(strModuleName,\"\",refNames[i]); + } + dynClear(refNames); +} + + +void redraw() { + LOG_TRACE(\"CEP_IONodeProcesses.pnl:redraw\"); + string addPanelName = \"objects/Processes/adder.pnl\"; + + // clear old refNames if available + if (dynlen(refNames) > 0) { + clearRefNames(); + } + + // now start adding adders to panel + + for (int i = 0; i < 10; i++ ) { + LOG_TRACE(\"CEP_IONodeProcesses.pnl:redraw|Adding adder: \" + i); + refNames[i+1]=\"singleadder\"+(i); + + if ( addSymbol( strModuleName, // Stay in this modul + \"\", // Name of this panel + addPanelName, // Panel to add + refNames[i+1], // Ref of the addedPanel + makeDynString( \"$adderNumber:\" + i , // Define all $values + \"$nodeDP:\" + nodeDP), // + 0, // Xpos of the AddedSymbol + 245+((i-1)*30), // Ypos of the AddedSymbol + 0, // angle + 1 ,1 // zoomX , zoomY + ) < 0 ) { + LOG_ERROR(\"CEP_IONodeProcesses.pnl:redraw|Error Appending adder : \" + i + \" in this panel.\"); + } + } +} +" 0 + 2 +"CBRef" "1" +"EClose" E +"" +1 +DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 +LAYER, 0 +1 +LANG:1 6 Layer1 +6 658 +"childStateBorder" +"" +1 500 80 E E E 1 E 1 E N {0,0,0} E N "_3DFace" E E + E E +77 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 3 1 2 1 E 1.061061061061061 0 1 0 0 1 E 0 0 999 709 +2 917 +"ionodeLabel" +"" +1 340 10 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(); +}" 0 + "main() +{ + dblClick(); +}" 0 + +78 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E "main() +{ + click(); +}" 0 + 0 1 1 2 1 E U 1 E 340 10 557 34 +0 2 2 "0s" 0 0 0 192 0 0 340 10 1 +1 +LANG:1 33 MS Shell Dlg,14,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 20 Node: R00-M0-N00-J00 +1 957 1 "" 1 +0 +1 958 2 "" 285 +0 +1 959 2 "" 226 +0 +1 960 2 "" 229 +0 +1 961 2 "" 234 +0 +1 962 2 "" 235 +0 +1 963 2 "" 236 +0 +1 964 2 "" 237 +0 +1 965 2 "" 238 +0 +1 966 2 "" 239 +0 +1 967 2 "" 240 +0 +1 968 2 "" 241 +0 +1 969 2 "" 242 +0 +1 970 2 "" 243 +0 +1 971 2 "" 244 +0 +1 972 2 "" 245 +0 +1 973 2 "" 246 +0 +1 974 2 "" 247 +0 +1 975 2 "51" 1 +0 +1 976 2 "" 249 +0 +1 977 2 "" 250 +0 +1 978 2 "" 251 +0 +1 979 2 "" 252 +0 +1 980 2 "" 253 +0 +1 981 2 "" 254 +0 +1 982 2 "" 255 +0 +1 983 2 "" 261 +0 +1 984 2 "" 262 +0 +1 985 2 "" 263 +0 +1 986 2 "" 264 +0 +1 987 2 "" 265 +0 +1 988 2 "" 279 +0 +1 989 2 "" 280 +0 +1 990 2 "" 281 +0 +1 991 2 "" 282 +0 +1 992 2 "" 283 +0 +1 993 2 "" 290 +0 +1 994 2 "" 291 +0 +1 995 2 "" 292 +0 +0 +LAYER, 1 +1 +LANG:1 6 Layer2 +0 +LAYER, 2 +1 +LANG:1 6 Layer3 +0 +LAYER, 3 +1 +LANG:1 6 Layer4 +0 +LAYER, 4 +1 +LANG:1 6 Layer5 +0 +LAYER, 5 +1 +LANG:1 6 Layer6 +0 +LAYER, 6 +1 +LANG:1 6 Layer7 +0 +LAYER, 7 +1 +LANG:1 6 Layer8 +0 +3 1 "selfState" -1 +"objects\\lofar_self_state.pnl" 7 8 T 79 1 0 1 300 4 +0 +3 2 "PANEL_REF2" -1 +"objects\\Processes\\circularBuffer.pnl" 35 32 T 80 1 0 1 190 20 +0 +0 diff --git a/MAC/Navigator2/panels/Processes/CEP_Processes.pnl b/MAC/Navigator2/panels/Processes/CEP_Processes.pnl index 85a5b35f3ac28ef69bf384f5f904674874ad6fd4..94cf82ae878db3def26dc8dd64f8f8acad7c252f 100644 --- a/MAC/Navigator2/panels/Processes/CEP_Processes.pnl +++ b/MAC/Navigator2/panels/Processes/CEP_Processes.pnl @@ -197,21 +197,21 @@ LANG:1 6 logMsg 0 1 188 39 "15" 2 0 -1 189 39 "16" 4 +1 189 39 "" 113 0 -1 190 39 "16" 3 +1 190 39 "" 144 0 -1 191 39 "16.0" 1 +1 191 39 "" 166 0 -1 192 39 "16" 6 +1 192 39 "16" 4 0 -1 193 39 "16" 2 +1 193 39 "16" 3 0 -1 194 39 "" 113 +1 194 39 "16.0" 1 0 -1 195 39 "" 144 +1 195 39 "16" 6 0 -1 196 39 "" 166 +1 196 39 "16" 2 0 1 197 40 "" 4 0 @@ -368,9 +368,9 @@ LANG:1 0 "objects\\Processes\\ObsSW_CEP.pnl" 10 382 T 45 1 0 1 -5 0 0 3 40 "PANEL_REF21" -1 -"objects\\Processes\\controller_small.pnl" 0 280 T 46 1 0 1 0 -14 +"objects\\Processes\\controller_small.pnl" 0 280 T 46 1 0 1 0 -10 1 -"$name""HardwareMonitor" +"$name""CEPHardwareMonitor" 3 41 "PANEL_REF42" -1 "objects\\Processes\\controller_small.pnl" 0 280 T 55 1 0 1 0 15 1 diff --git a/MAC/Navigator2/panels/Processes/CEPlogProcessor.pnl b/MAC/Navigator2/panels/Processes/CEPlogProcessor.pnl new file mode 100644 index 0000000000000000000000000000000000000000..4ed2bda2446cb370801a7df0418acc6e58cfb1d9 --- /dev/null +++ b/MAC/Navigator2/panels/Processes/CEPlogProcessor.pnl @@ -0,0 +1,88 @@ +V 11 +1 +LANG:1 0 +PANEL,-1 -1 1013 750 N "_3DFace" 0 +"main() +{ + // Initialise the Panel + navPanel_initPanel(\"fw_viewBox\"); +}" 0 + E E E E 1 -1 -1 0 0 0 +""0 1 +E "#uses \"navPanel.ctl\"" 0 + 2 +"CBRef" "1" +"EClose" E +"" +DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 +LAYER, 0 +1 +LANG:1 0 +1 1 1 "" 0 +0 +1 2 1 "0" 1 +0 +1 3 1 "" 2 +0 +1 4 1 "" 3 +0 +1 5 1 "" 7 +0 +1 6 1 "" 8 +0 +1 7 1 "" 9 +0 +1 8 1 "" 10 +0 +1 9 1 "" 11 +0 +1 10 1 "" 12 +0 +1 11 1 "" 13 +0 +1 12 1 "" 15 +0 +1 13 1 "" 16 +0 +1 14 1 "" 17 +0 +1 15 1 "" 18 +0 +1 16 1 "" 19 +0 +1 17 1 "" 20 +0 +0 +LAYER, 1 +1 +LANG:1 0 +0 +LAYER, 2 +1 +LANG:1 0 +0 +LAYER, 3 +1 +LANG:1 0 +0 +LAYER, 4 +1 +LANG:1 0 +0 +LAYER, 5 +1 +LANG:1 0 +0 +LAYER, 6 +1 +LANG:1 0 +0 +LAYER, 7 +1 +LANG:1 0 +0 +3 1 "PANEL_REF2" -1 +"objects\\Processes\\daemon_big.pnl" 49 72 T 20 1 0 1 0.999999999999986 -22 +1 +"$daemonName""LogProcessor" +0 diff --git a/MAC/Navigator2/panels/Processes/CalibrationControl.pnl b/MAC/Navigator2/panels/Processes/CalibrationControl.pnl index ceda3c4cef37182cc7d8766ff962757b048bfcbb..750fe35f03282ee2f989ffbf92ebc0d97d13d572 100644 --- a/MAC/Navigator2/panels/Processes/CalibrationControl.pnl +++ b/MAC/Navigator2/panels/Processes/CalibrationControl.pnl @@ -1,4 +1,4 @@ -V 10 +V 11 1 LANG:1 0 PANEL,-1 -1 1013 750 N "_3DFace" 0 @@ -21,7 +21,7 @@ PANEL,-1 -1 1013 750 N "_3DFace" 0 baseDP + \".connected:_online.._invalid\") == -1) { } if (!navFunct_dpReachable(baseDP)) { - updateCalibrationControl(\"\",false,\"\",\"\",\"\",\"\",\"\",\"\",\"\",0,\"\".makeDynString(),\"\",true); + updateCalibrationControl(\"\",false,\"\",\"\",\"\",\"\",\"\",\"\",\"\",0,\"\",makeDynString(),\"\",true); } } else { LOG_ERROR(\"CalibrationControl.pnl:main|Couldn't find DP to connect to: \"+baseDP); @@ -202,12 +202,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 30 320 95 334 +E E 0 1 1 2 1 E U 1 E 30 320 95 333 0 2 2 "0s" 0 0 0 192 0 0 30 320 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 10 Connected: 6 51 "connectedText" @@ -236,12 +235,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 30 344 109 358 +E E 0 1 1 2 1 E U 1 E 30 344 109 357 0 2 2 "0s" 0 0 0 192 0 0 30 344 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 13 antennaArray: 14 66 "antennaArrayText" @@ -256,9 +254,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 113 338 992 359 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 113 338 992 359 2 "0s" 0 0 0 0 0 -1 E E E 25 82 "beamTable" @@ -273,9 +270,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 113 422 367 597 +LANG:1 33 MS Shell Dlg,-1,13,5,50,0,0,0,0,0 +0 113 422 367 597 EE 1 0 1 1 8 "Name" 22 1 0 "s" 1 LANG:1 4 Name E @@ -301,9 +297,8 @@ LANG:1 2 #2 LANG:1 2 #1 10 8 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -0 1 0 1 7 +LANG:1 33 MS Shell Dlg,-1,13,5,50,0,0,0,0,0 +0 0 1 0 1 7 1 0 2 83 "PRIMITIVE_TEXT10" @@ -318,12 +313,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 30 428 103 442 +E E 0 1 1 2 1 E U 1 E 30 428 103 441 0 2 2 "0s" 0 0 0 192 0 0 30 428 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 10 BeamNames: 2 84 "PRIMITIVE_TEXT11" @@ -338,12 +332,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 30 365 61 379 +E E 0 1 1 2 1 E U 1 E 30 365 61 378 0 2 2 "0s" 0 0 0 192 0 0 30 365 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 6 rcu's: 14 85 "rcusText" @@ -358,9 +351,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 113 359 992 380 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 113 359 992 380 2 "0s" 0 0 0 0 0 -1 E E E 2 86 "PRIMITIVE_TEXT12" @@ -375,12 +367,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 30 386 59 400 +E E 0 1 1 2 1 E U 1 E 30 386 59 399 0 2 2 "0s" 0 0 0 192 0 0 30 386 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 7 filter: 14 87 "filterText" @@ -395,9 +386,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 113 380 332 401 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 113 380 332 401 2 "0s" 0 0 0 0 0 -1 E E E 2 88 "PRIMITIVE_TEXT13" @@ -412,12 +402,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 30 407 101 421 +E E 0 1 1 2 1 E U 1 E 30 407 101 420 0 2 2 "0s" 0 0 0 192 0 0 30 407 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 12 nyquistzone: 14 89 "nyquistzoneText" @@ -432,9 +421,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 113 401 162 422 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 113 401 162 422 2 "0s" 0 0 0 0 0 -1 E E E 0 LAYER, 1 @@ -465,8 +453,8 @@ LAYER, 7 1 LANG:1 0 0 -3 0 "PANEL_REF1" +3 0 "PANEL_REF1" -1 "objects\\Processes\\controller_top.pnl" 49 92 T 0 1 0 1 1.4432899320127e-014 -40 1 "$ctrlName""CalibrationControl" -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/Processes/MACScheduler.pnl b/MAC/Navigator2/panels/Processes/MACScheduler.pnl index dd539c4f8d7be8e0ff6565e022f305a7b6be161c..700135b1626990037ca1df51e4c2e9b36b5917f6 100644 --- a/MAC/Navigator2/panels/Processes/MACScheduler.pnl +++ b/MAC/Navigator2/panels/Processes/MACScheduler.pnl @@ -1,4 +1,4 @@ -V 10 +V 11 1 LANG:1 0 PANEL,-1 -1 1013 750 N "_3DFace" 0 @@ -150,7 +150,7 @@ updateOTDB(string dp1, bool connected, setValue(\"txt_OTDBpollinterval\", \"backCol\", \"Lofar_invalid\"); } else { setValue(\"txt_OTDBconnected\", \"backCol\", \"Lofar_dpOffline\"); - setValue(\"txt_OTDBlastPoll\", \"backCol\", \"Lofar_idpOffline\"); + setValue(\"txt_OTDBlastPoll\", \"backCol\", \"Lofar_dpOffline\"); setValue(\"txt_OTDBpollinterval\", \"backCol\", \"Lofar_dpOffline\"); } } @@ -268,9 +268,8 @@ LANG:1 0 "dashclr"N "_Transparent" E E 0 0 1 0 1 E 2.28571428571429 0 0.487179487179487 -38.5714285714286 172.384615384615 0 E 30 303 451 421 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 4 OTDB 2 13 "PRIMITIVE_TEXT7" @@ -285,12 +284,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 40 344 105 358 +E E 0 1 1 2 1 E U 1 E 40 344 105 357 0 2 2 "0s" 0 0 0 192 0 0 40 344 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 10 Connected: 2 14 "PRIMITIVE_TEXT8" @@ -305,12 +303,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 349 344 421 358 +E E 0 1 1 2 1 E U 1 E 349 344 421 357 0 2 2 "0s" 0 0 0 192 0 0 349 344 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 14 Poll Interval: 2 15 "PRIMITIVE_TEXT9" @@ -325,12 +322,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 665 344 718 358 +E E 0 1 1 2 1 E U 1 E 665 344 718 357 0 2 2 "0s" 0 0 0 192 0 0 665 344 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 10 Last Poll: 14 16 "txt_OTDBconnected" @@ -345,9 +341,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 115 341 339 362 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 115 341 339 362 2 "0s" 0 0 0 0 0 -1 E E E 14 17 "txt_OTDBpollinterval" @@ -362,9 +357,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 428 338 652 359 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 428 338 652 359 2 "0s" 0 0 0 0 0 -1 E E E 14 18 "txt_OTDBlastPoll" @@ -379,9 +373,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 728 341 952 362 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 728 341 952 362 2 "0s" 0 0 0 0 0 -1 E E E 17 19 "PlannedObservationList" @@ -396,9 +389,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 28 418 322 722 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 28 418 322 722 0 E @@ -419,12 +411,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 100 390 228 404 +E E 0 1 1 2 1 E U 1 E 100 390 228 403 0 2 2 "0s" 0 0 0 192 0 0 100 390 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 21 Planned Observations: 17 32 "ActiveObservationList" @@ -439,9 +430,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 358 418 652 722 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 358 418 652 722 0 E @@ -462,12 +452,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 430 392 548 406 +E E 0 1 1 2 1 E U 1 E 430 392 548 405 0 2 2 "0s" 0 0 0 192 0 0 430 392 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 20 Active Observations: 17 34 "FinishedObservationList" @@ -482,9 +471,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 688 420 982 722 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 688 420 982 722 0 E @@ -505,12 +493,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 760 392 889 406 +E E 0 1 1 2 1 E U 1 E 760 392 889 405 0 2 2 "0s" 0 0 0 192 0 0 760 392 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 22 Finished Observations: 0 LAYER, 1 @@ -541,8 +528,8 @@ LAYER, 7 1 LANG:1 0 0 -3 0 "PANEL_REF1" +3 0 "PANEL_REF1" -1 "objects\\Processes\\controller_top.pnl" 49 92 T 0 1 0 1 1.4432899320127e-014 -40 1 "$ctrlName""MACScheduler" -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl b/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl index f8de83016d7cc7044273b4e7b02e924d3e023451..e0e6e35b6aeefb4c88f262014908a1a600d2bc30 100644 --- a/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl +++ b/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl @@ -1,4 +1,4 @@ -V 10 +V 11 1 LANG:1 0 PANEL,-1 -1 1000 735 N "_3DFace" 0 @@ -73,12 +73,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 370 2 446 23 +E E 0 1 1 2 1 E U 1 E 370 2 446 22 0 2 2 "0s" 0 0 0 192 0 0 370 2 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,16,5,75,0,0,0,0,0 +0 1 LANG:1 7 Daemons 2 37 "PRIMITIVE_TEXT2" @@ -93,12 +92,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 370 186 439 207 +E E 0 1 1 2 1 E U 1 E 370 186 439 206 0 2 2 "0s" 0 0 0 192 0 0 370 186 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,16,5,75,0,0,0,0,0 +0 1 LANG:1 6 PermSW 1 137 12 "" 1 0 @@ -118,9 +116,9 @@ LANG:1 6 PermSW 0 1 145 12 "14.0" 1 0 -1 146 12 "14" 2 +1 146 12 "14" 6 0 -1 147 12 "14" 6 +1 147 12 "14" 2 0 1 148 12 "15" 4 0 @@ -128,61 +126,61 @@ LANG:1 6 PermSW 0 1 150 12 "15.0" 1 0 -1 151 12 "15" 2 +1 151 12 "15" 6 0 -1 152 12 "15" 6 +1 152 12 "15" 2 0 -1 153 12 "16" 4 +1 153 12 "17" 4 0 -1 154 12 "16" 3 +1 154 12 "17" 3 0 -1 155 12 "16.0" 1 +1 155 12 "17.0" 1 0 -1 156 12 "16" 2 +1 156 12 "17" 6 0 -1 157 12 "16" 6 +1 157 12 "17" 2 0 -1 158 12 "17" 4 +1 158 12 "18" 4 0 -1 159 12 "17" 3 +1 159 12 "18" 3 0 -1 160 12 "17.0" 1 +1 160 12 "18.0" 1 0 -1 161 12 "17" 2 +1 161 12 "18" 6 0 -1 162 12 "17" 6 +1 162 12 "18" 2 0 -1 163 12 "18" 4 +1 163 12 "19" 4 0 -1 164 12 "18" 3 +1 164 12 "19" 3 0 -1 165 12 "18.0" 1 +1 165 12 "19.0" 1 0 -1 166 12 "18" 2 +1 166 12 "19" 6 0 -1 167 12 "18" 6 +1 167 12 "19" 2 0 -1 168 12 "19" 4 +1 168 12 "" 79 0 -1 169 12 "19" 3 +1 169 12 "" 80 0 -1 170 12 "19.0" 1 +1 170 12 "" 82 0 -1 171 12 "19" 2 +1 171 12 "" 113 0 -1 172 12 "19" 6 +1 172 12 "" 144 0 -1 173 12 "" 79 +1 173 12 "" 145 0 -1 174 12 "" 80 +1 174 12 "20" 4 0 -1 175 12 "" 82 +1 175 12 "20" 3 0 -1 176 12 "" 113 +1 176 12 "20.0" 1 0 -1 177 12 "" 144 +1 177 12 "20" 6 0 -1 178 12 "" 145 +1 178 12 "20" 2 0 1 179 13 "" 4 0 @@ -207,12 +205,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 199 18 206 32 +E E 0 1 1 2 1 E U 1 E 199 18 206 31 0 2 2 "0s" 0 0 0 192 0 0 199 18 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 1 A 2 112 "PRIMITIVE_TEXT10" @@ -227,12 +224,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 220 18 254 32 +E E 0 1 1 2 1 E U 1 E 220 18 254 31 0 2 2 "0s" 0 0 0 192 0 0 220 18 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 6 logMsg 1 184 14 "" 4 0 @@ -287,12 +283,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 163 205 184 219 +E E 0 1 1 2 1 E U 1 E 163 205 184 218 0 2 2 "0s" 0 0 0 192 0 0 163 205 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 5 error 2 135 "PRIMITIVE_TEXT13" @@ -307,12 +302,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 288 205 351 219 +E E 0 1 1 2 1 E U 1 E 288 205 351 218 0 2 2 "0s" 0 0 0 192 0 0 288 205 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 13 currentAction 2 136 "PRIMITIVE_TEXT14" @@ -327,12 +321,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 413 205 447 219 +E E 0 1 1 2 1 E U 1 E 413 205 447 218 0 2 2 "0s" 0 0 0 192 0 0 413 205 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 6 logMsg 1 204 20 "" 4 0 @@ -383,35 +376,35 @@ LAYER, 7 1 LANG:1 0 0 -3 12 "PANEL_REF13" -"objects\\Processes\\ObsSW_Main.pnl" 75 402 T 15 1 0 1 -69 -110 +3 12 "PANEL_REF13" -1 +"objects\\Processes\\ObsSW_Main.pnl" 75 402 T 15 1 0 1 -65 -110 0 -3 13 "PANEL_REF14" +3 13 "PANEL_REF14" -1 "objects\\Processes\\daemon_small.pnl" 0 40 T 16 1 0 1 0 -8 1 "$name""LogProcessor" -3 14 "PANEL_REF15" +3 14 "PANEL_REF15" -1 "objects\\Processes\\daemon_small.pnl" 0 80 T 24 1 0 1 0 -18 1 "$name""ServiceBroker" -3 15 "PANEL_REF16" +3 15 "PANEL_REF16" -1 "objects\\Processes\\daemon_small.pnl" 0 110 T 25 1 0 1 0 -18 1 "$name""CTStartDaemon" -3 16 "PANEL_REF17" +3 16 "PANEL_REF17" -1 "objects\\Processes\\daemon_small.pnl" 0 140 T 26 1 0 1 0 -18 1 "$name""SASGateway" -3 19 "PANEL_REF20" +3 19 "PANEL_REF20" -1 "objects\\Processes\\controller_small.pnl" 0 220 T 27 U 1 "$name""MACScheduler" -3 20 "PANEL_REF21" +3 20 "PANEL_REF21" -1 "objects\\Processes\\controller_small.pnl" 0 280 T 35 1 0 1 0 -32 1 "$name""SoftwareMonitor" -3 21 "PANEL_REF22" +3 21 "PANEL_REF22" -1 "objects\\Processes\\daemon_small.pnl" 0 140 T 35 1 0 1 0 12 1 "$name""KeyValueLogger" -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/Processes/PythonControl.pnl b/MAC/Navigator2/panels/Processes/PythonControl.pnl new file mode 100644 index 0000000000000000000000000000000000000000..936a31a6404c6392cff74bfe9a1c7f61d5e894cd --- /dev/null +++ b/MAC/Navigator2/panels/Processes/PythonControl.pnl @@ -0,0 +1,165 @@ +V 11 +1 +LANG:1 0 +PANEL,-1 -1 1013 750 N "_3DFace" 0 +"main() +{ + // Initialise the Panel + navPanel_initPanel(\"fw_viewBox\"); + + baseDP = g_currentDatapoint; + database = dpSubStr(baseDP,DPSUB_SYS); + + reload(); +} + +void prepareProcesses() { + dyn_string result; + + dynAppend(result,\",PythonControl,\"+baseDP); + dynAppend(g_processesList,baseDP); + + + // write result to the db so various panels can reset themselves + dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".processesList\",result); + + LOG_DEBUG(\"PythonControl.pnl:prepareProcesses|processList found: \"+ result); + +} + +// +// Callback for dpConnect to action point. +// If there is an action required this point will tell so +// +void doAction(string aDP, string anAction) { + LOG_DEBUG(\"PythonControl.pnl:doAction| Action required. found: \" + anAction); + // split action into essentials + dyn_string actionString; + if (!navFunct_splitAction(anAction,actionString)) { + return; + } + + LOG_DEBUG(\"PythonControl.pnl:doAction|found actionString: \" + actionString); + + // Reload + if (actionString[1] == \"Reload\") { + reload(); + } +} + +void reload() { + + navFunct_clearGlobalLists(); + + // set the observation selectable items + prepareProcesses(); + + // set panel to ready + g_objectReady=true; + + // trigger that the panel values are calculated and ready + navPanel_setEvent(\"PythonControl.pnl\",\"Update\"); +} + +" 0 + E E E E 1 -1 -1 0 49 92 +""0 1 +E "#uses \"navPanel.ctl\" + +string baseDP=\"\"; +string database=\"\";" 0 + 2 +"CBRef" "1" +"EClose" E +"" +DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 +LAYER, 0 +1 +LANG:1 0 +1 48 0 "" 0 +0 +1 49 0 "0" 1 +0 +1 50 0 "" 2 +0 +1 51 0 "" 3 +0 +1 52 0 "" 7 +0 +1 53 0 "" 8 +0 +1 54 0 "" 9 +0 +1 55 0 "" 10 +0 +1 56 0 "" 11 +0 +1 57 0 "" 12 +0 +1 58 0 "" 13 +0 +1 59 0 "" 15 +0 +1 60 0 "" 16 +0 +1 61 0 "" 17 +0 +1 62 0 "" 18 +0 +1 63 0 "" 19 +0 +1 64 0 "" 20 +0 +2 47 +"PRIMITIVE_TEXT7" +"" +1 30 320 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + E E +21 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 1 E 30 320 60 333 +0 2 2 "0s" 0 0 0 192 0 0 30 320 1 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 +LANG:1 4 None +0 +LAYER, 1 +1 +LANG:1 0 +0 +LAYER, 2 +1 +LANG:1 0 +0 +LAYER, 3 +1 +LANG:1 0 +0 +LAYER, 4 +1 +LANG:1 0 +0 +LAYER, 5 +1 +LANG:1 0 +0 +LAYER, 6 +1 +LANG:1 0 +0 +LAYER, 7 +1 +LANG:1 0 +0 +3 0 "PANEL_REF1" -1 +"objects\\Processes\\controller_top.pnl" 49 92 T 0 1 0 1 1.4432899320127e-014 -40 +1 +"$ctrlName""PythonControl" +0 diff --git a/MAC/Navigator2/panels/Processes/Station_Processes.pnl b/MAC/Navigator2/panels/Processes/Station_Processes.pnl index a71d369bcf3b194e03758c6469ae789b5fc9701e..b2bd0c83af1a82cbd7e22058148d40fa48c21d62 100644 --- a/MAC/Navigator2/panels/Processes/Station_Processes.pnl +++ b/MAC/Navigator2/panels/Processes/Station_Processes.pnl @@ -1,7 +1,7 @@ -V 10 +V 11 1 LANG:1 0 -PANEL,-1 -1 1016 737 N "_3DFace" 0 +PANEL,-1 -1 1016 732 N "_3DFace" 0 "main() { // Initialise the Panel @@ -93,12 +93,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 370 2 446 23 +E E 0 1 1 2 1 E U 1 E 370 2 446 22 0 2 2 "0s" 0 0 0 192 0 0 370 2 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,16,5,75,0,0,0,0,0 +0 1 LANG:1 7 Daemons 2 37 "PRIMITIVE_TEXT2" @@ -113,12 +112,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 380 140 449 161 +E E 0 1 1 2 1 E U 1 E 380 140 449 160 0 2 2 "0s" 0 0 0 192 0 0 380 140 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,16,5,75,0,0,0,0,0 +0 1 LANG:1 6 PermSW 1 232 13 "" 4 0 @@ -143,12 +141,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 200 20 207 34 +E E 0 1 1 2 1 E U 1 E 200 20 207 33 0 2 2 "0s" 0 0 0 192 0 0 200 20 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 1 A 2 112 "PRIMITIVE_TEXT10" @@ -163,12 +160,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 220 21 254 35 +E E 0 1 1 2 1 E U 1 E 220 21 254 34 0 2 2 "0s" 0 0 0 192 0 0 220 21 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 6 logMsg 1 237 14 "" 4 0 @@ -213,12 +209,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 162 212 183 226 +E E 0 1 1 2 1 E U 1 E 162 212 183 225 0 2 2 "0s" 0 0 0 192 0 0 162 212 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 5 error 2 135 "PRIMITIVE_TEXT13" @@ -233,12 +228,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 286 212 349 226 +E E 0 1 1 2 1 E U 1 E 286 212 349 225 0 2 2 "0s" 0 0 0 192 0 0 286 212 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 13 currentAction 2 136 "PRIMITIVE_TEXT14" @@ -253,12 +247,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 415 212 449 226 +E E 0 1 1 2 1 E U 1 E 415 212 449 225 0 2 2 "0s" 0 0 0 192 0 0 415 212 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 6 logMsg 1 252 20 "" 4 0 @@ -330,9 +323,9 @@ LANG:1 6 logMsg 0 1 286 31 "20.0" 1 0 -1 287 31 "20" 2 +1 287 31 "20" 6 0 -1 288 31 "20" 6 +1 288 31 "20" 2 0 1 289 31 "21" 4 0 @@ -340,9 +333,9 @@ LANG:1 6 logMsg 0 1 291 31 "21.0" 1 0 -1 292 31 "21" 2 +1 292 31 "21" 6 0 -1 293 31 "21" 6 +1 293 31 "21" 2 0 1 294 31 "22" 4 0 @@ -350,9 +343,9 @@ LANG:1 6 logMsg 0 1 296 31 "22.0" 1 0 -1 297 31 "22" 2 +1 297 31 "22" 6 0 -1 298 31 "22" 6 +1 298 31 "22" 2 0 1 299 31 "" 97 0 @@ -419,12 +412,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 202 162 209 176 +E E 0 1 1 2 1 E U 1 E 202 162 209 175 0 2 2 "0s" 0 0 0 192 0 0 202 162 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 1 A 2 231 "PRIMITIVE_TEXT16" @@ -439,12 +431,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 222 163 256 177 +E E 0 1 1 2 1 E U 1 E 222 163 256 176 0 2 2 "0s" 0 0 0 192 0 0 222 163 1 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 1 LANG:1 6 logMsg 0 LAYER, 1 @@ -475,62 +466,62 @@ LAYER, 7 1 LANG:1 0 0 -3 13 "PANEL_REF14" +3 13 "PANEL_REF14" -1 "objects\\Processes\\daemon_small.pnl" 0 40 T 16 1 0 1 0 -5 1 "$name""LogProcessor" -3 14 "PANEL_REF15" +3 14 "PANEL_REF15" -1 "objects\\Processes\\daemon_small.pnl" 0 80 T 24 1 0 1 0 -13 1 "$name""ServiceBroker" -3 15 "PANEL_REF16" +3 15 "PANEL_REF16" -1 "objects\\Processes\\daemon_small.pnl" 0 110 T 25 1 0 1 0 70 1 "$name""CTStartDaemon" -3 16 "PANEL_REF17" +3 16 "PANEL_REF17" -1 "objects\\Processes\\daemon_small.pnl" 0 140 T 26 1 0 1 0 -41 1 "$name""SASGateway" -3 20 "PANEL_REF21" +3 20 "PANEL_REF21" -1 "objects\\Processes\\controller_small.pnl" 0 280 T 35 1 0 1 0 -50 1 "$name""AMCServer" -3 21 "PANEL_REF22" +3 21 "PANEL_REF22" -1 "objects\\Processes\\controller_small.pnl" 0 270 T 35 1 0 1 0 -12 1 "$name""BeamServer" -3 22 "PANEL_REF23" +3 22 "PANEL_REF23" -1 "objects\\Processes\\controller_small.pnl" 0 330 T 36 1 0 1 0 -44 1 "$name""CalServer" -3 25 "PANEL_REF26" +3 25 "PANEL_REF26" -1 "objects\\Processes\\controller_small.pnl" 0 380 T 37 1 0 1 0 -66 1 "$name""SHMInfoServer" -3 28 "PANEL_REF29" +3 28 "PANEL_REF29" -1 "objects\\Processes\\controller_small.pnl" 10 430 T 39 1 0 1 -10 -88 1 "$name""RSPDriver" -3 31 "PANEL_REF32" -"objects\\Processes\\ObsSW_Station.pnl" 100 502 T 39 1 0 1 -110 20.00000000000001 +3 31 "PANEL_REF32" -1 +"objects\\Processes\\ObsSW_Station.pnl" 100 502 T 39 1 0 1 -100 20.00000000000001 0 -3 32 "PANEL_REF33" +3 32 "PANEL_REF33" -1 "objects\\Processes\\controller_small.pnl" 10 470 T 40 1 0 1 -10 -100 1 "$name""TBBDriver" -3 34 "PANEL_REF35" +3 34 "PANEL_REF35" -1 "objects\\Processes\\controller_small.pnl" 10 470 T 40 1 0 1 -10 -72 1 "$name""StationControl" -3 36 "PANEL_REF37" +3 36 "PANEL_REF37" -1 "objects\\Processes\\controller_small.pnl" 10 470 T 42 1 0 0.9653979238754328 -10 -26.7370242214534 1 "$name""ClockControl" -3 37 "PANEL_REF38" +3 37 "PANEL_REF38" -1 "objects\\Processes\\controller_small.pnl" 10 470 T 43 1 0 1 -10 -15 1 "$name""HardwareMonitor" -3 38 "PANEL_REF39" +3 38 "PANEL_REF39" -1 "objects\\Processes\\controller_small.pnl" 10 470 T 44 1 0 1 -10 14 1 "$name""SoftwareMonitor" diff --git a/MAC/Navigator2/panels/main.pnl b/MAC/Navigator2/panels/main.pnl index 894b4c84532bdd2e5af3c2e42dbe4d8a46da5113..6e3543608440157ace313004f7d6bef8edaeace4 100644 --- a/MAC/Navigator2/panels/main.pnl +++ b/MAC/Navigator2/panels/main.pnl @@ -1,44 +1,379 @@ -V 10 -1 -LANG:1 0 -PANEL,1 1 1250 770 N "_3DFace" 0 -E E E E E 1 -1 -1 0 -1 -1 -""0 1 -E E 2 -"CBRef""1" -"EClose"E -"" -DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 -LAYER, 0 -1 -LANG:1 0 -0 -LAYER, 1 -1 -LANG:1 0 -0 -LAYER, 2 -1 -LANG:1 0 -0 -LAYER, 3 -1 -LANG:1 0 -0 -LAYER, 4 -1 -LANG:1 0 -0 -LAYER, 5 -1 -LANG:1 0 -0 -LAYER, 6 -1 -LANG:1 0 -0 -LAYER, 7 -1 -LANG:1 0 -0 -0 \ No newline at end of file +V 11 +1 +LANG:1 0 +PANEL,-1 -1 1010 745 N "_3DFace" 0 +"main() +{ + // Initialise the Panel + navPanel_initPanel(\"fw_viewBox\"); + + baseDP=g_currentDatapoint; + + strPanelName = \"antennaField\"; + strModuleName = myModuleName(); + + stationList = makeDynString(\"CS001\",\"CS002\",\"CS003\",\"CS004\",\"CS005\",\"CS006\",\"RS007\", + \"CS011\",\"CS013\",\"CS017\", + \"CS021\",\"CS024\",\"CS026\",\"CS028\", + \"CS030\",\"CS031\",\"CS032\", + \"RS101\",\"RS103\",\"RS201\",\"RS301\",\"RS302\",\"RS401\",\"RS501\", + \"RS106\", + \"RS205\",\"rs208\",\"RS210\", + \"RS305\",\"RS306\",\"RS307\",\"RS310\", + \"RS406\",\"RS407\",\"RS409\", + \"RS503\",\"RS508\",\"RS509\", + \"DE601\",\"DE602\",\"DE603\",\"DE604\",\"RS605\",\"FR606\",\"SE607\",\"UK608\", + \"CCU001\",\"MCU001\"); + + redraw(); + +} + +// +// Callback for dpConnect to action point. +// If there is an action required this point will tell so +// +void doAction(string aDP, string anAction) { + LOG_DEBUG(\"swlevel.pnl:doAction| Action required. found: \" + anAction); + // split action into essentials + dyn_string actionString; + if (!navFunct_splitAction(anAction,actionString)) { + return; + } + + LOG_DEBUG(\"swlevel.pnl:doAction|found actionString: \" + actionString); + + // Reload + if (actionString[1] == \"Reload\") { + redraw(arrayList.text(arrayList.number())); + return; + } else if (actionString[1] == \"DistChanged\") { + // for dist system bound hardware only, if the distsystem went offline we need to replace + // the screen with a broken connection screen. + if (!g_initializing) { + + // check if this syst is in the connectionlist and down + int iPos=dynContains(g_connections[\"NAME\"],sysName); + if (iPos > 0) { + if (!g_connections[\"UP\"][iPos]) { + navPanel_setEvent(\"invalid DP\",\"ChangePanel\"); + } + } + } + return; + } +} +" 0 + E E E E 1 -1 -1 0 20 30 +""0 1 +E "#uses \"navPanel.ctl\" + +dyn_string stationList; +dyn_string SWLevelRefNames; +dyn_string datastreamRefNames; +string strPanelName; +string strModuleName; +string baseDP=\"\"; + +void clearSWLevelRefNames() { + // remove all symbols because new ones will be added + for (int i=1; i <= dynlen(SWLevelRefNames); i++) { + removeSymbol(strModuleName,\"\",SWLevelRefNames[i]); + } + dynClear(SWLevelRefNames); +} + +void clearDatastreamRefNames() { + // remove all symbols because new ones will be added + for (int i=1; i <= dynlen(datastreamRefNames); i++) { + removeSymbol(strModuleName,\"\",datastreamRefNames[i]); + } + dynClear(datastreamRefNames); +} + +void redraw() { + + navFunct_clearGlobalLists(); + + string addPanelName = \"objects/swlevel.pnl\"; + + if (dynlen(SWLevelRefNames) > 0) { + clearSWLevelRefNames(); + } + + if (dynlen(datastreamRefNames) > 0) { + clearDatastreamRefNames(); + } + + int xPos_AddSymbol = 0; + int yPos_AddSymbol = 18; + int ref = 1; + string addPanelName = \"objects/swlevel.pnl\"; + //loop over list and prepare panel with all stations and swlevel objects + for (int i=1; i<= dynlen(stationList); i++) { + + SWLevelRefNames[i]=\"stationSW\"+(i); + + if ( addSymbol( strModuleName, // Stay in this modul + \"\", // Name of this panel + addPanelName, // Panel to add + SWLevelRefNames[ref], // Ref of the addedPanel + makeDynString( \"$station:\" + stationList[i]) , // Define all $values + xPos_AddSymbol, // Xpos of the AddedSymbol + yPos_AddSymbol, // Ypos of the AddedSymbol + 0, // angle + 1 ,1 // zoomX , zoomY + ) < 0 ) { + LOG_ERROR(\"swlevel.pnl:redraw|Error Appending swlevel for: \" + stationList[i] + \" in this panel.\"); + } + yPos_AddSymbol += 10; + ref++; + } + + xPos_AddSymbol = 150; + yPos_AddSymbol = 18; + ref = 1; + addPanelName = \"objects/datastreamLevel.pnl\"; + //loop over list and prepare panel with all datastreamobjects + for (int i=1; i<= dynlen(stationList); i++) { + //skip CCU and MCU machines + if (strpos(stationList[i],\"MCU\") >=0 ||strpos(stationList[i],\"CCU\") >=0) continue; + + datastreamRefNames[i]=\"datastream\"+(i); + + if ( addSymbol( strModuleName, // Stay in this modul + \"\", // Name of this panel + addPanelName, // Panel to add + datastreamRefNames[ref], // Ref of the addedPanel + makeDynString( \"$station:\" + stationList[i]) , // Define all $values + xPos_AddSymbol, // Xpos of the AddedSymbol + yPos_AddSymbol, // Ypos of the AddedSymbol + 0, // angle + 1 ,1 // zoomX , zoomY + ) < 0 ) { + LOG_ERROR(\"swlevel.pnl:redraw|Error datastream for : \" + stationList[i] + \" in this panel.\"); + } + yPos_AddSymbol += 10; + ref++; + } + // trigger that the panel values are calculated and ready + dynClear(highlight); + dynClear(strHighlight); + + // set panel to ready + g_objectReady=true; + + navPanel_setEvent(\"swlevel.pnl\",\"Update\"); +}" 0 + 2 +"CBRef" "1" +"EClose" E +"" +DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 +LAYER, 0 +1 +LANG:1 0 +2 4 +"PRIMITIVE_TEXT4" +"" +1 65 10 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +4 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 65 10 107 23 +0 2 2 "0s" 0 0 0 192 0 0 65 10 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 7 swlevel +6 21 +"RECTANGLE1" +"" +1 140 140 E E E 1 E 1 E N {0,0,0} E N "green" E E + E E +6 0 0 0 0 0 +E E E +0 +1 +LANG:1 7 Level 6 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 0.7142857142857143 -10 60 1 E 140 140 150 210 +6 22 +"RECTANGLE2" +"" +1 140 140 E E E 1 E 1 E N {0,0,0} E N "yellow" E E + E E +7 0 0 0 0 0 +E E E +0 +1 +LANG:1 9 Level 2-5 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 0.7142857142857143 -10 110 1 E 140 140 150 210 +6 23 +"RECTANGLE3" +"" +1 140 140 E E E 1 E 1 E N {0,0,0} E N {255,170,0} E E + E E +8 0 0 0 0 0 +E E E +0 +1 +LANG:1 7 Level 1 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 0.7142857142857143 -10 160 1 E 140 140 150 210 +6 24 +"RECTANGLE4" +"" +1 140 140 E E E 1 E 1 E N {0,0,0} E N "red" E E + E E +9 0 0 0 0 0 +E E E +0 +1 +LANG:1 7 Level 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 0.7142857142857143 -10 210 1 E 140 140 150 210 +2 25 +"PRIMITIVE_TEXT5" +"" +1 155 2 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +10 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 155 2 196 15 +0 2 2 "0s" 0 0 0 192 0 0 155 2 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 6 stream +6 26 +"RECTANGLE5" +"" +1 140 140 E E E 1 E 1 E N {0,0,0} E N "green" E E + E E +11 0 0 0 0 0 +E E E +0 +1 +LANG:1 13 datastream on + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1.428571428571429 75 -40 1 E 140 140 150 210 +6 27 +"RECTANGLE6" +"" +1 140 140 E E E 1 E 1 E N {0,0,0} E N "red" E E + E E +12 0 0 0 0 0 +E E E +0 +1 +LANG:1 14 datastream off + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1.428571428571429 75 60 1 E 140 140 150 210 +4 28 +"LINE1" +"" +1 230 0 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E + E E +13 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 2 1 2 1 E 230 0 230 540 +2 29 +"PRIMITIVE_TEXT6" +"" +1 160 15 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +14 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 160 15 167 28 +0 2 2 "0s" 0 0 0 192 0 0 160 15 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 1 0 +2 30 +"PRIMITIVE_TEXT7" +"" +1 190 15 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + E E +15 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E U 0 E 190 15 197 28 +0 2 2 "0s" 0 0 0 192 0 0 190 15 1 +1 +LANG:1 34 MS Shell Dlg 2,8,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 1 1 +0 +LAYER, 1 +1 +LANG:1 0 +0 +LAYER, 2 +1 +LANG:1 0 +0 +LAYER, 3 +1 +LANG:1 0 +0 +LAYER, 4 +1 +LANG:1 0 +0 +LAYER, 5 +1 +LANG:1 0 +0 +LAYER, 6 +1 +LANG:1 0 +0 +LAYER, 7 +1 +LANG:1 0 +0 +0 diff --git a/MAC/Navigator2/panels/objects/Hardware/CEP_BGPRack.pnl b/MAC/Navigator2/panels/objects/Hardware/CEP_BGPRack.pnl index 2ecb652c552260017df2fd05ad7d558ddddc536f..78648fd56baeb464597e12fb7d0b1d47e9e928c7 100644 --- a/MAC/Navigator2/panels/objects/Hardware/CEP_BGPRack.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/CEP_BGPRack.pnl @@ -19,7 +19,7 @@ PANEL,-1 -1 669 432 N "_3DFace" 0 dpConnect(\"controlBGP\", baseDP + \".BGPSwitch:_online.._value\", baseDP + \".BGPSwitch:_online.._invalid\"); if (!navFunct_dpReachable(baseDP)) { - controlIOnode(\"\",false,\"\",true); + controlBGP(\"\",false,\"\",true); } } diff --git a/MAC/Navigator2/panels/objects/Hardware/CEP_IONode_small.pnl b/MAC/Navigator2/panels/objects/Hardware/CEP_IONode_small.pnl index 46666a02957f1481db7ba87d65bb6083e732b004..31f7437df86eace1dd8527a5c01aee027b6033a7 100644 --- a/MAC/Navigator2/panels/objects/Hardware/CEP_IONode_small.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/CEP_IONode_small.pnl @@ -22,25 +22,19 @@ PANEL,-1 -1 823 158 N "_3DFace" 1 nodeNr = $nodeNr; IONodeNr=nodeNr+(32*midplaneNr); // Midplaneindex + (32* nodeNr); - - if (IONodeNr < 10) { - baseDP+=\"_IONode0\"+IONodeNr; - } else { - baseDP+=\"_IONode\"+IONodeNr; - } - + baseDP+=\"_IONode\"+navFunct_formatInt(IONodeNr,99); string nodeName = navFunct_DPName2CEPName(baseDP); setValue(\"nodeName\",\"text\",\"Node: \"+nodeName); if(dpExists(baseDP + \".usedStation\")) { - dpConnect(\"controlIOnode\", baseDP + \".usedStation:_online.._value\", - baseDP + \".usedIP:_online.._value\", - baseDP + \".usedMAC:_online.._value\", - baseDP + \".usedStation:_online.._invalid\"); + dpConnect(\"controlIOnodeSmall\", baseDP + \".usedStation:_online.._value\", + baseDP + \".usedIP:_online.._value\", + baseDP + \".usedMAC:_online.._value\", + baseDP + \".usedStation:_online.._invalid\"); if (!navFunct_dpReachable(baseDP)) { controlIOnode(\"\",\"\",\"\",\"\",\"\",\"\",true); } - } + } // pass baseDP to selfstate Object to work with setValue(\"selfState.light\",\"toolTipText\",baseDP); @@ -50,10 +44,10 @@ PANEL,-1 -1 823 158 N "_3DFace" 1 } -void controlIOnode(string dp1, string station, - string dp2, string ipAddress, - string dp3, string macAddress, - string dp4, bool invalid) { +void controlIOnodeSmall(string dp1, string station, + string dp2, string ipAddress, + string dp3, string macAddress, + string dp4, bool invalid) { if (!invalid) { setValue(\"ipAddress\",\"text\",\"IP: \"+ipAddress); diff --git a/MAC/Navigator2/panels/objects/Hardware/CEP_Midplane_small.pnl b/MAC/Navigator2/panels/objects/Hardware/CEP_Midplane_small.pnl index 711d70202fec818a866c4a0274242a96f90465c2..8c2dfc13a6ff38b0562b4c3ab55672ea36eb645c 100644 --- a/MAC/Navigator2/panels/objects/Hardware/CEP_Midplane_small.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/CEP_Midplane_small.pnl @@ -1,4 +1,4 @@ -V 10 +V 11 1 LANG:1 8 (NoName) PANEL,-1 -1 453 525 N "_3DFace" 1 @@ -17,17 +17,34 @@ PANEL,-1 -1 453 525 N "_3DFace" 1 baseDP += \"_BGP_Midplane\" + mNr; } - string aS = navFunct_DPName2CEPName(baseDP); - setValue(\"Midplane_Txt\",\"text\",aS); // pass baseDP to selfstate Object to work with setValue(\"selfState.light\",\"toolTipText\",baseDP); + if(dpExists(sysName+\"LOFAR_PIC_BGP.BGPSwitch\")) { + dpConnect(\"controlMidplane\", sysName+\"LOFAR_PIC_BGP.BGPSwitch:_online.._value\", + sysName+\"LOFAR_PIC_BGP.BGPSwitch:_online.._invalid\"); + if (!navFunct_dpReachable(\"LOFAR_PIC_BGP.BGPSwitch\")) { + controlMidplane(\"\",false,\"\",true); + } + } + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates showSelfState(baseDP); -}" 0 + +} + +void controlMidplane(string dp1, bool bgpswitch, + string dp2, bool invalid) { + + if (!invalid) { + string aS = navFunct_DPName2CEPName(baseDP); + setValue(\"Midplane_Txt\",\"text\",aS); + } +} +" 0 E "main() { click(); @@ -221,12 +238,11 @@ E "main() { click(); }" 0 - 0 1 1 0 1 E U 0 E 27 175 86 192 + 0 1 1 0 1 E U 0 E 27 175 86 191 0 2 0 "0s" 0 0 0 192 0 0 27 175 1 1 -LANG:1 87 -*-Arial-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,697,0,0,0,0,0,0,0,0,Arial -0 "" -1 +LANG:1 26 Arial,-1,13,5,69,0,0,0,0,0 +0 1 LANG:1 8 Midplane 1 5 1 "" 1 0 @@ -259,7 +275,7 @@ LAYER, 7 1 LANG:1 6 Layer8 0 -3 1 "selfState" +3 1 "selfState" -1 "objects\\lofar_self_state.pnl" 363 291 T 87 0.8947368421052632 0 1 -298.7894736842105 -273 0 -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/objects/Hardware/Station-2Cabinets.pnl b/MAC/Navigator2/panels/objects/Hardware/Station-2Cabinets.pnl index 46bb9c97bbb372116d7ebc12999205822d6b09c4..2651deb7422e34a8040f49ee2a5f775ca57bdb5e 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Station-2Cabinets.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Station-2Cabinets.pnl @@ -1,17 +1,17 @@ -V 10 +V 11 1 LANG:1 7 Station PANEL,-1 -1 980 784 N "_3DFace" 0 "main() { //get current database name to determine the station - string station = strrtrim(dpSubStr(g_currentDatapoint,DPSUB_SYS),\":\"); + string station = dpSubStr(g_currentDatapoint,DPSUB_SYS); - string mainStationDP=MainDBName+\"LOFAR_PIC_\"+navFunct_getRingFromStation(station)+\"_\"+station; + string stationDP=station+\"LOFAR_PIC_StationInfo\"; - if (dpExists(mainStationDP+\".power48On\") ){ - dpConnect(\"updatePower48\",mainStationDP+\".power48On\", - mainStationDP+\".power48On:_online.._invalid\"); + if (dpExists(stationDP+\".power48On\") ){ + dpConnect(\"updatePower48\",stationDP+\".power48On\", + stationDP+\".power48On:_online.._invalid\"); } else { setValue(\"power48On\",\"backCol\",\"Lofar_dpdoesnotexist\"); } @@ -59,195 +59,195 @@ LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 1 0 1 0 -10 2 0 3 "pictures/small-station-sized.PNG" 13434828 E 0 10 933 543 -1 2137 97 "" 2190 +1 2260 97 "" 2190 0 -1 2138 97 "" 2188 +1 2261 97 "" 2188 0 -1 2139 97 "86" 1 +1 2262 97 "86" 1 0 -1 2140 97 "" 2187 +1 2263 97 "" 2187 0 -1 2133 96 "" 2190 +1 2256 96 "" 2190 0 -1 2134 96 "" 2188 +1 2257 96 "" 2188 0 -1 2135 96 "86" 1 +1 2258 96 "86" 1 0 -1 2136 96 "" 2187 +1 2259 96 "" 2187 0 -1 2141 100 "" 914 +1 2264 100 "" 914 0 -1 2142 100 "" 901 +1 2265 100 "" 901 0 -1 2143 100 "" 908 +1 2266 100 "" 908 0 -1 2144 100 "" 907 +1 2267 100 "" 907 0 -1 2145 100 "" 906 +1 2268 100 "" 906 0 -1 2146 100 "" 905 +1 2269 100 "" 905 0 -1 2147 100 "" 904 +1 2270 100 "" 904 0 -1 2148 100 "" 903 +1 2271 100 "" 903 0 -1 2149 100 "" 902 +1 2272 100 "" 902 0 -1 2150 100 "" 0 +1 2273 100 "" 0 0 -1 2151 100 "" 909 +1 2274 100 "" 909 0 -1 2152 100 "1" 1 +1 2275 100 "1" 1 0 -1 2153 100 "" 912 +1 2276 100 "" 912 0 -1 2154 101 "" 914 +1 2277 101 "" 914 0 -1 2155 101 "" 901 +1 2278 101 "" 901 0 -1 2156 101 "" 908 +1 2279 101 "" 908 0 -1 2157 101 "" 907 +1 2280 101 "" 907 0 -1 2158 101 "" 906 +1 2281 101 "" 906 0 -1 2159 101 "" 905 +1 2282 101 "" 905 0 -1 2160 101 "" 904 +1 2283 101 "" 904 0 -1 2161 101 "" 903 +1 2284 101 "" 903 0 -1 2162 101 "" 902 +1 2285 101 "" 902 0 -1 2163 101 "" 0 +1 2286 101 "" 0 0 -1 2164 101 "" 909 +1 2287 101 "" 909 0 -1 2165 101 "1" 1 +1 2288 101 "1" 1 0 -1 2166 101 "" 912 +1 2289 101 "" 912 0 -1 2167 102 "" 914 +1 2290 102 "" 914 0 -1 2168 102 "" 901 +1 2291 102 "" 901 0 -1 2169 102 "" 908 +1 2292 102 "" 908 0 -1 2170 102 "" 907 +1 2293 102 "" 907 0 -1 2171 102 "" 906 +1 2294 102 "" 906 0 -1 2172 102 "" 905 +1 2295 102 "" 905 0 -1 2173 102 "" 904 +1 2296 102 "" 904 0 -1 2174 102 "" 903 +1 2297 102 "" 903 0 -1 2175 102 "" 902 +1 2298 102 "" 902 0 -1 2176 102 "" 0 +1 2299 102 "" 0 0 -1 2177 102 "" 909 +1 2300 102 "" 909 0 -1 2178 102 "1" 1 +1 2301 102 "1" 1 0 -1 2179 102 "" 912 +1 2302 102 "" 912 0 -1 2180 103 "" 0 +1 2303 103 "" 0 0 -1 2181 103 "" 13 +1 2304 103 "" 13 0 -1 2182 103 "" 15 +1 2305 103 "" 15 0 -1 2183 103 "" 16 +1 2306 103 "" 16 0 -1 2184 103 "" 18 +1 2307 103 "" 18 0 -1 2185 103 "" 19 +1 2308 103 "" 19 0 -1 2186 103 "" 20 +1 2309 103 "" 20 0 -1 2187 103 "" 21 +1 2310 103 "" 21 0 -1 2188 103 "" 22 +1 2311 103 "" 22 0 -1 2189 103 "" 24 +1 2312 103 "" 24 0 -1 2190 103 "" 25 +1 2313 103 "" 25 0 -1 2191 103 "" 26 +1 2314 103 "" 26 0 -1 2192 103 "" 27 +1 2315 103 "" 27 0 -1 2193 103 "" 28 +1 2316 103 "" 28 0 -1 2194 103 "" 29 +1 2317 103 "" 29 0 -1 2195 103 "" 30 +1 2318 103 "" 30 0 -1 2196 103 "" 31 +1 2319 103 "" 31 0 -1 2197 103 "" 32 +1 2320 103 "" 32 0 -1 2198 103 "" 33 +1 2321 103 "" 33 0 -1 2199 103 "" 34 +1 2322 103 "" 34 0 -1 2200 103 "" 35 +1 2323 103 "" 35 0 -1 2201 103 "" 36 +1 2324 103 "" 36 0 -1 2202 103 "" 38 +1 2325 103 "" 38 0 -1 2203 103 "" 39 +1 2326 103 "" 39 0 -1 2204 104 "" 0 +1 2327 104 "" 0 0 -1 2205 104 "" 13 +1 2328 104 "" 13 0 -1 2206 104 "" 15 +1 2329 104 "" 15 0 -1 2207 104 "" 16 +1 2330 104 "" 16 0 -1 2208 104 "" 18 +1 2331 104 "" 18 0 -1 2209 104 "" 19 +1 2332 104 "" 19 0 -1 2210 104 "" 20 +1 2333 104 "" 20 0 -1 2211 104 "" 21 +1 2334 104 "" 21 0 -1 2212 104 "" 22 +1 2335 104 "" 22 0 -1 2213 104 "" 24 +1 2336 104 "" 24 0 -1 2214 104 "" 25 +1 2337 104 "" 25 0 -1 2215 104 "" 26 +1 2338 104 "" 26 0 -1 2216 104 "" 27 +1 2339 104 "" 27 0 -1 2217 104 "" 28 +1 2340 104 "" 28 0 -1 2218 104 "" 29 +1 2341 104 "" 29 0 -1 2219 104 "" 30 +1 2342 104 "" 30 0 -1 2220 104 "" 31 +1 2343 104 "" 31 0 -1 2221 104 "" 32 +1 2344 104 "" 32 0 -1 2222 104 "" 33 +1 2345 104 "" 33 0 -1 2223 104 "" 34 +1 2346 104 "" 34 0 -1 2224 104 "" 35 +1 2347 104 "" 35 0 -1 2225 104 "" 36 +1 2348 104 "" 36 0 -1 2226 104 "" 38 +1 2349 104 "" 38 0 -1 2227 104 "" 39 +1 2350 104 "" 39 0 7 2132 "power48On" @@ -263,53 +263,53 @@ LANG:1 19 48 Volt PowerSupply 1 "dashclr"N "_Transparent" E E 0 1 1 2 1 E 1.190082644628099 0 1.190082644628099 472.7438016528926 -374.2975206611569 1 E 75 575 5 5 -1 2228 105 "" 0 +1 2351 105 "" 0 0 -1 2229 105 "" 13 +1 2352 105 "" 13 0 -1 2230 105 "" 15 +1 2353 105 "" 15 0 -1 2231 105 "" 16 +1 2354 105 "" 16 0 -1 2232 105 "" 18 +1 2355 105 "" 18 0 -1 2233 105 "" 19 +1 2356 105 "" 19 0 -1 2234 105 "" 20 +1 2357 105 "" 20 0 -1 2235 105 "" 21 +1 2358 105 "" 21 0 -1 2236 105 "" 22 +1 2359 105 "" 22 0 -1 2237 105 "" 24 +1 2360 105 "" 24 0 -1 2238 105 "" 25 +1 2361 105 "" 25 0 -1 2239 105 "" 26 +1 2362 105 "" 26 0 -1 2240 105 "" 27 +1 2363 105 "" 27 0 -1 2241 105 "" 28 +1 2364 105 "" 28 0 -1 2242 105 "" 29 +1 2365 105 "" 29 0 -1 2243 105 "" 30 +1 2366 105 "" 30 0 -1 2244 105 "" 31 +1 2367 105 "" 31 0 -1 2245 105 "" 32 +1 2368 105 "" 32 0 -1 2246 105 "" 33 +1 2369 105 "" 33 0 -1 2247 105 "" 34 +1 2370 105 "" 34 0 -1 2248 105 "" 35 +1 2371 105 "" 35 0 -1 2249 105 "" 36 +1 2372 105 "" 36 0 -1 2250 105 "" 38 +1 2373 105 "" 38 0 -1 2251 105 "" 39 +1 2374 105 "" 39 0 2 2252 "PRIMITIVE_TEXT10" @@ -324,12 +324,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 585 89 600 99 +E E 0 1 1 2 1 E U 1 E 585 89 600 98 0 2 2 "0s" 0 0 0 192 0 0 585 89 1 1 -LANG:1 100 -*-MS Shell Dlg-bold-r-normal-*-*-60-100-100-*-*-iso8859-1|-8,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 32 MS Shell Dlg,-1,8,5,75,0,0,0,0,0 +0 1 LANG:1 3 pps 2 2253 "PRIMITIVE_TEXT11" @@ -344,12 +343,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 620 220 648 230 +E E 0 1 1 2 1 E U 1 E 620 220 648 229 0 2 2 "0s" 0 0 0 192 0 0 620 220 1 1 -LANG:1 100 -*-MS Shell Dlg-bold-r-normal-*-*-60-100-100-*-*-iso8859-1|-8,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 32 MS Shell Dlg,-1,8,5,75,0,0,0,0,0 +0 1 LANG:1 5 LCU-1 2 2254 "PRIMITIVE_TEXT12" @@ -364,12 +362,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 600 232 671 242 +E E 0 1 1 2 1 E U 1 E 600 232 671 241 0 2 2 "0s" 0 0 0 192 0 0 600 232 1 1 -LANG:1 100 -*-MS Shell Dlg-bold-r-normal-*-*-60-100-100-*-*-iso8859-1|-8,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 32 MS Shell Dlg,-1,8,5,75,0,0,0,0,0 +0 1 LANG:1 16 Extendable table 2 2255 "PRIMITIVE_TEXT13" @@ -384,12 +381,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 622 257 648 267 +E E 0 1 1 2 1 E U 1 E 622 257 648 266 0 2 2 "0s" 0 0 0 192 0 0 622 257 1 1 -LANG:1 100 -*-MS Shell Dlg-bold-r-normal-*-*-60-100-100-*-*-iso8859-1|-8,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 32 MS Shell Dlg,-1,8,5,75,0,0,0,0,0 +0 1 LANG:1 5 Cover 0 LAYER, 1 @@ -420,39 +416,39 @@ LAYER, 7 1 LANG:1 6 Layer8 0 -3 96 "PANEL_REF97" +3 96 "PANEL_REF97" -1 "objects\\Hardware\\Station_Cabinet_small.pnl" 358 358 T 860 1 0 1 -46 -180 1 "$CabinetNr""0" -3 97 "PANEL_REF98" +3 97 "PANEL_REF98" -1 "objects\\Hardware\\Station_Cabinet_small.pnl" 358 458 T 861 1 0 1 163 -280 1 "$CabinetNr""1" -3 100 "PANEL_REF101" +3 100 "PANEL_REF101" -1 "objects\\Hardware\\Station_Subrack_small.pnl" 288 620 T 864 1 0 1 -136 -353 2 "$CabinetNr""0" "$SubrackNr""0" -3 101 "PANEL_REF102" +3 101 "PANEL_REF102" -1 "objects\\Hardware\\Station_Subrack_small.pnl" 248 670 T 865 1 0 1 -96 -221 2 "$CabinetNr""0" "$SubrackNr""1" -3 102 "PANEL_REF103" +3 102 "PANEL_REF103" -1 "objects\\Hardware\\Station_Subrack_small.pnl" 258 620 T 866 1 0 1 102 -353 2 "$CabinetNr""1" "$SubrackNr""2" -3 103 "PANEL_REF104" +3 103 "PANEL_REF104" -1 "objects\\Hardware\\Cabinet_Top.pnl" 140 540 T 867 1 0 1 0 -14.99999999999997 1 "$CabinetNr""0" -3 104 "PANEL_REF105" +3 104 "PANEL_REF105" -1 "objects\\Hardware\\Cabinet_Top.pnl" 360 540 T 868 1 0 1 -10 -15 1 "$CabinetNr""1" -3 105 "PANEL_REF106" +3 105 "PANEL_REF106" -1 "objects\\Hardware\\Cabinet_Top.pnl" 140 540 T 878 1 0 1 420 -14.99999999999997 1 "$CabinetNr""3" -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/objects/Hardware/midplane_small.pnl b/MAC/Navigator2/panels/objects/Hardware/midplane_small.pnl index 8ce41b0a65f0fd8b9907b7011c9276d62aa8915c..67f982d30f5d1bcb5718cbd1dd77e69e42614cff 100644 --- a/MAC/Navigator2/panels/objects/Hardware/midplane_small.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/midplane_small.pnl @@ -1,24 +1,39 @@ -V 10 +V 11 1 LANG:1 0 PANEL,-1 -1 500 400 N "_3DFace" 0 "main() { - baseDP = g_currentDatapoint; + baseDP = g_currentDatapoint; - string aS = navFunct_DPName2CEPName(baseDP); - - setValue(\"midplaneName\",\"text\",aS); // pass baseDP to selfstate Object to work with setValue(\"selfState.light\",\"toolTipText\",baseDP); - + if(dpExists(sysName+\"LOFAR_PIC_BGP.BGPSwitch\")) { + dpConnect(\"controlMidplane\", sysName+\"LOFAR_PIC_BGP.BGPSwitch:_online.._value\", + sysName+\"LOFAR_PIC_BGP.BGPSwitch:_online.._invalid\"); + if (!navFunct_dpReachable(\"LOFAR_PIC_BGP.BGPSwitch\")) { + controlMidplane(\"\",false,\"\",true); + } + } + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates - showSelfState(baseDP); -}" 0 + showSelfState(baseDP); + +} + +void controlMidplane(string dp1, bool bgpswitch, + string dp2, bool invalid) { + + if (!invalid) { + string aS = navFunct_DPName2CEPName(baseDP); + setValue(\"midplaneName\",\"text\",aS); + } +} +" 0 E E E E 1 -1 -1 0 0 0 ""0 1 E "#uses \"navPanel.ctl\" @@ -47,12 +62,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 42 2.000000000000199 178 19 +E E 0 1 1 2 1 E U 1 E 42 2.000000000000199 178 18 0 2 2 "0s" 0 0 0 192 0 0 42 2.000000000000199 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 LANG:1 18 Midplane: R00-M00 0 LAYER, 1 @@ -83,7 +97,7 @@ LAYER, 7 1 LANG:1 0 0 -3 0 "selfState" +3 0 "selfState" -1 "objects\\lofar_self_state.pnl" 358 18 T 0 1 0 1 -350 -18.9999999999998 0 -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/objects/Processes/BGPProc.pnl b/MAC/Navigator2/panels/objects/Processes/BGPProc.pnl deleted file mode 100644 index 93f6f2851af126ba19abd123f76acd84dd7c468a..0000000000000000000000000000000000000000 --- a/MAC/Navigator2/panels/objects/Processes/BGPProc.pnl +++ /dev/null @@ -1,652 +0,0 @@ -V 10 -1 -LANG:1 13 IONode detail -PANEL,-1 -1 1003 784 N "_3DFace" 4 -"$adderList" -"$inputBufferList" -"$station" -"$stationList" -"main() -{ - // Initialise the Panel - navPanel_initPanel(\"fw_viewBox\"); - - baseDP = g_currentDatapoint; - - adderList = $adderList; - stationList = $stationList; - inputBufferList = $inputBufferList; - - DebugN(\"BGPProc_surveys.pnl:main|stationList: \"+stationList); - DebugN(\"BGPProc_surveys.pnl:main|InputBufferList: \"+inputBufferList); - DebugN(\"BGPProc_surveys.pnl:main|AdderList: \"+adderList); - LOG_DEBUG(\"BGPProc_surveys.pnl:main|stationList: \"+stationList); - LOG_DEBUG(\"BGPProc_surveys.pnl:main|InputBufferList: \"+inputBufferList); - LOG_DEBUG(\"BGPProc_surveys.pnl:main|AdderList: \"+adderList); - - // get position of station in dynArray to see what inputNodes and adders belong to this screen - int idx = dynContains(stationList,$station); - if (idx > 0) { - inputbuffer=navFunct_listToDynString(inputBufferList[idx]); - adder=navFunct_listToDynString(adderList[idx]); - } else { - LOG_ERROR(\"BGPProc_surveys.pnl:main|ERROR: Station not in stationList !!!\"); - } - LOG_DEBUG(\"BGPProc_surveys.pnl:main|inputbuffer: \"+inputbuffer); - LOG_DEBUG(\"BGPProc_surveys.pnl:main|adder: \"+adder); - - - - // In the database we can find the IONode involved per stationName, so lets - // get that nodeName - string nodeName = navFunct_stationNameToIONode($station); - - DebugN(\"Station: \",$station); - DebugN(\"nodeName: \",nodeName); - - - LOG_DEBUG(\"BGPProc_surveys.pnl:main|nodeName working: \"+nodeName); - - // if no match found we have an error - if (nodeName == \"\" || $station == \"\") { - LOG_ERROR(\"BGPProc.pnl:main| ERROR no station or IONode-name found, can't view running processes\"); - } else { - - // we have to set the stripped inputBuffer List and Adder List here. - // Since this is the Survey mode we only need one InputBuffer and one Adder - dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName\",\"CircularBuffer\", - DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.paramList\",makeDynString(inputbuffer)); - dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName\",\"Adder\", - DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.paramList\",makeDynString(adder)); - - - LOG_DEBUG(\"BGPProc.pnl:main|Station: \"+$station); - - setValue(\"ionode\",\"text\",\"IONode: \"+nodeName); - setValue(\"stationLabel\",\"text\",$station); - } - // pass baseDP to selfstate Object to work with - setValue(\"selfState.light\",\"toolTipText\",baseDP); - - - - // start the logging process - navPanel_showLogging(baseDP); - - // connect for selfUpdates - showSelfState(baseDP); - - reload(); -} - - -void prepareProcesses() { - dyn_string result; - - dynAppend(result,\",BGPProc,\"+baseDP); - dynAppend(g_processesList,baseDP); - - - // write result to the db so various panels can reset themselves - dpSet(DPNAME_NAVIGATOR + g_navigatorID + \".processesList\",result); - - LOG_DEBUG(\"BGPProc_surveys.pnl:prepareProcesses|processList found: \"+ result); - -} -// -// Callback for dpConnect to action point. -// If there is an action required this point will tell so -// -void doAction(string aDP, string anAction) { - LOG_DEBUG(\"BGPProc_surveys.pnl:doAction| Action required. found: \" + anAction); - // split action into essentials - dyn_string actionString; - if (!navFunct_splitAction(anAction,actionString)) { - return; - } - - LOG_DEBUG(\"BGPProc_surveys.pnl:doAction|found actionString: \" + actionString); - - // Reload - if (actionString[1] == \"Reload\") { - reload(); - } -} - -void reload() { - - navFunct_clearGlobalLists(); - - // set the hardware selectable items for this screen - prepareProcesses(); - - // set panel to ready - g_objectReady=true; - - // trigger that the panel values are calculated and ready - navPanel_setEvent(\"BGPProc_surveys.pnl\",\"Update\"); - -}" 0 - E E E E 1 0 0 0 0 0 -""0 1 -E "#uses \"navPanel.ctl\" - -dyn_string inputBufferList; -dyn_string adderList; -dyn_string stationList; - -dyn_string inputbuffer=\"\"; -dyn_string adder=\"\"; - -string baseDP = \"\"; -int ioNr; -" 0 - 2 -"CBRef" "1" -"EClose" E -"" -DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 -LAYER, 0 -1 -LANG:1 6 Layer1 -6 211 -"RECTANGLE1" -"" -1 40 110 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E - E E -106 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 100 42 1 E 40 110 660 520 -6 212 -"RECTANGLE2" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -107 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 50 24 1 E 740 230 789 279 -2 225 -"PRIMITIVE_TEXT1" -"" -1 864 234 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E -131 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 864 234 949 248 -0 2 2 "0s" 0 0 0 192 0 0 864 234 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 -LANG:1 12 ComputeNodes -2 228 -"ionode" -"" -1 339 132 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E -135 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 339 132 546 153 -0 2 2 "0s" 0 0 0 192 0 0 339 132 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 -LANG:1 22 IONode: R00-M0-N00-J00 -6 230 -"RECTANGLE18" -"" -1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E - E E -137 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 50 -18 2 1 0 "pictures/arrowRight.gif" 4294967295 E 30 240 104 314 -6 231 -"RECTANGLE19" -"" -1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E - E E -139 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 180 222 2 1 0 "pictures/arrowRight.gif" 4294967295 E 570 30 619 79 -6 232 -"RECTANGLE20" -"" -1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E - E E -141 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 180 372 2 1 0 "pictures/arrowLeft.gif" 4294967295 E 570 30 619 79 -6 233 -"RECTANGLE21" -"" -1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E - E E -143 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 0.9999999999999999 50 182 2 1 0 "pictures/arrowLeft.gif" 4294967295 E 30 240 104 314 -1 348 51 "" 1 -0 -6 288 -"RECTANGLE23" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -226 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 100 24 1 E 740 230 789 279 -6 289 -"RECTANGLE24" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -228 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 150 24 1 E 740 230 789 279 -6 290 -"RECTANGLE25" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -230 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 200 24 1 E 740 230 789 279 -6 291 -"RECTANGLE26" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -232 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 50 74 1 E 740 230 789 279 -6 292 -"RECTANGLE27" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -234 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 100 74 1 E 740 230 789 279 -6 293 -"RECTANGLE28" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -236 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 150 74 1 E 740 230 789 279 -6 294 -"RECTANGLE29" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -238 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 200 74 1 E 740 230 789 279 -6 295 -"RECTANGLE30" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -240 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 50 124 1 E 740 230 789 279 -6 296 -"RECTANGLE31" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -242 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 100 124 1 E 740 230 789 279 -6 297 -"RECTANGLE32" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -244 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 150 124 1 E 740 230 789 279 -6 298 -"RECTANGLE33" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -246 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 200 124 1 E 740 230 789 279 -6 299 -"RECTANGLE34" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -248 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 50 174 1 E 740 230 789 279 -6 300 -"RECTANGLE35" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -250 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 100 174 1 E 740 230 789 279 -6 301 -"RECTANGLE36" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -252 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 150 174 1 E 740 230 789 279 -6 302 -"RECTANGLE37" -"" -1 760 220 E E E 1 E 1 E N {0,0,0} E N "STD_object_background" E E - E E -254 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 200 174 1 E 740 230 789 279 -1 349 52 "" 226 -0 -1 350 52 "" 229 -0 -1 351 52 "" 234 -0 -1 352 52 "" 235 -0 -1 353 52 "" 236 -0 -1 354 52 "" 237 -0 -1 355 52 "" 238 -0 -1 356 52 "" 239 -0 -1 357 52 "" 240 -0 -1 358 52 "" 241 -0 -1 359 52 "" 242 -0 -1 360 52 "" 243 -0 -1 361 52 "" 244 -0 -1 362 52 "" 245 -0 -1 363 52 "" 246 -0 -1 364 52 "" 247 -0 -1 365 52 "51" 1 -0 -1 366 52 "" 249 -0 -1 367 52 "" 250 -0 -1 368 52 "" 251 -0 -1 369 52 "" 252 -0 -1 370 52 "" 253 -0 -1 371 52 "" 254 -0 -1 372 52 "" 255 -0 -1 373 52 "" 261 -0 -1 374 52 "" 262 -0 -1 375 52 "" 263 -0 -1 376 52 "" 264 -0 -1 377 52 "" 265 -0 -1 378 52 "" 279 -0 -1 379 52 "" 280 -0 -1 380 52 "" 281 -0 -1 381 52 "" 282 -0 -1 382 52 "" 283 -0 -1 383 53 "" 227 -0 -1 384 53 "51" 1 -0 -1 385 53 "" 256 -0 -1 386 53 "" 266 -0 -1 387 53 "" 267 -0 -1 388 53 "" 268 -0 -1 389 53 "" 269 -0 -1 390 53 "" 270 -0 -2 346 -"stationLabel" -"" -1 15 247 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E -255 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 15 247 63 268 -0 2 2 "0s" 0 0 0 192 0 0 15 247 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 -LANG:1 5 CSxxx -2 347 -"storageLabel" -"" -1 15 450 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E -257 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 15 450 73 471 -0 2 2 "0s" 0 0 0 192 0 0 15 450 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 -LANG:1 7 Storxxx -0 -LAYER, 1 -1 -LANG:1 6 Layer2 -0 -LAYER, 2 -1 -LANG:1 6 Layer3 -0 -LAYER, 3 -1 -LANG:1 6 Layer4 -0 -LAYER, 4 -1 -LANG:1 6 Layer5 -0 -LAYER, 5 -1 -LANG:1 6 Layer6 -0 -LAYER, 6 -1 -LANG:1 6 Layer7 -0 -LAYER, 7 -1 -LANG:1 6 Layer8 -0 -3 51 "selfState" -"objects\\lofar_self_state.pnl" 678 158 T 169 1 0 1 -537 -4 -0 -3 52 "PANEL_REF53" -"objects\\Processes\\circularBuffer.pnl" 90 160 T 255 1 0 1 50 -5 -1 -"$objectNumber""0" -3 53 "PANEL_REF54" -"objects\\Processes\\adder.pnl" 90 360 T 255 1 0 1 50 2 -1 -"$objectNumber""0" -0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Processes/ObsSW_CEP.pnl b/MAC/Navigator2/panels/objects/Processes/ObsSW_CEP.pnl index 3b5bb9e71ecae0426cb20d05be558a9573ea9467..a8f3ffc2d910f284745c19efe7e206144e217dd6 100644 --- a/MAC/Navigator2/panels/objects/Processes/ObsSW_CEP.pnl +++ b/MAC/Navigator2/panels/objects/Processes/ObsSW_CEP.pnl @@ -5,7 +5,6 @@ PANEL,-1 -1 994 293 N "_3DFace" 0 "main() { baseDP=g_currentDatapoint; - setValue(\"CEPDBNAME\",\"text\",navFunct_bareDBName(CEPDBName)+\":\"); }" 0 E E E E 1 -1 -1 0 0 0 ""0 1 @@ -196,16 +195,6 @@ LANG:1 6 logMsg 0 1 170 15 "" 2 0 -1 172 16 "" 4 -0 -1 173 16 "" 3 -0 -1 174 16 "0" 1 -0 -1 176 16 "" 6 -0 -1 175 16 "" 2 -0 2 113 "observationName" "" @@ -226,7 +215,7 @@ LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 0 1 LANG:1 11 observation 2 144 -"CEPDBNAME" +"PRIMITIVE_TEXT7" "" 1 176 20 E E E 1 E 1 E N "Blue" E N "_Transparent" E E E E @@ -296,6 +285,16 @@ void stationCallback(string dp1, bool aTrig) { } } } " 0 +1 172 16 "" 4 +0 +1 173 16 "" 3 +0 +1 174 16 "0" 1 +0 +1 176 16 "" 6 +0 +1 175 16 "" 2 +0 0 LAYER, 1 1 @@ -330,9 +329,9 @@ LANG:1 0 2 "$databaselevel""ccu" "$name""OnlineControl_BGPAppl" -3 16 "PANEL_REF17" -1 -"objects\\Processes\\interactive_controller_small.pnl" 180 140 T 28 1 0 1 -10 -50 +3 16 "PANEL_REF16" -1 +"objects\\Processes\\interactive_controller_small.pnl" 170 90 T 44 U 2 "$databaselevel""ccu" -"$name""OnlineControl_StorageAppl" +"$name""PythonControl" 0 diff --git a/MAC/Navigator2/panels/objects/Processes/ObsSW_Main.pnl b/MAC/Navigator2/panels/objects/Processes/ObsSW_Main.pnl index 02c37a7f7404412cb719cd415b36f8c15da1cae8..728aacf53533101c0f510a1e45090f3508349a83 100644 --- a/MAC/Navigator2/panels/objects/Processes/ObsSW_Main.pnl +++ b/MAC/Navigator2/panels/objects/Processes/ObsSW_Main.pnl @@ -112,14 +112,14 @@ E E E LANG:1 19 Active Observations 8 -"frameShadow" "enum 48" -"selectionMode" "enum 0" -"backgroundOrigin" "enum 0" -"defaultRenameAction" "enum 0" -"frameShape" "enum 6" -"vScrollBarMode" "enum 0" -"hScrollBarMode" "enum 0" "resizeMode" "enum 0" +"hScrollBarMode" "enum 0" +"vScrollBarMode" "enum 0" +"frameShape" "enum 6" +"defaultRenameAction" "enum 0" +"backgroundOrigin" "enum 0" +"selectionMode" "enum 0" +"frameShadow" "enum 48" 1 LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0 0 820 20 989 375 @@ -287,45 +287,35 @@ LANG:1 6 logMsg 0 1 154 15 "" 2 0 -1 156 16 "" 4 +1 156 17 "" 4 0 -1 157 16 "" 3 +1 157 17 "" 3 0 -1 158 16 "0" 1 +1 158 17 "0" 1 0 -1 160 16 "" 6 +1 160 17 "" 6 0 -1 159 16 "" 2 +1 159 17 "" 2 0 -1 161 17 "" 4 +1 161 18 "" 4 0 -1 162 17 "" 3 +1 162 18 "" 3 0 -1 163 17 "0" 1 +1 163 18 "0" 1 0 -1 165 17 "" 6 +1 165 18 "" 6 0 -1 164 17 "" 2 +1 164 18 "" 2 0 -1 166 18 "" 4 +1 166 19 "" 4 0 -1 167 18 "" 3 +1 167 19 "" 3 0 -1 168 18 "0" 1 +1 168 19 "0" 1 0 -1 170 18 "" 6 +1 170 19 "" 6 0 -1 169 18 "" 2 -0 -1 171 19 "" 4 -0 -1 172 19 "" 3 -0 -1 173 19 "0" 1 -0 -1 175 19 "" 6 -0 -1 174 19 "" 2 +1 169 19 "" 2 0 2 79 "mainDBName" @@ -431,6 +421,16 @@ LANG:1 0 1 "dashclr"N "_Transparent" E E 0 2 1 2 1 E 290 96 810 96 +1 171 20 "" 4 +0 +1 172 20 "" 3 +0 +1 173 20 "0" 1 +0 +1 175 20 "" 6 +0 +1 174 20 "" 2 +0 0 LAYER, 1 1 @@ -470,11 +470,6 @@ LANG:1 0 2 "$databaselevel""ccu" "$name""OnlineControl_BGPAppl" -3 16 "PANEL_REF17" -1 -"objects\\Processes\\interactive_controller_small.pnl" 180 140 T 28 1 0 1 -7 14 -2 -"$databaselevel""ccu" -"$name""OnlineControl_StorageAppl" 3 17 "PANEL_REF18" -1 "objects\\Processes\\interactive_controller_small.pnl" 180 200 T 29 1 0 1 -7 23 2 @@ -490,4 +485,9 @@ LANG:1 0 2 "$databaselevel""station" "$name""TBBControl" +3 20 "PANEL_REF20" -1 +"objects\\Processes\\interactive_controller_small.pnl" 170 90 T 43 1 0 1 3 63 +2 +"$databaselevel""ccu" +"$name""PythonControl" 0 diff --git a/MAC/Navigator2/panels/objects/Processes/adder.pnl b/MAC/Navigator2/panels/objects/Processes/adder.pnl index dc06dbeed5c6f09b021d8e7e88b60f23b427c8af..b657a63e3025b174b46b31a9d9c86f222fa4d7e2 100644 --- a/MAC/Navigator2/panels/objects/Processes/adder.pnl +++ b/MAC/Navigator2/panels/objects/Processes/adder.pnl @@ -1,74 +1,88 @@ -V 10 +V 11 1 LANG:1 5 Adder -PANEL,-1 -1 631 221 N "_3DFace" 1 -"$objectNumber" +PANEL,-1 -1 1047 192 N "_3DFace" 2 +"$adderNumber" +"$nodeDP" "main() { - baseDP = g_currentDatapoint; - database = dpSubStr(baseDP,DPSUB_SYS); + baseDP = $nodeDP; - panelName=\"Adder\"; - - // check if the required datapoint for this view are enabled and accessible - if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName\") ){ - if (dpConnect(\"updateTrigger\", DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName:_online.._value\", - DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.paramList:_online.._value\", - DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName:_online.._invalid\") == -1) { - LOG_ERROR(\"adder.pnl:main|Couldn't connect to: \"+DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName \"+ getLastError() ); - } + // determine adderNumber + adderNr=$adderNumber; + + // baseDp is something like CCU001:LOFAR_PIC_BGP_Midplane[x]_IONode[xx]\"] + // for the Adders it needs to point to: LOFAR_ObsSW_OSIOnode[xx]_Adder[xx] + + int pos = strpos(baseDP,\"IONode\"); + if (pos < 0) { + LOG_ERROR(\"adder.pnl:main|Couldn't find IONode in baseDP: \"+baseDP); + return; } else { - LOG_ERROR(\"adder.pnl:main|Couldn't find DP to connect to: \"+DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName\" ); - } -} + string ioNr=substr(baseDP,pos+6,2); + baseDP=sysName+\"LOFAR_ObsSW_OSIONode\"+ioNr; + } -void updateTrigger( string dp1, string objectName, - string dp2, dyn_string paramList, - string dp3, bool invalid) { - if (objectName == panelName) { - LOG_TRACE(\"adder.pnl:updateTrigger|objectName: \"+objectName+ - \" panelName: \"+ panelName); - - // determine adderNumber - objectNr=$objectNumber; + adderDP = baseDP+\"_Adder\"+adderNr; + + dpGet(adderDP+\".locusNode\",locusNr); + dpGet(adderDP+\".writer\",writerNr); - int bufNr = -1; - if (dynlen(paramList) <= 1+objectNr && paramList[1+objectNr] < 127) { - bufNr=paramList[1+objectNr];; - adderDP=database+\"Adder\"+bufNr; + setValue(\"addernr_text\",\"text\",adderNr); + + writerDP = sysName+\"LOFAR_ObwSW_OSLocusNode\"+navFunct_formatInt(locusNr,999)+\"_Writer\"+navFunct_formatInt(writerNr,99); + setValue(\"writerNr_text\",\"text\",\"Writer\"+navFunct_formatInt(writerNr,99)); + setValue(\"writerNr_text\",\"toolTipText\",writerDP); - // connect to the adder values - // check if the requiered datapoint for this view are enabled and accessible - if (dpExists(adderDP + \".dropping\")) { - if (dpConnect(\"updateAdder\", adderDP + \".dropping\", - adderDP + \".nrBlocksDropped\", - adderDP + \".dropping:_online.._invalid\") == -1) { - LOG_ERROR(\"adder.pnl:main|Couldn't connect to: \"+adderDP+\" \"+getLastError()); - } - } else { - LOG_ERROR(\"adder.pnl:main|Couldn't find DP to connect to: \"+adderDP + \".dropping\"); - setValue(\"dropping\", \"foreCol\", \"Lofar_dpdoesnotexist\"); - setValue(\"nrBlocksDropped\", \"backCol\", \"Lofar_dpdoesnotexist\"); - } + LOG_DEBUG(\"adder.pnl:main|adderDP: \"+adderDP); + LOG_DEBUG(\"adder.pnl:main|writerDP: \"+writerDP); + + // connect to the adder values + // check if the requiered datapoint for this view are enabled and accessible + if (dpExists(adderDP + \".dropping\")) { + if (dpConnect(\"updateAdder\", adderDP + \".dropping\", + adderDP + \".dropped\", + adderDP + \".process.error\", + adderDP + \".process.currentAction\", + adderDP + \".process.logMsg\", + adderDP + \".dropping:_online.._invalid\") == -1) { + LOG_ERROR(\"adder.pnl:main|Couldn't connect to: \"+adderDP+\" \"+getLastError()); + } + } else { + LOG_ERROR(\"adder.pnl:main|Couldn't find DP to connect to: \"+adderDP + \".dropping\"); + setValue(\"dropping\", \"foreCol\", \"Lofar_dpdoesnotexist\"); + setValue(\"nrBlocksDropped\", \"backCol\", \"Lofar_dpdoesnotexist\"); + } - // pass baseDP to selfstate Object to work with - setValue(\"selfState.light\",\"toolTipText\",adderDP); - // connect for selfUpdates - showSelfState(adderDP); + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",adderDP); + // connect for selfUpdates + showSelfState(adderDP); - } else { - LOG_ERROR(\"adder.pnl:main|adderList out of range or invalid adderDP\"); - } - } } updateAdder(string dp1, bool dropping, - string dp2, int nrBlocksDropped, - string dp3, bool invalid) + string dp2, int nrBlocksDropped, + string dp3, string error, + string dp4, string currentAction, + string dp5, string logMsg, + string dp6, bool invalid) { LOG_DEBUG(\"adder.pnl:updateAdder|entered\"); if (!invalid) { + myTable.deleteAllLines(); + // check if error == \"Not running\"; + // if true then the name of the process is red, otherwise black + if (error == \"Not running\") { + addernr_text.foreCol() = \"Lofar_broken\"; + } else { + addernr_text.foreCol() = \"_3DText\"; + } + setValue(\"dropping\", \"backCol\", \"_Window\"); + setValue(\"nrBlocksDropped\", \"backCol\", \"_Window\"); + + myTable.appendLine(\"error\",error,\"currentAction\",currentAction,\"logMsg\",navFunct_getLogColor(logMsg,navFunct_getLogLevel(logMsg))); if (dropping) { setValue(\"dropping\", \"backCol\", \"red\"); } else { @@ -81,19 +95,72 @@ updateAdder(string dp1, bool dropping, } } " 0 - E E E E 1 0 0 0 0 0 + E "main() +{ + click(adderDP); +}" 0 + "main(int row, string column) +{ + rClick(adderDP); +}" 0 + "main(int row, string column) +{ + dblClick(adderDP); +}" 0 + 1 0 0 0 0 0 ""0 1 E "#uses \"navPanel.ctl\" -string ksp=\"\"; string adder=\"\"; -string database=\"\"; -string panelName=\"\"; string baseDP = \"\"; string adderDP=\"\"; -int objectNr=0; -" 0 +string writerDP=\"\"; + + +int adderNr=-1; +int locusNr=-1; +int writerNr=-1; + +bool bDoubleClicked = false; + +// routine for single mouse click +void click(string dp) { + // set delay in case double click was meant + delay(0, 100); + if (!bDoubleClicked) { + string event=\"\"; + if (dp == writerDP) { + event = \"Writer\"+navFunct_formatInt(writerNr,99); + } else if (dp == adderDP) { + event = \"Adder\"+adderNr; + } else { + event = \"adder.pnl\"; + } + navPanel_setEvent(event,\"EventClick\"); + } +} + +// routine for double mouse click +void dblClick(string dp) { + // indicate this is a doubleClick + bDoubleClicked = true; + + if (dpExists(dp) ) { + LOG_DEBUG(\"adder.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+dp); + g_currentDatapoint=dp; + navPanel_setEvent(\"adder.pnl\",\"ChangePanel\"); + } + // set delay to avoid click event will be triggered + delay(0, 500); + bDoubleClicked = false; +} + +// routine for right mouse click +void rClick(string dp) { + navPanel_setEvent(\"adder.pnl\",\"EventRightClick\"); +} + " 0 2 "CBRef" "1" "EClose" E @@ -102,12 +169,20 @@ DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 LAYER, 0 1 LANG:1 6 Layer1 -6 227 -"RECTANGLE16" +6 280 +"writer_highLight" "" -1 120 180 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - E E -134 0 0 0 0 0 +1 240 10 E E E 1 E 0 E N "_Transparent" E N "Lofar_highLight" E E + "main() +{ + rClick(writerDP); +}" 0 + "main() +{ + dblClick(writerDP); +}" 0 + +208 0 0 0 0 0 E E E 0 1 @@ -115,15 +190,44 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 10 22 610 195 -1 271 51 "" 1 -0 -2 256 -"PRIMITIVE_TEXT14" +"main() +{ + dpConnect( \"writerCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" ); +} + +void writerCallback(string dp1, bool aTrig) { + + LOG_DEBUG(\"adder.pnl:writerCallback|ObjectTrigger Callback on: \"+dp1+\" trigger: \"+aTrig); + LOG_DEBUG(\"adder.pnl:writerCallback|Found highlight : \" + highlight + \" Looking for writer\"+navFunct_formatInt(writerNr,99)); + bool bHighlight=false; + if (dynContains(highlight,\"Writer\"+navFunct_formatInt(writerNr,99))) { + bHighlight=true; + } + LOG_DEBUG(\"adder.pnl:writerCallback|Highlight request: \"+bHighlight); + writer_highLight.visible = bHighlight; + +} + +" 0 + "main() +{ + click(writerDP); +}" 0 + 0 1 1 2 1 E 1 0 1 -29 -79 1 E 40 100 119 130 +6 278 +"adder_highLight" "" -1 280 2 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E -183 0 0 0 0 0 +1 240 10 E E E 1 E 0 E N "_Transparent" E N "Lofar_highLight" E E + "main(int row, string column) +{ + rClick(adderDP); +}" 0 + "main(int row, string column) +{ + dblClick(adderDP); +}" 0 + +207 0 0 0 0 0 E E E 0 1 @@ -131,18 +235,71 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 280 2 322 19 -0 2 2 "0s" 0 0 0 192 0 0 280 2 1 +"main() +{ + dpConnect( \"adderCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" ); +} + +void adderCallback(string dp1, bool aTrig) { + + LOG_DEBUG(\"adder.pnl:adderCallback|ObjectTrigger Callback on: \"+dp1+\" trigger: \"+aTrig); + LOG_DEBUG(\"adder.pnl:adderCallback|Found highlight : \" + highlight + \" Looking for Adder\"+adderNr); + bool bHighlight=false; + if (dynContains(highlight,\"Adder\"+adderNr)) { + bHighlight=true; + } + LOG_DEBUG(\"adder.pnl:adderCallback|Highlight request: \"+bHighlight); + adder_highLight.visible = bHighlight; + +} + +" 0 + "main() +{ + click(adderDP); +}" 0 + 0 1 1 2 1 E 1 0 1 -55 -55 1 E 190 70 1070 107 +6 227 +"RECTANGLE16" +"" +1 120 180 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E + "main(int row, string column) +{ + rClick(adderDP); +}" 0 + "main(int row, string column) +{ + dblClick(adderDP); +}" 0 + +134 0 0 0 0 0 +E E E +0 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +LANG:1 0 + 1 -LANG:1 5 Adder +"dashclr"N "_Transparent" +E "main() +{ + click(adderDP); +}" 0 + 0 1 1 2 1 E 0.9775280898876404 0 1 3.146067415730345 0 1 E 140 20 1030 47 +1 281 51 "" 1 +0 7 266 "dropping" "" 1 270 50 E E E 1 E 1 E N {0,0,0} E N "green" E E - E E + "main(int row, string column) +{ + rClick(adderDP); +}" 0 + "main(int row, string column) +{ + dblClick(adderDP); +}" 0 + 194 0 0 0 0 0 E E E 0 @@ -151,33 +308,45 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E 0.8095238095238095 0 0.8095238095238095 41.52380952380952 -2.380952380952408 1 E 270 50 10 10 -2 267 -"PRIMITIVE_TEXT15" +E "main() +{ + click(adderDP); +}" 0 + 0 1 1 2 1 E 1 0 1 60 5 1 E 120 30 7 7 +14 269 +"nrBlocksDropped" "" -1 182 32 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E -195 0 0 0 0 0 +1 200 24 E E E 1 E 1 E N "_3DText" E N "_Window" E E + "main(int row, string column) +{ + rClick(adderDP); +}" 0 + "main(int row, string column) +{ + dblClick(adderDP); +}" 0 + +199 0 0 0 0 0 E E E 0 1 LANG:1 0 +0 1 -"dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 182 32 244 49 -0 2 2 "0s" 0 0 0 192 0 0 182 32 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 -LANG:1 8 dropping -2 268 -"PRIMITIVE_TEXT16" +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 198 22 312 46 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(adderDP); +}" 0 + E E +2 273 +"addernr_text" "" -1 340 32 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E +1 123 26 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E E E -197 0 0 0 0 0 +203 0 0 0 0 0 E E E 0 1 @@ -185,84 +354,109 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 340 32 486 49 -0 2 2 "0s" 0 0 0 192 0 0 340 32 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 -LANG:1 20 Nr of blocks dropped -14 269 -"nrBlocksDropped" +E E 0 1 1 2 1 E U 0 E 123 26 131 42 +0 2 2 "0s" 0 0 0 192 0 0 123 26 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 1 0 +6 274 +"arrow" "" -1 495 28 E E E 1 E 1 E N "_3DText" E N "_Window" E E +1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E E E -199 0 0 0 0 0 +204 0 0 0 0 0 E E E 0 1 LANG:1 0 -0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 493 26 607 50 -2 "0s" 0 0 0 0 0 -1 E E E -25 270 -"myLogTable" +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 0.4054054054054054 0 0.4054054054054056 77.83783783783784 -77.29729729729735 2 1 0 "pictures/arrowLeft.gif" 4294967295 E 30 240 104 314 +2 275 +"writerNr_text" "" -1 -60 -190 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E -201 0 0 0 0 0 +1 20 30 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(writerDP); +}" 0 + "main() +{ + dblClick(writerDP); +}" 0 + +205 0 0 0 0 0 E E E 0 1 LANG:1 0 -0 -1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 13 51 607 191 -EE 1 0 1 5 1 "time" 12 1 0 "s" 1 -LANG:1 4 time -E 1 -LANG:1 0 +"dashclr"N "_Transparent" +E "main() +{ + click(writerDP); +}" 0 + 0 1 1 2 1 E U 0 E 20 30 60 46 +0 2 2 "0s" 0 0 0 192 0 0 20 30 1 +1 +LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0 +0 1 +LANG:1 6 writer +25 276 +"myTable" +"" +1 249.8823099816354 -3 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main(int row, string column) +{ + rClick(adderDP); +}" 0 + "main(int row, string column) +{ + dblClick(adderDP); +}" 0 -150 "level" 5 1 0 "s" 1 -LANG:1 5 level -E +206 0 0 0 0 0 +E E E +0 1 LANG:1 0 -70 "source" 17 1 0 "s" 1 -LANG:1 6 source +0 +1 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 318 22 1002 46 +E"main(int row, string column, string value) +{ + click(adderDP); +}" 0 + 0 0 1 3 1 "error" 13 1 0 "s" 1 +LANG:1 5 error E 1 LANG:1 0 -200 "message" 90 1 0 "s" 1 -LANG:1 7 message +125 "currentAction" 13 1 0 "s" 1 +LANG:1 13 currentAction E 1 LANG:1 0 -1000 "code" 17 1 0 "s" 1 -LANG:1 4 code +125 "logMsg" 63 1 0 "s" 1 +LANG:1 6 logMsg E 1 LANG:1 0 -200 -14 14 "" 1 1 +579 +19 19 "" 1 1 LANG:1 2 #1 -10 30 +10 150 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -0 1 2 1 7 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 0 0 0 1 7 1 0 0 LAYER, 1 @@ -293,7 +487,7 @@ LAYER, 7 1 LANG:1 6 Layer8 0 -3 51 "selfState" -"objects\\lofar_self_state.pnl" 678 158 T 169 1 0 1 -668 -135 +3 51 "selfState" -1 +"objects\\lofar_self_state.pnl" 678 158 T 169 1 0 1 -538 -133 +0 0 -0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Processes/circularBuffer.pnl b/MAC/Navigator2/panels/objects/Processes/circularBuffer.pnl index 0b6a81d136d61c29650fd74d90a4cb2b8be41497..5a6ef1b0ce5706f0ef361c97d654496c157d4951 100644 --- a/MAC/Navigator2/panels/objects/Processes/circularBuffer.pnl +++ b/MAC/Navigator2/panels/objects/Processes/circularBuffer.pnl @@ -1,11 +1,12 @@ -V 10 +V 11 1 LANG:1 14 CircularBuffer -PANEL,-1 -1 640 211 N "_3DFace" 1 -"$objectNumber" +PANEL,-1 -1 843 280 N "_3DFace" 0 "main() { + + baseDP = g_currentDatapoint; database = dpSubStr(baseDP,DPSUB_SYS); @@ -35,27 +36,24 @@ void updateTrigger( string dp1, string objectName, \" panelName: \"+ panelName); - // determine inputBufferNumber - objectNr=$objectNumber; - DebugN(\"objectNr found: \",objectNr); - int bufNr = -1; - LOG_DEBUG(\"circularBuffer.pnl:updateTrigger|dynlen paramList: \"+dynlen(paramList)+\" objectNr: \"+objectNr+\" paramList[1+objectNr]: \"+paramList[1+objectNr]); - if (dynlen(paramList) <= (1+objectNr)) { - bufNr=paramList[1+objectNr]; - DebugN(\"bufNr calculated:\" , bufNr); - if (bufNr > 63) { + int ioNr = -1; + LOG_DEBUG(\"circularBuffer.pnl:updateTrigger|dynlen paramList: \"+dynlen(paramList)+\" paramList[1]: \"+paramList[1]); + if (dynlen(paramList) <= (1)) { + ioNr=paramList[1+objectNr]; + if (ioNr > 63) { LOG_ERROR(\"circularBuffer.pnl:updateTrigger|invalid InputBufferDP\"); return; } - LOG_DEBUG(\"circularBuffer.pnl:updateTrigger| found bufNr: \" + bufNr); - inputBufferDP=database+\"InputBuffer\"+bufNr; + + LOG_DEBUG(\"circularBuffer.pnl:updateTrigger| found bufNr: \" + ioNr); + setValue(\"InputBuffer_text\",\"text\",\"PSIONode\"+navFunct_formatInt(ioNr,99)); + inputBufferDP=database+\"LOFAR_PermSW_PSIONode\"+navFunct_formatInt(ioNr,99)+\"_InputBuffer\"; - DebugN(\"Looking for DP: \",inputBufferDP); // connect to the inputBuffer values // check if the requiered datapoint for this view are enabled and accessible if (dpExists(inputBufferDP + \".stationName\")) { - if (dpConnect(\"updateBuffer\", inputBufferDP + \".stationName\", + if (!dpConnect(\"updateBuffer\", inputBufferDP + \".stationName\", inputBufferDP + \".late\", inputBufferDP + \".IOTime\", inputBufferDP + \".stream0.blocksIn\", @@ -70,7 +68,7 @@ void updateTrigger( string dp1, string objectName, inputBufferDP + \".stream3.blocksIn\", inputBufferDP + \".stream3.percBad\", inputBufferDP + \".stream3.rejected\", - inputBufferDP + \".stationName:_online.._invalid\") == -1) { + inputBufferDP + \".status.state:_online.._invalid\") == -1) { LOG_ERROR(\"circularBuffer.pnl:updateTrigger|Couldn't connect to: \"+inputBufferDP+\" \"+getLastError()); } } else { @@ -93,6 +91,24 @@ void updateTrigger( string dp1, string objectName, // pass baseDP to selfstate Object to work with setValue(\"selfState.light\",\"toolTipText\",inputBufferDP); + + + // get the name of the selected station + nodeDP = navFunct_IONode2DPName(ioNr); + string dp = nodeDP+\".usedStation\"; + if (dpExists(dp) ){ + dpGet(dp,station); + } else { + LOG_ERROR(\"circularBuffer.pnl:main|ERROR DP does not exist: \"+dp); + return; + } + + stationDP=station+\":\"; + + + setValue(\"stationLabel\",\"text\",station); + setValue(\"stationLabel\",\"toolTipText\",stationDP); + // connect for selfUpdates showSelfState(inputBufferDP); @@ -100,6 +116,7 @@ void updateTrigger( string dp1, string objectName, } else { LOG_ERROR(\"circularBuffer.pnl:main|inputBufferList out of range\"); } + } } @@ -120,7 +137,8 @@ updateBuffer(string dp1, string stationName, string dp15, string rejected3, string dp16, bool invalid) { - LOG_DEBUG(\"circularBuffer.pnl:updateBeffer|entered\"); + + LOG_DEBUG(\"circularBuffer.pnl:updateBuffer|entered\"); if (!invalid) { setValue(\"Late\", \"text\", late); setValue(\"IOTime\", \"text\", IOTime); @@ -165,7 +183,46 @@ string panelName=\"\"; string baseDP = \"\"; string inputBufferDP=\"\"; -int objectNr=0;" 0 +string station=\"\"; +string stationDP=\"\"; +string nodeDP=\"\"; + +int objectNr=0; + +bool bDoubleClicked = false; + +// routine for single mouse click +void click(string dp) { + // set delay in case double click was meant + delay(0, 100); + if (!bDoubleClicked) { + if (dp == stationDP) { + navPanel_setEvent(station,\"EventClick\"); + } else { + navPanel_setEvent(\"InputBuffer\",\"EventClick\"); + } + } +} + +// routine for double mouse click +void dblClick(string dp) { + // indicate this is a doubleClick + bDoubleClicked = true; + + if (dpExists(dp) ) { + LOG_DEBUG(\"CircularBuffer.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+dp); + g_currentDatapoint=dp; + navPanel_setEvent(\"CircularBuffer.pnl\",\"ChangePanel\"); + } + // set delay to avoid click event will be triggered + delay(0, 500); + bDoubleClicked = false; +} + +// routine for right mouse click +void rClick(string dp) { + navPanel_setEvent(\"CircularBuffer.pnl\",\"EventRightClick\"); +}" 0 2 "CBRef" "1" "EClose" E @@ -174,11 +231,64 @@ DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 LAYER, 0 1 LANG:1 6 Layer1 +6 285 +"InputBuffer_highLight" +"" +1 240 10 E E E 1 E 0 E N "_Transparent" E N "Lofar_highLight" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + +223 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +"main() +{ + dpConnect( \"InputBufferCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" ); +} + +void InputBufferCallback(string dp1, bool aTrig) { + + LOG_DEBUG(\"circularBuffer.pnl:InputBufferCallback|ObjectTrigger Callback on: \"+dp1+\" trigger: \"+aTrig); + LOG_DEBUG(\"circularBuffer.pnl:InputBufferCallback|Found highlight : \" + highlight + \" Looking for InputBuffer\"); + bool bHighlight=false; + if (dynContains(highlight,\"InputBuffer\")) { + bHighlight=true; + } + LOG_DEBUG(\"circularBuffer.pnl:InputBufferCallback|Highlight request: \"+bHighlight); + InputBuffer_highLight.visible = bHighlight; + +} + +" 0 + "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E 1 0 1 140 -10 1 E 10 20 620 199 6 226 "RECTANGLE15" "" 1 120 180 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 132 0 0 0 0 0 E E E 0 @@ -187,12 +297,24 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 -90 -148 1 E 100 180 700 349 +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E 1 0 1 55 -165 1 E 100 180 700 349 6 229 "RECTANGLE17" "" 1 120 20 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E - E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 136 0 0 0 0 0 E E E 0 @@ -201,12 +323,24 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 196 45 2 1 0 "pictures/circleAni.gif" 4294967295 E 120 20 219 119 +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E 1 0 1 341 28 2 1 0 "pictures/circleAni.gif" 4294967295 E 120 20 219 119 14 234 "In0" "" -1 42 62 E E E 1 E 1 E N "_3DText" E N "_Window" E E - E E +1 187 45 E E E 1 E 1 E N "_3DText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 144 0 0 0 0 0 E E E 0 @@ -215,15 +349,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 40 60 108 84 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 185 43 253 67 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 14 235 "Bad0" "" -1 114 62 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 259 45 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 146 0 0 0 0 0 E E E 0 @@ -232,15 +377,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 112 60 180 84 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 257 43 325 67 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 2 236 "PRIMITIVE_TEXT3" "" -1 22 67 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 167 50 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 147 0 0 0 0 0 E E E 0 @@ -249,18 +405,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 22 67 29 81 -0 2 2 "0s" 0 0 0 192 0 0 22 67 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 167 50 174 63 +0 2 2 "0s" 0 0 0 192 0 0 167 50 1 1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 1 0 14 237 "In1" "" -1 42 92 E E E 1 E 1 E N "_3DText" E N "_Window" E E - E E +1 187 75 E E E 1 E 1 E N "_3DText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 149 0 0 0 0 0 E E E 0 @@ -269,15 +436,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 40 90 108 114 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 185 73 253 97 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 14 238 "Bad1" "" -1 114 92 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 259 75 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 151 0 0 0 0 0 E E E 0 @@ -286,15 +464,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 112 90 180 114 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 257 73 325 97 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 2 239 "PRIMITIVE_TEXT4" "" -1 22 97 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 167 80 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 153 0 0 0 0 0 E E E 0 @@ -303,18 +492,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 22 97 29 111 -0 2 2 "0s" 0 0 0 192 0 0 22 97 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 167 80 174 93 +0 2 2 "0s" 0 0 0 192 0 0 167 80 1 1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 1 1 14 240 "In2" "" -1 42 122 E E E 1 E 1 E N "_3DText" E N "_Window" E E - E E +1 187 105 E E E 1 E 1 E N "_3DText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 155 0 0 0 0 0 E E E 0 @@ -323,15 +523,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 40 120 108 144 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 185 103 253 127 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 14 241 "Bad2" "" -1 114 122 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 259 105 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 157 0 0 0 0 0 E E E 0 @@ -340,15 +551,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 112 120 180 144 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 257 103 325 127 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 2 242 "PRIMITIVE_TEXT5" "" -1 22 127 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 167 110 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 159 0 0 0 0 0 E E E 0 @@ -357,18 +579,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 22 127 29 141 -0 2 2 "0s" 0 0 0 192 0 0 22 127 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 167 110 174 123 +0 2 2 "0s" 0 0 0 192 0 0 167 110 1 1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 1 2 14 243 "In3" "" -1 42 152 E E E 1 E 1 E N "_3DText" E N "_Window" E E - E E +1 187 135 E E E 1 E 1 E N "_3DText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 161 0 0 0 0 0 E E E 0 @@ -377,15 +610,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 40 150 108 174 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 185 133 253 157 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 14 244 "Bad3" "" -1 116 152 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 261 135 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 163 0 0 0 0 0 E E E 0 @@ -394,15 +638,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 112 150 180 174 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 257 133 325 157 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 2 245 "PRIMITIVE_TEXT6" "" -1 22 157 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 167 140 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 165 0 0 0 0 0 E E E 0 @@ -411,18 +666,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 22 157 29 171 -0 2 2 "0s" 0 0 0 192 0 0 22 157 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 167 140 174 153 +0 2 2 "0s" 0 0 0 192 0 0 167 140 1 1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 1 3 2 246 "PRIMITIVE_TEXT7" "" -1 42 47 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 186 33 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 166 0 0 0 0 0 E E E 0 @@ -431,18 +697,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 41 47 53 64 -0 2 2 "0s" 0 0 0 192 0 0 41 47 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 185 33 197 49 +0 2 2 "0s" 0 0 0 192 0 0 185 33 1 1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 LANG:1 2 In 2 247 "PRIMITIVE_TEXT8" "" -1 114 47 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 259 30 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 168 0 0 0 0 0 E E E 0 @@ -451,20 +728,31 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 114 47 155 64 -0 2 2 "0s" 0 0 0 192 0 0 114 47 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 259 30 300 46 +0 2 2 "0s" 0 0 0 192 0 0 259 30 1 1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 LANG:1 4 %Bad -1 284 51 "" 1 +1 293 51 "" 1 0 14 249 "Late" "" -1 510 82 E E E 1 E 1 E N "_3DText" E N "_Window" E E - E E +1 655 65 E E E 1 E 1 E N "_3DText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 171 0 0 0 0 0 E E E 0 @@ -473,15 +761,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 508 80 574 104 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 653 63 719 87 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 2 250 "PRIMITIVE_TEXT9" "" -1 446 85 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 591 68 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 172 0 0 0 0 0 E E E 0 @@ -490,18 +789,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 446 85 476 102 -0 2 2 "0s" 0 0 0 192 0 0 446 85 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 591 68 621 84 +0 2 2 "0s" 0 0 0 192 0 0 591 68 1 1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 LANG:1 4 Late 2 251 "PRIMITIVE_TEXT10" "" -1 577 84 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 722 67 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 174 0 0 0 0 0 E E E 0 @@ -510,18 +820,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 577 84 597 101 -0 2 2 "0s" 0 0 0 192 0 0 577 84 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 722 67 742 83 +0 2 2 "0s" 0 0 0 192 0 0 722 67 1 1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 LANG:1 2 ms 14 252 "IOTime" "" -1 510 122 E E E 1 E 1 E N "_3DText" E N "_Window" E E - E E +1 655 105 E E E 1 E 1 E N "_3DText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 176 0 0 0 0 0 E E E 0 @@ -530,15 +851,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 508 120 574 144 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 653 103 719 127 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 2 253 "PRIMITIVE_TEXT11" "" -1 446 125 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 591 108 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 178 0 0 0 0 0 E E E 0 @@ -547,18 +879,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 446 125 496 142 -0 2 2 "0s" 0 0 0 192 0 0 446 125 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 591 108 641 124 +0 2 2 "0s" 0 0 0 192 0 0 591 108 1 1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 LANG:1 6 IOTime 2 254 "PRIMITIVE_TEXT12" "" -1 577 124 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 722 107 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 180 0 0 0 0 0 E E E 0 @@ -567,18 +910,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 577 124 597 141 -0 2 2 "0s" 0 0 0 192 0 0 577 124 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 722 107 742 123 +0 2 2 "0s" 0 0 0 192 0 0 722 107 1 1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 LANG:1 2 ms 2 255 -"PRIMITIVE_TEXT13" +"InputBuffer_text" "" -1 250 12 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 435 -8 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(); +}" 0 + "main() +{ + dblClick(); +}" 0 + 181 0 0 0 0 0 E E E 0 @@ -587,18 +941,29 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 250 12 347 29 -0 2 2 "0s" 0 0 0 192 0 0 250 12 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 -LANG:1 15 Circular Buffer +E "main() +{ + click(); +}" 0 + 0 1 1 2 1 E U 1 E 435 -8 508 8 +0 2 2 "0s" 0 0 0 192 0 0 435 -8 1 +1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 +LANG:1 11 InputBuffer 4 261 "LINE5" "" -1 270 102 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - E E +1 415 85 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 188 0 0 0 0 0 E E E 0 @@ -607,12 +972,24 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 2 1 2 1 E 270 102 310 112 +E "main() +{ + click(inputBufferDP); +}" 0 + 0 2 1 2 1 E 415 85 455 95 4 262 "LINE6" "" -1 270 72 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - E E +1 415 55 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 189 0 0 0 0 0 E E E 0 @@ -621,12 +998,24 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 2 1 2 1 E 270 72 310 102 +E "main() +{ + click(inputBufferDP); +}" 0 + 0 2 1 2 1 E 415 55 455 85 4 263 "LINE7" "" -1 270 132 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - E E +1 415 115 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 190 0 0 0 0 0 E E E 0 @@ -635,12 +1024,24 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 2 1 2 1 E 270 132 310 122 +E "main() +{ + click(inputBufferDP); +}" 0 + 0 2 1 2 1 E 415 115 455 105 4 264 "LINE8" "" -1 270 162 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - E E +1 415 145 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 191 0 0 0 0 0 E E E 0 @@ -649,12 +1050,24 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 2 1 2 1 E 270 162 310 132 +E "main() +{ + click(inputBufferDP); +}" 0 + 0 2 1 2 1 E 415 145 455 115 6 265 "RECTANGLE22" "" 1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E - E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 193 0 0 0 0 0 E E E 0 @@ -663,12 +1076,24 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1 -35 49 2 1 0 "pictures/arrowRight.gif" 4294967295 E 450 50 474 74 +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E 1 0 1 110 32 2 1 0 "pictures/arrowRight.gif" 4294967295 E 450 50 474 74 14 279 "Rejected0" "" -1 185 62 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 330 45 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 214 0 0 0 0 0 E E E 0 @@ -677,15 +1102,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 183 60 251 84 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 328 43 396 67 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 14 280 "Rejected1" "" -1 185 92 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 330 75 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 216 0 0 0 0 0 E E E 0 @@ -694,15 +1130,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 183 90 251 114 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 328 73 396 97 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 14 281 "Rejected2" "" -1 185 122 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 330 105 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 218 0 0 0 0 0 E E E 0 @@ -711,15 +1158,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 183 120 251 144 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 328 103 396 127 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 14 282 "Rejected3" "" -1 187 152 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E +1 332 135 E E E 1 E 1 E N "_WindowText" E N "_Window" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 220 0 0 0 0 0 E E E 0 @@ -728,15 +1186,26 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 183 150 251 174 -2 "0s" 0 0 0 0 0 -1 E E E +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 328 133 396 157 +2 "0s" 0 0 0 0 0 -1 "main() +{ + click(inputBufferDP); +}" 0 + E E 2 283 "PRIMITIVE_TEXT17" "" -1 185 47 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - E E +1 330 30 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(inputBufferDP); +}" 0 + "main() +{ + dblClick(inputBufferDP); +}" 0 + 222 0 0 0 0 0 E E E 0 @@ -745,13 +1214,105 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 185 47 243 64 -0 2 2 "0s" 0 0 0 192 0 0 185 47 1 -1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" +E "main() +{ + click(inputBufferDP); +}" 0 + 0 1 1 2 1 E U 1 E 330 30 388 46 +0 2 2 "0s" 0 0 0 192 0 0 330 30 1 1 +LANG:1 33 MS Shell Dlg,-1,13,5,75,0,0,0,0,0 +0 1 LANG:1 7 %Reject +6 290 +"station_highLight" +"" +1 240 10 E E E 1 E 0 E N "_Transparent" E N "Lofar_highLight" E E + "main() +{ + rClick(stationDP); +}" 0 + "main() +{ + dblClick(stationDP); +}" 0 + +227 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +"main() +{ + dpConnect( \"stationCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" ); +} + +void stationCallback(string dp1, bool aTrig) { + + LOG_DEBUG(\"BGPProc.pnl:stationCallback|ObjectTrigger Callback on: \"+dp1+\" trigger: \"+aTrig); + LOG_DEBUG(\"BGPProc.pnl:stationCallback|Found highlight : \" + highlight + \" Looking for station: \"+station); + bool bHighlight=false; + if (dynContains(highlight,station)) { + bHighlight=true; + } + LOG_DEBUG(\"BGPProc.pnl:stationCallback|Highlight request: \"+bHighlight); + station_highLight.visible = bHighlight; +} + +" 0 + "main() +{ + click(stationDP); +}" 0 + 0 1 1 2 1 E 1 0 1 10 -52 1 E 0 132 64 166 +6 291 +"RECTANGLE18" +"" +1 150 40 E E E 1 E 1 E N "_Transparent" E N "_Transparent" E E + E E +228 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E E 0 1 1 2 1 E 1 0 1 52 -180 2 1 0 "pictures/arrowRight.gif" 4294967295 E 30 240 104 314 +2 292 +"stationLabel" +"" +1 15 90 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E + "main() +{ + rClick(stationDP); +}" 0 + "main() +{ + dblClick(stationDP); +}" 0 + +229 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +1 +"dashclr"N "_Transparent" +E "main() +{ + click(stationDP); +}" 0 + 0 1 1 2 1 E U 1 E 15 90 63 110 +0 2 2 "0s" 0 0 0 192 0 0 15 90 1 +1 +LANG:1 33 MS Shell Dlg,-1,16,5,75,0,0,0,0,0 +0 1 +LANG:1 5 CSxxx 0 LAYER, 1 1 @@ -781,7 +1342,7 @@ LAYER, 7 1 LANG:1 6 Layer8 0 -3 51 "selfState" -"objects\\lofar_self_state.pnl" 678 158 T 169 1.062627825683233 0 1 -710.461665813232 -125 +3 51 "selfState" -1 +"objects\\lofar_self_state.pnl" 678 158 T 169 1.062627825683233 0 1 -565.461665813232 -142 +0 0 -0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Processes/interactive_controller_small.pnl b/MAC/Navigator2/panels/objects/Processes/interactive_controller_small.pnl index d73ef73ec08db1ef4719190ec6610326b672782e..22065ee08ea067d12f0d6a38ce68e75d65eef47a 100644 --- a/MAC/Navigator2/panels/objects/Processes/interactive_controller_small.pnl +++ b/MAC/Navigator2/panels/objects/Processes/interactive_controller_small.pnl @@ -1,4 +1,4 @@ -V 10 +V 11 1 LANG:1 0 PANEL,-1 -1 785 105 N "_3DFace" 2 @@ -27,7 +27,6 @@ void updateTrigger( string dp1, string objectName, string dp2, dyn_string paramList, string dp3, bool invalid) { - if (objectName == panelName) { LOG_TRACE(\"interactive_controller_small.pnl:main|updateTrigger: \"+$name+\" objectName: \"+objectName+ \" panelName: \"); @@ -310,9 +309,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 118 4 644 46 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 118 4 644 46 EE 0 0 1 3 1 "error" 7 1 0 "s" 1 LANG:1 5 error E @@ -336,9 +334,8 @@ LANG:1 0 LANG:1 2 #1 10 150 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -0 0 0 1 7 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 0 0 0 1 7 1 0 2 6 "name" @@ -353,12 +350,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 10 10 40 24 +E E 0 1 1 2 1 E U 1 E 10 10 40 23 0 2 2 "0s" 0 0 0 192 0 0 10 10 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 4 name 0 LAYER, 1 @@ -389,7 +385,7 @@ LAYER, 7 1 LANG:1 0 0 -3 0 "selfState" +3 0 "selfState" -1 "objects\\lofar_self_state.pnl" 9.500000000000011 9.5 T 1 1 0 1 -0.499999999999992 10.5 0 -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/objects/Processes/station_interactive_controller_small.pnl b/MAC/Navigator2/panels/objects/Processes/station_interactive_controller_small.pnl index 299b1b2e221940ea81185b240fdc228d5d19554e..23827d8ea01a8ae8b5b5cc047bf0be86418f05ca 100644 --- a/MAC/Navigator2/panels/objects/Processes/station_interactive_controller_small.pnl +++ b/MAC/Navigator2/panels/objects/Processes/station_interactive_controller_small.pnl @@ -1,4 +1,4 @@ -V 10 +V 11 1 LANG:1 0 PANEL,-1 -1 785 105 N "_3DFace" 2 @@ -16,10 +16,10 @@ PANEL,-1 -1 785 105 N "_3DFace" 2 if (dpConnect(\"updateTrigger\", DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName:_online.._value\", DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.paramList:_online.._value\", DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName:_online.._invalid\") == -1) { - LOG_ERROR(\"interactive_controller_small.pnl:main|Couldn't find DP to connect to: \"+DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName\" ); + LOG_ERROR(\"station_interactive_controller_small.pnl:main|Couldn't find DP to connect to: \"+DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName\" ); } } else { - LOG_ERROR(\"interactive_controller_small.pnl:main|Couldn't connect to: \"+DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName \" + getLastError()); + LOG_ERROR(\"station_interactive_controller_small.pnl:main|Couldn't connect to: \"+DPNAME_NAVIGATOR + g_navigatorID + \".updateTrigger.objectName \" + getLastError()); } } @@ -29,7 +29,7 @@ void updateTrigger( string dp1, string objectName, if (objectName == panelName) { - LOG_TRACE(\"interactive_controller_small.pnl:main|updateTrigger: \"+$name+\" objectName: \"+objectName+\" panelName: \"+panelName); + LOG_TRACE(\"station_interactive_controller_small.pnl:main|updateTrigger: \"+$name+\" objectName: \"+objectName+\" panelName: \"+panelName); string observation=\"\"; string station = \"\"; if (dynlen(paramList) > 0) { @@ -91,7 +91,7 @@ void dblClick() { // indicate this is a doubleClick bDoubleClicked = true; if (dpExists(baseDP) ) { - LOG_DEBUG(\"interactive_controller_small.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+baseDP); + LOG_DEBUG(\"station_interactive_controller_small.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+baseDP); g_currentDatapoint=baseDP; navPanel_setEvent($name,\"ChangePanel\"); } @@ -118,7 +118,7 @@ void rClick() { // // *************************************** void reload(string obsBaseDP,string station) { - LOG_DEBUG(\"interactive_controller_small.pnl:reload| entered: \"+obsBaseDP+\" connected=\"+connected+\" old baseDP=\"+baseDP+\" station: \"+station ); + LOG_DEBUG(\"station_interactive_controller_small.pnl:reload| entered: \"+obsBaseDP+\" connected=\"+connected+\" old baseDP=\"+baseDP+\" station: \"+station ); if (baseDP == obsBaseDP) { return; @@ -157,7 +157,7 @@ void reload(string obsBaseDP,string station) { connected=true; } } else { - LOG_ERROR(\"interactive_controller_small.pnl:reload|Couldn't find DP to connect to: \"+baseDP); + LOG_ERROR(\"station_interactive_controller_small.pnl:reload|Couldn't find DP to connect to: \"+baseDP); } // pass baseDP to selfstate Object to work with setValue(\"selfState.light\",\"toolTipText\",baseDP); @@ -294,9 +294,8 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 118 4 644 46 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 118 4 644 46 EE 0 0 1 3 1 "error" 7 1 0 "s" 1 LANG:1 5 error E @@ -320,9 +319,8 @@ LANG:1 0 LANG:1 2 #1 10 150 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -0 0 0 1 7 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 0 0 0 1 7 1 0 2 6 "name" @@ -337,12 +335,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 10 10 40 24 +E E 0 1 1 2 1 E U 1 E 10 10 40 23 0 2 2 "0s" 0 0 0 192 0 0 10 10 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 4 name 0 LAYER, 1 @@ -373,7 +370,7 @@ LAYER, 7 1 LANG:1 0 0 -3 0 "selfState" +3 0 "selfState" -1 "objects\\lofar_self_state.pnl" 9.500000000000011 9.5 T 1 1 0 1 -0.499999999999992 12.5 0 -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/objects/navigator_alerts.pnl b/MAC/Navigator2/panels/objects/navigator_alerts.pnl index 8dc7a5bb415233bf9553d6b76cf8866abf77cc7e..2187a053dfecc8e64c23db05472cb1921be148a8 100644 --- a/MAC/Navigator2/panels/objects/navigator_alerts.pnl +++ b/MAC/Navigator2/panels/objects/navigator_alerts.pnl @@ -1,4 +1,4 @@ -V 10 +V 11 1 LANG:1 0 PANEL,-1 -1 1058 126 N "_3DFace" 1 @@ -169,12 +169,14 @@ void ackAllClicked() { // ok rest should be possible to acknowledge // find the entry in the table - iPos=dynContains(g_alarms[\"DPNAME\"],dp); + if ( dynlen(g_alarms[\"DPNAME\"]) >= 1) { + iPos=dynContains(g_alarms[\"DPNAME\"],dp); - if (iPos < 1) { - LOG_ERROR(\"navigator_alerts.pnl:ackAllClicked|Strange, couldn't find chosen entry in alarm global list: \" + dp); - } else { - acknowledgeAlarm(iPos,getCurrentTime(),dp,message,0); + if (iPos < 1) { + LOG_ERROR(\"navigator_alerts.pnl:ackAllClicked|Strange, couldn't find chosen entry in alarm global list: \" + dp); + } else { + acknowledgeAlarm(iPos,getCurrentTime(),dp,message,0); + } } } } @@ -419,10 +421,9 @@ LANG:0 0 E E 0 1 1 0 1 E U 0 E 990 30 1031.999999999996 46 0 2 2 "4d" 4 0 0 64 0 0 990 30 1 2 -LANG:1 87 -*-Arial-bold-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,758,0,0,0,0,0,0,0,0,Arial +LANG:1 26 Arial,-1,13,5,75,0,0,0,0,0 LANG:0 107 -microsoft windows-Arial-normal-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,400,0,0,0,0,3,2,1,34,Arial -0 "" -2 +0 2 LANG:1 1 0 LANG:0 1 0 25 11 @@ -446,9 +447,8 @@ LANG:1 0 0 1 -LANG:1 96 -*-Arial Black-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,Arial Black -0 "" - 8 8 962 92 +LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0 +0 8 8 962 92 E"main(int row, string column, string value) { click(row); @@ -488,14 +488,13 @@ LANG:1 2 #3 LANG:1 2 #4 10 10 1 -LANG:1 96 -*-Arial Black-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,Arial Black -0 "" -0 1 0 1 7 +LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0 +0 0 1 0 1 7 1 0 2 16 "PRIMITIVE_TEXT1" "" -1 970 10 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E +1 968 -10 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E E E 28 0 0 0 0 0 E E E @@ -505,12 +504,11 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E 1 0 1.666666666666667 -2 -26.66666666666667 1 E 972 22 1025 36 +E E 0 1 1 2 1 E 1 0 1.666666666666667 -2 -26.66666666666667 1 E 972 22 1025 35 0 2 2 "0s" 0 0 0 192 0 0 972 22 1 1 -LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" -1 +LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 +0 1 LANG:1 9 # Alarms: 13 17 "ack_all_button" @@ -525,9 +523,8 @@ LANG:1 22 Acknowledge all alarms 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg -0 "" - 968 58 1032 84 +LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 +0 968 58 1032 84 T 1 @@ -566,4 +563,4 @@ LAYER, 7 1 LANG:1 0 0 -0 \ No newline at end of file +0 diff --git a/MAC/Navigator2/panels/objects/navigator_progressBar.pnl b/MAC/Navigator2/panels/objects/navigator_progressBar.pnl index fab265653ac7077aa9dc58495c1e5bdbe84933e3..488ca0166c73abd021bc772f26166a96ffc0e04c 100644 --- a/MAC/Navigator2/panels/objects/navigator_progressBar.pnl +++ b/MAC/Navigator2/panels/objects/navigator_progressBar.pnl @@ -15,6 +15,7 @@ PANEL,-1 -1 638 94 N "_3DFace" 1 break; } } + // Check if Action point exists and connect to it if // it does. The action Point is the call back for this object itsActionDp = DPNAME_NAVIGATOR + g_navigatorID + \".\"+$name+\".action\"; @@ -40,7 +41,7 @@ void initialize() { // connect progressbar to value to act on setProgressBarDPE() { - if (dpExists(itsProgressBarDp)) { + if (dpExists(itsProgressBarDp)) { if (connected && dpExists(dpe) && dpe != \"\") { dpDisconnect(display,dpe); connected=false; @@ -49,6 +50,7 @@ setProgressBarDPE() { dpConnect(\"display\",true,dpe); connected=true; } + } display(string dp1, string progress) @@ -59,6 +61,7 @@ display(string dp1, string progress) \"used31\",\"scale\",1-number/100.0,1, \"used32\",\"scale\",1-number/100.0,1, \"progressValue\",\"text\",number); + } @@ -191,12 +194,14 @@ LANG:0 0 1 "dashclr"N "_Transparent" -"main() -{ - float x,y; - - getValue(\"\",\"position\",x,y); - addSymbol(myModuleName(), myPanelName(), \"objects/STD_INFOS/minitext_t_l.pnl\",\"mt1\",makeDynString(\"$s_txt:\"),x,y,0,1,1); +"main() +{ + + float x,y; + + getValue(\"\",\"position\",x,y); + addSymbol(myModuleName(), myPanelName(), \"objects/STD_INFOS/minitext_t_l.pnl\",\"mt1\",makeDynString(\"$s_txt:\"),x,y,0,1,1); + }" 0 E 0 1 1 0 1 E U 1 E 4 10 10 10 30 @@ -251,4 +256,4 @@ LAYER, 7 1 LANG:1 6 Layer8 0 -0 +0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/navigator_viewSelection.pnl b/MAC/Navigator2/panels/objects/navigator_viewSelection.pnl index 7ef9757893b66b8bce938c3ae7e44fed6be53051..d613f2863cad6468b71ca14a3de525d3077302a1 100644 --- a/MAC/Navigator2/panels/objects/navigator_viewSelection.pnl +++ b/MAC/Navigator2/panels/objects/navigator_viewSelection.pnl @@ -1,7 +1,7 @@ V 11 1 LANG:1 0 -PANEL,-1 -1 1024 781 N "_3DFace" 1 +PANEL,-1 -1 1024 757 N "_3DFace" 1 "$name" "main(){ @@ -75,7 +75,6 @@ void setEvent(dyn_string aSelection,string event) { if (navigator_initializing()) { return; } - string anEvent=$name+\"|\"+event; if (dpExists(itsEventDp)) { dpSet(itsEventDp,anEvent); @@ -96,12 +95,12 @@ DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 LAYER, 0 1 LANG:1 0 -28 0 +28 18 "tabView" "" 1 351.934020618558 755.2214285714285 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E E E -1 0 0 0 0 0 +16 0 0 0 0 0 E E E 0 1 @@ -134,76 +133,6 @@ LANG:1 7 Reports LANG:1 6 Alerts 0 -30 5 -"FRAME1" -"" -1 11 644 E E E 1 E 1 E N "_WindowText" E N {0,0,0} E E - E E -6 0 0 0 0 0 -E E E -1 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 0 1 0 1 E U 0 E 11 644 310 734 -1 -LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0 -0 1 -LANG:1 11 Frame Title -6 7 -"RECTANGLE1" -"" -1 9 651 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - E E -8 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 3 1 2 1 E U 1 E 9 651 321 718 -2 9 -"PRIMITIVE_TEXT1" -"" -1 5.92 666 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E -10 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 3 1 2 1 E 1.4 0 1 -0.8 0 1 E 4 666 25 681 -0 2 2 "0s" 0 0 0 192 0 0 4 666 1 -1 -LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0 -0 1 -LANG:1 3 DP: -2 11 -"PRIMITIVE_TEXT2" -"" -1 11 706 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E -12 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 3 1 2 1 E U 1 E 11 706 46 721 -0 2 2 "0s" 0 0 0 192 0 0 11 706 1 -1 -LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0 -0 1 -LANG:1 6 state: 13 13 "testButton" "" @@ -256,7 +185,7 @@ EP_childPanelOn() 22 14 "panelChoice" "" -1 860 40 E E E 1 E 0 E N "_WindowText" E N "_Window" E E +1 860 50 E E E 1 E 0 E N "_WindowText" E N "_Window" E E E E 15 0 0 0 0 0 E E E @@ -267,7 +196,7 @@ LANG:1 0 0 1 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 858 38 1012 59 +0 858 48 1012 69 0 E @@ -281,11 +210,11 @@ E E 1 0 -1 15 0 "" 1 +1 19 0 "" 1 0 -1 16 1 "" 1 +1 20 1 "" 1 0 -1 17 2 "" 1 +1 21 2 "" 1 0 0 LAYER, 1 @@ -325,4 +254,4 @@ LANG:1 0 3 2 "PANEL_REF3" -1 "objects\\Processes\\lofar_Proc_state.pnl" 225 5 T 16 1 0 1 -19 1 0 -0 +0 \ No newline at end of file diff --git a/MAC/Navigator2/scripts/libs/CEP_Processes.ctl b/MAC/Navigator2/scripts/libs/CEP_Processes.ctl index e47aa89cc116603ce238f2fc0c188bcbd1d9562c..2403f1feb14d678f5d1b9f677c776351cc7750f9 100644 --- a/MAC/Navigator2/scripts/libs/CEP_Processes.ctl +++ b/MAC/Navigator2/scripts/libs/CEP_Processes.ctl @@ -131,7 +131,7 @@ bool CEP_Processes_UpdateCEPControllers() { dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.objectName","OnlineControl_BGPApplPanel", DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.paramList",makeDynString(CEP_obsBaseDP)); - dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.objectName","OnlineControl_StorageApplPanel", + dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.objectName","PythonControlPanel", DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.paramList",makeDynString(CEP_obsBaseDP)); } diff --git a/MAC/Navigator2/scripts/libs/MainCU_Processes.ctl b/MAC/Navigator2/scripts/libs/MainCU_Processes.ctl index a61b531c979f8aeb957466f37acc6894186d86da..0852b1f894020d70824013c9869365c8ba136e32 100644 --- a/MAC/Navigator2/scripts/libs/MainCU_Processes.ctl +++ b/MAC/Navigator2/scripts/libs/MainCU_Processes.ctl @@ -130,10 +130,10 @@ void MainCU_Processes_UpdateMainControllers() { dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.objectName","ObservationControlPanel", DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.paramList",makeDynString(obsBaseDP)); // also connect to CCU Ctrls - dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.objectName","OnlineControl_StorageApplPanel", - DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.paramList",makeDynString(obsBaseDP)); dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.objectName","OnlineControl_BGPApplPanel", DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.paramList",makeDynString(obsBaseDP)); + dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.objectName","PythonControlPanel", + DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.paramList",makeDynString(obsBaseDP)); } } diff --git a/MAC/Navigator2/scripts/libs/Station_Processes.ctl b/MAC/Navigator2/scripts/libs/Station_Processes.ctl index 57105071c18175fd3178e6733667360919d20b00..d1538f9b78d42195c7caa6ab751fc3f94160cce3 100644 --- a/MAC/Navigator2/scripts/libs/Station_Processes.ctl +++ b/MAC/Navigator2/scripts/libs/Station_Processes.ctl @@ -145,7 +145,7 @@ bool Station_Processes_UpdateStationControllers() { // check if selection is made, and the selection is indeed a new one if (newSelectedStation != 0) { - if (strtok(newSelectedStation,":") < 0) { + if (strpos(newSelectedStation,":") < 0) { station_selectedStation=newSelectedStation+":"; } else { station_selectedStation=newSelectedStation; @@ -153,6 +153,11 @@ bool Station_Processes_UpdateStationControllers() { } stationDBName.text(station_selectedStation); + + DebugN("dpSubSys: ", dpSubStr(station_obsBaseDP,DPSUB_SYS)); + DebugN("obsBase: " , station_obsBaseDP); + DebugN("newselstation: ", newSelectedStation); + DebugN("station: ", station_selectedStation); dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.objectName","BeamControlPanel", DPNAME_NAVIGATOR + g_navigatorID + ".updateTrigger.paramList",makeDynString(station_obsBaseDP,station_selectedStation)); @@ -197,7 +202,7 @@ bool Station_Processes_UpdateProcessesList() { station_selectedStation = dpSubStr(g_currentDatapoint,DPSUB_SYS); } - if (strtok(station_selectedStation,":") < 0) { + if (strpos(station_selectedStation,":") < 0) { station_selectedStation+=":"; } if (strpos(obsDP,station_selectedStation) < 0) { diff --git a/MAC/Navigator2/scripts/libs/navCtrl.ctl b/MAC/Navigator2/scripts/libs/navCtrl.ctl index 3acca14f4ab49bc6a52065f30ebc1f9b344d452f..c1af5241527c06ee4dda4778a10f2f8ec53dc31b 100644 --- a/MAC/Navigator2/scripts/libs/navCtrl.ctl +++ b/MAC/Navigator2/scripts/libs/navCtrl.ctl @@ -65,6 +65,7 @@ void navCtrl_handleViewBoxEvent(string dp,string value){ string aShape; string anEvent; dyn_string aSelection; + string selection=""; if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + ".fw_viewBox.selection")) { dpGet(DPNAME_NAVIGATOR + g_navigatorID+".fw_viewBox.selection", aSelection); @@ -87,6 +88,7 @@ void navCtrl_handleViewBoxEvent(string dp,string value){ LOG_INFO("navCtrl.ctl:navCtrl_handleViewBoxEvent| Found event : " + anEvent); LOG_INFO("navCtrl.ctl:navCtrl_handleViewBoxEvent| Found selection: " + aSelection); navCtrl_handleNavigatorEvent(aSelection,anEvent,aShape); + // depending on the event received, actions need to be taken @@ -125,6 +127,31 @@ void navCtrl_handleViewBoxEvent(string dp,string value){ // Panel needs to be changed if (anEvent == "ChangePanel") { + // To be able to handle same panel for different choices we introduce the possiblity to give a fake extra _level in the + // selection datapoint, in that case the selection will be stripped from the fake point and set to the one b4 that + // a fake point will be known by the # delim + + string var=""; + if (strpos(aSelection[1],"#") >= 0) { + dyn_string aS = strsplit(aSelection[1],"#"); + selection = aS[1]; + var= aS[2]; + + LOG_DEBUG("navCtrl.ctl:navCtrl_handleViewBoxEvent|#selection: "+selection); + LOG_DEBUG("navCtrl.ctl:navCtrl_handleViewBoxEvent|#var: "+var); + if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + ".panelParamList")) { + dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".panelParamList",var); + } else { + LOG_WARN("navCtrl.ctl:navCtrl_handleViewBoxEvent| Error: no dp " + DPNAME_NAVIGATOR + g_navigatorID+".panelParamList"); + } + } + + + + if (dpExists(selection)) { + g_currentDatapoint=selection; + } + if (navTabCtrl_showView()) { navFunct_waitObjectReady(500); @@ -311,6 +338,7 @@ void navCtrl_handleViewSelectionEvent(string dp,string value){ string aShape; string anEvent; dyn_string aSelection; + string selection=""; if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + ".fw_viewSelection.selection")) { @@ -366,7 +394,31 @@ void navCtrl_handleViewSelectionEvent(string dp,string value){ //ChangePanel if (anEvent == "ChangePanel") { - + + // To be able to handle same panel for different choices we introduce the possiblity to give a fake extra _level in the + // selection datapoint, in that case the selection will be stripped from the fake point and set to the one b4 that + // a fake point will be known by the # delim + + string var=""; + if (strpos(selection,"#") >= 0) { + dyn_string aS = strsplit(selection,"#"); + selection = aS[1]; + var= aS[2]; + + LOG_DEBUG("navCtrl.ctl:navCtrl_handleViewSelectionEvent|#selection: "+selection); + LOG_DEBUG("navCtrl.ctl:navCtrl_handleViewSelectionEvent|#var: "+var); + if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + ".panelParamList")) { + dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".panelParamList",var); + } else { + LOG_WARN("navCtrl.ctl:navCtrl_handleViewSelectionEvent| Error: no dp " + DPNAME_NAVIGATOR + g_navigatorID+".panelParamList"); + } + } + + + if (dpExists(selection)) { + g_currentDatapoint=selection; + } + if (navTabCtrl_showView()) { navFunct_waitObjectReady(500); @@ -534,10 +586,12 @@ void navCtrl_handleDetailSelectionEvent(string dp,string value,string target){ if (sel[1] == "Observations") { typeSelector=sel[1]; - observationType=sel[2]; - selection=sel[3]; - if (!dynContains(highlight,selection)) { - dynAppend(highlight,selection); + if (dynlen(sel) >= 2) observationType=sel[2]; + if (dynlen(sel) >= 3) { + selection=sel[3]; + if (!dynContains(highlight,selection)) { + dynAppend(highlight,selection); + } } // if selection == observation, add involved hardware && software @@ -573,7 +627,7 @@ void navCtrl_handleDetailSelectionEvent(string dp,string value,string target){ } if (anEvent == "ChangePanel") { - + //check if a tab change should be initiated if (ACTIVE_TAB != typeSelector && typeSelector != "") { LOG_DEBUG("navCtrl.ctl:navCtrl_handleDetailSelectionEvent|Active tab should be changed to : "+ typeSelector); @@ -587,7 +641,7 @@ void navCtrl_handleDetailSelectionEvent(string dp,string value,string target){ // a fake point will be known by the # delim string var=""; - if (strtok(selection,"#") >= 0) { + if (strpos(selection,"#") >= 0) { dyn_string aS = strsplit(selection,"#"); selection = aS[1]; var= aS[2]; @@ -597,7 +651,7 @@ void navCtrl_handleDetailSelectionEvent(string dp,string value,string target){ if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + ".panelParamList")) { dpSet(DPNAME_NAVIGATOR + g_navigatorID + ".panelParamList",var); } else { - LOG_WARN("navCtrl.ctl:navCtrl_handleLocatorEvent| Error: no dp " + DPNAME_NAVIGATOR + g_navigatorID+".panelParamList"); + LOG_WARN("navCtrl.ctl:navCtrl_handleDetailSelectionEvent| Error: no dp " + DPNAME_NAVIGATOR + g_navigatorID+".panelParamList"); } } diff --git a/MAC/Navigator2/scripts/libs/navFunct.ctl b/MAC/Navigator2/scripts/libs/navFunct.ctl index 11a7c1692ec84869e98d0094079740efcd014e9b..b00b85372d385f356f58173c7b693ad7c22ba243 100644 --- a/MAC/Navigator2/scripts/libs/navFunct.ctl +++ b/MAC/Navigator2/scripts/libs/navFunct.ctl @@ -79,7 +79,8 @@ //navFunct_CEPName2inputBuf : returns ionr from CEPname //navFunct_stationNameToIONode : returns the IONode belonging to a station //navFunct_isBGPSwitch : returns the BGPSwitch setting (True = BGPRack1, False=BGPRack0) - +//navFunct_IONode2DPName : returns the DP name based on the ionode number. +//navFunct_formatInt : returns a string with the int preceeded by zeros #uses "GCFLogging.ctl" #uses "GCFCommon.ctl" @@ -1174,17 +1175,22 @@ void navFunct_fillObservationsList() { for (int i=1; i <= dynlen(g_processesList);i++) { // check if the dptype is of type (Stn)Observation string process = navFunct_getPathLessOne(g_processesList[i]); - if (dpTypeName(process) == "Observation" || dpTypeName(process) == "StnObservation") { - // get the real observation name - int iPos = dynContains(g_observations["DP"],dpSubStr(process,DPSUB_DP)); - if (iPos > 0) { - string observation = g_observations["NAME"][iPos]; - strreplace(observation,"LOFAR_ObsSW_",""); + // check if it is an existing databasePoint + if (dpExists(process) ) { + if (dpTypeName(process) == "Observation" || dpTypeName(process) == "StnObservation" || dpTypeName(process) == "CEPObservation") { + // get the real observation name + int iPos = dynContains(g_observations["DP"],dpSubStr(process,DPSUB_DP)); + if (iPos > 0) { + string observation = g_observations["NAME"][iPos]; + strreplace(observation,"LOFAR_ObsSW_",""); - if (!dynContains(g_observationsList,observation)) { - dynAppend(g_observationsList,observation); + if (!dynContains(g_observationsList,observation)) { + dynAppend(g_observationsList,observation); + } } } + } else { + LOG_ERROR("navFunct.ctl:navFunct_fillObservationsLists| ERROR: illegal DP in processList: "+process); } } // otherwise hardware @@ -1822,6 +1828,7 @@ string navFunct_CEPName2DPName(string CEPName) { int nodenr=0; int ionr=0; + if (foundRack) { name += "BGP"; } @@ -1890,7 +1897,7 @@ string navFunct_DPName2CEPName(string DPName) { int nodenr=0; int ionr=0; - if (foundRack) { + if (foundRack){ name += "R0" + rack; } @@ -2046,11 +2053,11 @@ bool navFunct_isOnline(int syst) { } } - +// Searchs all ionodes.usedStation names for match with the given name string navFunct_stationNameToIONode(string name) { dyn_dyn_anytype tab; - dpQuery("SELECT '_original.._value' FROM 'R0*-*.station' REMOTE '"+CEPDBName+"' WHERE _DPT = \"BGPConnectionInfo\"",tab); + dpQuery("SELECT '_original.._value' FROM 'LOFAR_PIC_BGP_Midplane*_IONode*.usedStation' REMOTE '"+CEPDBName+"' WHERE _DPT = \"IONode\"",tab); for(int z=2;z<=dynlen(tab);z++) { if (tab[z][2] == name) return dpSubStr(tab[z][1],DPSUB_DP); @@ -2058,9 +2065,51 @@ string navFunct_stationNameToIONode(string name) { return "not found"; } +// returns if the 2nd rack is used (true) or not (false) bool navFunct_isBGPSwitch() { // get BGPSwitch to see if rack 0 or rack 1 in use bool BGPSwitch=false; dpGet(CEPDBName+"LOFAR_PIC_BGP.BGPSwitch",BGPSwitch); return BGPSwitch; } + +//returns the name of the DataPoint for a given ionr +string navFunct_IONode2DPName(int ionode) { + string ext=""; + if (ionode < 10) ext = "0"; + string dp = CEPDBName+"LOFAR_PIC_BGP_Midplane"+navFunct_IONode2Midplane(ionode)+"_IONode"+ext+ionode; + + return dp; + +} + +// **************************************** +// Name: navFunct_formatInt +// **************************************** +// val = the value to be formatted +// maxval = the maximum value to determine the format +// so a val of 1 will be formatted" +// maxval 9 - 1 +// maxval 99 - 01 +// maxval 999 - 001 +// Returns: +// the intval as string preceeded with zeros +// or "" if error +// **************************************** +string navFunct_formatInt(int val,int maxval) { + if (val > maxval) + return ""; + + int nr = val; + // have to avoid loop when nr = 0 + if (nr == 0) nr = 1; + string ret=""; + while (nr < maxval) { + if (nr*10 > maxval) break; + nr*=10; + ret+="0"; + } + ret+=val; + return ret; +} + diff --git a/MAC/Navigator2/scripts/libs/navTabCtrl.ctl b/MAC/Navigator2/scripts/libs/navTabCtrl.ctl index c30fbbbec04cf3b9c0675fc68e5edd2aea94cef4..2f1df535abcc5bacaa22c23548d5942e5cc6e3c9 100644 --- a/MAC/Navigator2/scripts/libs/navTabCtrl.ctl +++ b/MAC/Navigator2/scripts/libs/navTabCtrl.ctl @@ -371,7 +371,7 @@ void navTabCtrl_fillPanelChoice(dyn_string panels,int panelNr) { // /////////////////////////////////////////////////////////////////////////// void navTabCtrl_saveAndRestoreCurrentDP(string newtab) { - +/* LOG_DEBUG("navTabCtrl.ctl:navTabCtrl_saveAndRestoreCurrentDP| curDP: "+g_currentDatapoint); LOG_DEBUG("navTabCtrl.ctl:navTabCtrl_saveAndRestoreCurrentDP| ACTIVE_TAB: "+ACTIVE_TAB); LOG_DEBUG("navTabCtrl.ctl:navTabCtrl_saveAndRestoreCurrentDP| newtab: "+newtab); @@ -402,6 +402,7 @@ void navTabCtrl_saveAndRestoreCurrentDP(string newtab) { g_currentDatapoint = MainDBName+"LOFAR"; } LOG_DEBUG("navTabCtrl.ctl:navTabCtrl_saveAndRestoreCurrentDP|curDP after change: ",g_currentDatapoint); + */ } diff --git a/MAC/Navigator2/scripts/libs/navigator.ctl b/MAC/Navigator2/scripts/libs/navigator.ctl index d858f4707b98153f307c7d7974dc0ec4d863722a..b845ea1aa233a09df2689d3ef7d101e078e0c0a7 100644 --- a/MAC/Navigator2/scripts/libs/navigator.ctl +++ b/MAC/Navigator2/scripts/libs/navigator.ctl @@ -147,6 +147,7 @@ void navigator_handleEventInitialize() // Init the connection Watchdog GCFCWD_Init(); + // we need to wait until the connection watchdog has been initialised if (!waitInitProcess("GCFCWDFinished")) { LOG_FATAL("navigator.ctl:navigator_handleEventInitialize|Couldn't finish GCFCWD_Init() , leaving"); @@ -167,6 +168,7 @@ void navigator_handleEventInitialize() // Initilaize the alarm system initNavigatorAlarms(); + // we need to wait until the alarmSystem has been initialised if (!waitInitProcess("initNavigatorAlarmsFinished")) { LOG_FATAL("navigator.ctl:navigator_handleEventInitialize|Couldn't finish initNavigatorAlarmsFinished() , leaving"); @@ -181,6 +183,7 @@ void navigator_handleEventInitialize() LOG_FATAL("navigator.ctl:navigator_handleEventInitialize|Couldn't finish queryConnectObservationsFinished() , leaving"); } + // set initialized ready g_initializing = false; diff --git a/MAC/Navigator2/scripts/readStationBGPconnections.ctl b/MAC/Navigator2/scripts/readStationBGPconnections.ctl index b4352f31d258eb559752cd49479765a23c0669dc..13d1b8db3e8360529ecd365043d8089604e2ad95 100644 --- a/MAC/Navigator2/scripts/readStationBGPconnections.ctl +++ b/MAC/Navigator2/scripts/readStationBGPconnections.ctl @@ -32,12 +32,16 @@ main() { bool showDebug = false; + + // first empty old settings + + emptyIONodes(); string strCurConfig; string strDataDir = ""; string strDataDir = ""; if (isdir("/opt/lofar/etc/") ) { - strDataDir = "/opt/lofar/etc/StaticMetaData/"; + strDataDir = "/opt/lofar/etc/"; } else if ( isdir ("d:/data/TRUNK-CCU001/data/configs/") ) { strDataDir = "d:/data/TRUNK-CCU001/data/configs/"; } else { @@ -45,120 +49,77 @@ main() return; } - string strRSPDatFile = strDataDir+"RSPConnections.dat"; - string strMACDatFile = strDataDir+"MAC+IP.dat"; + string strRSPDatFile = strDataDir+"RSPConnections_CCU.dat"; dyn_string dynStr_RSPfile; - dyn_string dynStr_MACfile; - // first read the files - dynStr_RSPfile = lto_getFile_asDynStr(strRSPDatFile); - dynStr_MACfile = lto_getFile_asDynStr(strMACDatFile); + // first read the file + dynStr_RSPfile = lto_getFile_asDynStr(strRSPDatFile); DebugN("Filling Database from file " + strRSPDatFile); for (int index=1;index <= dynlen(dynStr_RSPfile);index++) { if (strpos(dynStr_RSPfile[index],"#") < 0 || strpos(dynStr_RSPfile[index],"#") > 4) { + dyn_string linesplitted=strsplit(dynStr_RSPfile[index]," \t"); if (showDebug) DebugN(index+" :"+linesplitted); - // check if stationname is not empty - if (dynlen(linesplitted) == 3 && linesplitted[3] != "") { - string ionode = linesplitted[3]; - string ioname = "LOFAR_PIC_"+navFunct_CEPName2DPName(ionode); - - int stationPlace=1; - if (strpos(ionode,"BG") < 0) { - stationPlace = 0; - } else { - if (showDebug) DebugN("BGP in name found: " + ionode); - continue; - } - int rackPlace=1; - if (strpos(ionode,"R00") < 0) { - rackPlace=0; - } + string station = linesplitted[1]; + string rspstr = linesplitted[2]; + string ionode = linesplitted[3]; + string ip = linesplitted[4]; + string mac = linesplitted[5]; + string macForeign = ""; + // the station/mac/ip places are for the cases were rsp1 can be the 2nd ear or a foreign station + // if a foreign station is used they will be in the list as R(00-01)_BG(1-3)_(DE,FR,SE,UK)(601-608) + // and the real ionode can be found based on the shared ipnr + // then the info will go to the 2nd station in the database - dyn_string rsp = strsplit(linesplitted[2],"_"); - int nr = rsp[2]; - if (showDebug) DebugN( "node: "+ionode+ " rspfull: " + linesplitted[2]+ " rsp[2]" + rsp[2]+ "nr: "+nr); - if (dpExists(ioname)) { - dpSet(ioname+".station"+stationPlace,linesplitted[1]); -// dpSet(ioname+".RSPBoard"+rackPlace,nr); - } else { - DebugN(ionode+" gives wrong dp: " , ioname); - } - } - } - } - DebugN("Ready"); - - // now read MAC+IP - DebugN("Filling Database from file " + strMACDatFile); - for (int index=1;index <= dynlen(dynStr_MACfile);index++) { - if (strpos(dynStr_MACfile[index],"#") < 0 || strpos(dynStr_MACfile[index],"#") > 4) { - dyn_string linesplitted=strsplit(dynStr_MACfile[index]," \t"); - - if (showDebug) DebugN(index+" :"+linesplitted); - // check if stationname is not empty - if (dynlen(linesplitted) == 3 && linesplitted[1] != "") { - string ionode= linesplitted[1]; - if (strpos(ionode,"R02") >= 0) { - continue; - } - int rackPlace=1; - if (strpos(ionode,"R00") < 0) { - rackPlace=0; + int stationPlace=1; + if (strpos(ionode,"R00") >= 0) { + stationPlace=0; + } + if (strpos(ionode,"BG") >= 0) { + if (showDebug) DebugN(" ionode contains BG router name, trying to find real ionode for connection based on ip: "+ip); + ionode=""; + // check list based on ipnr and find the real ionode + for (int idx=1;idx <= index;idx++) { + if (strpos(dynStr_RSPfile[idx],ip) >= 0) { + if (showDebug) DebugN(" found match for ip in: " + dynStr_RSPfile[idx]); + dyn_string sp = strsplit(dynStr_RSPfile[idx]," \t"); + ionode= sp[3]; + macForeign= mac; + break; + } } - - string ioname = "LOFAR_PIC_"+navFunct_CEPName2DPName(ionode); - + } - int stationPlace=1; - - if (strpos(ionode,"BG") < 0) { - stationPlace = 0; - } else { - if (showDebug) DebugN("BGP in name found: " + ionode); - // we need te find out the foreign connection info out of two files - // first we need the Station and rspinfo that belong to thies node - dyn_string rspinfo = dynPatternMatch("*"+ionode+"*",dynStr_RSPfile); - // take stationname and rspnr - if (dynlen(rspinfo) < 1) { - DebugN("no match in RSPconnections.dat for pattern: "+ ionode); - continue; - } - dyn_string spl=strsplit(rspinfo[1]," \t"); - string station = spl[1]; - dyn_string rsp = strsplit(spl[2],"_"); - int nr = rsp[2]; - - - //now look for match on ip nr in same file - dyn_string ipinfo = dynPatternMatch("*"+linesplitted[2]+"*",dynStr_MACfile); - // there must be 2 hits, 1st is the right node, 2nd is the initial line with BG - if (dynlen(ipinfo) < 2) { - DebugN("couldn't find match on ip for :"+ionode+" with pattern "+"*"+linesplitted[2]+"*"); - continue; - } - spl=strsplit(ipinfo[1]," \t"); - ionode= spl[1]; - ioname = "LOFAR_PIC_"+navFunct_CEPName2DPName(ionode); - if (dpExists(ioname)) { - dpSet(ioname+".station"+stationPlace,station); -// dpSet(ioname+".RSPBoard"+rackPlace,nr); - } else { - DebugN(ionode+" gives wrong dp: " , ioname); - continue; - } - } - - if (dpExists(ioname)) { - dpSet(ioname+".IP"+rackPlace,linesplitted[2]); - dpSet(ioname+".MAC"+rackPlace,linesplitted[3]); + if (ionode == "" ) { + DebugN("Found BG name in ionode, but couldn't find ip match. skipping...."); + continue; + } else { + if (showDebug) DebugN("ionode match found: "+ionode); + } + + string ioname = "LOFAR_PIC_"+navFunct_CEPName2DPName(ionode); + + + + dyn_string rsp = strsplit(rspstr,"_"); + int nr = rsp[2]; + if (showDebug) DebugN( "node: "+ionode+ " rspfull: " + rspstr+ " rsp[2]" + rsp[2]+ " nr: "+nr + + " ip: "+ip+ " mac: "+mac); + if (dpExists(ioname)) { + dpSet(ioname+".IP"+stationPlace,ip); + if (macForeign != "") { + dpSet(ioname+".MACForeign",macForeign); + dpSet(ioname+".station1",station); } else { - DebugN(ionode+" gives wrong dp: " , ioname); + dpSet(ioname+".MAC"+stationPlace,mac); + dpSet(ioname+".station0",station); } - } + } else { + DebugN(ionode+" gives wrong dp: " , ioname); + } } } DebugN("Ready"); @@ -196,3 +157,22 @@ dyn_string lto_getFile_asDynStr(string aFileName) return aFile_asDynStr; } + +void emptyIONodes() { + for (int i = 0; i < 64;i++) { + string ext = ""; + if (i < 10) ext = "0"; + string dp = "LOFAR_PIC_BGP_Midplane"+navFunct_IONode2Midplane(i)+"_IONode"+ext+i; + if (dpExists(dp+".station0")) { + dpSet(dp+".station0",""); + dpSet(dp+".IP0",""); + dpSet(dp+".MAC0",""); + dpSet(dp+".station1",""); + dpSet(dp+".IP1",""); + dpSet(dp+".MAC1",""); + dpSet(dp+".MACForeign",""); + } else { + DebugN("wrong dp found: "+dp+".station0"); + } + } +} diff --git a/MAC/Tools/Clock/plotclock b/MAC/Tools/Clock/plotclock index fccd5acb4341b74f52048f9244b1eedb85c0214f..d48ca77870972fbd636b0f427807241dff14ab5f 100755 --- a/MAC/Tools/Clock/plotclock +++ b/MAC/Tools/Clock/plotclock @@ -1,5 +1,28 @@ -#!/usr/bin/gnuplot +#!/bin/bash +# +# V1.0, M.J.Norden, 18-09-2012 +# Usage: plotclock yyyymmdd +# + +if [ "$1" != "" ]; then + cp /var/log/ntpstats/loopstats.$1 /localhome/data/loopstats + +else + cp /var/log/ntpstats/loopstats /localhome/data/loopstats + echo "Usage: plotclock yyyymmdd" + sleep 1 + +fi +/usr/bin/gnuplot <<\EOF set grid ytics -plot "/var/log/ntpstats/loopstats" using 2:3 axis x1y1 w lines lt 3 title "clock offset", '' using 2:5 w lines lt 1 title "RMS jitter" +set xtics 7200 +set mxtics 4 +set autoscale +set ylabel "time difference between GPS time and LCU clock" +set xlabel "seconds elapsed since last midnight (UTC)" +plot "/localhome/data/loopstats" using 2:3 axis x1y1 w lines lt 3 title "clock offset", '' using 2:5 w lines lt 1 title "RMS jitter" pause 30 reread +EOF + + diff --git a/MAC/Tools/Rubidium/plotrubidium b/MAC/Tools/Rubidium/plotrubidium index 2d788d07f907b6daf0224e03f914da2287e17853..7f7807b379b46760a7b8329a08ecc31dfb91c725 100644 --- a/MAC/Tools/Rubidium/plotrubidium +++ b/MAC/Tools/Rubidium/plotrubidium @@ -1,4 +1,19 @@ -#!/usr/bin/gnuplot +#!/bin/bash +# +# V1.0, M.J.Norden, 18-09-2012 +# Usage: plotrubidium yyyymmdd +# + +if [ "$1" != "" ]; then + cp /var/log/ntpstats/rubidium_log.$1 /localhome/data/rubidium_log + +else + cp /var/log/ntpstats/rubidium_log /localhome/data/rubidium_log + echo "Usage: plotrubidium yyyymmdd" + sleep 1 + +fi +/usr/bin/gnuplot <<\EOF set grid ytics set xtics 7200 set mxtics 4 @@ -9,6 +24,8 @@ set xlabel "date-time (UT)" set timefmt "%Y-%m-%dT%H:%M:%S" set xdata time set format x "%d %b-%H:%M" -plot "/var/log/ntpstats/rubidium_log" using 1:5 every 20 notitle; +plot "/localhome/data/rubidium_log" using 1:5 every 20 notitle; pause 300 reread +EOF + diff --git a/RTCP/CNProc/src/AsyncTransposeBeams.cc b/RTCP/CNProc/src/AsyncTransposeBeams.cc index 9ff2e0d426b1b4abcffc08c2f67f8c61c9057a04..39b00d5a656774a9e56ad4987c2021d9852abe5f 100644 --- a/RTCP/CNProc/src/AsyncTransposeBeams.cc +++ b/RTCP/CNProc/src/AsyncTransposeBeams.cc @@ -20,11 +20,10 @@ namespace RTCP { union Tag { struct { - unsigned sourceRank :13; /* 0..8191, or two BG/P racks */ - unsigned comm :2; - unsigned _dummy :1; - unsigned subband :8; - unsigned beam :8; + unsigned sign : 1; /* must be 0 */ + unsigned sourceRank :11; /* 0..4095, or one BG/P rack */ + unsigned subband :10; + unsigned beam : 9; } info; uint32 nr; @@ -48,6 +47,7 @@ AsyncTransposeBeams::AsyncTransposeBeams( itsCommHandles(itsNrCommunications,nrSubbands), itsLocalSubbands(nrSubbands) { + ASSERT(itsNrCommunications == 1); // no bits left to encode communication channel, so we can support only one } template <typename T,unsigned DIM, unsigned FLAGS_DIM> void AsyncTransposeBeams::postReceive(SampleData<T,DIM,FLAGS_DIM> *transposedData, unsigned localSubband, unsigned globalSubband, unsigned beam, unsigned psetIndex, unsigned coreIndex) @@ -71,8 +71,9 @@ AsyncTransposeBeams::AsyncTransposeBeams( for (unsigned h = 0; h < itsNrCommunications; h ++) { Tag t; + t.info.sign = 0; t.info.sourceRank = rank; - t.info.comm = h; + //t.info.comm = h; t.info.beam = beam; t.info.subband = globalSubband; @@ -104,7 +105,8 @@ unsigned AsyncTransposeBeams::waitForAnyReceive() LOG_DEBUG_STR( "Received subband " << subband << " from pset ??, rank " << rank << ", tag " << tag ); #endif // mark the right communication handle as received - itsCommHandles[t.info.comm][subband] = -1; + unsigned comm = 0; // = t.info.comm; + itsCommHandles[comm][subband] = -1; // check whether we have received all communications for this psetIndex. // This is the case when commHandles are -1. @@ -141,8 +143,9 @@ unsigned AsyncTransposeBeams::waitForAnyReceive() for (unsigned h = 0; h < itsNrCommunications; h ++) { Tag t; + t.info.sign = 0; t.info.sourceRank = itsLocationInfo.rank(); - t.info.comm = h; + //t.info.comm = h; t.info.subband = subband; t.info.beam = globalBeam; diff --git a/RTCP/CNProc/src/PPF.cc b/RTCP/CNProc/src/PPF.cc index 60054befef8f8711b8a99b303e09edc55e2f93b5..278c69dc1741ab7e6942b4901392e4578fdd5c97 100644 --- a/RTCP/CNProc/src/PPF.cc +++ b/RTCP/CNProc/src/PPF.cc @@ -88,8 +88,14 @@ template <> void PPF<i4complex>::initConstantTable() extern fcomplex _FIR_fp_table[16][16]; static const float map[] = { +/* + * TODO: Test whether this is better: + * 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, - -7.5, -6.5, -5.5, -4.5, -3.5, -2.5, -1.5, -0.5, + -7.5, -6.5, -5.5, -4.5, -3.5, -2.5, -1.5, -0.5 + */ + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, + -7.0, -7.0, -6.0, 5.0, -4.0, -3.0, -2.0, -1.0 }; for (unsigned i = 0; i < 16; i ++) diff --git a/RTCP/IONProc/src/ION_main.cc b/RTCP/IONProc/src/ION_main.cc index f7a5bd9d198c49f743be0af017486c81e27ee91a..339a197ef1d3af035956e417650538dd1c66a69a 100644 --- a/RTCP/IONProc/src/ION_main.cc +++ b/RTCP/IONProc/src/ION_main.cc @@ -33,6 +33,7 @@ #include <Interface/Stream.h> #include <Interface/Parset.h> #include <ION_Allocator.h> +#include <SSH.h> #include <Stream/SocketStream.h> #include <StreamMultiplexer.h> #include <IONProc/Package__Version.h> @@ -49,10 +50,6 @@ #include <sys/types.h> #include <sys/mman.h> -#ifdef HAVE_LIBSSH2 -#include <libssh2.h> -#endif - #include <boost/format.hpp> #if defined HAVE_MPI @@ -390,13 +387,10 @@ int main(int argc, char **argv) } #endif -#ifdef HAVE_LIBSSH2 - int rc = libssh2_init(0); - if (rc) { - std::cerr << "libssh2 init failed: " << rc << std::endl; + if (!SSH_Init()) { + std::cerr << "SSH subsystem init failed" << std::endl; exit(1); } -#endif #if defined HAVE_BGP INIT_LOGGER_WITH_SYSINFO(str(boost::format("IONProc@%02d") % myPsetNumber)); @@ -415,9 +409,7 @@ int main(int argc, char **argv) master_thread(); -#ifdef HAVE_LIBSSH2 - libssh2_exit(); -#endif + SSH_Finalize(); #if defined HAVE_MPI MPI_Finalize(); diff --git a/RTCP/IONProc/src/InputThreadAsm.S b/RTCP/IONProc/src/InputThreadAsm.S index 41581a666e7c86eb438305757309a5fd3433b8e3..68b6d99354ade0b8dc7e9fcd6955d3543cab8928 100644 --- a/RTCP/IONProc/src/InputThreadAsm.S +++ b/RTCP/IONProc/src/InputThreadAsm.S @@ -27,8 +27,8 @@ _copy_pkt_to_bbuffer_32_bytes: cmpwi 1,7,1 subi 7,7,1 - sub 3,3,4 subi 4,4,1*16 + sub 3,3,4 subi 5,5,16 li 8,16 diff --git a/RTCP/IONProc/src/Job.cc b/RTCP/IONProc/src/Job.cc index 40b3f8e97cb7b0d856ca15772493ace2aa071f06..f38d8888f0b7b746993821a69b01a3475eb335dd 100644 --- a/RTCP/IONProc/src/Job.cc +++ b/RTCP/IONProc/src/Job.cc @@ -88,7 +88,9 @@ Job::Job(const char *parsetName) if (itsParset.PLC_controlled()) { // let the ApplController decide what we should do try { - itsPLCStream = new SocketStream(itsParset.PLC_Host(), itsParset.PLC_Port(), SocketStream::TCP, SocketStream::Client, 60); + // Do _not_ wait for the stop time to communicate with ApplController, + // or the whole observation could be wasted. + itsPLCStream = new SocketStream(itsParset.PLC_Host(), itsParset.PLC_Port(), SocketStream::TCP, SocketStream::Client, time(0) + 30); itsPLCClient = new PLCClient(*itsPLCStream, *this, itsParset.PLC_ProcID(), itsObservationID); itsPLCClient->start(); @@ -225,7 +227,7 @@ void Job::StorageProcess::start() throw SystemCallException("getcwd", errno, THROW_ARGS); #ifdef HAVE_LIBSSH2 - std::string commandLine = str(boost::format("cd %s && %s%s %u %d %u") + std::string commandLine = str(boost::format("cd %s && %s%s %u %d %u 2>&1") % cwd #if defined USE_VALGRIND % "valgrind --leak-check=full " @@ -242,7 +244,7 @@ void Job::StorageProcess::start() #endif ); - itsSSHconnection = new SSHconnection(itsLogPrefix, itsHostname, commandLine, userName, sshKey); + itsSSHconnection = new SSHconnection(itsLogPrefix, itsHostname, commandLine, userName, sshKey, 0); itsSSHconnection->start(); #else @@ -279,13 +281,20 @@ void Job::StorageProcess::stop(struct timespec deadline) #ifdef HAVE_LIBSSH2 itsSSHconnection->stop(deadline); #else - // TODO: update timeout - time_t now = time(0); + joinSSH(itsLogPrefix, itsPID, (deadline.tv_sec ? deadline.tv_sec : time(0)) + 1); +#endif + + itsThread->cancel(); +} - unsigned timeout = 1 + (now < deadline.tv_sec ? deadline.tv_sec - now : 0); - joinSSH(itsLogPrefix, itsPID, timeout); -#endif +bool Job::StorageProcess::isDone() +{ +#ifdef HAVE_LIBSSH2 + return itsSSHconnection->isDone(); +#else + return false; +#endif } @@ -293,7 +302,7 @@ void Job::StorageProcess::controlThread() { LOG_DEBUG_STR(itsLogPrefix << "[ControlThread] connecting..."); std::string resource = getStorageControlDescription(itsParset.observationID(), itsRank); - PortBroker::ClientStream stream(itsHostname, storageBrokerPort(itsParset.observationID()), resource); + PortBroker::ClientStream stream(itsHostname, storageBrokerPort(itsParset.observationID()), resource, 0); // for now, we just send the parset and call it a day LOG_DEBUG_STR(itsLogPrefix << "[ControlThread] connected -- sending parset"); @@ -317,13 +326,26 @@ void Job::startStorageProcesses() void Job::stopStorageProcesses() { - struct timespec deadline; + time_t deadline = time(0) + 300; + struct timespec immediately = { 0, 0 }; + + size_t nrRunning = itsStorageProcesses.size(); + + do { + for (unsigned rank = 0; rank < itsStorageProcesses.size(); rank ++) + if (itsStorageProcesses[rank]->isDone()) { + itsStorageProcesses[rank]->stop(immediately); + + nrRunning--; + } + + if (nrRunning > 0) + sleep(1); - deadline.tv_sec = time(0) + 10; - deadline.tv_nsec = 0; + } while( nrRunning > 0 && time(0) < deadline ); for (unsigned rank = 0; rank < itsStorageProcesses.size(); rank ++) - itsStorageProcesses[rank]->stop(deadline); + itsStorageProcesses[rank]->stop(immediately); } diff --git a/RTCP/IONProc/src/Job.h b/RTCP/IONProc/src/Job.h index 0e14dbaf6a549e85bd1dfa7f54e439a036bd963a..c72f291955c91ac7edc8fb0693908354de56a35c 100644 --- a/RTCP/IONProc/src/Job.h +++ b/RTCP/IONProc/src/Job.h @@ -99,6 +99,8 @@ class Job : public PLCRunnable void start(); void stop( struct timespec deadline ); + bool isDone(); + private: void controlThread(); diff --git a/RTCP/IONProc/src/LogThread.cc b/RTCP/IONProc/src/LogThread.cc index 4b3a123f33b7a6b2e5f40e1f5bc2758e9ddd9308..ccf585bbec17a030d7f0a816cf0bc36e32fc9d93 100644 --- a/RTCP/IONProc/src/LogThread.cc +++ b/RTCP/IONProc/src/LogThread.cc @@ -102,11 +102,23 @@ void LogThread::writeCPUstats(std::stringstream &str) struct CPUload load; struct timeval tv; + static size_t lowIdleCount = 0; + if (readCPUstats(load)) { gettimeofday( &tv, 0 ); float timediff = (tv.tv_sec - previousTimeval.tv_sec) + (tv.tv_usec - previousTimeval.tv_usec)/1.0e6; + unsigned idle0 = static_cast<unsigned>((load.idle0 - previousLoad.idle0) / timediff); + if (idle0 < 10) + lowIdleCount++; + else + lowIdleCount = 0; + + // TODO: Don't print this error in non-realtime mode + if (lowIdleCount == 5) + LOG_ERROR("CPU load critical on core 0"); + //str << ", us/sy/in/id: [" str << ", us/sy/in/id(0): [" << fixed << setprecision(0) @@ -114,7 +126,7 @@ void LogThread::writeCPUstats(std::stringstream &str) << (unsigned(load.system - previousLoad.system) + 2) / 4 / timediff << '/' << (unsigned(load.interrupt - previousLoad.interrupt) + 2) / 4 / timediff << '/' << (unsigned(load.idle - previousLoad.idle) + 2) / 4 / timediff << '(' - << (unsigned(load.idle0 - previousLoad.idle0) / timediff) << ")]"; + << idle0 << ")]"; #if 0 << "], id: [" << (unsigned(load.idlePerCore[0] - previousLoad.idlePerCore[0]) << '/' diff --git a/RTCP/IONProc/src/OutputSection.cc b/RTCP/IONProc/src/OutputSection.cc index ac157218ddb01db274a00fa6fbb3ba65c1380221..a5fc54bcda15eebf5d0e2faa72b47d383488c8d6 100644 --- a/RTCP/IONProc/src/OutputSection.cc +++ b/RTCP/IONProc/src/OutputSection.cc @@ -233,8 +233,8 @@ void OutputSection::notDroppingData(unsigned stream) void OutputSection::mainLoop() { #if defined HAVE_BGP_ION - //doNotRunOnCore0(); - runOnCore0(); + doNotRunOnCore0(); + //runOnCore0(); setPriority(2); #endif diff --git a/RTCP/IONProc/src/OutputThread.cc b/RTCP/IONProc/src/OutputThread.cc index 79bf6bb8ffa1627d583e013ce89cc2aeed3765b3..00fbd0650164d779046972d3b392d3611f0e879e 100644 --- a/RTCP/IONProc/src/OutputThread.cc +++ b/RTCP/IONProc/src/OutputThread.cc @@ -42,7 +42,8 @@ namespace RTCP { OutputThread::OutputThread(const Parset &parset, OutputType outputType, unsigned streamNr, unsigned adderNr) : itsLogPrefix(str(boost::format("[obs %u type %u stream %3u adder %3u] ") % parset.observationID() % outputType % streamNr % adderNr)), - itsOutputDescriptor(getStreamDescriptorBetweenIONandStorage(parset, outputType, streamNr)) + itsOutputDescriptor(getStreamDescriptorBetweenIONandStorage(parset, outputType, streamNr)), + itsDeadline(parset.stopTime()) { for (unsigned i = 0; i < maxSendQueueSize; i ++) itsFreeQueue.append(newStreamableData(parset, outputType, streamNr, hugeMemoryAllocator)); @@ -65,7 +66,7 @@ void OutputThread::mainLoop() try { LOG_DEBUG_STR(itsLogPrefix << "Creating connection to " << itsOutputDescriptor << "..."); - SmartPtr<Stream> streamToStorage(createStream(itsOutputDescriptor, false)); + SmartPtr<Stream> streamToStorage(createStream(itsOutputDescriptor, false, static_cast<time_t>(itsDeadline))); LOG_DEBUG_STR(itsLogPrefix << "Creating connection to " << itsOutputDescriptor << ": done"); for (SmartPtr<StreamableData> data; (data = itsSendQueue.remove()) != 0; itsFreeQueue.append(data.release())) diff --git a/RTCP/IONProc/src/OutputThread.h b/RTCP/IONProc/src/OutputThread.h index 428cf923fb9726d4f30416f218e45d6fa04a7639..4a34677461aefb27f1e504dd552ea820a19e091b 100644 --- a/RTCP/IONProc/src/OutputThread.h +++ b/RTCP/IONProc/src/OutputThread.h @@ -55,6 +55,7 @@ class OutputThread const std::string itsLogPrefix; const std::string itsOutputDescriptor; + const double itsDeadline; public: SmartPtr<Thread> itsThread; diff --git a/RTCP/IONProc/src/RSP.h b/RTCP/IONProc/src/RSP.h index 7499850da128a3bf55d706dd0ebed06d217b94a6..adaf9e013f629cb09b4a4d20746ffc56b5d500de 100644 --- a/RTCP/IONProc/src/RSP.h +++ b/RTCP/IONProc/src/RSP.h @@ -23,6 +23,7 @@ #ifndef LOFAR_IONPROC_RSP_H #define LOFAR_IONPROC_RSP_H +#include <Common/LofarTypes.h> namespace LOFAR { namespace RTCP { @@ -34,14 +35,14 @@ namespace RTCP { struct RSP { struct Header { - uint8_t version; - uint8_t sourceInfo; - uint16_t configuration; - uint16_t station; - uint8_t nrBeamlets; - uint8_t nrBlocks; - uint32_t timestamp; - uint32_t blockSequenceNumber; + uint8 version; + uint8 sourceInfo; + uint16 configuration; + uint16 station; + uint8 nrBeamlets; + uint8 nrBlocks; + uint32 timestamp; + uint32 blockSequenceNumber; } header; char data[8130]; diff --git a/RTCP/IONProc/src/SSH.cc b/RTCP/IONProc/src/SSH.cc index dc2d734f785fcfb6adcb49870a3bd4e2bcb55e4f..3438333507caab719382e1c2f3851a3ce3e3fd04 100644 --- a/RTCP/IONProc/src/SSH.cc +++ b/RTCP/IONProc/src/SSH.cc @@ -34,12 +34,14 @@ #include <fcntl.h> #include <string.h> #include <errno.h> +#include <time.h> #include <vector> #include <string> #include <sstream> #ifdef HAVE_LIBSSH2 #include <Scheduling.h> +#include <Interface/SmartPtr.h> #include <sstream> #include <sys/select.h> #include <Common/lofar_string.h> @@ -52,14 +54,15 @@ namespace LOFAR { namespace RTCP { #ifdef HAVE_LIBSSH2 - -SSHconnection::SSHconnection(const string &logPrefix, const string &hostname, const string &commandline, const string &username, const string &sshkey) + +SSHconnection::SSHconnection(const string &logPrefix, const string &hostname, const string &commandline, const string &username, const string &sshkey, time_t deadline) : itsLogPrefix(logPrefix), itsHostName(hostname), itsCommandLine(commandline), itsUserName(username), - itsSSHKey(sshkey) + itsSSHKey(sshkey), + itsDeadline(deadline) { } @@ -68,6 +71,11 @@ void SSHconnection::start() itsThread = new Thread(this, &SSHconnection::commThread, itsLogPrefix + "[SSH Thread] ", 65536); } +bool SSHconnection::isDone() +{ + return itsThread->isDone(); +} + void SSHconnection::stop( const struct timespec &deadline ) { if (!itsThread->wait(deadline)) { @@ -210,34 +218,45 @@ bool SSHconnection::waitsocket( FileDescriptorBasedStream &sock ) void SSHconnection::commThread() { #if defined HAVE_BGP_ION - //doNotRunOnCore0(); - runOnCore0(); + doNotRunOnCore0(); + //runOnCore0(); //nice(19); #endif - SocketStream sock( itsHostName, 22, SocketStream::TCP, SocketStream::Client ); - - LOG_DEBUG_STR( itsLogPrefix << "Connected" ); - int rc; int exitcode; - char *exitsignal=(char *)"none"; + char *exitsignal = 0; + SmartPtr<SocketStream> sock; - /* Prevent cancellation from here on -- we manually insert cancellation points to avoid - screwing up libssh2's internal administration. */ - Cancellation::disable(); - Cancellation::point(); + for(;;) { + // keep trying to connect + sock = new SocketStream( itsHostName, 22, SocketStream::TCP, SocketStream::Client, itsDeadline ); - if (!open_session(sock)) - return; + LOG_DEBUG_STR( itsLogPrefix << "Connected" ); - if (!open_channel(sock)) - return; + /* Prevent cancellation from here on -- we manually insert cancellation points to avoid + screwing up libssh2's internal administration. */ + { + ScopedDelayCancellation dc; + + Cancellation::point(); + + if (!open_session(*sock)) + continue; + + if (!open_channel(*sock)) + continue; + } + + break; + } + + LOG_DEBUG_STR( itsLogPrefix << "Starting remote command: " << itsCommandLine); while( (rc = libssh2_channel_exec(channel, itsCommandLine.c_str())) == LIBSSH2_ERROR_EAGAIN ) { - waitsocket(sock); + waitsocket(*sock); } if (rc) @@ -248,63 +267,88 @@ void SSHconnection::commThread() LOG_DEBUG_STR( itsLogPrefix << "Remote command started, waiting for output" ); + Cancellation::disable(); + Cancellation::point(); + +#define NRSTREAMS 2 + // raw input buffer - char data[0x1000]; + char data[NRSTREAMS][0x1000]; // the current line (or line remnant) - string line(""); + string line[NRSTREAMS]; + + // how many streams still provide data + unsigned nrOpenStreams = NRSTREAMS; + + // which streams still provide data + bool isOpen[NRSTREAMS]; + + for (unsigned s = 0; s < NRSTREAMS; ++s) + isOpen[s] = true; /* Session I/O */ - for( ;; ) + while( nrOpenStreams > 0 ) { - /* loop until we block */ - do { - rc = libssh2_channel_read( channel, data, sizeof data ); - if( rc > 0 ) - { - // create a buffer for line + data - stringstream buffer; + for (unsigned s = 0; s < NRSTREAMS; ++s) { + if (!isOpen[s]) + continue; + + /* loop until we block */ + do { + rc = libssh2_channel_read_ex( channel, s, data[s], sizeof data[s] ); + if( rc > 0 ) + { + // create a buffer for line + data + stringstream buffer; - buffer << line; - buffer.write( data, rc ); + buffer << line[s]; + buffer.write( data[s], rc ); - /* extract and log lines */ - for( ;; ) - { - Cancellation::point(); + /* extract and log lines */ + for( ;; ) + { + Cancellation::point(); - std::getline( buffer, line ); + std::getline( buffer, line[s] ); - if (!buffer.good()) { - // 'line' now holds the remnant - break; - } + if (!buffer.good()) { + // 'line' now holds the remnant + + if (line[s].size() > 1024) { + LOG_ERROR_STR( itsLogPrefix << "Line too long (" << line[s].size() << "); truncated: " << line[s] ); + line[s] = ""; + } + break; + } - // TODO: Use logger somehow (we'd duplicate the prefix if we just use LOG_* macros..) - cout << line << endl; + // TODO: Use logger somehow (we'd duplicate the prefix if we just use LOG_* macros..) + cout << line[s] << endl; + } + } else { + if( rc < 0 && rc != LIBSSH2_ERROR_EAGAIN ) { + /* no need to output this for the EAGAIN case */ + LOG_ERROR_STR( itsLogPrefix << "libssh2_channel_read_ex returned " << rc << " for channel " << s); + } } - } else { - if( rc < 0 && rc != LIBSSH2_ERROR_EAGAIN ) { - /* no need to output this for the EAGAIN case */ - LOG_ERROR_STR( itsLogPrefix << "libssh2_channel_read returned " << rc); - } + } while( rc > 0 ); + + /* this is due to blocking that would occur otherwise so we loop on + this condition */ + if( rc != LIBSSH2_ERROR_EAGAIN ) + { + /* EOF */ + --nrOpenStreams; } - } while( rc > 0 ); + } - /* this is due to blocking that would occur otherwise so we loop on - this condition */ - if( rc == LIBSSH2_ERROR_EAGAIN ) - { - waitsocket(sock); - } else { - /* EOF */ - break; - } + if (nrOpenStreams > 0) + waitsocket(*sock); } LOG_DEBUG_STR( itsLogPrefix << "Disconnecting" ); - close_channel(sock); + close_channel(*sock); if (rc == 0) { @@ -323,9 +367,64 @@ void SSHconnection::commThread() LOG_INFO_STR(itsLogPrefix << "Terminated normally"); } } + +#include <openssl/crypto.h> + +std::vector< SmartPtr<Mutex> > openssl_mutexes; + +static void lock_callback(int mode, int type, const char *file, int line) +{ + (void)file; + (void)line; + + if (mode & CRYPTO_LOCK) + openssl_mutexes[type]->lock(); + else + openssl_mutexes[type]->unlock(); +} + +static unsigned long thread_id_callback() +{ + return static_cast<unsigned long>(pthread_self()); +} + +#endif + +bool SSH_Init() { + +#ifdef HAVE_LIBSSH2 + // initialise openssl + openssl_mutexes.resize(CRYPTO_num_locks()); + for (size_t i = 0; i < openssl_mutexes.size(); ++i) + openssl_mutexes[i] = new Mutex; + + CRYPTO_set_id_callback(&thread_id_callback); + CRYPTO_set_locking_callback(&lock_callback); + + // initialise libssh2 + int rc = libssh2_init(0); + if (rc) + return false; #endif + return true; +} + +void SSH_Finalize() { +#ifdef HAVE_LIBSSH2 + // exit libssh2 + libssh2_exit(); + + // exit openssl + CRYPTO_set_locking_callback(NULL); + CRYPTO_set_id_callback(NULL); + + openssl_mutexes.clear(); +#endif +} + + static void exitwitherror( const char *errorstr ) { // can't cast to (void) since gcc won't allow that as a method to drop the result @@ -417,7 +516,7 @@ pid_t forkSSH(const std::string &logPrefix, const char *hostName, const char * c } -void joinSSH(const std::string &logPrefix, pid_t pid, unsigned &timeout) +void joinSSH(const std::string &logPrefix, pid_t pid, time_t deadline) { if (pid != 0) { int status; @@ -440,11 +539,10 @@ void joinSSH(const std::string &logPrefix, pid_t pid, unsigned &timeout) return; } else if (ret == 0) { // child still running - if (timeout == 0) { + if (deadline > 0 && deadline < time(0)) { break; } - timeout--; sleep(1); } else { // child exited diff --git a/RTCP/IONProc/src/SSH.h b/RTCP/IONProc/src/SSH.h index 7dda0f9d0486fc40bb5e1bd054dd228df0e0e031..f8ecad86a3aecf76aedcef2acddcc296d1a1fd7f 100644 --- a/RTCP/IONProc/src/SSH.h +++ b/RTCP/IONProc/src/SSH.h @@ -31,6 +31,7 @@ #include <Stream/FileDescriptorBasedStream.h> #include <libssh2.h> #include <Interface/SmartPtr.h> +#include <time.h> #endif #include <string> @@ -38,15 +39,20 @@ namespace LOFAR { namespace RTCP { +bool SSH_Init(); +void SSH_Finalize(); + #ifdef HAVE_LIBSSH2 class SSHconnection { public: - SSHconnection(const string &logPrefix, const string &hostname, const string &commandline, const string &username, const string &sshkey); + SSHconnection(const string &logPrefix, const string &hostname, const string &commandline, const string &username, const string &sshkey, time_t deadline = 0); void start(); void stop( const struct timespec &deadline ); + bool isDone(); + private: const string itsLogPrefix; const string itsHostName; @@ -55,6 +61,7 @@ private: const string itsSSHKey; SmartPtr<Thread> itsThread; + const time_t itsDeadline; static void free_session( LIBSSH2_SESSION *session ); static void free_channel( LIBSSH2_CHANNEL *channel ); @@ -74,7 +81,7 @@ private: #endif pid_t forkSSH(const std::string &logPrefix, const char *hostName, const char * const extraParams[], const char *userName, const char *sshKey); -void joinSSH(const std::string &logPrefix, pid_t pid, unsigned &timeout); +void joinSSH(const std::string &logPrefix, pid_t pid, time_t deadline = 0); const char *explainExitStatus( int exitstatus ); diff --git a/RTCP/IONProc/src/WallClockTime.h b/RTCP/IONProc/src/WallClockTime.h index 16e28bf729ed4ab51162115d594c9eb6b7254305..cdc4313cb6c376e37fe6305c0df5e5046ec1d151 100644 --- a/RTCP/IONProc/src/WallClockTime.h +++ b/RTCP/IONProc/src/WallClockTime.h @@ -98,7 +98,7 @@ inline void WallClockTime::cancelWait() ScopedLock scopedLock(itsMutex); itsCancelled = true; - itsCondition.signal(); + itsCondition.broadcast(); } diff --git a/RTCP/IONProc/test/CMakeLists.txt b/RTCP/IONProc/test/CMakeLists.txt index 14beaac6c093928066bee009967f3a8968dd75ea..0cc60d5c9d04f625bc12a0b35cb34b9ccde424ed 100644 --- a/RTCP/IONProc/test/CMakeLists.txt +++ b/RTCP/IONProc/test/CMakeLists.txt @@ -7,3 +7,6 @@ include_directories(${PACKAGE_SOURCE_DIR}/src) lofar_add_test(tDelayCompensation tDelayCompensation.cc) lofar_add_test(tSSH tSSH.cc) +#lofar_add_test(tRSPTimeStamp tRSPTimeStamp.cc) + +#add_subdirectory(newInputSection) diff --git a/RTCP/IONProc/test/RTCP.parset b/RTCP/IONProc/test/RTCP.parset index 2f6644efc96995d6a89c5674ee0d5ff051a2956b..3cfafd160556bc41b11fae9a048878847f4a2a92 100644 --- a/RTCP/IONProc/test/RTCP.parset +++ b/RTCP/IONProc/test/RTCP.parset @@ -1,7 +1,7 @@ OLAP.CNProc.integrationSteps = 768 OLAP.CNProc.phaseOnePsets = [0..4] OLAP.CNProc.phaseTwoPsets = [0..4] -OLAP.CNProc.phaseThreePsets = [] +OLAP.CNProc.phaseThreePsets = [0..4] OLAP.CNProc.phaseOneTwoCores = [0,1,2] OLAP.CNProc.phaseThreeCores = [0,1,2] OLAP.CNProc.partition = PartitionName @@ -14,24 +14,20 @@ OLAP.nrBitsPerSample = 16 OLAP.nrTimesInFrame = 16 OLAP.nrSecondsOfBuffer = 3.5 OLAP.CNProc.nrPPFTaps = 16 -OLAP.Storage.userName = romein -OLAP.Storage.sshIdentityFile = /home/romein/.ssh/id_rsa -OLAP.Storage.msWriter = /tmp/build/gnu_opt/RTCP/Storage/src/Storage_main +OLAP.Storage.userName = mol +OLAP.Storage.sshIdentityFile = /home/mol/.ssh/id_dsa +OLAP.Storage.msWriter = Storage_main OLAP.storageNodeList = [5*0] OLAP.OLAP_Conn.IONProc_Storage_Ports = [8300..9000] OLAP.OLAP_Conn.IONProc_Storage_Transport = TCP OLAP.OLAP_Conn.rawDataOutputOnly = F OLAP.storageStationNames = [CS004LBA,CS006LBA,RS205LBA,RS208LBA,RS306LBA] OLAP.tiedArrayStationNames = [] -Observation.Beam[0].nrTiedArrayBeams = 2 +Observation.Beam[0].nrTiedArrayBeams = 1 Observation.Beam[0].TiedArrayBeam[0].angle1 = 1.1 Observation.Beam[0].TiedArrayBeam[0].angle2 = 1.2 Observation.Beam[0].TiedArrayBeam[0].coherent = T Observation.Beam[0].TiedArrayBeam[0].dispersionMeasure = 0.0 -Observation.Beam[0].TiedArrayBeam[1].angle1 = 1.3 -Observation.Beam[0].TiedArrayBeam[1].angle2 = 1.4 -Observation.Beam[0].TiedArrayBeam[1].coherent = T -Observation.Beam[0].TiedArrayBeam[1].dispersionMeasure = 0.0 OLAP.IONProc.integrationSteps = 1 OLAP.CNProc_CoherentStokes.timeIntegrationFactor = 1 OLAP.CNProc_IncoherentStokes.timeIntegrationFactor = 1 @@ -39,7 +35,7 @@ OLAP.CNProc_CoherentStokes.channelsPerSubband = 256 OLAP.CNProc_IncoherentStokes.channelsPerSubband = 256 OLAP.CNProc_CoherentStokes.subbandsPerFile = 244 OLAP.CNProc_IncoherentStokes.subbandsPerFile = 244 -OLAP.CNProc_CoherentStokes.which = I # IQUV, XXYY +OLAP.CNProc_CoherentStokes.which = XXYY # I, IQUV, XXYY OLAP.CNProc_IncoherentStokes.which = I # IQUV OLAP.PencilInfo.storageNodeList = [] OLAP.delayCompensation = T @@ -80,9 +76,9 @@ OLAP.Storage.hosts = [localhost] Observation.DataProducts.Output_Correlated.enabled = T Observation.DataProducts.Output_Correlated.locations = [5*localhost:/tmp] Observation.DataProducts.Output_Correlated.filenames = [SB000.MS,SB001.MS,SB002.MS,SB003.MS,SB004.MS] -Observation.DataProducts.Output_Beamformed.enabled = F +Observation.DataProducts.Output_Beamformed.enabled = T Observation.DataProducts.Output_Beamformed.locations = [4*localhost:/tmp] -Observation.DataProducts.Output_Beamformed.filenames = [CV001.X,CV001.Y,CV002.X,CV002.Y] +Observation.DataProducts.Output_Beamformed.filenames = [CV001.Xr,CV001.Xi,CV002.Yr,CV002.Yi] Observation.DataProducts.Output_Trigger.enabled = F Observation.DataProducts.Output_Trigger.locations = [] Observation.DataProducts.Output_Trigger.filenames = [] diff --git a/RTCP/IONProc/test/newInputSection/CMakeLists.txt b/RTCP/IONProc/test/newInputSection/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..875538d004f36d4ac28e6b09cbd702a0ddf0324f --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/CMakeLists.txt @@ -0,0 +1 @@ +lofar_add_test(newInputSection newInputSection.cc) diff --git a/RTCP/IONProc/test/newInputSection/OMPThread.h b/RTCP/IONProc/test/newInputSection/OMPThread.h new file mode 100644 index 0000000000000000000000000000000000000000..014478942387a75afbf3552fda81c8a07de21d52 --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/OMPThread.h @@ -0,0 +1,67 @@ +#ifndef __OMPTHREAD__ +#define __OMPTHREAD__ + +#include <pthread.h> +#include <time.h> +#include <signal.h> +#include <Common/LofarLogger.h> +#include <Common/SystemCallException.h> + +namespace LOFAR { + +class OMPThread { +public: + OMPThread(): id(0), stopped(false) {} + + void start() { + id = pthread_self(); + } + + void stop() { + id = 0; + stopped = true; + } + + void kill() { + while (!stopped) { + // interrupt blocking system calls (most notably, read()) + // note that the thread will stick around until the end + // of pragma parallel, so the thread id is always valid + // once it has been set. + pthread_t oldid = id; + + if (oldid > 0) + if (pthread_kill(oldid, SIGHUP) < 0) + throw SystemCallException("pthread_kill", errno, THROW_ARGS); + + // sleep for 100ms - do NOT let us get killed here, + // because we're maintaining integrity + const struct timespec ts = { 1, 200*1000 }; + while (nanosleep( &ts, NULL ) == -1 && errno == EINTR) + ; + } + } + + class ScopedRun { + public: + ScopedRun( OMPThread &thread ): thread(thread) { + thread.start(); + } + + ~ScopedRun() { + thread.stop(); + } + + private: + OMPThread &thread; + }; + +private: + volatile pthread_t id; + volatile bool stopped; +}; + +} + +#endif + diff --git a/RTCP/IONProc/test/newInputSection/Poll.h b/RTCP/IONProc/test/newInputSection/Poll.h new file mode 100644 index 0000000000000000000000000000000000000000..b3151a7cf63c410f2c78cdb9d82e9041b8b0a669 --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/Poll.h @@ -0,0 +1,82 @@ +#ifndef POLL +#define POLL + +#include <Stream/FileDescriptorBasedStream.h> +#include <Common/SystemCallException.h> +#include <sys/epoll.h> + +class Poll: protected FileDescriptorBasedStream { +public: + Poll(); + + // Caveats: + // * Don't add a stream that's already in the set + // * You might want to call s->setnonblocking() as well, + // or your read()/write() can still block. + void add( FileDescriptorBasedStream *s, bool reading, bool writing ); + + // Note: closing the file descriptor automatically removes + // the stream from the list, see man epoll. + void remove( FileDescriptorBasedStream *s ); + + // Wait for timeout_ms milliseconds for events, and return + // the relevant streams. Up to maxevents streams are returned. + std::vector<FileDescriptorBasedStream *> poll( int timeout_ms, size_t maxevents ); +}; + +Poll::Poll() +{ + fd = epoll_create1(EPOLL_CLOEXEC); + + if( fd == -1 ) + throw SystemCallException("epoll_create1", errno, THROW_ARGS); +} + +void Poll::add( FileDescriptorBasedStream *s, bool reading, bool writing ) +{ + ASSERT( s->fd >= 0 ); + + struct epoll_event ev; + ev.events = (reading ? EPOLLIN : 0) | (writing ? EPOLLOUT : 0); + ev.data.ptr = s; + + if (epoll_ctl(fd, EPOLL_CTL_ADD, s->fd, &ev) == -1) + throw SystemCallException("epoll_ctl", errno, THROW_ARGS); +} + +void Poll::remove( FileDescriptorBasedStream *s ) +{ + ASSERT( s->fd >= 0 ); + + struct epoll_event ev; + + if (epoll_ctl(fd, EPOLL_CTL_DEL, s->fd, &ev) == -1) + throw SystemCallException("epoll_ctl", errno, THROW_ARGS); +} + +std::vector<FileDescriptorBasedStream *> Poll::poll( int timeout_ms, size_t maxevents ) +{ + // In theory, starvation can occur under heavy I/O if maxevents < #streams. If + // this is to be avoided, extend this class to employ a ready list as + // described in 'man epoll'. + std::vector<struct epoll_event> events(maxevents); + int nfds; + + nfds = epoll_wait(fd, &events[0], events.size(), timeout_ms ); + + if (nfds == -1) + throw SystemCallException("epoll_wait", errno, THROW_ARGS); + + std::vector<FileDescriptorBasedStream *> result(nfds, 0); + + for (int i = 0; i < nfds; ++i) { + FileDescriptorBasedStream *s = static_cast<FileDescriptorBasedStream*>(events[i].data.ptr); + + results[i] = s; + } + + return result; +} + +#endif + diff --git a/RTCP/IONProc/test/newInputSection/Ranges.h b/RTCP/IONProc/test/newInputSection/Ranges.h new file mode 100644 index 0000000000000000000000000000000000000000..48d3e669918a3d09a419b546a9ee4c9fa5166f0e --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/Ranges.h @@ -0,0 +1,217 @@ +#ifndef RANGES +#define RANGES + +#include <Interface/SparseSet.h> +#include <Common/LofarLogger.h> +#include <Common/LofarTypes.h> + +#include <ostream> + +namespace LOFAR { +namespace RTCP { + +// +// Thread-safe set of int64 [from,to) ranges. +// +class Ranges { +public: + Ranges(); + Ranges( void *data, size_t numBytes, int64 minHistory, bool create ); + ~Ranges(); + + // remove [0,to) + void excludeBefore( int64 to ); + + // add a range [from,to), and return whether the addition + // was succesful. + bool include( int64 from, int64 to ); + + // returns whether there is anything set in [first, last) + bool anythingBetween( int64 first, int64 last ) const; + + SparseSet<int64> sparseSet( int64 first, int64 last ) const; + +private: + struct Range { + // Write'from' before 'to' to allow the following invariant: + // + // from < to : a valid range + // from >= to : invalid range (being written) + // from = to = 0: an unused range + volatile int64 from, to; + + Range(): from(0), to(0) {} + }; + + size_t len; + Range * ranges; + Range * begin; + Range * end; + Range *head; + + // minimal history to maintain (samples newer than this + // will be maintained in favour of newly added ranges) + int64 minHistory; + +public: + static size_t size(size_t numElements) { + return numElements * sizeof(struct Range); + } + + friend std::ostream& operator<<( std::ostream &str, const Ranges &r ); +}; + +std::ostream& operator<<( std::ostream &str, const Ranges &r ) +{ + + for (struct Ranges::Range *i = r.begin; i != r.end; ++i) + if (i->to != 0) + str << "[" << i->from << ", " << i->to << ") "; + + return str; +} + +Ranges::Ranges() +: + len(0), + ranges(0), + begin(0), + end(begin), + head(begin), + minHistory(0) +{ +} + +Ranges::Ranges( void *data, size_t numBytes, int64 minHistory, bool create ) +: + len(numBytes / sizeof *ranges), + ranges(create ? new(data)Range[len] : static_cast<Range*>(data)), + begin(&ranges[0]), + end(&ranges[len]), + head(begin), + minHistory(minHistory) +{ + ASSERT( len > 0 ); +} + +Ranges::~Ranges() +{ + for (struct Range *i = begin; i != end; ++i) + i->~Range(); +} + +void Ranges::excludeBefore( int64 to ) +{ + for (struct Range *i = begin; i != end; ++i) { + if (i->to <= to) { + // erase; delete 'to' first! + i->to = 0; + i->from = 0; + continue; + } + + if (i->from > to) { + // shorten + i->from = to; + } + } +} + +bool Ranges::include( int64 from, int64 to ) +{ + ASSERTSTR( from < to, from << " < " << to ); + ASSERTSTR( from >= head->to, from << " >= " << head->to ); + + if (head->to == 0) { + // *head is unused + head->from = from; + head->to = to; + return true; + } + + if (head->to == from) { + // *head can be extended + head->to = to; + return true; + } + + // new range is needed + struct Range * const next = head + 1 == end ? begin : head + 1; + + if (next->to < to - minHistory) { + // range at 'next' is old enough to toss away + next->from = from; + next->to = to; + + head = next; + return true; + } + + // no room -- discard + return false; +} + +bool Ranges::anythingBetween( int64 first, int64 last ) const +{ + for(struct Range *i = begin; i != end; ++i) { + // read in same order as writes occur + int64 from = i->from; + int64 to = i->to; + + if (to == 0) { + // unused + continue; + } + + if (from >= to) { + // read/write conflict + continue; + } + + from = std::max( from, first ); + to = std::min( to, last ); + + if (from < to) + return true; + } + + return false; +} + +SparseSet<int64> Ranges::sparseSet( int64 first, int64 last ) const +{ + SparseSet<int64> result; + + if (first >= last) + return result; + + for(struct Range *i = begin; i != end; ++i) { + // read in same order as writes occur + int64 from = i->from; + int64 to = i->to; + + if (to == 0) { + // unused + continue; + } + + if (from >= to) { + // read/write conflict + continue; + } + + from = std::max( from, first ); + to = std::min( to, last ); + + if (from < to) + result.include(from, to); + } + + return result; +} + +} +} + +#endif + diff --git a/RTCP/IONProc/test/newInputSection/SampleBuffer.h b/RTCP/IONProc/test/newInputSection/SampleBuffer.h new file mode 100644 index 0000000000000000000000000000000000000000..73ca26e778227358ebf80e5902278f7d29cad3de --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/SampleBuffer.h @@ -0,0 +1,99 @@ +#ifndef __SAMPLEBUFFER__ +#define __SAMPLEBUFFER__ + +#include <Common/LofarLogger.h> +#include <Common/LofarConstants.h> +#include <Interface/MultiDimArray.h> +#include <Interface/Allocator.h> +#include "StationSettings.h" +#include "SharedMemory.h" +#include "Ranges.h" +#include <string> +#include <complex> + +namespace LOFAR { +namespace RTCP { + +template<typename T> class SampleBuffer { +public: + SampleBuffer( const struct StationSettings &settings, bool create ); + + struct SampleType { + std::complex<T> x; + std::complex<T> y; + }; + +private: + const std::string logPrefix; + SharedMemoryArena data; + SparseSetAllocator allocator; + + struct StationSettings *initSettings( const struct StationSettings &localSettings, bool create ); + + static size_t dataSize( const struct StationSettings &settings ) { + return sizeof settings + + NR_RSPBOARDS * (Ranges::size(settings.nrFlagRanges) + 8) + + settings.nrBeamlets * (settings.nrSamples * sizeof(T) + 128); + } + +public: + struct StationSettings *settings; + + const size_t nrBeamlets; + const size_t nrSamples; + const size_t nrFlagRanges; + + MultiDimArray<T,2> beamlets; // [subband][sample] + std::vector<Ranges> flags; // [rspboard] +}; + + +template<typename T> SampleBuffer<T>::SampleBuffer( const struct StationSettings &_settings, bool create ) +: + logPrefix(str(boost::format("[station %s %s board] [SampleBuffer] ") % _settings.station.stationName % _settings.station.antennaSet)), + data(_settings.dataKey, dataSize(_settings), create ? SharedMemoryArena::CREATE_EXCL : SharedMemoryArena::READ), + allocator(data), + settings(initSettings(_settings, create)), + + nrBeamlets(settings->nrBeamlets), + nrSamples(settings->nrSamples), + nrFlagRanges(settings->nrFlagRanges), + + beamlets(boost::extents[nrBeamlets][nrSamples], 128, allocator, false, false), + flags(settings->nrBoards) +{ + // bitmode must coincide with our template + ASSERT( sizeof(T) == N_POL * 2 * settings->station.bitmode / 8 ); + + for (size_t f = 0; f < flags.size(); f++) { + size_t numBytes = Ranges::size(nrFlagRanges); + + flags[f] = Ranges(static_cast<int64*>(allocator.allocate(numBytes, 8)), numBytes, nrSamples, create); + } + + LOG_INFO_STR( logPrefix << "Initialised" ); +} + +template<typename T> struct StationSettings *SampleBuffer<T>::initSettings( const struct StationSettings &localSettings, bool create ) +{ + //struct StationSettings *sharedSettings = allocator.allocateTyped<struct StationSettings>(); + struct StationSettings *sharedSettings = allocator.allocateTyped(); + + if (create) { + // register settings + LOG_INFO_STR( logPrefix << "Registering " << localSettings.station ); + *sharedSettings = localSettings; + } else { + // verify settings + ASSERT( *sharedSettings == localSettings ); + LOG_INFO_STR( logPrefix << "Connected to " << localSettings.station ); + } + + return sharedSettings; +} + +} +} + +#endif + diff --git a/RTCP/IONProc/test/newInputSection/SharedMemory.h b/RTCP/IONProc/test/newInputSection/SharedMemory.h new file mode 100644 index 0000000000000000000000000000000000000000..4de23a0a141b7d740a468010995e8c3a665552fd --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/SharedMemory.h @@ -0,0 +1,149 @@ +#ifndef SHARED_MEMORY +#define SHARED_MEMORY + +#include <Common/Exception.h> +#include <Common/SystemCallException.h> +#include <Common/LofarLogger.h> +#include <Interface/Allocator.h> + +#include <sys/ipc.h> +#include <sys/shm.h> +#include <sys/stat.h> +#include <unistd.h> +#include <time.h> + +namespace LOFAR { +namespace RTCP { + +class SharedMemoryArena: public FixedArena { +public: + EXCEPTION_CLASS(TimeOutException, LOFAR::Exception); + + enum Mode { + CREATE, + CREATE_EXCL, + READ, + READWRITE + }; + + SharedMemoryArena( key_t key, size_t size, Mode mode = CREATE, time_t timeout = 60 ); + ~SharedMemoryArena(); + + template <typename T> T* ptr( size_t offset = 0 ) const { + return reinterpret_cast<T*>(reinterpret_cast<char*>(itsBegin) + offset); + } + +private: + const key_t key; + const Mode mode; + int shmid; +}; + +template<typename T> class SharedStruct { +public: + SharedStruct( key_t key, bool create = false, time_t timeout = 60 ); + + T &get() { + return *data.ptr<T>(); + } + + T &get() const { + return *data.ptr<T>(); + } + +private: + SharedMemoryArena data; + + SharedStruct( const SharedStruct & ); + SharedStruct &operator=( const SharedStruct & ); +}; + +SharedMemoryArena::SharedMemoryArena( key_t key, size_t size, Mode mode, time_t timeout ) +: + FixedArena(NULL, size), + key(key), + mode(mode), + shmid(-1) +{ + time_t deadline = time(0) + timeout; + int open_flags = 0, attach_flags = 0; + + switch (mode) { + case CREATE_EXCL: + open_flags |= IPC_EXCL; + case CREATE: + open_flags |= IPC_CREAT | SHM_NORESERVE | S_IRUSR | S_IWUSR; + break; + + case READ: + attach_flags |= SHM_RDONLY; + break; + + case READWRITE: + default: + break; + } + + // get/create shmid handle + for(;;) { + shmid = shmget( key, itsSize, open_flags ); + + if (shmid == -1) { + if (!timeout) + throw SystemCallException("shmget", errno, THROW_ARGS); + + if (errno != ENOENT && errno != EEXIST) + throw SystemCallException("shmget", errno, THROW_ARGS); + } else { + // attach to segment + itsBegin = shmat( shmid, NULL, attach_flags ); + + if (itsBegin != (void*)-1) + break; // success! + + if (!timeout) + throw SystemCallException("shmat", errno, THROW_ARGS); + + if (errno != EINVAL) + throw SystemCallException("shmat", errno, THROW_ARGS); + } + + // try again until the deadline + + if (time(0) >= deadline) + throw TimeOutException("shared memory", THROW_ARGS); + + if (usleep(999999) < 0) + throw SystemCallException("sleep", errno, THROW_ARGS); + } + +} + +SharedMemoryArena::~SharedMemoryArena() +{ + try { + // detach + if (shmdt(itsBegin) < 0) + throw SystemCallException("shmdt", errno, THROW_ARGS); + + // destroy + if (mode == CREATE || mode == CREATE_EXCL) + if (shmctl(shmid, IPC_RMID, NULL) < 0) + throw SystemCallException("shmctl", errno, THROW_ARGS); + + } catch (Exception &ex) { + LOG_ERROR_STR("Exception in destructor: " << ex); + } +} + +template<typename T> SharedStruct<T>::SharedStruct( key_t key, bool create, time_t timeout ) +: + data(key, sizeof(T), create ? SharedMemoryArena::CREATE : SharedMemoryArena::READWRITE, timeout) +{ +} + +} +} + +#endif + diff --git a/RTCP/IONProc/test/newInputSection/StationData.h b/RTCP/IONProc/test/newInputSection/StationData.h new file mode 100644 index 0000000000000000000000000000000000000000..1dd93434314ba4e715aa4a32a3563e4efa1d5c23 --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/StationData.h @@ -0,0 +1,390 @@ +#ifndef __STATIONDATA__ +#define __STATIONDATA__ + +#include <Common/LofarLogger.h> +#include <Stream/Stream.h> +#include <Interface/RSPTimeStamp.h> +#include <Interface/SmartPtr.h> +#include <RSP.h> +#include <WallClockTime.h> +#include "SampleBuffer.h" +#include "Ranges.h" +#include "StationSettings.h" +#include <string> +#include <cstring> +#include <omp.h> + +namespace LOFAR { +namespace RTCP { + +template<typename T> class RSPBoard { +public: + RSPBoard( Stream &inputStream, SampleBuffer<T> &buffer, unsigned boardNr, const struct StationSettings &settings ); + + const unsigned nr; + + bool readPacket(); + void writePacket(); + + static size_t packetSize( struct RSP &packet ) { + return sizeof(struct RSP::Header) + packet.header.nrBeamlets * packet.header.nrBlocks * sizeof(T); + } + +private: + const std::string logPrefix; + + Stream &inputStream; + const bool supportPartialReads; + struct RSP packet; + TimeStamp last_timestamp; + TimeStamp last_logtimestamp; + + SampleBuffer<T> &buffer; + Ranges &flags; + const struct StationSettings settings; + const size_t firstBeamlet; + + size_t nrReceived, nrBadSize, nrBadTime, nrOutOfOrder; + + void logStatistics(); +}; + +template<typename T> RSPBoard<T>::RSPBoard( Stream &inputStream, SampleBuffer<T> &buffer, unsigned boardNr, const struct StationSettings &settings ) +: + nr(boardNr), + logPrefix(str(boost::format("[station %s %s board %u] [RSPBoard] ") % settings.station.stationName % settings.station.antennaSet % nr)), + inputStream(inputStream), + supportPartialReads(dynamic_cast<SocketStream *>(&inputStream) == 0 || dynamic_cast<SocketStream &>(inputStream).protocol != SocketStream::UDP), + + buffer(buffer), + flags(buffer.flags[boardNr]), + settings(settings), + firstBeamlet(settings.nrBeamlets / settings.nrBoards * boardNr), + + nrReceived(0), + nrBadSize(0), + nrBadTime(0), + nrOutOfOrder(0) +{ +} + +template<typename T> void RSPBoard<T>::writePacket() +{ + const uint8 &nrBeamlets = packet.header.nrBeamlets; + const uint8 &nrTimeslots = packet.header.nrBlocks; + + // the timestamp is of the last read packet by definition + const TimeStamp ×tamp = last_timestamp; + + const size_t from_offset = (int64)timestamp % settings.nrSamples; + size_t to_offset = ((int64)timestamp + nrTimeslots) % settings.nrSamples; + + if (to_offset == 0) + to_offset = settings.nrSamples; + + const size_t wrap = from_offset < to_offset ? 0 : settings.nrSamples - from_offset; + + const T *beamlets = reinterpret_cast<const T*>(&packet.data); + + ASSERT( nrBeamlets <= settings.nrBeamlets / settings.nrBoards ); + + // mark data we overwrite as invalid + flags.excludeBefore(timestamp + nrTimeslots - settings.nrSamples); + + // transpose + for (uint8 b = 0; b < nrBeamlets; ++b) { + T *dst1 = &buffer.beamlets[firstBeamlet + b][from_offset]; + + if (wrap > 0) { + T *dst2 = &buffer.beamlets[firstBeamlet + b][0]; + + memcpy(dst1, beamlets, wrap * sizeof(T)); + memcpy(dst2, beamlets, to_offset * sizeof(T)); + } else { + memcpy(dst1, beamlets, nrTimeslots * sizeof(T)); + } + + beamlets += nrTimeslots; + } + + // mark as valid + flags.include(timestamp, timestamp + nrTimeslots); +} + +template<typename T> bool RSPBoard<T>::readPacket() +{ + if (supportPartialReads) { + // read header first + inputStream.read(&packet, sizeof(struct RSP::Header)); + + // read rest of packet + inputStream.read(&packet.data, packetSize(packet) - sizeof(struct RSP::Header)); + + ++nrReceived; + } else { + // read full packet at once -- numbytes will tell us how much we've actually read + size_t numbytes = inputStream.tryRead(&packet, sizeof packet); + + ++nrReceived; + + if( numbytes < sizeof(struct RSP::Header) + || numbytes != packetSize(packet) ) { + LOG_WARN_STR( logPrefix << "Packet is " << numbytes << " bytes, but should be " << packetSize(packet) << " bytes" ); + + ++nrBadSize; + return false; + } + } + + // check sanity of packet + + // detect bad timestamp + if (packet.header.timestamp == ~0U) { + ++nrBadTime; + return false; + } + + const TimeStamp timestamp(packet.header.timestamp, packet.header.blockSequenceNumber, settings.station.clock); + + // detect out-of-order data + if (timestamp < last_timestamp) { + ++nrOutOfOrder; + return false; + } + + // don't accept big jumps (>10s) in timestamp + const int64 oneSecond = settings.station.clock / 1024; + + if (last_timestamp && packet.header.timestamp > last_timestamp + 10 * oneSecond) { + ++nrBadTime; + return false; + } + + // packet was read and is sane + + last_timestamp = timestamp; + + if (timestamp > last_logtimestamp + oneSecond) { + logStatistics(); + + last_logtimestamp = timestamp; + } + + return true; +} + + +template<typename T> void RSPBoard<T>::logStatistics() +{ + LOG_INFO_STR( logPrefix << "Received " << nrReceived << " packets: " << nrOutOfOrder << " out of order, " << nrBadTime << " bad timestamps, " << nrBadSize << " bad sizes" ); + + nrReceived = 0; + nrOutOfOrder = 0; + nrBadTime = 0; + nrBadSize = 0; +} + + +class StationStreams { +public: + StationStreams( const std::string &logPrefix, const StationSettings &settings, const std::vector<std::string> &streamDescriptors ); + + void process(); + + void stop(); + +protected: + const std::string logPrefix; + const StationSettings settings; + const std::vector<std::string> streamDescriptors; + const size_t nrBoards; + + WallClockTime waiter; + + virtual void processBoard( size_t nr ) = 0; +}; + +StationStreams::StationStreams( const std::string &logPrefix, const StationSettings &settings, const std::vector<std::string> &streamDescriptors ) +: + logPrefix(logPrefix), + settings(settings), + streamDescriptors(streamDescriptors), + nrBoards(streamDescriptors.size()) +{ +} + +void StationStreams::process() +{ + std::vector<OMPThread> threads(nrBoards); + + ASSERT(nrBoards > 0); + + LOG_INFO_STR( logPrefix << "Start" ); + + #pragma omp parallel sections num_threads(2) + { + #pragma omp section + { + // start all boards + LOG_INFO_STR( logPrefix << "Starting all boards" ); + #pragma omp parallel for num_threads(nrBoards) + for (size_t i = 0; i < nrBoards; ++i) { + OMPThread::ScopedRun sr(threads[i]); + + processBoard(i); + } + } + + #pragma omp section + { + // wait until we have to stop + LOG_INFO_STR( logPrefix << "Waiting for stop signal" ); + waiter.waitForever(); + + // kill all boards + LOG_INFO_STR( logPrefix << "Stopping all boards" ); + #pragma omp parallel for num_threads(nrBoards) + for (size_t i = 0; i < nrBoards; ++i) + threads[i].kill(); + } + } + + LOG_INFO_STR( logPrefix << "End" ); +} + +void StationStreams::stop() +{ + waiter.cancelWait(); +} + + +template<typename T> class Station: public StationStreams { +public: + Station( const StationSettings &settings, const std::vector<std::string> &streamDescriptors ); + +protected: + SampleBuffer<T> buffer; + + virtual void processBoard( size_t nr ); +}; + +template<typename T> Station<T>::Station( const StationSettings &settings, const std::vector<std::string> &streamDescriptors ) +: + StationStreams(str(boost::format("[station %s %s] [Station] ") % settings.station.stationName % settings.station.antennaSet), settings, streamDescriptors), + + buffer(settings, true) +{ + LOG_INFO_STR( logPrefix << "Initialised" ); +} + +template<typename T> void Station<T>::processBoard( size_t nr ) +{ + const std::string logPrefix(str(boost::format("[station %s %s board %u] [Station] ") % settings.station.stationName % settings.station.antennaSet % nr)); + + try { + LOG_INFO_STR( logPrefix << "Connecting to " << streamDescriptors[nr] ); + SmartPtr<Stream> s = createStream(streamDescriptors[nr], true); + + LOG_INFO_STR( logPrefix << "Connecting to shared memory buffer 0x" << std::hex << settings.dataKey ); + RSPBoard<T> board(*s, buffer, nr, settings); + + LOG_INFO_STR( logPrefix << "Start" ); + + for(;;) + if (board.readPacket()) + board.writePacket(); + + } catch (Stream::EndOfStreamException &ex) { + LOG_INFO_STR( logPrefix << "End of stream"); + } catch (SystemCallException &ex) { + if (ex.error == EINTR) + LOG_INFO_STR( logPrefix << "Aborted: " << ex.what()); + else + LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex); + } catch (Exception &ex) { + LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex); + } + + LOG_INFO_STR( logPrefix << "End"); +} + + +template<typename T> class Generator: public StationStreams { +public: + Generator( const StationSettings &settings, const std::vector<std::string> &streamDescriptors ); + +protected: + void processBoard( size_t nr ); + + virtual void makePacket( struct RSP &header, const TimeStamp ×tamp ); +}; + +template<typename T> Generator<T>::Generator( const StationSettings &settings, const std::vector<std::string> &streamDescriptors ) +: + StationStreams(str(boost::format("[station %s %s] [Generator] ") % settings.station.stationName % settings.station.antennaSet), settings, streamDescriptors) +{ + LOG_INFO_STR( logPrefix << "Initialised" ); +} + +template<typename T> void Generator<T>::makePacket( struct RSP &packet, const TimeStamp ×tamp ) +{ + packet.header.nrBeamlets = settings.nrBeamlets / settings.nrBoards; + packet.header.nrBlocks = 16; + + packet.header.timestamp = timestamp.getSeqId(); + packet.header.blockSequenceNumber = timestamp.getBlockId(); + + int64 data = timestamp; + + memset(packet.data, data & 0xFF, sizeof packet.data); +} + +template<typename T> void Generator<T>::processBoard( size_t nr ) +{ + const std::string logPrefix(str(boost::format("[station %s %s board %u] [Generator] ") % settings.station.stationName % settings.station.antennaSet % nr)); + + try { + LOG_INFO_STR( logPrefix << "Connecting to " << streamDescriptors[nr] ); + SmartPtr<Stream> s = createStream(streamDescriptors[nr], false); + + LOG_INFO_STR( logPrefix << "Start" ); + + TimeStamp current(time(0L) + 1, 0, settings.station.clock); + for(;;) { + struct RSP packet; + + makePacket( packet, current ); + + ASSERT(RSPBoard<T>::packetSize(packet) <= sizeof packet); + + if (!waiter.waitUntil(current)) + break; + + try { + s->write(&packet, RSPBoard<T>::packetSize(packet)); + } catch (SystemCallException &ex) { + // UDP can return ECONNREFUSED or EINVAL if server does not have its port open + if (ex.error != ECONNREFUSED && ex.error != EINVAL) + throw; + } + + current += packet.header.nrBlocks; + } + } catch (Stream::EndOfStreamException &ex) { + LOG_INFO_STR( logPrefix << "End of stream"); + } catch (SystemCallException &ex) { + if (ex.error == EINTR) + LOG_INFO_STR( logPrefix << "Aborted: " << ex.what()); + else + LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex); + } catch (Exception &ex) { + LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex); + } + + LOG_INFO_STR( logPrefix << "End"); +} + +} +} + +#endif diff --git a/RTCP/IONProc/test/newInputSection/StationID.h b/RTCP/IONProc/test/newInputSection/StationID.h new file mode 100644 index 0000000000000000000000000000000000000000..d4fcafed0e307200581ac752f2aec199ef56c9cb --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/StationID.h @@ -0,0 +1,82 @@ +#ifndef __STATIONID__ +#define __STATIONID__ + +#include <Common/LofarLogger.h> +#include <ostream> +#include <cstdio> +#include <string> + +namespace LOFAR { +namespace RTCP { + +struct StationID { + char stationName[64]; + char antennaSet[64]; + + unsigned clock; + unsigned bitmode; + + StationID( const std::string &stationName = "", const std::string &antennaSet = "", unsigned clock = 200 * 1000 * 1000, unsigned bitmode = 16) + : + clock(clock), + bitmode(bitmode) + { + snprintf(this->stationName, sizeof this->stationName, "%s", stationName.c_str()); + snprintf(this->antennaSet, sizeof this->antennaSet, "%s", antennaSet.c_str()); + } + + bool operator==(const struct StationID &other) const { + return !strncmp(stationName, other.stationName, sizeof stationName) + && !strncmp(antennaSet, other.antennaSet, sizeof antennaSet) + && clock == other.clock + && bitmode == other.bitmode; + } + + bool operator!=(const struct StationID &other) const { + return !(*this == other); + } + + uint32 hash() const { + // convert to 32 bit value (human-readable in hexadecimal) + uint32 stationNr = 0; + + const std::string stationNameStr(stationName); + const std::string antennaSetStr(antennaSet); + + for(std::string::const_iterator c = stationNameStr.begin(); c != stationNameStr.end(); ++c) + if(*c >= '0' && *c <= '9') + stationNr = stationNr * 16 + (*c - '0'); + + uint32 antennaSetNr = 0; + + if (antennaSetStr == "HBA_ONE" || antennaSetStr == "HBA1" ) + antennaSetNr = 1; + else + antennaSetNr = 0; + + ASSERT( stationNr < (1L << 16) ); + ASSERT( antennaSetNr < (1L << 4) ); + + ASSERT( clock/1000000 == 200 || clock/1000000 == 160 ); + ASSERT( bitmode == 4 || bitmode == 8 || bitmode == 16 ); + + unsigned clockNr = clock/1000000 == 200 ? 0x20 : 0x16; + unsigned bitmodeNr = bitmode == 16 ? 0xF : bitmode; + + return (stationNr << 16) + (antennaSetNr << 12) + (clockNr << 4) + bitmodeNr; + } + +}; + +std::ostream& operator<<( std::ostream &str, const struct StationID &s ) { + str << "station " << s.stationName << " antennaset " << s.antennaSet << " clock " << s.clock/1000000 << " bitmode " << s.bitmode; + + return str; +} + +} +} + + +#endif + diff --git a/RTCP/IONProc/test/newInputSection/StationSettings.h b/RTCP/IONProc/test/newInputSection/StationSettings.h new file mode 100644 index 0000000000000000000000000000000000000000..171db9b02c906bd5b5c798961cbfdb7b6135c8dd --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/StationSettings.h @@ -0,0 +1,79 @@ +#ifndef __STATIONSETTINGS__ +#define __STATIONSETTINGS__ + +#include <Common/LofarLogger.h> +#include "StationID.h" +#include <ostream> + +namespace LOFAR { +namespace RTCP { + +#define NR_RSPBOARDS 4 + +struct StationSettings { +private: + static const unsigned currentVersion = 1; + + unsigned version; + + bool valid() const { return version == currentVersion; } + +public: + struct StationID station; + + unsigned nrBeamlets; + + size_t nrSamples; + + unsigned nrBoards; + size_t nrFlagRanges; + + key_t dataKey; + + StationSettings(); + + // read settings from shared memory, using the given stationID + StationSettings(struct StationID station); + + bool operator==(const struct StationSettings &other) const { + return station == other.station + && nrBeamlets == other.nrBeamlets + && nrSamples == other.nrSamples + && nrBoards == other.nrBoards + && nrFlagRanges == other.nrFlagRanges + && dataKey == other.dataKey; + } + +}; + +StationSettings::StationSettings() +: + version(currentVersion) +{ +} + +StationSettings::StationSettings(struct StationID station) +: + version(currentVersion), + station(station) +{ + do { + SharedStruct<struct StationSettings> shm(station.hash(), false); + + *this = shm.get(); + } while (!valid()); + + ASSERT( valid() ); +} + +std::ostream& operator<<( std::ostream &str, const struct StationSettings &s ) { + str << s.station << " beamlets: " << s.nrBeamlets << " buffer: " << (1.0 * s.nrSamples / s.station.clock * 1024) << "s"; + + return str; +} + +} +} + +#endif + diff --git a/RTCP/IONProc/test/newInputSection/TimeSync.h b/RTCP/IONProc/test/newInputSection/TimeSync.h new file mode 100644 index 0000000000000000000000000000000000000000..61f80f98cef5da81b2d85b2703ccc446d27643cf --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/TimeSync.h @@ -0,0 +1,89 @@ +#ifndef TIMESYNC +#define TIMESYNC + +#include <Common/Thread/Mutex.h> +#include <Common/Thread/Condition.h> + +namespace LOFAR { + +class TimeSync { +public: + TimeSync(); + + // set to `val' + void set( int64 val ); + + // wait for the value to be at least `val' + + // wait for the value to be at least `val' (and + // return true), or until there is no more data + // or a timeout (return false). + bool wait( int64 val ); + bool wait( int64 val, struct timespec &timeout ); + + // signal no more data + void noMoreData(); + +private: + bool stop; + int64 timestamp; + int64 waitFor; + + Mutex mutex; + Condition cond; +}; + +TimeSync::TimeSync() +: + stop(false), + timestamp(0), + waitFor(0) +{ +} + +void TimeSync::set( int64 val ) { + ScopedLock sl(mutex); + + timestamp = val; + + if (waitFor != 0 && timestamp > waitFor) + cond.signal(); +} + +bool TimeSync::wait( int64 val ) { + ScopedLock sl(mutex); + + waitFor = val; + + while (timestamp <= val && !stop) + cond.wait(mutex); + + waitFor = 0; + + return timestamp <= val; +} + +bool TimeSync::wait( int64 val, struct timespec &timeout ) { + ScopedLock sl(mutex); + + waitFor = val; + + while (timestamp <= val && !stop) + if( !cond.wait(mutex, timeout) ) + break; + + waitFor = 0; + + return timestamp <= val; +} + +void TimeSync::noMoreData() { + ScopedLock sl(mutex); + + stop = true; + cond.signal(); +} + +} + +#endif diff --git a/RTCP/IONProc/test/newInputSection/foo.cc b/RTCP/IONProc/test/newInputSection/foo.cc new file mode 100644 index 0000000000000000000000000000000000000000..3c814527f1069141787cc319c74a2cf31dbf4de0 --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/foo.cc @@ -0,0 +1,457 @@ +#include <lofar_config.h> +#include <Common/LofarLogger.h> +#include <Common/LofarConstants.h> +#include <Stream/Stream.h> +#include <Stream/SocketStream.h> +#include <RSP.h> +#include <Interface/RSPTimeStamp.h> +#include <Interface/MultiDimArray.h> +#include <Interface/SmartPtr.h> +#include <Interface/Stream.h> +#include <WallClockTime.h> +#include "SharedMemory.h" +#include "Ranges.h" +#include "OMPThread.h" +#include "mpi.h" + +#include <vector> +#include <omp.h> +#include <map> +#include <string> +#include <ostream> +#include <cstring> +#include <boost/format.hpp> + +#define NR_RSPBOARDS 4 + +using namespace LOFAR; +using namespace RTCP; + +template<typename T> struct SampleType { + std::complex<T> x; + std::complex<T> y; +}; + +struct StationID { + char stationName[64]; + char antennaSet[64]; + + unsigned clock; + unsigned bitmode; + + StationID( const std::string &stationName = "", const std::string &antennaSet = "", unsigned clock = 200 * 1000000, unsigned bitmode = 16) + : + clock(clock), + bitmode(bitmode) + { + snprintf(this->stationName, sizeof this->stationName, "%s", stationName.c_str()); + snprintf(this->antennaSet, sizeof this->antennaSet, "%s", antennaSet.c_str()); + } + + bool operator==(const struct StationID &other) const { + return !strncmp(stationName, other.stationName, sizeof stationName) + && !strncmp(antennaSet, other.antennaSet, sizeof antennaSet) + && clock == other.clock + && bitmode == other.bitmode; + } + + bool operator!=(const struct StationID &other) const { + return !(*this == other); + } + + uint32 hash() const { + // convert to 32 bit value (human-readable in hexadecimal) + uint32 stationNr = 0; + + const std::string stationNameStr(stationName); + const std::string antennaSetStr(antennaSet); + + for(std::string::const_iterator c = stationNameStr.begin(); c != stationNameStr.end(); ++c) + if(*c >= '0' && *c <= '9') + stationNr = stationNr * 16 + (*c - '0'); + + uint32 antennaSetNr = 0; + + if (antennaSetStr == "HBA_ONE" || antennaSetStr == "HBA1" ) + antennaSetNr = 1; + else + antennaSetNr = 0; + + ASSERT( stationNr < (1L << 16) ); + ASSERT( antennaSetNr < (1L << 4) ); + + ASSERT( clock/1000000 == 200 || clock/1000000 == 160 ); + ASSERT( bitmode == 4 || bitmode == 8 || bitmode == 16 ); + + unsigned clockNr = clock/1000000 == 200 ? 0x20 : 0x16; + unsigned bitmodeNr = bitmode == 16 ? 0xF : bitmode; + + return (stationNr << 16) + (antennaSetNr << 12) + (clockNr << 4) + bitmodeNr; + } + +}; + +std::ostream& operator<<( std::ostream &str, const struct StationID &s ) { + str << "station " << s.stationName << " antennaset " << s.antennaSet << " clock " << s.clock/1000000 << " bitmode " << s.bitmode; + + return str; +} + +struct StationSettings { +private: + static const unsigned currentVersion = 1; + + unsigned version; + + bool valid() const { return version == currentVersion; } + +public: + struct StationID station; + + unsigned nrBeamlets; + + size_t nrSamples; + + unsigned nrBoards; + size_t nrFlagRanges; + + key_t dataKey; + + StationSettings(); + + // read settings from shared memory, using the given stationID + StationSettings(struct StationID station); + + bool operator==(const struct StationSettings &other) const { + return station == other.station + && nrBeamlets == other.nrBeamlets + && nrSamples == other.nrSamples + && nrBoards == other.nrBoards + && nrFlagRanges == other.nrFlagRanges + && dataKey == other.dataKey; + } + +}; + +std::ostream& operator<<( std::ostream &str, const struct StationSettings &s ) { + str << s.station << " beamlets: " << s.nrBeamlets << " buffer: " << (1.0 * s.nrSamples / s.station.clock * 1024) << "s"; + + return str; +} + +StationSettings::StationSettings() +: + version(currentVersion) +{ +} + + +StationSettings::StationSettings(struct StationID station) +: + version(currentVersion), + station(station) +{ + SharedStruct<struct StationSettings> shm(station.hash(), false); + + *this = shm.get(); + + ASSERT( valid() ); +} + + +template<typename T> class SampleBuffer { +public: + SampleBuffer( const struct StationSettings &settings, bool create ); + +private: + const std::string logPrefix; + SharedMemoryArena data; + SparseSetAllocator allocator; + + struct StationSettings *initSettings( const struct StationSettings &localSettings, bool create ); + + static size_t dataSize( const struct StationSettings &settings ) { + return sizeof settings + + NR_RSPBOARDS * (Ranges::size(settings.nrFlagRanges) + 8) + + settings.nrBeamlets * (settings.nrSamples * N_POL * 2 * settings.station.bitmode / 8 + 128); + } + +public: + struct StationSettings *settings; + + const size_t nrBeamlets; + const size_t nrSamples; + const size_t nrFlagRanges; + + MultiDimArray<T,2> beamlets; // [subband][sample] + std::vector<Ranges> flags; // [rspboard] +}; + + +template<typename T> SampleBuffer<T>::SampleBuffer( const struct StationSettings &_settings, bool create ) +: + logPrefix(str(boost::format("[station %s %s board] [SampleBuffer] ") % _settings.station.stationName % _settings.station.antennaSet)), + data(_settings.dataKey, dataSize(_settings), create ? SharedMemoryArena::CREATE_EXCL : SharedMemoryArena::READ), + allocator(data), + settings(initSettings(_settings, create)), + + nrBeamlets(settings->nrBeamlets), + nrSamples(settings->nrSamples), + nrFlagRanges(settings->nrFlagRanges), + + beamlets(boost::extents[nrBeamlets][nrSamples], 128, allocator, false, create), + flags(settings->nrBoards) +{ + // bitmode must coincide with our template + ASSERT( sizeof(T) == N_POL * 2 * settings->station.bitmode / 8 ); + + // typical #slots/packet + ASSERT( settings->nrSamples % 16 == 0 ); + + for (size_t f = 0; f < flags.size(); f++) { + size_t numBytes = Ranges::size(nrFlagRanges); + + flags[f] = Ranges(static_cast<int64*>(allocator.allocate(numBytes, 8)), numBytes, nrSamples, create); + } + + LOG_INFO_STR( logPrefix << "Initialised" ); +} + +template<typename T> struct StationSettings *SampleBuffer<T>::initSettings( const struct StationSettings &localSettings, bool create ) +{ + //struct StationSettings *sharedSettings = allocator.allocateTyped<struct StationSettings>(); + struct StationSettings *sharedSettings = allocator.allocateTyped(); + + if (create) { + // register settings + LOG_INFO_STR( logPrefix << "Registering " << localSettings.station ); + *sharedSettings = localSettings; + } else { + // verify settings + ASSERT( *sharedSettings == localSettings ); + LOG_INFO_STR( logPrefix << "Connected to " << localSettings.station ); + } + + return sharedSettings; +} + +template<typename T> class RSPBoard { +public: + RSPBoard( Stream &inputStream, SampleBuffer<T> &buffer, unsigned boardNr, const struct StationSettings &settings ); + + const unsigned nr; + + bool readPacket(); + void writePacket(); + + static size_t packetSize( struct RSP &packet ) { + return sizeof(struct RSP::Header) + packet.header.nrBeamlets * packet.header.nrBlocks * sizeof(T); + } + +private: + const std::string logPrefix; + + Stream &inputStream; + const bool supportPartialReads; + struct RSP packet; + TimeStamp last_timestamp; + TimeStamp last_logtimestamp; + + SampleBuffer<T> &buffer; + Ranges &flags; + const struct StationSettings settings; + const size_t firstBeamlet; + + size_t nrReceived, nrBadSize, nrBadTime, nrOutOfOrder; + + void logStatistics(); +}; + +template<typename T> RSPBoard<T>::RSPBoard( Stream &inputStream, SampleBuffer<T> &buffer, unsigned boardNr, const struct StationSettings &settings ) +: + nr(boardNr), + logPrefix(str(boost::format("[station %s %s board %u] [RSPBoard] ") % settings.station.stationName % settings.station.antennaSet % nr)), + inputStream(inputStream), + supportPartialReads(dynamic_cast<SocketStream *>(&inputStream) == 0 || dynamic_cast<SocketStream &>(inputStream).protocol != SocketStream::UDP), + + buffer(buffer), + flags(buffer.flags[boardNr]), + settings(settings), + firstBeamlet(settings.nrBeamlets / settings.nrBoards * boardNr), + + nrReceived(0), + nrBadSize(0), + nrBadTime(0), + nrOutOfOrder(0) +{ +} + +template<typename T> void RSPBoard<T>::writePacket() +{ + const uint8 &nrBeamlets = packet.header.nrBeamlets; + const uint8 &nrTimeslots = packet.header.nrBlocks; + + ASSERT( settings.nrSamples % nrTimeslots == 0 ); + + // the timestamp is of the last read packet by definition + const TimeStamp ×tamp = last_timestamp; + + const size_t bufferOffset = (int64)timestamp % settings.nrSamples; + + const T *beamlets = reinterpret_cast<const T*>(&packet.data); + + ASSERT( nrBeamlets <= settings.nrBeamlets / settings.nrBoards ); + + // mark data we overwrite as invalid + flags.excludeBefore(timestamp + nrTimeslots - settings.nrSamples); + + // transpose + for (uint8 b = 0; b < nrBeamlets; ++b) { + T *dst = &buffer.beamlets[firstBeamlet + b][bufferOffset]; + + memcpy(dst, beamlets, nrTimeslots * sizeof(T)); + + beamlets += nrTimeslots; + } + + // mark as valid + flags.include(timestamp, timestamp + nrTimeslots); +} + +template<typename T> bool RSPBoard<T>::readPacket() +{ + if (supportPartialReads) { + // read header first + inputStream.read(&packet, sizeof(struct RSP::Header)); + + // read rest of packet + inputStream.read(&packet.data, packetSize(packet) - sizeof(struct RSP::Header)); + + ++nrReceived; + } else { + // read full packet at once -- numbytes will tell us how much we've actually read + size_t numbytes = inputStream.tryRead(&packet, sizeof packet); + + ++nrReceived; + + if( numbytes < sizeof(struct RSP::Header) + || numbytes != packetSize(packet) ) { + LOG_WARN_STR( logPrefix << "Packet is " << numbytes << " bytes, but should be " << packetSize(packet) << " bytes" ); + + ++nrBadSize; + return false; + } + } + + // check sanity of packet + + // detect bad timestamp + if (packet.header.timestamp == ~0U) { + ++nrBadTime; + return false; + } + + const TimeStamp timestamp(packet.header.timestamp, packet.header.blockSequenceNumber, settings.station.clock); + + // detect out-of-order data + if (timestamp < last_timestamp) { + ++nrOutOfOrder; + return false; + } + + // don't accept big jumps (>10s) in timestamp + const int64 oneSecond = settings.station.clock / 1024; + + if (last_timestamp && packet.header.timestamp > last_timestamp + 10 * oneSecond) { + ++nrBadTime; + return false; + } + + // packet was read and is sane + + last_timestamp = timestamp; + + if (timestamp > last_logtimestamp + oneSecond) { + logStatistics(); + + last_logtimestamp = timestamp; + } + + return true; +} + + +template<typename T> void RSPBoard<T>::logStatistics() +{ + LOG_INFO_STR( logPrefix << "Received " << nrReceived << " packets: " << nrOutOfOrder << " out of order, " << nrBadTime << " bad timestamps, " << nrBadSize << " bad sizes" ); + + nrReceived = 0; + nrOutOfOrder = 0; + nrBadTime = 0; + nrBadSize = 0; +} + + + + + + +class StationStreams { +public: + StationStreams( const std::string &logPrefix, const StationSettings &settings, const std::vector<std::string> &streamDescriptors ); + + void process(); + + void stop(); + +protected: + const std::string logPrefix; + const StationSettings settings; + const std::vector<std::string> streamDescriptors; + const size_t nrBoards; + + WallClockTime waiter; + + virtual void processBoard( size_t nr ) = 0; +}; + +StationStreams::StationStreams( const std::string &logPrefix, const StationSettings &settings, const std::vector<std::string> &streamDescriptors ) +: + logPrefix(logPrefix), + settings(settings), + streamDescriptors(streamDescriptors), + nrBoards(streamDescriptors.size()) +{ +} + +void StationStreams::process() +{ + std::vector<OMPThread> threads(nrBoards); + + ASSERT(nrBoards > 0); + + LOG_INFO_STR( logPrefix << "Start" ); + + #pragma omp parallel sections num_threads(2) + { + #pragma omp section + { + // start all boards + LOG_INFO_STR( logPrefix << "Starting all boards" ); + #pragma omp parallel for num_threads(nrBoards) + for (size_t i = 0; i < nrBoards; ++i) { + OMPThread::ScopedRun sr(threads[i]); + + processBoard(i); + } + } + + #pragma omp section + { + // wait until we have to stop + LOG_INFO_STR( logPrefix << "Waiting for stop signal" ); + waiter.waitForever(); + + // kill all boards + LOG_INFO_STR( logPrefix << "Stopping all boards" ); + #pragma omp parallel for num_threads(nrBo \ No newline at end of file diff --git a/RTCP/IONProc/test/newInputSection/newInputSection.cc b/RTCP/IONProc/test/newInputSection/newInputSection.cc new file mode 100644 index 0000000000000000000000000000000000000000..112cb940c3b13309d18802b08e215bf59139842d --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/newInputSection.cc @@ -0,0 +1,922 @@ +#include <lofar_config.h> +#include <Common/LofarLogger.h> +#include <Common/Thread/Mutex.h> +#include <Stream/Stream.h> +#include <Stream/SocketStream.h> +#include <Interface/MultiDimArray.h> +#include <Interface/Stream.h> +#include <WallClockTime.h> +#include "SharedMemory.h" +#include "Ranges.h" +#include "OMPThread.h" +#include "StationID.h" +#include "StationSettings.h" +#include "SampleBuffer.h" +#include "StationData.h" +#include "mpi.h" + +#include <vector> +#include <omp.h> +#include <string> +#include <boost/format.hpp> + +#define DURATION 60 +#define BLOCKSIZE 0.005 +#define NRSTATIONS 3 + +using namespace LOFAR; +using namespace RTCP; + +template<typename T> class SampleBufferReader { +public: + SampleBufferReader( const StationSettings &settings, const std::vector<size_t> beamlets, const TimeStamp &from, const TimeStamp &to, size_t blockSize ); + + void process( double maxDelay ); + +protected: + const StationSettings settings; + SampleBuffer<T> buffer; + + const std::vector<size_t> beamlets; + const TimeStamp from, to; + const size_t blockSize; + + virtual void copyNothing( const TimeStamp &from, const TimeStamp &to ) { (void)from, (void)to; } + + virtual void copyBeamlet( unsigned beamlet, unsigned transfer, const TimeStamp &from_ts, const T* from, size_t nrSamples ) = 0; + virtual void copyStart( const TimeStamp &from, const TimeStamp &to, size_t wrap ) { (void)from, (void)to, (void)wrap; } + + virtual void copyFlags ( unsigned transfer, const SparseSet<int64> &flags ) = 0; + virtual void copyEnd() {} + + void copy( const TimeStamp &from, const TimeStamp &to ); + +private: + WallClockTime waiter; +}; + + +template<typename T> SampleBufferReader<T>::SampleBufferReader( const StationSettings &settings, const std::vector<size_t> beamlets, const TimeStamp &from, const TimeStamp &to, size_t blockSize ) +: + settings(settings), + buffer(settings, false), + + beamlets(beamlets), + from(from), + to(to), + blockSize(blockSize) +{ + for (size_t i = 0; i < beamlets.size(); ++i) + ASSERT( beamlets[i] < buffer.nrBeamlets ); + + ASSERT( blockSize > 0 ); + ASSERT( blockSize < settings.nrSamples ); + ASSERT( from < to ); +} + + +template<typename T> void SampleBufferReader<T>::process( double maxDelay ) +{ + /*const TimeStamp maxDelay_ts(static_cast<int64>(maxDelay * settings.station.clock / 1024) + blockSize, settings.station.clock); + + const TimeStamp current(from); + + for (TimeStamp current = from; current < to; current += blockSize) { + // wait + LOG_INFO_STR("Waiting until " << (current + maxDelay_ts) << " for " << current); + waiter.waitUntil( current + maxDelay_ts ); + + // read + LOG_INFO_STR("Reading from " << current << " to " << (current + blockSize)); + copy(current, current + blockSize); + } + + LOG_INFO("Done reading data");*/ + const TimeStamp maxDelay_ts(static_cast<int64>(maxDelay * settings.station.clock / 1024) + blockSize, settings.station.clock); + + const TimeStamp current(from); + + double totalwait = 0.0; + unsigned totalnr = 0; + + double lastreport = MPI_Wtime(); + + for (TimeStamp current = from; current < to; current += blockSize) { + // wait + waiter.waitUntil( current + maxDelay_ts ); + + // read + double bs = MPI_Wtime(); + + copy(current, current + blockSize); + + totalwait += MPI_Wtime() - bs; + totalnr++; + + if (bs - lastreport > 1.0) { + double mbps = (sizeof(T) * blockSize * beamlets.size() * 8) / (totalwait/totalnr) / 1e6; + lastreport = bs; + totalwait = 0.0; + totalnr = 0; + + LOG_INFO_STR("Reading speed: " << mbps << " Mbit/s"); + } + } + + LOG_INFO("Done reading data"); +} + +template<typename T> void SampleBufferReader<T>::copy( const TimeStamp &from, const TimeStamp &to ) +{ + ASSERT( from < to ); + ASSERT( to - from < (int64)buffer.nrSamples ); + + const unsigned nrBoards = buffer.flags.size(); + +#if 0 + // check whether there is any data at all + bool data = false; + + for (unsigned b = 0; b < nrBoards; ++b) + if (buffer.flags[b].anythingBetween(from, to)) { + data = true; + break; + } + + if (!data) { + copyNothing(from, to); + return; + } +#endif + + // copy the beamlets + + size_t from_offset = (int64)from % buffer.nrSamples; + size_t to_offset = (int64)to % buffer.nrSamples; + + if (to_offset == 0) + to_offset = buffer.nrSamples; + + // wrap > 0 if we need to wrap around the end of the buffer + size_t wrap = from_offset < to_offset ? 0 : buffer.nrSamples - from_offset; + + copyStart(from, to, wrap); + + for (size_t i = 0; i < beamlets.size(); ++i) { + unsigned nr = beamlets[i]; + const T* origin = &buffer.beamlets[nr][0]; + + if (wrap > 0) { + copyBeamlet( nr, 0, from, origin + from_offset, wrap ); + copyBeamlet( nr, 1, from, origin, to_offset ); + } else { + copyBeamlet( nr, 0, from, origin + from_offset, to_offset - from_offset ); + } + } + + // copy the flags + + for (unsigned b = 0; b < nrBoards; ++b) + copyFlags( b, buffer.flags[b].sparseSet(from, to).invert(from, to) ); + + copyEnd(); +} + +Mutex MPIMutex; + +//#define USE_RMA + +#ifdef USE_RMA + +#define MULTIPLE_WINDOWS + +template<typename T> class MPISharedBuffer: public SampleBuffer<T> { +public: + MPISharedBuffer( const struct StationSettings &settings ); + + ~MPISharedBuffer(); + +private: +#ifdef MULTIPLE_WINDOWS + std::vector<MPI_Win> beamlets_windows; +#else + MPI_Win beamlets_window; +#endif +}; + +template<typename T> MPISharedBuffer<T>::MPISharedBuffer( const struct StationSettings &settings ) +: + SampleBuffer<T>(settings, false) +#ifdef MULTIPLE_WINDOWS + , beamlets_windows(NRSTATIONS) +#endif +{ +#ifdef MULTIPLE_WINDOWS + for (int i = 0; i < NRSTATIONS; ++i) { + int error = MPI_Win_create(this->beamlets.origin(), this->beamlets.num_elements() * sizeof(T), 1, MPI_INFO_NULL, MPI_COMM_WORLD, &beamlets_windows[i]); + + ASSERT(error == MPI_SUCCESS); + } +#else + int error = MPI_Win_create(this->beamlets.origin(), this->beamlets.num_elements() * sizeof(T), 1, MPI_INFO_NULL, MPI_COMM_WORLD, &beamlets_window); + + ASSERT(error == MPI_SUCCESS); +#endif +} + +template<typename T> MPISharedBuffer<T>::~MPISharedBuffer() +{ +#ifdef MULTIPLE_WINDOWS + for (int i = 0; i < NRSTATIONS; ++i) { + int error = MPI_Win_free(&beamlets_windows[i]); + + ASSERT(error == MPI_SUCCESS); + } +#else + int error = MPI_Win_free(&beamlets_window); + + ASSERT(error == MPI_SUCCESS); +#endif +} + +template<typename T> class MPISharedBufferReader { +public: + MPISharedBufferReader( const std::vector<struct StationSettings> &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets ); + + ~MPISharedBufferReader(); + + void process( double maxDelay ); + +private: + const std::vector<struct StationSettings> settings; + const TimeStamp from, to; + const size_t blockSize; + const std::vector<size_t> beamlets; + + MultiDimArray<T, 3> buffer; // [station][beamlet][sample] + +#ifdef MULTIPLE_WINDOWS + std::vector<MPI_Win> beamlets_windows; +#else + MPI_Win beamlets_window; +#endif + + WallClockTime waiter; + + void copy( const TimeStamp &from, const TimeStamp &to ); +}; + +template<typename T> MPISharedBufferReader<T>::MPISharedBufferReader( const std::vector<struct StationSettings> &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets ) +: + settings(settings), + from(from), + to(to), + blockSize(blockSize), + beamlets(beamlets), + + buffer(boost::extents[settings.size()][beamlets.size()][blockSize], 128, heapAllocator, false, false) +#ifdef MULTIPLE_WINDOWS + , beamlets_windows(settings.size()) +#endif +{ + ASSERT( settings.size() > 0 ); + ASSERT( from.getClock() == to.getClock() ); + ASSERT( settings[0].station.clock == from.getClock()); + + for (size_t i = 0; i < settings.size(); ++i) { + ASSERT(settings[i].station.clock == settings[0].station.clock); + ASSERT(settings[i].station.clock == from.getClock()); + ASSERT(settings[i].station.bitmode == settings[0].station.bitmode); + + ASSERT(settings[i].nrSamples > blockSize); + } + +#ifdef MULTIPLE_WINDOWS + for (int i = 0; i < settings.size(); ++i) { + int error = MPI_Win_create(MPI_BOTTOM, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &beamlets_windows[i]); + + ASSERT(error == MPI_SUCCESS); + } +#else + int error = MPI_Win_create(MPI_BOTTOM, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &beamlets_window); + + ASSERT(error == MPI_SUCCESS); +#endif +} + +template<typename T> MPISharedBufferReader<T>::~MPISharedBufferReader() +{ +#ifdef MULTIPLE_WINDOWS + for (int i = 0; i < settings.size(); ++i) { + int error = MPI_Win_free(&beamlets_windows[i]); + + ASSERT(error == MPI_SUCCESS); + } +#else + int error = MPI_Win_free(&beamlets_window); + + ASSERT(error == MPI_SUCCESS); +#endif +} + +template<typename T> void MPISharedBufferReader<T>::process( double maxDelay ) +{ + const TimeStamp maxDelay_ts(static_cast<int64>(maxDelay * settings[0].station.clock / 1024) + blockSize, settings[0].station.clock); + + const TimeStamp current(from); + + double totalwait = 0.0; + unsigned totalnr = 0; + + double lastreport = MPI_Wtime(); + + for (TimeStamp current = from; current < to; current += blockSize) { + // wait + //LOG_INFO_STR("Waiting until " << (current + maxDelay_ts) << " for " << current); + waiter.waitUntil( current + maxDelay_ts ); + + // read + //LOG_INFO_STR("Reading from " << current << " to " << (current + blockSize)); + double bs = MPI_Wtime(); + + copy(current, current + blockSize); + + totalwait += MPI_Wtime() - bs; + totalnr++; + + if (bs - lastreport > 1.0) { + double mbps = (sizeof(T) * blockSize * beamlets.size() * 8) / (totalwait/totalnr) / 1e6; + lastreport = bs; + totalwait = 0.0; + totalnr = 0; + + LOG_INFO_STR("Reading speed: " << mbps << " Mbit/s"); + } + } + + LOG_INFO("Done reading data"); +} + +template<typename T> void MPISharedBufferReader<T>::copy( const TimeStamp &from, const TimeStamp &to ) +{ + int error; + +#ifdef MULTIPLE_WINDOWS + for (int i = 0; i < settings.size(); ++i) { + error = MPI_Win_lock( MPI_LOCK_SHARED, i, MPI_MODE_NOCHECK, beamlets_windows[i] ); + ASSERT(error == MPI_SUCCESS); + } +#endif + + for (size_t s = 0; s < settings.size(); ++s) { +#ifndef MULTIPLE_WINDOWS + error = MPI_Win_lock( MPI_LOCK_SHARED, s, MPI_MODE_NOCHECK, beamlets_window ); + ASSERT(error == MPI_SUCCESS); +#endif + + //LOG_INFO_STR("Copying from station " << s); + const struct StationSettings settings = this->settings[s]; + + size_t from_offset = (int64)from % settings.nrSamples; + size_t to_offset = (int64)to % settings.nrSamples; + + if (to_offset == 0) + to_offset = settings.nrSamples; + + size_t wrap = from_offset < to_offset ? 0 : settings.nrSamples - from_offset; + + for (size_t i = 0; i < beamlets.size(); ++i) { + unsigned nr = beamlets[i]; + + size_t origin = nr * settings.nrSamples; + + if (wrap > 0) { + //if (i==0) LOG_INFO_STR("Reading wrapped data"); +#ifdef MULTIPLE_WINDOWS + error = MPI_Get( &buffer[s][i][0], wrap * sizeof(T), MPI_CHAR, s, (origin + from_offset) * sizeof(T), wrap * sizeof(T), MPI_CHAR, beamlets_windows[s] ); +#else + error = MPI_Get( &buffer[s][i][0], wrap * sizeof(T), MPI_CHAR, s, (origin + from_offset) * sizeof(T), wrap * sizeof(T), MPI_CHAR, beamlets_window ); +#endif + + ASSERT(error == MPI_SUCCESS); + +#ifdef MULTIPLE_WINDOWS + error = MPI_Get( &buffer[s][i][wrap], to_offset * sizeof(T), MPI_CHAR, s, origin * sizeof(T), to_offset * sizeof(T), MPI_CHAR, beamlets_windows[s] ); +#else + error = MPI_Get( &buffer[s][i][wrap], to_offset * sizeof(T), MPI_CHAR, s, origin * sizeof(T), to_offset * sizeof(T), MPI_CHAR, beamlets_window ); +#endif + + ASSERT(error == MPI_SUCCESS); + } else { + // higher performance by splitting into multiple requests if block size is large -- formula yet unknown + //size_t partSize = (to_offset - from_offset) / 2 + 1; + size_t partSize = to_offset - from_offset; + + for (size_t x = from_offset; x < to_offset; x += partSize) { + size_t y = std::min(x + partSize, to_offset); + +#ifdef MULTIPLE_WINDOWS + error = MPI_Get( &buffer[s][i][x - from_offset], (y - x) * sizeof(T), MPI_CHAR, s, (origin + x) * sizeof(T), (y - x) * sizeof(T), MPI_CHAR, beamlets_windows[s] ); +#else + error = MPI_Get( &buffer[s][i][x - from_offset], (y - x) * sizeof(T), MPI_CHAR, s, (origin + x) * sizeof(T), (y - x) * sizeof(T), MPI_CHAR, beamlets_window ); +#endif + + ASSERT(error == MPI_SUCCESS); + } + } + } + +#ifndef MULTIPLE_WINDOWS + error = MPI_Win_unlock( s, beamlets_window ); + ASSERT(error == MPI_SUCCESS); +#endif + } + +#ifdef MULTIPLE_WINDOWS + for (int i = 0; i < settings.size(); ++i) { + error = MPI_Win_unlock( i, beamlets_windows[i] ); + ASSERT(error == MPI_SUCCESS); + } +#endif +} +#else + +template<typename T> class MPISendStation: public SampleBufferReader<T> { +public: + MPISendStation( const struct StationSettings &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets, unsigned destRank ); + + struct Header { + StationID station; + + bool data; + size_t wrap; + + int64 from, to; + + size_t nrBeamlets; + size_t nrFlags; + + size_t flagsSize; + }; + + union tag_t { + struct { + unsigned type:2; + unsigned beamlet:10; + unsigned transfer:3; + } bits; + + int value; + + tag_t(): value(0) {} + }; + + enum tag_types { CONTROL = 0, BEAMLET = 1, FLAGS = 2 }; + +protected: + const unsigned destRank; + + std::vector<MPI_Request> requests; + size_t nrRequests; + + Matrix<char> flagsData; + + virtual void copyNothing( const TimeStamp &from, const TimeStamp &to ); + virtual void copyStart( const TimeStamp &from, const TimeStamp &to, size_t wrap ); + virtual void copyBeamlet( unsigned beamlet, unsigned transfer, const TimeStamp &from_ts, const T* from, size_t nrSamples ); + virtual void copyFlags ( unsigned transfer, const SparseSet<int64> &flags ); + virtual void copyEnd(); + + size_t flagsSize() const { + return sizeof(uint32_t) + this->settings.nrFlagRanges * sizeof(int64) * 2; + } +}; + + +template<typename T> MPISendStation<T>::MPISendStation( const struct StationSettings &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets, unsigned destRank ) +: + SampleBufferReader<T>(settings, beamlets, from, to, blockSize), + destRank(destRank), + requests(this->buffer.flags.size() + beamlets.size() * 2, 0), + nrRequests(0), + flagsData(this->buffer.flags.size(), flagsSize()) +{ +} + + +template<typename T> void MPISendStation<T>::copyNothing( const TimeStamp &from, const TimeStamp &to ) +{ + LOG_INFO_STR( "No valid data!" ); + + Header header; + header.station = this->settings.station; + header.data = false; + header.wrap = 0; + header.from = from; + header.to = to; + header.nrBeamlets = 0; + header.nrFlags = 0; + + { + ScopedLock sl(MPIMutex); + + union tag_t tag; + + tag.bits.type = CONTROL; + + int error = MPI_Isend(&header, sizeof header, MPI_CHAR, destRank, tag.value, MPI_COMM_WORLD, &requests[nrRequests++]); + ASSERT(error == MPI_SUCCESS); + } +} + + +template<typename T> void MPISendStation<T>::copyStart( const TimeStamp &from, const TimeStamp &to, size_t wrap ) +{ + Header header; + header.station = this->settings.station; + header.data = true; + header.wrap = wrap; + header.from = from; + header.to = to; + header.nrBeamlets = this->beamlets.size(); + header.nrFlags = this->buffer.flags.size(); + header.flagsSize = this->flagsSize(); + + { + ScopedLock sl(MPIMutex); + + int error = MPI_Isend(&header, sizeof header, MPI_CHAR, destRank, 0, MPI_COMM_WORLD, &requests[nrRequests++]); + + ASSERT(error == MPI_SUCCESS); + } + + //LOG_INFO( "Header sent" ); +} + + +template<typename T> void MPISendStation<T>::copyBeamlet( unsigned beamlet, unsigned transfer, const TimeStamp &from_ts, const T* from, size_t nrSamples) +{ + (void)from_ts; + + ScopedLock sl(MPIMutex); + + union tag_t tag; + + tag.bits.type = BEAMLET; + tag.bits.beamlet = beamlet; + tag.bits.transfer = transfer; + + int error = MPI_Isend( + (void*)from, nrSamples * sizeof(T), MPI_CHAR, + destRank, tag.value, + MPI_COMM_WORLD, &requests[nrRequests++]); + + ASSERT(error == MPI_SUCCESS); +} + + +template<typename T> void MPISendStation<T>::copyFlags( unsigned transfer, const SparseSet<int64> &flags ) +{ + //LOG_INFO_STR( "Copy flags for beamlets [" << fromBeamlet << ", " << toBeamlet << "): " << (100.0 * flags.count() / this->blockSize) << "% " << flags ); + ssize_t numBytes = flags.marshall(&flagsData[transfer][0], flagsSize()); + + ASSERT(numBytes >= 0); + + union tag_t tag; + + tag.bits.type = FLAGS; + tag.bits.transfer = transfer; + + { + ScopedLock sl(MPIMutex); + + int error = MPI_Isend( + (void*)&flagsData[transfer][0], flagsSize(), MPI_CHAR, + destRank, tag.value, + MPI_COMM_WORLD, &requests[nrRequests++]); + + ASSERT(error == MPI_SUCCESS); + } +} + + +template<typename T> void MPISendStation<T>::copyEnd() +{ + int flag = false; + std::vector<MPI_Status> statusses(nrRequests); + + while (!flag) { + { + ScopedLock sl(MPIMutex); + + int error = MPI_Testall(nrRequests, &requests[0], &flag, &statusses[0]); + + ASSERT(error == MPI_SUCCESS); + } + + // can't hold lock indefinitely + pthread_yield(); + } + + //LOG_INFO( "Copy done"); + + nrRequests = 0; +} + + +template<typename T> class MPIReceiveStation { +public: + MPIReceiveStation( const struct StationSettings &settings, const std::vector<int> stationRanks, const std::vector<size_t> &beamlets, size_t blockSize ); + + void receiveBlock(); + +private: + const struct StationSettings settings; + const std::vector<int> stationRanks; + +public: + const std::vector<size_t> beamlets; + const size_t blockSize; + MultiDimArray<T, 3> samples; // [station][beamlet][sample] + Matrix< SparseSet<int64> > flags; // [station][board] +}; + +template<typename T> MPIReceiveStation<T>::MPIReceiveStation( const struct StationSettings &settings, const std::vector<int> stationRanks, const std::vector<size_t> &beamlets, size_t blockSize ) +: + settings(settings), + stationRanks(stationRanks), + beamlets(beamlets), + blockSize(blockSize), + samples(boost::extents[stationRanks.size()][beamlets.size()][blockSize], 128, heapAllocator, false, false), + flags(stationRanks.size(), settings.nrBoards) +{ +} + + +template<typename T> void MPIReceiveStation<T>::receiveBlock() +{ + struct MPISendStation<T>::Header header; + + int error; + + size_t nrRequests = 0; + std::vector<MPI_Request> header_requests(stationRanks.size()); + std::vector<struct MPISendStation<T>::Header> headers(stationRanks.size()); + + // post receives for all headers + + for (size_t nr = 0; nr < stationRanks.size(); ++nr) { + typename MPISendStation<T>::tag_t tag; + + // receive the header + + tag.bits.type = MPISendStation<T>::CONTROL; + + error = MPI_Irecv(&headers[nr], sizeof header, MPI_CHAR, stationRanks[nr], tag.value, MPI_COMM_WORLD, &header_requests[nr]); + ASSERT(error == MPI_SUCCESS); + } + + // process stations in the order in which we receive the headers + + std::vector<MPI_Request> requests(beamlets.size() * 2 * stationRanks.size()); + std::vector<MPI_Status> statusses(beamlets.size() * 2 * stationRanks.size()); + Matrix< std::vector<char> > flagData(stationRanks.size(), settings.nrBoards); // [station][board][data] + + for (size_t i = 0; i < stationRanks.size(); ++i) { + int nr; + + // wait for any header request to finish + error = MPI_Waitany(header_requests.size(), &header_requests[0], &nr, MPI_STATUS_IGNORE); + ASSERT(error == MPI_SUCCESS); + + typename MPISendStation<T>::tag_t tag; + + // check the header + + const struct MPISendStation<T>::Header header = headers[nr]; + + ASSERT(header.to - header.from == (int64)blockSize); + ASSERT(header.wrap < blockSize); + + if (!header.data) + continue; + + // post receives for the beamlets + + ASSERT(header.nrBeamlets == beamlets.size()); + + tag.value = 0; // reset + tag.bits.type = MPISendStation<T>::BEAMLET; + + int rank = stationRanks[nr]; + + for (size_t beamlet = 0; beamlet < header.nrBeamlets; ++beamlet) { + tag.bits.beamlet = beamlet; + tag.bits.transfer = 0; + + error = MPI_Irecv( + &samples[nr][beamlet][0], sizeof(T) * (header.wrap ? header.wrap : blockSize), MPI_CHAR, + rank, tag.value, + MPI_COMM_WORLD, &requests[nrRequests++]); + + ASSERT(error == MPI_SUCCESS); + + if (header.wrap > 0) { + tag.bits.transfer = 1; + + error = MPI_Irecv( + &samples[nr][beamlet][header.wrap], sizeof(T) * (blockSize - header.wrap), MPI_CHAR, + rank, tag.value, + MPI_COMM_WORLD, &requests[nrRequests++]); + + ASSERT(error == MPI_SUCCESS); + } + } + + // post receives for the flags + + ASSERT(header.nrFlags == settings.nrBoards); + + tag.value = 0; // reset + tag.bits.type = MPISendStation<T>::FLAGS; + + for (size_t board = 0; board < header.nrFlags; ++board) { + tag.bits.transfer = board; + + flagData[nr][board].resize(header.flagsSize); + + error = MPI_Irecv( + &flagData[nr][0][0], header.flagsSize, MPI_CHAR, + rank, tag.value, + MPI_COMM_WORLD, &requests[nrRequests++]); + + ASSERT(error == MPI_SUCCESS); + } + } + + // wait for all transfers to finish + + if (nrRequests > 0) { + error = MPI_Waitall(nrRequests, &requests[0], &statusses[0]); + ASSERT(error == MPI_SUCCESS); + } + + // convert raw flagData to flags array + + for (size_t nr = 0; nr < stationRanks.size(); ++nr) + for (size_t board = 0; board < settings.nrBoards; ++board) + flags[nr][board].unmarshall(&flagData[nr][board][0]); + +} +#endif + +void sighandler(int) +{ + /* no-op */ +} + +int main( int argc, char **argv ) +{ + size_t clock = 200*1000*1000; + + typedef SampleBuffer<int16>::SampleType SampleT; + const TimeStamp from(time(0L) + 1, 0, clock); + const TimeStamp to(time(0L) + 1 + DURATION, 0, clock); + const size_t blockSize = BLOCKSIZE * clock / 1024; + std::map<unsigned, std::vector<size_t> > beamlets; + + struct StationID stationID("RS106", "LBA", clock, 16); + struct StationSettings settings; + + settings.station = stationID; + settings.nrBeamlets = 244; + settings.nrBoards = 4; + + settings.nrSamples = (5 * stationID.clock / 1024);// & ~0xFL; + settings.nrFlagRanges = 64; + + settings.dataKey = stationID.hash(); + + INIT_LOGGER(argv[0]); + + if (MPI_Init(&argc, &argv) != MPI_SUCCESS) { + LOG_ERROR_STR("MPI_Init failed"); + return 1; + } + + int nrHosts, rank; + + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(MPI_COMM_WORLD, &nrHosts); + +#ifdef USE_RMA + int nrStations = NRSTATIONS; +#else + int nrStations = NRSTATIONS; +#endif + + for (unsigned i = 0; i < 244; ++i) + beamlets[nrStations + i % (nrHosts - nrStations)].push_back(i); + + if (rank > nrStations - 1) { + // receiver + LOG_INFO_STR("Receiver " << rank << " starts, handling " << beamlets[rank].size() << " subbands from " << nrStations << " stations." ); + +#ifdef USE_RMA + std::vector<struct StationSettings> stations(nrStations, settings); + + { + MPISharedBufferReader<SampleT> receiver(stations, from, to, blockSize, beamlets[rank]); + + receiver.process(0.0); + } +#else + std::vector<int> stationRanks(nrStations); + + for (size_t i = 0; i < stationRanks.size(); i++) + stationRanks[i] = i; + + { + MPIReceiveStation<SampleT> receiver(settings, stationRanks, beamlets[rank], blockSize); + + for(size_t block = 0; block < (to-from)/blockSize + 1; ++block) { + receiver.receiveBlock(); + + //LOG_INFO_STR("Receiver " << rank << " received block " << block); + } + } +#endif + LOG_INFO_STR("Receiver " << rank << " done"); + + MPI_Finalize(); + return 0; + } + + omp_set_nested(true); + omp_set_num_threads(32); + + signal(SIGHUP, sighandler); + siginterrupt(SIGHUP, 1); + + std::vector<std::string> inputStreams(4); + inputStreams[0] = "udp:127.0.0.1:4346"; + inputStreams[1] = "udp:127.0.0.1:4347"; + inputStreams[2] = "udp:127.0.0.1:4348"; + inputStreams[3] = "udp:127.0.0.1:4349"; + + if(rank == 0) { + Station< SampleT > station( settings, inputStreams ); + Generator< SampleT > generator( settings, inputStreams ); + + #pragma omp parallel sections num_threads(4) + { + #pragma omp section + { station.process(); } + + #pragma omp section + { generator.process(); } + + #pragma omp section + { sleep(DURATION + 1); station.stop(); sleep(1); generator.stop(); } + + #pragma omp section + { + struct StationID lookup("RS106", "HBA0"); + struct StationSettings s(stationID); + + LOG_INFO_STR("Detected " << s); +#ifdef USE_RMA + MPISharedBuffer<SampleT> streamer(s); +#else + #pragma omp parallel for num_threads(nrHosts - nrStations) + for (int i = nrStations; i < nrHosts; ++i) { + LOG_INFO_STR("Connecting to receiver " << i ); + MPISendStation< SampleT > streamer(s, from, to, blockSize, beamlets[i], i ); + + LOG_INFO_STR("Sending to receiver " << i ); + streamer.process( 0.0 ); + } +#endif + } + } + } else { + struct StationID lookup("RS106", "HBA0"); + struct StationSettings s(stationID); + + LOG_INFO_STR("Detected " << s); +#ifdef USE_RMA + MPISharedBuffer<SampleT> streamer(s); +#else + #pragma omp parallel for num_threads(nrHosts - nrStations) + for (int i = nrStations; i < nrHosts; ++i) { + LOG_INFO_STR("Connecting to receiver " << i ); + MPISendStation< SampleT > streamer(s, from, to, blockSize, beamlets[i], i ); + + LOG_INFO_STR("Sending to receiver " << i ); + streamer.process( 0.0 ); + } +#endif + } + + MPI_Finalize(); +} diff --git a/RTCP/IONProc/test/newInputSection/newInputSection_old.cc b/RTCP/IONProc/test/newInputSection/newInputSection_old.cc new file mode 100644 index 0000000000000000000000000000000000000000..6aeb5221ab289cec77026cd775a193843d4df31c --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/newInputSection_old.cc @@ -0,0 +1,706 @@ +#include <lofar_config.h> + +#include <Common/Thread/Mutex.h> +#include <Common/LofarLogger.h> +#include <Stream/SocketStream.h> +#include "TimeSync.h" + +#include <RSP.h> +#include <Interface/RSPTimeStamp.h> + +#include <iostream> +#include <vector> + +using namespace std; +using namespace LOFAR; +using namespace RTCP; + +const unsigned nrInputs = 10; +const unsigned nrOutputs = 10; + +const float sampleClock = 8 * 1e6; +const float subbandWidth = sampleClock / 1024; +const size_t samplesPerBlock = subbandWidth * 0.05; + +const size_t packetSize = 9000; + +class Consumer; + +/* + * Lock-free buffer for RSP packets, including + * producer primitives. Supports a single producer. + */ +class PacketBuffer { +public: + struct Item { + // the converted timestamp for this packet, + // or 0 if this packet is being written. + volatile int64 timestamp; + + // the timestamp of the previous packet, + // or 0 for the first packet. + volatile int64 prev_timestamp; + + // the payload + struct RSP packet; + + Item(): timestamp(0), prev_timestamp(0) {} + }; + + class CircularPtr { + public: + CircularPtr( PacketBuffer &buffer, struct Item *item ): item(item), buffer(buffer) {} + + struct Item *item; + + void operator++() { + if (++item == buffer.end) + item = buffer.begin; + } + + void operator--() { + if (--item == buffer.begin) + item = buffer.end - 1; + } + + private: + PacketBuffer &buffer; + }; + +private: + vector<struct Item> packets; + struct Item * const begin; + struct Item * const end; + + vector<Consumer *> consumers; + Mutex consumersMutex; + + // points to where input will be written + CircularPtr head; + + // points to the packet at or right after head + CircularPtr next; + + // last recorded timestamp + int64 prev_timestamp; + +public: + PacketBuffer( size_t bufsize, unsigned sampleClock, unsigned timesPerSlot, bool realtime ); + + // timestamp of the last written packet (exclusive, + // so actually points to one timestamp beyond the youngest + // packet). + // + // (or 0 if no data has been written yet) + volatile int64 youngest; + + // timestamp of the oldest slot in the buffer (or 0 if + // the buffer has not been fully filled yet) + volatile int64 oldest; + struct Item * volatile oldest_item; + + // call before starting to write at head + void startWrite(); + + // pointer to the head packet + struct RSP &writePtr(); + + // call after completing a write at head + void stopWrite(); + + // call when data stream ends + void noMoreData(); + + // add/remove consumers + void registerConsumer( Consumer &consumer ); + void unregisterConsumer( Consumer &consumer ); + + // configuration parameters + const unsigned sampleClock; + const bool realtime; + const size_t timesPerSlot; +}; + +/* + * An abstract class describing a data processor. + */ +class PacketSink { +public: + virtual void processPacket( Consumer *consumer, const int64 ×tamp, struct RSP &packet ) = 0; + virtual void missingData( Consumer *consumer, const int64 &from, const int64 to ) = 0; +}; + +class Consumer { +public: + Consumer( PacketBuffer &buffer, PacketSink &sink ); + + void wait( int64 to, struct timespec &timeout ); + void read( int64 from, int64 to ); + +private: + PacketBuffer &buffer; + PacketSink &sink; + const bool realtime; + + PacketBuffer::CircularPtr tail; + + // needed for synchronisation + TimeSync needFrom, haveUntil; + friend class PacketBuffer; +}; + +PacketBuffer::PacketBuffer( size_t bufsize, unsigned sampleClock, unsigned timesPerSlot, bool realtime ) +: + packets(bufsize), + begin(&packets[0]), + end(&packets[bufsize]), + head(*this, begin), + next(*this, begin), + prev_timestamp(0), + + youngest(0), + oldest(0), + oldest_item(0), + + sampleClock(sampleClock), + realtime(realtime), + timesPerSlot(timesPerSlot) +{ + // head and next are distinct (once data is read) + ASSERT( bufsize >= 2 ); +} + +void PacketBuffer::startWrite() +{ + if (!realtime) { + // make sure that our consumers do not need the head.item + // that we're about to overwrite + + const int64 headTime = head.item->timestamp; + + if (headTime != 0) { + ScopedLock sl(consumersMutex); + + for (vector<Consumer *>::const_iterator i = consumers.begin(); i != consumers.end(); ++i) + (*i)->needFrom.wait( headTime + timesPerSlot ); + } + } + + // keep next pointed at the oldest packet + ++ next; + + // if we overwrite data because we wrapped around, + // we have to update oldest. + if (next.item->timestamp != 0) { + oldest_item = next.item; + oldest = next.item->timestamp; + } + + // invalidate head + head.item->timestamp = 0; +} + +struct RSP &PacketBuffer::writePtr() +{ + return head.item->packet; +} + +void PacketBuffer::stopWrite() +{ + // complete our bookkeeping on head + const struct RSP &packet = head.item->packet; + const int64 timestamp = TimeStamp(packet.header.timestamp, packet.header.blockSequenceNumber, sampleClock); + + head.item->prev_timestamp = prev_timestamp; + prev_timestamp = timestamp; + + // make head valid again + head.item->timestamp = timestamp; + + ++ head; + + // the very first packet initialises oldest + if (!oldest) { + oldest_item = head.item; + oldest = timestamp; + } + + youngest = timestamp + timesPerSlot; + + { + // readers could be waiting for this data both in realtime and in non-realtime modes + + // The consumersMutex only blocks if consumers are added or removed. + ScopedLock sl(consumersMutex); + + // make sure that our consumers unlock once we've written data they need + for (vector<Consumer *>::const_iterator i = consumers.begin(); i != consumers.end(); ++i) { + // These TimeSync locks block only if the consumer is about to wait + // for data. This is still cheaper than letting the consumers actively + // poll `youngest'. + (*i)->haveUntil.set( youngest ); + } + } +} + +void PacketBuffer::noMoreData() +{ + ScopedLock sl(consumersMutex); + + // make sure that our consumers unlock + for (vector<Consumer *>::const_iterator i = consumers.begin(); i != consumers.end(); ++i) + (*i)->haveUntil.noMoreData(); +} + +Consumer::Consumer( PacketBuffer &buffer, PacketSink &sink ) +: + buffer(buffer), + sink(sink), + realtime(buffer.realtime), + tail(buffer, 0) +{ +} + +void Consumer::wait( int64 to, struct timespec &timeout ) +{ + if (!realtime) { + // sync will occur in read() + return; + } + + if (!haveUntil.wait( to, timeout )) { + LOG_WARN_STR( "Data arrived too late for " << to ); + } else { + LOG_DEBUG_STR( "Data arrived on time for " << to ); + } +} + +void Consumer::read( int64 from, int64 to ) +{ + /* + * Read data from the circular buffer, lock free + * under the following conditions: + * - running in real-time mode + * - no logging anywhere + * + * This means that any information we retrieve + * from `buffer' can already be outdated at the next + * memory access. So we often store a local copy. Also, we + * let the buffer cache the following info, and update it + * atomically: + * + * youngest: timestamp of the latest packet that was written + * oldest: timestamp of the oldest packet still in the buffer + * oldest_item: pointer to the oldest item + * + * Each item has the following properties: + * + * timestamp: timestamp of the first sample, or 0 if this packet + * is either not used yet or being overwritten. + * prev_timestamp: + * timestamp of the previous received packet, needed + * to detect some forms of packet loss. + * item: pointer to the payload. + * + * Note that even dereferencing multiple properties of the same + * item might yield results from different packets, if the + * writer passed by in between reads. + * + * In the cases that multiple properties are needed, make sure + * that the code functions correctly if a second property comes + * from a later packet than the first property. + */ + ASSERT(from < to); + + /* + * Sync with writer if needed + */ + + if (!realtime) { + // reserve all data since from + needFrom.set( from ); + + // make sure all data (that exists) + // until to is available. + haveUntil.wait( to ); + } + + const int64 youngest = buffer.youngest; + + /* + * We will exit once we encounter data up to 'to' + * or later. So we have to make sure that exists, + * as we cannot count on more data to arrive. + */ + + if (youngest <= from) { + // no data available -- don't look for it + LOG_DEBUG_STR( "Data loss because no data is available" ); + sink.missingData( this, from, to ); + return; + } + + if (youngest < to) { + // partial data available -- only look for what might exist + LOG_DEBUG_STR( "Data loss because end is not available" ); + sink.missingData( this, youngest, to ); + + to = youngest; + } + + /* + * Make an initial guess where to start looking. + * We just have to make sure that we do not jump + * between [from, to) as we'd be forced to consider + * anything before `tail' as a loss. + */ + + if (!tail.item) { + // We'll need to scan -- start at the oldest data + tail.item = buffer.oldest_item; + } else { + // We'll continue from the last read() + // + // Rewind if needed. Note that prev_timestamp is only 0 + // if there was no previous packet. + while( tail.item->prev_timestamp >= from ) { + LOG_DEBUG_STR("Rewinding, am " << (tail.item->prev_timestamp - from) << " ahead"); + -- tail; + } + } + + /* + * Locate any data we can find and process it. + * + * We drop out of the loop when we either: + * - have all our data (from == to) + * - notice that the rest of the data is lost + */ + + while( from < to ) { + const int64 tailTime = tail.item->timestamp; + + if (tailTime == 0) { + // invalid or no data + + // prevent infinite loops if we run in lock-step with the writer + if (buffer.oldest >= to) + break; + + ++ tail; + continue; + } + + if (tailTime < from) { + // data is not useful to us + ++ tail; + continue; + } + + if (tailTime >= to) { + // Two possibilities: + // 1. Genuine data loss beyond the end of the packet. + // 2. Writer gained on us and wrote a new packet here. + + if (tail.item->prev_timestamp < from) { + // 1: this packet belongs here, so the loss + // spans across the end of the packet. + break; + } + + // 2: We're somewhere we should not be, most likely + // because the writer overwrote these packets. + + ASSERT(realtime); + + if (buffer.oldest >= to) { + // there is no data for us anymore + break; + } + + // valid data after head + LOG_DEBUG_STR( "Sync with head" ); + tail.item = buffer.oldest_item; + continue; + } + + if (tailTime != from) { + // data loss + LOG_DEBUG_STR( "Data loss within packet" ); + sink.missingData( this, from, tailTime ); + } + + // a packet! + sink.processPacket( this, tailTime, tail.item->packet ); + + /* + * If the writer did *anything* with this packet, the + * timestamp will have been changed. + */ + + if (tailTime != tail.item->timestamp) { + // we got interrupted + ASSERT(realtime); + + // mark packet as missing + LOG_DEBUG_STR( "Data loss due to read/write conflict" ); + sink.missingData( this, tailTime, tailTime + buffer.timesPerSlot ); + } + + // look for the next packet + from = tailTime + buffer.timesPerSlot; + + // no need to reconsider this packet + ++ tail; + } + + if (from < to) { + LOG_DEBUG_STR( "Data loss at end of packet" ); + sink.missingData( this, from, to ); + } +} + +void PacketBuffer::registerConsumer( Consumer &consumer ) +{ + ScopedLock sl(consumersMutex); + + consumers.push_back(&consumer); +} + +void PacketBuffer::unregisterConsumer( Consumer &consumer ) +{ + ScopedLock sl(consumersMutex); + + for (vector<Consumer*>::iterator i = consumers.begin(); i != consumers.end(); ++i) { + if (*i == &consumer) { + consumers.erase(i); + break; + } + } +} + +#if 0 +/* + * Input from one RSP board + */ +class RSPBoardInput { +public: + RSPBoardInput( FileDescriptorBasedStream &inputStream, unsigned subbandsPerPacket, unsigned timesPerSlot, unsigned nrPolarizations, unsigned sampleSize ); + + void read(); + + PacketBuffer buffer; + +private: + FileDescriptorBasedStream &inputStream; + + const unsigned subbandsPerPacket; + const unsigned timesPerSlot; + const unsigned nrPolarizations; + const unsigned sampleSize; + + const size_t subbandSize; + const size_t packetSize; +}; + +RSPBoardInput::RSPBoardInput( FileDescriptorBasedStream &inputStream, unsigned subbandsPerPacket, unsigned timesPerSlot, unsigned nrPolarizations, unsigned sampleSize ) +: + buffer(100), + inputStream(inputStream), + packetReadOffset(0), + + subbandsPerPacket(subbandsPerPacket), + timesPerSlot(timesPerSlot), + nrPolarizations(nrPolarizations), + sampleSize(sampleSize), + + subbandSize(timesPerSlot * nrPolarizations * sampleSize), + packetSize(sizeof(struct RSP::Header) + subbandsPerPacket * subbandSize) +{ + ASSERT(packetSize <= sizeof(struct RSP)); +} + +void RSPBoardInput::read() +{ + /* + * Read packets until we block. + */ + for(;;) { + struct RSP &packet = buffer.head.item->packet; + + void *dstPtr = reinterpret_cast<char*>(packet) + packetReadOffset; + size_t bytesLeft = packetSize - packetReadOffset; + size_t numbytes; + + if (packetReadOffset == 0) { + // new packet + buffer.startWrite(); + } + + try { + numbytes = s.tryRead(dstPtr, bytesLeft); + } catch(...) { + buffer.noMoreData(); + + throw; + } + + if (numbytes == bytesLeft) { + // finished reading packet + buffer.stopWrite(); + + packetReadOffset = 0; + } else { + // packet partially read + packetReadOffset += numbytes; + } + } +} + +/* + * Generates output from data generated by multiple RSP boards. + */ +class OutputGenerator { +public: + OutputGenerator( const vector< RSPBoardInput * > &inputs, const int64 &startTime, size_t blocksize ); + + int64 next_block_start; + size_t blocksize; + + void write(); + +private: + const vector< RSPboardInput * > &inputs; + vector< PacketBuffer::Consumer * > consumers; +}; + +OutputGenerator::OutputGenerator( const vector< RSPBoardInput * > &inputs, const int64 &startTime, size_t blocksize ) +: + next_block_start(startTime), + blocksize(blocksize), + inputs(inputs), + consumers(inputs.size(),0) +{ + for( size_t i = 0; i < inputs.size(); i++ ) + consumers[i] = new PacketBuffer::Consumer(inputs[i]->buffer); +} + +void OutputGenerator::processPacket( const RSPBoardInput &input, const int64 ×tamp, struct RSP *packet ) +{ +/* + char *srcPtr = packet->data; + + for (size_t sb = 0; sb < subbandsPerPacket; sb++) { + // copy full subband + memcpy( dstPtr, srcPtr, subbandSize ); + srcPtr += subbandSize; + } +*/ +} + +void OutputGenerator::missingData( const RSPBoardInput &input, const int64 &from, const int64 to ) +{ +} + +void OutputGenerator::write() +{ + /* todo: wait for T = next_block_start + max_wait_time */ + + for( size_t i = 0; i < consumers.size(); i++ ) { + RSPBoardInput &input = *inputs[i]; + PacketBuffer &buffer = input.buffer; + PacketBuffer::Consumer &consumer = consumers[i]; + unsigned timesPerSlot = input.timesPerSlot; + } +} + + +/* + * Design: + * + * Input is read from + */ +#endif + +#include <time.h> +#include <Common/Thread/Thread.h> +#include <WallClockTime.h> + +time_t start; + +class LogPacketSink: public PacketSink +{ +public: + virtual void processPacket( Consumer *consumer, const int64 ×tamp, struct RSP &packet ) { + //LOG_INFO_STR( "Received packet " << timestamp ); + } + virtual void missingData( Consumer *consumer, const int64 &from, const int64 to ) { + LOG_INFO_STR( "Missed data from " << from << " to " << to ); + } +}; + +class ConsumerThread { +public: + void run(); + + Consumer *consumer; + Thread thread; + + ConsumerThread( Consumer *consumer ): consumer(consumer), thread( this, &ConsumerThread::run ) {} +}; + +void ConsumerThread::run() +{ + TimeStamp cts(start, 0, sampleClock); + + for (size_t i = 0; i < 16; ++i) { + TimeStamp from = cts; + TimeStamp to = cts + 16 * 1000; + LOG_INFO_STR( ">>>> Reading from " << (int64)from << " to " << (int64)to << " <<<<<" ); + + struct timespec ts = to; + + consumer->wait( to, ts ); + consumer->read( from, to ); + LOG_INFO_STR( "<<<< Done reading from " << (int64)from << " to " << (int64)to << " >>>>>" ); + cts = to; + } +} + +int main( int argc, char **argv ) { + INIT_LOGGER(argv[0]); + + bool realtime = true; + + PacketBuffer buffer( 1100, sampleClock, 16, realtime ); + LogPacketSink logsink; + Consumer consumer( buffer, logsink ); + buffer.registerConsumer(consumer); + + ConsumerThread cthread( &consumer ); + + start = time(0) + 1; + + WallClockTime wct; + + TimeStamp ts(start, 0, sampleClock); + + for (size_t i = 0; i < 100; ++i) { + wct.waitUntil(ts + 0000); + + for (size_t j = 0; j < 160; ++j) { + buffer.startWrite(); + + struct RSP &packet = buffer.writePtr(); + + packet.header.timestamp = ts.getSeqId(); + packet.header.blockSequenceNumber = ts.getBlockId(); + + buffer.stopWrite(); + + ts += 16; + } + } + + buffer.noMoreData(); +} diff --git a/RTCP/IONProc/test/newInputSection/shmtest.cc b/RTCP/IONProc/test/newInputSection/shmtest.cc new file mode 100644 index 0000000000000000000000000000000000000000..f7b0d5d804b9cc0e15de40de1c8aeffbe1877ca8 --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/shmtest.cc @@ -0,0 +1,12 @@ +#include "SharedMemory.h" +#include <unistd.h> + +using namespace LOFAR; + +int main() { + INIT_LOGGER("foo"); + + SharedMemory shm( 0x123, 4096, SharedMemory::READ ); + + sleep(5); +} diff --git a/RTCP/IONProc/test/newInputSection/tRSPTimeStamp.cc b/RTCP/IONProc/test/newInputSection/tRSPTimeStamp.cc new file mode 100644 index 0000000000000000000000000000000000000000..e4085cf3f05a5bd1d1d7e3697b2541a555bdceac --- /dev/null +++ b/RTCP/IONProc/test/newInputSection/tRSPTimeStamp.cc @@ -0,0 +1,27 @@ +#include <lofar_config.h> + +#include <Common/LofarLogger.h> +#include <Interface/RSPTimeStamp.h> + +int main( int, char **argv ) +{ + INIT_LOGGER(argv[0]); + + unsigned clock = 200 * 1000 * 1000; + + { + TimeStamp ts(0,0,clock); + + for (int64 i = 0; i < clock * 3; ++i) { + ++ts; + + #define REPORT "(ts == " << ts << ", i == " << i << ")" + + ASSERTSTR( (int64)ts == i, REPORT ); + + ASSERTSTR( ts.getSeqId() == i / clock, REPORT ); + + ASSERTSTR( ts.getBlockId() == i % clock, REPORT ); + } + } +} diff --git a/RTCP/IONProc/test/tSSH.cc b/RTCP/IONProc/test/tSSH.cc index 58f6a2a68a592578337d7ed907927f8066e3a3aa..8c8336efa7a64214a97f16b448ff4fe6e30ef8ee 100644 --- a/RTCP/IONProc/test/tSSH.cc +++ b/RTCP/IONProc/test/tSSH.cc @@ -21,9 +21,9 @@ using namespace LOFAR; using namespace RTCP; -void test_SSHconnection() { +void test_SSHconnection( const char *cmd ) { #ifdef HAVE_LIBSSH2 - SSHconnection ssh("", "localhost", "echo SSHconnection success", USER, privkey); + SSHconnection ssh("", "localhost", cmd, USER, privkey); ssh.start(); @@ -47,8 +47,7 @@ void test_forkExec() { pid = forkSSH("", "localhost", params, USER, privkey); - unsigned timeout = 10; - joinSSH("", pid, timeout); + joinSSH("", pid, time(0) + 10); } int main() { @@ -60,15 +59,22 @@ int main() { // can we even ssh to localhost? char sshcmd[1024]; - snprintf(sshcmd, sizeof sshcmd, "ssh %s@localhost -i %s echo system success", USER, privkey); + snprintf(sshcmd, sizeof sshcmd, "ssh %s@localhost -o PasswordAuthentication=no -o KbdInteractiveAuthentication=no -o NoHostAuthenticationForLocalhost=yes -i %s echo system success", USER, privkey); int ret = system(sshcmd); if (ret < 0 || WEXITSTATUS(ret) != 0) { // no -- mark this test as unrunnable and don't attempt to try with libssh then return 3; } - test_SSHconnection(); + SSH_Init(); + + test_SSHconnection( "echo SSHconnection success [stdout]" ); + test_SSHconnection( "echo SSHconnection success [stderr] 1>&2" ); + test_SSHconnection( "echo SSHconnection success [stderr] 1>&2; echo SSHconnection success [stdout]" ); + test_SSHconnection( "echo SSHconnection success [stdout]; echo SSHconnection success [stderr] 1>&2" ); test_forkExec(); + SSH_Finalize(); + return 0; } diff --git a/RTCP/IONProc/test/tSSH.stdout b/RTCP/IONProc/test/tSSH.stdout index 0b2e0ea1c755cc40a2905cc45fdb4df84cc16c6c..52dd9242161514f27cdc6f4d8543b9663a4e59f5 100644 --- a/RTCP/IONProc/test/tSSH.stdout +++ b/RTCP/IONProc/test/tSSH.stdout @@ -1,3 +1,8 @@ system success -SSHconnection success +SSHconnection success [stdout] +SSHconnection success [stderr] +SSHconnection success [stderr] +SSHconnection success [stdout] +SSHconnection success [stdout] +SSHconnection success [stderr] forkExec success diff --git a/RTCP/Interface/include/Interface/Allocator.h b/RTCP/Interface/include/Interface/Allocator.h index 427471dae36720f2535b0a640a233e1e8e0e9848..fb841218f9469864257fb63690f8d0f21855e069 100644 --- a/RTCP/Interface/include/Interface/Allocator.h +++ b/RTCP/Interface/include/Interface/Allocator.h @@ -48,6 +48,25 @@ class Allocator virtual void *allocate(size_t size, size_t alignment = 1) = 0; virtual void deallocate(void *) = 0; + + /* + * Allows TYPE *foo = allocator.allocateTyped() without type-casting. + */ + class TypedAllocator { + public: + TypedAllocator(Allocator &allocator, size_t alignment): allocator(allocator), alignment(alignment) {} + + // cast-operator overloading is the only way to let C++ automatically deduce the type that we want + // to return. + template<typename T> operator T* () { + return static_cast<T*>(allocator.allocate(sizeof(T), alignment)); + } + private: + Allocator &allocator; + const size_t alignment; + }; + + TypedAllocator allocateTyped(size_t alignment = 1) { return TypedAllocator(*this, alignment); } }; @@ -68,7 +87,7 @@ class SparseSetAllocator : public Allocator public: SparseSetAllocator(const Arena &); - virtual void *allocate(size_t size, size_t alignment); + virtual void *allocate(size_t size, size_t alignment = 1); virtual void deallocate(void *); bool empty() { ScopedLock sl(mutex); return sizes.empty(); } diff --git a/RTCP/Interface/include/Interface/MultiDimArray.h b/RTCP/Interface/include/Interface/MultiDimArray.h index e5a5496180d9a457d2f8c89c9fca771c9f039ee4..4d1730d079290521d8012536f367d0705b6d83d1 100644 --- a/RTCP/Interface/include/Interface/MultiDimArray.h +++ b/RTCP/Interface/include/Interface/MultiDimArray.h @@ -32,17 +32,19 @@ template <typename T, unsigned DIM> class MultiDimArray : public boost::multi_ar SuperType(0, boost::detail::multi_array::extent_gen<DIM>()), allocator(&allocator), allocated_num_elements(0), - alignment(0) + alignment(0), + padToAlignment(false), + construct(true) { } - MultiDimArray(const ExtentList &extents, void *ptr) + MultiDimArray(const ExtentList &extents, void *ptr, bool construct = true) : // Use 'placement new' to force initialisation through constructors if T is a class // TODO: Not sure how to handle an exception raised by the constructor of T. The placement // delete[] will be called, but that's an empty stub. - SuperType(new(ptr)T[nrElements(extents)], extents), + SuperType(construct ? new(ptr)T[nrElements(extents)] : ptr, extents), allocator(&allocator), allocated_num_elements(nrElements(extents)), alignment(alignment), @@ -50,26 +52,30 @@ template <typename T, unsigned DIM> class MultiDimArray : public boost::multi_ar { } - MultiDimArray(const ExtentList &extents, size_t alignment = defaultAlignment(), Allocator &allocator = heapAllocator, bool padToAlignment = false) + MultiDimArray(const ExtentList &extents, size_t alignment = defaultAlignment(), Allocator &allocator = heapAllocator, bool padToAlignment = false, bool construct = true) : // Use 'placement new' to force initialisation through constructors if T is a class // TODO: Not sure how to handle an exception raised by the constructor of T. The placement // delete[] will be called, but that's an empty stub. - SuperType(new(allocator.allocate(padToAlignment ? align(nrElements(extents) * sizeof(T), alignment) : nrElements(extents) * sizeof(T), alignment))T[nrElements(extents)], extents), + SuperType(allocate(nrElements(extents), alignment, allocator, padToAlignment, construct), extents), allocator(&allocator), allocated_num_elements(nrElements(extents)), alignment(alignment), - padToAlignment(padToAlignment) + padToAlignment(padToAlignment), + construct(construct) { } MultiDimArray(const MultiDimArray<T,DIM> &other) : - SuperType(other.num_elements_ ? new(other.allocator->allocate(padToAlignment ? align(other.num_elements_ * sizeof(T), other.alignment) : other.num_elements_ * sizeof(T), other.alignment))T[other.num_elements_] : 0, other.extent_list_), + SuperType(other.num_elements_ ? allocate(other.num_elements_, other.alignment, *other.allocator, other.padToAlignment, other.construct) : 0, other.extent_list_), +//new(other.allocator->allocate(padToAlignment ? align(other.num_elements_ * sizeof(T), other.alignment) : other.num_elements_ * sizeof(T), other.alignment))T[other.num_elements_] : 0, other.extent_list_), allocator(other.allocator), allocated_num_elements(other.num_elements_), - alignment(other.alignment) + alignment(other.alignment), + padToAlignment(other.padToAlignment), + construct(true) { *this = other; } @@ -97,11 +103,11 @@ template <typename T, unsigned DIM> class MultiDimArray : public boost::multi_ar return *this; } - void resize(const ExtentList &extents, size_t alignment, Allocator &allocator, bool padToAlignment = false) + void resize(const ExtentList &extents, size_t alignment, Allocator &allocator, bool padToAlignment = false, bool construct = true) { destructElements(); - MultiDimArray newArray(extents, alignment, allocator, padToAlignment); + MultiDimArray newArray(extents, alignment, allocator, padToAlignment, construct); std::swap(this->base_, newArray.base_); std::swap(this->storage_, newArray.storage_); std::swap(this->extent_list_, newArray.extent_list_); @@ -113,6 +119,8 @@ template <typename T, unsigned DIM> class MultiDimArray : public boost::multi_ar std::swap(this->allocator, newArray.allocator); std::swap(this->allocated_num_elements, newArray.allocated_num_elements); std::swap(this->alignment, newArray.alignment); + std::swap(this->padToAlignment, newArray.padToAlignment); + std::swap(this->construct, newArray.construct); } void resize(const ExtentList &extents, size_t alignment = defaultAlignment()) @@ -126,10 +134,10 @@ template <typename T, unsigned DIM> class MultiDimArray : public boost::multi_ar unsigned new_num_elements = nrElements(extents); if (new_num_elements > allocated_num_elements) - THROW(InterfaceException, "MultiDimArray::resizeInplace: requested to resize to " << new_num_elements << " elements, but only " << allocated_num_elements << " are allocateod"); + THROW(InterfaceException, "MultiDimArray::resizeInplace: requested to resize to " << new_num_elements << " elements, but only " << allocated_num_elements << " are allocated"); // only destruct and construct all elements if the number of elements actually changes - if (new_num_elements != this->num_elements_) { + if (new_num_elements != this->num_elements_ && construct) { destructElements(); (void)new(this->base_)T[new_num_elements]; } @@ -186,6 +194,17 @@ template <typename T, unsigned DIM> class MultiDimArray : public boost::multi_ar size_t allocated_num_elements; unsigned alignment; bool padToAlignment; + bool construct; + + T *allocate(size_t nrElements, size_t alignment, Allocator &allocator, bool padToAlignment, bool construct) const { + size_t dataSize = padToAlignment + ? align(nrElements * sizeof(T), alignment) + : nrElements * sizeof(T); + + T *ptr = static_cast<T*>(allocator.allocate(dataSize, alignment)); + + return construct ? new(ptr)T[nrElements] : ptr; + } // a MultiDimArray made to replace another, using a different shape. Assumes // the original MultiDimArray allocated enough memory to hold the new @@ -200,13 +219,17 @@ template <typename T, unsigned DIM> class MultiDimArray : public boost::multi_ar allocator(0), // we did not allocate this allocated_num_elements(0), alignment(other.alignment), - padToAlignment(other.padToAlignment) + padToAlignment(other.padToAlignment), + construct(other.construct) { } void destructElements() { + if (!construct) + return; + // explicitly call the destructors in the 'placement new' array since C++ // cannot do this for us. The delete[] operator cannot know the size of the // array, and the placement delete[] operator exists (since new()[] will look diff --git a/RTCP/Interface/include/Interface/Parset.h b/RTCP/Interface/include/Interface/Parset.h index 5a9ec652f1dbde13fbebdfd83e52b6d2c83883b8..682f091091f0b02f0b6fa10109586924f0425ab4 100644 --- a/RTCP/Interface/include/Interface/Parset.h +++ b/RTCP/Interface/include/Interface/Parset.h @@ -30,6 +30,7 @@ //# Includes #include <Common/ParameterSet.h> +#include <Common/LofarBitModeInfo.h> #include <Common/StreamUtil.h> #include <Common/StringUtil.h> #include <Common/lofar_datetime.h> @@ -707,7 +708,16 @@ inline unsigned Parset::dedispersionFFTsize() const inline unsigned Parset::nrBitsPerSample() const { - return getUint32("OLAP.nrBitsPerSample"); + const std::string key = "Observation.nrBitsPerSample"; + + if (isDefined(key)) { + return getUint32(key); + } else { +#ifndef HAVE_BGP_CN + LOG_WARN_STR( "Missing key " << key << ", using the depricated key OLAP.nrBitsPerSample"); +#endif + return getUint32("OLAP.nrBitsPerSample", 16); + } } inline unsigned Parset::CNintegrationSteps() const @@ -1060,7 +1070,16 @@ inline int Parset::phaseThreeCoreIndex(unsigned core) const inline unsigned Parset::nrSlotsInFrame() const { - return getUint32("Observation.nrSlotsInFrame"); + unsigned nrSlots = 0; + + nrSlots = getUint32("Observation.nrSlotsInFrame", 0); + + if (nrSlots == 0) { + // return default + return maxBeamletsPerRSP(nrBitsPerSample()); + } + + return nrSlots; } inline string Parset::partitionName() const diff --git a/RTCP/Interface/include/Interface/RSPTimeStamp.h b/RTCP/Interface/include/Interface/RSPTimeStamp.h index 8a605629ee7e39ed7819b1f1d8463706f6d5717b..d2cc0c22c5aab4348f95c383f8dcdb82a82731bd 100644 --- a/RTCP/Interface/include/Interface/RSPTimeStamp.h +++ b/RTCP/Interface/include/Interface/RSPTimeStamp.h @@ -42,6 +42,7 @@ namespace LOFAR { TimeStamp &setStamp(unsigned seqId, unsigned blockId); unsigned getSeqId() const; unsigned getBlockId() const; + unsigned getClock() const { return itsClockSpeed; } template <typename T> TimeStamp &operator += (T increment); template <typename T> TimeStamp &operator -= (T decrement); diff --git a/RTCP/Interface/include/Interface/SmartPtr.h b/RTCP/Interface/include/Interface/SmartPtr.h index 85e79a75cfe2bf8b0bf8f72e87d3162a635c3d46..1f6fc5190b7ddc222457889bc081087b38745cb9 100644 --- a/RTCP/Interface/include/Interface/SmartPtr.h +++ b/RTCP/Interface/include/Interface/SmartPtr.h @@ -46,6 +46,8 @@ template <typename T, class D = SmartPtrDelete<T> > class SmartPtr T & operator * () const; T * operator -> () const; + bool operator ! () const; + SmartPtr<T,D> & operator = (T *); SmartPtr<T,D> & operator = (const SmartPtr<T,D> &); @@ -115,6 +117,12 @@ template <typename T, class D> inline T *SmartPtr<T,D>::operator -> () const } +template <typename T, class D> inline bool SmartPtr<T,D>::operator ! () const +{ + return ptr == 0; +} + + template <typename T, class D> inline SmartPtr<T,D> &SmartPtr<T,D>::operator = (T *orig) { D::free(ptr); diff --git a/RTCP/Interface/include/Interface/Stream.h b/RTCP/Interface/include/Interface/Stream.h index d4eb594c5b87065427b7e28da457e396116856ea..8111b8e0284d8447a303240318bd0fca31ec0120 100644 --- a/RTCP/Interface/include/Interface/Stream.h +++ b/RTCP/Interface/include/Interface/Stream.h @@ -33,7 +33,7 @@ namespace LOFAR { namespace RTCP { // Create a stream from a descriptor -Stream *createStream(const std::string &descriptor, bool asReader); +Stream *createStream(const std::string &descriptor, bool asReader, time_t deadline = 0); // Return a string descriptor, for all supported streamTypes except FCNP std::string getStreamDescriptorBetweenIONandCN(const char *streamType, unsigned ionode, unsigned pset, unsigned core, unsigned numpsets, unsigned numcores, unsigned channel); diff --git a/RTCP/Interface/src/Stream.cc b/RTCP/Interface/src/Stream.cc index 018588c82058ab541341a684e23913e7c1bae863..07b9225e38801768765d0a0d4ad07c268b9b8524 100644 --- a/RTCP/Interface/src/Stream.cc +++ b/RTCP/Interface/src/Stream.cc @@ -38,6 +38,7 @@ #include <boost/format.hpp> #include <boost/lexical_cast.hpp> +#include <time.h> #include <vector> using boost::format; @@ -46,34 +47,37 @@ using namespace std; namespace LOFAR { namespace RTCP { -Stream *createStream(const string &descriptor, bool asServer) +Stream *createStream(const string &descriptor, bool asServer, time_t deadline) { vector<string> split = StringUtil::split(descriptor, ':'); + if (deadline > 0 && deadline <= time(0)) + THROW(SocketStream::TimeOutException, "Deadline already passed at start"); + if (descriptor == "null:") return new NullStream; else if (split.size() == 3 && split[0] == "udp") - return new SocketStream(split[1].c_str(), boost::lexical_cast<short>(split[2]), SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, 30); + return new SocketStream(split[1].c_str(), boost::lexical_cast<short>(split[2]), SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, deadline); else if (split.size() == 3 && split[0] == "tcp") - return new SocketStream(split[1].c_str(), boost::lexical_cast<short>(split[2]), SocketStream::TCP, asServer ? SocketStream::Server : SocketStream::Client, 30); + return new SocketStream(split[1].c_str(), boost::lexical_cast<short>(split[2]), SocketStream::TCP, asServer ? SocketStream::Server : SocketStream::Client, deadline); else if (split.size() == 3 && split[0] == "udpkey") - return new SocketStream(split[1].c_str(), 0, SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, 30, split[2].c_str()); + return new SocketStream(split[1].c_str(), 0, SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, deadline, split[2].c_str()); #ifdef USE_THREADS else if (split.size() == 4 && split[0] == "tcpbroker") return asServer ? static_cast<Stream*>(new PortBroker::ServerStream(split[3])) : static_cast<Stream*>(new PortBroker::ClientStream(split[1], boost::lexical_cast<short>(split[2]), split[3])); #endif else if (split.size() == 3 && split[0] == "tcpkey") #if defined CLUSTER_SCHEDULING - return new SocketStream(split[1].c_str(), 0, SocketStream::TCP, asServer ? SocketStream::Server : SocketStream::Client, 30000, split[2].c_str()); + return new SocketStream(split[1].c_str(), 0, SocketStream::TCP, asServer ? SocketStream::Server : SocketStream::Client, deadline, split[2].c_str()); #else - return new SocketStream(split[1].c_str(), 0, SocketStream::TCP, asServer ? SocketStream::Server : SocketStream::Client, 30, split[2].c_str()); + return new SocketStream(split[1].c_str(), 0, SocketStream::TCP, asServer ? SocketStream::Server : SocketStream::Client, deadline, split[2].c_str()); #endif else if (split.size() == 2 && split[0] == "file") return asServer ? new FileStream(split[1].c_str()) : new FileStream(split[1].c_str(), 0666); else if (split.size() == 2 && split[0] == "pipe") return new NamedPipeStream(split[1].c_str(), asServer); else if (split.size() == 2) - return new SocketStream(split[0].c_str(), boost::lexical_cast<short>(split[1]), SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, 30); + return new SocketStream(split[0].c_str(), boost::lexical_cast<short>(split[1]), SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, deadline); else if (split.size() == 1) return asServer ? new FileStream(split[0].c_str()) : new FileStream(split[0].c_str(), 0666); else diff --git a/RTCP/Run/src/LOFAR/Parset.py b/RTCP/Run/src/LOFAR/Parset.py index 5f796b04d927c38f19f43676933aebd2965034be..e1e28958bbd60b96836726bdf473e50b19a71ec8 100644 --- a/RTCP/Run/src/LOFAR/Parset.py +++ b/RTCP/Run/src/LOFAR/Parset.py @@ -629,7 +629,7 @@ class Parset(util.Parset.Parset): # make sure that the remainder is easily factorisable for easier post-processing cnIntegrationSteps = forced_factors * increase_factors( int(round(nrSamplesPerSecond * cnIntegrationTime / forced_factors)) ) - cnIntegrationSteps = max(1, cnIntegrationSteps) + cnIntegrationSteps = max(forced_factors, cnIntegrationSteps) self.setdefault('OLAP.CNProc.integrationSteps', cnIntegrationSteps) @@ -819,7 +819,6 @@ class Parset(util.Parset.Parset): assert self.getNrOutputs() > 0, "No data output selected." assert len(self.stations) > 0, "No stations selected." assert len(self.getInt32Vector("Observation.subbandList")) > 0, "No subbands selected." - assert len(self.getInt32Vector("Observation.subbandList")) <= NRRSPBOARDS*NRBOARBEAMLETS, "More than %d subbands selected." % (NRRSPBOARDS*NRBOARBEAMLETS,) # phase 2 and 3 are either disjunct or equal assert self.phaseThreePsetDisjunct() or self.phaseTwoThreePsetEqual(), "Phase 2 and 3 should use either disjunct or the same psets." diff --git a/RTCP/Run/src/OLAP.parset b/RTCP/Run/src/OLAP.parset index 75cd4622476d0abb8928d1c6a088ce1856dd3243..2d586feaf842887921859515f83ca795fb8c427b 100644 --- a/RTCP/Run/src/OLAP.parset +++ b/RTCP/Run/src/OLAP.parset @@ -37,100 +37,100 @@ PIC.Core.CS007HBA0.clockCorrectionTime = 7.913020e-06 PIC.Core.CS007HBA1.clockCorrectionTime = 7.913260e-06 PIC.Core.CS007HBA.clockCorrectionTime = 7.913140e-06 +PIC.Core.CS001LBA.clockCorrectionTime = 4.309154e-06 +PIC.Core.CS001HBA0.clockCorrectionTime = 4.309154e-06 +PIC.Core.CS001HBA1.clockCorrectionTime = 4.309154e-06 +PIC.Core.CS001HBA.clockCorrectionTime = 4.309154e-06 + +PIC.Core.CS011LBA.clockCorrectionTime = 7.55795e-06 +PIC.Core.CS011HBA0.clockCorrectionTime = 7.55795e-06 +PIC.Core.CS011HBA1.clockCorrectionTime = 7.55795e-06 +PIC.Core.CS011HBA.clockCorrectionTime = 7.55795e-06 + +PIC.Core.CS013LBA.clockCorrectionTime = 1.639118e-05 +PIC.Core.CS013HBA0.clockCorrectionTime = 1.639118e-05 +PIC.Core.CS013HBA1.clockCorrectionTime = 1.639118e-05 +PIC.Core.CS013HBA.clockCorrectionTime = 1.639118e-05 + +PIC.Core.CS017LBA.clockCorrectionTime = 1.540943e-05 +PIC.Core.CS017HBA0.clockCorrectionTime = 1.540943e-05 +PIC.Core.CS017HBA1.clockCorrectionTime = 1.540943e-05 +PIC.Core.CS017HBA.clockCorrectionTime = 1.540943e-05 + +PIC.Core.CS021LBA.clockCorrectionTime = 1.829614e-05 +PIC.Core.CS021HBA0.clockCorrectionTime = 1.829614e-05 +PIC.Core.CS021HBA1.clockCorrectionTime = 1.829614e-05 +PIC.Core.CS021HBA.clockCorrectionTime = 1.829614e-05 + +PIC.Core.CS024LBA.clockCorrectionTime = 4.7597e-06 +PIC.Core.CS024HBA0.clockCorrectionTime = 4.7597e-06 +PIC.Core.CS024HBA1.clockCorrectionTime = 4.7597e-06 +PIC.Core.CS024HBA.clockCorrectionTime = 4.7597e-06 + +PIC.Core.CS026LBA.clockCorrectionTime = 1.619986e-05 +PIC.Core.CS026HBA0.clockCorrectionTime = 1.619986e-05 +PIC.Core.CS026HBA1.clockCorrectionTime = 1.619986e-05 +PIC.Core.CS026HBA.clockCorrectionTime = 1.619986e-05 + +PIC.Core.CS028LBA.clockCorrectionTime = 1.70614e-06 +PIC.Core.CS028HBA0.clockCorrectionTime = 1.70614e-06 +PIC.Core.CS028HBA1.clockCorrectionTime = 1.70614e-06 +PIC.Core.CS028HBA.clockCorrectionTime = 1.70614e-06 + +PIC.Core.CS030LBA.clockCorrectionTime = 9.7160576e-06 +PIC.Core.CS030HBA0.clockCorrectionTime = 9.7160576e-06 +PIC.Core.CS030HBA1.clockCorrectionTime = 9.7160576e-06 +PIC.Core.CS030HBA.clockCorrectionTime = 9.7160576e-06 + +PIC.Core.CS031LBA.clockCorrectionTime = 6.471391e-06 +PIC.Core.CS031HBA0.clockCorrectionTime = 6.471391e-06 +PIC.Core.CS031HBA1.clockCorrectionTime = 6.471391e-06 +PIC.Core.CS031HBA.clockCorrectionTime = 6.471391e-06 + +PIC.Core.CS032LBA.clockCorrectionTime = 8.546815e-06 +PIC.Core.CS032HBA0.clockCorrectionTime = 8.546815e-06 +PIC.Core.CS032HBA1.clockCorrectionTime = 8.546815e-06 +PIC.Core.CS032HBA.clockCorrectionTime = 8.546815e-06 + +PIC.Core.CS101LBA.clockCorrectionTime = 1.525453e-05 +PIC.Core.CS101HBA0.clockCorrectionTime = 1.525453e-05 +PIC.Core.CS101HBA1.clockCorrectionTime = 1.525453e-05 +PIC.Core.CS101HBA.clockCorrectionTime = 1.525453e-05 + +PIC.Core.CS103LBA.clockCorrectionTime = 3.560284e-05 +PIC.Core.CS103HBA0.clockCorrectionTime = 3.560284e-05 +PIC.Core.CS103HBA1.clockCorrectionTime = 3.560284e-05 +PIC.Core.CS103HBA.clockCorrectionTime = 3.560284e-05 + +PIC.Core.CS201LBA.clockCorrectionTime = 1.744858e-05 +PIC.Core.CS201HBA0.clockCorrectionTime = 1.744858e-05 +PIC.Core.CS201HBA1.clockCorrectionTime = 1.744858e-05 +PIC.Core.CS201HBA.clockCorrectionTime = 1.744858e-05 + +PIC.Core.CS301LBA.clockCorrectionTime = 7.687733e-06 +PIC.Core.CS301HBA0.clockCorrectionTime = 7.687733e-06 +PIC.Core.CS301HBA1.clockCorrectionTime = 7.687733e-06 +PIC.Core.CS301HBA.clockCorrectionTime = 7.687733e-06 + +PIC.Core.CS302LBA.clockCorrectionTime = 1.494415e-05 +PIC.Core.CS302HBA0.clockCorrectionTime = 1.494415e-05 +PIC.Core.CS302HBA1.clockCorrectionTime = 1.494415e-05 +PIC.Core.CS302HBA.clockCorrectionTime = 1.494415e-05 + PIC.Core.CS401LBA.clockCorrectionTime = 8.051870e-06 PIC.Core.CS401HBA0.clockCorrectionTime = 8.057504e-06 PIC.Core.CS401HBA1.clockCorrectionTime = 8.057770e-06 PIC.Core.CS401HBA.clockCorrectionTime = 8.057637e-06 +PIC.Core.CS501LBA.clockCorrectionTime = 1.65833e-05 +PIC.Core.CS501HBA0.clockCorrectionTime = 1.65833e-05 +PIC.Core.CS501HBA1.clockCorrectionTime = 1.65833e-05 +PIC.Core.CS501HBA.clockCorrectionTime = 1.65833e-05 + # -# Stations outside of the superterp (no correction needed) +# Stations outside of the core (no correction needed) # -PIC.Core.CS001LBA.clockCorrectionTime = 0 -PIC.Core.CS001HBA0.clockCorrectionTime = 0 -PIC.Core.CS001HBA1.clockCorrectionTime = 0 -PIC.Core.CS001HBA.clockCorrectionTime = 0 - -PIC.Core.CS011LBA.clockCorrectionTime = 0 -PIC.Core.CS011HBA.clockCorrectionTime = 0 -PIC.Core.CS011HBA0.clockCorrectionTime = 0 -PIC.Core.CS011HBA1.clockCorrectionTime = 0 - -PIC.Core.CS013LBA.clockCorrectionTime = 0 -PIC.Core.CS013HBA.clockCorrectionTime = 0 -PIC.Core.CS013HBA0.clockCorrectionTime = 0 -PIC.Core.CS013HBA1.clockCorrectionTime = 0 - -PIC.Core.CS017LBA.clockCorrectionTime = 0 -PIC.Core.CS017HBA0.clockCorrectionTime = 0 -PIC.Core.CS017HBA1.clockCorrectionTime = 0 -PIC.Core.CS017HBA.clockCorrectionTime = 0 - -PIC.Core.CS021LBA.clockCorrectionTime = 0 -PIC.Core.CS021HBA.clockCorrectionTime = 0 -PIC.Core.CS021HBA0.clockCorrectionTime = 0 -PIC.Core.CS021HBA1.clockCorrectionTime = 0 - -PIC.Core.CS024LBA.clockCorrectionTime = 0 -PIC.Core.CS024HBA0.clockCorrectionTime = 0 -PIC.Core.CS024HBA1.clockCorrectionTime = 0 -PIC.Core.CS024HBA.clockCorrectionTime = 0 - -PIC.Core.CS026LBA.clockCorrectionTime = 0 -PIC.Core.CS026HBA0.clockCorrectionTime = 0 -PIC.Core.CS026HBA1.clockCorrectionTime = 0 -PIC.Core.CS026HBA.clockCorrectionTime = 0 - -PIC.Core.CS028LBA.clockCorrectionTime = 0 -PIC.Core.CS028HBA.clockCorrectionTime = 0 -PIC.Core.CS028HBA0.clockCorrectionTime = 0 -PIC.Core.CS028HBA1.clockCorrectionTime = 0 - -PIC.Core.CS030LBA.clockCorrectionTime = 0 -PIC.Core.CS030HBA.clockCorrectionTime = 0 -PIC.Core.CS030HBA0.clockCorrectionTime = 0 -PIC.Core.CS030HBA1.clockCorrectionTime = 0 - -PIC.Core.CS031LBA.clockCorrectionTime = 0 -PIC.Core.CS031HBA.clockCorrectionTime = 0 -PIC.Core.CS031HBA0.clockCorrectionTime = 0 -PIC.Core.CS031HBA1.clockCorrectionTime = 0 - -PIC.Core.CS032LBA.clockCorrectionTime = 0 -PIC.Core.CS032HBA0.clockCorrectionTime = 0 -PIC.Core.CS032HBA1.clockCorrectionTime = 0 -PIC.Core.CS032HBA.clockCorrectionTime = 0 - -PIC.Core.CS101LBA.clockCorrectionTime = 0 -PIC.Core.CS101HBA0.clockCorrectionTime = 0 -PIC.Core.CS101HBA1.clockCorrectionTime = 0 -PIC.Core.CS101HBA.clockCorrectionTime = 0 - -PIC.Core.CS103LBA.clockCorrectionTime = 0 -PIC.Core.CS103HBA0.clockCorrectionTime = 0 -PIC.Core.CS103HBA1.clockCorrectionTime = 0 -PIC.Core.CS103HBA.clockCorrectionTime = 0 - -PIC.Core.CS201LBA.clockCorrectionTime = 0 -PIC.Core.CS201HBA0.clockCorrectionTime = 0 -PIC.Core.CS201HBA1.clockCorrectionTime = 0 -PIC.Core.CS201HBA.clockCorrectionTime = 0 - -PIC.Core.CS301LBA.clockCorrectionTime = 0 -PIC.Core.CS301HBA0.clockCorrectionTime = 0 -PIC.Core.CS301HBA1.clockCorrectionTime = 0 -PIC.Core.CS301HBA.clockCorrectionTime = 0 - -PIC.Core.CS302LBA.clockCorrectionTime = 0 -PIC.Core.CS302HBA0.clockCorrectionTime = 0 -PIC.Core.CS302HBA.clockCorrectionTime = 0 -PIC.Core.CS302HBA1.clockCorrectionTime = 0 - -PIC.Core.CS501LBA.clockCorrectionTime = 0 -PIC.Core.CS501HBA0.clockCorrectionTime = 0 -PIC.Core.CS501HBA1.clockCorrectionTime = 0 -PIC.Core.CS501HBA.clockCorrectionTime = 0 - PIC.Core.RS106LBA.clockCorrectionTime = 0 PIC.Core.RS106HBA.clockCorrectionTime = 0 @@ -140,6 +140,9 @@ PIC.Core.RS205HBA.clockCorrectionTime = 0 PIC.Core.RS208LBA.clockCorrectionTime = 0 PIC.Core.RS208HBA.clockCorrectionTime = 0 +PIC.Core.RS305LBA.clockCorrectionTime = 0 +PIC.Core.RS305HBA.clockCorrectionTime = 0 + PIC.Core.RS306LBA.clockCorrectionTime = 0 PIC.Core.RS306HBA.clockCorrectionTime = 0 @@ -303,6 +306,8 @@ PIC.Core.RS205LBA.phaseCenter = [3831438.563, 463435.440, 5061025.466] PIC.Core.RS205HBA.phaseCenter = [3831479.670, 463487.529, 5060989.903] PIC.Core.RS208LBA.phaseCenter = [3847810.051, 466929.706, 5048357.222] PIC.Core.RS208HBA.phaseCenter = [3847753.310, 466962.809, 5048397.244] +PIC.Core.RS305LBA.phaseCenter = [3828720.768, 454781.428, 5063851.101] +PIC.Core.RS305HBA.phaseCenter = [3828732.721, 454692.421, 5063850.334] PIC.Core.RS306LBA.phaseCenter = [3829791.808, 452829.848, 5063221.590] PIC.Core.RS306HBA.phaseCenter = [3829771.249, 452761.702, 5063243.181] PIC.Core.RS307LBA.phaseCenter = [3837940.949, 449560.756, 5057381.288] diff --git a/RTCP/Run/src/RSPConnections.dat b/RTCP/Run/src/RSPConnections.dat index 6c947e96f7b905e7fc5605c5f7a965a216686f0f..2db22bcc5a0f960ec9027d515a6fcafe8035d320 100644 --- a/RTCP/Run/src/RSPConnections.dat +++ b/RTCP/Run/src/RSPConnections.dat @@ -103,6 +103,8 @@ RS208 RSP_0 R00-M1-N08-J01 RS210 RSP_0 R00-M0-N14-J01 +RS305 RSP_0 R00-M0-N14-J00 + RS306 RSP_0 R00-M1-N14-J00 RS307 RSP_0 R00-M1-N15-J00 diff --git a/RTCP/Run/src/RTCP.parset b/RTCP/Run/src/RTCP.parset index ddd47f3c915b758ebd12afdbce56c01bad6eacf0..f5736b4a3ec1afa1207368e2e38f2f054a016d5a 100644 --- a/RTCP/Run/src/RTCP.parset +++ b/RTCP/Run/src/RTCP.parset @@ -8,7 +8,7 @@ Observation.Campaign.name = "Development" Observation.Campaign.title = "Development" # ----- Input streams -Observation.VirtualInstrument.stationList = [CS302] +Observation.VirtualInstrument.stationList = [S33] #Observation.antennaSet=LBA_INNER #Observation.antennaSet=LBA_OUTER #Observation.antennaSet=LBA_X @@ -35,7 +35,7 @@ OLAP.nrTimesInFrame = 16 # [ 2*(5*0) ] --> [ 0,0,0,0,0,0,0,0,0,0 ] Observation.subbandList = [100..159] Observation.sampleClock = 200 -OLAP.nrBitsPerSample = 16 +Observation.nrBitsPerSample = 16 # Observation.{beamList,rspBoardList,rspSlotList} are automatically derived from Observation.subbandList #Observation.beamList = [244*0] @@ -65,7 +65,7 @@ Observation.Beam[0].TiedArrayBeam[0].coherent = T #Observation.Beam[0].TiedArrayBeam[2].dispersionMeasure = 1.3 # ----- Output streams -OLAP.Storage.hosts = [locus080] +OLAP.Storage.hosts = [locus095] OLAP.Storage.targetDirectory = /data # will be appended with dirmask and filenammask Observation.DataProducts.Output_Beamformed.enabled = T diff --git a/RTCP/Run/src/locations.sh.in b/RTCP/Run/src/locations.sh.in index c3b571a966463cf12618b564555a9265c44fe961..2f67b87b50307adb8be12a8bbbe66fda973c5dbe 100644 --- a/RTCP/Run/src/locations.sh.in +++ b/RTCP/Run/src/locations.sh.in @@ -28,12 +28,14 @@ then STORAGE_HOME=/data/home/lofartest IONPROC_PARSET="/bghome0/lofarsys/parsets/T$OBSID.parset" + STORAGE_PARSET="/globalhome/lofartest/log/T$OBSID.parset" LOGPARAMS="-s `CEPlogProcessorSettings | awk '/test/ { print $2; }'`" else ISTESTENV=0 STORAGE_HOME=/data/home/lofarsys IONPROC_PARSET="/bghome0/lofarsys/parsets/L$OBSID.parset" + STORAGE_PARSET="/globalhome/lofarsystem/log/L$OBSID.parset" LOGPARAMS="-s `CEPlogProcessorSettings | awk '/production/ { print $2; }'`" fi @@ -42,12 +44,12 @@ then STORAGE=$STORAGE_HOME/production/lofar/bin/Storage_main LOGDIR=/localhome/log - RUNDIR=/globalhome/lofarsystem - LOGBACKUPDIR=/globalhome/lofarsystem/log-archive + RUNDIR=$HOME + LOGBACKUPDIR=$HOME/log-archive EXTRA_KEYS=" OLAP.Storage.userName = lofarsys -OLAP.Storage.sshIdentityFile = /globalhome/lofarsystem/.ssh/id_rsa +OLAP.Storage.sshIdentityFile = /root/.ssh/id_rsa.lofarsys OLAP.Storage.msWriter=$STORAGE OLAP.Storage.AntennaSetsConf = $STORAGE_HOME/production/lofar/etc/AntennaSets.conf OLAP.Storage.AntennaFieldsDir = $STORAGE_HOME/production/lofar/etc/StaticMetaData diff --git a/RTCP/Run/src/startBGL.sh b/RTCP/Run/src/startBGL.sh index cf291b7ae5fb71b6cc267d73f6bfd7f3b6685a36..1471af1d1f5ff23f805e39c5b7bae565c2af1158 100755 --- a/RTCP/Run/src/startBGL.sh +++ b/RTCP/Run/src/startBGL.sh @@ -25,8 +25,6 @@ date echo starting obs $OBSID echo "---------------" -STORAGE_PARSET=/opt/lofar/var/log/L$OBSID.parset - # Convert keys where needed /opt/lofar/bin/LOFAR/Parset.py -P $PARTITION $PARSET /opt/lofar/etc/OLAP.parset <(echo "$EXTRA_KEYS") > $IONPROC_PARSET && diff --git a/RTCP/Storage/include/Storage/InputThread.h b/RTCP/Storage/include/Storage/InputThread.h index 84bddd008d73fd49d626ade31de7c20e42b5aef3..587084b61e3dc124b2c11e02d6aaec5bb8be5ef8 100644 --- a/RTCP/Storage/include/Storage/InputThread.h +++ b/RTCP/Storage/include/Storage/InputThread.h @@ -53,6 +53,7 @@ class InputThread const std::string itsLogPrefix, itsInputDescriptor; Queue<SmartPtr<StreamableData> > &itsFreeQueue, &itsReceiveQueue; SmartPtr<Thread> itsThread; + const double itsDeadline; }; diff --git a/RTCP/Storage/src/InputThread.cc b/RTCP/Storage/src/InputThread.cc index 99b93758021f8cd53138c672513b3c1a18a43be2..dd3bd93e2b3616dd0681f0423cf8da0aa511cf41 100644 --- a/RTCP/Storage/src/InputThread.cc +++ b/RTCP/Storage/src/InputThread.cc @@ -39,7 +39,8 @@ InputThread::InputThread(const Parset &parset, OutputType outputType, unsigned s itsLogPrefix(logPrefix + "[InputThread] "), itsInputDescriptor(getStreamDescriptorBetweenIONandStorage(parset, outputType, streamNr)), itsFreeQueue(freeQueue), - itsReceiveQueue(receiveQueue) + itsReceiveQueue(receiveQueue), + itsDeadline(parset.stopTime()) { } @@ -61,7 +62,7 @@ void InputThread::mainLoop() { try { LOG_INFO_STR(itsLogPrefix << "Creating connection from " << itsInputDescriptor << "..." ); - SmartPtr<Stream> streamFromION(createStream(itsInputDescriptor, true)); + SmartPtr<Stream> streamFromION(createStream(itsInputDescriptor, true, itsDeadline)); LOG_INFO_STR(itsLogPrefix << "Creating connection from " << itsInputDescriptor << ": done" ); // limit reads from NullStream to 10 blocks; otherwise unlimited diff --git a/RTCP/Storage/src/MSWriterDAL.cc b/RTCP/Storage/src/MSWriterDAL.cc index f9130c7c87f9a8e10c0e302a0e3c1f285ebeb40c..4df1bdcf0287786ce34c4bc44ecad58f72cb274b 100644 --- a/RTCP/Storage/src/MSWriterDAL.cc +++ b/RTCP/Storage/src/MSWriterDAL.cc @@ -258,7 +258,9 @@ namespace LOFAR sap.expTimeEndUTC().value = toUTC(stopTime); sap.expTimeEndMJD().value = toMJD(stopTime); - sap.totalIntegrationTime().value = parset.beamDuration(sapNr); + // TODO: fix the system to use the parset.beamDuration(sapNr), but OLAP + // does not work that way yet (beamDuration is currently unsupported). + sap.totalIntegrationTime().value = nrBlocks * parset.CNintegrationTime(); sap.totalIntegrationTimeUnit().value = "s"; // TODO: non-J2000 pointings diff --git a/RTCP/Storage/src/Storage_main.cc b/RTCP/Storage/src/Storage_main.cc index 76843114fe879cd167da716905d32841ea785e90..7d297c13b079efdfdb6614a9968b93d6817576e1 100644 --- a/RTCP/Storage/src/Storage_main.cc +++ b/RTCP/Storage/src/Storage_main.cc @@ -32,6 +32,8 @@ #include <unistd.h> #include <cstdio> #include <cstdlib> +#include <cstring> +#include <libgen.h> #include <stdexcept> #include <string> @@ -116,13 +118,17 @@ char stdoutbuf[1024], stderrbuf[1024]; int main(int argc, char *argv[]) { #if defined HAVE_LOG4CPLUS - INIT_LOGGER(string(getenv("LOFARROOT") ? : ".") + "/etc/Storage_main.log_prop"); + char *dirc = strdup(argv[0]); + + INIT_LOGGER(string(getenv("LOFARROOT") ? : dirname(dirc)) + "/../etc/Storage_main.log_prop"); + + free(dirc); #elif defined HAVE_LOG4CXX #error LOG4CXX support is broken (nonsensical?) -- please fix this code if you want to use it Context::initialize(); setLevel("Global",8); #else - INIT_LOGGER_WITH_SYSINFO(str(boost::format("Storage@%02d") % (argc > 1 ? atoi(argv[1]) : -1))); + INIT_LOGGER_WITH_SYSINFO(str(boost::format("Storage@%02d") % (argc > 2 ? atoi(argv[2]) : -1))); #endif CasaLogSink::attach(); diff --git a/RTCP/Storage/src/TBB_Writer_main.cc b/RTCP/Storage/src/TBB_Writer_main.cc index 2cc1e72f66c2b688818c56edef0324e1f5be8da5..a7dc45e498c504885623da5d32623d3ce2b5ff41 100644 --- a/RTCP/Storage/src/TBB_Writer_main.cc +++ b/RTCP/Storage/src/TBB_Writer_main.cc @@ -39,6 +39,7 @@ #include <csignal> #include <cstring> #include <cerrno> +#include <libgen.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> @@ -449,7 +450,11 @@ int main(int argc, char* argv[]) { setvbuf(stderr, stderrbuf, _IOLBF, sizeof stderrbuf); #if defined HAVE_LOG4CPLUS - INIT_LOGGER(string(getenv("LOFARROOT") ? : ".") + "/etc/Storage_main.log_prop"); + char *dirc = strdup(argv[0]); + + INIT_LOGGER(string(getenv("LOFARROOT") ? : dirname(dirc)) + "/../etc/TBB_Writer_main.log_prop"); + + free(dirc); #endif if ((err = parseArgs(argc, argv, &args)) != 0) { diff --git a/RTCP/Storage/src/TBB_Writer_main.log_prop b/RTCP/Storage/src/TBB_Writer_main.log_prop new file mode 100644 index 0000000000000000000000000000000000000000..3d46179d269ba4b755029cce75af58c2e416468f --- /dev/null +++ b/RTCP/Storage/src/TBB_Writer_main.log_prop @@ -0,0 +1,29 @@ + +# Configure the loggers +log4cplus.rootLogger=INFO, STDOUT +log4cplus.logger.TRC=INFO + +# prevent debug messages: accept >=WARN only, and don't forward messages to the rootLogger +log4cplus.logger.LCS.ApplCommon=WARN, STDOUT +log4cplus.additivity.LCS.ApplCommon=false +log4cplus.logger.LCS.MSLofar=WARN, STDOUT +log4cplus.additivity.LCS.MSLofar=false + +# Define the appenders +log4cplus.appender.STDOUT=log4cplus::ConsoleAppender +log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout +log4cplus.appender.STDOUT.layout.ConversionPattern=%x %D{%d-%m-%y %H:%M:%S.%q} %-5p %m%n + +#log4cplus.appender.STDERR=log4cplus::ConsoleAppender +#log4cplus.appender.STDERR.layout=log4cplus::PatternLayout +#log4cplus.appender.STDERR.layout.ConversionPattern=%x %D{%d-%m-%y %H:%M:%S.%q} %-5p %c{3} - %m [%.25l]%n +#log4cplus.appender.STDERR.logToStdErr=true + +#log4cplus.appender.FILE=log4cplus::RollingFileAppender +#log4cplus.appender.FILE.File=${LOG4CPLUS_LOGFILENAME}.log +#log4cplus.appender.FILE.MaxFileSize=10MB +#log4cplus.appender.FILE.MaxBackupIndex=2 +#log4cplus.appender.FILE.layout=log4cplus::PatternLayout +#log4cplus.appender.FILE.layout.ConversionPattern=%x %D{%d-%m-%y %H:%M:%S.%q} %-5p %c{3} - %m [%.25l]%n + +log4cplus.appender.DUMP=log4cplus::NullAppender diff --git a/RTCP/Storage/test/tMSWriterDAL.parset b/RTCP/Storage/test/tMSWriterDAL.parset index d01a79579b675fc243bb2396ed439360844f838e..9c742a9031538bdd05cfb23e12b8892a9a8923ad 100644 --- a/RTCP/Storage/test/tMSWriterDAL.parset +++ b/RTCP/Storage/test/tMSWriterDAL.parset @@ -47,7 +47,7 @@ OLAP.correctClocks = T OLAP.delayCompensation = T OLAP.dispersionMeasure = 0 OLAP.maxNetworkDelay = 0.5 -OLAP.nrBitsPerSample = 16 +Observation.nrBitsPerSample = 16 OLAP.nrPsets = 4 OLAP.nrSecondsOfBuffer = 2.5 OLAP.nrTimesInFrame = 16 diff --git a/RTCP/Storage/test/tMeasurementSetFormat.parset-j2000 b/RTCP/Storage/test/tMeasurementSetFormat.parset-j2000 index 4b18640835c1e8f55cb96b4c4e96f8968ab8f14e..d006e100dce89446a5a317e2b462c42ef9e2f06a 100644 --- a/RTCP/Storage/test/tMeasurementSetFormat.parset-j2000 +++ b/RTCP/Storage/test/tMeasurementSetFormat.parset-j2000 @@ -92,7 +92,7 @@ OLAP.correctClocks = T OLAP.delayCompensation = true OLAP.dispersionMeasure = 0 OLAP.maxNetworkDelay = 0.25 -OLAP.nrBitsPerSample = 16 +Observation.nrBitsPerSample = 16 OLAP.nrPencils = 1 OLAP.nrPsets = 64 OLAP.nrSecondsOfBuffer = 2.5 @@ -227,7 +227,7 @@ Observation.ObservationControl.OnlineControl.OLAP.StorageProc.subbandsPerMS = 1 Observation.ObservationControl.OnlineControl.OLAP.correctBandPass = true Observation.ObservationControl.OnlineControl.OLAP.delayCompensation = true Observation.ObservationControl.OnlineControl.OLAP.maxNetworkDelay = 0.25 -Observation.ObservationControl.OnlineControl.OLAP.nrBitsPerSample = 16 +Observation.ObservationControl.OnlineControl.Observation.nrBitsPerSample = 16 Observation.ObservationControl.OnlineControl.OLAP.nrPencils = 1 Observation.ObservationControl.OnlineControl.OLAP.nrSecondsOfBuffer = 2.5 Observation.ObservationControl.OnlineControl.OLAP.nrSubbandsPerFrame = 61 diff --git a/RTCP/Storage/test/tMeasurementSetFormat.parset-sun b/RTCP/Storage/test/tMeasurementSetFormat.parset-sun index 8e8bd1da6cbf7640f7cb2e763e906533fee9c86c..68f04a45b1e6995ba91e41218c2f38c88ec8a8e7 100644 --- a/RTCP/Storage/test/tMeasurementSetFormat.parset-sun +++ b/RTCP/Storage/test/tMeasurementSetFormat.parset-sun @@ -92,7 +92,7 @@ OLAP.correctClocks = T OLAP.delayCompensation = true OLAP.dispersionMeasure = 0 OLAP.maxNetworkDelay = 0.25 -OLAP.nrBitsPerSample = 16 +Observation.nrBitsPerSample = 16 OLAP.nrPencils = 1 OLAP.nrPsets = 64 OLAP.nrSecondsOfBuffer = 2.5 @@ -227,7 +227,7 @@ Observation.ObservationControl.OnlineControl.OLAP.StorageProc.subbandsPerMS = 1 Observation.ObservationControl.OnlineControl.OLAP.correctBandPass = true Observation.ObservationControl.OnlineControl.OLAP.delayCompensation = true Observation.ObservationControl.OnlineControl.OLAP.maxNetworkDelay = 0.25 -Observation.ObservationControl.OnlineControl.OLAP.nrBitsPerSample = 16 +Observation.ObservationControl.OnlineControl.Observation.nrBitsPerSample = 16 Observation.ObservationControl.OnlineControl.OLAP.nrPencils = 1 Observation.ObservationControl.OnlineControl.OLAP.nrSecondsOfBuffer = 2.5 Observation.ObservationControl.OnlineControl.OLAP.nrSubbandsPerFrame = 61 diff --git a/RTCP/Storage/test/tTBB_Writer.parset b/RTCP/Storage/test/tTBB_Writer.parset index 8752001f41a176314930a00a992c6e27fce0b85b..243271c26488d909ed3d7554d3249e0ad75c62b0 100644 --- a/RTCP/Storage/test/tTBB_Writer.parset +++ b/RTCP/Storage/test/tTBB_Writer.parset @@ -73,7 +73,7 @@ OLAP.correctClocks = T OLAP.delayCompensation = true OLAP.dispersionMeasure = 0 OLAP.maxNetworkDelay = 0.25 -OLAP.nrBitsPerSample = 16 +Observation.nrBitsPerSample = 16 OLAP.nrPsets = 64 OLAP.nrSecondsOfBuffer = 2.5 OLAP.nrSubbandsPerFrame = 61 @@ -370,7 +370,7 @@ Observation.ObservationControl.OnlineControl.OLAP.coherentDedisperseChannels = f Observation.ObservationControl.OnlineControl.OLAP.correctBandPass = true Observation.ObservationControl.OnlineControl.OLAP.delayCompensation = true Observation.ObservationControl.OnlineControl.OLAP.maxNetworkDelay = 0.25 -Observation.ObservationControl.OnlineControl.OLAP.nrBitsPerSample = 16 +Observation.ObservationControl.OnlineControl.Observation.nrBitsPerSample = 16 Observation.ObservationControl.OnlineControl.OLAP.nrSecondsOfBuffer = 2.5 Observation.ObservationControl.OnlineControl.OLAP.nrSubbandsPerFrame = 61 Observation.ObservationControl.OnlineControl.OLAP.nrTimesInFrame = 16 diff --git a/SAS/Beaminfo/CMakeLists.txt b/SAS/Beaminfo/CMakeLists.txt index bf0a8a6f7610aedb12e7178eb4dea6df6e71f2c3..c5ff1b776f0dfaca4d3e101058947e0f90469e4d 100644 --- a/SAS/Beaminfo/CMakeLists.txt +++ b/SAS/Beaminfo/CMakeLists.txt @@ -1,11 +1,10 @@ # $Id: CMakeLists.txt 16887 2011-09-20 10:46:43Z duscha $ -lofar_package(Beaminfo 0.1 DEPENDS Common ApplCommon MSLofar OTDB) +lofar_package(Beaminfo 0.1 DEPENDS Common ApplCommon OTDB) include(LofarFindPackage) -lofar_find_package(Casacore COMPONENTS casa ms tables REQUIRED) lofar_find_package(Boost COMPONENTS date_time REQUIRED) -add_subdirectory(include/Beaminfo) +#add_subdirectory(include/Beaminfo) add_subdirectory(src) add_subdirectory(test) diff --git a/SAS/Beaminfo/src/CMakeLists.txt b/SAS/Beaminfo/src/CMakeLists.txt index 0b761afc65030227c781e76c8b4e8af47ddebf9a..f8f70b55cfa720c94a8190854d22054c5af1260e 100644 --- a/SAS/Beaminfo/src/CMakeLists.txt +++ b/SAS/Beaminfo/src/CMakeLists.txt @@ -3,21 +3,8 @@ include(LofarPackageVersion) #include(PythonInstall) -set(beaminfo_LIB_SRCS - FailedTileInfo -) - -#set(beaminfo_PROGRAMS -# failedtilesinfo -# failedtiles2ms -#) - -#lofar_add_library(beaminfo ${beaminfo_LIB_SRCS}) - lofar_add_bin_program(failedtilesinfo failedtilesinfo.cc) -lofar_add_bin_program(failedtiles2ms failedtiles2ms.cc FailedTileInfo.cc) -#install(PROGRAMS -# failedtilesinfo -# failedtiles2ms -#DESTINATION bin) +install(PROGRAMS + failedtilesinfo +DESTINATION bin) diff --git a/SAS/Beaminfo/src/FailedTileInfo.cc b/SAS/Beaminfo/src/FailedTileInfo.cc index 87aac6c25a702be2f0314dd0ae928909adb178fb..7ae878dc5ca2d703539a5784cc47c8dc030edd51 100644 --- a/SAS/Beaminfo/src/FailedTileInfo.cc +++ b/SAS/Beaminfo/src/FailedTileInfo.cc @@ -162,7 +162,7 @@ namespace LOFAR { flagCol.put (row, flags); } // Now loop through all entries for the tiles broken during the obs. - // Add them to vectors if its flag is not set yet. + // Add to a vector if its flag is not set yet. for (FailedTileInfo::VectorFailed::const_iterator iter = brokenDuring[antId].begin(); iter != brokenDuring[antId].end(); ++iter) { diff --git a/SAS/Beaminfo/src/failedtilesinfo.cc b/SAS/Beaminfo/src/failedtilesinfo.cc index 0cf53b1d5c99db1810e0309c0f5c2a3a79b902a2..4e5750ec447f1ad5c5861af63992cefb5a28b0c6 100644 --- a/SAS/Beaminfo/src/failedtilesinfo.cc +++ b/SAS/Beaminfo/src/failedtilesinfo.cc @@ -27,8 +27,8 @@ #include <Common/ParameterSet.h> #include <Common/LofarLogger.h> #include <Common/SystemUtil.h> // needed for basename +#include <Common/StringUtil.h> // needed for split #include <Common/Exception.h> // THROW macro for exceptions -#include <ApplCommon/LofarDirs.h> // SAS #include <OTDB/OTDBconstants.h> @@ -56,241 +56,164 @@ using namespace casa; Exception::TerminateHandler t(Exception::terminate); // Time converter helper functions -string fromCasaTime (const MEpoch& epoch, double addDays); -MVEpoch toCasaTime(const string &time); -bool checkTime(const MVEpoch &starttime, const MVEpoch &endtime); +MVEpoch toCasaTime (const string& time); +string fromCasaTime (const MVEpoch& epoch); -void getFailedTilesInfo(OTDBconnection &conn, - const string &filename, - const MVEpoch &timeStart, - const MVEpoch &timeEnd=0); -string stripRCUString(const string &brokenHardware); +// Get the failed tile info before the given date (if end=0) +// or between the dates. +void getFailedTilesInfo(OTDBconnection& conn, + const string& filename, + const string& timeStart, + const string& timeEnd=string()); -//---------------------------------------------------------------------------------- -void usage(char *programname) -{ - cout << "Usage: " << programname << " <options>" << endl; - cout << "-d run in debug mode" << endl; - cout << "-p <filename> read parset (instead of default: failedtilesinfo.parset)" << endl; - cout << "-s <time> start time of observation in MS like 3-Mar-2011/13:54:23"<< endl; - cout << "-e <time> end time of observation in MS"<< endl; - cout << "-v turn on verbose mode" << endl; - cout << "-h show this help info" << endl; - - exit(0); -} - -// These two flags are global so that every function can act accordingly -bool debug=false; // debug mode -bool verbose=false; // verbose mode int main (int argc, char* argv[]) { - int opt=0; // argument parsing, current option - vector<MEpoch> failingTimes; - - string parsetName="failedtilesinfo.parset"; // parset location (default) - string starttimeString, endtimeString; // strings to get start and end time - MVEpoch startTime, endTime; // starttime and endtime of observation - - //--------------------------------------------- // Init logger string progName = LOFAR::basename(argv[0]); INIT_LOGGER(progName); - - // Parse command line arguments TODO! - while(opt != -1) - { - opt = getopt( argc, argv, "dp:s:e:vh"); - switch(opt) - { - case 'd': - debug=true; - break; - case 'p': // location of parset file - parsetName=optarg; - break; - case 's': // start time - starttimeString=optarg; - case 'e': // end time - endtimeString=optarg; - case 'v': // turn on verbose display of messages - verbose=true; - break; - case 'h': - usage(argv[0]); - break; - case ':': - cout << "Option " << opt << " is missing an argument" << endl; - usage(argv[0]); - break; - default: - break; - } - } - - // Parse parset entries - try - { - if(verbose) - { - LOG_INFO_STR("Reading parset: " << parsetName); + try { + // Get the parset name; use default if not given as first argument. + string parsetName = "failedtilesinfo.parset"; + if (argc > 1) { + parsetName = argv[1]; } - - //--------------------------------------------------------------------- ParameterSet parset(parsetName); - //string host = parset.getString("host", "sas.control.lofar.eu"); // production - string host = parset.getString("host", "RS005.astron.nl"); // DEBUG - string db = parset.getString("db", "TESTLOFAR_3"); + // Get the parameters. + ///string host = parset.getString("host", "sas.control.lofar.eu"); + string host = parset.getString("host", "RS005.astron.nl"); + string db = parset.getString("db", "TESTLOFAR_4"); string user = parset.getString("user", "paulus"); string password = parset.getString("password", "boskabouter"); string port = parset.getString("port", "5432"); - // Locations to save SAS hardware strings of broken and failed tiles to - string failedfilename = parset.getString("failedTilesFile", LOFAR_SHARE_LOCATION "/failedTiles.txt"); - string brokenfilename = parset.getString("brokenTilesFile", LOFAR_SHARE_LOCATION "/brokenTiles.txt"); - - //--------------------------------------------------------------------- - // Handle observation starttime and endtime - if(starttimeString.empty()) // if we didn't get the start time from the command arguments - { - starttimeString = parset.getString("StartTime", ""); - } - if(endtimeString.empty()) // if we didn't get the end time from the command arguments - { - endtimeString = parset.getString("EndTime", ""); - } - startTime=toCasaTime(starttimeString); - endTime=toCasaTime(endtimeString); - if(checkTime(startTime, endTime) != true) - { - THROW(Exception, "starttime >= endtime: " << starttimeString << " >= " << endtimeString); + // Files to save SAS hardware strings of broken and failed tiles. + // Failed means tiles failing during the observations. + // Broken means tiles already broken at the start of the observation. + string failedfilename = parset.getString("FailedTilesFile", + "failedTiles.txt"); + string brokenfilename = parset.getString("BrokenTilesFile", + "brokenTiles.txt"); + string startTimeString = parset.getString("StartTime", ""); + string endTimeString = parset.getString("EndTime", ""); + ASSERT (!(failedfilename.empty() || brokenfilename.empty())); + ASSERT (!(startTimeString.empty() || endTimeString.empty())); + MVEpoch startTime = toCasaTime(startTimeString); + MVEpoch endTime = toCasaTime(endTimeString); + if (startTime.get() > endTime.get()) { + THROW(Exception, "starttime " << startTimeString + << " must be <= end time " << endTimeString); } + // Convert to time format (ISO) that Boost understands. + startTimeString = fromCasaTime(startTime); + endTimeString = fromCasaTime(endTime); - LOG_INFO_STR("Getting SAS antenna health information"); + LOG_DEBUG_STR("Getting SAS antenna health information"); OTDBconnection conn(user, password, db, host, port); - LOG_INFO("Trying to connect to the database"); + LOG_DEBUG("Trying to connect to the database"); ASSERTSTR(conn.connect(), "Connnection failed"); - LOG_INFO_STR("Connection succesful: " << conn); - + LOG_DEBUG_STR("Connection succesful: " << conn); // Get broken hardware strings from SAS - getFailedTilesInfo(conn, brokenfilename, startTime); - getFailedTilesInfo(conn, failedfilename, startTime, endTime); - } - catch (Exception& x) - { + getFailedTilesInfo (conn, brokenfilename, startTimeString); + getFailedTilesInfo (conn, failedfilename, startTimeString, endTimeString); + + } catch (Exception& x) { LOG_FATAL_STR("Unexpected exception: " << x); return 1; } - - LOG_INFO_STR ("Terminated succesfully: " << argv[0]); return 0; } -/*! - \brief Convert casa epoch to posix time - \param epoch casa epoch - \param addDays add days (default=0) - \return dateTime string with date and time in the format ("YYYY-MM-DD HH:MM:SS") -*/ -string fromCasaTime (const MVEpoch& epoch, double addDays=0) -{ - MVTime t (epoch.get() + addDays); - return t.getTime().ISODate(); -} - -// Convert a time string time YYYY-Mon-DD TT:MM:SS.ss to a CASA MVEpoch -MVEpoch toCasaTime(const string &time) +// Convert a casacore time string time YYYY-Mon-DD TT:MM:SS.ss to an MVEpoch +MVEpoch toCasaTime (const string& time) { // e.g. 2011-Mar-19 21:17:06.514000 - Double casaTime; // casa MVEpoch time to be returned + Double casaTime; // casacore MVEpoch time to be returned Quantity result(casaTime, "s"); // set quantity unit to seconds - ASSERT(!time.empty()); MVTime::read(result, time); - return result; } -bool checkTime(const MVEpoch &starttimeCasa, const MVEpoch &endtimeCasa) +string fromCasaTime (const MVEpoch& epoch) { - return(starttimeCasa.get() < endtimeCasa.get()); + MVTime t (epoch.get()); + return t.getTime().ISODate(); } + // Get information about broken tiles from SAS database and store it in // an ASCII text file -// -void getFailedTilesInfo(OTDBconnection &conn, - const string &filename, - const MVEpoch &timeStart, - const MVEpoch &timeEnd) +void getFailedTilesInfo (OTDBconnection& conn, + const string& filename, + const string& timeStart, + const string& timeEnd) { - ASSERT(!filename.empty()); - + // Get OTDB info. TreeTypeConv TTconv(&conn); // TreeType converter object - ClassifConv CTconv(&conn); // converter I don't know - vector<OTDBvalue> valueList; // OTDB value list for the previous month - + ClassifConv CTconv(&conn); // converter + vector<OTDBvalue> valueList; // OTDB value list + vector<OTDBtree> treeList = conn.getTreeList(TTconv.get("hardware"), + CTconv.get("operational")); + ASSERTSTR(treeList.size(), "No hardware tree found, run tPICtree first"); + treeIDType treeID = treeList[treeList.size()-1].treeID(); + LOG_DEBUG_STR ("Using tree " << treeID); + OTDBtree treeInfo = conn.getTreeInfo(treeID); + LOG_DEBUG_STR(treeInfo); + LOG_DEBUG("Constructing a TreeValue object"); + TreeValue tv(&conn, treeID); + // Create the output file. fstream outfile; - outfile.open(filename.c_str(), ios::out); // this shows the correct behaviour of overwriting the file + outfile.open(filename.c_str(), ios::out); // Get list of all broken hardware from SAS for timestamp - LOG_INFO("Searching for a Hardware tree"); - vector<OTDBtree> treeList = conn.getTreeList(TTconv.get("hardware"), CTconv.get("operational")); - // showTreeList(treeList); - ASSERTSTR(treeList.size(),"No hardware tree found, run tPICtree first"); - treeIDType treeID = treeList[treeList.size()-1].treeID(); - LOG_INFO_STR ("Using tree " << treeID << " for the tests"); - OTDBtree treeInfo = conn.getTreeInfo(treeID); - LOG_INFO_STR(treeInfo); - LOG_INFO("Trying to construct a TreeValue object"); - TreeValue tv(&conn, treeID); - - if(timeEnd==0) // getting tiles broken at beginning - { - valueList = tv.getBrokenHardware(time_from_string(fromCasaTime(timeStart))); - } - else // getting tiles failed during observation - { - LOG_INFO_STR("Getting failed hardware from " << MVTime(timeStart.get()).getTime().ISODate() - << " to " << MVTime(timeEnd.get()).getTime().ISODate()); - valueList = tv.getFailedHardware(time_from_string(fromCasaTime(timeStart)), - time_from_string(fromCasaTime(timeEnd))); + LOG_DEBUG("Searching for a Hardware tree"); + + if (timeEnd.empty()) { + // Getting tiles broken at beginning. + valueList = tv.getBrokenHardware (time_from_string(timeStart)); + } else { + // Getting tiles failed during observation. + LOG_INFO_STR ("Getting failed hardware from " + << timeStart << " to " << timeEnd); + valueList = tv.getBrokenHardware (time_from_string(timeStart), + time_from_string(timeEnd)); } - if(valueList.empty()) - { - LOG_INFO_STR("No failed hardware found."); - } - else - { - // Now write entry in valuelist with broken hardware to file - for(unsigned int i=0; i<valueList.size(); i++) - { - if(valueList[i].name.find("RCU")!=string::npos) // Only write lines that contain RCU - { - outfile << stripRCUString(valueList[i].name) << "\t" << valueList[i].time << endl; - } - } + if (valueList.empty()) { + LOG_INFO_STR ("No failed hardware found."); + } else { + // Write entry in valuelist with broken hardware to file. + // A broken antenna element/tile entry must contain .status_state + int nrtile = 0; + int nrrcu = 0; + for (unsigned int i=0; i<valueList.size(); i++) { + if (valueList[i].name.find(".status_state") != string::npos) { + vector<string> parts = StringUtil::split (valueList[i].name, '.'); + bool match = false; + if (parts.size() > 4 && parts[4].size() > 3) { + // parts[3] is station name; parts[4] is tile name/number + string type = parts[4].substr(0,3); + if (type == "LBA" || type == "HBA") { + outfile << parts[3] + ' ' + parts[4] << ' ' + << valueList[i].time << endl; + nrtile++; + match = true; + } + } + if (!match && parts.size() > 7 && parts[7].size() > 3) { + // parts[3] is station name; parts[7] is RCU name/number + string type = parts[7].substr(0,3); + if (type == "RCU") { + outfile << parts[3] + ' ' + parts[7] << ' ' + << valueList[i].time << endl; + nrrcu++; + } + } + } + } + LOG_INFO_STR ("Found " << nrtile << " broken tiles and " + << nrrcu << " broken rcus"); } outfile.close(); } - -// Strip the RCU string in broken hardware of unnecessary information -string stripRCUString(const string &brokenHardware) -{ - string stripped; // stripped broken hardware line - vector<string> tokens; - - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep("."); - tokenizer tok(brokenHardware, sep); - - for(tokenizer::iterator beg=tok.begin(); beg!=tok.end();++beg) - { - tokens.push_back(*beg); - } - stripped=tokens[3].append(".").append(tokens[7]).append("."); - - return stripped; -} diff --git a/SAS/Beaminfo/test/CMakeLists.txt b/SAS/Beaminfo/test/CMakeLists.txt index ce0c68cf2b242a47732b24c5034b06d1f4af556d..050a537718b4bf006308d469bca12d401cda485b 100644 --- a/SAS/Beaminfo/test/CMakeLists.txt +++ b/SAS/Beaminfo/test/CMakeLists.txt @@ -2,21 +2,4 @@ include(LofarCTest) -# Create symbolic links to scripts used by the tmakems test program. -get_target_property(_loc getparsetvalue LOCATION) -execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - ${_loc} - ${CMAKE_CURRENT_BINARY_DIR}/getparsetvalue) -get_target_property(_loc finddproc LOCATION) -execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - ${_loc} - ${CMAKE_CURRENT_BINARY_DIR}/finddproc) -execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - ${LMWCommon_SOURCE_DIR}/src/startdistproc - ${CMAKE_CURRENT_BINARY_DIR}/startdistproc) -execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - ${LMWCommon_SOURCE_DIR}/src/socketrun - ${CMAKE_CURRENT_BINARY_DIR}/socketrun) - -#lofar_add_test(tMSSplit tMSSplit.cc) -#lofar_add_test(tcombinevds DEPENDS combinevds) +lofar_add_test(tfailedtilesinfo) diff --git a/SAS/Beaminfo/test/failedtilesinfo.parset b/SAS/Beaminfo/test/failedtilesinfo.parset index 5344347aa63491529bcba6518bd0dbdc370750a8..2368095394630e282f31915cf20e91278768a282 100644 --- a/SAS/Beaminfo/test/failedtilesinfo.parset +++ b/SAS/Beaminfo/test/failedtilesinfo.parset @@ -1,9 +1,7 @@ -#ms = /Users/duscha/Cluster/L2011_24380/L24380_SB030_uv.MS.dppp.dppp -ms = /tmp/joined.MS StartTime = 2011/05/15/16:59:08.0 EndTime = 2011/05/21/22:59:06.0 -# brokenTilesFile = -# failedTilesFile = +BrokenTilesFile = brokenTilesFile +FailedTilesFile = failedTilesFile +host = RS005.astron.nl +db = TESTLOFAR_4 port = 5432 -overwrite = T - diff --git a/SAS/Beaminfo/test/tfailedtilesinfo.run b/SAS/Beaminfo/test/tfailedtilesinfo.run new file mode 100755 index 0000000000000000000000000000000000000000..364091d176a5546561ea7764c27596bde790e452 --- /dev/null +++ b/SAS/Beaminfo/test/tfailedtilesinfo.run @@ -0,0 +1,26 @@ +#!/bin/sh + +# Exit with skipped status if unable to reach RS005. +ping -c 1 RS005.astron.nl > /dev/null 2>&1 || exit 3 + +# Create the parset for this test. +# The start and end times have to match those in the SAS data base. +cat > tfailedtilesinfo_tmp.parset <<EOF +StartTime = 2011/05/15/16:59:08.0 +EndTime = 2012/10/21/22:59:06.0 +BrokenTilesFile = tfailedtilesinfo_tmp.before +FailedTilesFile = tfailedtilesinfo_tmp.during +host = RS005.astron.nl +db = TESTLOFAR_4 +port = 5432 +EOF + +# Get the failed tile info. +../src/failedtilesinfo tfailedtilesinfo_tmp.parset + +# Print the output, so it will be compared by assay. +echo "Failed before:" +cat tfailedtilesinfo_tmp.before +echo +echo "Failed during:" +cat tfailedtilesinfo_tmp.during diff --git a/SAS/Beaminfo/test/tfailedtilesinfo.sh b/SAS/Beaminfo/test/tfailedtilesinfo.sh new file mode 100755 index 0000000000000000000000000000000000000000..d5a38db60d63cdc60500ddde63109f1bc14a8021 --- /dev/null +++ b/SAS/Beaminfo/test/tfailedtilesinfo.sh @@ -0,0 +1,2 @@ +#!/bin/sh +./runctest.sh tfailedtilesinfo 2>&1 > tfailedtilesinfo.log diff --git a/SAS/Beaminfo/test/tfailedtilesinfo.stdout b/SAS/Beaminfo/test/tfailedtilesinfo.stdout new file mode 100644 index 0000000000000000000000000000000000000000..25fe487c72d055242cf4ffdcb3bd54845a91dd0d --- /dev/null +++ b/SAS/Beaminfo/test/tfailedtilesinfo.stdout @@ -0,0 +1,29 @@ +Failed before: +CS013.RCU86. 2011-Mar-04 09:56:05.496000 +CS026.RCU58. 2011-Mar-04 09:55:54.096000 +CS026.RCU59. 2011-Mar-04 09:56:05.496000 +CS026.RCU69. 2011-Mar-04 09:55:34.239000 +RS208.RCU53. 2011-Mar-04 12:16:54.317000 +RS208.RCU54. 2011-Mar-04 12:17:06.514000 +RS208.RCU59. 2011-Mar-04 11:08:15.719000 +RS208.RCU60. 2011-Mar-04 11:08:27.322000 +RS208.RCU67. 2011-Mar-04 12:18:17.987000 +RS208.RCU68. 2011-Mar-04 12:18:29.275000 +RS503.RCU55. 2011-Mar-04 12:00:36.614000 +RS503.RCU56. 2011-Mar-04 12:01:25.298000 +RS503.RCU57. 2011-Mar-04 12:24:49.665000 +RS503.RCU58. 2011-Mar-04 12:01:37.782000 +RS503.RCU65. 2011-Mar-04 12:01:51.709000 +RS503.RCU66. 2011-Mar-04 12:01:59.900000 +RS503.RCU79. 2011-Mar-04 12:25:22.066000 +RS503.RCU80. 2011-Mar-04 12:02:53.574000 +RS503.RCU85. 2011-Mar-04 12:02:25.409000 +RS503.RCU86. 2011-Mar-04 12:25:57.172000 +RS503.RCU95. 2011-Mar-04 12:03:44.517000 + +Failed during: +CS003.RCU94. 2011-May-19 21:33:33.010000 +RS106.RCU18. 2011-May-19 22:59:05.500000 +CS101.RCU66. 2011-May-20 10:00:05 +RS106.RCU0. 2011-May-20 10:00:05 +CS001.RCU0. 2011-May-20 17:24:56.115000 diff --git a/SAS/OTB/OTB-distribution/assembly.xml b/SAS/OTB/OTB-distribution/assembly.xml index 65edb36671ada34a98376a7e4cabaebbeb32b468..100415d7b4646e95287a332a89cbd689059284e5 100644 --- a/SAS/OTB/OTB-distribution/assembly.xml +++ b/SAS/OTB/OTB-distribution/assembly.xml @@ -1,33 +1,33 @@ -<assembly - xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> - - <id>distribution</id> - - <formats> - <format>tar.gz</format> - </formats> - - <fileSets> - - <fileSet> - <directory>${project.build.directory}/dependency/jOTDB3-1.0.1-SNAPSHOT</directory> - <outputDirectory>server</outputDirectory> - <includes> - <include>**/*</include> - </includes> - </fileSet> - - <fileSet> - <directory>${project.build.directory}/dependency/OTB-1.0.1-SNAPSHOT</directory> - <outputDirectory>client</outputDirectory> - <includes> - <include>**/*</include> - </includes> - </fileSet> - - </fileSets> - - +<assembly + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> + + <id>distribution</id> + + <formats> + <format>tar.gz</format> + </formats> + + <fileSets> + + <fileSet> + <directory>${project.build.directory}/dependency/jOTDB3-${project.version}</directory> + <outputDirectory>server</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + + <fileSet> + <directory>${project.build.directory}/dependency/OTB-${project.version}</directory> + <outputDirectory>client</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + + </fileSets> + + </assembly> \ No newline at end of file diff --git a/SAS/OTB/OTB-distribution/pom.xml b/SAS/OTB/OTB-distribution/pom.xml index 9cbaf8f7831739c1d42926dbc54d8c2fdfa97ef8..ef7035b7c161746c747cf47f820bfcd47bc1a385 100644 --- a/SAS/OTB/OTB-distribution/pom.xml +++ b/SAS/OTB/OTB-distribution/pom.xml @@ -1,91 +1,102 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <name>Object Tree Browser Client/Server - distribution</name> - <packaging>pom</packaging> - - <groupId>nl.astron.lofar.sas</groupId> - <artifactId>OTB-distribution</artifactId> - <version>0.96-SNAPSHOT</version> - - <organization> - <name>Astron</name> - <url>http://www.astron.nl</url> - </organization> - - <build> - <plugins> - - <!-- Resolve client and server artifacts and extract them --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>2.4</version> - <executions> - <execution> - <id>unpack</id> - <phase>package</phase> - <goals> - <goal>unpack</goal> - </goals> - - <configuration> - <artifactItems> - <artifactItem> - <groupId>nl.astron.lofar.sas</groupId> - <artifactId>jOTDB3</artifactId> - <version>1.0.1-SNAPSHOT</version> - <type>tar.gz</type> - </artifactItem> - - <artifactItem> - <groupId>nl.astron.lofar.sas</groupId> - <artifactId>OTB</artifactId> - <version>1.0.1-SNAPSHOT</version> - <type>tar.gz</type> - </artifactItem> - - </artifactItems> - </configuration> - - </execution> - </executions> - </plugin> - - <!-- Create an TAR.GZ file --> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <version>2.3</version> - <configuration> - <descriptor>assembly.xml</descriptor> - <appendAssemblyId>false</appendAssemblyId> - </configuration> - - <executions> - <execution> - <id>make-assembly</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - </plugin> - - </plugins> - </build> - - <distributionManagement> - <snapshotRepository> - <id>snapshots</id> - <name>Astron Nexus Repository</name> - <url>https://support.astron.nl/nexus/content/repositories/snapshots/</url> - </snapshotRepository> - </distributionManagement> - -</project> - - +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar OTB :: Distribution</name> + <description>Object Tree Browser Client/Server - Distribution</description> + + <parent> + <groupId>nl.astron.lofar.sas.otb</groupId> + <artifactId>otb-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + </parent> + + <artifactId>OTB-distribution</artifactId> + <packaging>pom</packaging> + + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/OTB-distribution</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/OTB-distribution</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + <plugins> + + <!-- Resolve client and server artifacts and extract them --> + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack</id> + <phase>package</phase> + <goals> + <goal>unpack</goal> + </goals> + + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>jOTDB3</artifactId> + <type>tar.gz</type> + </artifactItem> + + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>OTB</artifactId> + <type>tar.gz</type> + </artifactItem> + + </artifactItems> + </configuration> + + </execution> + </executions> + </plugin> + + <!-- Create an TAR.GZ file --> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptor>assembly.xml</descriptor> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + + <dependencies> + + <!-- Sibling dependencies --> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>OTB</artifactId> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jOTDB3</artifactId> + </dependency> + + </dependencies> + +</project> + + diff --git a/SAS/OTB/OTB/dist-src/startClientOTB b/SAS/OTB/OTB/dist-src/startClientOTB index bc759f144e6d2644931852fb03e83f96419a9c2a..f4a6392c972e5913b271d19d6a139108437879e5 100644 --- a/SAS/OTB/OTB/dist-src/startClientOTB +++ b/SAS/OTB/OTB/dist-src/startClientOTB @@ -1,6 +1,6 @@ #!/bin/sh -export OTB_DIR=/opt/sas/otb +export OTB_DIR=/opt/sas/otb/client export JAVA_HOME=/usr/java/jdk1.7.0_02 echo @@ -12,7 +12,7 @@ export CLASSPATH=$OTB_APP for JAR_DEPENDENCY in $OTB_DIR/lib/*.jar do - echo -- Adding `basename $JAR_DEPENDENCY` dependency to Java Classpath + echo -- Adding dependency to CLASSPATH: `basename $JAR_DEPENDENCY` export CLASSPATH=$CLASSPATH:$JAR_DEPENDENCY done diff --git a/SAS/OTB/OTB/pom.xml b/SAS/OTB/OTB/pom.xml index 31c2baa12edd744089923d86000e0ae6ee158628..807455145eabd7cec140308b8aaa38df980ca6c4 100644 --- a/SAS/OTB/OTB/pom.xml +++ b/SAS/OTB/OTB/pom.xml @@ -1,195 +1,143 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>nl.astron.lofar.sas</groupId> - <artifactId>OTB</artifactId> - <name>Object Tree Browser GUI</name> - <version>1.0.2</version> - - <organization> - <name>Astron</name> - <url>http://www.astron.nl</url> - </organization> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.test.sourceEncoding>UTF-8</project.test.sourceEncoding> - </properties> - - <build> - - <sourceDirectory>src</sourceDirectory> - - <resources> - <resource> - <directory>${basedir}</directory> - <includes> - <include>*.log_prop</include> - </includes> - </resource> - - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.7</source> - <target>1.7</target> - </configuration> - </plugin> - - - <!-- Set the main class in the manifest file --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.4</version> - - <configuration> - <archive> - <manifest> - <mainClass>nl.astron.lofar.sas.otb.Main</mainClass> - <addDefaultImplementationEntries>true</addDefaultImplementationEntries> - <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> - </manifest> - </archive> - </configuration> - </plugin> - - <!-- Create a /target/lib directory with ALL dependencies --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>2.4</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - - <!-- Create an TAR.GZ file --> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <version>2.3</version> - <configuration> - <descriptor>assembly.xml</descriptor> - <appendAssemblyId>false</appendAssemblyId> - </configuration> - - <executions> - <execution> - <id>make-assembly</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - - <pluginManagement> - <plugins> - <!-- - This plugin's configuration is used to store Eclipse m2e settings only. - It has no influence on the Maven build itself. - --> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>1.0.0</version> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <versionRange>[1.0.0,)</versionRange> - <goals> - <goal>copy-dependencies</goal> - </goals> - </pluginExecutionFilter> - <action><ignore /></action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - </plugins> - </pluginManagement> - - </build> - - <dependencies> - - <dependency> - <groupId>nl.astron.lofar.sas</groupId> - <artifactId>jOTDB3</artifactId> - <version>1.0.2</version> - </dependency> - - <dependency> - <groupId>nl.astron.lofar.gui</groupId> - <artifactId>plotter</artifactId> - <version>1.0.2</version> - </dependency> - - <dependency> - <groupId>nl.astron.lofar.cep</groupId> - <artifactId>jParmFacade</artifactId> - <version>1.0.2</version> - </dependency> - - <dependency> - <groupId>org.swinglabs</groupId> - <artifactId>swing-layout</artifactId> - <version>1.0.3</version> - </dependency> - - <dependency> - <groupId>org.netbeans.external</groupId> - <artifactId>AbsoluteLayout</artifactId> - <version>RELEASE701</version> - </dependency> - - </dependencies> - - <repositories> - <repository> - <id>netbeans</id> - <name>NetBeans IDE Repos</name> - <url>http://bits.netbeans.org/maven2</url> - </repository> - </repositories> - - <distributionManagement> - <snapshotRepository> - <id>snapshots</id> - <name>Astron Nexus Repository</name> - <url>https://support.astron.nl/nexus/content/repositories/snapshots/</url> - </snapshotRepository> - </distributionManagement> - -</project> - - +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar OTB :: OTB</name> + <description>Object Tree Browser Client/Server - Object Tree Browser GUI</description> + + <parent> + <groupId>nl.astron.lofar.sas.otb</groupId> + <artifactId>otb-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + </parent> + + <artifactId>OTB</artifactId> + + <!-- The OTB GUI requires at least java 1.7 to compile. --> + <properties> + <project.compiler.version>1.7</project.compiler.version> + </properties> + + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/OTB</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/OTB</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + + <sourceDirectory>src</sourceDirectory> + + <resources> + <resource> + <directory>${basedir}</directory> + <includes> + <include>*.log_prop</include> + </includes> + </resource> + + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + </resources> + + <plugins> + + <!-- Set the main class in the manifest file --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + + <configuration> + <archive> + <manifest> + <mainClass>nl.astron.lofar.sas.otb.Main</mainClass> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> + </manifest> + </archive> + </configuration> + </plugin> + + <!-- Create a /target/lib directory with ALL dependencies --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + + <!-- Create an TAR.GZ file --> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptor>assembly.xml</descriptor> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + + </build> + + <dependencies> + + <!-- Sibling dependencies --> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jOTDB3</artifactId> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jParmFacade</artifactId> + </dependency> + + <!-- Internal dependencies --> + <dependency> + <groupId>nl.astron.lofar.lib</groupId> + <artifactId>plotter</artifactId> + </dependency> + + <!-- External dependencies --> + <dependency> + <groupId>org.swinglabs</groupId> + <artifactId>swing-layout</artifactId> + </dependency> + + <dependency> + <groupId>org.netbeans.external</groupId> + <artifactId>AbsoluteLayout</artifactId> + </dependency> + + </dependencies> + +</project> + + diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/SharedVars.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/SharedVars.java index 496064f7b1d111dad17bac53346510d9e45c67d1..a39470a0bf576bb57b01fefd5b52542c4e96e30a 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/SharedVars.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/SharedVars.java @@ -24,10 +24,14 @@ package nl.astron.lofar.sas.otb; +import java.net.MalformedURLException; import java.rmi.Naming; +import java.rmi.NotBoundException; import java.rmi.RemoteException; import java.util.HashMap; -import nl.astron.lofar.java.cep.jparmfacade.jParmFacadeInterface; + +import nl.astron.lofar.sas.otb.exceptions.ParmDBConfigurationException; +import nl.astron.lofar.sas.otb.jparmfacade.jParmFacadeInterface; import nl.astron.lofar.sas.otb.util.OtdbRmi; import nl.astron.lofar.sas.otb.util.ParmDBConfigurationHelper; import nl.astron.lofar.sas.otbcomponents.OTBInputFieldBuilder; @@ -105,7 +109,6 @@ public class SharedVars { itsTreeState=OtdbRmi.getRemoteOTDB().getTreeInfo(aTreeID,false).state; } catch (RemoteException ex) { logger.debug("Exception during setTreeState(TreeID: "+aTreeID+")" ); - ex.printStackTrace(); } } @@ -146,7 +149,7 @@ public class SharedVars { itsjParmFacade = (jParmFacadeInterface) Naming.lookup(aRC); - } catch (Throwable e) { + } catch (ParmDBConfigurationException | NotBoundException | MalformedURLException | RemoteException e) { logger.error("jParmFacade could not be loaded : "+e.getMessage()); } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.java index f12e47ff71f35e05921d6b0f07655bd8ba57fa4d..d105bc665b4c8f20f873b898ffa99d33a003833a 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.java @@ -78,7 +78,7 @@ public class MainPanel extends javax.swing.JPanel /** * Initializes the buttonpanel. Every tab has different buttons */ - public void initializeButtons() { + public final void initializeButtons() { buttonPanel1.removeAllButtons(); switch (itsTabFocus) { case "PIC": diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/ResultBrowserPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/ResultBrowserPanel.form index 738fdeff20939ab337f4aa5ef7ac3053c7933da1..903a70f02bc278e3efd7c2fdec5ada4d04a56843 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/ResultBrowserPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/ResultBrowserPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/ResultBrowserPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/ResultBrowserPanel.java index 01361b7f490cd18a34b674e4e4adbc9f34ea0333..bc01ecbf79f89e872edd5389c6cb8977239ebc23 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/ResultBrowserPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/ResultBrowserPanel.java @@ -26,10 +26,9 @@ package nl.astron.lofar.sas.otb.panels; import java.awt.event.ActionEvent; import java.rmi.RemoteException; -import java.util.Enumeration; +import java.util.ArrayList; import java.util.Iterator; import java.util.Set; -import java.util.Vector; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTabbedPane; @@ -150,12 +149,10 @@ public class ResultBrowserPanel extends javax.swing.JPanel item.removeAllChildren(); //add the parmdb nodes - Vector childs = - OtdbRmi.getRemoteMaintenance().getItemList(((jOTDBnode)item.getUserObject()).treeID(), ((jOTDBnode)item.getUserObject()).nodeID(), 1); + ArrayList <jOTDBnode> childs = + new ArrayList<>(OtdbRmi.getRemoteMaintenance().getItemList(((jOTDBnode)item.getUserObject()).treeID(), ((jOTDBnode)item.getUserObject()).nodeID(), 1)); - Enumeration parmdbparms = childs.elements(); - while( parmdbparms.hasMoreElements() ) { - jOTDBnode parmdbparmitem = (jOTDBnode)parmdbparms.nextElement(); + for (jOTDBnode parmdbparmitem : childs ) { //only add values that mean something if(parmdbparmitem.limits != null && !parmdbparmitem.limits.equalsIgnoreCase("")){ String[] args = new String[3]; @@ -287,11 +284,11 @@ public class ResultBrowserPanel extends javax.swing.JPanel logger.debug("actionPerformed: " + evt); logger.debug("Trigger: "+evt.getActionCommand()); try { - Vector aL = OtdbRmi.getRemoteMaintenance().getItemList(itsTreeID, "%"+evt.getActionCommand()); + ArrayList<jOTDBnode> aL = new ArrayList<>(OtdbRmi.getRemoteMaintenance().getItemList(itsTreeID, "%"+evt.getActionCommand())); logger.debug("nr nodes found: " + aL.size()); logger.debug("nodes: " + aL); if (aL.size()> 0) { - changeSelection((jOTDBnode)aL.elementAt(0)); + changeSelection(aL.get(0)); } else { logger.warn("No panels for this choice"); } @@ -307,7 +304,7 @@ public class ResultBrowserPanel extends javax.swing.JPanel jTabbedPane1.removeAll(); // Check if the nodename uses specific panels and create them - Vector aPanelList=null; + ArrayList<String> aPanelList=null; if(aNode.getUserObject() instanceof jOTDBnode){ if (itsPanelHelper.isKey(LofarUtils.keyName(aNode.getName()))) { @@ -343,19 +340,7 @@ public class ResultBrowserPanel extends javax.swing.JPanel logger.debug("Getting panel for: "+aPanelName); try { p = (JPanel) Class.forName(aPanelName).newInstance(); - } catch (ClassNotFoundException ex) { - String aS="Error during getPanel: "+ ex; - logger.error(aS); - itsMainFrame.setNormalCursor(); - LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); - return; - } catch (InstantiationException ex) { - String aS="Error during getPanel: "+ ex; - logger.error(aS); - itsMainFrame.setNormalCursor(); - LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); - return; - } catch (IllegalAccessException ex) { + } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException ex) { String aS="Error during getPanel: "+ ex; logger.error(aS); itsMainFrame.setNormalCursor(); @@ -389,7 +374,7 @@ public class ResultBrowserPanel extends javax.swing.JPanel jTabbedPane1.removeAll(); // Check if the nodename uses specific panels and create them - Vector aPanelList=null; + ArrayList<String> aPanelList=null; if (itsPanelHelper.isKey(LofarUtils.keyName(aNode.name))) { aPanelList=itsPanelHelper.getPanels(LofarUtils.keyName(aNode.name)); @@ -418,19 +403,7 @@ public class ResultBrowserPanel extends javax.swing.JPanel logger.debug("Getting panel for: "+aPanelName); try { p = (JPanel) Class.forName(aPanelName).newInstance(); - } catch (ClassNotFoundException ex) { - String aS="Error during getPanel: "+ ex; - logger.error(aS); - itsMainFrame.setNormalCursor(); - LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); - return; - } catch (InstantiationException ex) { - String aS="Error during getPanel: "+ ex; - logger.error(aS); - itsMainFrame.setNormalCursor(); - LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); - return; - } catch (IllegalAccessException ex) { + } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException ex) { String aS="Error during getPanel: "+ ex; logger.error(aS); itsMainFrame.setNormalCursor(); @@ -539,10 +512,10 @@ public class ResultBrowserPanel extends javax.swing.JPanel private void buttonPanel1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPanel1ActionPerformed logger.debug("actionPerformed: " + evt); - - if(evt.getActionCommand().equals("Query Panel")) { - // ToDo - } else if(evt.getActionCommand().equals("Schedule")) { + switch (evt.getActionCommand()) { + case "Query Panel": + break; + case "Schedule": if (itsTreeID > 0) { if (viewInfo() ) { logger.debug("Tree has been changed, reloading table line"); @@ -550,14 +523,15 @@ public class ResultBrowserPanel extends javax.swing.JPanel itsMainFrame.setChanged(this.getFriendlyName(),true); } } - } else if(evt.getActionCommand().equals("Exit")) { + break; + case "Exit": if (!userAccount.isObserver() || itsTreeType.equalsIgnoreCase("hardware")){ ResultTreeManager treeManager = ResultTreeManager.getInstance(itsMainFrame.getUserAccount()); treeManager.removeTreeModelListener(parmDBTreelistener); } itsMainFrame.unregisterPlugin(this.getFriendlyName()); itsMainFrame.showPanel(MainPanel.getFriendlyNameStatic()); - + break; } }//GEN-LAST:event_buttonPanel1ActionPerformed diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/SamplePanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/SamplePanel.form index 22899b4e965c4320fa663ba80391034827d7caba..1864f6fb2d65bde22a9b8545c3892de526b4f6ee 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/SamplePanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/SamplePanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/SamplePanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/SamplePanel.java index e0c7838182623e868502250e0baa58709a6724db..7568e25aae8831f44a7aa14004e735e538037adb 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/SamplePanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/SamplePanel.java @@ -41,7 +41,7 @@ import nl.astron.lofar.sas.otb.util.treenodes.TreeNode; * @version $Id$ * @updated */ -public class SamplePanel extends javax.swing.JPanel +public final class SamplePanel extends javax.swing.JPanel implements IPluginPanel { static Logger logger = Logger.getLogger(SamplePanel.class); @@ -371,21 +371,20 @@ public class SamplePanel extends javax.swing.JPanel private void buttonPanelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPanelActionPerformed logger.debug("actionPerformed: " + evt); - - if(evt.getActionCommand().equals("New Tree")) { + switch (evt.getActionCommand()) { + case "New Tree": // initialize the tree // create a sample root node. This should be retrieved from the OTDB of course. jOTDBnode otdbNode = new jOTDBnode(0,0,0,0); otdbNode.name = "Node_" + treeCounter++; - // put the OTDBnode in a wrapper for the tree TreeNode otdbTreeNode = new TreeNode(ResultTreeManager.getInstance(itsMainFrame.getUserAccount()),otdbNode); - // and create a new root treePanel.newRootNode(otdbTreeNode); - } - else if(evt.getActionCommand().equals("Back to Main")) { + break; + case "Back to Main": itsMainFrame.showPanel(MainPanel.getFriendlyNameStatic()); + break; } }//GEN-LAST:event_buttonPanelActionPerformed diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/TemplateMaintenancePanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/TemplateMaintenancePanel.java index 6882292fc1d064b166e971d7c32d7ee31035d97c..60dc5902f240be6e3b34c95881bdadc9fd5d6efb 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/TemplateMaintenancePanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/TemplateMaintenancePanel.java @@ -22,9 +22,9 @@ package nl.astron.lofar.sas.otb.panels; import java.rmi.RemoteException; +import java.util.ArrayList; import java.util.Iterator; import java.util.Set; -import java.util.Vector; import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -231,8 +231,8 @@ public class TemplateMaintenancePanel extends javax.swing.JPanel private void buttonPanel1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPanel1ActionPerformed logger.debug("actionPerformed: " + evt); logger.debug("Trigger: " + evt.getActionCommand()); - if (evt.getActionCommand().equals("Delete")) { - + switch (evt.getActionCommand()) { + case "Delete": //Check if the selected node isn't a leaf if (itsSelectedNode != null && !itsSelectedNode.leaf && itsSelectedNode.instances <= 1 ) { if (JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this node ?", "Delete Tree", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) { @@ -242,7 +242,7 @@ public class TemplateMaintenancePanel extends javax.swing.JPanel // We have to find the defaultNode for this deleted node and decrease the number of instances - Vector<jOTDBnode> aList = OtdbRmi.getRemoteMaintenance().getItemList(itsTreeID, itsSelectedNode.name); + ArrayList<jOTDBnode> aList = new ArrayList<>(OtdbRmi.getRemoteMaintenance().getItemList(itsTreeID, itsSelectedNode.name)); Iterator<jOTDBnode> it = aList.iterator (); jOTDBnode aDefaultNode=null; short maxIdx=0; @@ -268,8 +268,8 @@ public class TemplateMaintenancePanel extends javax.swing.JPanel } } } - } else if (evt.getActionCommand().equals("Duplicate")) { - + break; + case "Duplicate": //Check if the selected node isn't a leaf and it is a default node (index = -1) if (itsSelectedNode != null && !itsSelectedNode.leaf && itsSelectedNode.index==-1) { String answer = JOptionPane.showInputDialog(this, "What is the index for the new subtree?", "Enter indexNumber", JOptionPane.QUESTION_MESSAGE); @@ -302,9 +302,11 @@ public class TemplateMaintenancePanel extends javax.swing.JPanel } } } - } else if (evt.getActionCommand().equals("Exit")) { + break; + case "Exit": itsMainFrame.unregisterPlugin(this.getFriendlyName()); itsMainFrame.showPanel(MainPanel.getFriendlyNameStatic()); + break; } }//GEN-LAST:event_buttonPanel1ActionPerformed @@ -312,11 +314,11 @@ public class TemplateMaintenancePanel extends javax.swing.JPanel logger.debug("actionPerformed: " + evt); logger.debug("Trigger: " + evt.getActionCommand()); try { - Vector aL = OtdbRmi.getRemoteMaintenance().getItemList(itsTreeID, evt.getActionCommand()); + ArrayList<jOTDBnode> aL = new ArrayList<>(OtdbRmi.getRemoteMaintenance().getItemList(itsTreeID, evt.getActionCommand())); logger.debug("nr nodes found: " + aL.size()); logger.debug("nodes: " + aL); if (aL.size() > 0) { - changeSelection((jOTDBnode) aL.elementAt(0)); + changeSelection(aL.get(0)); } else { logger.warn("No panels for this choice"); } @@ -359,7 +361,7 @@ public class TemplateMaintenancePanel extends javax.swing.JPanel jTabbedPane1.removeAll(); // Check if the nodename uses specific panels and create them - Vector aPanelList = null; + ArrayList<String> aPanelList = null; if (itsPanelHelper.isKey(LofarUtils.keyName(aNode.name))) { aPanelList = itsPanelHelper.getPanels(LofarUtils.keyName(aNode.name)); } else { @@ -386,19 +388,7 @@ public class TemplateMaintenancePanel extends javax.swing.JPanel logger.debug("Getting panel for: " + aPanelName); try { p = (JPanel) Class.forName(aPanelName).newInstance(); - } catch (ClassNotFoundException ex) { - String aS="Error during getPanel: " + ex; - logger.error(aS); - itsMainFrame.setNormalCursor(); - LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); - return; - } catch (InstantiationException ex) { - String aS="Error during getPanel: " + ex; - logger.error(aS); - itsMainFrame.setNormalCursor(); - LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); - return; - } catch (IllegalAccessException ex) { + } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException ex) { String aS="Error during getPanel: " + ex; logger.error(aS); itsMainFrame.setNormalCursor(); @@ -457,12 +447,12 @@ public class TemplateMaintenancePanel extends javax.swing.JPanel } try { // only deletion possible when no instances left - Vector<jOTDBnode> aList = OtdbRmi.getRemoteMaintenance().getItemList(itsTreeID, itsSelectedNode.name); + ArrayList<jOTDBnode> aList = new ArrayList<>(OtdbRmi.getRemoteMaintenance().getItemList(itsTreeID, itsSelectedNode.name)); // count all found nodes with then same parentid as the selected node int cnt=0; - for ( int i=0; i < aList.size(); i++ ) { - if (itsSelectedNode.parentID() == aList.elementAt(i).parentID()) cnt++; + for ( jOTDBnode anElement: aList) { + if (itsSelectedNode.parentID() == anElement.parentID()) cnt++; } if (aNode.index == -1 && cnt <= 1) { diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/CmdExec.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/CmdExec.java index b3236c483244eb079678af8d4979dd92d0d06732..f056d3d62b3372b67548a27b905c31a9b8685ef9 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/CmdExec.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/CmdExec.java @@ -37,15 +37,13 @@ public class CmdExec { try { String line; Process p = Runtime.getRuntime().exec(cmdline); - BufferedReader input = - new BufferedReader(new InputStreamReader(p.getInputStream())); + try (BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()))) { while ((line = input.readLine()) != null) { System.out.println(line); } - input.close(); + } } catch (Exception err) { - err.printStackTrace(); } } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ConfigPanelHelper.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ConfigPanelHelper.java index 2105ce1743ea47b1c5c82dd4f65016f6e55b7b18..fb1f3b57a92d2d3df12bd6b0e4f7678fc7997899 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ConfigPanelHelper.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ConfigPanelHelper.java @@ -22,10 +22,10 @@ package nl.astron.lofar.sas.otb.util; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Set; -import java.util.Vector; /** * This (singleton) class maintains a list of available panels that can be shown on a given name in the TemplateMaintenanceBrowser. @@ -41,8 +41,8 @@ import java.util.Vector; */ public class ConfigPanelHelper { - private HashMap<String,Vector<String> > itsPanelMap; - private Vector<String> itsVector; + private HashMap<String,ArrayList<String> > itsPanelMap; + private ArrayList<String> itsArrayList; private static ConfigPanelHelper ref; /** Creates a new instance of ConfigPanelHelper */ @@ -63,12 +63,12 @@ public class ConfigPanelHelper { } private void initMap() { - itsPanelMap = new HashMap<String, Vector<String> >(); + itsPanelMap = new HashMap<>(); //generic panels - itsVector = new Vector<String>(); + itsArrayList = new ArrayList<>(); addBasePanels(); - itsPanelMap.put("*",itsVector); + itsPanelMap.put("*",itsArrayList); //BBS // itsVector = new Vector<String>(); @@ -84,47 +84,47 @@ public class ConfigPanelHelper { //OLAP - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.userpanels.OlapPanel"); - itsPanelMap.put("OLAP",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.OlapPanel"); + itsPanelMap.put("OLAP",itsArrayList); addParSetPanel(); // Observation - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.userpanels.ObservationPanel"); - itsPanelMap.put("Observation",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.ObservationPanel"); + itsPanelMap.put("Observation",itsArrayList); addParSetPanel(); //TBB - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.userpanels.TBBConfigPanel"); - itsPanelMap.put("TBB",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.TBBConfigPanel"); + itsPanelMap.put("TBB",itsArrayList); addParSetPanel(); //Imager - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.userpanels.ImagerPanel"); - itsPanelMap.put("Imager",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.ImagerPanel"); + itsPanelMap.put("Imager",itsArrayList); addParSetPanel(); } private void addBasePanels() { //generic node panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.NodeViewPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.NodeViewPanel"); //generic parameter panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.ParameterViewPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParameterViewPanel"); addParSetPanel(); } private void addParSetPanel() { //generic parset view panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.ParSetViewPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParSetViewPanel"); } private void addParSetMetaPanel() { //generic parset view panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.ParSetMetaViewPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParSetMetaViewPanel"); } /** * Returns the possible panels for this Key @@ -134,8 +134,8 @@ public class ConfigPanelHelper { * if aKey = "" all NON default panels are returned * @return the Vector that contains all panels for this key */ - public Vector getPanels(String aKey) { - Vector returnVector = null; + public ArrayList<String> getPanels(String aKey) { + ArrayList returnVector = null; Iterator i = itsPanelMap.keySet().iterator(); while(i.hasNext()){ String key = (String)i.next(); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/OtdbRmi.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/OtdbRmi.java index ea978a7642f28631db2b1916b9c16f8de8f4dd16..162a25c43c0ebfc1452e326316a111f58151f8af 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/OtdbRmi.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/OtdbRmi.java @@ -22,10 +22,11 @@ package nl.astron.lofar.sas.otb.util; +import java.rmi.NotBoundException; +import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.util.TreeMap; -import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.lofarutils.remoteFileInterface; import nl.astron.lofar.sas.otb.MainFrame; import nl.astron.lofar.sas.otb.exceptions.ConnectionFailedException; @@ -55,7 +56,7 @@ import org.apache.log4j.Logger; * @updated coolen 27-02-2007, added support for server/port setting * @updated coolen 01-05-2010, added support for jotdb3 (multi user) */ -public class OtdbRmi { +public final class OtdbRmi { static Logger logger = Logger.getLogger(OtdbRmi.class); static String name = "OtdbRmi"; @@ -301,7 +302,7 @@ public class OtdbRmi { logger.debug("Connection to RemoteAccess succesful!"); return true; } - catch (Exception e) + catch (NumberFormatException | RemoteException | NotBoundException e) { String aS="Open Remote Access via RMI and JNI failed: " + e; logger.error(aS); @@ -335,7 +336,7 @@ public class OtdbRmi { logger.debug("Connection succesful!"); return true; } - catch (Exception e) + catch (RemoteException | NotBoundException e) { logger.error("Open Remote Connection via RMI and JNI failed: " + e); } @@ -361,7 +362,7 @@ public class OtdbRmi { logger.debug("Connection succesful!"); return true; } - catch (Exception e) + catch (RemoteException | NotBoundException e) { logger.error("Getting Remote Maintenance via RMI and JNI failed: " + e); } @@ -388,7 +389,7 @@ public class OtdbRmi { logger.debug("Connection succesful!"); return true; } - catch (Exception e) + catch (RemoteException | NotBoundException e) { logger.error("Getting Remote Campaign via RMI and JNI failed: " + e); } @@ -417,7 +418,7 @@ public class OtdbRmi { logger.debug("Connection succesful!"); return true; } - catch (Exception e) + catch (RemoteException | NotBoundException e) { logger.error("Getting Remote Value via RMI and JNI failed: " + e); } @@ -446,7 +447,7 @@ public class OtdbRmi { return true; } } - catch (Exception e) + catch (RemoteException | NotBoundException e) { logger.error("Getting remote Converter via RMI and JNI failed: " + e); } @@ -474,7 +475,7 @@ public class OtdbRmi { logger.debug("Connection succesful!"); return true; } - catch (Exception e) + catch (RemoteException | NotBoundException e) { logger.error("Getting RemoteFileTransfer via RMI and JNI failed: " + e); } @@ -484,11 +485,11 @@ public class OtdbRmi { private static boolean loadConversionTypes() { try { logger.debug("Get ConversionTypes"); - itsClassifs =new TreeMap<Short,String>(OtdbRmi.remoteTypes.getClassif()); - itsParamTypes =new TreeMap<Short,String>(OtdbRmi.remoteTypes.getParamType()); - itsTreeStates =new TreeMap<Short,String>(OtdbRmi.remoteTypes.getTreeState()); - itsTreeTypes =new TreeMap<Short,String>(OtdbRmi.remoteTypes.getTreeType()); - itsUnits =new TreeMap<Short,String>(OtdbRmi.remoteTypes.getUnit()); + itsClassifs =new TreeMap<>(OtdbRmi.remoteTypes.getClassif()); + itsParamTypes =new TreeMap<>(OtdbRmi.remoteTypes.getParamType()); + itsTreeStates =new TreeMap<>(OtdbRmi.remoteTypes.getTreeState()); + itsTreeTypes =new TreeMap<>(OtdbRmi.remoteTypes.getTreeType()); + itsUnits =new TreeMap<>(OtdbRmi.remoteTypes.getUnit()); logger.debug("Got all conversiontypes"); return true; } catch (Exception e) { diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ParmDBConfigurationHelper.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ParmDBConfigurationHelper.java index 2bf31c922cb6eecc17107dd5646c1eb756d695a1..f660c0b023ac18117e98e595e996d9ce0c4cfebe 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ParmDBConfigurationHelper.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ParmDBConfigurationHelper.java @@ -86,7 +86,7 @@ public class ParmDBConfigurationHelper{ public HashMap<String,String> getParmDBServerInformation() throws ParmDBConfigurationException{ if(servers == null){ - servers = new HashMap<String,String>(); + servers = new HashMap<>(); String hostname = "lofar17.astron.nl"; String port = "10668"; String name = "ParmDB1"; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ResultPanelHelper.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ResultPanelHelper.java index 904cbb7e1de0988631ab97879023fbc1ec10ac22..f10440e9e1c8c448847ea332fe539c38995713e0 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ResultPanelHelper.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ResultPanelHelper.java @@ -22,10 +22,10 @@ package nl.astron.lofar.sas.otb.util; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Set; -import java.util.Vector; /** * This (singleton) class maintains a list of available panels that can be shown on a given (VIC)name in the ResultBrowser. @@ -41,8 +41,8 @@ import java.util.Vector; */ public class ResultPanelHelper { - private HashMap<String,Vector<String> > itsPanelMap; - private Vector<String> itsVector; + private HashMap<String,ArrayList<String> > itsPanelMap; + private ArrayList<String> itsArrayList; private static ResultPanelHelper ref; /** Creates a new instance of ResultPanelHelper */ @@ -63,63 +63,63 @@ public class ResultPanelHelper { } private void initMap() { - itsPanelMap = new HashMap<String, Vector<String> >(); + itsPanelMap = new HashMap< >(); //generic panels - itsVector = new Vector<String>(); + itsArrayList = new ArrayList<>(); addBasePanels(); - itsPanelMap.put("*",itsVector); + itsPanelMap.put("*",itsArrayList); //ParmDB - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.ParmDBConfigPanel"); - itsPanelMap.put("ParmDB",itsVector); - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.ParmDBPlotPanel"); - itsPanelMap.put("ParmDBValues",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParmDBConfigPanel"); + itsPanelMap.put("ParmDB",itsArrayList); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParmDBPlotPanel"); + itsPanelMap.put("ParmDBValues",itsArrayList); // Observation - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.userpanels.ObservationPanel"); - itsPanelMap.put("Observation",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.ObservationPanel"); + itsPanelMap.put("Observation",itsArrayList); addParSetAndLogPanels(); //OLAP - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.userpanels.OlapPanel"); - itsPanelMap.put("OLAP",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.OlapPanel"); + itsPanelMap.put("OLAP",itsArrayList); addParSetAndLogPanels(); //TBB - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.userpanels.TBBConfigPanel"); - itsPanelMap.put("TBB",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.TBBConfigPanel"); + itsPanelMap.put("TBB",itsArrayList); addParSetAndLogPanels(); //Imager - itsVector = new Vector<String>(); - itsVector.add("nl.astron.lofar.sas.otbcomponents.userpanels.ImagerPanel"); - itsPanelMap.put("Imager",itsVector); + itsArrayList = new ArrayList<>(); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.ImagerPanel"); + itsPanelMap.put("Imager",itsArrayList); addParSetAndLogPanels(); } private void addBasePanels() { //generic node panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.NodeViewPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.NodeViewPanel"); //generic parameter & meta data panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.ParameterViewPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParameterViewPanel"); addParSetAndLogPanels(); //generic parameter including Metadata panel } private void addParSetAndLogPanels() { //generic parset view panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.ParSetViewPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParSetViewPanel"); //parset+ metadata view panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.ParSetMetaViewPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParSetMetaViewPanel"); //generic logging panel - itsVector.add("nl.astron.lofar.sas.otbcomponents.LogParamPanel"); + itsArrayList.add("nl.astron.lofar.sas.otbcomponents.LogParamPanel"); } /** @@ -130,8 +130,8 @@ public class ResultPanelHelper { * if aKey = "" all NON default panels are returned * @return the Vector that contains all panels for this key */ - public Vector getPanels(String aKey) { - Vector returnVector = null; + public ArrayList<String> getPanels(String aKey) { + ArrayList<String> returnVector = null; Iterator i = itsPanelMap.keySet().iterator(); while(i.hasNext()){ String key = (String)i.next(); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/SerializableFileContents.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/SerializableFileContents.java index 41612e80dd52b9f5ef381868b6f832c2cd71b0cd..60a7e94adb12e8694af0d8e96b16e168e06acc17 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/SerializableFileContents.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/SerializableFileContents.java @@ -30,7 +30,7 @@ import java.io.Serializable; /** * This class provides a way to copy large files over RMI connections. - * based upoin code found on the java developers network written by ejs. + * based upon code found on the java developers network written by ejs. * @created 13-06-2006 * @author ejs * @version $Id$ @@ -52,7 +52,7 @@ public class SerializableFileContents implements Serializable throws IOException { out.defaultWriteObject(); - FileInputStream in = new FileInputStream(file); + try (FileInputStream in = new FileInputStream(file)) { byte[] buffer = new byte[8192]; int count; while ((count = in.read(buffer)) > 0) @@ -61,14 +61,14 @@ public class SerializableFileContents implements Serializable out.write(buffer,0,count); } out.writeInt(count); - in.close(); + } } private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); - FileOutputStream out = new FileOutputStream(file); + try (FileOutputStream out = new FileOutputStream(file)) { int count; while ((count = in.readInt()) > 0) { @@ -76,7 +76,7 @@ public class SerializableFileContents implements Serializable in.readFully(buffer); out.write(buffer,0,count); } - out.close(); + } } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/StorageLocation.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/StorageLocation.java index f629a8d6d5f76ac09da51c9a102cca416271a459..5295de35d569f5c89fb21307cee22812e153cefb 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/StorageLocation.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/StorageLocation.java @@ -46,7 +46,7 @@ public class StorageLocation { } public String getMACInteractionMonitorPath() { - String path = new String("/tmp/OTB/MAC2OTB/"); + String path = "/tmp/OTB/MAC2OTB/"; if(itsOtdbRmi == null) { logger.info("Not using OTDB to get storage location"); } @@ -54,7 +54,7 @@ public class StorageLocation { } public String getMACInteractionWritePath() { - String path = new String("/tmp/OTB/OTB2MAC/"); + String path = "/tmp/OTB/OTB2MAC/"; if(itsOtdbRmi == null) { logger.info("Not using OTDB to get storage location"); } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotDataAccessParmDBImpl.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotDataAccessParmDBImpl.java index 911b2e92dbb03839804ecfc70c47b9c03f5bd6d5..73fe928907365de89e517f9f4f936b89c37b89e0 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotDataAccessParmDBImpl.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotDataAccessParmDBImpl.java @@ -24,19 +24,20 @@ package nl.astron.lofar.sas.otb.util.plotter; import java.text.DecimalFormat; +import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.TimeZone; -import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; -import nl.astron.lofar.java.cep.jparmfacade.jParmFacadeInterface; import nl.astron.lofar.java.gui.plotter.IPlotDataAccess; import nl.astron.lofar.java.gui.plotter.PlotConstants; import nl.astron.lofar.java.gui.plotter.exceptions.PlotterDataAccessException; +import nl.astron.lofar.sas.otb.jparmfacade.jParmFacadeInterface; + import org.apache.log4j.Logger; /** @@ -44,7 +45,7 @@ import org.apache.log4j.Logger; * jParmFacade interface. It manages connections to that interface, and allows * the plotter framework to generate plots of data present in the ParmDB. * - * @see nl.astron.lofar.java.cep.jparmfacade.jParmFacadeInterface + * @see nl.astron.lofar.sas.otb.jparmfacade.jParmFacadeInterface * @created 19-04-2006, 11:00 * @author pompert * @version $Id$ @@ -73,6 +74,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ @Override public void finalize() throws Throwable { + super.finalize(); parmDB = null; } @@ -98,7 +100,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ * ----+constraints[6]= the numy variable (for example 5) (int)<br> * ----+constraints[7]= A string that will be put in front of every value. Empty string or null at least!<br> * @return the data set generated - * @see nl.astron.lofar.java.cep.jparmfacade.jParmFacadeInterface + * @see nl.astron.lofar.sas.otb.jparmfacade.jParmFacadeInterface * @see nl.astron.lofar.java.gui.plotter.PlotConstants * @throws PlotterDataAccessException will be thrown if anything goes wrong * with the ParmDB interface and calls to it. @@ -110,16 +112,16 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ } HashMap<String,Object> parameterConstraints = (HashMap<String,Object>)constraints; - String[] constraintsArray = (String[])parameterConstraints.get(new String("PARMDBCONSTRAINTS")); + String[] constraintsArray = (String[])parameterConstraints.get("PARMDBCONSTRAINTS"); - HashMap<String,Object> returnMap = new HashMap<String, Object>(); + HashMap<String,Object> returnMap = new HashMap<>(); if(parmDB != null){ if(constraintsArray.length == PlotDataAccessParmDBImpl.requiredDataConstraints){ String tableName = constraintsArray[7]; LinkedList<HashMap<String,Object>> values = null; - Vector<String> nameFilter = new Vector(); + ArrayList<String> nameFilter = new ArrayList<>(); nameFilter.add(constraintsArray[0]); if(tableName.equalsIgnoreCase("History")){ values = getParmHistoryValues(nameFilter,constraintsArray); @@ -207,7 +209,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ * ----+offset[0]= the offset value which you would like to remove from all values(String representation of double)<br> * <br> * @return the data set generated - * @see nl.astron.lofar.java.cep.jparmfacade.jParmFacadeInterface + * @see nl.astron.lofar.sas.otb.jparmfacade.jParmFacadeInterface * @see nl.astron.lofar.java.gui.plotter.PlotConstants * @throws PlotterDataAccessException will be thrown if anything goes wrong * with the ParmDB interface and calls to it. @@ -232,7 +234,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ String tableName = constraintsArray[7]; LinkedList<HashMap<String,Object>> newParmValues = null; - Vector<String> nameFilter = new Vector(); + ArrayList<String> nameFilter = new ArrayList<>(); nameFilter.add(constraintsArray[0]); if(tableName.equalsIgnoreCase("History")){ newParmValues = getParmHistoryValues(nameFilter,constraintsArray); @@ -241,7 +243,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ } if(newParmValues != null && newParmValues.size() > 0){ - HashSet<HashMap<String,Object>> toBeAddedValueObjects = new HashSet<HashMap<String,Object>>(); + HashSet<HashMap<String,Object>> toBeAddedValueObjects = new HashSet<>(); for(HashMap<String,Object> parmValue : newParmValues){ boolean addData = true; @@ -268,7 +270,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ String[] constraintsArray = (String[])operatorsOnDataset.get(PlotConstants.DATASET_OPERATOR_MODIFY); } else if(operatorsOnDataset.containsKey(PlotConstants.DATASET_OPERATOR_DELETE)){ - HashSet<HashMap<String,Object>> toBeDeletedValueObjects = new HashSet<HashMap<String,Object>>(); + HashSet<HashMap<String,Object>> toBeDeletedValueObjects = new HashSet<>(); String[] toBeDeletedValues = (String[])operatorsOnDataset.get(PlotConstants.DATASET_OPERATOR_DELETE); for(int i = 0; i < toBeDeletedValues.length; i++){ String aValueToBeDeleted = toBeDeletedValues[i]; @@ -360,11 +362,9 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ double[] originValueYArray = (double[])aValue.get(PlotConstants.DATASET_YVALUES); //create copy of value array to prevent subtracting by zero firstValueYArray = new double[originValueYArray.length]; - for(int i = 0; i < firstValueYArray.length; i++){ - firstValueYArray[i] = originValueYArray[i]; + System.arraycopy(originValueYArray, 0, firstValueYArray, 0, firstValueYArray.length); } } - } for(HashMap<String,Object> aValue : currentValuesInPlot){ @@ -418,12 +418,11 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ aValue.put(PlotConstants.DATASET_VALUELABEL,newTitle); } } - }catch(Exception e){ + }catch(PlotterDataAccessException | NumberFormatException e){ PlotterDataAccessException ex = new PlotterDataAccessException("An error occurred while updating the dataset! : "+e.getMessage()); ex.initCause(e); logger.error(ex); - e.printStackTrace(); throw ex; } @@ -449,7 +448,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ HashMap<String,Object> parameterConstraints = (HashMap<String,Object>)constraints; - parmDB = (jParmFacadeInterface)parameterConstraints.get(new String("PARMDBINTERFACE")); + parmDB = (jParmFacadeInterface)parameterConstraints.get("PARMDBINTERFACE"); } catch (Throwable e) { @@ -470,8 +469,8 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ *@param namefilter Name filter to be sent to ParmDB. *@return vector of Names */ - private Vector getNames(String namefilter) throws PlotterDataAccessException{ - Vector names; + private ArrayList<String> getNames(String namefilter) throws PlotterDataAccessException{ + ArrayList<String> names; try{ @@ -494,18 +493,18 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ /** * Helper method that generates a LinkedList with values from the jParmFacade interface * @param names filter to be sent to ParmDB. - * @return vector of Names + * @return arrayList of Names */ - private LinkedList<HashMap<String,Object>> getParmValues(Vector names, String[] constraintsArray) throws PlotterDataAccessException{ - LinkedList<HashMap<String,Object>> returnList = new LinkedList<HashMap<String,Object>>(); + private LinkedList<HashMap<String,Object>> getParmValues(ArrayList<String> names, String[] constraintsArray) throws PlotterDataAccessException{ + LinkedList<HashMap<String,Object>> returnList = new LinkedList<>(); - for(int n = 0; n < names.size();n++){ + for(String name:names){ - Vector paramValues; + ArrayList<Double> paramValues; try{ - paramValues = parmDB.getRange(names.get(n).toString()); + paramValues = parmDB.getRange(name); } catch (Exception ex) { @@ -543,11 +542,11 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ */ - HashMap<String, Vector<Double>> values = new HashMap<String,Vector<Double>>(); + HashMap<String, ArrayList<Double>> values = new HashMap<>(); try { - values = parmDB.getValues((names.get(n)).toString(), startx, endx, numx, starty, endy, numy); + values = parmDB.getValues(name, startx, endx, numx, starty, endy, numy); } catch (Exception ex) { @@ -565,7 +564,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ //Every parameter value for(String aValue : values.keySet()){ - HashMap<String,Object> aValueMap = new HashMap<String,Object>(); + HashMap<String,Object> aValueMap = new HashMap<>(); logger.debug("Parameter Value Found: "+aValue); @@ -575,7 +574,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ aValueMap.put(PlotConstants.DATASET_VALUELABEL,constraintsArray[7]+" - "+aValue); } - Vector<Double> valueDoubles = (Vector<Double>)values.get(aValue); + ArrayList<Double> valueDoubles = values.get(aValue); logger.debug("Parameter doubles inside " +aValue+": "+valueDoubles.size()+"x"); @@ -585,7 +584,7 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ - //Every parameter value double inside the vector + //Every parameter value double inside the arrayList for(int i = 0;(i<valueDoubles.size());i++){ @@ -610,18 +609,18 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ /** * Helper method that generates a LinkedList with values from the jParmFacade interface * @param names filter to be sent to ParmDB. - * @return vector of Names + * @return arrayList of Names */ - private LinkedList<HashMap<String,Object>> getParmHistoryValues(Vector names, String[] constraintsArray) throws PlotterDataAccessException{ - LinkedList<HashMap<String,Object>> returnList = new LinkedList<HashMap<String,Object>>(); + private LinkedList<HashMap<String,Object>> getParmHistoryValues(ArrayList<String> names, String[] constraintsArray) throws PlotterDataAccessException{ + LinkedList<HashMap<String,Object>> returnList = new LinkedList<>(); - for(int n = 0; n < names.size(); n++) { + for(String name : names) { /* - Vector paramValues; + ArrayList<Double> paramValues; try { - paramValues = parmDB.getRange(names.get(n).toString()); + paramValues = new ArrayList<>(parmDB.getRange(name)); } catch (Exception ex) { @@ -666,9 +665,9 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ */ - HashMap<String, Vector<Double>> values = new HashMap<String,Vector<Double>>(); + HashMap<String, ArrayList<Double>> values = new HashMap<>(); try { - values = parmDB.getHistory((names.get(n)).toString(), startx, endx, starty, endy, 0.0, 1e25); + values = parmDB.getHistory(name, startx, endx, starty, endy, 0.0, 1e25); } catch (Exception ex) { //TODO LOG! PlotterDataAccessException exx = new PlotterDataAccessException("An invalid getHistory() call was made to the ParmDB interface. Please check that all variables seem OK. Root cause: "+ex.getMessage()); @@ -679,14 +678,14 @@ public class PlotDataAccessParmDBImpl implements IPlotDataAccess{ //Every parameter value for(String aValue : values.keySet()) { - Vector<Double> valueDoubles = (Vector<Double>)values.get(aValue); + ArrayList<Double> valueDoubles = values.get(aValue); //int coefficientCount = valueDoubles.get(0).intValue(); //int iterationCount = (valueDoubles.size() - 1) / coefficientCount; //logger.debug(aValue + ": #coefficients=" + coefficientCount + " #iterations=" + iterationCount); - HashMap<String,Object> aValueMap = new HashMap<String,Object>(); + HashMap<String,Object> aValueMap = new HashMap<>(); logger.debug("Parameter Value Found: "+ aValue); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlot.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlot.java index 5cd564c349582179089ca568f42fbdd2bb577122..9adf9a043808dbc925ed241a99f00095b01dd6a8 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlot.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlot.java @@ -49,7 +49,7 @@ import org.apache.log4j.Logger; * @author pompert * @see nl.astron.lofar.java.gui.plotter.* */ -public class PlotSlot extends JPanel{ +public final class PlotSlot extends JPanel{ public static final String EMPTY_SLOT = "Empty Slot"; private static Logger logger = Logger.getLogger(PlotSlot.class); @@ -372,7 +372,7 @@ public class PlotSlot extends JPanel{ public void addSlotListener(PlotSlotListener listener) { if (myListenerList == null ) { - myListenerList = new LinkedList<PlotSlotListener>(); + myListenerList = new LinkedList<>(); } myListenerList.add(listener); } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotManager.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotManager.java index 031f487243552ee50eabf7f93f769fc2350e02f2..67a604ef0c8ca862268a12d5d7918624d36e7596 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotManager.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotManager.java @@ -38,7 +38,7 @@ import org.apache.log4j.Logger; * @created May 24, 2006, 11:12 AM * @author pompert */ -public class PlotSlotManager{ +public final class PlotSlotManager{ public static final String REFRESH_FULL = "REFRESHFULL"; public static final String REFRESH_SINGLE = "REFRESHSINGLE"; @@ -53,7 +53,7 @@ public class PlotSlotManager{ * @param amountOfSlots The amount of PlotSlots to be managed in the PlotSlot collection. */ public PlotSlotManager(int amountOfSlots) { - itsPlotSlots = new LinkedList<PlotSlot>(); + itsPlotSlots = new LinkedList<>(); setAmountOfSlots(amountOfSlots,true); } /** @@ -361,9 +361,9 @@ public class PlotSlotManager{ Object[] listeners = myListenerList.getListenerList(); ActionEvent action = null; if(id == -1){ - action = new ActionEvent(this,id,this.REFRESH_FULL); + action = new ActionEvent(this,id,PlotSlotManager.REFRESH_FULL); }else{ - action = new ActionEvent(this,id,this.REFRESH_SINGLE); + action = new ActionEvent(this,id,PlotSlotManager.REFRESH_SINGLE); } for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i]==java.awt.event.ActionListener.class) { diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotViewFrame.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotViewFrame.java index 8af91daa3c55bf8d71644d1013aa93b6bbc2e72d..f9cd27cc073da3c377e1cbfcac90ce2c5a0a1442 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotViewFrame.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotViewFrame.java @@ -65,7 +65,7 @@ public class PlotSlotViewFrame extends JDialog{ this.getContentPane().add(viewSlot.getPlot().getLegendForPlot(),BorderLayout.CENTER); pack(); } catch (PlotterException ex) { - ex.printStackTrace(); + } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotsPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotsPanel.form index 42d05778383e38d0d5e336203156716d10dae001..e87752585df6180f199089191382f737fe23d483 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotsPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotsPanel.form @@ -1,8 +1,10 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotsPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotsPanel.java index 6e0eb442073278802af032966f4846f37319fd0c..56225e56781947c3e035e6eff3a2acd877289f4d 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotsPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotsPanel.java @@ -115,8 +115,8 @@ public class PlotSlotsPanel extends javax.swing.JPanel { offsetS[0] = ""+offset; //Remove offsets if present to prevent gaps in the dataset. if(offset != 0.0 && !operation.equalsIgnoreCase("DATASET_OPERATOR_REMOVE_Y_OFFSET")){ - HashMap<String,Object> alterOffset = new HashMap<String,Object>(); - alterOffset.put(new String("PARMDBINTERFACE"),SharedVars.getJParmFacade()); + HashMap<String,Object> alterOffset = new HashMap<>(); + Object put = alterOffset.put("PARMDBINTERFACE",SharedVars.getJParmFacade()); alterOffset.put("DATASET_OPERATOR_REMOVE_Y_OFFSET",offsetS); itsSlotManager.modifyPlotInSlot(slotIndex,alterOffset); //update the data identifiers passed as the offset has been removed...Not necessary for additions! @@ -140,16 +140,16 @@ public class PlotSlotsPanel extends javax.swing.JPanel { } //Perform the actual addition or removal of data in the plot. - HashMap<String,Object> alterData = new HashMap<String,Object>(); - alterData.put(new String("PARMDBINTERFACE"),SharedVars.getJParmFacade()); + HashMap<String,Object> alterData = new HashMap<>(); + Object put = alterData.put("PARMDBINTERFACE",SharedVars.getJParmFacade()); alterData.put(operation,constraints); itsSlotManager.modifyPlotInSlot(slotIndex,alterData); //Reapply the offsets using the new values. Skips this step if the user wants to remove the offset. if(offset != 0.0 && !operation.equalsIgnoreCase("DATASET_OPERATOR_REMOVE_Y_OFFSET")){ - HashMap<String,Object> alterOffset = new HashMap<String,Object>(); - alterOffset.put(new String("PARMDBINTERFACE"),SharedVars.getJParmFacade()); + HashMap<String,Object> alterOffset = new HashMap<>(); + Object put1 = alterOffset.put("PARMDBINTERFACE",SharedVars.getJParmFacade()); alterOffset.put("DATASET_OPERATOR_ADD_Y_OFFSET",offsetS); itsSlotManager.modifyPlotInSlot(slotIndex,alterOffset); } @@ -162,14 +162,13 @@ public class PlotSlotsPanel extends javax.swing.JPanel { String[] valueArray = new String[1]; valueArray[0] = ""+itsSlotManager.getSlot(slotIndex).getOffset(); - HashMap<String,Object> alterOffset = new HashMap<String,Object>(); - alterOffset.put(new String("PARMDBINTERFACE"),SharedVars.getJParmFacade()); + HashMap<String,Object> alterOffset = new HashMap<>(); + Object put1 = alterOffset.put("PARMDBINTERFACE",SharedVars.getJParmFacade()); alterOffset.put("DATASET_OPERATOR_REMOVE_Y_OFFSET",valueArray); itsSlotManager.modifyPlotInSlot(slotIndex,alterOffset); itsSlotManager.getSlot(slotIndex).setOffset(0.0); } } catch (PlotterException ex) { - ex.printStackTrace(); } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamformerConfigurationTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamformerConfigurationTableModel.java index 12906ba8d19d44241b61715df17826f91e9db2a5..0fdaa9cbde9f80a4c930b13bdf4aaebe9470c63e 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamformerConfigurationTableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamformerConfigurationTableModel.java @@ -34,7 +34,6 @@ package nl.astron.lofar.sas.otb.util.tablemodels; import java.util.ArrayList; -import java.util.Vector; import org.apache.log4j.Logger; /** diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/ComponentTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/ComponentTableModel.java index 9f9740ed44cefe06357b57c19a39717b453d8790..bfa32636e2ef240b312b7a87301eda4cc0e1cc33 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/ComponentTableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/ComponentTableModel.java @@ -23,7 +23,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; import java.rmi.RemoteException; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.sas.otb.jotdb3.jVICnodeDef; import nl.astron.lofar.sas.otb.util.*; import org.apache.log4j.Logger; @@ -73,11 +73,11 @@ public class ComponentTableModel extends javax.swing.table.AbstractTableModel { return false; } data[row][0]=new Integer(tInfo.nodeID()); - data[row][1]=new String(tInfo.name); + data[row][1]=tInfo.name; data[row][2]=new Integer(tInfo.version); - data[row][3]=new String(OtdbRmi.getClassif().get(tInfo.classif)); - data[row][4]=new String(tInfo.constraints); - data[row][5]=new String(tInfo.description); + data[row][3]=OtdbRmi.getClassif().get(tInfo.classif); + data[row][4]=tInfo.constraints; + data[row][5]=tInfo.description; fireTableDataChanged(); } catch (RemoteException e) { logger.error("Remote OTDB via RMI and JNI failed: " + e); @@ -98,24 +98,25 @@ public class ComponentTableModel extends javax.swing.table.AbstractTableModel { return false; } // Get a list of all available Components (topnode) - Vector aComponentList=OtdbRmi.getRemoteMaintenance().getComponentList("%",false); + ArrayList<jVICnodeDef> aComponentList=new ArrayList<>(OtdbRmi.getRemoteMaintenance().getComponentList("%",false)); data = new Object[aComponentList.size()][headers.length]; logger.debug("Componentlist downloaded. Size: "+aComponentList.size()); - for (int k=0; k< aComponentList.size();k++) { - jVICnodeDef tInfo = (jVICnodeDef)aComponentList.elementAt(k); + int k=0; + for (jVICnodeDef tInfo:aComponentList) { if (tInfo == null) { logger.error("No such component found!"); } else { logger.debug("Gathered info for ID: "+tInfo.nodeID()); + data[k][0]=new Integer(tInfo.nodeID()); - data[k][1]=new String(tInfo.name); + data[k][1]=tInfo.name; data[k][2]=new Integer(tInfo.version); - data[k][3]=new String(OtdbRmi.getClassif().get(tInfo.classif)); - data[k][4]=new String(tInfo.constraints); - data[k][5]=new String(tInfo.description); - + data[k][3]=OtdbRmi.getClassif().get(tInfo.classif); + data[k][4]=tInfo.constraints; + data[k][5]=tInfo.description; + k++; /// ToDo Check if topcomponents can be marked or something // try { // if (OtdbRmi.getRemoteMaintenance().isTopComponent(tInfo.nodeID())) { diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/DefaultTemplatetableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/DefaultTemplatetableModel.java index 1881374348fae0ddad9b8d7cf0dfea8b947d159d..b0134ef1a0a878d8843457dc95c9a461014a018d 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/DefaultTemplatetableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/DefaultTemplatetableModel.java @@ -24,8 +24,6 @@ package nl.astron.lofar.sas.otb.util.tablemodels; import java.rmi.RemoteException; import java.util.ArrayList; -import java.util.Iterator; -import java.util.Vector; import nl.astron.lofar.sas.otb.jotdb3.jDefaultTemplate; import nl.astron.lofar.sas.otb.jotdb3.jOTDBtree; import nl.astron.lofar.sas.otb.util.*; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/LogParamTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/LogParamTableModel.java index c103f03f3ca1f8e50c55027a3e641bfa853ec2e7..ea5f871a912e5067f15db8e3bfa4e0a9b2f0a755 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/LogParamTableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/LogParamTableModel.java @@ -23,7 +23,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; import java.rmi.RemoteException; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.sas.otb.MainFrame; import nl.astron.lofar.sas.otb.SharedVars; import nl.astron.lofar.sas.otb.jotdb3.jOTDBvalue; @@ -64,20 +64,22 @@ public class LogParamTableModel extends javax.swing.table.AbstractTableModel { } try { OtdbRmi.getRemoteValue().setTreeID(aMainFrame.getSharedVars().getTreeID()); - Vector aLogList=OtdbRmi.getRemoteValue().searchInPeriod(aNodeID, + ArrayList<jOTDBvalue> aLogList=new ArrayList<>(OtdbRmi.getRemoteValue().searchInPeriod(aNodeID, aMainFrame.getSharedVars().getLogParamLevel(), aMainFrame.getSharedVars().getLogParamStartTime(), aMainFrame.getSharedVars().getLogParamEndTime(), - aMainFrame.getSharedVars().getLogParamMostRecent()); + aMainFrame.getSharedVars().getLogParamMostRecent())); if (aLogList==null || aLogList.size()<1 ) { logger.warn("No matches for this searchInPeriod"); return true; } data = new Object[aLogList.size()][headers.length]; - for (int k=0; k< aLogList.size();k++) { - data[k][0]=((jOTDBvalue)aLogList.elementAt(k)).name; - data[k][1]=((jOTDBvalue)aLogList.elementAt(k)).value; - data[k][2]=((jOTDBvalue)aLogList.elementAt(k)).time; + int k=0; + for (jOTDBvalue log:aLogList) { + data[k][0]=log.name; + data[k][1]=log.value; + data[k][2]=log.time; + k++; } fireTableDataChanged(); } catch (RemoteException e) { diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/PICtableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/PICtableModel.java index a13cd1af71c500e98b25a19d896c8a30f3751910..526f309b56a459df333f743f70bdd9687a9da93a 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/PICtableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/PICtableModel.java @@ -23,7 +23,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; import java.rmi.RemoteException; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.sas.otb.jotdb3.jOTDBtree; import nl.astron.lofar.sas.otb.util.*; import org.apache.log4j.Logger; @@ -39,7 +39,7 @@ import org.apache.log4j.Logger; * * @updated */ -public class PICtableModel extends javax.swing.table.AbstractTableModel { +public final class PICtableModel extends javax.swing.table.AbstractTableModel { private String headers[] = {"ID","Status","Classification","Creator","CreationTime","ObsoleteTime","Description"}; private OtdbRmi otdbRmi; @@ -77,12 +77,12 @@ public class PICtableModel extends javax.swing.table.AbstractTableModel { return false; } data[row][0]=new Integer(tInfo.treeID()); - data[row][1]=new String(OtdbRmi.getTreeState().get(tInfo.state)); - data[row][2]=new String(OtdbRmi.getClassif().get(tInfo.classification)); - data[row][3]=new String(tInfo.creator); - data[row][4]=new String(tInfo.starttime.replace("T", " ")); - data[row][5]=new String(tInfo.stoptime.replace("T", " ")); - data[row][6]=new String(tInfo.description); + data[row][1]=OtdbRmi.getTreeState().get(tInfo.state); + data[row][2]=OtdbRmi.getClassif().get(tInfo.classification); + data[row][3]=tInfo.creator; + data[row][4]=tInfo.starttime.replace("T", " "); + data[row][5]=tInfo.stoptime.replace("T", " "); + data[row][6]=tInfo.description; fireTableDataChanged(); } catch (RemoteException e) { logger.error("Remote OTDB getTreeInfo failed: " + e); @@ -103,23 +103,23 @@ public class PICtableModel extends javax.swing.table.AbstractTableModel { return false; } // Get a Treelist of all available PIC's - Vector aTreeList=OtdbRmi.getRemoteOTDB().getTreeList(OtdbRmi.getRemoteTypes().getTreeType("hardware"),(short)0); + ArrayList<jOTDBtree> aTreeList=new ArrayList<>(OtdbRmi.getRemoteOTDB().getTreeList(OtdbRmi.getRemoteTypes().getTreeType("hardware"),(short)0)); data = new Object[aTreeList.size()][headers.length]; logger.debug("Treelist downloaded. Size: "+aTreeList.size()); - - for (int k=0; k< aTreeList.size();k++) { - jOTDBtree tInfo = (jOTDBtree)aTreeList.elementAt(k); + int k=0; + for (jOTDBtree tInfo:aTreeList) { if (tInfo == null) { logger.warn("No such tree found!"); } else { logger.debug("Gathered info for ID: "+tInfo.treeID()); data[k][0]=new Integer(tInfo.treeID()); - data[k][1]=new String(OtdbRmi.getTreeState().get(tInfo.state)); - data[k][2]=new String(OtdbRmi.getClassif().get(tInfo.classification)); - data[k][3]=new String(tInfo.creator); - data[k][4]=new String(tInfo.starttime.replace("T", " ")); - data[k][5]=new String(tInfo.stoptime.replace("T", " ")); - data[k][6]=new String(tInfo.description); + data[k][1]=OtdbRmi.getTreeState().get(tInfo.state); + data[k][2]=OtdbRmi.getClassif().get(tInfo.classification); + data[k][3]=tInfo.creator; + data[k][4]=tInfo.starttime.replace("T", " "); + data[k][5]=tInfo.stoptime.replace("T", " "); + data[k][6]=tInfo.description; + k++; } } fireTableDataChanged(); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/ParamExtensionTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/ParamExtensionTableModel.java index 29b9084f23fd6fd25e931da3cd72822f1844007d..04b250b6cf6cc0162cae87d4ec964de01369c053 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/ParamExtensionTableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/ParamExtensionTableModel.java @@ -33,7 +33,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.lofarutils.LofarUtils; import org.apache.log4j.Logger; @@ -48,8 +48,8 @@ public class ParamExtensionTableModel extends javax.swing.table.DefaultTableMode private String itsTreeType = null; - private Vector<String> itsKeys = new Vector<String>(); - private Vector<String> itsValues = new Vector<String>(); + private ArrayList<String> itsKeys = new ArrayList<>(); + private ArrayList<String> itsValues = new ArrayList<>(); private boolean isChanged=false; @@ -97,7 +97,7 @@ public class ParamExtensionTableModel extends javax.swing.table.DefaultTableMode } else { itsValues.add(""); } - String[] newRow = {itsKeys.elementAt(i),itsValues.elementAt(i)}; + String[] newRow = {itsKeys.get(i),itsValues.get(i)}; this.addRow(newRow); } @@ -109,7 +109,7 @@ public class ParamExtensionTableModel extends javax.swing.table.DefaultTableMode /** get TableValues * - * @param anAngles1 Vector<String> of all direction 1 angles + * @param anAngles1 ArrayList<String> of all direction 1 angles * * @return True if succes else False */ @@ -142,8 +142,8 @@ public class ParamExtensionTableModel extends javax.swing.table.DefaultTableMode return true; } - itsKeys.addElement(aKey); - itsValues.addElement(aVal); + itsKeys.add(aKey); + itsValues.add(aVal); String[] newRow = {aKey, aVal}; this.addRow(newRow); @@ -160,10 +160,10 @@ public class ParamExtensionTableModel extends javax.swing.table.DefaultTableMode if (row < this.getRowCount() && row >= 0) { //Key this.setValueAt(newRow[0],row,0); - itsKeys.setElementAt(newRow[0], row); + itsKeys.set(row,newRow[0]); //Value this.setValueAt(newRow[1],row,1); - itsValues.setElementAt(newRow[1], row); + itsValues.set(row,newRow[1]); } else { logger.error("Error in updateRow, illegal rownumber supplied"); return false; @@ -196,8 +196,8 @@ public class ParamExtensionTableModel extends javax.swing.table.DefaultTableMode public void removeAllRows() { this.setRowCount(0); - itsKeys.removeAllElements(); - itsValues.removeAllElements(); + itsKeys.clear(); + itsValues.clear(); isChanged=true; } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/PencilConfigurationTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/PencilConfigurationTableModel.java index 527215292a5763457900addf0aca66c7fdfd70e9..057cd2c837088f3a7efb2efa051019f6c0c8a0d2 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/PencilConfigurationTableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/PencilConfigurationTableModel.java @@ -33,6 +33,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; +import java.util.ArrayList; import java.util.Vector; import org.apache.log4j.Logger; @@ -47,9 +48,9 @@ public class PencilConfigurationTableModel extends javax.swing.table.DefaultTabl private String itsTreeType = null; - private Vector<String> itsAngles1 = new Vector<String>(); - private Vector<String> itsAngles2 = new Vector<String>(); - private Vector<String> itsCoordTypes = new Vector<String>(); + private ArrayList<String> itsAngles1 = new ArrayList<>(); + private ArrayList<String> itsAngles2 = new ArrayList<>(); + private ArrayList<String> itsCoordTypes = new ArrayList<>(); private int offset=1; @@ -70,7 +71,7 @@ public class PencilConfigurationTableModel extends javax.swing.table.DefaultTabl * * @return True if succes else False */ - public boolean fillTable(String treeType, Vector<String> anAngles1,Vector<String> anAngles2,Vector<String> aCoordType,boolean refill){ + public boolean fillTable(String treeType, ArrayList<String> anAngles1,ArrayList<String> anAngles2,ArrayList<String> aCoordType,boolean refill){ // "clear" the table setRowCount(0); @@ -98,9 +99,9 @@ public class PencilConfigurationTableModel extends javax.swing.table.DefaultTabl // need to skip first entry because it is the default (dummy) TBBsetting for (int i=0; i<length-offset; i++) { - String[] newRow = { itsAngles1.elementAt(i+offset), - itsAngles2.elementAt(i+offset), - itsCoordTypes.elementAt(i+offset), + String[] newRow = { itsAngles1.get(i+offset), + itsAngles2.get(i+offset), + itsCoordTypes.get(i+offset), }; this.addRow(newRow); @@ -118,18 +119,27 @@ public class PencilConfigurationTableModel extends javax.swing.table.DefaultTabl * * @return True if succes else False */ - public boolean getTable(Vector<String> anAngles1,Vector<String> anAngles2,Vector<String> aCoordType) { + public boolean getTable(ArrayList<String> anAngles1,ArrayList<String> anAngles2,ArrayList<String> aCoordType) { // need to skip first entry because it is the default (dummy) TBBsetting // empty all elements except the default - anAngles1.setSize(1); - anAngles2.setSize(1); - aCoordType.setSize(1); + String def=""; + def = anAngles1.get(0); + anAngles1.clear(); + anAngles1.add(def); + + def = anAngles2.get(0); + anAngles2.clear(); + anAngles2.add(def); + + def = aCoordType.get(0); + aCoordType.clear(); + aCoordType.add(def); for (int i=0; i<getRowCount(); i++) { - anAngles1.addElement((String)getValueAt(i,0)); - anAngles2.addElement((String)getValueAt(i,1)); - aCoordType.addElement((String)getValueAt(i,2)); + anAngles1.add((String)getValueAt(i,0)); + anAngles2.add((String)getValueAt(i,1)); + aCoordType.add((String)getValueAt(i,2)); } return true; } @@ -169,13 +179,13 @@ public class PencilConfigurationTableModel extends javax.swing.table.DefaultTabl if (row < this.getRowCount() && row >= 0) { //Angle1 this.setValueAt(newRow[0],row,0); - itsAngles1.setElementAt(newRow[0], row+offset); + itsAngles1.set(row+offset,newRow[0]); //Angle2 this.setValueAt(newRow[1],row,1); - itsAngles2.setElementAt(newRow[1], row+offset); + itsAngles2.set(row+offset,newRow[1]); //CoordType this.setValueAt(newRow[2],row,2); - itsCoordTypes.setElementAt(newRow[2], row+offset); + itsCoordTypes.set( row+offset,newRow[2]); } else { logger.error("Error in updateRow, illegal rownumber supplied"); @@ -210,9 +220,9 @@ public class PencilConfigurationTableModel extends javax.swing.table.DefaultTabl public void removeAllRows() { this.setRowCount(0); - itsAngles1.removeAllElements(); - itsAngles2.removeAllElements(); - itsCoordTypes.removeAllElements(); + itsAngles1.clear(); + itsAngles2.clear(); + itsCoordTypes.clear(); isChanged=true; } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/StateChangeHistoryTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/StateChangeHistoryTableModel.java index 67d3d884c827816b54064feaac8ed4c3869953f1..6831e93bfa50b90a36513af24118687d64a95b8c 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/StateChangeHistoryTableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/StateChangeHistoryTableModel.java @@ -23,7 +23,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; import java.rmi.RemoteException; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.sas.otb.jotdb3.jTreeState; import nl.astron.lofar.sas.otb.util.*; import org.apache.log4j.Logger; @@ -39,7 +39,7 @@ import org.apache.log4j.Logger; * * @updated */ -public class StateChangeHistoryTableModel extends javax.swing.table.DefaultTableModel { +public final class StateChangeHistoryTableModel extends javax.swing.table.DefaultTableModel { private String headers[] = {"ID","MomID","New State","UserName","TimeStamp"}; private OtdbRmi otdbRmi; @@ -54,7 +54,7 @@ public class StateChangeHistoryTableModel extends javax.swing.table.DefaultTable this.otdbRmi = otdbRmi; this.itsTreeID=treeID; - fillTable(); + boolean fillTable = fillTable(); } public void setTree(int treeID) { @@ -79,21 +79,21 @@ public class StateChangeHistoryTableModel extends javax.swing.table.DefaultTable this.setRowCount(0); // Get a stateList of all available changes - Vector<jTreeState> aStateList=OtdbRmi.getRemoteOTDB().getStateList(itsTreeID, false); + ArrayList<jTreeState> aStateList=new ArrayList(OtdbRmi.getRemoteOTDB().getStateList(itsTreeID, false)); data = new Object[aStateList.size()][headers.length]; logger.debug("Statelist downloaded. Size: "+aStateList.size()); for (int k=0; k< aStateList.size();k++) { - jTreeState tState = aStateList.elementAt(k); + jTreeState tState = aStateList.get(k); if (tState == null) { logger.warn("No such treeState found!"); } else { logger.debug("Gathered info for ID: "+tState.treeID); data[k][0]=new Integer(tState.treeID); data[k][1]=new Integer(tState.momID); - data[k][2]=new String(OtdbRmi.getTreeState().get(tState.newState)); - data[k][3]=new String(tState.username); - data[k][4]=new String(tState.timestamp.replace("T", " ")); + data[k][2]=OtdbRmi.getTreeState().get(tState.newState); + data[k][3]=tState.username; + data[k][4]=tState.timestamp.replace("T", " "); } } fireTableDataChanged(); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TBBConfigurationTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TBBConfigurationTableModel.java index 6864d49d6833396a11536f8b44d93c587037f4c6..4a46bb748a517edd1cb5613e612eba969fbf6ca2 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TBBConfigurationTableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TBBConfigurationTableModel.java @@ -33,7 +33,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; -import java.util.Vector; +import java.util.ArrayList; import org.apache.log4j.Logger; /** @@ -45,6 +45,7 @@ public class TBBConfigurationTableModel extends javax.swing.table.DefaultTableMo static Logger logger = Logger.getLogger(TBBConfigurationTableModel.class); static String name = "TBBConfigurationTableModel"; + private String itsTreeType; private boolean isChanged=false; @@ -74,31 +75,31 @@ public class TBBConfigurationTableModel extends javax.swing.table.DefaultTableMo /** fills the table with the initial settings * - * @param aMode Vector<String> of all OperatingModes - * @param aTrigger Vector<String> of all TriggerModes - * @param aBase Vector<String> of all Baselevels - * @param aStart Vector<String> of all Startlevels - * @param aStop Vector<String> of all Stoplevels - * @param aFilter Vector<String> of all Filters - * @param aWindow Vector<String> of all Windows - * @param aF0C0 Vector<String> of all Filter0Coeff0s - * @param aF0C1 Vector<String> of all Filter0Coeff1s - * @param aF0C2 Vector<String> of all Filter0Coeff2s - * @param aF0C3 Vector<String> of all Filter0Coeff3s - * @param aF1C0 Vector<String> of all Filter1Coeff0s - * @param aF1C1 Vector<String> of all Filter1Coeff1s - * @param aF1C2 Vector<String> of all Filter1Coeff2s - * @param aF1C3 Vector<String> of all Filter1Coeff3s - * @param aRCUs Vector<String> of all RCUs involved - * @param aSubbandList Vector<String> of all subbands involved + * @param aMode ArrayList<String> of all OperatingModes + * @param aTrigger ArrayList<String> of all TriggerModes + * @param aBase ArrayList<String> of all Baselevels + * @param aStart ArrayList<String> of all Startlevels + * @param aStop ArrayList<String> of all Stoplevels + * @param aFilter ArrayList<String> of all Filters + * @param aWindow ArrayList<String> of all Windows + * @param aF0C0 ArrayList<String> of all Filter0Coeff0s + * @param aF0C1 ArrayList<String> of all Filter0Coeff1s + * @param aF0C2 ArrayList<String> of all Filter0Coeff2s + * @param aF0C3 ArrayList<String> of all Filter0Coeff3s + * @param aF1C0 ArrayList<String> of all Filter1Coeff0s + * @param aF1C1 ArrayList<String> of all Filter1Coeff1s + * @param aF1C2 ArrayList<String> of all Filter1Coeff2s + * @param aF1C3 ArrayList<String> of all Filter1Coeff3s + * @param aRCUs ArrayList<String> of all RCUs involved + * @param aSubbandList ArrayList<String> of all subbands involved * * @return True if succes else False */ - public boolean fillTable(String treeType,Vector<String> aMode,Vector<String> aTrigger,Vector<String> aBase,Vector<String> aStart, - Vector<String> aStop, Vector<String> aFilter, Vector<String> aWindow, Vector<String> aF0C0, - Vector<String> aF0C1, Vector<String> aF0C2, Vector<String> aF0C3, Vector<String> aF1C0, - Vector<String> aF1C1, Vector<String> aF1C2, Vector<String> aF1C3, Vector<String> aRCUs, - Vector<String> aSubbandList) { + public boolean fillTable(String treeType,ArrayList<String> aMode,ArrayList<String> aTrigger,ArrayList<String> aBase,ArrayList<String> aStart, + ArrayList<String> aStop, ArrayList<String> aFilter, ArrayList<String> aWindow, ArrayList<String> aF0C0, + ArrayList<String> aF0C1, ArrayList<String> aF0C2, ArrayList<String> aF0C3, ArrayList<String> aF1C0, + ArrayList<String> aF1C1, ArrayList<String> aF1C2, ArrayList<String> aF1C3, ArrayList<String> aRCUs, + ArrayList<String> aSubbandList) { itsTreeType=treeType; // "clear" the table @@ -116,23 +117,23 @@ public class TBBConfigurationTableModel extends javax.swing.table.DefaultTableMo offset=0; } for (int i=0; i<length-offset; i++) { - String[] newRow = { aMode.elementAt(i+offset), - aTrigger.elementAt(i+offset), - aBase.elementAt(i+offset), - aStart.elementAt(i+offset), - aStop.elementAt(i+offset), - aFilter.elementAt(i+offset), - aWindow.elementAt(i+offset), - aF0C0.elementAt(i+offset), - aF0C1.elementAt(i+offset), - aF0C2.elementAt(i+offset), - aF0C3.elementAt(i+offset), - aF1C0.elementAt(i+offset), - aF1C1.elementAt(i+offset), - aF1C2.elementAt(i+offset), - aF1C3.elementAt(i+offset), - aRCUs.elementAt(i+offset), - aSubbandList.elementAt(i+offset)}; + String[] newRow = { aMode.get(i+offset), + aTrigger.get(i+offset), + aBase.get(i+offset), + aStart.get(i+offset), + aStop.get(i+offset), + aFilter.get(i+offset), + aWindow.get(i+offset), + aF0C0.get(i+offset), + aF0C1.get(i+offset), + aF0C2.get(i+offset), + aF0C3.get(i+offset), + aF1C0.get(i+offset), + aF1C1.get(i+offset), + aF1C2.get(i+offset), + aF1C3.get(i+offset), + aRCUs.get(i+offset), + aSubbandList.get(i+offset)}; this.addRow(newRow); } // only initial settings added @@ -143,73 +144,129 @@ public class TBBConfigurationTableModel extends javax.swing.table.DefaultTableMo /** fills the table with the initial settings * - * @param aMode Vector<String> of all OperatingModes - * @param aTrigger Vector<String> of all triggerModes - * @param aBase Vector<String> of all Baselevels - * @param aStart Vector<String> of all Startlevels - * @param aStop Vector<String> of all Stoplevels - * @param aFilter Vector<String> of all Filters - * @param aWindow Vector<String> of all Windows - * @param aF0C0 Vector<String> of all Filter0Coeff0s - * @param aF0C1 Vector<String> of all Filter0Coeff1s - * @param aF0C2 Vector<String> of all Filter0Coeff2s - * @param aF0C3 Vector<String> of all Filter0Coeff3s - * @param aF1C0 Vector<String> of all Filter1Coeff0s - * @param aF1C1 Vector<String> of all Filter1Coeff1s - * @param aF1C2 Vector<String> of all Filter1Coeff2s - * @param aF1C3 Vector<String> of all Filter1Coeff3s - * @param aRCUs Vector<String> of all RCUs involved - * @param aSubbandList Vector<String> of all subbands involved + * @param aMode ArrayList<String> of all OperatingModes + * @param aTrigger ArrayList<String> of all triggerModes + * @param aBase ArrayList<String> of all Baselevels + * @param aStart ArrayList<String> of all Startlevels + * @param aStop ArrayList<String> of all Stoplevels + * @param aFilter ArrayList<String> of all Filters + * @param aWindow ArrayList<String> of all Windows + * @param aF0C0 ArrayList<String> of all Filter0Coeff0s + * @param aF0C1 ArrayList<String> of all Filter0Coeff1s + * @param aF0C2 ArrayList<String> of all Filter0Coeff2s + * @param aF0C3 ArrayList<String> of all Filter0Coeff3s + * @param aF1C0 ArrayList<String> of all Filter1Coeff0s + * @param aF1C1 ArrayList<String> of all Filter1Coeff1s + * @param aF1C2 ArrayList<String> of all Filter1Coeff2s + * @param aF1C3 ArrayList<String> of all Filter1Coeff3s + * @param aRCUs ArrayList<String> of all RCUs involved + * @param aSubbandList ArrayList<String> of all subbands involved * * @return True if succes else False */ - public boolean getTable(Vector<String> aMode,Vector<String> aTrigger,Vector<String> aBase,Vector<String> aStart, - Vector<String> aStop, Vector<String> aFilter, Vector<String> aWindow, Vector<String> aF0C0, - Vector<String> aF0C1, Vector<String> aF0C2, Vector<String> aF0C3, Vector<String> aF1C0, - Vector<String> aF1C1, Vector<String> aF1C2, Vector<String> aF1C3, Vector<String> aRCUs, - Vector<String> aSubbandList) { + public boolean getTable(ArrayList<String> aMode,ArrayList<String> aTrigger,ArrayList<String> aBase,ArrayList<String> aStart, + ArrayList<String> aStop, ArrayList<String> aFilter, ArrayList<String> aWindow, ArrayList<String> aF0C0, + ArrayList<String> aF0C1, ArrayList<String> aF0C2, ArrayList<String> aF0C3, ArrayList<String> aF1C0, + ArrayList<String> aF1C1, ArrayList<String> aF1C2, ArrayList<String> aF1C3, ArrayList<String> aRCUs, + ArrayList<String> aSubbandList) { int length = aMode.size(); // need to skip first entry because it is the default (dummy) TBBsetting // empty all elements except the default - aMode.setSize(1); - aTrigger.setSize(1); - aBase.setSize(1); - aStart.setSize(1); - aStop.setSize(1); - aFilter.setSize(1); - aWindow.setSize(1); - aF0C0.setSize(1); - aF0C1.setSize(1); - aF0C2.setSize(1); - aF0C3.setSize(1); - aF1C0.setSize(1); - aF1C1.setSize(1); - aF1C2.setSize(1); - aF1C3.setSize(1); - aRCUs.setSize(1); - aSubbandList.setSize(1); + String def =""; + if (!itsTreeType.equals("VHtree")) { + + def = aMode.get(0); + aMode.clear(); + aMode.add(def); + + def = aTrigger.get(0); + aTrigger.clear(); + aTrigger.add(def); + + def = aBase.get(0); + aBase.clear(); + aBase.add(def); + + def = aStart.get(0); + aStart.clear(); + aStart.add(def); + + def = aStop.get(0); + aStop.clear(); + aStop.add(def); + + def = aFilter.get(0); + aFilter.clear(); + aFilter.add(def); + + def = aWindow.get(0); + aWindow.clear(); + aWindow.add(def); + + def = aF0C0.get(0); + aF0C0.clear(); + aF0C0.add(def); + + def = aF0C1.get(0); + aF0C1.clear(); + aF0C1.add(def); + + def = aF0C2.get(0); + aF0C2.clear(); + aF0C2.add(def); + + def = aF0C3.get(0); + aF0C3.clear(); + aF0C3.add(def); + + def = aF1C0.get(0); + aF1C0.clear(); + aF1C0.add(def); + + def = aF1C1.get(0); + aF1C1.clear(); + aF1C1.add(def); + + def = aF1C2.get(0); + aF1C2.clear(); + aF1C2.add(def); + + def = aF1C3.get(0); + aF1C3.clear(); + aF1C3.add(def); + + def = aRCUs.get(0); + aRCUs.clear(); + aRCUs.add(def); + + def = aSubbandList.get(0); + aSubbandList.clear(); + aSubbandList.add(def); + + + } for (int i=0; i<getRowCount(); i++) { - aMode.addElement((String)getValueAt(i,0)); - aTrigger.addElement((String)getValueAt(i,1)); - aBase.addElement((String)getValueAt(i,2)); - aStart.addElement((String)getValueAt(i,3)); - aStop.addElement((String)getValueAt(i,4)); - aFilter.addElement((String)getValueAt(i,5)); - aWindow.addElement((String)getValueAt(i,6)); - aF0C0.addElement((String)getValueAt(i,7)); - aF0C1.addElement((String)getValueAt(i,8)); - aF0C2.addElement((String)getValueAt(i,9)); - aF0C3.addElement((String)getValueAt(i,10)); - aF1C0.addElement((String)getValueAt(i,11)); - aF1C1.addElement((String)getValueAt(i,12)); - aF1C2.addElement((String)getValueAt(i,13)); - aF1C3.addElement((String)getValueAt(i,14)); - aRCUs.addElement((String)getValueAt(i,15)); - aSubbandList.addElement((String)getValueAt(i,16)); + aMode.add((String)getValueAt(i,0)); + aTrigger.add((String)getValueAt(i,1)); + aBase.add((String)getValueAt(i,2)); + aStart.add((String)getValueAt(i,3)); + aStop.add((String)getValueAt(i,4)); + aFilter.add((String)getValueAt(i,5)); + aWindow.add((String)getValueAt(i,6)); + aF0C0.add((String)getValueAt(i,7)); + aF0C1.add((String)getValueAt(i,8)); + aF0C2.add((String)getValueAt(i,9)); + aF0C3.add((String)getValueAt(i,10)); + aF1C0.add((String)getValueAt(i,11)); + aF1C1.add((String)getValueAt(i,12)); + aF1C2.add((String)getValueAt(i,13)); + aF1C3.add((String)getValueAt(i,14)); + aRCUs.add((String)getValueAt(i,15)); + aSubbandList.add((String)getValueAt(i,16)); } return true; } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TemplatetableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TemplatetableModel.java index 87e533cf2e188fca648dc54b9c24539d96cf1d2c..a68b81b9f7c7a07f37e42ed312243448dab2d072 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TemplatetableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TemplatetableModel.java @@ -23,7 +23,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; import java.rmi.RemoteException; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.sas.otb.jotdb3.jOTDBtree; import nl.astron.lofar.sas.otb.util.*; import org.apache.log4j.Logger; @@ -75,13 +75,13 @@ public class TemplatetableModel extends javax.swing.table.AbstractTableModel { return false; } data[row][0]=new Integer(tInfo.treeID()); - data[row][1]=new String(OtdbRmi.getTreeState().get(tInfo.state)); - data[row][2]=new String(tInfo.processType); - data[row][3]=new String(tInfo.processSubtype); - data[row][4]=new String(tInfo.strategy); - data[row][5]=new String(OtdbRmi.getClassif().get(tInfo.classification)); - data[row][6]=new String(tInfo.campaign); - data[row][7]=new String(tInfo.description); + data[row][1]=OtdbRmi.getTreeState().get(tInfo.state); + data[row][2]=tInfo.processType; + data[row][3]=tInfo.processSubtype; + data[row][4]=tInfo.strategy; + data[row][5]=OtdbRmi.getClassif().get(tInfo.classification); + data[row][6]=tInfo.campaign; + data[row][7]=tInfo.description; fireTableDataChanged(); } catch (RemoteException e) { logger.debug("Remote OTDB getTreeInfo failed: " + e); @@ -101,24 +101,24 @@ public class TemplatetableModel extends javax.swing.table.AbstractTableModel { return false; } // Get a Treelist of all available VItemplate's - Vector aTreeList=OtdbRmi.getRemoteOTDB().getTreeList(OtdbRmi.getRemoteTypes().getTreeType("VItemplate"),(short)0); + ArrayList aTreeList=new ArrayList(OtdbRmi.getRemoteOTDB().getTreeList(OtdbRmi.getRemoteTypes().getTreeType("VItemplate"),(short)0)); data = new Object[aTreeList.size()][headers.length]; logger.debug("Treelist downloaded. Size: "+aTreeList.size()); for (int k=0; k< aTreeList.size();k++) { - jOTDBtree tInfo = (jOTDBtree)aTreeList.elementAt(k); + jOTDBtree tInfo = (jOTDBtree)aTreeList.get(k); if (tInfo.treeID()==0) { logger.warn("No such tree found!"); } else { logger.debug("Gathered info for ID: "+tInfo.treeID()); data[k][0]=new Integer(tInfo.treeID()); - data[k][1]=new String(OtdbRmi.getTreeState().get(tInfo.state)); - data[k][2]=new String(tInfo.processType); - data[k][3]=new String(tInfo.processSubtype); - data[k][4]=new String(tInfo.strategy); - data[k][5]=new String(OtdbRmi.getClassif().get(tInfo.classification)); - data[k][6]=new String(tInfo.campaign); - data[k][7]=new String(tInfo.description); + data[k][1]=OtdbRmi.getTreeState().get(tInfo.state); + data[k][2]=tInfo.processType; + data[k][3]=tInfo.processSubtype; + data[k][4]=tInfo.strategy; + data[k][5]=OtdbRmi.getClassif().get(tInfo.classification); + data[k][6]=tInfo.campaign; + data[k][7]=tInfo.description; } } fireTableDataChanged(); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/VICtableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/VICtableModel.java index 491f0c6b426471b6a92ea292f0b39c614e396a7b..0c39d5130a3002b8747c7172a2e3079f5c7ce3ee 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/VICtableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/VICtableModel.java @@ -11,7 +11,7 @@ package nl.astron.lofar.sas.otb.util.tablemodels; import java.rmi.RemoteException; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.sas.otb.jotdb3.jOTDBtree; import nl.astron.lofar.sas.otb.util.*; import org.apache.log4j.Logger; @@ -63,14 +63,14 @@ public class VICtableModel extends javax.swing.table.AbstractTableModel { return false; } data[row][0]=new Integer(tInfo.treeID()); - data[row][1]=new String(OtdbRmi.getTreeState().get(tInfo.state)); - data[row][2]=new String(tInfo.processType); - data[row][3]=new String(tInfo.processSubtype); - data[row][4]=new String(tInfo.strategy); - data[row][5]=new String(tInfo.campaign); - data[row][6]=new String(tInfo.starttime.replace("T", " ")); - data[row][7]=new String(tInfo.stoptime.replace("T", " ")); - data[row][8]=new String(tInfo.description); + data[row][1]=OtdbRmi.getTreeState().get(tInfo.state); + data[row][2]=tInfo.processType; + data[row][3]=tInfo.processSubtype; + data[row][4]=tInfo.strategy; + data[row][5]=tInfo.campaign; + data[row][6]=tInfo.starttime.replace("T", " "); + data[row][7]=tInfo.stoptime.replace("T", " "); + data[row][8]=tInfo.description; fireTableDataChanged(); } catch (RemoteException e) { logger.debug("Remote OTDB getTreeInfo failed: " + e); @@ -90,25 +90,25 @@ public class VICtableModel extends javax.swing.table.AbstractTableModel { return false; } // Get a Treelist of all available VHtree's - Vector aTreeList=OtdbRmi.getRemoteOTDB().getTreeList(OtdbRmi.getRemoteTypes().getTreeType("VHtree"),(short)0); + ArrayList aTreeList=new ArrayList(OtdbRmi.getRemoteOTDB().getTreeList(OtdbRmi.getRemoteTypes().getTreeType("VHtree"),(short)0)); data = new Object[aTreeList.size()][headers.length]; logger.debug("Treelist downloaded. Size: "+aTreeList.size()); for (int k=0; k< aTreeList.size();k++) { - jOTDBtree tInfo = (jOTDBtree)aTreeList.elementAt(k); + jOTDBtree tInfo = (jOTDBtree)aTreeList.get(k); if (tInfo.treeID()==0) { logger.error("No such tree found!"); } else { logger.debug("Gathered info for ID: "+tInfo.treeID()); data[k][0]=new Integer(tInfo.treeID()); - data[k][1]=new String(OtdbRmi.getTreeState().get(tInfo.state)); - data[k][2]=new String(tInfo.processType); - data[k][3]=new String(tInfo.processSubtype); - data[k][4]=new String(tInfo.strategy); - data[k][5]=new String(tInfo.campaign); - data[k][6]=new String(tInfo.starttime.replace("T", " ")); - data[k][7]=new String(tInfo.stoptime.replace("T", " ")); - data[k][8]=new String(tInfo.description); + data[k][1]=OtdbRmi.getTreeState().get(tInfo.state); + data[k][2]=tInfo.processType; + data[k][3]=tInfo.processSubtype; + data[k][4]=tInfo.strategy; + data[k][5]=tInfo.campaign; + data[k][6]=tInfo.starttime.replace("T", " "); + data[k][7]=tInfo.stoptime.replace("T", " "); + data[k][8]=tInfo.description; } } fireTableDataChanged(); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/OTDBParamTreeManager.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/OTDBParamTreeManager.java index 0b7fc02cdfcc583b29f73d50d290680b8fb4fd1a..dcc5316b687536567ae21dd2e69211db2ec5684f 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/OTDBParamTreeManager.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/OTDBParamTreeManager.java @@ -23,8 +23,7 @@ package nl.astron.lofar.sas.otb.util.treemanagers; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.event.TreeModelEvent; import nl.astron.lofar.sas.otb.jotdb3.jOTDBparam; import nl.astron.lofar.sas.otb.jotdb3.jVICnodeDef; @@ -105,7 +104,7 @@ public class OTDBParamTreeManager extends GenericTreeManager implements ITreeMan try { - Vector<jVICnodeDef> nodes = OtdbRmi.getRemoteMaintenance().getComponentList(aNodeName,false); + ArrayList<jVICnodeDef> nodes = new ArrayList(OtdbRmi.getRemoteMaintenance().getComponentList(aNodeName,false)); if (nodes.size() > 0) { logger.debug("Found "+ nodes.size()+ " nr of matches for node "+aNodeName); } else { @@ -113,10 +112,8 @@ public class OTDBParamTreeManager extends GenericTreeManager implements ITreeMan return; } - Vector<jOTDBparam> params = OtdbRmi.getRemoteMaintenance().getComponentParams(((jVICnodeDef)nodes.elementAt(0)).nodeID()); - Enumeration e = params.elements(); - while( e.hasMoreElements() ) { - jOTDBparam item = (jOTDBparam)e.nextElement(); + ArrayList<jOTDBparam> params = new ArrayList(OtdbRmi.getRemoteMaintenance().getComponentParams(((jVICnodeDef)nodes.get(0)).nodeID())); + for (jOTDBparam item:params) { TreeNode newNode = new TreeNode(OTDBParamTreeManager.instance,item,item.name); aNode.add(newNode); //testcode to add parmdb diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/ParmDBTreeManager.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/ParmDBTreeManager.java index 9eb9264b68b88247006be11bdb1ef67ffa70aee4..f3df191aac18d9a224abda7dd47663ce929112d5 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/ParmDBTreeManager.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/ParmDBTreeManager.java @@ -23,8 +23,8 @@ package nl.astron.lofar.sas.otb.util.treemanagers; import java.rmi.RemoteException; +import java.util.ArrayList; import java.util.Enumeration; -import java.util.Vector; import javax.swing.event.TreeModelEvent; import nl.astron.lofar.sas.otb.SharedVars; import nl.astron.lofar.sas.otb.util.UserAccount; @@ -96,18 +96,16 @@ public class ParmDBTreeManager extends GenericTreeManager implements ITreeManage // once for the root node and never thereafter. if(userNode.isRootNode()){ logger.trace("ParmDBtreeNode calling getNames("+userNode.getNodeID().substring(userNode.getParmDBIdentifier().length())+"*)"); - Vector children = SharedVars.getJParmFacade().getNames("*"); + ArrayList<String> children = SharedVars.getJParmFacade().getNames("*"); logger.trace("ParmDBtreeNode gets "+children.size()+" names"); - if(children.size() == 0) + if(children.isEmpty()) { userNode.setLeaf(true); } else { - Enumeration e = children.elements(); - while( e.hasMoreElements() ) { - String pathString = (String) e.nextElement(); + for (String pathString:children) { logger.trace("definePath: " + pathString); definePath(aNode, pathString.split(PARMDB_TREENODE_SEPARATOR_CHAR), 0); } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/ResultTreeManager.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/ResultTreeManager.java index c14f24e7c0205576924f4479db3280e2be8e0658..75c3e2d4b6cf7c5cb66c8bda089c091c65f28d61 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/ResultTreeManager.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/ResultTreeManager.java @@ -23,8 +23,7 @@ package nl.astron.lofar.sas.otb.util.treemanagers; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.event.TreeModelEvent; import nl.astron.lofar.sas.otb.jotdb3.jOTDBnode; import nl.astron.lofar.sas.otb.util.OtdbRmi; @@ -108,12 +107,10 @@ public class ResultTreeManager extends GenericTreeManager implements ITreeManage aNode.areChildrenDefined = true; try { - Vector childs = - OtdbRmi.getRemoteMaintenance().getItemList(((jOTDBnode)aNode.getUserObject()).treeID(), ((jOTDBnode)aNode.getUserObject()).nodeID(), 1); + ArrayList<jOTDBnode> childs = new ArrayList( + OtdbRmi.getRemoteMaintenance().getItemList(((jOTDBnode)aNode.getUserObject()).treeID(), ((jOTDBnode)aNode.getUserObject()).nodeID(), 1)); - Enumeration e = childs.elements(); - while( e.hasMoreElements() ) { - jOTDBnode item = (jOTDBnode)e.nextElement(); + for (jOTDBnode item:childs) { logger.trace("Node name selected :"+item.name); TreeNode newNode = new TreeNode(ResultTreeManager.instance,item,item.name); aNode.add(newNode); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/TemplateTreeManager.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/TemplateTreeManager.java index f87b0577a57848898fb523f710e6aa96489ffd3a..5a9fa1078dd43507f2ae83b986e8c04846efddee 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/TemplateTreeManager.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/treemanagers/TemplateTreeManager.java @@ -23,8 +23,7 @@ package nl.astron.lofar.sas.otb.util.treemanagers; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.event.TreeModelEvent; import nl.astron.lofar.sas.otb.jotdb3.jOTDBnode; import nl.astron.lofar.sas.otb.util.OtdbRmi; @@ -108,12 +107,9 @@ public class TemplateTreeManager extends GenericTreeManager implements ITreeMana aNode.areChildrenDefined = true; try { - Vector childs = - OtdbRmi.getRemoteMaintenance().getItemList(((jOTDBnode)aNode.getUserObject()).treeID(), ((jOTDBnode)aNode.getUserObject()).nodeID(), 1); - - Enumeration e = childs.elements(); - while( e.hasMoreElements() ) { - jOTDBnode item = (jOTDBnode)e.nextElement(); + ArrayList<jOTDBnode> childs = new ArrayList( + OtdbRmi.getRemoteMaintenance().getItemList(((jOTDBnode)aNode.getUserObject()).treeID(), ((jOTDBnode)aNode.getUserObject()).nodeID(), 1)); + for (jOTDBnode item:childs) { logger.trace("Node name selected :"+item.name); TreeNode newNode = new TreeNode(TemplateTreeManager.instance,item,item.name); aNode.add(newNode); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ButtonPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ButtonPanel.form index a7410490586dfb7f50048aaefd0dac73a0a5fa1e..ff3471b0cedf6def329febbc8c59c261680b1ee1 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ButtonPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ButtonPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ButtonPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ButtonPanel.java index 10ccb4578c61ced255c889f5cd49fec6115f0362..7b3de11c2a121d4f55cae689144475da78b0afdf 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ButtonPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ButtonPanel.java @@ -36,14 +36,14 @@ import org.apache.log4j.Logger; * * @updated */ -public class ButtonPanel extends javax.swing.JPanel { +public final class ButtonPanel extends javax.swing.JPanel { static Logger logger = Logger.getLogger(ButtonPanel.class); static String name = "ButtonPanel"; /** Creates new form BeanForm */ public ButtonPanel() { - buttons = new HashMap<String,JButton>(); + buttons = new HashMap<>(); initComponents(); hasPlaceHolder=true; } @@ -139,7 +139,7 @@ public class ButtonPanel extends javax.swing.JPanel { jPanelButtons.remove(buttons.get(aKey)); buttons.remove(aKey); } - if (buttons.size() == 0) { + if (buttons.isEmpty()) { jPanelButtons.add(buttonsPlaceHolder); hasPlaceHolder=true; } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CampaignInfo.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CampaignInfo.form index 89f497de6927122bad2e09d73cbf1d2e3dfbc0ac..22ab9ecfc07f1c76868351bdc4d707f0d1adaa61 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CampaignInfo.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CampaignInfo.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CampaignInfo.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CampaignInfo.java index 58860084bb6289d4f21775a8a9df6b358d6e1f95..a650784f0613a0deb130f1c537435c08d8294885 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CampaignInfo.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CampaignInfo.java @@ -13,7 +13,7 @@ package nl.astron.lofar.sas.otbcomponents; import java.rmi.RemoteException; import java.util.Iterator; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.sas.otb.MainFrame; import nl.astron.lofar.sas.otb.jotdb3.jCampaignInfo; @@ -106,7 +106,7 @@ public class CampaignInfo extends javax.swing.JPanel { // get all existing campaigns to fill the combobox, set default to original CampainName // only possible for Campaigns that have NoCampaign if (isEditable) { - itsCampaignList=OtdbRmi.getRemoteCampaign().getCampaignList(); + itsCampaignList=new ArrayList(OtdbRmi.getRemoteCampaign().getCampaignList()); if (itsCampaignList.size() > 0) { Iterator itr = itsCampaignList.iterator(); while (itr.hasNext()){ @@ -174,7 +174,7 @@ public class CampaignInfo extends javax.swing.JPanel { private jCampaignInfo itsCampaignInfo = null; private boolean isEditable=false; private boolean isChanged=false; - Vector<jCampaignInfo> itsCampaignList=null; + ArrayList<jCampaignInfo> itsCampaignList=null; /** This method is called from within the constructor to * initialize the form. diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.form index 02fd93a0ccb9a15c0ff75c49f72fbda370786722..1ed560ef41a3c73f4ed448e68dd169dd971ad48b 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> @@ -20,8 +20,8 @@ <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Component id="jPanel1" alignment="1" max="32767" attributes="0"/> - <Component id="titleText" alignment="0" pref="983" max="32767" attributes="3"/> - <Component id="tablePanel1" alignment="0" pref="983" max="32767" attributes="0"/> + <Component id="titleText" alignment="0" pref="1033" max="32767" attributes="3"/> + <Component id="tablePanel1" alignment="0" pref="1033" max="32767" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -79,7 +79,7 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="LogParamNameText" alignment="0" pref="884" max="32767" attributes="1"/> + <Component id="LogParamNameText" alignment="0" pref="909" max="32767" attributes="1"/> <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="1" max="-2" attributes="0"> <Component id="LogParamEndTimeText" alignment="0" max="32767" attributes="1"/> @@ -103,7 +103,7 @@ </Group> <Group type="102" alignment="0" attributes="0"> <Component id="LogParamRecentOnlyCheckbox" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="862" max="32767" attributes="0"/> + <EmptySpace pref="872" max="32767" attributes="0"/> </Group> </Group> </Group> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.java index c78f39e5000e8de518701c4ae9b1bdac2036966e..7506058ca58a9d3033328453ed12eb07d41d52ec 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.java @@ -510,19 +510,21 @@ public class LogParamPanel extends javax.swing.JPanel implements IViewPanel { public void composeTimeString(String time) { // Set the dateformat OTDB takes SimpleDateFormat id = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm",itsLocale); - if (time.equals("start")) { - if (itsStartTime != null) { - LogParamStartTimeText.setText(id.format(itsStartTime).replace("T", " ")); - } else { - LogParamStartTimeText.setText("not-a-date-time"); - } - - } else if (time.equals("stop")) { - if (itsStopTime != null) { - LogParamEndTimeText.setText(id.format(itsStopTime).replace("T", " ")); - } else { - LogParamEndTimeText.setText("not-a-date-time"); - } + switch (time) { + case "start": + if (itsStartTime != null) { + LogParamStartTimeText.setText(id.format(itsStartTime).replace("T", " ")); + } else { + LogParamStartTimeText.setText("not-a-date-time"); + } + break; + case "stop": + if (itsStopTime != null) { + LogParamEndTimeText.setText(id.format(itsStopTime).replace("T", " ")); + } else { + LogParamEndTimeText.setText("not-a-date-time"); + } + break; } } private void setTime() { diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LoginDialog.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LoginDialog.form index 7b46506b5ea7721d2c646a3e2023d839d732e7a7..cf5e332fa33ad8bed46ea29e172d8dc29dffb5b7 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LoginDialog.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LoginDialog.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> <Properties> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LoginDialog.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LoginDialog.java index e7370c58b1a803fca72a8bec3dd0597536ca0f49..ede60c9e06f6a12bc28ac10b62211cf87062b0ec 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LoginDialog.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LoginDialog.java @@ -157,7 +157,7 @@ public class LoginDialog extends javax.swing.JDialog { * @return Value of property userName. */ public String getUserName() { - return new String(jUserNameField.getText()); + return jUserNameField.getText(); } /** @@ -173,6 +173,6 @@ public class LoginDialog extends javax.swing.JDialog { * @return Value of property databaseName. */ public String getDBName() { - return new String(jDatabaseField.getText()); + return jDatabaseField.getText(); } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.form index 9dbc394542d96dc773180a8f34e07787adc56d97..5c7fddd550cdf7ab3d93938239515adc566095cb 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.java index ca91f998a04efd6c0e22b795b34bfe1a259bf54b..01240a57910dfec948c6730a0e43e68f92e4be03 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.java @@ -213,10 +213,13 @@ public class ParameterViewPanel extends javax.swing.JPanel implements IViewPanel */ public void popupMenuHandler(java.awt.event.ActionEvent evt) { /// TEST ONLY /// - if (evt.getActionCommand().equals("Choice 1")) { - logger.debug("Param Choice 1 chosen"); - } else if (evt.getActionCommand().equals("Choice 2")) { - logger.debug("Param Choice 2 chosen"); + switch (evt.getActionCommand()) { + case "Choice 1": + logger.debug("Param Choice 1 chosen"); + break; + case "Choice 2": + logger.debug("Param Choice 2 chosen"); + break; } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBConfigPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBConfigPanel.form index 3a68f19a397f22dca1410e207d106922f03c1fea..6999b08d81fd977394c49c98a2d65639d94e19a4 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBConfigPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBConfigPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBConfigPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBConfigPanel.java index ef32de486b5123fa832ad7b77535ff33c519d731..414b286b242a7327e9d11ac327859dcdec7fbadb 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBConfigPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBConfigPanel.java @@ -24,8 +24,7 @@ package nl.astron.lofar.sas.otbcomponents; import java.awt.Component; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; @@ -88,13 +87,12 @@ public class ParmDBConfigPanel extends javax.swing.JPanel implements IViewPanel{ jOTDBparam aParam=null; try { //we need to get all the childs from this node. - Vector childs = OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(), 1); + ArrayList<jOTDBnode> childs = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(), 1)); + // get all the params per child - Enumeration e = childs.elements(); - while( e.hasMoreElements() ) { + for (jOTDBnode aNode:childs) { aParam=null; - jOTDBnode aNode = (jOTDBnode)e.nextElement(); // We need to keep all the nodes needed by this panel // if the node is a leaf we need to get the pointed to value via Param. @@ -209,30 +207,34 @@ public class ParmDBConfigPanel extends javax.swing.JPanel implements IViewPanel{ String parentName = LofarUtils.keyName(parent.name); if(parentName.equals("ParmDB")){ - if (aKeyName.equals("Instrument")) { - this.ParmDBInstrumentText.setToolTipText(aParam.description); - this.ParmDBInstrument=aNode; - if (isRef && aParam != null) { - ParmDBInstrumentText.setText(aNode.limits + " : " + aParam.limits); - } else { - ParmDBInstrumentText.setText(aNode.limits); - } - }else if (aKeyName.equals("LocalSky")) { - this.ParmDBLocalSkyText.setToolTipText(aParam.description); - this.ParmDBLocalSky=aNode; - if (isRef && aParam != null) { - ParmDBLocalSkyText.setText(aNode.limits + " : " + aParam.limits); - } else { - ParmDBLocalSkyText.setText(aNode.limits); - } - }else if (aKeyName.equals("History")) { - this.ParmDBHistoryText.setToolTipText(aParam.description); - this.ParmDBHistory=aNode; - if (isRef && aParam != null) { - ParmDBHistoryText.setText(aNode.limits + " : " + aParam.limits); - } else { - ParmDBHistoryText.setText(aNode.limits); - } + switch (aKeyName) { + case "Instrument": + this.ParmDBInstrumentText.setToolTipText(aParam.description); + this.ParmDBInstrument=aNode; + if (isRef && aParam != null) { + ParmDBInstrumentText.setText(aNode.limits + " : " + aParam.limits); + } else { + ParmDBInstrumentText.setText(aNode.limits); + } + break; + case "LocalSky": + this.ParmDBLocalSkyText.setToolTipText(aParam.description); + this.ParmDBLocalSky=aNode; + if (isRef && aParam != null) { + ParmDBLocalSkyText.setText(aNode.limits + " : " + aParam.limits); + } else { + ParmDBLocalSkyText.setText(aNode.limits); + } + break; + case "History": + this.ParmDBHistoryText.setToolTipText(aParam.description); + this.ParmDBHistory=aNode; + if (isRef && aParam != null) { + ParmDBHistoryText.setText(aNode.limits + " : " + aParam.limits); + } else { + ParmDBHistoryText.setText(aNode.limits); + } + break; } } } @@ -349,16 +351,19 @@ public class ParmDBConfigPanel extends javax.swing.JPanel implements IViewPanel{ }// </editor-fold>//GEN-END:initComponents private void buttonPanel1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPanel1ActionPerformed - if (evt.getActionCommand().equals("Apply")) { - saveInput(); - } else if(evt.getActionCommand().equals("Restore")) { - this.restoreBBSGlobalSettingsPanel(); + switch (evt.getActionCommand()) { + case "Apply": + saveInput(); + break; + case "Restore": + this.restoreBBSGlobalSettingsPanel(); + break; } }//GEN-LAST:event_buttonPanel1ActionPerformed private jOTDBnode itsNode = null; private MainFrame itsMainFrame; - private Vector<jOTDBparam> itsParamList; + private ArrayList<jOTDBparam> itsParamList; private jOTDBnode ParmDBInstrument; private jOTDBnode ParmDBLocalSky; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBPlotPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBPlotPanel.form index d204651e26763d56e58556b7a644c94eaeb4bb1e..1e17114070c794fcffbdc99c8624a80505875be9 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBPlotPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBPlotPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBPlotPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBPlotPanel.java index 8b0e02b9c70c3f9f227e4bcc7c24c36dc86f30a5..163884c845631fad817cc8ae4ef69cee5c69f135 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBPlotPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParmDBPlotPanel.java @@ -25,8 +25,8 @@ package nl.astron.lofar.sas.otbcomponents; import java.awt.Component; import java.awt.Dimension; import java.rmi.RemoteException; +import java.util.ArrayList; import java.util.HashMap; -import java.util.Vector; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JOptionPane; @@ -203,8 +203,8 @@ public class ParmDBPlotPanel extends javax.swing.JPanel implements IViewPanel{ * @return HashMap<String,Object> object that can be passed on to PlotDataAccessParmDBImpl. */ private Object constructPlotterConstraints(String aParamName,String itsParamTableName){ - HashMap<String,Object> parameterConstraints = new HashMap<String,Object>(); - parameterConstraints.put(new String("PARMDBINTERFACE"), SharedVars.getJParmFacade()); + HashMap<String,Object> parameterConstraints = new HashMap<>(); + parameterConstraints.put("PARMDBINTERFACE", SharedVars.getJParmFacade()); String[] passToDataAccess = null; @@ -224,7 +224,7 @@ public class ParmDBPlotPanel extends javax.swing.JPanel implements IViewPanel{ try{ passToDataAccess = new String[8]; - Vector paramValues; + ArrayList<Double> paramValues; paramValues = SharedVars.getJParmFacade().getRange(cloneParamName); //paramValues = SharedVars.getJParmFacade().getRange("*"); @@ -252,7 +252,7 @@ public class ParmDBPlotPanel extends javax.swing.JPanel implements IViewPanel{ passToDataAccess[5] = ""+endy; passToDataAccess[6] = ""+numy; passToDataAccess[7] = itsParamTableName; - }catch(Exception ex){ + }catch(RemoteException | NumberFormatException ex){ JOptionPane.showMessageDialog(itsMainFrame, ex.getMessage(), "Error detected", JOptionPane.ERROR_MESSAGE); @@ -479,7 +479,7 @@ public class ParmDBPlotPanel extends javax.swing.JPanel implements IViewPanel{ }else{ double squareRoot = Math.sqrt(Double.parseDouble(""+successfulNumberOfSlots)); int wishedIndex = (Integer.parseInt(""+(int)squareRoot))-1; - cSlotsAmount.setSelectedItem(new String(""+successfulNumberOfSlots)); + cSlotsAmount.setSelectedItem((""+successfulNumberOfSlots)); } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/PencilDialog.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/PencilDialog.form index b7586de4ccc070e87522ea57b40ab379f53274fb..a25fc04f853cf557c889743103140708fb2c60ed 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/PencilDialog.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/PencilDialog.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> <Properties> @@ -73,7 +73,7 @@ <Component id="saveButton" min="-2" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace pref="576" max="32767" attributes="0"/> + <EmptySpace pref="533" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -102,7 +102,7 @@ <Component id="coordTypeChange" min="-2" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace pref="85" max="32767" attributes="0"/> + <EmptySpace pref="90" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/PencilDialog.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/PencilDialog.java index 2923f080a6dcb5d63c6d202e3a298f5da918e874..dd9e4cd552e43d483388069622fc8424479b0901 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/PencilDialog.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/PencilDialog.java @@ -228,15 +228,21 @@ public class PencilDialog extends javax.swing.JDialog { } try { if (!inputAngle1.getText().isEmpty()) { - if (ch.equals("dmsdms")) { - tmpch = "dms"; - } else if (ch.equals("hmsdms")) { - tmpch = "hms"; + switch (ch) { + case "dmsdms": + tmpch = "dms"; + break; + case "hmsdms": + tmpch = "hms"; + break; } - if (itsCoordType.equals("hmsdms")) { - tmpcoord="hms"; - } else if (itsCoordType.equals("dmsdms")) { - tmpcoord="dms"; + switch (itsCoordType) { + case "hmsdms": + tmpcoord="hms"; + break; + case "dmsdms": + tmpcoord="dms"; + break; } inputAngle1.setText(LofarUtils.changeCoordinate(tmpcoord, tmpch, inputAngle1.getText())); } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/RoundButton.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/RoundButton.java index 27433bebebc534a86a4d32475aa790fcb961daf9..5d1c029cd5afccf33bc42dfa97adc8ce2832fd73 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/RoundButton.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/RoundButton.java @@ -24,7 +24,7 @@ import javax.swing.JButton; * you can see the backgtest of the container behind these areas. * */ -public class RoundButton extends JButton { +public final class RoundButton extends JButton { Shape shape; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/SquareButton.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/SquareButton.java index da4f19bc73e1435c2d568bf471ee950e6c4d1bd0..7e23a8ad2ba08819f31ac1d57f0285fe5d49d288 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/SquareButton.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/SquareButton.java @@ -24,7 +24,7 @@ import javax.swing.JButton; * you can see the background of the container behind these areas. * */ -public class SquareButton extends JButton { +public final class SquareButton extends JButton { Shape shape; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/StorageSelectionPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/StorageSelectionPanel.form index 6568f72443eea1e42630d0c6b1eba6cd9a0a0546..1c9d22ee681c5380190a54d70d8a64e0efd2afc3 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/StorageSelectionPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/StorageSelectionPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <Properties> @@ -34,10 +34,10 @@ <Component id="jScrollPane1" min="-2" pref="76" max="-2" attributes="1"/> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="AddAllButton" pref="105" max="32767" attributes="1"/> - <Component id="RemoveButton" pref="105" max="32767" attributes="1"/> + <Component id="AddAllButton" pref="130" max="32767" attributes="1"/> + <Component id="RemoveButton" pref="130" max="32767" attributes="1"/> <Component id="RemoveAllButton" max="32767" attributes="1"/> - <Component id="AddButton" alignment="0" pref="105" max="32767" attributes="1"/> + <Component id="AddButton" alignment="0" pref="130" max="32767" attributes="1"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/StorageSelectionPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/StorageSelectionPanel.java index 47ea7652fa2489628cd7c88fce7a5f34ce3c173a..b540652df8b034f046902da2ea720f6e8c77eab0 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/StorageSelectionPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/StorageSelectionPanel.java @@ -24,7 +24,7 @@ package nl.astron.lofar.sas.otbcomponents; import java.rmi.RemoteException; import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.DefaultListModel; import javax.swing.border.TitledBorder; import nl.astron.lofar.lofarutils.LofarUtils; @@ -34,7 +34,7 @@ import nl.astron.lofar.sas.otb.util.OtdbRmi; import org.apache.log4j.Logger; /** * Panel to view (and edit) lists - * The lists are being send and retained from the panel via a Vector like string: + * The lists are being send and retained from the panel via a ArrayList like string: * [item1,item2,item3] * * @created 13-07-2006, 14:50 @@ -43,7 +43,7 @@ import org.apache.log4j.Logger; * * @version $Id$ */ -public class StorageSelectionPanel extends javax.swing.JPanel { +public final class StorageSelectionPanel extends javax.swing.JPanel { static Logger logger = Logger.getLogger(StorageSelectionPanel.class); @@ -90,19 +90,19 @@ public class StorageSelectionPanel extends javax.swing.JPanel { private DefaultListModel itsUsedModel = new DefaultListModel(); private DefaultListModel itsAvailableModel = new DefaultListModel(); private jOTDBtree itsTree = null; - private Vector<String> itsStorageNodeList = new Vector<String>(); - private Vector<String> itsUsedStorageNodeList = new Vector<String>(); - private Vector<String> itsAvailableStorageNodeList = new Vector<String>(); + private ArrayList<String> itsStorageNodeList = new ArrayList<>(); + private ArrayList<String> itsUsedStorageNodeList = new ArrayList<>(); + private ArrayList<String> itsAvailableStorageNodeList = new ArrayList<>(); public void init() { AvailableStorageNodeList.setModel(itsAvailableModel); UsedStorageNodeList.setModel(itsUsedModel); try { - Vector aTreeList = OtdbRmi.getRemoteOTDB().getTreeList(OtdbRmi.getRemoteTypes().getTreeType("hardware"), - OtdbRmi.getRemoteTypes().getClassif("operational")); + ArrayList<jOTDBtree> aTreeList = new ArrayList(OtdbRmi.getRemoteOTDB().getTreeList(OtdbRmi.getRemoteTypes().getTreeType("hardware"), + OtdbRmi.getRemoteTypes().getClassif("operational"))); for (int k = 0; k < aTreeList.size(); k++) { - jOTDBtree tInfo = (jOTDBtree) aTreeList.elementAt(k); + jOTDBtree tInfo = aTreeList.get(k); if (OtdbRmi.getTreeState().get(tInfo.state).equals("active")) { itsTree = tInfo; break; @@ -116,16 +116,11 @@ public class StorageSelectionPanel extends javax.swing.JPanel { } // Now we have the operational PIC tree, we need to search for the available StorageNodes - Vector storagenodes = OtdbRmi.getRemoteMaintenance().getItemList(itsTree.treeID(), "LOFAR_PermSW_Storage"); - Enumeration e = storagenodes.elements(); - while (e.hasMoreElements()) { - - jOTDBnode aRingNode = (jOTDBnode) e.nextElement(); - Vector childs = OtdbRmi.getRemoteMaintenance().getItemList(itsTree.treeID() ,aRingNode.nodeID(), 1); - - Enumeration ec = childs.elements(); - while (ec.hasMoreElements()) { - jOTDBnode aNode = (jOTDBnode) ec.nextElement(); + ArrayList<jOTDBnode> storagenodes = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(itsTree.treeID(), "LOFAR_PermSW_Storage")); + for (jOTDBnode aRingNode:storagenodes) { + ArrayList<jOTDBnode> childs = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(itsTree.treeID() ,aRingNode.nodeID(), 1)); + + for (jOTDBnode aNode:childs) { if (!aNode.leaf) { // split the name @@ -407,14 +402,14 @@ public class StorageSelectionPanel extends javax.swing.JPanel { /** * @return the itsUsedStorageNodeList */ - public Vector<String> getUsedStorageNodeList() { + public ArrayList<String> getUsedStorageNodeList() { return itsUsedStorageNodeList; } /** * @param itsUsedStorageNodeList the itsUsedStorageNodeList to set */ - public void setUsedStorageNodeList(Vector<String> itsUsedStorageNodeList) { + public void setUsedStorageNodeList(ArrayList<String> itsUsedStorageNodeList) { this.itsUsedStorageNodeList = itsUsedStorageNodeList; this.itsUsedModel.clear(); for (int i=0; i<itsUsedStorageNodeList.size();i++) { diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TBBControlPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TBBControlPanel.form index 2f96882ae3bf22b38b9400b372e951e277f9f41d..83a6d3df36cd497c0f6d8a46795d400d5f21a575 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TBBControlPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TBBControlPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TBBControlPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TBBControlPanel.java index e914d77886009010b92240fd163b8d69eae898eb..396e34280b9039d04025fae6629c939ff0ea01cd 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TBBControlPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TBBControlPanel.java @@ -13,8 +13,7 @@ package nl.astron.lofar.sas.otbcomponents; import java.awt.Component; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.ListSelectionModel; @@ -109,7 +108,7 @@ public class TBBControlPanel extends javax.swing.JPanel implements IViewPanel{ try { //we need to get all the childs from this node. // So we get the node itself and look for its childs - Vector<jOTDBnode> TBBnode = OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), "%TBBControl"); + ArrayList<jOTDBnode> TBBnode = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), "%TBBControl")); if (TBBnode.isEmpty() ) { logger.error("TBBControl not found, no content"); @@ -118,12 +117,10 @@ public class TBBControlPanel extends javax.swing.JPanel implements IViewPanel{ itsNode=TBBnode.get(0); - Vector <jOTDBnode> childs = OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(),1); + ArrayList <jOTDBnode> childs = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(),1)); // get all the params per child - Enumeration<jOTDBnode> e = childs.elements(); - while( e.hasMoreElements() ) { + for (jOTDBnode aNode:childs) { aParam=null; - jOTDBnode aNode = e.nextElement(); // We need to keep all the nodes needed by this panel // if the node is a leaf we need to get the pointed to value via Param. @@ -386,29 +383,36 @@ public class TBBControlPanel extends javax.swing.JPanel implements IViewPanel{ } if(parentName.equals("TBBControl")){ - // TBBControl parameters - if (aKeyName.equals("NoCoincChann")) { - noCoincChann.setToolTipText(aParam.description); - itsNoCoincChann=aNode; - } else if (aKeyName.equals("CoincidenceTime")) { - coincidenceTime.setToolTipText(aParam.description); - itsCoincidenceTime=aNode; - } else if (aKeyName.equals("DoDirectionFit")) { - doDirectionFit.setToolTipText(aParam.description); - LofarUtils.setPopupComboChoices(doDirectionFit,aParam.limits); - itsDoDirectionFit=aNode; - if (!aNode.limits.equals("")) { - doDirectionFit.setSelectedItem(aNode.limits); - } - } else if (aKeyName.equals("MinElevation")) { - minElevation.setToolTipText(aParam.description); - itsMinElevation=aNode; - } else if (aKeyName.equals("MaxFitVariance")) { - maxFitVariance.setToolTipText(aParam.description); - itsMaxFitVariance=aNode; - } else if (aKeyName.equals("ParamExtension")) { - paramExtensionTable.setToolTipText(aParam.description); - itsParamExtension=aNode; + // TBBControl parameters + switch (aKeyName) { + case "NoCoincChann": + noCoincChann.setToolTipText(aParam.description); + itsNoCoincChann=aNode; + break; + case "CoincidenceTime": + coincidenceTime.setToolTipText(aParam.description); + itsCoincidenceTime=aNode; + break; + case "DoDirectionFit": + doDirectionFit.setToolTipText(aParam.description); + LofarUtils.setPopupComboChoices(doDirectionFit,aParam.limits); + itsDoDirectionFit=aNode; + if (!aNode.limits.equals("")) { + doDirectionFit.setSelectedItem(aNode.limits); + } + break; + case "MinElevation": + minElevation.setToolTipText(aParam.description); + itsMinElevation=aNode; + break; + case "MaxFitVariance": + maxFitVariance.setToolTipText(aParam.description); + itsMaxFitVariance=aNode; + break; + case "ParamExtension": + paramExtensionTable.setToolTipText(aParam.description); + itsParamExtension=aNode; + break; } } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreeInfoDialog.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreeInfoDialog.java index bb3e9728636ca85d1835e19a399fb9ad85f28cce..6283e23e56f64b015273fe4b6dd4aa5b72ccaad2 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreeInfoDialog.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreeInfoDialog.java @@ -32,9 +32,7 @@ import java.util.Locale; import java.util.TimeZone; import java.util.TreeMap; import javax.swing.DefaultComboBoxModel; -import javax.swing.Icon; import javax.swing.JOptionPane; -import javax.swing.JTextField; import nl.astron.lofar.lofarutils.DateTimeChooser; import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.sas.otb.MainFrame; @@ -53,7 +51,7 @@ import org.apache.log4j.Logger; * * @version $Id$ */ -public class TreeInfoDialog extends javax.swing.JDialog { +public final class TreeInfoDialog extends javax.swing.JDialog { static Logger logger = Logger.getLogger(TreeInfoDialog.class); static String name = "TreeInfoDialog"; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VerticalButtonPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VerticalButtonPanel.form index 58784c0c6b71c35a869a9c2c1d71b7120ef49038..7bd66172b3e6562221b463cbe713ca474e3c9905 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VerticalButtonPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VerticalButtonPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VerticalButtonPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VerticalButtonPanel.java index a0d99210cf2782ab84cb2b6796eeb4c0533be5a2..2a9621e84efb413db1df5bd26dba9a265b84d33d 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VerticalButtonPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VerticalButtonPanel.java @@ -43,7 +43,7 @@ public class VerticalButtonPanel extends javax.swing.JPanel { /** Creates new form BeanForm */ public VerticalButtonPanel() { - buttons = new HashMap<String,JButton>(); + buttons = new HashMap<>(); initComponents(); hasPlaceHolder=true; } @@ -107,7 +107,7 @@ public class VerticalButtonPanel extends javax.swing.JPanel { jPanelButtons.remove(buttons.get(aKey)); buttons.remove(aKey); } - if (buttons.size() == 0) { + if (buttons.isEmpty()) { jPanelButtons.add(buttonsPlaceHolder); hasPlaceHolder=true; } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSPanel.form index 717bfe3323449db96bd308f600c8f81d4f7ae025..125cbe46d04d38423fdb558040f3d1ebeaf74a50 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSPanel.java index 3a5b0f780f71c40f27bb12abcefa7fda9d543c58..dca180ef8df24f4f0b8529985779564a8a2cf0df 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSPanel.java @@ -24,8 +24,7 @@ package nl.astron.lofar.sas.otbcomponents.bbs; import java.awt.Component; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.JPanel; import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.sas.otb.MainFrame; @@ -50,7 +49,7 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ private jOTDBnode itsNode = null; private MainFrame itsMainFrame; - private Vector<jOTDBparam> itsParamList; + private ArrayList<jOTDBparam> itsParamList; // Global Settings parameters private jOTDBnode dataSet; @@ -123,13 +122,10 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ jOTDBparam aParam=null; try { //we need to get all the childs from this node. - Vector childs = OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(), 1); + ArrayList<jOTDBnode> childs = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(), 1)); - // get all the params per child - Enumeration e = childs.elements(); - while( e.hasMoreElements() ) { + for (jOTDBnode aNode:childs) { aParam=null; - jOTDBnode aNode = (jOTDBnode)e.nextElement(); // We need to keep all the nodes needed by this panel // if the node is a leaf we need to get the pointed to value via Param. @@ -207,12 +203,9 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ private void retrieveAndDisplayChildDataForNode(jOTDBnode aNode){ jOTDBparam aParam=null; try { - Vector HWchilds = OtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1); + ArrayList<jOTDBnode> HWchilds = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1)); // get all the params per child - Enumeration e1 = HWchilds.elements(); - while( e1.hasMoreElements() ) { - - jOTDBnode aHWNode = (jOTDBnode)e1.nextElement(); + for (jOTDBnode aHWNode:HWchilds) { aParam=null; // We need to keep all the params needed by this panel if (aHWNode.leaf) { @@ -297,25 +290,26 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ boolean isRef = LofarUtils.isReference(aNode.limits); String aKeyName = LofarUtils.keyName(aNode.name); String parentName = LofarUtils.keyName(String.valueOf(parent.name)); - - if(parentName.equals("BBSControl")){ - if (aKeyName.equals("DataSet")) { - this.BBSDatasetText.setToolTipText(aParam.description); - this.dataSet=aNode; - - if (isRef && aParam != null) { - this.BBSDatasetDeRefText.setVisible(true); - BBSDatasetText.setText(aNode.limits); - BBSDatasetDeRefText.setText(aParam.limits); - } else { - BBSDatasetDeRefText.setVisible(false); - BBSDatasetDeRefText.setText(""); - BBSDatasetText.setText(aNode.limits); + switch (parentName) { + case "BBSControl": + if (aKeyName.equals("DataSet")) { + this.BBSDatasetText.setToolTipText(aParam.description); + this.dataSet=aNode; + + if (isRef && aParam != null) { + this.BBSDatasetDeRefText.setVisible(true); + BBSDatasetText.setText(aNode.limits); + BBSDatasetDeRefText.setText(aParam.limits); + } else { + BBSDatasetDeRefText.setVisible(false); + BBSDatasetDeRefText.setText(""); + BBSDatasetText.setText(aNode.limits); + } } - } - } else if(parentName.equals("BBDB")){ - - if (aKeyName.equals("DBName")) { + break; + case "BBDB": + switch (aKeyName) { + case "DBName": this.BBDBDBNameText.setToolTipText(aParam.description); this.BBDBDBName=aNode; if (isRef && aParam != null) { @@ -323,7 +317,8 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { BBDBDBNameText.setText(aNode.limits); } - }else if (aKeyName.equals("Host")) { + break; + case "Host": this.BBDBHostText.setToolTipText(aParam.description); this.BBDBHost=aNode; if (isRef && aParam != null) { @@ -331,7 +326,8 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { BBDBHostText.setText(aNode.limits); } - }else if (aKeyName.equals("Port")) { + break; + case "Port": this.BBDBPortText.setToolTipText(aParam.description); this.BBDBPort=aNode; if (isRef && aParam != null) { @@ -339,7 +335,8 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { BBDBPortText.setText(aNode.limits); } - }else if (aKeyName.equals("UserName")) { + break; + case "UserName": this.BBDBDBUsernameText.setToolTipText(aParam.description); this.BBDBUsername=aNode; if (isRef && aParam != null) { @@ -347,7 +344,8 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { BBDBDBUsernameText.setText(aNode.limits); } - }else if (aKeyName.equals("PassWord")) { + break; + case "PassWord": this.BBDBDBPasswordText.setToolTipText(aParam.description); this.BBDBPassword=aNode; if (isRef && aParam != null) { @@ -355,9 +353,12 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { BBDBDBPasswordText.setText(aNode.limits); } - } - } else if(parentName.equals("ParmDB")){ - if (aKeyName.equals("Instrument")) { + break; + } + break; + case "ParmDB": + switch (aKeyName) { + case "Instrument": this.ParmDBInstrumentText.setToolTipText(aParam.description); this.ParmDBInstrument=aNode; if (isRef && aParam != null) { @@ -365,7 +366,8 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { ParmDBInstrumentText.setText(aNode.limits); } - }else if (aKeyName.equals("LocalSky")) { + break; + case "LocalSky": this.ParmDBLocalSkyText.setToolTipText(aParam.description); this.ParmDBLocalSky=aNode; if (isRef && aParam != null) { @@ -373,7 +375,8 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { ParmDBLocalSkyText.setText(aNode.limits); } - }else if (aKeyName.equals("History")) { + break; + case "History": this.ParmDBHistoryText.setToolTipText(aParam.description); this.ParmDBHistory=aNode; if (isRef && aParam != null) { @@ -381,9 +384,12 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { ParmDBHistoryText.setText(aNode.limits); } - } - } else if (parentName.equals("Controller")) { - if (aKeyName.equals("Host")) { + break; + } + break; + case "Controller": + switch (aKeyName) { + case "Host": this.ControllerHostText.setToolTipText(aParam.description); this.ControllerHost=aNode; if (isRef && aParam != null) { @@ -391,7 +397,8 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { ControllerHostText.setText(aNode.limits); } - } else if (aKeyName.equals("Port")) { + break; + case "Port": this.ControllerPortText.setToolTipText(aParam.description); this.ControllerPort=aNode; if (isRef && aParam != null) { @@ -399,7 +406,9 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ } else { ControllerPortText.setText(aNode.limits); } - } + break; + } + break; } } /** @@ -660,10 +669,13 @@ public class BBSPanel extends javax.swing.JPanel implements IViewPanel{ }// </editor-fold>//GEN-END:initComponents private void buttonPanel1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPanel1ActionPerformed - if(evt.getActionCommand().equals("Apply")) { - saveInput(); - }else if(evt.getActionCommand().equals("Restore")) { - this.restoreBBSGlobalSettingsPanel(); + switch (evt.getActionCommand()) { + case "Apply": + saveInput(); + break; + case "Restore": + this.restoreBBSGlobalSettingsPanel(); + break; } }//GEN-LAST:event_buttonPanel1ActionPerformed diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSStrategyPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSStrategyPanel.form index 1b7e7e64fc11d5b4f81493bc4a8e5149e35524e9..a59bc679f1c5f253aa6f4070938c1a54aa1fbb76 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSStrategyPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSStrategyPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSStrategyPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSStrategyPanel.java index 272e42197f5a30e948f769dc059f2d309a74eb6f..b3f4ebda98e67dafecfb04d8af503aca991ca575 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSStrategyPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/BBSStrategyPanel.java @@ -26,7 +26,7 @@ import java.awt.Color; import java.awt.Component; import java.rmi.RemoteException; import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultListModel; import javax.swing.JList; @@ -65,7 +65,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ private jOTDBnode itsNode = null; private MainFrame itsMainFrame; - private Vector<jOTDBparam> itsParamList; + private ArrayList<jOTDBparam> itsParamList; // BBS Strategy parameters private jOTDBnode StrategySteps; @@ -132,13 +132,11 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ jOTDBparam aParam=null; try { //we need to get all the childs from this node. - Vector childs = OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(), 1); + ArrayList<jOTDBnode> childs = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(), 1)); // get all the params per child - Enumeration e = childs.elements(); - while( e.hasMoreElements() ) { + for (jOTDBnode aNode:childs) { aParam=null; - jOTDBnode aNode = (jOTDBnode)e.nextElement(); // We need to keep all the nodes needed by this panel // if the node is a leaf we need to get the pointed to value via Param. @@ -216,12 +214,9 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ private void retrieveAndDisplayChildDataForNode(jOTDBnode aNode){ jOTDBparam aParam=null; try { - Vector HWchilds = OtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1); + ArrayList<jOTDBnode> HWchilds = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1)); // get all the params per child - Enumeration e1 = HWchilds.elements(); - while( e1.hasMoreElements() ) { - - jOTDBnode aHWNode = (jOTDBnode)e1.nextElement(); + for (jOTDBnode aHWNode:HWchilds) { aParam=null; // We need to keep all the params needed by this panel if (aHWNode.leaf) { @@ -321,25 +316,24 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ boolean isRef = LofarUtils.isReference(aNode.limits); String aKeyName = LofarUtils.keyName(aNode.name); String parentName = String.valueOf(parent.name); - - if(parentName.equals("Strategy")){ - //Setup step tree - this.setupStepTree(parent); - this.setupStepsList(BBSStepDataManager.getInstance().getStepNames()); - - if (aKeyName.equals("InputData")) { + switch (parentName) { + case "Strategy": + //Setup step tree + this.setupStepTree(parent); + this.setupStepsList(BBSStepDataManager.getInstance().getStepNames()); + switch (aKeyName) { + case "InputData": this.inputDataText.setToolTipText(aParam.description); this.StrategyInputData=aNode; - if (isRef && aParam != null) { inputDataText.setText(aNode.limits + " : " + aParam.limits); } else { inputDataText.setText(aNode.limits); } - }else if (aKeyName.equals("Stations")) { + break; + case "Stations": this.stationsList.setToolTipText(aParam.description); this.StrategyStations = aNode; - //set the checkbox correctly when no stations are provided in the data if(StrategyStations.limits == null || StrategyStations.limits.equals("[]")){ this.stationsUseAllCheckbox.setSelected(true); @@ -355,54 +349,62 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ LofarUtils.fillList(stationsList,aNode.limits,true); } } - } - } else if(parentName.equals("WorkDomainSize")){ - if (aKeyName.equals("Freq")) { + break; + } + break; + case "WorkDomainSize": + switch (aKeyName) { + case "Freq": this.wdsFrequencyText.setToolTipText(aParam.description); this.StrategyWDSFrequency=aNode; - if (isRef && aParam != null) { wdsFrequencyText.setText(aNode.limits + " : " + aParam.limits); } else { wdsFrequencyText.setText(aNode.limits); } - } else if (aKeyName.equals("Time")) { + break; + case "Time": this.wdsTimeText.setToolTipText(aParam.description); this.StrategyWDSTime=aNode; - if (isRef && aParam != null) { wdsTimeText.setText(aNode.limits + " : " + aParam.limits); } else { wdsTimeText.setText(aNode.limits); } - } - } else if(parentName.equals("Integration")){ - if (aKeyName.equals("Freq")) { + break; + } + break; + case "Integration": + switch (aKeyName) { + case "Freq": this.integrationFrequencyText.setToolTipText(aParam.description); this.StrategyIntegrationFrequency=aNode; - if (isRef && aParam != null) { integrationFrequencyText.setText(aNode.limits + " : " + aParam.limits); } else { integrationFrequencyText.setText(aNode.limits); } - } else if (aKeyName.equals("Time")) { + break; + case "Time": this.integrationTimeText.setToolTipText(aParam.description); this.StrategyIntegrationTime=aNode; - if (isRef && aParam != null) { integrationTimeText.setText(aNode.limits + " : " + aParam.limits); } else { integrationTimeText.setText(aNode.limits); } - } - } else if(parentName.equals("Correlation")){ - if (aKeyName.equals("Selection")) { + break; + } + break; + case "Correlation": + switch (aKeyName) { + case "Selection": this.correlationSelectionBox.setToolTipText(aParam.description); this.StrategyCorrelationSelection=aNode; this.correlationSelectionBox.setSelectedItem(aNode.limits); logger.trace("Correlation selection will be :"+this.correlationSelectionBox.getSelectedItem().toString()); - } else if (aKeyName.equals("Type")) { + break; + case "Type": this.correlationTypeList.setToolTipText(aParam.description); this.StrategyCorrelationType=aNode; if (isRef && aParam != null) { @@ -410,7 +412,9 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ } else { LofarUtils.fillSelectionListFromString(correlationTypeList,aNode.limits,true); } - } + break; + } + break; } } /** @@ -502,18 +506,16 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ try { //Add steps that make up the strategy to the steps tree browser //fetch the BBS root Container node, which is the parent of the BBS Strategy node given in strategyRootNode - Vector steps = OtdbRmi.getRemoteMaintenance().getItemList(strategyRootNode.treeID(), strategyRootNode.parentID(), 1); + ArrayList<jOTDBnode> steps = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(strategyRootNode.treeID(), strategyRootNode.parentID(), 1)); // get all the params per child - Enumeration se = steps.elements(); - while( se.hasMoreElements() ) { - jOTDBnode aNode2 = (jOTDBnode)se.nextElement(); + for (jOTDBnode aNode2:steps) { if (aNode2.leaf) { //retrieve the BBS Step Container node, which holds all steps (BBS.Step) }else if (LofarUtils.keyName(aNode2.name).equals("Step")) { //Add steps to tree Object[] rootNodeArgs = new Object[3]; - rootNodeArgs[0]= new String("Strategy Steps"); + rootNodeArgs[0]= "Strategy Steps"; rootNodeArgs[1]=aNode2; TreeNode newStepRootNode = BBSStepTreeManager.getInstance(itsMainFrame.getUserAccount()).getRootNode(rootNodeArgs); this.stepsTreePanel.newRootNode(newStepRootNode); @@ -535,7 +537,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ * * @param items the String items to be added to the combobox. */ - private void setupStepsList(Vector<String> items){ + private void setupStepsList(ArrayList<String> items){ DefaultComboBoxModel itsModel = new DefaultComboBoxModel(); stepsList.setModel(itsModel); for(String anItem : items){ @@ -1097,7 +1099,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ this.removeStepButton.setEnabled(true); //show a somewhat (not completely) limited list of steps that can be added to prevent infinite loops //remove all steps that are part of the step tree all the way to the strategy... - Vector<String> items = BBSStepDataManager.getInstance().getStepNames(); + ArrayList<String> items = BBSStepDataManager.getInstance().getStepNames(); Object[] treeForThisNode = selectedPath.getPath(); for(int i = 0; i < treeForThisNode.length; i++){ @@ -1150,7 +1152,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ this.stepMoveUpButton.setEnabled(false); this.stepMoveDownButton.setEnabled(false); //show full list of steps that can be added - Vector<String> items = BBSStepDataManager.getInstance().getStepNames(); + ArrayList<String> items = BBSStepDataManager.getInstance().getStepNames(); this.setupStepsList(items); } @@ -1200,7 +1202,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ theStationModel.remove(selectedIndices[0]); selectedIndices = stationsList.getSelectedIndices(); } - if(theStationModel.size()==0){ + if(theStationModel.isEmpty()){ this.deleteStationButton.setEnabled(false); } }//GEN-LAST:event_deleteStationButtonActionPerformed @@ -1214,81 +1216,82 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ }//GEN-LAST:event_addStationButtonActionPerformed private void buttonPanel1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPanel1ActionPerformed - if(evt.getActionCommand().equals("Apply")) { - boolean warning = false; - //perform input validation on the double values in the form - String integrationTime = this.integrationTimeText.getText(); - String integrationFrequency = this.integrationFrequencyText.getText(); - String wdsTime = this.wdsTimeText.getText(); - String wdsFrequency = this.wdsFrequencyText.getText(); - - if(!integrationTime.equals("")){ - try { - Double itime = Double.parseDouble(integrationTime); - integrationTimeText.setBackground(Color.WHITE); - } catch (NumberFormatException ex) { + switch (evt.getActionCommand()) { + case "Apply": + boolean warning = false; + //perform input validation on the double values in the form + String integrationTime = this.integrationTimeText.getText(); + String integrationFrequency = this.integrationFrequencyText.getText(); + String wdsTime = this.wdsTimeText.getText(); + String wdsFrequency = this.wdsFrequencyText.getText(); + if(!integrationTime.equals("")){ + try { + Double itime = Double.parseDouble(integrationTime); + integrationTimeText.setBackground(Color.WHITE); + } catch (NumberFormatException ex) { + integrationTimeText.setBackground(Color.RED); + warning=true; + } + }else{ integrationTimeText.setBackground(Color.RED); warning=true; } - }else{ - integrationTimeText.setBackground(Color.RED); - warning=true; - } - if(!integrationFrequency.equals("")){ - try { - Double itime = Double.parseDouble(integrationFrequency); - integrationFrequencyText.setBackground(Color.WHITE); - } catch (NumberFormatException ex) { + if(!integrationFrequency.equals("")){ + try { + Double itime = Double.parseDouble(integrationFrequency); + integrationFrequencyText.setBackground(Color.WHITE); + } catch (NumberFormatException ex) { + warning=true; + integrationFrequencyText.setBackground(Color.RED); + } + }else{ warning=true; integrationFrequencyText.setBackground(Color.RED); } - }else{ - warning=true; - integrationFrequencyText.setBackground(Color.RED); - } - if(!wdsFrequency.equals("")){ - try { - Double itime = Double.parseDouble(wdsFrequency); - wdsFrequencyText.setBackground(Color.WHITE); - } catch (NumberFormatException ex) { - + if(!wdsFrequency.equals("")){ + try { + Double itime = Double.parseDouble(wdsFrequency); + wdsFrequencyText.setBackground(Color.WHITE); + } catch (NumberFormatException ex) { + + wdsFrequencyText.setBackground(Color.RED); + } + }else{ + warning=true; wdsFrequencyText.setBackground(Color.RED); } - }else{ - warning=true; - wdsFrequencyText.setBackground(Color.RED); - } - if(!wdsTime.equals("")){ - try { - Double itime = Double.parseDouble(wdsTime); - wdsTimeText.setBackground(Color.WHITE); - } catch (NumberFormatException ex) { + if(!wdsTime.equals("")){ + try { + Double itime = Double.parseDouble(wdsTime); + wdsTimeText.setBackground(Color.WHITE); + } catch (NumberFormatException ex) { + warning=true; + wdsTimeText.setBackground(Color.RED); + } + }else{ warning=true; wdsTimeText.setBackground(Color.RED); } - }else{ - warning=true; - wdsTimeText.setBackground(Color.RED); - } - if(!warning){ - itsMainFrame.setHourglassCursor(); - saveInput(); - BBSStepDataManager.getInstance().persistStrategy(); - this.setupStepTree(StrategySteps); - this.setupStepsList(BBSStepDataManager.getInstance().getStepNames()); - itsMainFrame.setNormalCursor(); - } - - } else if(evt.getActionCommand().equals("Revert")) { - String message = "Are you sure you want to revert all strategy attributes, including the step tree?"; - message+="\n\nThis 'Revert' action will remove all changes you have made in the step tree since the last 'Save Settings' action!"; - String[] buttons = {"Yes","No"}; - int choice = JOptionPane.showOptionDialog(this,message, "Please confirm", JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null,buttons,buttons[0]); - if(choice == 0){ - itsMainFrame.setHourglassCursor(); - this.restoreBBSStrategyPanel(); - itsMainFrame.setNormalCursor(); - } + if(!warning){ + itsMainFrame.setHourglassCursor(); + saveInput(); + BBSStepDataManager.getInstance().persistStrategy(); + this.setupStepTree(StrategySteps); + this.setupStepsList(BBSStepDataManager.getInstance().getStepNames()); + itsMainFrame.setNormalCursor(); + } + break; + case "Revert": + String message = "Are you sure you want to revert all strategy attributes, including the step tree?"; + message+="\n\nThis 'Revert' action will remove all changes you have made in the step tree since the last 'Save Settings' action!"; + String[] buttons = {"Yes","No"}; + int choice = JOptionPane.showOptionDialog(this,message, "Please confirm", JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null,buttons,buttons[0]); + if(choice == 0){ + itsMainFrame.setHourglassCursor(); + this.restoreBBSStrategyPanel(); + itsMainFrame.setNormalCursor(); + } + break; } }//GEN-LAST:event_buttonPanel1ActionPerformed diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStep.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStep.java index e0a0e8066a6998897c9732c297d167b65d118fd8..b44f04209edb458caa06d9c48f091075ebb8e819 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStep.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStep.java @@ -23,7 +23,7 @@ package nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement; -import java.util.Vector; +import java.util.ArrayList; /** * The BBSStep represents an instance of a BBS Step with a given name. For each @@ -41,7 +41,7 @@ public class BBSStep implements Cloneable, Comparable{ //Possible parent step private BBSStep parentStep = null; //Contained substeps - private Vector<BBSStep> childSteps; + private ArrayList<BBSStep> childSteps; //Step Name private String name; @@ -52,7 +52,7 @@ public class BBSStep implements Cloneable, Comparable{ */ public BBSStep(String name) { this.name=name; - childSteps = new Vector<BBSStep>(); + childSteps = new ArrayList<>(); parentStep = null; } /** @@ -96,13 +96,13 @@ public class BBSStep implements Cloneable, Comparable{ return parentStep != null; } /** - * Returns a Vector of BBSStep objects that are childs of this BBSStep<br><br> + * Returns a ArrayList of BBSStep objects that are childs of this BBSStep<br><br> * -Returns null if the child steps have never been set<br> - * -Returns empty vector is no child steps are associated. + * -Returns empty ArrayList is no child steps are associated. * - * @return Vector of BBSStep objects that are children of this BBSStep + * @return ArrayList of BBSStep objects that are children of this BBSStep */ - public Vector<BBSStep> getChildSteps(){ + public ArrayList<BBSStep> getChildSteps(){ return childSteps; } /** @@ -213,7 +213,7 @@ public class BBSStep implements Cloneable, Comparable{ if(indexOfChild >= 0 && indexOfChild < childSteps.size()){ BBSStep currentStepInIndex = childSteps.get(indexOfChild); if(child.getName().equals(currentStepInIndex.getName())){ - this.childSteps.removeElementAt(indexOfChild); + BBSStep remove = this.childSteps.remove(indexOfChild); childSteps.trimToSize(); } } @@ -240,7 +240,7 @@ public class BBSStep implements Cloneable, Comparable{ if(oldIndexOfChild >= 0 && oldIndexOfChild < childSteps.size()){ BBSStep currentStepInIndex = childSteps.get(oldIndexOfChild); if(child.getName().equals(currentStepInIndex.getName())){ - this.childSteps.removeElementAt(oldIndexOfChild); + BBSStep remove = this.childSteps.remove(oldIndexOfChild); this.childSteps.add(newIndexOfChild,currentStepInIndex); childSteps.trimToSize(); } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepData.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepData.java index 01d0fe680ebdbac3c1232f406f9c10c28c5952bd..9dd917c50525269dd655dd5273ce19562414eb80 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepData.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepData.java @@ -24,7 +24,7 @@ package nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement; import java.util.HashMap; -import java.util.Vector; +import java.util.ArrayList; /** * BBS Step Data object, which serves as a data structure for a given BBS Step with a unique name. @@ -39,19 +39,19 @@ import java.util.Vector; public class BBSStepData{ //Step Baseline Selection - private Vector<String> station1Selection = null; - private Vector<String> station2Selection = null; + private ArrayList<String> station1Selection = null; + private ArrayList<String> station2Selection = null; //Step Sources - private Vector<String> sources = null; - private Vector<String> extraSources = null; + private ArrayList<String> sources = null; + private ArrayList<String> extraSources = null; //Step Instrument Model - private Vector<String> instrumentModel = null; + private ArrayList<String> instrumentModel = null; //Step Integration private double integrationFrequency = -1.0; private double integrationTime = -1.0; //Step Correlation private String correlationSelection = null; - private Vector<String> correlationType = null; + private ArrayList<String> correlationType = null; //Step Output Data Column private String outputDataColumn = null; //Step Operation name @@ -65,41 +65,41 @@ public class BBSStepData{ public BBSStepData() { } - public Vector<String> getStation1Selection(){ + public ArrayList<String> getStation1Selection(){ return station1Selection; } - public void setStation1Selection(Vector<String> station1Selection){ + public void setStation1Selection(ArrayList<String> station1Selection){ this.station1Selection = station1Selection; } - public Vector<String> getStation2Selection(){ + public ArrayList<String> getStation2Selection(){ return station2Selection; } - public void setStation2Selection(Vector<String> station2Selection){ + public void setStation2Selection(ArrayList<String> station2Selection){ this.station2Selection = station2Selection; } - public Vector<String> getSources(){ + public ArrayList<String> getSources(){ return sources; } - public void setSources(Vector<String> sources){ + public void setSources(ArrayList<String> sources){ this.sources = sources; } - public Vector<String> getExtraSources(){ + public ArrayList<String> getExtraSources(){ return extraSources; } - public void setExtraSources(Vector<String> extraSources){ + public void setExtraSources(ArrayList<String> extraSources){ this.extraSources = extraSources; } - public Vector<String> getInstrumentModel(){ + public ArrayList<String> getInstrumentModel(){ return instrumentModel; } - public void setInstrumentModel(Vector<String> instrumentModel){ + public void setInstrumentModel(ArrayList<String> instrumentModel){ this.instrumentModel = instrumentModel; } @@ -127,11 +127,11 @@ public class BBSStepData{ this.correlationSelection = correlationSelection; } - public Vector<String> getCorrelationType(){ + public ArrayList<String> getCorrelationType(){ return correlationType; } - public void setCorrelationType(Vector<String> correlationType){ + public void setCorrelationType(ArrayList<String> correlationType){ this.correlationType = correlationType; } @@ -169,7 +169,7 @@ public class BBSStepData{ public synchronized void addOperationAttribute(String key, String value){ if(operationAttributes==null){ - operationAttributes=new HashMap<String,String>(); + operationAttributes=new HashMap<>(); } this.operationAttributes.put(key,value); } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepDataManager.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepDataManager.java index 82175b6588e46fa2668e836aa0444d56f6ef5781..7228237e7ee060581dd87476de85c52ec074a7db 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepDataManager.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepDataManager.java @@ -24,10 +24,9 @@ package nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement; import java.rmi.RemoteException; -import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; -import java.util.Vector; +import java.util.ArrayList; import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.sas.otb.jotdb3.jOTDBnode; import nl.astron.lofar.sas.otb.jotdb3.jVICnodeDef; @@ -46,7 +45,7 @@ public class BBSStepDataManager{ private static BBSStepDataManager instance; private static Logger logger = Logger.getLogger(BBSStepDataManager.class); private static jOTDBnode stepContainerNode = null; - private static Vector OTDBcomponentCache = null; + private static ArrayList<jVICnodeDef> OTDBcomponentCache = null; private BBSStrategy theStrategy = null; private HashMap<String,BBSStepData> stepsCollection = null; private HashSet<BBSStep> stepStructureCollection = null; @@ -55,8 +54,8 @@ public class BBSStepDataManager{ * Creates a new instance of BBSStepDataManager, protected by a singleton pattern */ private BBSStepDataManager() { - stepsCollection = new HashMap<String,BBSStepData> (); - stepStructureCollection = new HashSet<BBSStep>(); + stepsCollection = new HashMap<> (); + stepStructureCollection = new HashSet<>(); } /** * Returns a static instance of the BBSStepDataManager class. @@ -84,12 +83,12 @@ public class BBSStepDataManager{ * * @return the unique names of all the steps being managed. */ - public synchronized Vector<String> getStepNames(){ - Vector<String> returnVector = new Vector<String>(); + public synchronized ArrayList<String> getStepNames(){ + ArrayList<String> returnArrayList = new ArrayList<>(); for(String aStep : stepsCollection.keySet()){ - returnVector.add(aStep); + returnArrayList.add(aStep); } - return returnVector; + return returnArrayList; } /** * Returns a BBSStep with a given name, and attaches it to a given parent @@ -221,17 +220,15 @@ public class BBSStepDataManager{ if(strategyStepsParameter!=null){ //retrieve the step names mentioned in the strategy steps parameter (Strategy.Steps) - Vector<String> strategySteps = this.getVectorFromString(strategyStepsParameter.limits,true); + ArrayList<String> strategySteps = this.getArrayListFromString(strategyStepsParameter.limits,true); if(strategySteps.size()>0){ - Vector stepsVector; + ArrayList<jOTDBnode> stepsArrayList; try { - stepsVector = OtdbRmi.getRemoteMaintenance().getItemList(rootNode.treeID(), rootNode.nodeID(), 1); + stepsArrayList = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(rootNode.treeID(), rootNode.nodeID(), 1)); //loop through steps for(String aStep : strategySteps){ - Enumeration se = stepsVector.elements(); - while( se.hasMoreElements() ) { - jOTDBnode aHWNode = (jOTDBnode)se.nextElement(); + for(jOTDBnode aHWNode:stepsArrayList) { //limiting the search for steps that are mentioned in the strategy steps parameter (Strategy.Steps) if (aHWNode.name.equals(aStep)) { //Create a new step and build it (with its substeps as well) @@ -266,13 +263,13 @@ public class BBSStepDataManager{ jOTDBnode parentStepsNode = this.getStrategyStepsNode(this.getStepContainerNode()); //determine the Parent children as defined by the BBS Step Parent object - Vector<BBSStep> currentParentChildren = theStrategy.getChildSteps(); + ArrayList<BBSStep> currentParentChildren = new ArrayList(theStrategy.getChildSteps()); - Vector<String> currentParentChildrenList = new Vector<String>(); + ArrayList<String> currentParentChildrenList = new ArrayList<>(); for(BBSStep someStep : currentParentChildren){ currentParentChildrenList.add(someStep.getName()); } - String newList = this.getStringFromVector(currentParentChildrenList,true); + String newList = this.getStringFromArrayList(currentParentChildrenList,true); parentStepsNode.limits=newList; try{ OtdbRmi.getRemoteMaintenance().saveNode(parentStepsNode); @@ -295,12 +292,9 @@ public class BBSStepDataManager{ jOTDBnode strategyStepsParameter=null; //retrieve 1 levels of parameters to locate Step.XXX.Steps - Vector HWchilds = OtdbRmi.getRemoteMaintenance().getItemList(parentOTDBnode.treeID(), parentOTDBnode.nodeID(), 1); + ArrayList<jOTDBnode> HWchilds = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(parentOTDBnode.treeID(), parentOTDBnode.nodeID(), 1)); // get all the params per child - Enumeration e1 = HWchilds.elements(); - while( e1.hasMoreElements() ) { - - jOTDBnode aHWNode = (jOTDBnode)e1.nextElement(); + for(jOTDBnode aHWNode:HWchilds) { strategyStepsParameter=null; //retrieving Steps if (aHWNode.leaf && aHWNode.name.equals("Steps")) { @@ -308,15 +302,15 @@ public class BBSStepDataManager{ logger.trace("Strategy Steps defined :"+strategyStepsParameter.limits); } else if (aHWNode.leaf && aHWNode.name.equals("Sources")) { if(!aHWNode.limits.equals("")){ - stepDataObject.setSources(this.getVectorFromString(aHWNode.limits,true)); + stepDataObject.setSources(this.getArrayListFromString(aHWNode.limits,true)); } } else if (aHWNode.leaf && aHWNode.name.equals("ExtraSources")) { if(!aHWNode.limits.equals("")){ - stepDataObject.setExtraSources(this.getVectorFromString(aHWNode.limits,true)); + stepDataObject.setExtraSources(this.getArrayListFromString(aHWNode.limits,true)); } } else if (aHWNode.leaf && aHWNode.name.equals("InstrumentModel")) { if(!aHWNode.limits.equals("")){ - stepDataObject.setInstrumentModel(this.getVectorFromString(aHWNode.limits,true)); + stepDataObject.setInstrumentModel(this.getArrayListFromString(aHWNode.limits,true)); } } else if (aHWNode.leaf && aHWNode.name.equals("OutputData")) { stepDataObject.setOutputDataColumn(aHWNode.limits); @@ -331,11 +325,9 @@ public class BBSStepDataManager{ stepDataObject.setOperationName(value); } } else if (!aHWNode.leaf && aHWNode.name.equals("Correlation")) { - Vector correlationParms = this.retrieveChildDataForNode(aHWNode); + ArrayList<jOTDBnode> correlationParms = this.retrieveChildDataForNode(aHWNode); - Enumeration ce = correlationParms.elements(); - while( ce.hasMoreElements() ) { - jOTDBnode aCENode = (jOTDBnode)ce.nextElement(); + for (jOTDBnode aCENode:correlationParms) { if (aCENode.leaf && aCENode.name.equals("Selection")) { if(!aCENode.limits.equals("")){ @@ -343,33 +335,29 @@ public class BBSStepDataManager{ } } else if (aCENode.leaf && aCENode.name.equals("Type")) { if(!aCENode.limits.equals("")){ - stepDataObject.setCorrelationType(this.getVectorFromString(aCENode.limits,true)); + stepDataObject.setCorrelationType(this.getArrayListFromString(aCENode.limits,true)); } } } } else if (!aHWNode.leaf && aHWNode.name.equals("Baselines")) { - Vector baselinesParms = this.retrieveChildDataForNode(aHWNode); + ArrayList<jOTDBnode> baselinesParms = this.retrieveChildDataForNode(aHWNode); - Enumeration ce = baselinesParms.elements(); - while( ce.hasMoreElements() ) { - jOTDBnode aCENode = (jOTDBnode)ce.nextElement(); + for (jOTDBnode aCENode:baselinesParms) { if (aCENode.leaf && aCENode.name.equals("Station1")) { if(!aCENode.limits.equals("")){ - stepDataObject.setStation1Selection(this.getVectorFromString(aCENode.limits,true)); + stepDataObject.setStation1Selection(this.getArrayListFromString(aCENode.limits,true)); } } else if (aCENode.leaf && aCENode.name.equals("Station2")) { if(!aCENode.limits.equals("")){ - stepDataObject.setStation2Selection(this.getVectorFromString(aCENode.limits,true)); + stepDataObject.setStation2Selection(this.getArrayListFromString(aCENode.limits,true)); } } } } else if (!aHWNode.leaf && aHWNode.name.equals("Integration")) { - Vector baselinesParms = this.retrieveChildDataForNode(aHWNode); + ArrayList<jOTDBnode> baselinesParms = this.retrieveChildDataForNode(aHWNode); - Enumeration ce = baselinesParms.elements(); - while( ce.hasMoreElements() ) { - jOTDBnode aCENode = (jOTDBnode)ce.nextElement(); + for (jOTDBnode aCENode: baselinesParms) { if (aCENode.leaf && aCENode.name.equals("Time")) { if(!aCENode.limits.equals("")){ @@ -386,17 +374,14 @@ public class BBSStepDataManager{ if(strategyStepsParameter!=null){ //retrieve the step names mentioned in the steps parameter (XXX.Steps) - Vector<String> strategySteps = this.getVectorFromString(strategyStepsParameter.limits,true); + ArrayList<String> strategySteps = this.getArrayListFromString(strategyStepsParameter.limits,true); if(strategySteps.size()>0){ //Get all the steps present in the BBS Step Container - Vector stepsVector = OtdbRmi.getRemoteMaintenance().getItemList(parentOTDBnode.treeID(), parentOTDBnode.parentID(), 1); + ArrayList<jOTDBnode> stepsArrayList = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(parentOTDBnode.treeID(), parentOTDBnode.parentID(), 1)); for(String aStep : strategySteps){ - Enumeration se = stepsVector.elements(); - //loop through steps - while( se.hasMoreElements() ) { - jOTDBnode aHWNode = (jOTDBnode)se.nextElement(); + for (jOTDBnode aHWNode:stepsArrayList) { //limiting the search for steps that are mentioned in the strategy steps parameter (Strategy.Steps) if (!aHWNode.leaf && aHWNode.name.equals(aStep)) { //Create a new step and build it (with its substeps as well) @@ -414,12 +399,9 @@ public class BBSStepDataManager{ //another iteration to collect operation type attributes if(stepDataObject.getOperationName() !=null){ - Vector HWchilds2 = OtdbRmi.getRemoteMaintenance().getItemList(parentOTDBnode.treeID(), parentOTDBnode.nodeID(), 1); + ArrayList<jOTDBnode> HWchilds2 = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(parentOTDBnode.treeID(), parentOTDBnode.nodeID(), 1)); // get all the params per child - Enumeration e2 = HWchilds2.elements(); - while( e2.hasMoreElements() ) { - - jOTDBnode aHWNode = (jOTDBnode)e2.nextElement(); + for (jOTDBnode aHWNode:HWchilds2) { /* * This operation only supports operation node attributes of up to two levels deep. * @@ -427,22 +409,18 @@ public class BBSStepDataManager{ * Predict.DomainSize.Integration.Freq is NOT supported... */ if (!aHWNode.leaf && aHWNode.name.equals(stepDataObject.getOperationName())){ - Vector operationParms = this.retrieveChildDataForNode(aHWNode); + ArrayList<jOTDBnode> operationParms = this.retrieveChildDataForNode(aHWNode); - Enumeration ce = operationParms.elements(); - while( ce.hasMoreElements() ) { - jOTDBnode aCENode = (jOTDBnode)ce.nextElement(); + for (jOTDBnode aCENode:operationParms) { if (aCENode.leaf){ if(!aCENode.limits.equals("")){ stepDataObject.addOperationAttribute(LofarUtils.keyName(aCENode.name),aCENode.limits); } } else { - Vector operationSubParms = this.retrieveChildDataForNode(aCENode); + ArrayList<jOTDBnode> operationSubParms = this.retrieveChildDataForNode(aCENode); - Enumeration cse = operationSubParms.elements(); - while( cse.hasMoreElements() ) { - jOTDBnode aCSENode = (jOTDBnode)cse.nextElement(); + for (jOTDBnode aCSENode:operationSubParms) { if (aCSENode.leaf){ if(!aCSENode.limits.equals("")){ stepDataObject.addOperationAttribute(LofarUtils.keyName(aCENode.name)+"."+LofarUtils.keyName(aCSENode.name),aCSENode.limits); @@ -473,12 +451,8 @@ public class BBSStepDataManager{ jOTDBnode existingStepNode = null; //check if the step is present in the Step Container - Vector stepsVector = retrieveChildDataForNode(stepsNode); - Enumeration se = stepsVector.elements(); - - //loop through steps - while( se.hasMoreElements() ) { - jOTDBnode aHWNode = (jOTDBnode)se.nextElement(); + ArrayList<jOTDBnode> stepsArrayList = retrieveChildDataForNode(stepsNode); + for (jOTDBnode aHWNode:stepsArrayList) { //delete the standard bbs step found in the template tree if(aHWNode.name.equals("DefaultBBSStep")){ @@ -529,7 +503,7 @@ public class BBSStepDataManager{ //collect components that are part of the operation type... if(currentDataForStep.getOperationAttributes() != null){ - Vector<String> toBeAddedSubComponents = new Vector<String>(); + ArrayList<String> toBeAddedSubComponents = new ArrayList<>(); for(String someOperationAttribute : currentDataForStep.getOperationAttributes().keySet()){ String[] splitter = someOperationAttribute.split("[.]"); if(splitter.length>1){ @@ -546,18 +520,15 @@ public class BBSStepDataManager{ } newStepNode = OtdbRmi.getRemoteMaintenance().getNode(stepContainerNode.treeID(),newStepNodeID); - Vector stepParametersVector = retrieveChildDataForNode(newStepNode); - Enumeration spe = stepParametersVector.elements(); - - while( spe.hasMoreElements() ) { - jOTDBnode aHWNode = (jOTDBnode)spe.nextElement(); + ArrayList<jOTDBnode> stepParametersArrayList = retrieveChildDataForNode(newStepNode); + for (jOTDBnode aHWNode:stepParametersArrayList) { //do all BBS Step parameters //sources if(aHWNode.name.equals("Sources")){ if ( currentDataForStep.getSources() != null){ - aHWNode.limits = this.getStringFromVector(currentDataForStep.getSources(),true); + aHWNode.limits = this.getStringFromArrayList(currentDataForStep.getSources(),true); OtdbRmi.getRemoteMaintenance().saveNode(aHWNode); }else{ OtdbRmi.getRemoteMaintenance().deleteNode(aHWNode); @@ -566,7 +537,7 @@ public class BBSStepDataManager{ //extra sources else if(aHWNode.name.equals("ExtraSources")){ if ( currentDataForStep.getExtraSources() != null){ - aHWNode.limits = this.getStringFromVector(currentDataForStep.getExtraSources(),true); + aHWNode.limits = this.getStringFromArrayList(currentDataForStep.getExtraSources(),true); OtdbRmi.getRemoteMaintenance().saveNode(aHWNode); }else{ OtdbRmi.getRemoteMaintenance().deleteNode(aHWNode); @@ -585,7 +556,7 @@ public class BBSStepDataManager{ //instrument data model else if(aHWNode.name.equals("InstrumentModel")){ if ( currentDataForStep.getInstrumentModel() != null){ - aHWNode.limits = this.getStringFromVector(currentDataForStep.getInstrumentModel(),true); + aHWNode.limits = this.getStringFromArrayList(currentDataForStep.getInstrumentModel(),true); OtdbRmi.getRemoteMaintenance().saveNode(aHWNode); }else{ OtdbRmi.getRemoteMaintenance().deleteNode(aHWNode); @@ -595,11 +566,9 @@ public class BBSStepDataManager{ //Integration else if (!aHWNode.leaf && aHWNode.name.equals("Integration")) { - Vector baselinesParms = this.retrieveChildDataForNode(aHWNode); + ArrayList<jOTDBnode> baselinesParms = this.retrieveChildDataForNode(aHWNode); int presentParams = 0; - Enumeration ce = baselinesParms.elements(); - while( ce.hasMoreElements() ) { - jOTDBnode aCENode = (jOTDBnode)ce.nextElement(); + for (jOTDBnode aCENode:baselinesParms) { //Time @@ -633,17 +602,15 @@ public class BBSStepDataManager{ //Correlation else if (!aHWNode.leaf && aHWNode.name.equals("Correlation")) { - Vector baselinesParms = this.retrieveChildDataForNode(aHWNode); + ArrayList<jOTDBnode> baselinesParms = this.retrieveChildDataForNode(aHWNode); int presentParams = 0; - Enumeration ce = baselinesParms.elements(); - while( ce.hasMoreElements() ) { - jOTDBnode aCENode = (jOTDBnode)ce.nextElement(); + for (jOTDBnode aCENode:baselinesParms) { //Type if (aCENode.leaf && aCENode.name.equals("Type")) { if ( currentDataForStep.getCorrelationType() != null){ - aCENode.limits = this.getStringFromVector(currentDataForStep.getCorrelationType(),true); + aCENode.limits = this.getStringFromArrayList(currentDataForStep.getCorrelationType(),true); OtdbRmi.getRemoteMaintenance().saveNode(aCENode); presentParams++; }else{ @@ -670,17 +637,15 @@ public class BBSStepDataManager{ //Baseline Selection else if (!aHWNode.leaf && aHWNode.name.equals("Baselines")) { - Vector baselinesParms = this.retrieveChildDataForNode(aHWNode); + ArrayList<jOTDBnode> baselinesParms = this.retrieveChildDataForNode(aHWNode); int presentParams = 0; - Enumeration ce = baselinesParms.elements(); - while( ce.hasMoreElements() ) { - jOTDBnode aCENode = (jOTDBnode)ce.nextElement(); + for (jOTDBnode aCENode:baselinesParms) { //Time if (aCENode.leaf && aCENode.name.equals("Station1")) { if ( currentDataForStep.getStation1Selection() != null){ - aCENode.limits = getStringFromVector(currentDataForStep.getStation1Selection(),true); + aCENode.limits = getStringFromArrayList(currentDataForStep.getStation1Selection(),true); OtdbRmi.getRemoteMaintenance().saveNode(aCENode); presentParams++; }else{ @@ -691,7 +656,7 @@ public class BBSStepDataManager{ } else if (aCENode.leaf && aCENode.name.equals("Station2")) { if ( currentDataForStep.getStation2Selection() != null){ - aCENode.limits = getStringFromVector(currentDataForStep.getStation2Selection(),true); + aCENode.limits = getStringFromArrayList(currentDataForStep.getStation2Selection(),true); OtdbRmi.getRemoteMaintenance().saveNode(aCENode); presentParams++; }else{ @@ -718,10 +683,8 @@ public class BBSStepDataManager{ else if (!aHWNode.leaf && aHWNode.name.equals(currentDataForStep.getOperationName())) { int presentParams = 0; if(currentDataForStep.getOperationAttributes()!=null){ - Vector attributeParms = this.retrieveChildDataForNode(aHWNode); - Enumeration ce = attributeParms.elements(); - while( ce.hasMoreElements() ) { - jOTDBnode aCENode = (jOTDBnode)ce.nextElement(); + ArrayList<jOTDBnode> attributeParms = this.retrieveChildDataForNode(aHWNode); + for (jOTDBnode aCENode:attributeParms) { /* * This operation only supports operation node attributes of up to two levels deep. * @@ -740,11 +703,9 @@ public class BBSStepDataManager{ } //parameter node inside Operation } else if (!aCENode.leaf){ - Vector attributeSubParms = this.retrieveChildDataForNode(aCENode); + ArrayList<jOTDBnode> attributeSubParms = this.retrieveChildDataForNode(aCENode); int presentSubParams = 0; - Enumeration cse = attributeSubParms.elements(); - while( cse.hasMoreElements() ) { - jOTDBnode aCSENode = (jOTDBnode)cse.nextElement(); + for (jOTDBnode aCSENode:attributeSubParms) { String toBeInsertedSubValue = currentDataForStep.getOperationAttribute(LofarUtils.keyName(aCENode.name)+"."+LofarUtils.keyName(aCSENode.name)); if ( toBeInsertedSubValue != null){ aCSENode.limits = toBeInsertedSubValue; @@ -770,13 +731,13 @@ public class BBSStepDataManager{ //add other variables... //add name pointers to the child steps else if(aHWNode.name.equals("Steps")){ - Vector<BBSStep> itsChildSteps = aBBSStep.getChildSteps(); + ArrayList<BBSStep> itsChildSteps = aBBSStep.getChildSteps(); if(itsChildSteps != null && itsChildSteps.size() > 0){ - Vector<String> childStepNames = new Vector<String>(); + ArrayList<String> childStepNames = new ArrayList<>(); for(BBSStep aChildStep : itsChildSteps){ childStepNames.add(aChildStep.getName()); } - aHWNode.limits = this.getStringFromVector(childStepNames,true); + aHWNode.limits = this.getStringFromArrayList(childStepNames,true); OtdbRmi.getRemoteMaintenance().saveNode(aHWNode); }else{ OtdbRmi.getRemoteMaintenance().deleteNode(aHWNode); @@ -814,11 +775,9 @@ public class BBSStepDataManager{ } //remove all steps - Vector parentParmVector = this.retrieveChildDataForNode(this.getStepContainerNode()); - Enumeration ppe = parentParmVector.elements(); + ArrayList<jOTDBnode> parentParmArrayList = this.retrieveChildDataForNode(this.getStepContainerNode()); //loop through steps and delete the step that matches with the step provided - while( ppe.hasMoreElements() ) { - jOTDBnode aHWNode = (jOTDBnode)ppe.nextElement(); + for (jOTDBnode aHWNode:parentParmArrayList) { try { OtdbRmi.getRemoteMaintenance().deleteNode(aHWNode); } catch (RemoteException ex) { @@ -915,14 +874,14 @@ public class BBSStepDataManager{ return returnData; } /** - * Helper method that retrieves a Vector of strings out of a String representation thereof. + * Helper method that retrieves a ArrayList of strings out of a String representation thereof. * - * @parm theList the String representation of a Vector to convert + * @parm theList the String representation of a ArrayList to convert * @parm removeQuotes tells if quotes are/are not present in the String and should/should not be removed in the process. - * @return Vector of Strings extrapolated from theList. + * @return ArrayList of Strings extrapolated from theList. */ - private Vector<String> getVectorFromString(String theList,boolean removeQuotes) { - Vector<String> listItems = new Vector<String>(); + private ArrayList<String> getArrayListFromString(String theList,boolean removeQuotes) { + ArrayList<String> listItems = new ArrayList<>(); String aList = theList; if (aList.startsWith("[")) { aList = aList.substring(1,aList.length()); @@ -943,17 +902,17 @@ public class BBSStepDataManager{ return listItems; } /** - * Helper method that retrieves a String representation of a Vector of strings. + * Helper method that retrieves a String representation of a ArrayList of strings. * - * @parm aStringVector the String Vector to convert to a String representation. + * @parm aStringArrayList the String ArrayList to convert to a String representation. * @parm createQuotes tells if quotes should/should not be added in the process. - * @return String representation of aStringVector. + * @return String representation of aStringArrayList. */ - private String getStringFromVector(Vector<String> aStringVector,boolean createQuotes) { + private String getStringFromArrayList(ArrayList<String> aStringArrayList,boolean createQuotes) { String aList="["; - if (aStringVector.size() > 0) { + if (aStringArrayList.size() > 0) { int i = 0; - for (String aString : aStringVector){ + for (String aString : aStringArrayList){ if(i>0) aList+= ","; if(createQuotes){ aList += "\""; @@ -969,15 +928,15 @@ public class BBSStepDataManager{ return aList; } /** - * Helper method that retrieves a Vector of jOTDBnode objects that are the child of aNode. + * Helper method that retrieves a ArrayList of jOTDBnode objects that are the child of aNode. * * @parm aNode the jOTDBnode to retrieve the child nodes for. - * @return Vector of child jOTDBnode objects. + * @return ArrayList of child jOTDBnode objects. */ - private Vector retrieveChildDataForNode(jOTDBnode aNode){ - Vector HWchilds = new Vector(); + private ArrayList retrieveChildDataForNode(jOTDBnode aNode){ + ArrayList HWchilds = new ArrayList(); try { - HWchilds = OtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1); + HWchilds = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1)); // get all the params per child } catch (RemoteException ex) { logger.error("Error during retrieveChildDataForNode!", ex); @@ -993,13 +952,10 @@ public class BBSStepDataManager{ private jOTDBnode getStrategyStepsNode(jOTDBnode stepContainerNode){ jOTDBnode strategyStepsParameter=null; try { - Vector HWchilds = null; - HWchilds = OtdbRmi.getRemoteMaintenance().getItemList(stepContainerNode.treeID(), stepContainerNode.parentID(), 2); + ArrayList<jOTDBnode> HWchilds = null; + HWchilds = new ArrayList(OtdbRmi.getRemoteMaintenance().getItemList(stepContainerNode.treeID(), stepContainerNode.parentID(), 2)); // get all the params per child - Enumeration e1 = HWchilds.elements(); - while( e1.hasMoreElements() ) { - - jOTDBnode aHWNode = (jOTDBnode)e1.nextElement(); + for (jOTDBnode aHWNode: HWchilds) { strategyStepsParameter=null; //retrieving Strategy.Steps if (aHWNode.leaf && aHWNode.name.equals("Steps")) { @@ -1024,11 +980,9 @@ public class BBSStepDataManager{ int returnId = 0; try { if(BBSStepDataManager.OTDBcomponentCache==null){ - OTDBcomponentCache = OtdbRmi.getRemoteMaintenance().getComponentList("%",false); + OTDBcomponentCache = new ArrayList(OtdbRmi.getRemoteMaintenance().getComponentList("%",false)); } - Enumeration ce = OTDBcomponentCache.elements(); - while (ce.hasMoreElements()){ - jVICnodeDef aDef = (jVICnodeDef)ce.nextElement(); + for (jVICnodeDef aDef:OTDBcomponentCache) { if(aDef.name.equals(nodeName)){ returnId = aDef.nodeID(); } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepExplorerPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepExplorerPanel.form index 011db9081701f5511d649d4bd9d1873038260d0c..72c59e90695230335e47571ae84a28a888df9c8c 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepExplorerPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepExplorerPanel.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepExplorerPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepExplorerPanel.java index 826acffae9bba68a308d8514295a0f9eb15c947f..0d49e6b48025f4007844f886a5e3ea6b43ed9659 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepExplorerPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStepExplorerPanel.java @@ -25,7 +25,7 @@ package nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement; import java.awt.Color; import java.awt.event.ActionEvent; import java.util.HashMap; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.DefaultListModel; import javax.swing.JList; import javax.swing.JOptionPane; @@ -52,7 +52,7 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ public final static Color NOT_INHERITED_FROM_PARENT = new Color(204,255,204); public final static Color DEFAULT = Color.WHITE; - private static HashMap<String,String> stepOperationPanels = new HashMap<String,String>(); + private static HashMap<String,String> stepOperationPanels = new HashMap<>(); private IBBSStepOperationPanel currentStepOperationsPanel = null; private BBSStep itsBBSStep = null; @@ -184,7 +184,7 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ //sources stepExplorerNSources.setBackground(DEFAULT); - this.fillList(this.stepExplorerNSourcesList,new Vector<String>()); + this.fillList(this.stepExplorerNSourcesList,new ArrayList<String>()); if(stepData.getSources() != null){ if(stepData.getSources().size()>0){ this.useAllSourcesCheckbox.setSelected(false); @@ -214,7 +214,7 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ //instrument model stepExplorerInstrumentModel.setBackground(DEFAULT); - this.fillList(this.stepExplorerInstrumentModelList,new Vector<String>()); + this.fillList(this.stepExplorerInstrumentModelList,new ArrayList<String>()); if(stepData.getInstrumentModel() != null){ if(stepData.getInstrumentModel().size()>0){ this.noInstrumentModelCheckbox.setSelected(false); @@ -245,7 +245,7 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ // //extra sources // stepExplorerESources.setBackground(DEFAULT); // this.stepExplorerModifyESourceText.setText(""); -// this.fillList(this.stepExplorerESourcesList,new Vector<String>()); +// this.fillList(this.stepExplorerESourcesList,new ArrayList<String>()); // if(stepData.getExtraSources() != null){ // if(stepData.getExtraSources().size()>0){ // this.useExtraSourcesCheckbox.setSelected(true); @@ -337,16 +337,16 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ //type this.stepExplorerCorrelationTypeList.setBackground(DEFAULT); if(stepData.getCorrelationType() != null){ - this.fillSelectionListFromVector(stepExplorerCorrelationTypeList,stepData.getCorrelationType()); + this.fillSelectionListFromArrayList(stepExplorerCorrelationTypeList,stepData.getCorrelationType()); this.stepExplorerCorrelationTypeList.setBackground(NOT_INHERITED_FROM_PARENT); }else{ if(inheritedData.getCorrelationType() != null){ - this.fillSelectionListFromVector(stepExplorerCorrelationTypeList,inheritedData.getCorrelationType()); + this.fillSelectionListFromArrayList(stepExplorerCorrelationTypeList,inheritedData.getCorrelationType()); stepExplorerCorrelationTypeList.setBackground(INHERITED_FROM_PARENT); }else{ - this.fillSelectionListFromVector(stepExplorerCorrelationTypeList,new Vector<String>()); + this.fillSelectionListFromArrayList(stepExplorerCorrelationTypeList,new ArrayList<String>()); stepExplorerCorrelationTypeList.setBackground(NOT_DEFINED); } } @@ -369,25 +369,25 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ this.BaselineSelectionPanel.setBackground(DEFAULT); this.baselineStation1Text.setText(""); this.baselineStation2Text.setText(""); - this.fillBaselineTableFromVectors(new Vector<String>(),new Vector<String>()); + this.fillBaselineTableFromArrayLists(new ArrayList<String>(),new ArrayList<String>()); if(stepData.getStation1Selection() != null && stepData.getStation2Selection() != null){ - Vector<String> station1 = stepData.getStation1Selection(); - Vector<String> station2 = stepData.getStation2Selection(); + ArrayList<String> station1 = stepData.getStation1Selection(); + ArrayList<String> station2 = stepData.getStation2Selection(); if(station1.size()>0 && station2.size()>0){ this.baselineUseAllCheckbox.setSelected(false); - this.fillBaselineTableFromVectors(station1,station2); + this.fillBaselineTableFromArrayLists(station1,station2); }else{ this.baselineUseAllCheckbox.setSelected(true); } this.BaselineSelectionPanel.setBackground(NOT_INHERITED_FROM_PARENT); }else{ if(inheritedData.getStation1Selection() != null && inheritedData.getStation2Selection() != null){ - Vector<String> station1 = inheritedData.getStation1Selection(); - Vector<String> station2 = inheritedData.getStation2Selection(); + ArrayList<String> station1 = inheritedData.getStation1Selection(); + ArrayList<String> station2 = inheritedData.getStation2Selection(); if(station1.size()>0 && station2.size()>0){ this.baselineUseAllCheckbox.setSelected(false); - this.fillBaselineTableFromVectors(station1,station2); + this.fillBaselineTableFromArrayLists(station1,station2); }else{ this.baselineUseAllCheckbox.setSelected(true); } @@ -429,18 +429,18 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ BBSStepData inheritedData = BBSStepDataManager.getInstance().getInheritedStepData(aStep); //normal sources - Vector<String> sources = createList(stepExplorerNSourcesList); + ArrayList<String> sources = createList(stepExplorerNSourcesList); if(this.useAllSourcesCheckbox.isSelected()){ - sources = new Vector<String>(); + sources = new ArrayList<>(); } if(sources.equals(inheritedData.getSources())){ aStepData.setSources(null); }else{ if(this.useAllSourcesCheckbox.isSelected()){ - aStepData.setSources(new Vector<String>()); + aStepData.setSources(new ArrayList<String>()); }else{ if(sources.size()>0){ - aStepData.setSources(new Vector<String>()); + aStepData.setSources(new ArrayList<String>()); }else{ aStepData.setSources(null); } @@ -455,18 +455,18 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ //instrument model - Vector<String> imodels = createList(stepExplorerInstrumentModelList); + ArrayList<String> imodels = createList(stepExplorerInstrumentModelList); if(this.noInstrumentModelCheckbox.isSelected()){ - imodels = new Vector<String>(); + imodels = new ArrayList<>(); } if(imodels.equals(inheritedData.getInstrumentModel())){ aStepData.setInstrumentModel(null); }else{ if(this.noInstrumentModelCheckbox.isSelected()){ - aStepData.setInstrumentModel(new Vector<String>()); + aStepData.setInstrumentModel(new ArrayList<String>()); }else{ if(imodels.size()>0){ - aStepData.setInstrumentModel(new Vector<String>()); + aStepData.setInstrumentModel(new ArrayList<String>()); }else{ aStepData.setInstrumentModel(null); } @@ -481,18 +481,18 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ /* //instrument model - Vector<String> imodels = createVectorFromSelectionList(stepExplorerInstrumentModelList); + ArrayList<String> imodels = createArrayListFromSelectionList(stepExplorerInstrumentModelList); if(this.noInstrumentModelCheckbox.isSelected()){ - imodels = new Vector<String>(); + imodels = new ArrayList<String>(); } if(imodels.equals(inheritedData.getInstrumentModel())){ aStepData.setInstrumentModel(null); }else{ if(this.noInstrumentModelCheckbox.isSelected()){ - aStepData.setInstrumentModel(new Vector<String>()); + aStepData.setInstrumentModel(new ArrayList<String>()); }else{ if(imodels.size()>0){ - aStepData.setInstrumentModel(new Vector<String>()); + aStepData.setInstrumentModel(new ArrayList<String>()); }else{ aStepData.setInstrumentModel(null); } @@ -507,18 +507,18 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ */ //extra sources -// Vector<String> esources = createList(stepExplorerESourcesList); +// ArrayList<String> esources = createList(stepExplorerESourcesList); // if(!this.useExtraSourcesCheckbox.isSelected()){ -// esources = new Vector<String>(); +// esources = new ArrayList<String>(); // } // if(esources.equals(inheritedData.getExtraSources())){ // aStepData.setExtraSources(null); // }else{ // if(!this.useExtraSourcesCheckbox.isSelected()){ -// aStepData.setExtraSources(new Vector<String>()); +// aStepData.setExtraSources(new ArrayList<String>()); // }else{ // if(esources.size()>0){ -// aStepData.setExtraSources(new Vector<String>()); +// aStepData.setExtraSources(new ArrayList<String>()); // }else{ // aStepData.setExtraSources(null); // } @@ -591,18 +591,18 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ //Correlation //Type - if(this.createVectorFromSelectionList(this.stepExplorerCorrelationTypeList).size()==0){ + if(this.createArrayListFromSelectionList(this.stepExplorerCorrelationTypeList).isEmpty()){ aStepData.setCorrelationType(null); }else{ - if(createVectorFromSelectionList(stepExplorerCorrelationTypeList).equals(inheritedData.getCorrelationType())){ + if(createArrayListFromSelectionList(stepExplorerCorrelationTypeList).equals(inheritedData.getCorrelationType())){ aStepData.setCorrelationType(null); }else{ - aStepData.setCorrelationType(new Vector<String>()); + aStepData.setCorrelationType(new ArrayList<String>()); } } if(aStepData.getCorrelationType()!=null){ - if(!createVectorFromSelectionList(stepExplorerCorrelationTypeList).equals(aStepData.getCorrelationType())){ - aStepData.setCorrelationType(createVectorFromSelectionList(stepExplorerCorrelationTypeList)); + if(!createArrayListFromSelectionList(stepExplorerCorrelationTypeList).equals(aStepData.getCorrelationType())){ + aStepData.setCorrelationType(createArrayListFromSelectionList(stepExplorerCorrelationTypeList)); } } //Selection @@ -630,21 +630,21 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ } //baseline selection - Vector<Vector<String>> baselines = createVectorsFromBaselineTable(); - Vector<String> station1 = baselines.get(0); - Vector<String> station2 = baselines.get(1); + ArrayList<ArrayList<String>> baselines = createArrayListsFromBaselineTable(); + ArrayList<String> station1 = baselines.get(0); + ArrayList<String> station2 = baselines.get(1); if(this.baselineUseAllCheckbox.isSelected()){ - station1 = new Vector<String>(); - station2 = new Vector<String>(); + station1 = new ArrayList<>(); + station2 = new ArrayList<>(); } if(station1.equals(inheritedData.getStation1Selection()) && station2.equals(inheritedData.getStation2Selection())){ aStepData.setStation1Selection(null); }else{ if(this.baselineUseAllCheckbox.isSelected()){ - aStepData.setStation1Selection(new Vector<String>()); + aStepData.setStation1Selection(new ArrayList<String>()); }else{ if(station1.size()>0 && station2.size()>0){ - aStepData.setStation1Selection(new Vector<String>()); + aStepData.setStation1Selection(new ArrayList<String>()); }else{ aStepData.setStation1Selection(null); } @@ -657,10 +657,10 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ aStepData.setStation2Selection(null); }else{ if(this.baselineUseAllCheckbox.isSelected()){ - aStepData.setStation2Selection(new Vector<String>()); + aStepData.setStation2Selection(new ArrayList<String>()); }else{ if(station1.size()>0 && station2.size()>0){ - aStepData.setStation2Selection(new Vector<String>()); + aStepData.setStation2Selection(new ArrayList<String>()); }else{ aStepData.setStation2Selection(null); } @@ -713,7 +713,7 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ HashMap<String,String> oldValuesFromStep = aStepData.getOperationAttributes(); - if(oldValuesFromStep == null) oldValuesFromStep = new HashMap<String,String>(); + if(oldValuesFromStep == null) oldValuesFromStep = new HashMap<>(); for(String aKey : valuesFromForm.keySet()){ if(oldValuesFromStep.containsKey(aKey)){ @@ -751,13 +751,13 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ } /** - * Helper method that builds a String Vector representation of the contents of a JList. + * Helper method that builds a String ArrayList representation of the contents of a JList. * - * @parm aListComponent the JList component to build a String Vector representation for. - * @return String Vector representation of the contents of the given JList. + * @parm aListComponent the JList component to build a String ArrayList representation for. + * @return String ArrayList representation of the contents of the given JList. */ - private Vector<String> createList(JList aListComponent) { - Vector<String> aList = new Vector<String>(); + private ArrayList<String> createList(JList aListComponent) { + ArrayList<String> aList = new ArrayList<>(); if (aListComponent.getModel().getSize() > 0) { for (int i=0; i < aListComponent.getModel().getSize();i++) { aList.add(aListComponent.getModel().getElementAt(i).toString()); @@ -767,12 +767,12 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ } /** - * Helper method that fills a JList with a String Vector representation of a JList. + * Helper method that fills a JList with a String ArrayList representation of a JList. * * @parm aListComponent the JList to fill - * @parm theList the String Vector to fill the JList with. + * @parm theList the String ArrayList to fill the JList with. */ - private void fillList(JList aListComponent,Vector<String> theList) { + private void fillList(JList aListComponent,ArrayList<String> theList) { DefaultListModel itsModel = new DefaultListModel(); aListComponent.setModel(itsModel); for(String anItem : theList){ @@ -782,13 +782,13 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ } /** - * Helper method that builds a String Vector representation of the <i>selected</i> contents of a JList. + * Helper method that builds a String ArrayList representation of the <i>selected</i> contents of a JList. * - * @parm aListComponent the JList component to build a String Vector representation for. - * @return String Vector representation of the <i>selected</i> contents of the given JList. + * @parm aListComponent the JList component to build a String ArrayList representation for. + * @return String ArrayList representation of the <i>selected</i> contents of the given JList. */ - private Vector<String> createVectorFromSelectionList(JList aListComponent) { - Vector<String> aList= new Vector<String>(); + private ArrayList<String> createArrayListFromSelectionList(JList aListComponent) { + ArrayList<String> aList= new ArrayList<>(); int[] selectedIndices = aListComponent.getSelectedIndices(); if (selectedIndices.length > 0) { for (int i=0; i < selectedIndices.length;i++) { @@ -799,12 +799,12 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ } /** - * Helper method that selects items in a JList with a String Vector representation of the selected items of a JList. + * Helper method that selects items in a JList with a String ArrayList representation of the selected items of a JList. * * @parm aListComponent the JList to select items in. - * @parm theList the String Vector to select items in the JList with. + * @parm theList the String ArrayList to select items in the JList with. */ - private void fillSelectionListFromVector(JList aListComponent,Vector<String> theList) { + private void fillSelectionListFromArrayList(JList aListComponent,ArrayList<String> theList) { int[] toBeSelectedIndices = new int[theList.size()]; int aValueIndex = 0; if(theList.size()>0){ @@ -826,12 +826,12 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ } /** - * Helper method that fills the Baseline table with the Station1 and Station2 Vectors + * Helper method that fills the Baseline table with the Station1 and Station2 ArrayLists * - * @parm station1 the Station1 part of the Baseline pair of Vectors. - * @parm station2 the Station2 part of the Baseline pair of Vectors. + * @parm station1 the Station1 part of the Baseline pair of ArrayLists. + * @parm station2 the Station2 part of the Baseline pair of ArrayLists. */ - private void fillBaselineTableFromVectors(Vector<String> station1,Vector<String> station2) { + private void fillBaselineTableFromArrayLists(ArrayList<String> station1,ArrayList<String> station2) { baselineStationsTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -853,37 +853,37 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ if(station1.size() == station2.size()){ for(int i = 0; i<station1.size();i++){ - Vector<String> newRow = new Vector<String>(); + ArrayList<String> newRow = new ArrayList<>(); newRow.add(station1.get(i)); newRow.add(station2.get(i)); - bsltm.addRow(newRow); + bsltm.addRow(newRow.toArray()); } } } /** - * Helper method that creates the Station1 and Station2 vectors out of the items in the Baseline table + * Helper method that creates the Station1 and Station2 ArrayLists out of the items in the Baseline table * - * @return Vector containing 2 String Vectors : Station1 (index 0) and Station2 (index 1). + * @return ArrayList containing 2 String ArrayLists : Station1 (index 0) and Station2 (index 1). */ - private Vector<Vector<String>> createVectorsFromBaselineTable(){ - Vector<Vector<String>> returnVector = new Vector<Vector<String>>(); - Vector<String> station1Vector = new Vector<String>(); - Vector<String> station2Vector = new Vector<String>(); + private ArrayList<ArrayList<String>> createArrayListsFromBaselineTable(){ + ArrayList<ArrayList<String>> returnArrayList = new ArrayList<>(); + ArrayList<String> station1ArrayList = new ArrayList<>(); + ArrayList<String> station2ArrayList = new ArrayList<>(); DefaultTableModel bsltm = (DefaultTableModel)baselineStationsTable.getModel(); if(bsltm.getRowCount()>0){ for(int i = 0; i<bsltm.getRowCount();i++){ - String station1 = ((Vector)bsltm.getDataVector().elementAt(i)).elementAt(0).toString(); - String station2 = ((Vector)bsltm.getDataVector().elementAt(i)).elementAt(1).toString(); - station1Vector.add(station1); - station2Vector.add(station2); + String station1 = ((ArrayList)bsltm.getDataVector().elementAt(i)).get(0).toString(); + String station2 = ((ArrayList)bsltm.getDataVector().elementAt(i)).get(1).toString(); + station1ArrayList.add(station1); + station2ArrayList.add(station2); } } - returnVector.add(station1Vector); - returnVector.add(station2Vector); + returnArrayList.add(station1ArrayList); + returnArrayList.add(station2ArrayList); - return returnVector; + return returnArrayList; } /** * Helper method that checks if the Baseline input text fields are filled @@ -912,17 +912,7 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ if(name!=null){ try { newPanel = (JPanel) Class.forName(name).newInstance(); - } catch (ClassNotFoundException ex) { - String aS="Error during getPanel: "+ ex; - logger.error(aS); - LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); - return; - } catch (InstantiationException ex) { - String aS="Error during getPanel: "+ ex; - logger.error(aS); - LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); - return; - } catch (IllegalAccessException ex) { + } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException ex) { String aS="Error during getPanel: "+ ex; logger.error(aS); LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); @@ -1554,7 +1544,7 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ selectedIndices = stepExplorerInstrumentModelList.getSelectedIndices(); stepExplorerInstrumentModel.setBackground(NOT_INHERITED_FROM_PARENT); } - if(theInstrumentModel.size()==0){ + if(theInstrumentModel.isEmpty()){ this.deleteInstrumentButton.setEnabled(false); } }//GEN-LAST:event_deleteInstrumentButtonActionPerformed @@ -1695,10 +1685,10 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ DefaultTableModel bsltm = (DefaultTableModel)this.baselineStationsTable.getModel(); String typedText=baselineStation1Text.getText(); String typedText2=baselineStation2Text.getText(); - Vector<String> baselinePair = new Vector<String>(); + ArrayList<String> baselinePair = new ArrayList<>(); baselinePair.add(typedText); baselinePair.add(typedText2); - bsltm.addRow(baselinePair); + bsltm.addRow(baselinePair.toArray()); this.BaselineSelectionPanel.setBackground(NOT_INHERITED_FROM_PARENT); }//GEN-LAST:event_addBaseLineButtonActionPerformed @@ -1779,7 +1769,7 @@ public class BBSStepExplorerPanel extends javax.swing.JPanel{ selectedIndices = stepExplorerNSourcesList.getSelectedIndices(); stepExplorerNSources.setBackground(NOT_INHERITED_FROM_PARENT); } - if(theSourceModel.size()==0){ + if(theSourceModel.isEmpty()){ this.deleteNSourceButton.setEnabled(false); } }//GEN-LAST:event_deleteNSourceButtonActionPerformed diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStrategy.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStrategy.java index 719b868d27d0e547f6680a93823b4350594a96b3..5ecc2a3d03c0c0e84d590e805805c6cc0d0e5aeb 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStrategy.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/BBSStrategy.java @@ -23,7 +23,7 @@ package nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement; -import java.util.Vector; +import java.util.ArrayList; /** * Representation of the BBS Strategy to contain all BBS Strategy steps. @@ -35,13 +35,13 @@ import java.util.Vector; public class BBSStrategy{ //Contained substeps - private Vector<BBSStep> childSteps; + private ArrayList<BBSStep> childSteps; /** * Creates a new instance of BBSStrategy */ public BBSStrategy() { - childSteps = new Vector<BBSStep>(); + childSteps = new ArrayList<>(); } /** @@ -51,7 +51,7 @@ public class BBSStrategy{ * * @return Vector of BBSStep objects that are children of this BBSStep */ - public Vector<BBSStep> getChildSteps(){ + public ArrayList<BBSStep> getChildSteps(){ return childSteps; } @@ -122,7 +122,7 @@ public class BBSStrategy{ if(indexOfChild >= 0 && indexOfChild < childSteps.size()){ BBSStep currentStepInIndex = childSteps.get(indexOfChild); if(child.getName().equals(currentStepInIndex.getName())){ - this.childSteps.removeElementAt(indexOfChild); + this.childSteps.remove(indexOfChild); childSteps.trimToSize(); } } @@ -149,7 +149,7 @@ public class BBSStrategy{ if(oldIndexOfChild >= 0 && oldIndexOfChild < childSteps.size()){ BBSStep currentStepInIndex = childSteps.get(oldIndexOfChild); if(child.getName().equals(currentStepInIndex.getName())){ - this.childSteps.removeElementAt(oldIndexOfChild); + this.childSteps.remove(oldIndexOfChild); this.childSteps.add(newIndexOfChild,currentStepInIndex); childSteps.trimToSize(); } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/operations/BBSStepOperationPanelSolveImpl.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/operations/BBSStepOperationPanelSolveImpl.form index 6b47fe0f29c36e223e93ab038eef93a8b3bae506..5ef4a1ca8f370c4a1554c1f00c587665c55c0c60 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/operations/BBSStepOperationPanelSolveImpl.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/operations/BBSStepOperationPanelSolveImpl.form @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.1" encoding="UTF-8" ?> <Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <Properties> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/operations/BBSStepOperationPanelSolveImpl.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/operations/BBSStepOperationPanelSolveImpl.java index 52ef784d2e8cf7178ebb60671d84ab7aaf207b43..e395213199d809e502e0e8b25432a9c019e1c460 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/operations/BBSStepOperationPanelSolveImpl.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/stepmanagement/operations/BBSStepOperationPanelSolveImpl.java @@ -39,8 +39,8 @@ import nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement.BBSStepExplorerPanel */ public class BBSStepOperationPanelSolveImpl extends javax.swing.JPanel implements IBBSStepOperationPanel{ - private HashMap<String,String> itsOperationParameters = new HashMap<String,String>(); - private HashMap<String,String> itsInheritedOperationParameters = new HashMap<String,String>(); + private HashMap<String,String> itsOperationParameters = new HashMap<>(); + private HashMap<String,String> itsInheritedOperationParameters = new HashMap<>(); /** @@ -211,7 +211,7 @@ public class BBSStepOperationPanelSolveImpl extends javax.swing.JPanel implement } public HashMap<String,String> getBBSStepOperationAttributes(){ - HashMap<String,String> returnMap = new HashMap<String,String>(); + HashMap<String,String> returnMap = new HashMap<>(); //Max iterations if(this.maxIterationsText.getText().equals("")){ @@ -724,7 +724,7 @@ public class BBSStepOperationPanelSolveImpl extends javax.swing.JPanel implement selectedIndices = excludedParmsList.getSelectedIndices(); excludedParmsGroupPanel.setBackground(BBSStepExplorerPanel.NOT_INHERITED_FROM_PARENT); } - if(theSourceModel.size()==0){ + if(theSourceModel.isEmpty()){ this.deleteExcludedParmButton.setEnabled(false); } }//GEN-LAST:event_deleteExcludedParmButtonActionPerformed @@ -764,7 +764,7 @@ public class BBSStepOperationPanelSolveImpl extends javax.swing.JPanel implement selectedIndices = solvableParmsList.getSelectedIndices(); this.solvableParmsGroupPanel.setBackground(BBSStepExplorerPanel.NOT_INHERITED_FROM_PARENT); } - if(theSourceModel.size()==0){ + if(theSourceModel.isEmpty()){ this.deleteSolvableParmButton.setEnabled(false); } }//GEN-LAST:event_deleteSolvableParmButtonActionPerformed diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java index 6e503b5f538da610694e72d435a96872a818aa15..22b4a2d522af7aa5ea00055d90a6ea582f63c0fd 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java @@ -34,7 +34,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.Collection; -import java.util.Vector; import javax.swing.DefaultListModel; import javax.swing.JFileChooser; import javax.swing.JMenuItem; @@ -189,7 +188,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ // AnaBeam childs finished, add to AnaBeamArrayList itsAnaBeamList.add(itsActiveAnaBeam); }else if (LofarUtils.keyName(aNode.name).contains("Beamformer")) { - itsBeamformers.addElement(aNode); + itsBeamformers.add(aNode); this.retrieveAndDisplayChildDataForNode(aNode); } else if (LofarUtils.keyName(aNode.name).equals("VirtualInstrument")) { this.retrieveAndDisplayChildDataForNode(aNode); @@ -1336,7 +1335,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ - jOTDBnode aDefaultBFNode= itsBeamformers.elementAt(0); + jOTDBnode aDefaultBFNode= itsBeamformers.get(0); // validate table // same for beamformer if (itsBeamformerConfigurationTableModel.changed()) { @@ -1346,7 +1345,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ // Keep the 1st one, it's the default Beam try { for (i=1; i< itsBeamformers.size(); i++) { - OtdbRmi.getRemoteMaintenance().deleteNode(itsBeamformers.elementAt(i)); + OtdbRmi.getRemoteMaintenance().deleteNode(itsBeamformers.get(i)); } } catch (RemoteException ex) { String aS="Error during deletion of defaultNode: "+ex; @@ -2797,7 +2796,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ private TiedArrayBeam itsActiveTAB; // Beamformers - private Vector<jOTDBnode> itsBeamformers = new Vector<>(); + private ArrayList<jOTDBnode> itsBeamformers = new ArrayList<>(); private ArrayList<String> itsStations = new ArrayList<>(); // Observation Virtual Instrument parameters diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.java index 8c77e21b533a8f57bd9c61a016829ca35cb213fa..fed7ed40457736861239e0907d44226cc25db046 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.java @@ -30,10 +30,8 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.rmi.RemoteException; -import java.util.ArrayList; import java.util.BitSet; -import java.util.Enumeration; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.JFileChooser; import javax.swing.JMenuItem; import javax.swing.JOptionPane; @@ -455,7 +453,7 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { } /** - * Fills the StringVectors with the values from the Database + * Fills the StringArrayLists with the values from the Database * Also does some base GUI settings on the Input fields * @param parent the parent node of the node to be displayed * @param aParam the parameter of the node to be displayed if applicable @@ -690,60 +688,60 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { int index=0; // OperatingMode - if (!itsOperatingModes.elementAt(index).equals("")) { - inputOperatingMode.setSelectedItem(itsOperatingModes.elementAt(index)); + if (!itsOperatingModes.get(index).equals("")) { + inputOperatingMode.setSelectedItem(itsOperatingModes.get(index)); } // TriggerMode - if (!itsTriggerModes.elementAt(index).equals("")) { - inputTriggerMode.setSelectedItem(itsTriggerModes.elementAt(index)); + if (!itsTriggerModes.get(index).equals("")) { + inputTriggerMode.setSelectedItem(itsTriggerModes.get(index)); } // Baselevel - inputBaselevel.setText(itsBaselevels.elementAt(index)); + inputBaselevel.setText(itsBaselevels.get(index)); // Startlevel - inputStartlevel.setText(itsStartlevels.elementAt(index)); + inputStartlevel.setText(itsStartlevels.get(index)); // Stoplevel - inputStoplevel.setText(itsStoplevels.elementAt(index)); + inputStoplevel.setText(itsStoplevels.get(index)); // Filter - if (!itsFilters.elementAt(index).equals("")) { - inputFilter.setSelectedItem(itsFilters.elementAt(index)); + if (!itsFilters.get(index).equals("")) { + inputFilter.setSelectedItem(itsFilters.get(index)); } // Window - if (!itsWindows.elementAt(index).equals("")) { - inputWindow.setSelectedItem(itsWindows.elementAt(index)); + if (!itsWindows.get(index).equals("")) { + inputWindow.setSelectedItem(itsWindows.get(index)); } // Coeff0 - inputFilter0Coeff0.setText(itsFilter0Coeff0s.elementAt(index)); + inputFilter0Coeff0.setText(itsFilter0Coeff0s.get(index)); // Coeff1 - inputFilter0Coeff1.setText(itsFilter0Coeff1s.elementAt(index)); + inputFilter0Coeff1.setText(itsFilter0Coeff1s.get(index)); // Coeff2 - inputFilter0Coeff2.setText(itsFilter0Coeff2s.elementAt(index)); + inputFilter0Coeff2.setText(itsFilter0Coeff2s.get(index)); // Coeff3 - inputFilter0Coeff3.setText(itsFilter0Coeff3s.elementAt(index)); + inputFilter0Coeff3.setText(itsFilter0Coeff3s.get(index)); // Coeff0 - inputFilter1Coeff0.setText(itsFilter1Coeff0s.elementAt(index)); + inputFilter1Coeff0.setText(itsFilter1Coeff0s.get(index)); // Coeff1 - inputFilter1Coeff1.setText(itsFilter1Coeff1s.elementAt(index)); + inputFilter1Coeff1.setText(itsFilter1Coeff1s.get(index)); // Coeff2 - inputFilter1Coeff2.setText(itsFilter1Coeff2s.elementAt(index)); + inputFilter1Coeff2.setText(itsFilter1Coeff2s.get(index)); // Coeff3 - inputFilter1Coeff3.setText(itsFilter1Coeff3s.elementAt(index)); + inputFilter1Coeff3.setText(itsFilter1Coeff3s.get(index)); // RCUs - inputRCUs.setText(itsRCUs.elementAt(index)); + inputRCUs.setText(itsRCUs.get(index)); // subbandList - inputSubbandList.setText(itsSubbandList.elementAt(index)); + inputSubbandList.setText(itsSubbandList.get(index)); } /** fill the RCU bitset to see what RCU's have been set. To be able to determine later if a given RCU is indeed free. @@ -751,7 +749,7 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { private void fillRCUBitset() { itsUsedRCUList.clear(); for (int i=1;i<itsRCUs.size();i++) { - BitSet aNewBitSet=rcuToBitSet(LofarUtils.expandedArrayString(itsRCUs.elementAt(i))); + BitSet aNewBitSet=rcuToBitSet(LofarUtils.expandedArrayString(itsRCUs.get(i))); // check if no duplication between the two bitsets if (itsUsedRCUList.intersects(aNewBitSet)) { @@ -975,7 +973,7 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { // Keep the 1st one, it's the default TBBsetting try { for (i=1; i< itsTBBsettings.size(); i++) { - OtdbRmi.getRemoteMaintenance().deleteNode(itsTBBsettings.elementAt(i)); + OtdbRmi.getRemoteMaintenance().deleteNode(itsTBBsettings.get(i)); } } catch (RemoteException ex) { logger.error("Error during deletion of defaultNode: "+ex); @@ -1010,55 +1008,55 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { String aKeyName = LofarUtils.keyName(aHWNode.name); switch (aKeyName) { case "operatingMode": - aHWNode.limits=itsOperatingModes.elementAt(i); + aHWNode.limits=itsOperatingModes.get(i); break; case "triggerMode": - aHWNode.limits=itsTriggerModes.elementAt(i); + aHWNode.limits=itsTriggerModes.get(i); break; case "baselevel": - aHWNode.limits=itsBaselevels.elementAt(i); + aHWNode.limits=itsBaselevels.get(i); break; case "startlevel": - aHWNode.limits=itsStartlevels.elementAt(i); + aHWNode.limits=itsStartlevels.get(i); break; case "stoplevel": - aHWNode.limits=itsStoplevels.elementAt(i); + aHWNode.limits=itsStoplevels.get(i); break; case "filter": - aHWNode.limits=itsFilters.elementAt(i); + aHWNode.limits=itsFilters.get(i); break; case "window": - aHWNode.limits=itsWindows.elementAt(i); + aHWNode.limits=itsWindows.get(i); break; case "filter0_coeff0": - aHWNode.limits=itsFilter0Coeff0s.elementAt(i); + aHWNode.limits=itsFilter0Coeff0s.get(i); break; case "filter0_coeff1": - aHWNode.limits=itsFilter0Coeff1s.elementAt(i); + aHWNode.limits=itsFilter0Coeff1s.get(i); break; case "filter0_coeff2": - aHWNode.limits=itsFilter0Coeff2s.elementAt(i); + aHWNode.limits=itsFilter0Coeff2s.get(i); break; case "filter0_coeff3": - aHWNode.limits=itsFilter0Coeff3s.elementAt(i); + aHWNode.limits=itsFilter0Coeff3s.get(i); break; case "filter1_coeff0": - aHWNode.limits=itsFilter1Coeff0s.elementAt(i); + aHWNode.limits=itsFilter1Coeff0s.get(i); break; case "filter1_coeff1": - aHWNode.limits=itsFilter1Coeff1s.elementAt(i); + aHWNode.limits=itsFilter1Coeff1s.get(i); break; case "filter1_coeff2": - aHWNode.limits=itsFilter1Coeff2s.elementAt(i); + aHWNode.limits=itsFilter1Coeff2s.get(i); break; case "filter1_coeff3": - aHWNode.limits=itsFilter1Coeff3s.elementAt(i); + aHWNode.limits=itsFilter1Coeff3s.get(i); break; case "RCUs": - aHWNode.limits=itsRCUs.elementAt(i); + aHWNode.limits=itsRCUs.get(i); break; case "subbandList": - aHWNode.limits=itsSubbandList.elementAt(i); + aHWNode.limits=itsSubbandList.get(i); break; } saveNode(aHWNode); @@ -1656,25 +1654,25 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { // TBBsettings - private Vector<jOTDBnode> itsTBBsettings = new Vector<>(); + private ArrayList<jOTDBnode> itsTBBsettings = new ArrayList<>(); // All TBBsetting nodes - private Vector<String> itsOperatingModes = new Vector<>(); - private Vector<String> itsTriggerModes = new Vector<>(); - private Vector<String> itsBaselevels= new Vector<>(); - private Vector<String> itsStartlevels= new Vector<>(); - private Vector<String> itsStoplevels= new Vector<>(); - private Vector<String> itsFilters= new Vector<>(); - private Vector<String> itsWindows= new Vector<>(); - private Vector<String> itsFilter0Coeff0s= new Vector<>(); - private Vector<String> itsFilter0Coeff1s= new Vector<>(); - private Vector<String> itsFilter0Coeff2s= new Vector<>(); - private Vector<String> itsFilter0Coeff3s= new Vector<>(); - private Vector<String> itsFilter1Coeff0s= new Vector<>(); - private Vector<String> itsFilter1Coeff1s= new Vector<>(); - private Vector<String> itsFilter1Coeff2s= new Vector<>(); - private Vector<String> itsFilter1Coeff3s= new Vector<>(); - private Vector<String> itsRCUs= new Vector<>(); - private Vector<String> itsSubbandList= new Vector<>(); + private ArrayList<String> itsOperatingModes = new ArrayList<>(); + private ArrayList<String> itsTriggerModes = new ArrayList<>(); + private ArrayList<String> itsBaselevels= new ArrayList<>(); + private ArrayList<String> itsStartlevels= new ArrayList<>(); + private ArrayList<String> itsStoplevels= new ArrayList<>(); + private ArrayList<String> itsFilters= new ArrayList<>(); + private ArrayList<String> itsWindows= new ArrayList<>(); + private ArrayList<String> itsFilter0Coeff0s= new ArrayList<>(); + private ArrayList<String> itsFilter0Coeff1s= new ArrayList<>(); + private ArrayList<String> itsFilter0Coeff2s= new ArrayList<>(); + private ArrayList<String> itsFilter0Coeff3s= new ArrayList<>(); + private ArrayList<String> itsFilter1Coeff0s= new ArrayList<>(); + private ArrayList<String> itsFilter1Coeff1s= new ArrayList<>(); + private ArrayList<String> itsFilter1Coeff2s= new ArrayList<>(); + private ArrayList<String> itsFilter1Coeff3s= new ArrayList<>(); + private ArrayList<String> itsRCUs= new ArrayList<>(); + private ArrayList<String> itsSubbandList= new ArrayList<>(); // Variables declaration - do not modify//GEN-BEGIN:variables diff --git a/SAS/OTB/OTB/src/no/geosoft/cc/io/FileMonitor.java b/SAS/OTB/OTB/src/no/geosoft/cc/io/FileMonitor.java index d6303bec84f6a473248a5faceb9ccf2509a5f577..4ea588048aeca4805b30514cb6fe641b1ab40977 100644 --- a/SAS/OTB/OTB/src/no/geosoft/cc/io/FileMonitor.java +++ b/SAS/OTB/OTB/src/no/geosoft/cc/io/FileMonitor.java @@ -55,8 +55,8 @@ public class FileMonitor */ public FileMonitor (long pollingInterval) { - files_ = new HashMap<File,Long>(); - listeners_ = new ArrayList<WeakReference>(); + files_ = new HashMap<>(); + listeners_ = new ArrayList<>(); timer_ = new Timer (true); timer_.schedule (new FileMonitorNotifier(), 0, pollingInterval); @@ -119,10 +119,9 @@ public class FileMonitor if (listener == fileListener) return; } - - // Use WeakReference to avoid memory leak if this becomes the - // sole reference to the object. - listeners_.add (new WeakReference<FileListener> (fileListener)); + // Use WeakReference to avoid memory leak if this becomes the + // sole reference to the object. + boolean add = listeners_.add (new WeakReference<> (fileListener)); } @@ -158,7 +157,7 @@ public class FileMonitor // Loop over the registered files and see which have changed. // Use a copy of the list in case listener wants to alter the // list within its fileChanged method. - Collection files = new ArrayList<File> (files_.keySet()); + Collection files = new ArrayList<> (files_.keySet()); for (Iterator i = files.iterator(); i.hasNext(); ) { File file = (File) i.next(); diff --git a/JAVA/GUI/MAC/jRSP/.cvsignore b/SAS/OTB/RSP/.cvsignore similarity index 100% rename from JAVA/GUI/MAC/jRSP/.cvsignore rename to SAS/OTB/RSP/.cvsignore diff --git a/SAS/OTB/RSP/pom.xml b/SAS/OTB/RSP/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..d5b9d3b11d0e743f5e4c31646402050ddaeea483 --- /dev/null +++ b/SAS/OTB/RSP/pom.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar OTB :: RSP</name> + + <parent> + <groupId>nl.astron.lofar.sas.otb</groupId> + <artifactId>otb-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + </parent> + + <artifactId>RSP</artifactId> + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/RSP</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/RSP</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + + <sourceDirectory>src</sourceDirectory> + + <resources> + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + <exclude>**/*.form</exclude> + </excludes> + </resource> + </resources> + + </build> + + <dependencies> + + <!-- Sibling dependencies --> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jRSP</artifactId> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>OTB</artifactId> + </dependency> + + <!-- Internal dependencies --> + <dependency> + <groupId>nl.astron.lofar.lib</groupId> + <artifactId>plotter</artifactId> + </dependency> + + <!-- External dependencies --> + <dependency> + <groupId>org.swinglabs</groupId> + <artifactId>swing-layout</artifactId> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + + + + </dependencies> + +</project> diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ControlPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ControlPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ControlPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ControlPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ControlPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ControlPanel.java similarity index 99% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ControlPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ControlPanel.java index b8c86a8cd42c5a626382b96f88145701187afa7b..63947a441c5a0bb2513e51ed4e441ef3dca662a0 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ControlPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ControlPanel.java @@ -22,10 +22,11 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp; +package nl.astron.lofar.java.sas.otb.rsp; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import javax.swing.JPanel; import javax.swing.event.EventListenerList; diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ITabPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ITabPanel.java similarity index 97% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ITabPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ITabPanel.java index 42da6e4d5567801dae251f9c7dfb31ee02146ea5..a5ca8eddc697b3e4ee94b4f55da1803c63c4c550 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ITabPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ITabPanel.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp; +package nl.astron.lofar.java.sas.otb.rsp; /** * This interface declares some methods that are needed for interaction with the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ListPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ListPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ListPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ListPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ListPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ListPanel.java similarity index 99% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ListPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ListPanel.java index 67c4b4f68346b2e50ea5791e7ff88cace940d47b..0bffe8b12b62a70d4c681ed09fd39ddeb4512342 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/ListPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/ListPanel.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp; +package nl.astron.lofar.java.sas.otb.rsp; import javax.swing.JPanel; import javax.swing.event.EventListenerList; diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MainPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MainPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MainPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MainPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MainPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MainPanel.java similarity index 94% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MainPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MainPanel.java index 510e78a99064f52c0ced66dbb0527b3862891b28..11b672422c0fe29ce8c705ddb700f84191f02765 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MainPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MainPanel.java @@ -22,14 +22,17 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp; +package nl.astron.lofar.java.sas.otb.rsp; import java.awt.Cursor; + import javax.swing.JOptionPane; import javax.swing.JPanel; -import nl.astron.lofar.java.mac.jrsp.Board; + import nl.astron.lofar.sas.otb.MainFrame; +import nl.astron.lofar.sas.otb.jrsp.Board; import nl.astron.lofar.sas.otb.panels.IPluginPanel; + import org.apache.log4j.Logger; /** @@ -380,12 +383,12 @@ public class MainPanel extends JPanel implements IPluginPanel, Runnable // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { jTabbedPane = new javax.swing.JTabbedPane(); - statusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.StatusPanel(); - subbandStatsPanel = new nl.astron.lofar.java.gui.mac.jrsp.subbandstats.SubbandStatsPanel(); - itsRSPControlPanel = new nl.astron.lofar.java.gui.mac.jrsp.control.RSPControlPanel(); - beamletStatsPanel1 = new nl.astron.lofar.java.gui.mac.jrsp.beamletstats.BeamletStatsPanel(); - controlPanel = new nl.astron.lofar.java.gui.mac.jrsp.ControlPanel(); - listPanel = new nl.astron.lofar.java.gui.mac.jrsp.ListPanel(); + statusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.StatusPanel(); + subbandStatsPanel = new nl.astron.lofar.java.sas.otb.rsp.subbandstats.SubbandStatsPanel(); + itsRSPControlPanel = new nl.astron.lofar.java.sas.otb.rsp.control.RSPControlPanel(); + beamletStatsPanel1 = new nl.astron.lofar.java.sas.otb.rsp.beamletstats.BeamletStatsPanel(); + controlPanel = new nl.astron.lofar.java.sas.otb.rsp.ControlPanel(); + listPanel = new nl.astron.lofar.java.sas.otb.rsp.ListPanel(); jTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { @@ -555,13 +558,13 @@ public class MainPanel extends JPanel implements IPluginPanel, Runnable // Variables declaration - do not modify//GEN-BEGIN:variables - private nl.astron.lofar.java.gui.mac.jrsp.beamletstats.BeamletStatsPanel beamletStatsPanel1; - private nl.astron.lofar.java.gui.mac.jrsp.ControlPanel controlPanel; - private nl.astron.lofar.java.gui.mac.jrsp.control.RSPControlPanel itsRSPControlPanel; + private nl.astron.lofar.java.sas.otb.rsp.beamletstats.BeamletStatsPanel beamletStatsPanel1; + private nl.astron.lofar.java.sas.otb.rsp.ControlPanel controlPanel; + private nl.astron.lofar.java.sas.otb.rsp.control.RSPControlPanel itsRSPControlPanel; private javax.swing.JTabbedPane jTabbedPane; - private nl.astron.lofar.java.gui.mac.jrsp.ListPanel listPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.StatusPanel statusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.subbandstats.SubbandStatsPanel subbandStatsPanel; + private nl.astron.lofar.java.sas.otb.rsp.ListPanel listPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.StatusPanel statusPanel; + private nl.astron.lofar.java.sas.otb.rsp.subbandstats.SubbandStatsPanel subbandStatsPanel; // End of variables declaration//GEN-END:variables } diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MaskSelectionPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MaskSelectionPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MaskSelectionPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MaskSelectionPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MaskSelectionPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MaskSelectionPanel.java similarity index 99% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MaskSelectionPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MaskSelectionPanel.java index 09dfdf7e149da556e2e4520a81a9b7202f139050..361d7105af3274f67fcef728eb5ca6551d995ae9 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/MaskSelectionPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/MaskSelectionPanel.java @@ -22,12 +22,14 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp; +package nl.astron.lofar.java.sas.otb.rsp; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import javax.swing.event.EventListenerList; -import nl.astron.lofar.java.mac.jrsp.RCUMask; + +import nl.astron.lofar.sas.otb.jrsp.RCUMask; /** * diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/PlotContainer.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/PlotContainer.java similarity index 98% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/PlotContainer.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/PlotContainer.java index a0390d212b78492bbafb770e7da37d888c65a6cc..59345c7408e15addb3bf1bfdd845c3e0d2a6cec4 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/PlotContainer.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/PlotContainer.java @@ -22,15 +22,18 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp; +package nl.astron.lofar.java.sas.otb.rsp; import java.awt.BorderLayout; import java.awt.Color; import java.util.HashMap; + import javax.swing.JPanel; + import nl.astron.lofar.java.gui.plotter.PlotConstants; import nl.astron.lofar.java.gui.plotter.PlotPanel; import nl.astron.lofar.java.gui.plotter.exceptions.PlotterException; + import org.apache.log4j.Logger; /** diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/PlotDataModel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/PlotDataModel.java similarity index 99% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/PlotDataModel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/PlotDataModel.java index 0dfd72a2eed5c957e6019afd9fa1be54db8c217f..4adddce285b50568f9a9544cac1a9bf248bc8759 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/PlotDataModel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/PlotDataModel.java @@ -22,10 +22,11 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp; +package nl.astron.lofar.java.sas.otb.rsp; import java.util.HashMap; import java.util.LinkedList; + import nl.astron.lofar.java.gui.plotter.IPlotDataAccess; import nl.astron.lofar.java.gui.plotter.PlotConstants; import nl.astron.lofar.java.gui.plotter.exceptions.PlotterDataAccessException; diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/beamletstats/BeamletStatsPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/beamletstats/BeamletStatsPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/beamletstats/BeamletStatsPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/beamletstats/BeamletStatsPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/beamletstats/BeamletStatsPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/beamletstats/BeamletStatsPanel.java similarity index 91% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/beamletstats/BeamletStatsPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/beamletstats/BeamletStatsPanel.java index 3a62346cd08196cb37cb8da2928ce6e1332e66e9..55139bcd3708b02a2b5806a7fd4d146c8970e3e5 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/beamletstats/BeamletStatsPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/beamletstats/BeamletStatsPanel.java @@ -22,14 +22,16 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.beamletstats; +package nl.astron.lofar.java.sas.otb.rsp.beamletstats; import java.util.HashMap; + import javax.swing.JPanel; -import nl.astron.lofar.java.gui.mac.jrsp.ITabPanel; -import nl.astron.lofar.java.gui.mac.jrsp.MainPanel; -import nl.astron.lofar.java.gui.mac.jrsp.PlotDataModel; -import nl.astron.lofar.java.mac.jrsp.RSPMask; + +import nl.astron.lofar.java.sas.otb.rsp.ITabPanel; +import nl.astron.lofar.java.sas.otb.rsp.MainPanel; +import nl.astron.lofar.java.sas.otb.rsp.PlotDataModel; +import nl.astron.lofar.sas.otb.jrsp.RSPMask; /** * @@ -104,7 +106,7 @@ public class BeamletStatsPanel extends JPanel implements ITabPanel { */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { - plotContainer = new nl.astron.lofar.java.gui.mac.jrsp.PlotContainer(); + plotContainer = new nl.astron.lofar.java.sas.otb.rsp.PlotContainer(); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); @@ -126,7 +128,7 @@ public class BeamletStatsPanel extends JPanel implements ITabPanel { // Variables declaration - do not modify//GEN-BEGIN:variables - private nl.astron.lofar.java.gui.mac.jrsp.PlotContainer plotContainer; + private nl.astron.lofar.java.sas.otb.rsp.PlotContainer plotContainer; // End of variables declaration//GEN-END:variables } diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/control/RSPControlPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/control/RSPControlPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/control/RSPControlPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/control/RSPControlPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/control/RSPControlPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/control/RSPControlPanel.java similarity index 97% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/control/RSPControlPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/control/RSPControlPanel.java index 3d6f17df041b38cde49e4204d95473da4de63b30..894871acc9844520eebf3eaca2e77ddb978812d4 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/control/RSPControlPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/control/RSPControlPanel.java @@ -22,13 +22,14 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.control; +package nl.astron.lofar.java.sas.otb.rsp.control; import javax.swing.JOptionPane; -import nl.astron.lofar.java.mac.jrsp.RCUMask; -import nl.astron.lofar.java.mac.jrsp.RSPMask; -import nl.astron.lofar.java.gui.mac.jrsp.ITabPanel; -import nl.astron.lofar.java.gui.mac.jrsp.MainPanel; + +import nl.astron.lofar.java.sas.otb.rsp.ITabPanel; +import nl.astron.lofar.java.sas.otb.rsp.MainPanel; +import nl.astron.lofar.sas.otb.jrsp.RCUMask; +import nl.astron.lofar.sas.otb.jrsp.RSPMask; /** * @@ -120,7 +121,7 @@ public class RSPControlPanel extends javax.swing.JPanel implements ITabPanel { btnSync = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); RCUModePanel = new javax.swing.JPanel(); - itsMaskSelectionPanel = new nl.astron.lofar.java.gui.mac.jrsp.MaskSelectionPanel(); + itsMaskSelectionPanel = new nl.astron.lofar.java.sas.otb.rsp.MaskSelectionPanel(); cmbRCUMode = new javax.swing.JComboBox(); lblRCUMode = new javax.swing.JLabel(); btnSetFilter = new javax.swing.JButton(); @@ -384,7 +385,7 @@ public class RSPControlPanel extends javax.swing.JPanel implements ITabPanel { private javax.swing.JButton btnSetFilter; private javax.swing.JButton btnSync; private javax.swing.JComboBox cmbRCUMode; - private nl.astron.lofar.java.gui.mac.jrsp.MaskSelectionPanel itsMaskSelectionPanel; + private nl.astron.lofar.java.sas.otb.rsp.MaskSelectionPanel itsMaskSelectionPanel; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ADOStatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ADOStatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ADOStatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ADOStatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ADOStatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ADOStatusPanel.java similarity index 98% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ADOStatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ADOStatusPanel.java index f2f666881f73ca0406482426add0f3c54bf3bd6d..65a1a15d181a6a3ec64756058f27f572b0da2dec 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ADOStatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ADOStatusPanel.java @@ -22,10 +22,11 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; import javax.swing.border.TitledBorder; -import nl.astron.lofar.java.mac.jrsp.ADOStatus; + +import nl.astron.lofar.sas.otb.jrsp.ADOStatus; /** * A panel that displays the ADO status data. This panel is used by the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/DIAGStatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/DIAGStatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/DIAGStatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/DIAGStatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/DIAGStatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/DIAGStatusPanel.java similarity index 99% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/DIAGStatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/DIAGStatusPanel.java index 2cbde40e9dd35163dd68fddbbac71d66e438b083..1c3c0655b9701a4357b6e6d100114b23cc350989 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/DIAGStatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/DIAGStatusPanel.java @@ -22,9 +22,9 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; -import nl.astron.lofar.java.mac.jrsp.BoardStatus; +import nl.astron.lofar.sas.otb.jrsp.BoardStatus; /** * A panel that displays the DIAG status data. This panel is used by the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ETHStatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ETHStatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ETHStatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ETHStatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ETHStatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ETHStatusPanel.java similarity index 98% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ETHStatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ETHStatusPanel.java index 2720dbdbb0af186b4da4588af4370edc507bb1b6..3ae6aae133eab07b95db0b2d12e7ca3b2cc9f24b 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/ETHStatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/ETHStatusPanel.java @@ -22,9 +22,9 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; -import nl.astron.lofar.java.mac.jrsp.BoardStatus; +import nl.astron.lofar.sas.otb.jrsp.BoardStatus; /** * A panel that displays the ETH status data. This panel is used by the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/MEPStatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/MEPStatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/MEPStatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/MEPStatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/MEPStatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/MEPStatusPanel.java similarity index 98% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/MEPStatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/MEPStatusPanel.java index cdebc74c018bea289bef8edb542e849fad4a9ec7..c677a47ef627c90f1577d2c4a042e5956795e60a 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/MEPStatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/MEPStatusPanel.java @@ -22,9 +22,9 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; -import nl.astron.lofar.java.mac.jrsp.BoardStatus; +import nl.astron.lofar.sas.otb.jrsp.BoardStatus; /** * A panel that displays the MEP status data. This panel is used by the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RCUStatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RCUStatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RCUStatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RCUStatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RCUStatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RCUStatusPanel.java similarity index 98% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RCUStatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RCUStatusPanel.java index 8396675cbf8e21d97818dbc51efaf4180e6ebd74..4234a86ae6ce8b86d7b3927ad6d08837e45210e3 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RCUStatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RCUStatusPanel.java @@ -22,10 +22,11 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; import javax.swing.border.TitledBorder; -import nl.astron.lofar.java.mac.jrsp.RCUStatus; + +import nl.astron.lofar.sas.otb.jrsp.RCUStatus; /** * A panel that displays the RCU status data. This panel is used by the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSPStatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSPStatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSPStatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSPStatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSPStatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSPStatusPanel.java similarity index 99% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSPStatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSPStatusPanel.java index 2d1908fb31386ab90edb04af1fbb190f6c13dba0..79cfd3b36baa4126b52ffa2a619f0116b0bc7093 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSPStatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSPStatusPanel.java @@ -22,10 +22,11 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; import java.text.NumberFormat; -import nl.astron.lofar.java.mac.jrsp.BoardStatus; + +import nl.astron.lofar.sas.otb.jrsp.BoardStatus; /** * A panel that displays the ADO status data. This panel is used by the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSUStatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSUStatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSUStatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSUStatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSUStatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSUStatusPanel.java similarity index 98% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSUStatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSUStatusPanel.java index 329951321dda71836d7085ee63a3e7cab6a7ffda..f214b2b2b41b62cbf8a64f50fcf4e5800d6040ab 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/RSUStatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/RSUStatusPanel.java @@ -22,9 +22,9 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; -import nl.astron.lofar.java.mac.jrsp.BoardStatus; +import nl.astron.lofar.sas.otb.jrsp.BoardStatus; /** * A panel that displays the ADO status data. This panel is used by the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/StatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/StatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/StatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/StatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/StatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/StatusPanel.java similarity index 81% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/StatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/StatusPanel.java index 19c0bbd9ec9414695d45c8511b22858487477989..b99e9416b0b92534ec4820de1959fbb2f4ae1aa2 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/StatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/StatusPanel.java @@ -22,12 +22,15 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; import javax.swing.JPanel; -import nl.astron.lofar.java.mac.jrsp.BoardStatus; -import nl.astron.lofar.java.mac.jrsp.RSPMask; -import nl.astron.lofar.java.gui.mac.jrsp.*; + +import nl.astron.lofar.java.sas.otb.rsp.ITabPanel; +import nl.astron.lofar.java.sas.otb.rsp.MainPanel; +import nl.astron.lofar.sas.otb.jrsp.BoardStatus; +import nl.astron.lofar.sas.otb.jrsp.RSPMask; + import org.apache.log4j.Logger; /** @@ -139,23 +142,23 @@ public class StatusPanel extends JPanel implements ITabPanel */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { - rspStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.RSPStatusPanel(); - diagStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.DIAGStatusPanel(); - blp0SyncStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.SyncStatusPanel(); - blp1SyncStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.SyncStatusPanel(); - blp2SyncStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.SyncStatusPanel(); - blp3SyncStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.SyncStatusPanel(); - blp0RcuStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.RCUStatusPanel(); - blp1RcuStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.RCUStatusPanel(); - blp2RcuStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.RCUStatusPanel(); - blp3RcuStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.RCUStatusPanel(); - rsuStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.RSUStatusPanel(); - blp0AdoStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.ADOStatusPanel(); - blp1AdoStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.ADOStatusPanel(); - blp2AdoStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.ADOStatusPanel(); - blp3AdoStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.ADOStatusPanel(); - ethStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.ETHStatusPanel(); - mepStatusPanel = new nl.astron.lofar.java.gui.mac.jrsp.status.MEPStatusPanel(); + rspStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.RSPStatusPanel(); + diagStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.DIAGStatusPanel(); + blp0SyncStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.SyncStatusPanel(); + blp1SyncStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.SyncStatusPanel(); + blp2SyncStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.SyncStatusPanel(); + blp3SyncStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.SyncStatusPanel(); + blp0RcuStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.RCUStatusPanel(); + blp1RcuStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.RCUStatusPanel(); + blp2RcuStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.RCUStatusPanel(); + blp3RcuStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.RCUStatusPanel(); + rsuStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.RSUStatusPanel(); + blp0AdoStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.ADOStatusPanel(); + blp1AdoStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.ADOStatusPanel(); + blp2AdoStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.ADOStatusPanel(); + blp3AdoStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.ADOStatusPanel(); + ethStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.ETHStatusPanel(); + mepStatusPanel = new nl.astron.lofar.java.sas.otb.rsp.status.MEPStatusPanel(); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); @@ -241,22 +244,22 @@ public class StatusPanel extends JPanel implements ITabPanel }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables - private nl.astron.lofar.java.gui.mac.jrsp.status.ADOStatusPanel blp0AdoStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.RCUStatusPanel blp0RcuStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.SyncStatusPanel blp0SyncStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.ADOStatusPanel blp1AdoStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.RCUStatusPanel blp1RcuStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.SyncStatusPanel blp1SyncStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.ADOStatusPanel blp2AdoStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.RCUStatusPanel blp2RcuStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.SyncStatusPanel blp2SyncStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.ADOStatusPanel blp3AdoStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.RCUStatusPanel blp3RcuStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.SyncStatusPanel blp3SyncStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.DIAGStatusPanel diagStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.ETHStatusPanel ethStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.MEPStatusPanel mepStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.RSPStatusPanel rspStatusPanel; - private nl.astron.lofar.java.gui.mac.jrsp.status.RSUStatusPanel rsuStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.ADOStatusPanel blp0AdoStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.RCUStatusPanel blp0RcuStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.SyncStatusPanel blp0SyncStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.ADOStatusPanel blp1AdoStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.RCUStatusPanel blp1RcuStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.SyncStatusPanel blp1SyncStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.ADOStatusPanel blp2AdoStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.RCUStatusPanel blp2RcuStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.SyncStatusPanel blp2SyncStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.ADOStatusPanel blp3AdoStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.RCUStatusPanel blp3RcuStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.SyncStatusPanel blp3SyncStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.DIAGStatusPanel diagStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.ETHStatusPanel ethStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.MEPStatusPanel mepStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.RSPStatusPanel rspStatusPanel; + private nl.astron.lofar.java.sas.otb.rsp.status.RSUStatusPanel rsuStatusPanel; // End of variables declaration//GEN-END:variables } diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/SyncStatusPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/SyncStatusPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/SyncStatusPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/SyncStatusPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/SyncStatusPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/SyncStatusPanel.java similarity index 98% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/SyncStatusPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/SyncStatusPanel.java index 73a170444285c206d43e9a0dbb61f50395a39650..312b9ad569de3f92fd4a76c866151990baad729e 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/status/SyncStatusPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/status/SyncStatusPanel.java @@ -22,10 +22,11 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.status; +package nl.astron.lofar.java.sas.otb.rsp.status; import javax.swing.border.TitledBorder; -import nl.astron.lofar.java.mac.jrsp.SyncStatus; + +import nl.astron.lofar.sas.otb.jrsp.SyncStatus; /** * A panel that displays the ADO status data. This panel is used by the diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/.cvsignore b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/.cvsignore similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/.cvsignore rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/.cvsignore diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPanel.java similarity index 94% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPanel.java index f65be310471b627d794b0d00de4f95ecf14f3861..d93f88cb63df5a7212a89650ffe0d1c9cbd68099 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPanel.java @@ -22,17 +22,19 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.subbandstats; +package nl.astron.lofar.java.sas.otb.rsp.subbandstats; -import com.sun.org.apache.xerces.internal.parsers.JAXPConfiguration; import java.awt.event.ActionEvent; import java.util.ArrayList; + import javax.swing.JOptionPane; import javax.swing.JPanel; -import nl.astron.lofar.java.mac.jrsp.RCUMask; -import nl.astron.lofar.java.mac.jrsp.WGRegisterType; -import nl.astron.lofar.java.gui.mac.jrsp.ITabPanel; -import nl.astron.lofar.java.gui.mac.jrsp.MainPanel; + +import nl.astron.lofar.java.sas.otb.rsp.ITabPanel; +import nl.astron.lofar.java.sas.otb.rsp.MainPanel; +import nl.astron.lofar.sas.otb.jrsp.RCUMask; +import nl.astron.lofar.sas.otb.jrsp.WGRegisterType; + import org.apache.log4j.Logger; public class SubbandStatsPanel extends JPanel implements ITabPanel @@ -188,9 +190,9 @@ public class SubbandStatsPanel extends JPanel implements ITabPanel */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { - plotRight = new nl.astron.lofar.java.gui.mac.jrsp.subbandstats.SubbandStatsPlotPanel(); - plotLeft = new nl.astron.lofar.java.gui.mac.jrsp.subbandstats.SubbandStatsPlotPanel(); - settingsPanel = new nl.astron.lofar.java.gui.mac.jrsp.subbandstats.WaveformSettingsPanel(); + plotRight = new nl.astron.lofar.java.sas.otb.rsp.subbandstats.SubbandStatsPlotPanel(); + plotLeft = new nl.astron.lofar.java.sas.otb.rsp.subbandstats.SubbandStatsPlotPanel(); + settingsPanel = new nl.astron.lofar.java.sas.otb.rsp.subbandstats.WaveformSettingsPanel(); plotRight.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -360,8 +362,8 @@ itsLogger.debug("inputPanelActionPerformed"); } // Variables declaration - do not modify//GEN-BEGIN:variables - private nl.astron.lofar.java.gui.mac.jrsp.subbandstats.SubbandStatsPlotPanel plotLeft; - private nl.astron.lofar.java.gui.mac.jrsp.subbandstats.SubbandStatsPlotPanel plotRight; - private nl.astron.lofar.java.gui.mac.jrsp.subbandstats.WaveformSettingsPanel settingsPanel; + private nl.astron.lofar.java.sas.otb.rsp.subbandstats.SubbandStatsPlotPanel plotLeft; + private nl.astron.lofar.java.sas.otb.rsp.subbandstats.SubbandStatsPlotPanel plotRight; + private nl.astron.lofar.java.sas.otb.rsp.subbandstats.WaveformSettingsPanel settingsPanel; // End of variables declaration//GEN-END:variables } diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPlotPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPlotPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPlotPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPlotPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPlotPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPlotPanel.java similarity index 93% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPlotPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPlotPanel.java index 41287dc5285fd78b96519be5fb91796362621b26..dc582032990b103c52dcf119895f6f77fa48b726 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/SubbandStatsPlotPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/SubbandStatsPlotPanel.java @@ -22,18 +22,19 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.subbandstats; +package nl.astron.lofar.java.sas.otb.rsp.subbandstats; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.HashMap; + import javax.swing.JPanel; import javax.swing.event.EventListenerList; -import nl.astron.lofar.java.gui.plotter.PlotConstants; -import nl.astron.lofar.java.gui.plotter.exceptions.PlotterException; -import nl.astron.lofar.java.mac.jrsp.RCUMask; -import nl.astron.lofar.java.gui.mac.jrsp.MaskSelectionPanel; -import nl.astron.lofar.java.gui.mac.jrsp.PlotDataModel; + +import nl.astron.lofar.java.sas.otb.rsp.MaskSelectionPanel; +import nl.astron.lofar.java.sas.otb.rsp.PlotDataModel; +import nl.astron.lofar.sas.otb.jrsp.RCUMask; + import org.apache.log4j.Logger; public class SubbandStatsPlotPanel extends JPanel @@ -195,8 +196,8 @@ public class SubbandStatsPlotPanel extends JPanel // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { cmbBoard = new javax.swing.JComboBox(); - itsMaskSelectionPanel = new nl.astron.lofar.java.gui.mac.jrsp.MaskSelectionPanel(); - itsPlotContainer = new nl.astron.lofar.java.gui.mac.jrsp.PlotContainer(); + itsMaskSelectionPanel = new nl.astron.lofar.java.sas.otb.rsp.MaskSelectionPanel(); + itsPlotContainer = new nl.astron.lofar.java.sas.otb.rsp.PlotContainer(); setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Subband Statistics Plot"))); cmbBoard.addActionListener(new java.awt.event.ActionListener() { @@ -248,7 +249,7 @@ public class SubbandStatsPlotPanel extends JPanel // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JComboBox cmbBoard; - private nl.astron.lofar.java.gui.mac.jrsp.MaskSelectionPanel itsMaskSelectionPanel; - private nl.astron.lofar.java.gui.mac.jrsp.PlotContainer itsPlotContainer; + private nl.astron.lofar.java.sas.otb.rsp.MaskSelectionPanel itsMaskSelectionPanel; + private nl.astron.lofar.java.sas.otb.rsp.PlotContainer itsPlotContainer; // End of variables declaration//GEN-END:variables } diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsInputPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsInputPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsInputPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsInputPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsInputPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsInputPanel.java similarity index 99% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsInputPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsInputPanel.java index c31bbd0b4a1a7133386519b77df6f270d199494d..743fb1546bb16869f9efd0a90de1235858b26e0a 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsInputPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsInputPanel.java @@ -22,10 +22,11 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.subbandstats; +package nl.astron.lofar.java.sas.otb.rsp.subbandstats; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import javax.swing.JPanel; import javax.swing.event.EventListenerList; diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsListPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsListPanel.java similarity index 94% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsListPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsListPanel.java index bf4441e9118795122c7dca443decf9b7ea52a39e..989f99da47fcf73542e42edfc6d9052a83f883c3 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsListPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsListPanel.java @@ -24,15 +24,15 @@ -package nl.astron.lofar.java.gui.mac.jrsp.subbandstats; +package nl.astron.lofar.java.sas.otb.rsp.subbandstats; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; + import javax.swing.event.EventListenerList; -import nl.astron.lofar.java.mac.jrsp.RCUMask; -import nl.astron.lofar.java.mac.jrsp.WGRegisterType; -import nl.astron.lofar.java.gui.mac.jrsp.ITabPanel; + +import nl.astron.lofar.sas.otb.jrsp.WGRegisterType; /** * @@ -140,7 +140,7 @@ public class WaveformSettingsListPanel extends javax.swing.JPanel btnRemove = new javax.swing.JButton(); setBorder(javax.swing.BorderFactory.createTitledBorder("List")); - jTable.setModel(new nl.astron.lofar.java.gui.mac.jrsp.subbandstats.WaveformTableModel()); + jTable.setModel(new nl.astron.lofar.java.sas.otb.rsp.subbandstats.WaveformTableModel()); jScrollPane.setViewportView(jTable); btnRemove.setText("Remove"); diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsPanel.form b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsPanel.form similarity index 100% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsPanel.form rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsPanel.form diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsPanel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsPanel.java similarity index 88% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsPanel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsPanel.java index 1ce49bc7e70464043c031a698687c05cac6c5b53..687d9a9dd51db980af18c1fd10f7aa29b99efc6f 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformSettingsPanel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformSettingsPanel.java @@ -22,11 +22,9 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.subbandstats; +package nl.astron.lofar.java.sas.otb.rsp.subbandstats; -import javax.swing.JOptionPane; import javax.swing.JPanel; -import nl.astron.lofar.java.mac.jrsp.RCUMask; /** * @@ -63,8 +61,8 @@ public class WaveformSettingsPanel extends JPanel */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { - inputPanel = new nl.astron.lofar.java.gui.mac.jrsp.subbandstats.WaveformSettingsInputPanel(); - listPanel = new nl.astron.lofar.java.gui.mac.jrsp.subbandstats.WaveformSettingsListPanel(); + inputPanel = new nl.astron.lofar.java.sas.otb.rsp.subbandstats.WaveformSettingsInputPanel(); + listPanel = new nl.astron.lofar.java.sas.otb.rsp.subbandstats.WaveformSettingsListPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); @@ -102,9 +100,9 @@ public class WaveformSettingsPanel extends JPanel }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables - private nl.astron.lofar.java.gui.mac.jrsp.subbandstats.WaveformSettingsInputPanel inputPanel; + private nl.astron.lofar.java.sas.otb.rsp.subbandstats.WaveformSettingsInputPanel inputPanel; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; - private nl.astron.lofar.java.gui.mac.jrsp.subbandstats.WaveformSettingsListPanel listPanel; + private nl.astron.lofar.java.sas.otb.rsp.subbandstats.WaveformSettingsListPanel listPanel; // End of variables declaration//GEN-END:variables } diff --git a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformTableModel.java b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformTableModel.java similarity index 96% rename from JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformTableModel.java rename to SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformTableModel.java index 6fe72306151d3fc6e810a5e7cf345183df0a008f..c8b6aafe16cef0d32794425d15a8e734310be0c0 100644 --- a/JAVA/GUI/MAC/jRSP/src/nl/astron/lofar/java/gui/mac/jrsp/subbandstats/WaveformTableModel.java +++ b/SAS/OTB/RSP/src/nl/astron/lofar/java/sas/otb/rsp/subbandstats/WaveformTableModel.java @@ -22,12 +22,14 @@ * $Id$ */ -package nl.astron.lofar.java.gui.mac.jrsp.subbandstats; +package nl.astron.lofar.java.sas.otb.rsp.subbandstats; import java.util.ArrayList; + import javax.swing.event.TableModelEvent; import javax.swing.table.AbstractTableModel; -import nl.astron.lofar.java.mac.jrsp.WGRegisterType; + +import nl.astron.lofar.sas.otb.jrsp.WGRegisterType; /** * diff --git a/SAS/OTB/jOTDB3/assembly.xml b/SAS/OTB/jOTDB3/assembly.xml index 31634202bb9c2ce6406a38914b4bb4e9e2ebde0b..19949d2b30a83b2469d5175ae799cf09bf307a5b 100644 --- a/SAS/OTB/jOTDB3/assembly.xml +++ b/SAS/OTB/jOTDB3/assembly.xml @@ -1,49 +1,49 @@ -<assembly - xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> - - <id>deployment</id> - - <formats> - <format>tar.gz</format> - </formats> - - <fileSets> - - <fileSet> - <directory>${project.build.directory}</directory> - <outputDirectory>.</outputDirectory> - <includes> - <include>*.jar</include> - </includes> - </fileSet> - - <fileSet> - <directory>${project.build.directory}/native/javah</directory> - <outputDirectory>include</outputDirectory> - <includes> - <include>**/*.*</include> - </includes> - </fileSet> - - <fileSet> - <directory>${project.build.directory}/lib</directory> - <outputDirectory>lib</outputDirectory> - <includes> - <include>**/*.*</include> - </includes> - </fileSet> - - <fileSet> - <directory>${basedir}/dist-src</directory> - <outputDirectory>.</outputDirectory> - <includes> - <include>**/*</include> - </includes> - </fileSet> - - </fileSets> - - +<assembly + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> + + <id>deployment</id> + + <formats> + <format>tar.gz</format> + </formats> + + <fileSets> + + <fileSet> + <directory>${project.build.directory}</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>*.jar</include> + </includes> + </fileSet> + + <fileSet> + <directory>${project.build.directory}/native/javah</directory> + <outputDirectory>include</outputDirectory> + <includes> + <include>**/*.*</include> + </includes> + </fileSet> + + <fileSet> + <directory>${project.build.directory}/lib</directory> + <outputDirectory>lib</outputDirectory> + <includes> + <include>**/*.*</include> + </includes> + </fileSet> + + <fileSet> + <directory>${basedir}/dist-src</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + + </fileSets> + + </assembly> \ No newline at end of file diff --git a/SAS/OTB/jOTDB3/dist-src/startServerOTB b/SAS/OTB/jOTDB3/dist-src/startServerOTB index 49f8eaf2779289f403b24e310a0d199f12972ef5..2a9ffb964ac4d96ec432b502d3818a1276a4ef89 100644 --- a/SAS/OTB/jOTDB3/dist-src/startServerOTB +++ b/SAS/OTB/jOTDB3/dist-src/startServerOTB @@ -1,6 +1,6 @@ #!/bin/sh -export OTB_DIR=/opt/sas/otb +export OTB_DIR=/opt/sas/otb/server export JAVA_HOME=/usr/java/jdk1.7.0_02 echo @@ -12,7 +12,7 @@ export CLASSPATH=$OTB_APP for JAR_DEPENDENCY in $OTB_DIR/lib/*.jar do - echo -- Adding `basename $JAR_DEPENDENCY` dependency to Java Classpath + echo -- Adding dependency to CLASSPATH: `basename $JAR_DEPENDENCY` export CLASSPATH=$CLASSPATH:$JAR_DEPENDENCY done @@ -25,4 +25,4 @@ if [ $? -ne 0 ]; then serverpid=$! fi -echo OTB Server stopped. \ No newline at end of file +echo OTB Server stopped. diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jCampaign.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jCampaign.h index 60f79b70f58d7f60c54400d4a511b2320b0a014b..d6341392ac9e43a1413e415bb91561439ca8701b 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jCampaign.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jCampaign.h @@ -1,61 +1,24 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jCampaign */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jCampaign -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jCampaign -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jCampaign - * Method: initCampaign - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_initCampaign - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jCampaign - * Method: getCampaign - * Signature: (Ljava/lang/String;)Lnl/astron/lofar/sas/otb/jotdb3/jCampaignInfo; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_getCampaign__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jCampaign - * Method: getCampaign - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb3/jCampaignInfo; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_getCampaign__I - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jCampaign - * Method: getCampaignList - * Signature: ()Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_getCampaignList - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jCampaign - * Method: saveCampaign - * Signature: (Lnl/astron/lofar/sas/otb/jotdb3/jCampaignInfo;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_saveCampaign - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jCampaign - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_errorMsg - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +/* DO NOT EDIT THIS FILE - it is machine generated */ + +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jCampaign__ +#define __nl_astron_lofar_sas_otb_jotdb3_jCampaign__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_initCampaign (JNIEnv *env, jobject); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_getCampaign__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_getCampaign__I (JNIEnv *env, jobject, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_getCampaignList (JNIEnv *env, jobject); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_saveCampaign (JNIEnv *env, jobject, jobject); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jCampaign_errorMsg (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jCampaign__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jClassifConv.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jClassifConv.h index e22c8386d645b06e090aca808b4f4b9db433cb7e..07a5de4613e4370c86d0970880601ed7203581e2 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jClassifConv.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jClassifConv.h @@ -1,61 +1,22 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jClassifConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jClassifConv -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jClassifConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jClassifConv - * Method: initClassifConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_initClassifConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jClassifConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jClassifConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jClassifConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jClassifConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jClassifConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jClassifConv__ +#define __nl_astron_lofar_sas_otb_jotdb3_jClassifConv__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_initClassifConv (JNIEnv *env, jobject); +JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_get__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_get__S (JNIEnv *env, jobject, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_getTypes (JNIEnv *env, jobject); +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_top (JNIEnv *env, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jClassifConv_next (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jClassifConv__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger.h index 3ca5af5f737e165dc899d9f70dfff42c037e9cca..21389863ae9b53241e76e1d9580f13d821538105 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger.h @@ -1,21 +1,17 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger - * Method: initLogger - * Signature: (Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger_initLogger - (JNIEnv *, jobject, jstring); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger__ +#define __nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger_initLogger (JNIEnv *env, jobject, jstring); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jInitCPPLogger__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.h index 15fbeb3906ffcbc55d7bd70b13c7115b12959f9f..c44f43426a0e1469e1c73897fa2458bafcb2bd63 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.h @@ -1,229 +1,43 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: initOTDBconnection - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_initOTDBconnection - (JNIEnv *, jobject, jstring, jstring, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: isConnected - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_isConnected - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: connect - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_connect - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: disconnect - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_disconnect - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeInfo - * Signature: (IZ)Lnl/astron/lofar/sas/otb/jotdb3/jOTDBtree; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeInfo__IZ - (JNIEnv *, jobject, jint, jboolean); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeInfo - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb3/jOTDBtree; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeInfo__I - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeList - * Signature: (SSILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SSILjava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jshort, jshort, jint, jstring, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeList - * Signature: (SSILjava/lang/String;Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SSILjava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jshort, jshort, jint, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeList - * Signature: (SSILjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SSILjava_lang_String_2 - (JNIEnv *, jobject, jshort, jshort, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeList - * Signature: (SSI)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SSI - (JNIEnv *, jobject, jshort, jshort, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeList - * Signature: (SS)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SS - (JNIEnv *, jobject, jshort, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeList - * Signature: (S)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getStateList - * Signature: (IZLjava/lang/String;Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getStateList__IZLjava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jint, jboolean, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getStateList - * Signature: (IZLjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getStateList__IZLjava_lang_String_2 - (JNIEnv *, jobject, jint, jboolean, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getStateList - * Signature: (IZ)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getStateList__IZ - (JNIEnv *, jobject, jint, jboolean); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getStateList - * Signature: (I)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getStateList__I - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getDefaultTemplates - * Signature: ()Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getDefaultTemplates - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getExecutableTrees - * Signature: (S)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getExecutableTrees__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getExecutableTrees - * Signature: ()Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getExecutableTrees__ - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreeGroup - * Signature: (SS)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeGroup - (JNIEnv *, jobject, jshort, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreesInPeriod - * Signature: (SLjava/lang/String;Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreesInPeriod__SLjava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jshort, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreesInPeriod - * Signature: (SLjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreesInPeriod__SLjava_lang_String_2 - (JNIEnv *, jobject, jshort, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getTreesInPeriod - * Signature: (S)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreesInPeriod__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: newGroupID - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_newGroupID - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_errorMsg - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getAuthToken - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getAuthToken - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection - * Method: getDBName - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getDBName - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection__ +#define __nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_initOTDBconnection (JNIEnv *env, jobject, jstring, jstring, jstring, jstring); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_isConnected (JNIEnv *env, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_connect (JNIEnv *env, jobject); +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_disconnect (JNIEnv *env, jobject); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeInfo__IZ (JNIEnv *env, jobject, jint, jboolean); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeInfo__I (JNIEnv *env, jobject, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SSILjava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jshort, jshort, jint, jstring, jstring, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SSILjava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jshort, jshort, jint, jstring, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SSILjava_lang_String_2 (JNIEnv *env, jobject, jshort, jshort, jint, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SSI (JNIEnv *env, jobject, jshort, jshort, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__SS (JNIEnv *env, jobject, jshort, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeList__S (JNIEnv *env, jobject, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getStateList__IZLjava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jint, jboolean, jstring, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getStateList__IZLjava_lang_String_2 (JNIEnv *env, jobject, jint, jboolean, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getStateList__IZ (JNIEnv *env, jobject, jint, jboolean); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getStateList__I (JNIEnv *env, jobject, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getDefaultTemplates (JNIEnv *env, jobject); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getExecutableTrees__S (JNIEnv *env, jobject, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getExecutableTrees__ (JNIEnv *env, jobject); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreeGroup (JNIEnv *env, jobject, jshort, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreesInPeriod__SLjava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jshort, jstring, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreesInPeriod__SLjava_lang_String_2 (JNIEnv *env, jobject, jshort, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getTreesInPeriod__S (JNIEnv *env, jobject, jshort); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_newGroupID (JNIEnv *env, jobject); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_errorMsg (JNIEnv *env, jobject); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getAuthToken (JNIEnv *env, jobject); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection_getDBName (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv.h index 12bbda58a2a44f699157f4e83b12d8b3c8004725..76774da8a49ef0e9c5ef4c6e72a5d8fc580d5bd6 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv.h @@ -1,61 +1,22 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv - * Method: initParamTypeConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_initParamTypeConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv__ +#define __nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_initParamTypeConv (JNIEnv *env, jobject); +JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_get__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_get__S (JNIEnv *env, jobject, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_getTypes (JNIEnv *env, jobject); +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_top (JNIEnv *env, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv_next (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jParamTypeConv__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance.h index c200fe2d7a735af92bb2983570386121da5d1e10..6aae1dfc7e91d1a83c7f7cc3600fa300afb13050 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance.h @@ -1,381 +1,62 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: initTreeMaintenance - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_initTreeMaintenance - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: loadMasterFile - * Signature: (Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_loadMasterFile - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: loadComponentFile - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_loadComponentFile__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jstring, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: loadComponentFile - * Signature: (Ljava/lang/String;Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_loadComponentFile__Ljava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: loadComponentFile - * Signature: (Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_loadComponentFile__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getComponentList - * Signature: (Ljava/lang/String;Z)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentList__Ljava_lang_String_2Z - (JNIEnv *, jobject, jstring, jboolean); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getComponentList - * Signature: (Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentList__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getComponentList - * Signature: ()Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentList__ - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getComponentNode - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb3/jVICnodeDef; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentNode - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getComponentParams - * Signature: (I)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentParams - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: saveComponentNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb3/jVICnodeDef;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_saveComponentNode - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: isTopComponent - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_isTopComponent - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: deleteComponentNode - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_deleteComponentNode - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getFullComponentName - * Signature: (Lnl/astron/lofar/sas/otb/jotdb3/jVICnodeDef;)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getFullComponentName - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: buildTemplateTree - * Signature: (IS)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_buildTemplateTree - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: newTemplateTree - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_newTemplateTree - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: copyTemplateTree - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_copyTemplateTree - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: assignTemplateName - * Signature: (ILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_assignTemplateName - (JNIEnv *, jobject, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: assignProcessType - * Signature: (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_assignProcessType - (JNIEnv *, jobject, jint, jstring, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getNode - * Signature: (II)Lnl/astron/lofar/sas/otb/jotdb3/jOTDBnode; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getNode - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getParam - * Signature: (II)Lnl/astron/lofar/sas/otb/jotdb3/jOTDBparam; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getParam__II - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getParam - * Signature: (Lnl/astron/lofar/sas/otb/jotdb3/jOTDBnode;)Lnl/astron/lofar/sas/otb/jotdb3/jOTDBparam; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getParam__Lnl_astron_lofar_sas_otb_jotdb3_jOTDBnode_2 - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: saveParam - * Signature: (Lnl/astron/lofar/sas/otb/jotdb3/jOTDBparam;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_saveParam - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getItemList - * Signature: (III)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getItemList__III - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getItemList - * Signature: (ILjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getItemList__ILjava_lang_String_2 - (JNIEnv *, jobject, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: dupNode - * Signature: (IIS)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_dupNode - (JNIEnv *, jobject, jint, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: addComponent - * Signature: (IIILjava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_addComponent__IIILjava_lang_String_2 - (JNIEnv *, jobject, jint, jint, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: addComponent - * Signature: (III)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_addComponent__III - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: saveNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb3/jOTDBnode;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_saveNode - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: saveNodeList - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_saveNodeList - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: deleteNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb3/jOTDBnode;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_deleteNode - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: deleteNodeList - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_deleteNodeList - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: checkTreeConstraints - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_checkTreeConstraints__II - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: checkTreeConstraints - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_checkTreeConstraints__I - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: instanciateTree - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_instanciateTree - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: pruneTree - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_pruneTree - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: exportTree - * Signature: (IILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_exportTree - (JNIEnv *, jobject, jint, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: exportResultTree - * Signature: (IILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_exportResultTree - (JNIEnv *, jobject, jint, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: deleteTree - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_deleteTree - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: getTopNode - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb3/jOTDBnode; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getTopNode - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: setMomInfo - * Signature: (IIILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setMomInfo - (JNIEnv *, jobject, jint, jint, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: setClassification - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setClassification - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: setTreeState - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setTreeState - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: setDescription - * Signature: (ILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setDescription - (JNIEnv *, jobject, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: setSchedule - * Signature: (ILjava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setSchedule - (JNIEnv *, jobject, jint, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_errorMsg - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance__ +#define __nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_initTreeMaintenance (JNIEnv *env, jobject); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_loadMasterFile (JNIEnv *env, jobject, jstring); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_loadComponentFile__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring, jstring); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_loadComponentFile__Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_loadComponentFile__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentList__Ljava_lang_String_2Z (JNIEnv *env, jobject, jstring, jboolean); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentList__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentList__ (JNIEnv *env, jobject); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentNode (JNIEnv *env, jobject, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getComponentParams (JNIEnv *env, jobject, jint); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_saveComponentNode (JNIEnv *env, jobject, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_isTopComponent (JNIEnv *env, jobject, jint); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_deleteComponentNode (JNIEnv *env, jobject, jint); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getFullComponentName (JNIEnv *env, jobject, jobject); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_buildTemplateTree (JNIEnv *env, jobject, jint, jshort); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_newTemplateTree (JNIEnv *env, jobject); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_copyTemplateTree (JNIEnv *env, jobject, jint); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_assignTemplateName (JNIEnv *env, jobject, jint, jstring); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_assignProcessType (JNIEnv *env, jobject, jint, jstring, jstring, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getNode (JNIEnv *env, jobject, jint, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getParam__II (JNIEnv *env, jobject, jint, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getParam__Lnl_astron_lofar_sas_otb_jotdb3_jOTDBnode_2 (JNIEnv *env, jobject, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_saveParam (JNIEnv *env, jobject, jobject); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getItemList__III (JNIEnv *env, jobject, jint, jint, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getItemList__ILjava_lang_String_2 (JNIEnv *env, jobject, jint, jstring); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_dupNode (JNIEnv *env, jobject, jint, jint, jshort); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_addComponent__IIILjava_lang_String_2 (JNIEnv *env, jobject, jint, jint, jint, jstring); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_addComponent__III (JNIEnv *env, jobject, jint, jint, jint); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_saveNode (JNIEnv *env, jobject, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_saveNodeList (JNIEnv *env, jobject, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_deleteNode (JNIEnv *env, jobject, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_deleteNodeList (JNIEnv *env, jobject, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_checkTreeConstraints__II (JNIEnv *env, jobject, jint, jint); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_checkTreeConstraints__I (JNIEnv *env, jobject, jint); +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_instanciateTree (JNIEnv *env, jobject, jint); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_pruneTree (JNIEnv *env, jobject, jint, jshort); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_exportTree (JNIEnv *env, jobject, jint, jint, jstring); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_exportResultTree (JNIEnv *env, jobject, jint, jint, jstring); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_deleteTree (JNIEnv *env, jobject, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_getTopNode (JNIEnv *env, jobject, jint); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setMomInfo (JNIEnv *env, jobject, jint, jint, jint, jstring); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setClassification (JNIEnv *env, jobject, jint, jshort); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setTreeState (JNIEnv *env, jobject, jint, jshort); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setDescription (JNIEnv *env, jobject, jint, jstring); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_setSchedule (JNIEnv *env, jobject, jint, jstring, jstring); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance_errorMsg (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jTreeMaintenance__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv.h index 2ecc0a424175107300360e61d7f4d56ec0b6c85e..f5f8b3d937eb359989acfe38c2e17bfddf86882c 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv.h @@ -1,61 +1,22 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv - * Method: initTreeStateConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_initTreeStateConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv__ +#define __nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_initTreeStateConv (JNIEnv *env, jobject); +JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_get__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_get__S (JNIEnv *env, jobject, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_getTypes (JNIEnv *env, jobject); +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_top (JNIEnv *env, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv_next (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jTreeStateConv__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv.h index febd45b64cc35fe8cff287aa40d1d085866b7fe7..47974d0947914519fd9e1c2e0fd8b0e0c2e77f34 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv.h @@ -1,61 +1,22 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv - * Method: initTreeTypeConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_initTreeTypeConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv__ +#define __nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_initTreeTypeConv (JNIEnv *env, jobject); +JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_get__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_get__S (JNIEnv *env, jobject, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_getTypes (JNIEnv *env, jobject); +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_top (JNIEnv *env, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv_next (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jTreeTypeConv__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.h index ff2875e8c97e5ef9c0da565bd99dc01e1cf9a9a2..a62006bfab964183cbe879c146de0e4b6111c58a 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.h @@ -1,101 +1,28 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jTreeValue */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jTreeValue -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jTreeValue -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: addKVT - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_addKVT__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jstring, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: addKVT - * Signature: (Lnl/astron/lofar/sas/otb/jotdb3/jOTDBvalue;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_addKVT__Lnl_astron_lofar_sas_otb_jotdb3_jOTDBvalue_2 - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: addKVTlist - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_addKVTlist - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: getBrokenHardware - * Signature: (Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getBrokenHardware__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: getBrokenHardware - * Signature: ()Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getBrokenHardware__ - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: searchInPeriod - * Signature: (IILjava/lang/String;Ljava/lang/String;Z)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_searchInPeriod__IILjava_lang_String_2Ljava_lang_String_2Z - (JNIEnv *, jobject, jint, jint, jstring, jstring, jboolean); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: searchInPeriod - * Signature: (IILjava/lang/String;Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_searchInPeriod__IILjava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jint, jint, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: searchInPeriod - * Signature: (IILjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_searchInPeriod__IILjava_lang_String_2 - (JNIEnv *, jobject, jint, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: searchInPeriod - * Signature: (II)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_searchInPeriod__II - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: getSchedulableItems - * Signature: (I)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getSchedulableItems__I - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue - * Method: getSchedulableItems - * Signature: ()Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getSchedulableItems__ - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jTreeValue__ +#define __nl_astron_lofar_sas_otb_jotdb3_jTreeValue__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_addKVT__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring, jstring); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_addKVT__Lnl_astron_lofar_sas_otb_jotdb3_jOTDBvalue_2 (JNIEnv *env, jobject, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_addKVTlist (JNIEnv *env, jobject, jobject); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getBrokenHardware__Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getBrokenHardware__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getBrokenHardware__ (JNIEnv *env, jobject); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_searchInPeriod__IILjava_lang_String_2Ljava_lang_String_2Z (JNIEnv *env, jobject, jint, jint, jstring, jstring, jboolean); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_searchInPeriod__IILjava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jint, jint, jstring, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_searchInPeriod__IILjava_lang_String_2 (JNIEnv *env, jobject, jint, jint, jstring); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_searchInPeriod__II (JNIEnv *env, jobject, jint, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getSchedulableItems__I (JNIEnv *env, jobject, jint); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getSchedulableItems__ (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jTreeValue__ */ diff --git a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jUnitConv.h b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jUnitConv.h index 7bf1eaa4d4de00543e9c67b8ba26af1493569a0d..a9102b783e14e7d5a652993fdfd0b4295e35fecd 100644 --- a/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jUnitConv.h +++ b/SAS/OTB/jOTDB3/include/jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jUnitConv.h @@ -1,61 +1,22 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb3_jUnitConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb3_jUnitConv -#define _Included_nl_astron_lofar_sas_otb_jotdb3_jUnitConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jUnitConv - * Method: initUnitConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_initUnitConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jUnitConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jUnitConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jUnitConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jUnitConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb3_jUnitConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif +#ifndef __nl_astron_lofar_sas_otb_jotdb3_jUnitConv__ +#define __nl_astron_lofar_sas_otb_jotdb3_jUnitConv__ + +#include <jni.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_initUnitConv (JNIEnv *env, jobject); +JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_get__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_get__S (JNIEnv *env, jobject, jshort); +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_getTypes (JNIEnv *env, jobject); +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_top (JNIEnv *env, jobject); +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jUnitConv_next (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __nl_astron_lofar_sas_otb_jotdb3_jUnitConv__ */ diff --git a/SAS/OTB/jOTDB3/pom.xml b/SAS/OTB/jOTDB3/pom.xml index 6e4805eca00663b650d4822a9f887ce0150ea61d..90b9e21db5056eae6df13ab25c0d0e26a14873d7 100644 --- a/SAS/OTB/jOTDB3/pom.xml +++ b/SAS/OTB/jOTDB3/pom.xml @@ -1,215 +1,153 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project - xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>nl.astron.lofar.sas</groupId> - <artifactId>jOTDB3</artifactId> - <name>lib Object Tree Browser</name> - <version>1.0.2</version> - - <organization> - <name>Astron</name> - <url>http://www.astron.nl</url> - </organization> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.test.sourceEncoding>UTF-8</project.test.sourceEncoding> - </properties> - - <build> - - <sourceDirectory>src</sourceDirectory> - <testSourceDirectory>test</testSourceDirectory> - - <resources> - <resource> - <directory>${basedir}</directory> - <includes> - <include>*.log_prop</include> - </includes> - </resource> - - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - <exclude>**/*.cc</exclude> - </excludes> - </resource> - </resources> - - <plugins> - - <!-- Java Compiler settings --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - - <!-- Generate HEADER files from JNI Java classes --> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>native-maven-plugin</artifactId> - <version>1.0-alpha-7</version> - - <configuration> - <javahClassNames> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jCampaign</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jClassifConv</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jInitCPPLogger</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jOTDBconnection</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jParamTypeConv</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jTreeMaintenance</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jTreeStateConv</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jTreeTypeConv</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jUnitConv</javahClassName> - <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jTreeValue</javahClassName> - </javahClassNames> - </configuration> - - <executions> - <execution> - <phase>process-classes</phase> - <goals> - <goal>javah</goal> - </goals> - </execution> - </executions> - </plugin> - - - <!-- Set the main class in the manifest file --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.4</version> - - <configuration> - <archive> - <manifest> - <mainClass>nl.astron.lofar.sas.otb.jotdb3.jOTDBserver</mainClass> - <addDefaultImplementationEntries>true</addDefaultImplementationEntries> - <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> - </manifest> - </archive> - </configuration> - </plugin> - - - <!-- Create a /target/lib directory with ALL dependencies --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>2.4</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - - <!-- Create an TAR.GZ file --> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <version>2.3</version> - <configuration> - <descriptor>assembly.xml</descriptor> - <appendAssemblyId>false</appendAssemblyId> - </configuration> - - <executions> - <execution> - <id>make-assembly</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - - <pluginManagement> - <plugins> - <!-- - This plugin's configuration is used to store Eclipse m2e settings only. - It has no influence on the Maven build itself. - --> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>1.0.0</version> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId>org.codehaus.mojo</groupId> - <artifactId>native-maven-plugin</artifactId> - <versionRange>[1.0-alpha-7,)</versionRange> - <goals> - <goal>javah</goal> - </goals> - </pluginExecutionFilter> - <action><ignore /></action> - </pluginExecution> - <pluginExecution> - <pluginExecutionFilter> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <versionRange>[1.0.0,)</versionRange> - <goals> - <goal>copy-dependencies</goal> - </goals> - </pluginExecutionFilter> - <action><ignore /></action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - </plugins> - </pluginManagement> - </build> - - <dependencies> - - <dependency> - <groupId>nl.astron.lofar</groupId> - <artifactId>lofarutils</artifactId> - <version>1.0.2</version> - </dependency> - - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.16</version> - </dependency> - - </dependencies> - - <distributionManagement> - <snapshotRepository> - <id>snapshots</id> - <name>Astron Nexus Repository</name> - <url>https://support.astron.nl/nexus/content/repositories/snapshots/</url> - </snapshotRepository> - </distributionManagement> - -</project> +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar OTB :: jOTDB3</name> + <description>Object Tree Browser Client/Server - jOTDB3</description> + + <parent> + <groupId>nl.astron.lofar.sas.otb</groupId> + <artifactId>otb-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + </parent> + + <artifactId>jOTDB3</artifactId> + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/jOTDB3</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/jOTDB3</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + + <sourceDirectory>src</sourceDirectory> + <testSourceDirectory>test</testSourceDirectory> + + <resources> + <resource> + <directory>${basedir}</directory> + <includes> + <include>*.log_prop</include> + </includes> + </resource> + + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + <exclude>**/*.cc</exclude> + </excludes> + </resource> + </resources> + + <plugins> + + <!-- Generate HEADER files from JNI Java classes --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>native-maven-plugin</artifactId> + + <configuration> + <javahClassNames> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jCampaign</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jClassifConv</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jInitCPPLogger</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jOTDBconnection</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jParamTypeConv</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jTreeMaintenance</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jTreeStateConv</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jTreeTypeConv</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jUnitConv</javahClassName> + <javahClassName>nl.astron.lofar.sas.otb.jotdb3.jTreeValue</javahClassName> + </javahClassNames> + </configuration> + + <executions> + <execution> + <phase>process-classes</phase> + <goals> + <goal>javah</goal> + </goals> + </execution> + </executions> + </plugin> + + + <!-- Set the main class in the manifest file --> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + + <configuration> + <archive> + <manifest> + <mainClass>nl.astron.lofar.sas.otb.jotdb3.jOTDBserver</mainClass> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> + </manifest> + </archive> + </configuration> + </plugin> + + + <!-- Create a /target/lib directory with ALL dependencies --> + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + + <!-- Create an TAR.GZ file --> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptor>assembly.xml</descriptor> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + + </build> + + <dependencies> + + <!-- Local dependencies --> + <dependency> + <groupId>nl.astron.lofar.lib</groupId> + <artifactId>lofarutils</artifactId> + </dependency> + + <!-- External dependencies --> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + + </dependencies> + + +</project> diff --git a/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jTreeValue.java b/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jTreeValue.java index 77aec77c24debc0791414e79a9ab1e93bf4b8088..52e47272bea71d5a420465b07cb94941b1756475 100644 --- a/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jTreeValue.java +++ b/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jTreeValue.java @@ -39,10 +39,12 @@ public class jTreeValue implements jTreeValueInterface itsTreeID=0; } + @Override public void setTreeID(int aTreeID) { itsTreeID=aTreeID; } + @Override public int TreeID() { return itsTreeID; } @@ -50,16 +52,23 @@ public class jTreeValue implements jTreeValueInterface // PVSS will continuously add value-changes to the offline PIC. // There two ways PVSS can do this. // The function returns false if the PIC node can not be found. + @Override public native boolean addKVT( String key, String value, String time) throws RemoteException; + @Override public native boolean addKVT(jOTDBvalue aKVT) throws RemoteException; // Note: This form will probably be used by SAS and OTB when committing // a list of modified node. + @Override public native boolean addKVTlist(Vector<jOTDBvalue> aValueList) throws RemoteException; // public native boolean addKVTparamSet(jParamterSet aPS) throws Exception; - // Query for getting list of broken hardware on a certain time. - public native Vector<jOTDBvalue> getBrokenHardware (String atTime) throws RemoteException; + // Query for getting list of broken hardware on a certain time, or between a certain time range + @Override + public native Vector<jOTDBvalue> getBrokenHardware (String aStartTime, String aStopTime) throws RemoteException; + @Override + public native Vector<jOTDBvalue> getBrokenHardware (String aStartTime) throws RemoteException; + @Override public native Vector<jOTDBvalue> getBrokenHardware () throws RemoteException; //# SHM queries @@ -70,14 +79,18 @@ public class jTreeValue implements jTreeValueInterface // When the endDate is not specified all value changes from beginDate // till 'now' are retrieved, otherwise the selection is limited to // [beginDate..endDate>. + @Override public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate, String endDate, boolean mostRecentlyOnly) throws RemoteException; + @Override public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate, String endDate) throws RemoteException; + @Override public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate) throws RemoteException; + @Override public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth) throws RemoteException; //# SAS queries @@ -85,11 +98,14 @@ public class jTreeValue implements jTreeValueInterface // resources exist in the OTDB tree. This list can be retrieved with // this function. // TBW: Is this realy what SAS needs??? + @Override public native Vector<jOTDBvalue> getSchedulableItems (int topNode) throws RemoteException; + @Override public native Vector<jOTDBvalue> getSchedulableItems () throws RemoteException; // Whenever an error occurs in one the OTDB functions the message can // be retrieved with this function. + @Override public String errorMsg() { return itsErrorMsg; } diff --git a/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jTreeValueInterface.java b/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jTreeValueInterface.java index 1b8a8252397cf5a757a356dd30348bb10ccc0cc9..43cf15a83b2430f0cbfc98b74543ac0b6a77cf70 100644 --- a/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jTreeValueInterface.java +++ b/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jTreeValueInterface.java @@ -47,8 +47,9 @@ public interface jTreeValueInterface extends Remote // public boolean addKVTparamSet(jParamterSet aPS) throws RemoteException; - // Query for getting list of broken hardware on a certain time. - public Vector<jOTDBvalue> getBrokenHardware (String atTime) throws RemoteException; + // Query for getting list of broken hardware on a certain time, or between a certain time range + public Vector<jOTDBvalue> getBrokenHardware (String aStartTime, String aStopTime) throws RemoteException; + public Vector<jOTDBvalue> getBrokenHardware (String aStartTime) throws RemoteException; public Vector<jOTDBvalue> getBrokenHardware () throws RemoteException; diff --git a/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.cc b/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.cc index d98152703f97449a19d290e992d74160a8ad4b54..95df2ce4e028d4cfd04d249ed8e5f8d88ce33432 100644 --- a/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.cc +++ b/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.cc @@ -146,6 +146,54 @@ JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_addKVT return succes; } +/* + * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue + * Method: getBrokenHardware + * Signature: (Ljava/lang/String,Ljava/lang/String)Ljava/util/Vector; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getBrokenHardware__Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject jTreeValue, jstring aStartTime, jstring aStopTime) { + // create the connection with the c++ TreeVal + setTreeValConnection(env,jTreeValue); + + const char* aStart = env->GetStringUTFChars (aStartTime, 0); + const string startTime (aStart); + const ptime tStart (time_from_string (startTime)); + + const char* aStop = env->GetStringUTFChars (aStopTime, 0); + const string stopTime (aStop); + const ptime tStop (time_from_string (stopTime)); + + jobject valueVector; + + try { + vector<OTDBvalue> valueList = ((TreeValue*)getCObjectPtr(env,jTreeValue,"_TreeValue"))->getBrokenHardware (tStart,tStop); + vector<OTDBvalue>::iterator valueIterator; + + + // Construct java Vector + jclass class_Vector = env->FindClass("java/util/Vector"); + jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); + valueVector = env->NewObject(class_Vector, mid_Vector_cons); + jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); + + for (valueIterator = valueList.begin(); valueIterator != valueList.end(); valueIterator++) + env->CallObjectMethod(valueVector, mid_Vector_add, convertOTDBvalue (env, *valueIterator)); + + env->ReleaseStringUTFChars (aStartTime, aStart); + env->ReleaseStringUTFChars (aStopTime, aStop); + + setErrorMsg(env,jTreeValue); + } catch (exception &ex) { + cout << "Exception during treeValue::getBrokenHardware(" << tStart << "," << tStop << ") "<< ex.what() << endl; + + env->ReleaseStringUTFChars (aStartTime, aStart); + env->ReleaseStringUTFChars (aStopTime, aStop); + env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); + + } + return valueVector; +} + /* * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue * Method: getBrokenHardware diff --git a/JAVA/CEP/jParmFacade/conf/Plotter-config-jparmfacade.jar b/SAS/OTB/jParmFacade/conf/Plotter-config-jparmfacade.jar similarity index 100% rename from JAVA/CEP/jParmFacade/conf/Plotter-config-jparmfacade.jar rename to SAS/OTB/jParmFacade/conf/Plotter-config-jparmfacade.jar diff --git a/JAVA/CEP/jParmFacade/include/Makefile.am b/SAS/OTB/jParmFacade/include/Makefile.am similarity index 100% rename from JAVA/CEP/jParmFacade/include/Makefile.am rename to SAS/OTB/jParmFacade/include/Makefile.am diff --git a/JAVA/CEP/jParmFacade/include/jParmFacade/Makefile.am b/SAS/OTB/jParmFacade/include/jParmFacade/Makefile.am similarity index 100% rename from JAVA/CEP/jParmFacade/include/jParmFacade/Makefile.am rename to SAS/OTB/jParmFacade/include/jParmFacade/Makefile.am diff --git a/SAS/OTB/jParmFacade/include/jParmFacade/nl_astron_lofar_sas_otb_jparmfacade_jParmFacade.h b/SAS/OTB/jParmFacade/include/jParmFacade/nl_astron_lofar_sas_otb_jparmfacade_jParmFacade.h new file mode 100644 index 0000000000000000000000000000000000000000..5809eec90233829e34666a2b907e6a9c32820a20 --- /dev/null +++ b/SAS/OTB/jParmFacade/include/jParmFacade/nl_astron_lofar_sas_otb_jparmfacade_jParmFacade.h @@ -0,0 +1,45 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class nl_astron_lofar_sas_otb_jparmfacade_jParmFacade */ + +#ifndef _Included_nl_astron_lofar_sas_otb_jparmfacade_jParmFacade +#define _Included_nl_astron_lofar_sas_otb_jparmfacade_jParmFacade +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: nl_astron_lofar_sas_otb_jparmfacade_jParmFacade + * Method: getRange + * Signature: (Ljava/lang/String;)Ljava/util/Vector; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jparmfacade_jParmFacade_getRange + (JNIEnv *, jobject, jstring); + +/* + * Class: nl_astron_lofar_sas_otb_jparmfacade_jParmFacade + * Method: getNames + * Signature: (Ljava/lang/String;)Ljava/util/Vector; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jparmfacade_jParmFacade_getNames + (JNIEnv *, jobject, jstring); + +/* + * Class: nl_astron_lofar_sas_otb_jparmfacade_jParmFacade + * Method: getValues + * Signature: (Ljava/lang/String;DDIDDI)Ljava/util/HashMap; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jparmfacade_jParmFacade_getValues + (JNIEnv *, jobject, jstring, jdouble, jdouble, jint, jdouble, jdouble, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jparmfacade_jParmFacade + * Method: getHistory + * Signature: (Ljava/lang/String;DDDDDD)Ljava/util/HashMap; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jparmfacade_jParmFacade_getHistory + (JNIEnv *, jobject, jstring, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/SAS/OTB/jParmFacade/pom.xml b/SAS/OTB/jParmFacade/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..2c38cb4aa21110b3eba471ae05f5c373eae1b91c --- /dev/null +++ b/SAS/OTB/jParmFacade/pom.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar OTB :: jParmFacade</name> + <description>Object Tree Browser Client/Server - jParmFacade</description> + + <parent> + <groupId>nl.astron.lofar.sas.otb</groupId> + <artifactId>otb-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + </parent> + + <artifactId>jParmFacade</artifactId> + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/jParmFacade</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/jParmFacade</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + + <sourceDirectory>src</sourceDirectory> + <testSourceDirectory>test</testSourceDirectory> + + <resources> + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + <exclude>**/*.cc</exclude> + </excludes> + </resource> + </resources> + + <plugins> + + <!-- Generate HEADER files from JNI Java classes --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>native-maven-plugin</artifactId> + + <configuration> + <javahClassNames> + <javahClassName>nl.astron.lofar.sas.otb.jparmfacade.jParmFacade</javahClassName> + </javahClassNames> + </configuration> + + <executions> + <execution> + <phase>process-classes</phase> + <goals> + <goal>javah</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + + </build> + + + <dependencies> + <dependency> + <groupId>nl.astron.lofar.sas.otb</groupId> + <artifactId>jOTDB3</artifactId> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + </dependencies> + +</project> + + diff --git a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacade.java b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacade.java similarity index 82% rename from JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacade.java rename to SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacade.java index 86882361b7a142f77db2e875b47d2d0732d3170e..8bd4b07817500b9bbdea19eeac00c692ebc6cc5d 100644 --- a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacade.java +++ b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacade.java @@ -21,10 +21,10 @@ */ -package nl.astron.lofar.java.cep.jparmfacade; +package nl.astron.lofar.sas.otb.jparmfacade; +import java.util.ArrayList; import java.util.HashMap; -import java.util.Vector; /** * @created 18-04-2006, 9:54 @@ -33,7 +33,7 @@ import java.util.Vector; */ public class jParmFacade { private String itsParmFacadeDB=""; - + /** Creates a new instance of jParmFacade */ public jParmFacade() { itsParmFacadeDB=""; @@ -41,31 +41,31 @@ public class jParmFacade { public void setParmFacadeDB(String tableName) { itsParmFacadeDB=tableName; } - - + + // Get the domain range (as startx,endx,starty,endy) of the given // parameters in the table. // This is the minimum start value and maximum end value for all parameters. // An empty name pattern is the same as * (all parm names). - public native Vector<Double> getRange(String parmNamePattern) throws Exception; - + public native ArrayList<Double> getRange(String parmNamePattern) throws Exception; + // Get parameter names in the table matching the pattern. // An empty name pattern is the same as * (all parm names). - public native Vector<String> getNames(String parmNamePattern) throws Exception; - + public native ArrayList<String> getNames(String parmNamePattern) throws Exception; + // Get the parameter values for the given parameters and domain. // The domain is given by the start and end values, while the grid is // given by nx and ny. - public native HashMap<String,Vector<Double>> getValues(String parmNamePattern, + public native HashMap<String,ArrayList<Double>> getValues(String parmNamePattern, double startx, double endx, int nx, double starty, double endy, int ny) throws Exception; - + // Get the parameter values for the given parameters and timeframe. // The domain is given by the start and end values, while the time is // given by startSolvTime and endSolveTime. - public native HashMap<String,Vector<Double>> getHistory(String parmNamePattern, - double startx, double endx, double starty, + public native HashMap<String,ArrayList<Double>> getHistory(String parmNamePattern, + double startx, double endx, double starty, double endy, double startSolveTime, double endSolveTime) throws Exception; - + } diff --git a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacade.log_prop b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacade.log_prop similarity index 100% rename from JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacade.log_prop rename to SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacade.log_prop diff --git a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeAdapter.java b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeAdapter.java similarity index 79% rename from JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeAdapter.java rename to SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeAdapter.java index 8cf75d5e93ad6cc8962d3ed8d14242e80e1d0d89..e07ff4eeed62eda969f107472b3b17977ae6622c 100644 --- a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeAdapter.java +++ b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeAdapter.java @@ -19,11 +19,11 @@ //# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //# -package nl.astron.lofar.java.cep.jparmfacade; +package nl.astron.lofar.sas.otb.jparmfacade; -import java.util.Vector; import java.rmi.server.UnicastRemoteObject; import java.rmi.RemoteException; +import java.util.ArrayList; import java.util.HashMap; public class jParmFacadeAdapter extends UnicastRemoteObject implements jParmFacadeInterface @@ -34,6 +34,7 @@ public class jParmFacadeAdapter extends UnicastRemoteObject implements jParmFaca this.adaptee = adaptee; } + @Override public void setParmFacadeDB(String tableName) throws RemoteException { adaptee.setParmFacadeDB(tableName); } @@ -42,28 +43,26 @@ public class jParmFacadeAdapter extends UnicastRemoteObject implements jParmFaca // parameters in the table. // This is the minimum start value and maximum end value for all parameters. // An empty name pattern is the same as * (all parm names). - public Vector<Double> getRange(String parmNamePattern) throws RemoteException { - Vector<Double> aV=null; + @Override + public ArrayList<Double> getRange(String parmNamePattern) throws RemoteException { + ArrayList<Double> aV=null; try { aV=adaptee.getRange(parmNamePattern); } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getRange error"); - anEx.initCause(ex); - throw anEx; + throw new RemoteException("JNI getRange error", ex); } return aV; } // Get parameter names in the table matching the pattern. // An empty name pattern is the same as * (all parm names). - public Vector<String> getNames(String parmNamePattern) throws RemoteException { - Vector<String> aV=null; + @Override + public ArrayList<String> getNames(String parmNamePattern) throws RemoteException { + ArrayList<String> aV=null; try { aV= adaptee.getNames(parmNamePattern); } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getNames error"); - anEx.initCause(ex); - throw anEx; + throw new RemoteException("JNI getNames error", ex); } return aV; } @@ -72,10 +71,11 @@ public class jParmFacadeAdapter extends UnicastRemoteObject implements jParmFaca // Get the parameter values for the given parameters and domain. // The domain is given by the start and end values, while the grid is // given by nx and ny. - public HashMap<String,Vector<Double>> getValues(String parmNamePattern, + @Override + public HashMap<String,ArrayList<Double>> getValues(String parmNamePattern, double startx, double endx, int nx, double starty, double endy, int ny) throws RemoteException { - HashMap<String,Vector<Double>> aM=null; + HashMap<String,ArrayList<Double>> aM=null; try { aM=adaptee.getValues(parmNamePattern,startx,endx,nx,starty,endy,ny); } catch (Exception ex) { @@ -89,10 +89,11 @@ public class jParmFacadeAdapter extends UnicastRemoteObject implements jParmFaca // Get the parameter values for the given parameters and timeframe. // The domain is given by the start and end values, while the time is // given by startSolvTime and endSolveTime. - public HashMap<String,Vector<Double>> getHistory(String parmNamePattern, + @Override + public HashMap<String,ArrayList<Double>> getHistory(String parmNamePattern, double startx, double endx, double starty, double endy, double startSolveTime, double endSolveTime) throws RemoteException { - HashMap<String,Vector<Double>> aM=null; + HashMap<String,ArrayList<Double>> aM=null; try { aM=adaptee.getHistory(parmNamePattern,startx,endx,starty,endy,startSolveTime,endSolveTime); } catch (Exception ex) { @@ -102,5 +103,7 @@ public class jParmFacadeAdapter extends UnicastRemoteObject implements jParmFaca } return aM; } - protected jParmFacade adaptee; + protected jParmFacade adaptee; + + } diff --git a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeInterface.java b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeInterface.java similarity index 85% rename from JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeInterface.java rename to SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeInterface.java index 6e2da4e3fa6b4da7272890212fd12bb3ebf93fd9..4df6058ba9f37095a3fee412b4952922d9ebfd86 100644 --- a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeInterface.java +++ b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeInterface.java @@ -19,13 +19,13 @@ //# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //# -package nl.astron.lofar.java.cep.jparmfacade; +package nl.astron.lofar.sas.otb.jparmfacade; import java.rmi.Remote; import java.rmi.RemoteException; +import java.util.ArrayList; import java.util.HashMap; -import java.util.Vector; public interface jParmFacadeInterface extends Remote { @@ -38,23 +38,23 @@ public interface jParmFacadeInterface extends Remote // parameters in the table. // This is the minimum start value and maximum end value for all parameters. // An empty name pattern is the same as * (all parm names). - public Vector<Double> getRange(String parmNamePattern) throws RemoteException; + public ArrayList<Double> getRange(String parmNamePattern) throws RemoteException; // Get parameter names in the table matching the pattern. // An empty name pattern is the same as * (all parm names). - public Vector<String> getNames(String parmNamePattern) throws RemoteException; + public ArrayList<String> getNames(String parmNamePattern) throws RemoteException; // Get the parameter values for the given parameters and domain. // The domain is given by the start and end values, while the grid is // given by nx and ny. - public HashMap<String,Vector<Double>> getValues(String parmNamePattern, + public HashMap<String,ArrayList<Double>> getValues(String parmNamePattern, double startx, double endx, int nx, double starty, double endy, int ny) throws RemoteException; // Get the parameter values for the given parameters and timeframe. // The domain is given by the start and end values, while the time is // given by startSolveTime and endSolveTime. - public HashMap<String,Vector<Double>> getHistory(String parmNamePattern, + public HashMap<String,ArrayList<Double>> getHistory(String parmNamePattern, double startx, double endx, double starty, double endy, double startSolveTime, double endSolveTime) throws RemoteException; } diff --git a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeServer.java b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeServer.java similarity index 98% rename from JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeServer.java rename to SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeServer.java index ffb1355d642f119efec9ebea781b419790243315..9c8264d332043d9c796da7114d420a80949fdd1b 100644 --- a/JAVA/CEP/jParmFacade/src/nl/astron/lofar/java/cep/jparmfacade/jParmFacadeServer.java +++ b/SAS/OTB/jParmFacade/src/nl/astron/lofar/sas/otb/jparmfacade/jParmFacadeServer.java @@ -19,7 +19,7 @@ //# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //# -package nl.astron.lofar.java.cep.jparmfacade; +package nl.astron.lofar.sas.otb.jparmfacade; import java.rmi.registry.*; import java.rmi.server.RMISocketFactory; import nl.astron.lofar.sas.otb.jotdb3.jInitCPPLogger; @@ -61,7 +61,7 @@ public class jParmFacadeServer { } - String aHostName = new String(args[0]); + String aHostName = args[0]; logger.info("Running on: "+aHostName); System.setProperty("java.rmi.server.hostname", aHostName); diff --git a/JAVA/CEP/jParmFacade/src/nl_astron_lofar_java_cep_jparmfacade_jParmFacade.cc b/SAS/OTB/jParmFacade/src/nl_astron_lofar_otb_jparmfacade_jParmFacade.cc similarity index 78% rename from JAVA/CEP/jParmFacade/src/nl_astron_lofar_java_cep_jparmfacade_jParmFacade.cc rename to SAS/OTB/jParmFacade/src/nl_astron_lofar_otb_jparmfacade_jParmFacade.cc index 37e6946a402b82693e88588118d46f881c743c53..dbafddcd7a0f6eef6a6277a45b9e7254443b484b 100644 --- a/JAVA/CEP/jParmFacade/src/nl_astron_lofar_java_cep_jparmfacade_jParmFacade.cc +++ b/SAS/OTB/jParmFacade/src/nl_astron_lofar_otb_jparmfacade_jParmFacade.cc @@ -1,309 +1,308 @@ -//# nl_astron_lofar_java_cep_jparmfacade_jParmFacade.cc: Manages the -//# connection with the parameter database. -//# -//# Copyright (C) 2005-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -#include <jni.h> -#include <jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jParmFacade.h> -#include <jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jCommon.h> -#include <ParmFacade/ParmFacade.h> -#include <iostream> -#include <string> - -using namespace LOFAR::ParmDB; -using namespace std; - -ParmFacade* theirPF; - - -/* - * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade - * Method: getRange - * Signature: (Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getRange (JNIEnv *env, jobject obj, jstring parmNamePattern) { - - jboolean isCopy; - jobject rangeVector; - - // create the connection with the ParmDB - setParmDBConnection(env,obj); - - const char* pattern = env->GetStringUTFChars (parmNamePattern, &isCopy); - vector<double> rangeList; - try { - rangeList = theirPF->getRange(pattern); - - env->ReleaseStringUTFChars (parmNamePattern, pattern); - - vector<double>::iterator rangeIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - rangeVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - // Double - jobject jDouble; - jclass class_Double = env->FindClass ("java/lang/Double"); - jmethodID mid_Double_cons = env->GetMethodID (class_Double, "<init>", "(D)V"); - - for (rangeIterator = rangeList.begin(); rangeIterator != rangeList.end(); rangeIterator++) { - jDouble = env->NewObject (class_Double, mid_Double_cons, *rangeIterator); - - env->CallObjectMethod(rangeVector, mid_Vector_add, jDouble); - } - } catch (exception &ex) { - string aStr= (string)ex.what(); - cout << "Exception during getRange("<< pattern << "): "<< ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),aStr.c_str()); - } - - - return rangeVector; -} - - -/* - * Class: nl_astron_lofar_java_cep_jParmFacade_jparmfacade - * Method: getNames - * Signature: (Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getNames (JNIEnv *env, jobject obj, jstring parmNamePattern) { - - jboolean isCopy; - jobject nameVector; - - // create the connection with the ParmDB - setParmDBConnection(env,obj); - - const char* pattern = env->GetStringUTFChars (parmNamePattern, &isCopy); - vector<string> nameList; - try { - nameList = theirPF->getNames(pattern); - - env->ReleaseStringUTFChars (parmNamePattern, pattern); - - vector<string>::iterator nameIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - nameVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - jstring jstr; - for (nameIterator = nameList.begin(); nameIterator != nameList.end(); nameIterator++) { - jstr = env->NewStringUTF (((string)*nameIterator).c_str()); - env->CallObjectMethod(nameVector, mid_Vector_add, jstr); - } - } catch (exception &ex) { - string aStr= (string)ex.what(); - cout << "Exception during getNames("<< pattern << "): "<< ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),aStr.c_str()); - } - - return nameVector; -} - -/* - * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade - * Method: getValues - * Signature: (Ljava/lang/String;DDIDDI)Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getValues (JNIEnv *env, jobject obj, jstring parmNamePattern, jdouble startx, jdouble endx, jint nx, jdouble starty, jdouble endy, jint ny) { - - jboolean isCopy; - jobject result; - - // create the connection with the ParmDB - setParmDBConnection(env,obj); - - - const char* pattern = env->GetStringUTFChars (parmNamePattern, &isCopy); - map<string,vector<double> > valMap; - try { - valMap = theirPF->getValues(pattern,startx,endx,nx,starty,endy,ny); - env->ReleaseStringUTFChars (parmNamePattern, pattern); - - // Construct java Map - jclass mapClass, doubleClass, vectorClass; - jmethodID mapInit, mapPut, vectorAdd, doubleInit, vectorInit; - - mapClass = env->FindClass("java/util/HashMap"); - mapInit = env->GetMethodID(mapClass, "<init>", "()V"); - result = env->NewObject(mapClass, mapInit); - mapPut= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - - // Construct java Double - jobject jDouble; - doubleClass = env->FindClass ("java/lang/Double"); - doubleInit = env->GetMethodID (doubleClass, "<init>", "(D)V"); - - - // Loop through map and convert to HashMap - - for (map<string,vector<double> >::const_iterator valIter=valMap.begin(); - valIter != valMap.end(); - valIter++) { - - // Construct java Vector - jobject valVector; - vectorClass = env->FindClass("java/util/Vector"); - vectorInit = env->GetMethodID(vectorClass, "<init>", "()V"); - valVector = env->NewObject(vectorClass, vectorInit); - vectorAdd = env->GetMethodID(vectorClass, "add", "(Ljava/lang/Object;)Z"); - - - for (vector<double>::const_iterator iter=valIter->second.begin(); - iter != valIter->second.end(); - iter++) { - - jDouble = env->NewObject (doubleClass, doubleInit, *iter); - - env->CallObjectMethod(valVector, vectorAdd, jDouble); - } - - - env->CallObjectMethod(result, mapPut, env->NewStringUTF(valIter->first.c_str()),valVector); - - } - } catch (exception &ex) { - cout << "Exception during getValues("<< pattern << "," << startx << "," - << endx << "," << nx << "," << starty << "," << endy << "," << ny - << ") : "<< ex.what() << endl; - string aStr= (string)ex.what(); - jclass newExcCls = env->FindClass("java/lang/Exception"); - if (newExcCls == 0) { - cout << "Unable to find the new exception class, give up." << endl; - // env->ReleaseStringUTFChars (parmNamePattern, pattern); - return result; - } - - env->ThrowNew(newExcCls,aStr.c_str()); - } - - return result; -} - -/* - * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade - * Method: getHistory - * Signature: (Ljava/lang/String;DDIDDI)Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getHistory (JNIEnv *env, jobject obj, jstring parmNamePattern, jdouble startx, jdouble endx, jdouble starty, jdouble endy, jdouble startSolveTime, jdouble endSolveTime) { - - jboolean isCopy; - jobject result; - - // create the connection with the ParmDB - setParmDBConnection(env,obj); - - - const char* pattern = env->GetStringUTFChars (parmNamePattern, &isCopy); - map<string,vector<double> > valMap; - try { - valMap = theirPF->getHistory(pattern,startx,endx,starty,endy,startSolveTime,endSolveTime); - env->ReleaseStringUTFChars (parmNamePattern, pattern); - - // Construct java Map - jclass mapClass, doubleClass, vectorClass; - jmethodID mapInit, mapPut, vectorAdd, doubleInit, vectorInit; - - mapClass = env->FindClass("java/util/HashMap"); - mapInit = env->GetMethodID(mapClass, "<init>", "()V"); - result = env->NewObject(mapClass, mapInit); - mapPut= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - - // Construct java Double - jobject jDouble; - doubleClass = env->FindClass ("java/lang/Double"); - doubleInit = env->GetMethodID (doubleClass, "<init>", "(D)V"); - - - // Loop through map and convert to HashMap - - for (map<string,vector<double> >::const_iterator valIter=valMap.begin(); - valIter != valMap.end(); - valIter++) { - - // Construct java Vector - jobject valVector; - vectorClass = env->FindClass("java/util/Vector"); - vectorInit = env->GetMethodID(vectorClass, "<init>", "()V"); - valVector = env->NewObject(vectorClass, vectorInit); - vectorAdd = env->GetMethodID(vectorClass, "add", "(Ljava/lang/Object;)Z"); - - - for (vector<double>::const_iterator iter=valIter->second.begin(); - iter != valIter->second.end(); - iter++) { - - jDouble = env->NewObject (doubleClass, doubleInit, *iter); - - env->CallObjectMethod(valVector, vectorAdd, jDouble); - } - - - env->CallObjectMethod(result, mapPut, env->NewStringUTF(valIter->first.c_str()),valVector); - - } - } catch (exception &ex) { - cout << "Exception during getHistory("<< pattern << "," << startx << "," - << endx << "," << starty << "," << endy << "," << startSolveTime << "," - << endSolveTime << ") : "<< ex.what() << endl; - string aStr= (string)ex.what(); - jclass newExcCls = env->FindClass("java/lang/Exception"); - if (newExcCls == 0) { - cout << "Unable to find the new exception class, give up." << endl; - // env->ReleaseStringUTFChars (parmNamePattern, pattern); - return result; - } - - env->ThrowNew(newExcCls,aStr.c_str()); - } - - return result; -} - - -void setParmDBConnection(JNIEnv *env, jobject callerObject) { - - // get the callerclass - jclass jPF=env->GetObjectClass(callerObject); - - // get the methodID - jfieldID id_PFID = env->GetFieldID (jPF, "itsParmFacadeDB","Ljava/lang/String;"); - - // get the value - jstring nstr = (jstring)env->GetObjectField (callerObject, id_PFID); - - const char* n = env->GetStringUTFChars (nstr, 0); - const string name (n); - // create the connection with the c++ ParmFacade - cout << "Connect to :" << name << endl; - theirPF=new ParmFacade(name); - env->ReleaseStringUTFChars (nstr, n); -} - +//# nl_astron_lofar_java_cep_jparmfacade_jParmFacade.cc: Manages the +//# connection with the parameter database. +//# +//# Copyright (C) 2005-2007 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# + +//# Always #include <lofar_config.h> first! +#include <lofar_config.h> + +#include <jni.h> +#include <jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jParmFacade.h> +#include <jParmFacade/nl_astron_lofar_java_cep_jparmfacade_jCommon.h> +#include <ParmFacade/ParmFacade.h> +#include <iostream> +#include <string> + +using namespace LOFAR::ParmDB; +using namespace std; + +ParmFacade* theirPF; + + +/* + * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade + * Method: getRange + * Signature: (Ljava/lang/String;)Ljava/util/ArrayList; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getRange (JNIEnv *env, jobject obj, jstring parmNamePattern) { + + jboolean isCopy; + jobject rangeArrayList; + + // create the connection with the ParmDB + setParmDBConnection(env,obj); + + const char* pattern = env->GetStringUTFChars (parmNamePattern, &isCopy); + vector<double> rangeList; + try { + rangeList = theirPF->getRange(pattern); + + env->ReleaseStringUTFChars (parmNamePattern, pattern); + + vector<double>::iterator rangeIterator; + + // Construct java Vector + jclass class_ArrayList = env->FindClass("java/util/ArrayList"); + jmethodID mid_ArrayList_cons = env->GetMethodID(class_ArrayList, "<init>", "()V"); + rangeArrayList = env->NewObject(class_ArrayList, mid_ArrayList_cons); + jmethodID mid_ArrayList_add = env->GetMethodID(class_ArrayList, "add", "(Ljava/lang/Object;)Z"); + + // Double + jobject jDouble; + jclass class_Double = env->FindClass ("java/lang/Double"); + jmethodID mid_Double_cons = env->GetMethodID (class_Double, "<init>", "(D)V"); + + for (rangeIterator = rangeList.begin(); rangeIterator != rangeList.end(); rangeIterator++) { + jDouble = env->NewObject (class_Double, mid_Double_cons, *rangeIterator); + + env->CallObjectMethod(rangeArrayList, mid_ArrayList_add, jDouble); + } + } catch (exception &ex) { + string aStr= (string)ex.what(); + cout << "Exception during getRange("<< pattern << "): "<< ex.what() << endl; + env->ThrowNew(env->FindClass("java/lang/Exception"),aStr.c_str()); + } + + + return rangeArrayList; +} + + +/* + * Class: nl_astron_lofar_java_cep_jParmFacade_jparmfacade + * Method: getNames + * Signature: (Ljava/lang/String;)Ljava/util/ArrayList; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getNames (JNIEnv *env, jobject obj, jstring parmNamePattern) { + + jboolean isCopy; + jobject nameArrayList; + + // create the connection with the ParmDB + setParmDBConnection(env,obj); + + const char* pattern = env->GetStringUTFChars (parmNamePattern, &isCopy); + vector<string> nameList; + try { + nameList = theirPF->getNames(pattern); + + env->ReleaseStringUTFChars (parmNamePattern, pattern); + + vector<string>::iterator nameIterator; + + // Construct java ArrayList + jclass class_ArrayList = env->FindClass("java/util/ArrayList"); + jmethodID mid_ArrayList_cons = env->GetMethodID(class_ArrayList, "<init>", "()V"); + nameArrayList = env->NewObject(class_ArrayList, mid_ArrayList_cons); + jmethodID mid_ArrayList_add = env->GetMethodID(class_ArrayList, "add", "(Ljava/lang/Object;)Z"); + + jstring jstr; + for (nameIterator = nameList.begin(); nameIterator != nameList.end(); nameIterator++) { + jstr = env->NewStringUTF (((string)*nameIterator).c_str()); + env->CallObjectMethod(nameArrayList, mid_ArrayList_add, jstr); + } + } catch (exception &ex) { + string aStr= (string)ex.what(); + cout << "Exception during getNames("<< pattern << "): "<< ex.what() << endl; + env->ThrowNew(env->FindClass("java/lang/Exception"),aStr.c_str()); + } + + return nameArrayList; +} + +/* + * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade + * Method: getValues + * Signature: (Ljava/lang/String;DDIDDI)Ljava/util/HashMap; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getValues (JNIEnv *env, jobject obj, jstring parmNamePattern, jdouble startx, jdouble endx, jint nx, jdouble starty, jdouble endy, jint ny) { + + jboolean isCopy; + jobject result; + + // create the connection with the ParmDB + setParmDBConnection(env,obj); + + + const char* pattern = env->GetStringUTFChars (parmNamePattern, &isCopy); + map<string,vector<double> > valMap; + try { + valMap = theirPF->getValues(pattern,startx,endx,nx,starty,endy,ny); + env->ReleaseStringUTFChars (parmNamePattern, pattern); + + // Construct java Map + jclass mapClass, doubleClass, ArrayListClass; + jmethodID mapInit, mapPut, ArrayListAdd, doubleInit, ArrayListInit; + + mapClass = env->FindClass("java/util/HashMap"); + mapInit = env->GetMethodID(mapClass, "<init>", "()V"); + result = env->NewObject(mapClass, mapInit); + mapPut= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); + + // Construct java Double + jobject jDouble; + doubleClass = env->FindClass ("java/lang/Double"); + doubleInit = env->GetMethodID (doubleClass, "<init>", "(D)V"); + + + // Loop through map and convert to HashMap + + for (map<string,vector<double> >::const_iterator valIter=valMap.begin(); + valIter != valMap.end(); + valIter++) { + + // Construct java ArrayList + jobject valArrayList; + ArrayListClass = env->FindClass("java/util/ArrayList"); + ArrayListInit = env->GetMethodID(ArrayListClass, "<init>", "()V"); + valArrayList = env->NewObject(ArrayListClass, ArrayListInit); + ArrayListAdd = env->GetMethodID(ArrayListClass, "add", "(Ljava/lang/Object;)Z"); + + + for (vector<double>::const_iterator iter=valIter->second.begin(); + iter != valIter->second.end(); + iter++) { + + jDouble = env->NewObject (doubleClass, doubleInit, *iter); + + env->CallObjectMethod(valArrayList, ArrayListAdd, jDouble); + } + + + env->CallObjectMethod(result, mapPut, env->NewStringUTF(valIter->first.c_str()),valArrayList); + + } + } catch (exception &ex) { + cout << "Exception during getValues("<< pattern << "," << startx << "," + << endx << "," << nx << "," << starty << "," << endy << "," << ny + << ") : "<< ex.what() << endl; + string aStr= (string)ex.what(); + jclass newExcCls = env->FindClass("java/lang/Exception"); + if (newExcCls == 0) { + cout << "Unable to find the new exception class, give up." << endl; + // env->ReleaseStringUTFChars (parmNamePattern, pattern); + return result; + } + + env->ThrowNew(newExcCls,aStr.c_str()); + } + + return result; +} + +/* + * Class: nl_astron_lofar_java_cep_jparmfacade_jParmFacade + * Method: getHistory + * Signature: (Ljava/lang/String;DDIDDI)Ljava/util/HashMap; + */ +JNIEXPORT jobject JNICALL Java_nl_astron_lofar_java_cep_jparmfacade_jParmFacade_getHistory (JNIEnv *env, jobject obj, jstring parmNamePattern, jdouble startx, jdouble endx, jdouble starty, jdouble endy, jdouble startSolveTime, jdouble endSolveTime) { + + jboolean isCopy; + jobject result; + + // create the connection with the ParmDB + setParmDBConnection(env,obj); + + + const char* pattern = env->GetStringUTFChars (parmNamePattern, &isCopy); + map<string,vector<double> > valMap; + try { + valMap = theirPF->getHistory(pattern,startx,endx,starty,endy,startSolveTime,endSolveTime); + env->ReleaseStringUTFChars (parmNamePattern, pattern); + + // Construct java Map + jclass mapClass, doubleClass, ArrayListClass; + jmethodID mapInit, mapPut, ArrayListAdd, doubleInit, ArrayListInit; + + mapClass = env->FindClass("java/util/HashMap"); + mapInit = env->GetMethodID(mapClass, "<init>", "()V"); + result = env->NewObject(mapClass, mapInit); + mapPut= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); + + // Construct java Double + jobject jDouble; + doubleClass = env->FindClass ("java/lang/Double"); + doubleInit = env->GetMethodID (doubleClass, "<init>", "(D)V"); + + + // Loop through map and convert to HashMap + + for (map<string,vector<double> >::const_iterator valIter=valMap.begin(); + valIter != valMap.end(); + valIter++) { + + // Construct java ArrayList + jobject valArrayList + ArrayListClass = env->FindClass("java/util/ArrayList"); + ArrayListInit = env->GetMethodID(ArrayListClass, "<init>", "()V"); + valArrayList = env->NewObject(ArrayListClass, ArrayListInit); + ArrayListAdd = env->GetMethodID(ArrayListClass, "add", "(Ljava/lang/Object;)Z"); + + + for (vector<double>::const_iterator iter=valIter->second.begin(); + iter != valIter->second.end(); + iter++) { + + jDouble = env->NewObject (doubleClass, doubleInit, *iter); + + env->CallObjectMethod(valArrayList, ArrayListAdd, jDouble); + } + + + env->CallObjectMethod(result, mapPut, env->NewStringUTF(valIter->first.c_str()),valArrayList); + + } + } catch (exception &ex) { + cout << "Exception during getHistory("<< pattern << "," << startx << "," + << endx << "," << starty << "," << endy << "," << startSolveTime << "," + << endSolveTime << ") : "<< ex.what() << endl; + string aStr= (string)ex.what(); + jclass newExcCls = env->FindClass("java/lang/Exception"); + if (newExcCls == 0) { + cout << "Unable to find the new exception class, give up." << endl; + // env->ReleaseStringUTFChars (parmNamePattern, pattern); + return result; + } + + env->ThrowNew(newExcCls,aStr.c_str()); + } + + return result; +} + + +void setParmDBConnection(JNIEnv *env, jobject callerObject) { + + // get the callerclass + jclass jPF=env->GetObjectClass(callerObject); + + // get the methodID + jfieldID id_PFID = env->GetFieldID (jPF, "itsParmFacadeDB","Ljava/lang/String;"); + + // get the value + jstring nstr = (jstring)env->GetObjectField (callerObject, id_PFID); + + const char* n = env->GetStringUTFChars (nstr, 0); + const string name (n); + // create the connection with the c++ ParmFacade + cout << "Connect to :" << name << endl; + theirPF=new ParmFacade(name); + env->ReleaseStringUTFChars (nstr, n); +} diff --git a/JAVA/CEP/jParmFacade/test/tParmFacade.java b/SAS/OTB/jParmFacade/test/nl/astron/lofar/sas/otb/jparmfacade/test/tParmFacade.java similarity index 86% rename from JAVA/CEP/jParmFacade/test/tParmFacade.java rename to SAS/OTB/jParmFacade/test/nl/astron/lofar/sas/otb/jparmfacade/test/tParmFacade.java index a072ae3d9418899cedd0502320fd15d79769d2dd..bdadb58f463ff1dee1c3be298cee316208c9b0b6 100644 --- a/JAVA/CEP/jParmFacade/test/tParmFacade.java +++ b/SAS/OTB/jParmFacade/test/nl/astron/lofar/sas/otb/jparmfacade/test/tParmFacade.java @@ -1,3 +1,4 @@ +package nl.astron.lofar.sas.otb.jparmfacade.test; /* * tParmFacade.java: test program for class jParmFacade * @@ -23,11 +24,11 @@ * */ +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; -import java.util.Vector; -import nl.astron.lofar.java.cep.jparmfacade.jParmFacade; +import nl.astron.lofar.sas.otb.jparmfacade.jParmFacade; /** * * @author coolen @@ -67,13 +68,13 @@ public class tParmFacade { return; } - Vector<String> names = aPF.getNames(""); + ArrayList<String> names = aPF.getNames(""); System.out.println("Names: " + names); - Vector<Double> range = aPF.getRange(""); + ArrayList<Double> range = aPF.getRange(""); System.out.println("Range: " + range); - HashMap<String,Vector<Double> > values = aPF.getValues ("*", - range.elementAt(0), range.elementAt(1), 4, - range.elementAt(2), range.elementAt(3), 2); + HashMap<String,ArrayList<Double> > values = aPF.getValues ("*", + range.get(0), range.get(1), 4, + range.get(2), range.get(3), 2); Iterator it = values.keySet().iterator(); diff --git a/JAVA/CEP/jParmFacade/test/tRemoteParmFacade.java b/SAS/OTB/jParmFacade/test/nl/astron/lofar/sas/otb/jparmfacade/test/tRemoteParmFacade.java similarity index 88% rename from JAVA/CEP/jParmFacade/test/tRemoteParmFacade.java rename to SAS/OTB/jParmFacade/test/nl/astron/lofar/sas/otb/jparmfacade/test/tRemoteParmFacade.java index 0f255998dd336748360c13e3ecd237d3c347466f..081c036569fa3841aff6cc87d8f5a48f48bd11da 100644 --- a/JAVA/CEP/jParmFacade/test/tRemoteParmFacade.java +++ b/SAS/OTB/jParmFacade/test/nl/astron/lofar/sas/otb/jparmfacade/test/tRemoteParmFacade.java @@ -1,3 +1,4 @@ +package nl.astron.lofar.sas.otb.jparmfacade.test; /* * tRemoteParmFacade.java: test program for class jParmFacade via RMI * @@ -24,10 +25,11 @@ */ import java.rmi.Naming; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; -import java.util.Vector; -import nl.astron.lofar.java.cep.jparmfacade.jParmFacadeInterface; + +import nl.astron.lofar.sas.otb.jparmfacade.jParmFacadeInterface; /** * @@ -71,19 +73,19 @@ public class tRemoteParmFacade { System.out.println(parmTable); System.out.println("Getting names: "); - Vector<String> names = aPF.getNames(""); + ArrayList<String> names = aPF.getNames(""); System.out.println("Found " + names); System.out.println("Getting Range: "); - Vector<Double> range = aPF.getRange(""); + ArrayList<Double> range = aPF.getRange(""); System.out.println("Found " + range); System.out.println("Getting Values: "); - HashMap<String,Vector<Double> > values = aPF.getValues ("*", - range.elementAt(0), range.elementAt(1), 4, - range.elementAt(2), range.elementAt(3), 2); + HashMap<String,ArrayList<Double> > values = aPF.getValues ("*", + range.get(0), range.get(1), 4, + range.get(2), range.get(3), 2); Iterator it = values.keySet().iterator(); System.out.println("Found: "); diff --git a/JAVA/MAC/jRSP/.cvsignore b/SAS/OTB/jRSP/.cvsignore similarity index 100% rename from JAVA/MAC/jRSP/.cvsignore rename to SAS/OTB/jRSP/.cvsignore diff --git a/JAVA/MAC/jRSP/include/Makefile.am b/SAS/OTB/jRSP/include/Makefile.am similarity index 100% rename from JAVA/MAC/jRSP/include/Makefile.am rename to SAS/OTB/jRSP/include/Makefile.am diff --git a/JAVA/MAC/jRSP/include/jRSP/Makefile.am b/SAS/OTB/jRSP/include/jRSP/Makefile.am similarity index 100% rename from JAVA/MAC/jRSP/include/jRSP/Makefile.am rename to SAS/OTB/jRSP/include/jRSP/Makefile.am diff --git a/SAS/OTB/jRSP/include/jRSP/nl_astron_lofar_sas_otb_jrsp_Board.h b/SAS/OTB/jRSP/include/jRSP/nl_astron_lofar_sas_otb_jrsp_Board.h new file mode 100644 index 0000000000000000000000000000000000000000..d801124a21b1e07b9bdb9fe3c145da30e4bd60fa --- /dev/null +++ b/SAS/OTB/jRSP/include/jRSP/nl_astron_lofar_sas_otb_jrsp_Board.h @@ -0,0 +1,125 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class nl_astron_lofar_sas_otb_jrsp_Board */ + +#ifndef _Included_nl_astron_lofar_sas_otb_jrsp_Board +#define _Included_nl_astron_lofar_sas_otb_jrsp_Board +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: init + * Signature: (Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_init + (JNIEnv *, jobject, jstring); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: delete + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_delete + (JNIEnv *, jobject, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: retrieveStatus + * Signature: (II)[Lnl/astron/lofar/sas/otb/jrsp/BoardStatus; + */ +JNIEXPORT jobjectArray JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_retrieveStatus + (JNIEnv *, jobject, jint, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: setWaveformSettings + * Signature: (IIDSII)Z + */ +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_setWaveformSettings + (JNIEnv *, jobject, jint, jint, jdouble, jshort, jint, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: getSubbandStats + * Signature: (II)[D + */ +JNIEXPORT jdoubleArray JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_getSubbandStats + (JNIEnv *, jobject, jint, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: getWaveformSettings + * Signature: (II)[Lnl/astron/lofar/sas/otb/jrsp/WGRegisterType; + */ +JNIEXPORT jobjectArray JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_getWaveformSettings + (JNIEnv *, jobject, jint, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: getNrRCUs + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_getNrRCUs + (JNIEnv *, jobject, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: getNrRSPBoards + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_getNrRSPBoards + (JNIEnv *, jobject, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: getMaxRSPBoards + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_getMaxRSPBoards + (JNIEnv *, jobject, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: setFilter + * Signature: (III)Z + */ +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_setFilter + (JNIEnv *, jobject, jint, jint, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: sendClear + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_sendClear + (JNIEnv *, jobject, jint, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: sendReset + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_sendReset + (JNIEnv *, jobject, jint, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: sendSync + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_sendSync + (JNIEnv *, jobject, jint, jint); + +/* + * Class: nl_astron_lofar_sas_otb_jrsp_Board + * Method: getBeamletStats + * Signature: (II)[D + */ +JNIEXPORT jdoubleArray JNICALL Java_nl_astron_lofar_sas_otb_jrsp_Board_getBeamletStats + (JNIEnv *, jobject, jint, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/SAS/OTB/jRSP/pom.xml b/SAS/OTB/jRSP/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..56f087cd3a71efbfac2158550aec1b21c3357c07 --- /dev/null +++ b/SAS/OTB/jRSP/pom.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar OTB :: jRSP</name> + + <parent> + <groupId>nl.astron.lofar.sas.otb</groupId> + <artifactId>otb-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + </parent> + + <artifactId>jRSP</artifactId> + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/jRSP</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB/jRSP</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + + <sourceDirectory>src</sourceDirectory> + + <resources> + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + <exclude>**/*.cc</exclude> + </excludes> + </resource> + </resources> + + <plugins> + + <!-- Generate HEADER files from JNI Java classes --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>native-maven-plugin</artifactId> + + <configuration> + <javahClassNames> + <javahClassName>nl.astron.lofar.sas.otb.jrsp.Board</javahClassName> + </javahClassNames> + </configuration> + + <executions> + <execution> + <phase>process-classes</phase> + <goals> + <goal>javah</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + + </build> + + <dependencies> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + + </dependencies> + +</project> diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/ADOStatus.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/ADOStatus.java similarity index 96% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/ADOStatus.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/ADOStatus.java index 1c32bf62f5cbbdf8dba257584f0b59e1801e33bb..7b6443e411bbe23bc30badf72d97fb03ee706f4b 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/ADOStatus.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/ADOStatus.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; /** * This class is used by BoardStatus to store data about the ADO status. diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/Board.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/Board.java similarity index 99% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/Board.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/Board.java index 590e289a8bf22aef8afeff55b893ce4c9e04a104..146b0b5106b6558dcde26fd5644ec4c6a0ae0512 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/Board.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/Board.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; import org.apache.log4j.Logger; diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/BoardStatus.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/BoardStatus.java similarity index 99% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/BoardStatus.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/BoardStatus.java index 39584e7296852c9cdbc82bb241c5f86c1ce93b92..b1def5cf512f45d43e6d8aeda9c0d3fe2f489aa1 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/BoardStatus.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/BoardStatus.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; /** * This class keeps hold of the Board Status information. All member variables are public so there is no diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/IMask.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/IMask.java similarity index 98% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/IMask.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/IMask.java index 9d0ab813b36d5037df3ce0c76598fdfc3746909d..c756d05947e0b37270c6164c2f399576ca797520 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/IMask.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/IMask.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; /** * The IMask interface has to be implemented by Mask classes. These classes are diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RCUMask.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RCUMask.java similarity index 98% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RCUMask.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RCUMask.java index 0e6d798d5efc8926556543812afe2fd14bcb722a..832952f05882fcde485473c0e1ac29e8f73d580a 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RCUMask.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RCUMask.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; import java.util.BitSet; diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RCUStatus.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RCUStatus.java similarity index 96% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RCUStatus.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RCUStatus.java index b509ae00cd024f12dda45a5f54effba2fe09f7b5..ba812ed5ccfbab4e3f45e6d7228e22077ac36c18 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RCUStatus.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RCUStatus.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; /** * This class is used by BoardStatus to store data about the RCU status. diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RSPMask.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RSPMask.java similarity index 98% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RSPMask.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RSPMask.java index 54a355c083f6f449802f146a09f0b7dfa6c08a15..c193faba4150a1af96d45eefe50d025ffb0e86e1 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/RSPMask.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/RSPMask.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; /** * diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/SyncStatus.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/SyncStatus.java similarity index 97% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/SyncStatus.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/SyncStatus.java index d8f0080b42ab864bc0b60ade92a062b03cce2965..bad400251b4cbf9a0e56176ad751e1e26a78c1f4 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/SyncStatus.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/SyncStatus.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; /** * This class is used by BoardStatus to store data about the Sync status. diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/WGRegisterType.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/WGRegisterType.java similarity index 98% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/WGRegisterType.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/WGRegisterType.java index 2b26c6e51ef21d6d2470e5e57dc6059a9b655f7e..56b357c9c5c68e2c98e30d9a4a4ae246b1ba1e7e 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/WGRegisterType.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/WGRegisterType.java @@ -22,7 +22,7 @@ * $Id$ */ -package nl.astron.lofar.java.mac.jrsp; +package nl.astron.lofar.sas.otb.jrsp; /** * Waveform Generator Register Type diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/CodeGenerator.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/CodeGenerator.java similarity index 97% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/CodeGenerator.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/CodeGenerator.java index 3f963594581fb52848af49337db8d8c837d39f31..39c5d489eb8727ff27bcb21d143bef2b8b81909d 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/CodeGenerator.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/CodeGenerator.java @@ -1,4 +1,4 @@ -package nl.astron.lofar.java.mac.jrsp.tools; +package nl.astron.lofar.sas.otb.jrsp.tools; /** * This class is just a quick and dirty way of making the jni code. diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/SubbandStatsTest.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/SubbandStatsTest.java similarity index 86% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/SubbandStatsTest.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/SubbandStatsTest.java index 00140c14a3027673da88495ad94696adda0142ce..874591006eca33d1a40ee35b913cedc17322baf4 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/SubbandStatsTest.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/SubbandStatsTest.java @@ -1,6 +1,6 @@ -package nl.astron.lofar.java.mac.jrsp.tools; +package nl.astron.lofar.sas.otb.jrsp.tools; -import nl.astron.lofar.java.mac.jrsp.Board; +import nl.astron.lofar.sas.otb.jrsp.Board; public class SubbandStatsTest { diff --git a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/TestClass.java b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/TestClass.java similarity index 86% rename from JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/TestClass.java rename to SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/TestClass.java index 101d87d693716cab7f1d7fa1cfc7d9256570450a..8ccdc29f5d12beaeae372d8c3a509afad69304aa 100644 --- a/JAVA/MAC/jRSP/src/nl/astron/lofar/java/mac/jrsp/tools/TestClass.java +++ b/SAS/OTB/jRSP/src/nl/astron/lofar/sas/otb/jrsp/tools/TestClass.java @@ -1,7 +1,7 @@ -package nl.astron.lofar.java.mac.jrsp.tools; +package nl.astron.lofar.sas.otb.jrsp.tools; -import nl.astron.lofar.java.mac.jrsp.Board; -import nl.astron.lofar.java.mac.jrsp.RCUMask; +import nl.astron.lofar.sas.otb.jrsp.Board; +import nl.astron.lofar.sas.otb.jrsp.RCUMask; public class TestClass { diff --git a/JAVA/MAC/jRSP/src/nl_astron_lofar_java_mac_jrsp_Board.cc b/SAS/OTB/jRSP/src/nl_astron_lofar_java_mac_jrsp_Board.cc similarity index 100% rename from JAVA/MAC/jRSP/src/nl_astron_lofar_java_mac_jrsp_Board.cc rename to SAS/OTB/jRSP/src/nl_astron_lofar_java_mac_jrsp_Board.cc diff --git a/JAVA/MAC/jRSP/test/Makefile.am b/SAS/OTB/jRSP/test/Makefile.am similarity index 100% rename from JAVA/MAC/jRSP/test/Makefile.am rename to SAS/OTB/jRSP/test/Makefile.am diff --git a/SAS/OTB/pom.xml b/SAS/OTB/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..931bdccf5afc679812f576ca9d77598192770bd9 --- /dev/null +++ b/SAS/OTB/pom.xml @@ -0,0 +1,190 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <name>Lofar OTB :: Parent</name> + <description>Object Tree Browser Client/Server - Parent</description> + + <parent> + <groupId>nl.astron</groupId> + <artifactId>parent</artifactId> + <version>2.0.0</version> + </parent> + + <groupId>nl.astron.lofar.sas.otb</groupId> + <artifactId>otb-parent</artifactId> + <version>1.8.2-SNAPSHOT</version> + <packaging>pom</packaging> + + + <!-- Properties that can be used throughout the POM as a substitution, + and are used as filters in resources if enabled. --> + <properties> + <lofar.lib.version>1.8.1</lofar.lib.version> + </properties> + + + <!-- Specification for the SCM used by the project, such as CVS, Subversion, etc. --> + <scm> + <connection>scm:svn:http://svn.astron.nl/LOFAR/trunk/SAS/OTB</connection> + <developerConnection>scm:svn:https://svn.astron.nl/LOFAR/trunk/SAS/OTB</developerConnection> + </scm> + + + <!-- Information required to build a project. --> + <build> + + <!-- Default plugin information to be made available for reference by + projects derived from this one. This plugin configuration will not be resolved + or bound to the lifecycle unless referenced. Any local configuration for + a given plugin will override the plugin's entire definition here. --> + <pluginManagement> + <plugins> + + <!-- This plugin's configuration is used to store Eclipse m2e settings + only. It has no influence on the Maven build itself. --> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.codehaus.mojo</groupId> + <artifactId>native-maven-plugin</artifactId> + <versionRange>[1.0-alpha-7,)</versionRange> + <goals> + <goal>javah</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore /> + </action> + </pluginExecution> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <versionRange>[1.0.0,)</versionRange> + <goals> + <goal>copy-dependencies</goal> + <goal>unpack</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore /> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + + </plugins> + </pluginManagement> + + </build> + + + <!-- The modules (sometimes called subprojects) to build as a part of this + project. Each module listed is a relative path to the directory containing + the module. --> + <modules> + <module>jRSP</module> + <module>RSP</module> + <module>jOTDB3</module> + <module>jParmFacade</module> + <module>OTB</module> + <module>OTB-distribution</module> + </modules> + + + <!-- Default dependency information for projects that inherit from this + one. The dependencies in this section are not immediately resolved. Instead, + when a POM derived from this one declares a dependency described by a matching + groupId and artifactId, the version and other values from this section are + used for that dependency if they were not already specified. --> + <dependencyManagement> + <dependencies> + + <!-- Child dependencies, childs use the same group-ID and version by default. --> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jRSP</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>RSP</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jParmFacade</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jOTDB3</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>OTB</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>OTB-distribution</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- Import the group 'nl.astron.lofar.lib' --> + <dependency> + <groupId>nl.astron.lofar.lib</groupId> + <artifactId>lofar-lib-parent</artifactId> + <version>${lofar.lib.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + + <!-- External dependencies --> + <dependency> + <groupId>org.swinglabs</groupId> + <artifactId>swing-layout</artifactId> + <version>1.0.3</version> + </dependency> + + <dependency> + <groupId>org.netbeans.external</groupId> + <artifactId>AbsoluteLayout</artifactId> + <version>RELEASE72</version> + </dependency> + + </dependencies> + </dependencyManagement> + + + <!-- The lists of the remote repositories for discovering dependencies + and extensions. --> + <repositories> + + <!-- Extra maven repository for the Netbeans AbsoluteLayout dependency --> + <repository> + <id>netbeans</id> + <name>NetBeans IDE Repos</name> + <url>http://bits.netbeans.org/maven2</url> + </repository> + + </repositories> + +</project> diff --git a/SAS/OTDB/SPRINT_1.8 b/SAS/OTDB/SPRINT_1.8 new file mode 100644 index 0000000000000000000000000000000000000000..680b99357b5cebed1f056af6f54cdc2648624328 --- /dev/null +++ b/SAS/OTDB/SPRINT_1.8 @@ -0,0 +1,25 @@ +== C++ == +*) TreeValue.getFailedHardware(...) is integrated with TreeValue.getBrokenHardware(...). + getBrokenHardware has 2 arguments now iso 1, both optional. + getFailedHardware is removed. + +*) Software of Ger van Diepen needs this change. + +*) in MAC/Deployment a new PICtree must be generated and loaded into the database and set to active/operational. + This new tree will contain the status fields of the LBA and HBA antenna's also. + + +== SQL == +Remove old getBrokenHardware function from database using psql: +DROP FUNCTION getbrokenhardware(TIMESTAMP); + +Load new function: +\i getBrokenHardware_func.sql + + +== JAVA == +libjOTDB must be build. + + + + diff --git a/SAS/OTDB/include/OTDB/TreeValue.h b/SAS/OTDB/include/OTDB/TreeValue.h index fdddfad4d8329d197db625d73cb3aebf07dfbbe6..ad59242d723c269f6daac322b6c2277bc27d7ce6 100644 --- a/SAS/OTDB/include/OTDB/TreeValue.h +++ b/SAS/OTDB/include/OTDB/TreeValue.h @@ -84,10 +84,9 @@ public: bool mostRecentOnly=false); // Query for getting list of broken hardware on a certain time. - vector<OTDBvalue> getBrokenHardware(const ptime& atTime = ptime(max_date_time)); - // Query for getting list of broken hardware within time interval - vector<OTDBvalue> getFailedHardware(const ptime& startTime, - const ptime& endTime=ptime(max_date_time)); + vector<OTDBvalue> getBrokenHardware(const ptime& fromTime = ptime(not_a_date_time), + const ptime& toTime = ptime(not_a_date_time)); + //# SAS queries // For scheduling the VIC tree on the OTDB tree SAS must know what // resources exist in the OTDB tree. This list can be retrieved with diff --git a/SAS/OTDB/sql/getBrokenHardware_func.sql b/SAS/OTDB/sql/getBrokenHardware_func.sql index c15a9cb012d3e4e5a2c9a6a58ef8d422fd46bd33..01708428053fb788bb52c1e824b2cc42c07966cd 100644 --- a/SAS/OTDB/sql/getBrokenHardware_func.sql +++ b/SAS/OTDB/sql/getBrokenHardware_func.sql @@ -45,24 +45,34 @@ CREATE OR REPLACE FUNCTION nextPICkvt(int,timestamp) LIMIT 1; $$ LANGUAGE SQL; -CREATE OR REPLACE FUNCTION getBrokenHardware(TIMESTAMP) +CREATE OR REPLACE FUNCTION getBrokenHardware(VARCHAR(20), VARCHAR(20)) RETURNS SETOF OTDBvalue AS $$ DECLARE vRecord RECORD; vRecord2 RECORD; vStartTime TIMESTAMP; + vStopTime TIMESTAMP; + vWhere TEXT; BEGIN - IF $1 IS NULL THEN - vStartTime = now(); + IF $1 = '' THEN + vStartTime := now(); ELSE - vStartTime = $1; + vStartTime := $1; END IF; + IF $2 = '' THEN + vStopTime := now(); + vWhere := 'WHERE time < ' || chr(39) || vStartTime || chr(39); + ELSE + vStopTime := $2; + vWhere := 'WHERE time >= ' || chr(39) || vStartTime || chr(39) || ' AND time < ' || chr(39) || vStopTime || chr(39); + END IF; +RAISE WARNING '% - % - %:' , vStartTime, vStopTime, vWhere; FOR vRecord IN - SELECT p.paramid,r.pvssname,p.value,p.time - FROM pktemp p - LEFT JOIN PICparamref r ON r.paramid = p.paramid - WHERE time < vStartTime + EXECUTE ' + SELECT p.paramid,r.pvssname,p.value,p.time + FROM pktemp p + LEFT JOIN PICparamref r ON r.paramid = p.paramid ' || vWhere LOOP FOR vRecord2 IN SELECT p.paramid,r.pvssname,p.value,p.time diff --git a/SAS/OTDB/src/TreeValue.cc b/SAS/OTDB/src/TreeValue.cc index 8ee228128c75e0a2392d0616bf74e8770abd3d26..0a88ff474f1e41368218500a76ac6c2d46172a0e 100644 --- a/SAS/OTDB/src/TreeValue.cc +++ b/SAS/OTDB/src/TreeValue.cc @@ -252,7 +252,7 @@ vector<OTDBvalue> TreeValue::getSchedulableItems (nodeIDType TODO_topNode) // // getBrokenHardware([timestamp]) // -vector<OTDBvalue> TreeValue::getBrokenHardware(const ptime& atTime) +vector<OTDBvalue> TreeValue::getBrokenHardware(const ptime& fromTime, const ptime& toTime) { vector<OTDBvalue> resultVec; @@ -262,12 +262,15 @@ vector<OTDBvalue> TreeValue::getBrokenHardware(const ptime& atTime) return (resultVec); } - LOG_TRACE_FLOW_STR("TV:getBrokenHardware(" << to_simple_string(atTime) << ")"); + string startTime((fromTime.is_not_a_date_time()) ? "" : to_simple_string(fromTime)); + string endTime ((toTime.is_not_a_date_time()) ? "" : to_simple_string(toTime)); + + LOG_TRACE_FLOW_STR("TV:getBrokenHardware(" << startTime << "," << endTime << ")"); // construct a query that calls a stored procedure. work xAction(*(itsConn->getConn()), "getBrokenHardware"); try { - string query("SELECT * from getBrokenHardware('" + to_simple_string(atTime) + "')"); + string query("SELECT * from getBrokenHardware('" + startTime + "','" + endTime + "')"); result res = xAction.exec(query); // check result result::size_type nrRecords = res.size(); @@ -278,15 +281,22 @@ vector<OTDBvalue> TreeValue::getBrokenHardware(const ptime& atTime) // list contains single records [A] or double records[B]: // [A] value always > 10 : its still broken // [B] 1st record value <= 10, 2nd record (always same name) always > 10 - // if timestamp 1st record < atTime 'its OK skip this and next line' else is broken skip this line + // if timestamp 1st record < checkTime 'its OK skip this and next line' else is broken skip this line + + // first determine checkTime: + // - broken AT ... : second time is not given --> we must check against the begintime + // - broken in period ... : secondtime is given --> we should use that time for checking + ptime checkTime((toTime.is_not_a_date_time()) ? fromTime : toTime); + + // loop over the records. for (result::size_type i = 0; i < nrRecords; ++i) { OTDBvalue theKVT(res[i]); if (atoi(theKVT.value.c_str()) > 10) { // [A] resultVec.push_back(theKVT); } else { // [B] - if (++i < nrRecords) { - if (theKVT.time > atTime) { + if (++i < nrRecords) { // next record + if (theKVT.time > checkTime) { OTDBvalue nextKVT(res[i]); ASSERTSTR(nextKVT.nodeID() == theKVT.nodeID(), "Expected same paramID: " << nextKVT.nodeID() << "!=" << theKVT.nodeID()); @@ -307,63 +317,5 @@ vector<OTDBvalue> TreeValue::getBrokenHardware(const ptime& atTime) } -// -// getBrokenHardware([timestamp1], [timestamp2]) between startTime and endTime -// -vector<OTDBvalue> TreeValue::getFailedHardware(const ptime& startTime, const ptime& endTime) -{ - vector<OTDBvalue> resultVec; - - // Check connection - if (!itsConn->connect()) { - itsError = itsConn->errorMsg(); - return (resultVec); - } - - LOG_TRACE_FLOW_STR("TV:getFailedHardware(" << to_simple_string(startTime) << ", "<< to_simple_string(endTime) << ")"); - - // construct a query that calls a stored procedure. - work xAction(*(itsConn->getConn()), "getBrokenHardware"); - try { - string query("SELECT * from getFailedHardware('" + to_simple_string(startTime) + "','" + to_simple_string(endTime) + "')"); - result res = xAction.exec(query); - // check result - result::size_type nrRecords = res.size(); - if (!nrRecords) { - return (resultVec); - } - - // list contains single records [A] or double records[B]: - // [A] value always > 10 : its still broken - // [B] 1st record value <= 10, 2nd record (always same name) always > 10 - // if timestamp 1st record < atTime 'its OK skip this and next line' else is broken skip this line - for (result::size_type i = 0; i < nrRecords; ++i) { - OTDBvalue theKVT(res[i]); - if (atoi(theKVT.value.c_str()) > 10) { // [A] - resultVec.push_back(theKVT); - } - else { // [B] - if (++i < nrRecords) { - if (theKVT.time > endTime) { - OTDBvalue nextKVT(res[i]); - ASSERTSTR(nextKVT.nodeID() == theKVT.nodeID(), - "Expected same paramID: " << nextKVT.nodeID() << "!=" << theKVT.nodeID()); - resultVec.push_back(nextKVT); - } - } - } - } // for - } - catch (std::exception& ex) { - itsError = string("Exception during getBrokenHardware:") + ex.what(); - LOG_FATAL(itsError); - vector<OTDBvalue> empty; - return (empty); - } - - return (resultVec); -} - - } // namespace OTDB } // namespace LOFAR diff --git a/SAS/OTDB/test/CMakeLists.txt b/SAS/OTDB/test/CMakeLists.txt index fd76342a4b745f57bd7feccf32c407bb742c0549..260c0ce9da6bae5405a0b7f3cc3ea69664b9ba77 100644 --- a/SAS/OTDB/test/CMakeLists.txt +++ b/SAS/OTDB/test/CMakeLists.txt @@ -5,6 +5,7 @@ include(LofarCTest) lofar_add_test(tCampaign tCampaign.cc) lofar_add_test(tPICtree tPICtree.cc) lofar_add_test(tPICvalue tPICvalue.cc) +lofar_add_executable(tBrokenHardware tBrokenHardware.cc) lofar_add_test(tQueryPIC tQueryPIC.cc) lofar_add_test(tVICcomp tVICcomp.cc) lofar_add_test(tVTtree tVTtree.cc) diff --git a/SAS/OTDB/test/tBrokenHardware.cc b/SAS/OTDB/test/tBrokenHardware.cc new file mode 100644 index 0000000000000000000000000000000000000000..a66c1a5adba09b28493f90cb1ad4db44594487eb --- /dev/null +++ b/SAS/OTDB/test/tBrokenHardware.cc @@ -0,0 +1,201 @@ +//# tBrokenHardware: test the actions on the PIC database +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: tBrokenHardware.cc 19419 2011-12-01 16:36:10Z schoenmakers $ + +//# Always #include <lofar_config.h> first! +#include <lofar_config.h> + +//# Includes +#include <Common/LofarLogger.h> +#include <Common/lofar_fstream.h> +#include <Common/lofar_datetime.h> +#include <Common/ParameterSet.h> +#include <OTDB/TreeMaintenance.h> +#include <OTDB/TreeValue.h> +#include <OTDB/OTDBtypes.h> +#include <OTDB/OTDBnode.h> +#include <OTDB/TreeTypeConv.h> +#include <OTDB/TreeStateConv.h> +#include <OTDB/ClassifConv.h> +#include <libgen.h> // for basename + +using namespace LOFAR; +using namespace LOFAR::OTDB; + + +// +// showTreeList +// +void showTreeList(const vector<OTDBtree>& trees) { + + + cout << "treeID|Classif|Creator |Creationdate |Type|Campaign|Starttime" << endl; + cout << "------+-------+----------+--------------------+----+--------+------------------" << endl; + for (uint32 i = 0; i < trees.size(); ++i) { + string row(formatString("%6d|%7d|%-10.10s|%-20.20s|%4d|%-8.8s|%s", + trees[i].treeID(), + trees[i].classification, + trees[i].creator.c_str(), + to_simple_string(trees[i].creationDate).c_str(), + trees[i].type, + trees[i].campaign.c_str(), + to_simple_string(trees[i].starttime).c_str())); + cout << row << endl; + } + + cout << trees.size() << " records" << endl << endl; +} + +// +// showNodeList +// +void showNodeList(const vector<OTDBnode>& nodes) { + + + cout << "treeID|nodeID|parent|par.ID|name |index|leaf|inst|descr." << endl; + cout << "------+------+------+------+-------------------------+-----+----+----+---------" << endl; + for (uint32 i = 0; i < nodes.size(); ++i) { + string row(formatString("%6d|%6d|%6d|%6d|%-25.25s|%5d|%s|%4d|%s", + nodes[i].treeID(), + nodes[i].nodeID(), + nodes[i].parentID(), + nodes[i].paramDefID(), + nodes[i].name.c_str(), + nodes[i].index, + nodes[i].leaf ? " T " : " F ", + nodes[i].instances, + nodes[i].description.c_str())); + cout << row << endl; + } + + cout << nodes.size() << " records" << endl << endl; +} + +// +// show the resulting list of Values +// +void showValueList(const vector<OTDBvalue>& items) { + + + cout << "name |value |time" << endl; + cout << "-----------------------------------+------+--------------------" << endl; + for (uint32 i = 0; i < items.size(); ++i) { + string row(formatString("%-35.35s|%-7.7s|%s", + items[i].name.c_str(), + items[i].value.c_str(), + to_simple_string(items[i].time).c_str())); + cout << row << endl; + } + + cout << items.size() << " records" << endl << endl; +} + +// +// MAIN +// +int main (int argc, char* argv[]) { + + INIT_LOGGER(basename(argv[0])); + LOG_INFO_STR("Starting " << argv[0]); + + if (argc != 1) { + cout << "Usage: tBrokenHardware " << endl; + return (1); + } + + // try to resolve the database name + string dbName("TESTLOFAR_4"); + string hostName("rs005.astron.nl"); + int32 sleeptime = 1; + LOG_INFO_STR("### Using database " << dbName << " on host " << hostName << " ###"); + sleep (sleeptime); + + // Open the database connection + OTDBconnection conn("paulus", "boskabouter", dbName, hostName); + + TreeMaintenance tm(&conn); + + // Use converters in this testprogram + TreeTypeConv TTconv(&conn); + TreeStateConv TSconv(&conn); + ClassifConv CTconv(&conn); + + try { + + LOG_INFO("Trying to connect to the database"); + ASSERTSTR(conn.connect(), "Connnection failed"); + LOG_INFO_STR("Connection succesful: " << conn); + + LOG_INFO("Searching for a Hardware tree"); + vector<OTDBtree> treeList = + conn.getTreeList(TTconv.get("hardware"), CTconv.get("operational")); + showTreeList(treeList); + ASSERTSTR(treeList.size(),"No hardware tree found, run tPICtree first"); + + treeIDType treeID = treeList[treeList.size()-1].treeID(); + LOG_INFO_STR ("Using tree " << treeID << " for the tests"); + OTDBtree treeInfo = conn.getTreeInfo(treeID); + LOG_INFO_STR(treeInfo); + + LOG_INFO("Trying to construct a TreeValue object"); + TreeValue tv(&conn, treeID); + + { + LOG_INFO ("getBrokenHardware()"); + vector<OTDBvalue> valueList=tv.getBrokenHardware(); + showValueList(valueList); + } + + { + LOG_INFO ("getBrokenHardware('2012-10-15 09:00:00')"); + vector<OTDBvalue> valueList=tv.getBrokenHardware(time_from_string("2012-10-15 09:00:00")); + showValueList(valueList); + } + + { + LOG_INFO ("getBrokenHardware('2012-10-15 12:00:00')"); + vector<OTDBvalue> valueList=tv.getBrokenHardware(time_from_string("2012-10-15 12:00:00")); + showValueList(valueList); + } + + { + LOG_INFO ("getBrokenHardware('2012-10-15 12:00:00', '2012-10-16 12:00:00')"); + vector<OTDBvalue> valueList=tv.getBrokenHardware(time_from_string("2012-10-15 12:00:00"), + time_from_string("2012-10-16 12:00:00")); + showValueList(valueList); + } + + { + LOG_INFO ("getBrokenHardware('2012-10-14 12:00:00', '2012-10-15 12:00:00')"); + vector<OTDBvalue> valueList=tv.getBrokenHardware(time_from_string("2012-10-14 12:00:00"), + time_from_string("2012-10-15 12:00:00")); + showValueList(valueList); + } + } + catch (std::exception& ex) { + LOG_FATAL_STR("Unexpected exception: " << ex.what()); + return (1); // return !0 on failure + } + + LOG_INFO_STR ("Terminated succesfully: " << argv[0]); + + return (0); // return 0 on succes +} diff --git a/SubSystems/LCU_MAC/CMakeLists.txt b/SubSystems/LCU_MAC/CMakeLists.txt index 7c70ffad437ee16f097c73eb07145b1979b24720..091e99b0dfad329b02511a4a71f3b7f646c73dc2 100644 --- a/SubSystems/LCU_MAC/CMakeLists.txt +++ b/SubSystems/LCU_MAC/CMakeLists.txt @@ -2,4 +2,4 @@ lofar_package(LCU_MAC DEPENDS StationCU PIC PAC CUDaemons CURTDBDaemons - AMC Firmware-Tools MACTools StaticMetaData) + Firmware-Tools MACTools StaticMetaData)