diff --git a/.gitattributes b/.gitattributes index b91de50a2ae104c84263fed7616a08707bb903c7..d3a0c16359d07520c98a76706e9b04bfd2db65e6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2446,7 +2446,6 @@ RTCP/Interface/include/Interface/SmartPtr.h -text RTCP/Interface/include/Interface/StokesData.h -text RTCP/Interface/include/Interface/Stream.h -text RTCP/Interface/include/Interface/StreamableData.h -text -RTCP/Interface/include/Interface/TransposeLogic.h -text RTCP/Interface/include/Interface/TransposedBeamFormedData.h -text RTCP/Interface/include/Interface/TriggerData.h -text RTCP/Interface/src/BeamCoordinates.cc -text diff --git a/CMake/variants/variants.lce072 b/CMake/variants/variants.lce072 index beb097b9423d52a51e46369d8bd99e2787f32094..6339e763e82d724fe2ab17771df19036f31fe842 100644 --- a/CMake/variants/variants.lce072 +++ b/CMake/variants/variants.lce072 @@ -2,17 +2,15 @@ option(BUILD_SHARED_LIBS "Build shared libraries" ON) set(CASACORE_ROOT_DIR /data/opt/cep/casacore) set(CASAREST_ROOT_DIR /data/opt/cep/casarest) -set(ENV{HDF5_ROOT} /data/opt/cep/hdf5) +set(ENV{HDF5_ROOT} /data/opt/cep/storage/hdf5) set(PYRAP_ROOT_DIR /data/opt/cep/pyrap) set(WCSLIB_ROOT_DIR /data/opt/cep/wcslib) -set(LOG4CXX_ROOT_DIR /data/opt/cep/lofar/external/log4cxx) +set(LOG4CXX_ROOT_DIR /data/opt/cep/LofIm/external/log4cxx) set(LOG4CPLUS_ROOT_DIR /data/opt/cep/lofar/external/log4cplus) -#set(ENV{JAVA_HOME} /usr/lib/jvm/java-1.5.0-sun) - set(CTEST_CUSTOM_WARNING_EXCEPTION "/log4cxx/helpers/objectptr.h:[0-9]+: warning: base class" "/log4cxx/helpers/objectptr.h:[0-9]+: warning: dereferencing type-punned pointer" diff --git a/LCS/ApplCommon/src/Observation.cc b/LCS/ApplCommon/src/Observation.cc index 098e4950fa8b1d225cfcfb243408654fa90e4596..8b9ac244ef0264c7dae6bfa9b1c998800bdd1a0e 100644 --- a/LCS/ApplCommon/src/Observation.cc +++ b/LCS/ApplCommon/src/Observation.cc @@ -266,6 +266,7 @@ Observation::Observation(ParameterSet* aParSet, } } +#if 0 // loop over all data products and generate all data flows string olapprefix = aParSet->locateModule("OLAP") + "OLAP."; const char *dataProductNames[] = { "CoherentStokes", "IncoherentStokes", "Beamformed", "Correlated", "Filtered" }; @@ -327,6 +328,7 @@ Observation::Observation(ParameterSet* aParSet, streamsToStorage.push_back(a); } } +#endif } diff --git a/MAC/APL/APLCommon/src/ChildControl.cc b/MAC/APL/APLCommon/src/ChildControl.cc index 44a41e2aff75c480a9962b742c67dcd2b8660a8e..d0105d81613418b785268fe60e4908319e943011 100644 --- a/MAC/APL/APLCommon/src/ChildControl.cc +++ b/MAC/APL/APLCommon/src/ChildControl.cc @@ -1348,8 +1348,10 @@ GCFEvent::TResult ChildControl::operational(GCFEvent& event, else { // found controller, close port LOG_DEBUG_STR("Removing " << controller->cntlrName << " from the controllerlist"); - controller->port->close(); - delete controller->port; + if (controller->port) { + controller->port->close(); + delete controller->port; + } itsCntlrList->erase(controller); // just remove } } diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc index 86a823209cd3710631256d84756ae18030346a7c..39e75182dc47737605f5a9baaab2c44eb3bfad4e 100644 --- a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc +++ b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc @@ -442,7 +442,7 @@ GCFEvent::TResult BeamControl::allocBeams_state(GCFEvent& event, GCFPortInterfac switch (event.signal) { case F_ENTRY: itsTimerPort->cancelAllTimers(); - itsTimerPort->setTimer(0.2); // give CalControl + CalServer some time to allocated the beams. + itsTimerPort->setTimer(0.01); // give CalControl + CalServer some time to allocated the beams. break; case F_TIMER: { diff --git a/MAC/Deployment/data/OTDB/OLAP.comp b/MAC/Deployment/data/OTDB/OLAP.comp index 989f56b7cba1678eddeabcbc0239e06fef192cdc..a88dd596dc1424842ea7c20ef1cdf499712de4f5 100644 --- a/MAC/Deployment/data/OTDB/OLAP.comp +++ b/MAC/Deployment/data/OTDB/OLAP.comp @@ -19,33 +19,6 @@ par phaseTwoPsets I vint - 10 0 '[]' - par phaseThreePsets I vint - 10 0 '[]' - "Psets used for phase three (calculations per pencil beam)" -# -- CNProc_CoherentStokes -- -# -# name vers qual constr. descr. -#-------------------------------------------------------------------------------------------------------- -node CNProc_CoherentStokes 4.0.0 development 'node constraint' "Coherent Stokes settings for BG/P" - -# name dir. type unit prun. vm value constr. descr. -#-------------------------------------------------------------------------------------------------------- -par which I ptext - 10 0 "I|IQUV;I" - "Which Stokes values to compute" -par channelsPerSubband I int - 10 0 "<<Observation.channelsPerSubband" - "Number of channels for Stokes data" -par timeIntegrationFactor I int - 10 0 1 - "Time-wise integration of Stokes data (in samples)" - - -# -- CNProc_IncoherentStokes -- -# -# name vers qual constr. descr. -#-------------------------------------------------------------------------------------------------------- -node CNProc_IncoherentStokes 4.0.0 development 'node constraint' "Incoherent Stokes settings for BG/P" - -# name dir. type unit prun. vm value constr. descr. -#-------------------------------------------------------------------------------------------------------- -par which I ptext - 10 0 "I|IQUV;I" - "Which Stokes values to compute" -par channelsPerSubband I int - 10 0 "<<Observation.channelsPerSubband" - "Number of channels for Stokes data" -par timeIntegrationFactor I int - 10 0 1 - "Time-wise integration of Stokes data (in samples)" -par dispersionMeasures I vdbl - 10 0 '[]' - "Dedisperse channels with these measures, producing a dataset for each measure [] == [0.0]" - - # -- OLAP_Conni -- # name vers qual constr. descr. #-------------------------------------------------------------------------------------------------------- @@ -54,7 +27,7 @@ node OLAP_Conn 4.0.0 development 'node constraint' "Connection specificati # name dir. type unit prun. vm value constr. descr. #-------------------------------------------------------------------------------------------------------- par IONProc_Storage_Ports I vint - 10 0 '[8300..9000]' - "portnumbers to use in the Storage connections" -par IONProc_CNProc_Transport I ptext - 10 0 'FCNP|TCP|NULL;FCNP' - "communication protocol between IO and CN nodes" +par IONProc_CNProc_Transport I ptext - 10 0 'FCNP|TCP|NULL;FCNP' - "communication protocol between IO and CN nodes" par rawDataOutputs I text - 10 0 'tcp:10.181.0.2:4000' - "where to send raw station data if enabled" par rawDataOutputOnly I bool - 10 0 false - "only retransmit raw station data" @@ -69,6 +42,27 @@ node Correlator 4.0.0 development 'node constraint' "Settings for Correlation par integrationTime I dbl - 10 0 1 - "Integration time" +# -- Stokes -- +# name vers qual constr. descr. +#-------------------------------------------------------------------------------------------------------- +node Stokes 4.0.0 development 'node constraint' "Settings for Stokes calculations" + +# output configuration +par which I ptext - 10 0 "I|IQUV;I" - "Which Stokes values to compute" +par integrateChannels I bool - 10 0 false - "Collapse channels for Stokes (DM=0)" +par integrationSteps I int - 10 0 1 - "Time-wise integration of Stokes data (in samples)" + +######################################################################################################### +# -- Pencil -- +# name vers qual constr. descr. +#-------------------------------------------------------------------------------------------------------- +node Pencil 4.0.0 development 'node constraint' "Pencil beam specification" +# name dir. type unit prun. vm value constr. descr. +#-------------------------------------------------------------------------------------------------------- +par angle1 I vdbl - 10 0 0 - 'RightAscention(s) or Azimuth of thesource(s) in rad. (coordinate system is same as used in the Beams)' +par angle2 I vdbl - 10 0 0 - 'Declination(s) or Elevation of the source(s) in rad. (coordinate system is the same as used in the Beams)' + + # -- PencilInfo -- # name vers qual constr. descr. #-------------------------------------------------------------------------------------------------------- @@ -115,13 +109,11 @@ par subbandsPerMS I int - 10 0 1 - '???' # -- OLAP-- # name vers qual constr. descr. #-------------------------------------------------------------------------------------------------------- -node OLAP 4.0.3 development 'node constraint' "OLAP" - +node OLAP 4.0.1 development 'node constraint' "OLAP" # name dir. type unit prun. vm value constr. descr. #-------------------------------------------------------------------------------------------------------- par realTime I bool - 10 0 true - "whether data is processed at real-time" -par coherentDedisperseChannels I bool - 10 0 true - "dedisperse each channel in beam-forming modes" par delayCompensation I bool - 10 0 true - "perform delay compensation between stations" par storageStationNames I text - 10 0 'AllStations' - '???' #par IPHeaderSize I int - 10 0 28 - '???' @@ -132,15 +124,16 @@ par nrBitsPerSample I int - 10 0 16 - "sample size in bits" par nrSecondsOfBuffer I dbl - 10 0 2.5 - 'buffer size for raw station data (in seconds)' par maxNetworkDelay I dbl - 10 0 0.25 - '???' par correctBandPass I bool - 10 0 true - 'apply the bandpass filter' - +par nrPencils I int - 10 0 0 - "Number of additional (manual) pencil beams" # name vers qual constr. descr. #-------------------------------------------------------------------------------------------------------- uses CNProc 4.0.0 development 'node constraint' "Compute-Node Processing: application running on the BlueGene compute nodes" -uses CNProc_CoherentStokes 4.0.0 development 'node constraint' "Coherent Stokes settings for BG/P" -uses CNProc_IncoherentStokes 4.0.0 development 'node constraint' "Incoherent Stokes settings for BG/P" uses OLAP_Conn 4.0.0 development 'node constraint' "Connection specification of OLAP" +uses Stokes 4.0.0 development 'node constraint' "Settings for Stokes calculations" +uses PencilInfo 4.0.0 development 'node constraint' "Settings for pencil beamformer" uses DelayComp 4.0.0 development 'node constraint' "Setting of the delaycompensation" uses IONProc 4.0.0 development 'node constraint' "I/O Node Processing: application running on the BlueGene I/O nodes" uses StorageProc 4.0.0 development 'node constraint' "Stores output from the correlator in one or more MeasurmentSet files" +uses Pencil 4.0.0 development 'node constraint' "Pencil beam specification" uses Correlator 4.0.0 development 'node constraint' "Correlator specification" diff --git a/MAC/Deployment/data/OTDB/Scheduler.comp b/MAC/Deployment/data/OTDB/Scheduler.comp index 5178e59f0d6953c61cbb225e7fd6dc7f6705ee19..4cc847be1bc02ff5b6dddeb28364ec5279e63dc2 100644 --- a/MAC/Deployment/data/OTDB/Scheduler.comp +++ b/MAC/Deployment/data/OTDB/Scheduler.comp @@ -14,13 +14,13 @@ par fixedTime I bool - 10 0 false - "fixes the task to the scheduled time (not par lastPossibleDay I uint - 10 0 0 - "last possible date for scheduling" par late I bool - 10 0 false - "true takes earliest time in case of ambiguity" par nightTimeWeightFactor I uint - 10 0 0 - "weight factor curve for penalty calculation" -par predecessor I uint - 10 0 0 - "predecessor Task ID" +par predecessor I uint - 10 0 0 - "predecessor task ID" par predMaxTimeDif I text - 10 0 '' - "maximal distance to predecessor" par predMinTimeDif I text - 10 0 '' - "minimal distance to predecessor" par priority I flt - 10 0 0.0 - "the task priority" +par reason I text - 10 0 '' - "error reason" par referenceFrame I uint - 10 0 0 - "reference frame (0=J2000,1=B1950)" -par reservation I uint - 10 0 0 - "reservation task ID" -par storageSelectionMode I int - 10 0 1 - "the storage nodes selection mode" +par reservation I uint - 10 0 0 - "reservation task ID" par storageSelectionMode I int - 10 0 1 - "the storage nodes selection mode" par taskDuration I uint - 10 0 0 - "duration of the task in seconds" par taskID I uint - 10 0 0 - "internal scheduler task ID" diff --git a/MAC/Deployment/data/StaticMetaData/createFiles b/MAC/Deployment/data/StaticMetaData/createFiles index 26ef845b40ec7e5541dd4393bc4007e13199a0a0..fefdfc814505802b0e93205cbd960a3da3be55d1 100755 --- a/MAC/Deployment/data/StaticMetaData/createFiles +++ b/MAC/Deployment/data/StaticMetaData/createFiles @@ -250,11 +250,11 @@ def createRSPDriverFile(resultDir, stationName, dataDir, partitionName,ilt_local for rspNr in range(4): RSPconfig = RSPconfig.replace("@LANE_0"+str(rspNr)+"_MAC@", mac +" # "+rspDestNode[str(0)]) RSPconfig = RSPconfig.replace("@LANE_0"+str(rspNr)+"_IP@", ip) - if str(1) in rspDestNode.keys(): - (ip, mac) = findIPandMAC(rspDestNode[str(1)],dataDir) - for rspNr in range(0,4): - RSPconfig = RSPconfig.replace("@LANE_1"+str(rspNr)+"_MAC@", mac +" # "+rspDestNode[str(1)]) - RSPconfig = RSPconfig.replace("@LANE_1"+str(rspNr)+"_IP@", ip) + if str(1) in rspDestNode.keys(): + (ip, mac) = findIPandMAC(rspDestNode[str(1)],dataDir) + for rspNr in range(4): + RSPconfig = RSPconfig.replace("@LANE_1"+str(rspNr)+"_MAC@", mac +" # "+rspDestNode[str(1)]) + RSPconfig = RSPconfig.replace("@LANE_1"+str(rspNr)+"_IP@", ip) # Find IP address for RSP board ethernet. All NL stations have RSP address diff --git a/RTCP/CNProc/src/CN_Processing.cc b/RTCP/CNProc/src/CN_Processing.cc index aa6eacad25d9c2f85da2a43d901de7818e7be7db..da312f8ff3f0f77b7cdb5d8f1604e9fda040ae92 100644 --- a/RTCP/CNProc/src/CN_Processing.cc +++ b/RTCP/CNProc/src/CN_Processing.cc @@ -104,9 +104,9 @@ template <typename SAMPLE_TYPE> CN_Processing<SAMPLE_TYPE>::CN_Processing(const #endif itsLocationInfo(locationInfo), #if defined HAVE_MPI - itsTranspose2Logic(parset, itsLocationInfo.psetNumber(), CN_Mapping::reverseMapCoreOnPset(itsLocationInfo.rankInPset(), itsLocationInfo.psetNumber())) + itsTranspose2Logic(parset.CN_transposeLogic(itsLocationInfo.psetNumber(), CN_Mapping::reverseMapCoreOnPset(itsLocationInfo.rankInPset(), itsLocationInfo.psetNumber()))) #else - itsTranspose2Logic(parset, 0, 0) + itsTranspose2Logic(parset.CN_transposeLogic(0, 0)) #endif { if(LOG_CONDITION) diff --git a/RTCP/CNProc/src/CN_Processing.h b/RTCP/CNProc/src/CN_Processing.h index 55705905fd4e3d1dbfa8f3ea237050f0d27f9e4c..c9f1dc541eb2d369dab95fc6d068a0942a7bb9aa 100644 --- a/RTCP/CNProc/src/CN_Processing.h +++ b/RTCP/CNProc/src/CN_Processing.h @@ -36,7 +36,6 @@ #include <Interface/SubbandMetaData.h> #include <Interface/TransposedData.h> #include <Interface/TriggerData.h> -#include <Interface/TransposeLogic.h> #include <Stream/Stream.h> @@ -141,7 +140,7 @@ template <typename SAMPLE_TYPE> class CN_Processing : public CN_Processing_Base SmartPtr<Stream> itsTriggerDataStream; const LocationInfo &itsLocationInfo; - const CN_Transpose2 itsTranspose2Logic; + const CN_Transpose2 &itsTranspose2Logic; std::vector<double> itsCenterFrequencies; SmartPtr<Ring> itsFirstInputSubband, itsCurrentSubband; std::vector<double> itsDMs; diff --git a/RTCP/IONProc/src/OutputSection.cc b/RTCP/IONProc/src/OutputSection.cc index a5d104dc048dc7e1f431263f5ea34edcf298ef04..60a8512489bde36a2c618071eff4f05b2062c333 100644 --- a/RTCP/IONProc/src/OutputSection.cc +++ b/RTCP/IONProc/src/OutputSection.cc @@ -49,7 +49,7 @@ OutputSection::OutputSection(const Parset &parset, : itsLogPrefix(str(boost::format("[obs %u type %u") % parset.observationID() % outputType)), // no trailing "] " so we can add subband info for some log messages itsVariableNrSubbands(variableNrSubbands), - itsTranspose2Logic(parset), + itsTranspose2Logic(parset.transposeLogic()), itsNrComputeCores(cores.size()), itsNrCoresPerIteration(parset.maxNrStreamsPerPset(outputType)), itsNrCoresSkippedPerIteration(parset.phaseThreeDisjunct() ? 0 : parset.maxNrStreamsPerPset(CORRELATED_DATA,true) - itsNrCoresPerIteration), // if phase 1+2=phase 3, we iterate over the #subbands, not over #streams produced in phase 3 diff --git a/RTCP/IONProc/src/OutputSection.h b/RTCP/IONProc/src/OutputSection.h index a07db6fe5fe4c8067427ec4aa9402e5ddbd7c2fd..0114483269612985f8f0f183eb21870e7310b8ed 100644 --- a/RTCP/IONProc/src/OutputSection.h +++ b/RTCP/IONProc/src/OutputSection.h @@ -24,7 +24,6 @@ #include <Interface/OutputTypes.h> #include <Interface/Parset.h> #include <Interface/SmartPtr.h> -#include <Interface/TransposeLogic.h> #include <IONProc/OutputThread.h> #include <Stream/Stream.h> #include <Common/Thread/Semaphore.h> @@ -59,7 +58,7 @@ class OutputSection const std::string itsLogPrefix; const bool itsVariableNrSubbands; - const Transpose2 itsTranspose2Logic; + const Transpose2 &itsTranspose2Logic; const unsigned itsNrComputeCores; const unsigned itsNrCoresPerIteration, itsNrCoresSkippedPerIteration, itsFirstStreamNr, itsNrStreams; diff --git a/RTCP/IONProc/src/OutputThread.h b/RTCP/IONProc/src/OutputThread.h index 56e5c9817bd58d4199267446e47ea157b5359f56..4ff27eda8a2696c5bb83d10847d189b3e8222f47 100644 --- a/RTCP/IONProc/src/OutputThread.h +++ b/RTCP/IONProc/src/OutputThread.h @@ -29,7 +29,6 @@ #include <Interface/OutputTypes.h> #include <Interface/SmartPtr.h> #include <Interface/StreamableData.h> -#include <Interface/TransposeLogic.h> #include <Common/Thread/Queue.h> #include <Common/Thread/Semaphore.h> #include <Common/Thread/Thread.h> diff --git a/RTCP/Interface/include/Interface/Parset.h b/RTCP/Interface/include/Interface/Parset.h index 8116652af11401dbe2119d3a23b330d9085cc4ee..474137599c67d355a1b57edef82e256b583e3a92 100644 --- a/RTCP/Interface/include/Interface/Parset.h +++ b/RTCP/Interface/include/Interface/Parset.h @@ -37,7 +37,9 @@ #include <Interface/BeamCoordinates.h> #include <Interface/Config.h> #include <Interface/OutputTypes.h> +#include <Interface/SmartPtr.h> #include <Stream/Stream.h> +#include <Interface/PrintVector.h> #include <algorithm> #include <numeric> @@ -51,6 +53,9 @@ namespace LOFAR { namespace RTCP { +class Transpose2; +class CN_Transpose2; + // The Parset class is a public struct that can be used as base-class // for holding Parset related information. // It can be instantiated with a parset containing Parset information. @@ -221,9 +226,15 @@ class Parset: public ParameterSet std::string AntennaFieldsDir() const; std::string HBADeltasDir() const; + const Transpose2 &transposeLogic() const; + const CN_Transpose2 &CN_transposeLogic( unsigned pset, unsigned core ) const; + private: const std::string itsName; + mutable SmartPtr<const Transpose2> itsTransposeLogic; + mutable SmartPtr<const CN_Transpose2> itsCN_TransposeLogic; + void checkVectorLength(const std::string &key, unsigned expectedSize) const; void checkInputConsistency() const; @@ -239,12 +250,239 @@ private: bool disjointCores(const Parset &, std::stringstream &error) const; }; +// +// All of the logic for the second transpose. +// + +struct StreamInfo { + unsigned stream; + + unsigned sap; + unsigned beam; + unsigned stokes; + unsigned part; + + std::vector<unsigned> subbands; + + void log() const { + LOG_DEBUG_STR( "Stream " << stream << " is sap " << sap << " beam " << beam << " stokes " << stokes << " part " << part << " consisting of subbands " << subbands ); + } +}; + +class Transpose2 { +public: + Transpose2( const Parset &parset ) + : + phaseThreeDisjunct( parset.phaseThreeDisjunct() ), + + nrBeams( parset.totalNrPencilBeams() ), + nrStokesPerBeam( parset.nrCoherentStokes() ), + nrSubbandsPerPart( parset.nrSubbandsPerPart() ), + + nrPhaseTwoPsets( parset.phaseTwoPsets().size() ), + nrPhaseTwoCores( parset.phaseOneTwoCores().size() ), + nrPhaseThreePsets( parset.phaseThreePsets().size() ), + nrPhaseThreeCores( parset.phaseThreeCores().size() ), + + nrSubbandsPerPset( parset.nrSubbandsPerPset() ), + nrStreamsPerPset( parset.nrPhase3StreamsPerPset() ), + streamInfo( generateStreamInfo(parset) ) + { + } + + unsigned nrStreams() const { return streamInfo.size(); } + + // compose and decompose a stream number + unsigned stream( unsigned sap, unsigned beam, unsigned stokes, unsigned part ) const { + for (unsigned i = 0; i < streamInfo.size(); i++) { + const struct StreamInfo &info = streamInfo[i]; + + if (sap == info.sap && beam == info.beam && stokes == info.stokes && part == info.part) + return i; + } + + // shouldn't reach this point + ASSERTSTR(false, "Requested non-existing sap " << sap << " beam " << beam << " stokes " << stokes << " part " << part); + + return 0; + } + + void decompose( unsigned stream, unsigned &sap, unsigned &beam, unsigned &stokes, unsigned &part ) const { + const struct StreamInfo &info = streamInfo[stream]; + + sap = info.sap; + beam = info.beam; + stokes = info.stokes; + part = info.part; + } + + std::vector<unsigned> subbands( unsigned stream ) const { ASSERT(stream < streamInfo.size()); return streamInfo[stream].subbands; } + unsigned nrSubbands( unsigned stream ) const { return stream >= streamInfo.size() ? 0 : subbands(stream).size(); } + unsigned maxNrSubbands() const { return streamInfo.size() == 0 ? 0 : std::max_element( streamInfo.begin(), streamInfo.end(), &streamInfoSizeComp )->subbands.size(); } + + //unsigned maxNrSubbandsPerStream() const { return std::min(nrSubbands, nrSubbandsPerPart); } + + // the pset/core which processes a certain block of a certain subband + // note: AsyncTransposeBeams applied the mapping of phaseThreePsets + unsigned sourceCore( unsigned subband, unsigned block ) const { return (block * nrSubbandsPerPset + subband % nrSubbandsPerPset) % nrPhaseTwoCores; } + unsigned sourcePset( unsigned subband, unsigned block ) const { (void)block; return subband / nrSubbandsPerPset; } + + // the pset/core which processes a certain block of a certain stream + // note: AsyncTransposeBeams applied the mapping of phaseTwoPsets + unsigned destCore( unsigned stream, unsigned block ) const { return (block * phaseThreeGroupSize() + stream % nrStreamsPerPset) % nrPhaseThreeCores; } + unsigned destPset( unsigned stream, unsigned block ) const { (void)block; return stream / nrStreamsPerPset; } + + // if phase2 == phase3, each block in phase3 is processed by more cores (more cores idle to align phases 2 and 3) + unsigned phaseThreeGroupSize() const { + return phaseThreeDisjunct ? nrStreamsPerPset : nrSubbandsPerPset; + } + + const bool phaseThreeDisjunct; + + const unsigned nrBeams; + const unsigned nrStokesPerBeam; + const unsigned nrSubbandsPerPart; + + const unsigned nrPhaseTwoPsets; + const unsigned nrPhaseTwoCores; + const unsigned nrPhaseThreePsets; + const unsigned nrPhaseThreeCores; + + const unsigned nrSubbandsPerPset; + const unsigned nrStreamsPerPset; + + const std::vector<struct StreamInfo> streamInfo; +private: + + static bool streamInfoSizeComp( const struct StreamInfo &a, const struct StreamInfo &b ) { + return a.subbands.size() < b.subbands.size(); + } + + std::vector<struct StreamInfo> generateStreamInfo( const Parset &parset ) const { + // get all info from parset, since we will be called while constructing our members + + // ParameterSets are SLOW, so cache any info we need repeatedly + + std::vector<struct StreamInfo> infoset; + const std::vector<unsigned> sapMapping = parset.subbandToSAPmapping(); + const unsigned nrSAPs = parset.nrBeams(); + const unsigned nrSubbands = parset.nrSubbands(); + const unsigned nrCoherentStokes = parset.nrCoherentStokes(); + const unsigned nrSubbandsPerPart = parset.nrSubbandsPerPart(); + + struct StreamInfo info; + info.stream = 0; + + for (unsigned sap = 0; sap < nrSAPs; sap++) { + const unsigned nrBeams = parset.nrPencilBeams(sap); + + info.sap = sap; + + std::vector<unsigned> sapSubbands; + + for (unsigned sb = 0; sb < nrSubbands; sb++) + if (sapMapping[sb] == sap) + sapSubbands.push_back(sb); + + for (unsigned beam = 0; beam < nrBeams; beam++) { + info.beam = beam; + + for (unsigned stokes = 0; stokes < nrCoherentStokes; stokes++) { + info.stokes = stokes; + info.part = 0; + + // split into parts of at most parset.nrSubbandsPerPart() + for (unsigned sb = 0; sb < sapSubbands.size(); sb += nrSubbandsPerPart ) { + for (unsigned i = 0; sb + i < sapSubbands.size() && i < nrSubbandsPerPart; i++) + info.subbands.push_back(sapSubbands[sb + i]); + + infoset.push_back(info); + + info.subbands.clear(); + info.part++; + info.stream++; + } + } + } + } + + return infoset; + } +}; + +class CN_Transpose2: public Transpose2 { +public: + CN_Transpose2( const Parset &parset, unsigned myPset, unsigned myCore ) + : + Transpose2( parset ), + myPset( myPset ), + myCore( myCore ), + + phaseThreePsetIndex( parset.phaseThreePsetIndex(myPset) ), + phaseThreeCoreIndex( parset.phaseThreeCoreIndex(myCore) ) + { + } + + // the stream to process on (myPset, myCore) + int myStream( unsigned block ) const { + unsigned first = phaseThreePsetIndex * nrStreamsPerPset; + unsigned relative = (nrPhaseThreeCores + phaseThreeCoreIndex - phaseThreeGroupSize() * block) % nrPhaseThreeCores; + + // such a stream does not exist + if (first + relative >= nrStreams()) + return -1; + + // we could handle this stream, but it's handled by a subsequent pset + if (relative >= nrStreamsPerPset) + return -1; + + return first + relative; + } + + // the part number of a subband with an absolute index + unsigned myPart( unsigned subband ) const { + for (unsigned i = 0; i < streamInfo.size(); i++) { + const struct StreamInfo &info = streamInfo[i]; + + if ( info.subbands[0] <= subband + && info.subbands[info.subbands.size()-1] >= subband ) + return info.part; + } + + // shouldn't reach this point + ASSERTSTR(false, "Requested part for unused subband " << subband); + + return 0; + } + + const unsigned myPset; + const unsigned myCore; + + const int phaseThreePsetIndex; + const int phaseThreeCoreIndex; +}; inline std::string Parset::name() const { return itsName; } +inline const Transpose2 &Parset::transposeLogic() const +{ + if (!itsTransposeLogic) + itsTransposeLogic = new Transpose2(*this); + + return *itsTransposeLogic; +} + +inline const CN_Transpose2 &Parset::CN_transposeLogic( unsigned pset, unsigned core ) const +{ + if (!itsCN_TransposeLogic) + itsCN_TransposeLogic = new CN_Transpose2(*this, pset, core); + + return *itsCN_TransposeLogic; +} + inline unsigned Parset::observationID() const { diff --git a/RTCP/Interface/include/Interface/TransposeLogic.h b/RTCP/Interface/include/Interface/TransposeLogic.h deleted file mode 100644 index ae55d5ea21063b1d5c0588c5c87ffaf642f633c0..0000000000000000000000000000000000000000 --- a/RTCP/Interface/include/Interface/TransposeLogic.h +++ /dev/null @@ -1,219 +0,0 @@ -#ifndef LOFAR_INTERFACE_TRANSPOSELOGIC_H -#define LOFAR_INTERFACE_TRANSPOSELOGIC_H - -#include <Interface/Parset.h> -#include <Interface/PrintVector.h> -#include <Common/LofarLogger.h> -#include <algorithm> - -namespace LOFAR { -namespace RTCP { - -// -// All of the logic for the second transpose. -// - -struct StreamInfo { - unsigned stream; - - unsigned sap; - unsigned beam; - unsigned stokes; - unsigned part; - - std::vector<unsigned> subbands; - - void log() const { - LOG_DEBUG_STR( "Stream " << stream << " is sap " << sap << " beam " << beam << " stokes " << stokes << " part " << part << " consisting of subbands " << subbands ); - } -}; - -class Transpose2 { -public: - Transpose2( const Parset &parset ) - : - phaseThreeDisjunct( parset.phaseThreeDisjunct() ), - - nrBeams( parset.totalNrPencilBeams() ), - nrStokesPerBeam( parset.nrCoherentStokes() ), - nrSubbandsPerPart( parset.nrSubbandsPerPart() ), - - nrPhaseTwoPsets( parset.phaseTwoPsets().size() ), - nrPhaseTwoCores( parset.phaseOneTwoCores().size() ), - nrPhaseThreePsets( parset.phaseThreePsets().size() ), - nrPhaseThreeCores( parset.phaseThreeCores().size() ), - - nrSubbandsPerPset( parset.nrSubbandsPerPset() ), - nrStreamsPerPset( parset.nrPhase3StreamsPerPset() ), - streamInfo( generateStreamInfo(parset) ) - { - } - - unsigned nrStreams() const { return streamInfo.size(); } - - // compose and decompose a stream number - unsigned stream( unsigned sap, unsigned beam, unsigned stokes, unsigned part ) const { - for (unsigned i = 0; i < streamInfo.size(); i++) { - const struct StreamInfo &info = streamInfo[i]; - - if (sap == info.sap && beam == info.beam && stokes == info.stokes && part == info.part) - return i; - } - - // shouldn't reach this point - ASSERTSTR(false, "Requested non-existing sap " << sap << " beam " << beam << " stokes " << stokes << " part " << part); - - return 0; - } - - void decompose( unsigned stream, unsigned &sap, unsigned &beam, unsigned &stokes, unsigned &part ) const { - const struct StreamInfo &info = streamInfo[stream]; - - sap = info.sap; - beam = info.beam; - stokes = info.stokes; - part = info.part; - } - - std::vector<unsigned> subbands( unsigned stream ) const { ASSERT(stream < streamInfo.size()); return streamInfo[stream].subbands; } - unsigned nrSubbands( unsigned stream ) const { return stream >= streamInfo.size() ? 0 : subbands(stream).size(); } - unsigned maxNrSubbands() const { return streamInfo.size() == 0 ? 0 : std::max_element( streamInfo.begin(), streamInfo.end(), &streamInfoSizeComp )->subbands.size(); } - - //unsigned maxNrSubbandsPerStream() const { return std::min(nrSubbands, nrSubbandsPerPart); } - - // the pset/core which processes a certain block of a certain subband - // note: AsyncTransposeBeams applied the mapping of phaseThreePsets - unsigned sourceCore( unsigned subband, unsigned block ) const { return (block * nrSubbandsPerPset + subband % nrSubbandsPerPset) % nrPhaseTwoCores; } - unsigned sourcePset( unsigned subband, unsigned block ) const { (void)block; return subband / nrSubbandsPerPset; } - - // the pset/core which processes a certain block of a certain stream - // note: AsyncTransposeBeams applied the mapping of phaseTwoPsets - unsigned destCore( unsigned stream, unsigned block ) const { return (block * phaseThreeGroupSize() + stream % nrStreamsPerPset) % nrPhaseThreeCores; } - unsigned destPset( unsigned stream, unsigned block ) const { (void)block; return stream / nrStreamsPerPset; } - - // if phase2 == phase3, each block in phase3 is processed by more cores (more cores idle to align phases 2 and 3) - unsigned phaseThreeGroupSize() const { - return phaseThreeDisjunct ? nrStreamsPerPset : nrSubbandsPerPset; - } - - const bool phaseThreeDisjunct; - - const unsigned nrBeams; - const unsigned nrStokesPerBeam; - const unsigned nrSubbandsPerPart; - - const unsigned nrPhaseTwoPsets; - const unsigned nrPhaseTwoCores; - const unsigned nrPhaseThreePsets; - const unsigned nrPhaseThreeCores; - - const unsigned nrSubbandsPerPset; - const unsigned nrStreamsPerPset; - - const std::vector<struct StreamInfo> streamInfo; -private: - - static bool streamInfoSizeComp( const struct StreamInfo &a, const struct StreamInfo &b ) { - return a.subbands.size() < b.subbands.size(); - } - - std::vector<struct StreamInfo> generateStreamInfo( const Parset &parset ) const { - // get all info from parset, since we will be called while constructing our members - - std::vector<struct StreamInfo> infoset; - std::vector<unsigned> sapMapping = parset.subbandToSAPmapping(); - - struct StreamInfo info; - info.stream = 0; - - for (unsigned sap = 0; sap < parset.nrBeams(); sap++) { - info.sap = sap; - - std::vector<unsigned> sapSubbands; - - for (unsigned sb = 0; sb < parset.nrSubbands(); sb++) - if (sapMapping[sb] == sap) - sapSubbands.push_back(sb); - - for (unsigned beam = 0; beam < parset.nrPencilBeams(sap); beam++) { - info.beam = beam; - - for (unsigned stokes = 0; stokes < parset.nrCoherentStokes(); stokes++) { - info.stokes = stokes; - info.part = 0; - - // split into parts of at most parset.nrSubbandsPerPart() - for (unsigned sb = 0; sb < sapSubbands.size(); sb += parset.nrSubbandsPerPart() ) { - for (unsigned i = 0; sb + i < sapSubbands.size() && i < parset.nrSubbandsPerPart(); i++) - info.subbands.push_back(sapSubbands[sb + i]); - - infoset.push_back(info); - - info.subbands.clear(); - info.part++; - info.stream++; - } - } - } - } - - return infoset; - } -}; - -class CN_Transpose2: public Transpose2 { -public: - CN_Transpose2( const Parset &parset, unsigned myPset, unsigned myCore ) - : - Transpose2( parset ), - myPset( myPset ), - myCore( myCore ), - - phaseThreePsetIndex( parset.phaseThreePsetIndex(myPset) ), - phaseThreeCoreIndex( parset.phaseThreeCoreIndex(myCore) ) - { - } - - // the stream to process on (myPset, myCore) - int myStream( unsigned block ) const { - unsigned first = phaseThreePsetIndex * nrStreamsPerPset; - unsigned relative = (nrPhaseThreeCores + phaseThreeCoreIndex - phaseThreeGroupSize() * block) % nrPhaseThreeCores; - - // such a stream does not exist - if (first + relative >= nrStreams()) - return -1; - - // we could handle this stream, but it's handled by a subsequent pset - if (relative >= nrStreamsPerPset) - return -1; - - return first + relative; - } - - // the part number of a subband with an absolute index - unsigned myPart( unsigned subband ) const { - for (unsigned i = 0; i < streamInfo.size(); i++) { - const struct StreamInfo &info = streamInfo[i]; - - if ( info.subbands[0] <= subband - && info.subbands[info.subbands.size()-1] >= subband ) - return info.part; - } - - // shouldn't reach this point - ASSERTSTR(false, "Requested part for unused subband " << subband); - - return 0; - } - - const unsigned myPset; - const unsigned myCore; - - const int phaseThreePsetIndex; - const int phaseThreeCoreIndex; -}; - -} // namespace RTCP -} // namespace LOFAR - -#endif diff --git a/RTCP/Interface/src/DataFactory.cc b/RTCP/Interface/src/DataFactory.cc index 93c1bcace992da4905158fc212bc339b803a70c0..1c2590734c4425ee6512f4fdbfc1d3535d456ea6 100644 --- a/RTCP/Interface/src/DataFactory.cc +++ b/RTCP/Interface/src/DataFactory.cc @@ -29,7 +29,6 @@ #include <Interface/FilteredData.h> #include <Interface/StokesData.h> #include <Interface/TriggerData.h> -#include <Interface/TransposeLogic.h> namespace LOFAR { @@ -38,6 +37,7 @@ namespace RTCP { StreamableData *newStreamableData(const Parset &parset, OutputType outputType, int streamNr, Allocator &allocator) { + const Transpose2 &beamFormLogic = parset.transposeLogic(); switch (outputType) { case FILTERED_DATA : return new FilteredData(parset.nrStations(), parset.nrChannelsPerSubband(), parset.CNintegrationSteps(), allocator); @@ -47,12 +47,10 @@ StreamableData *newStreamableData(const Parset &parset, OutputType outputType, i case INCOHERENT_STOKES : return new StokesData(false, parset.nrIncoherentStokes(), 1, parset.incoherentStokesChannelsPerSubband(), parset.CNintegrationSteps(), parset.incoherentStokesTimeIntegrationFactor(), allocator); case BEAM_FORMED_DATA : { - Transpose2 beamFormLogic(parset); unsigned nrTransposedSubbands = streamNr == -1 ? beamFormLogic.maxNrSubbands() : beamFormLogic.nrSubbands(streamNr); return new FinalBeamFormedData(nrTransposedSubbands, parset.nrChannelsPerSubband(), parset.CNintegrationSteps(), 4 / parset.nrCoherentStokes(), allocator); } case COHERENT_STOKES : { - Transpose2 beamFormLogic(parset); unsigned nrTransposedSubbands = streamNr == -1 ? beamFormLogic.maxNrSubbands() : beamFormLogic.nrSubbands(streamNr); return new FinalStokesData(true, nrTransposedSubbands, parset.coherentStokesChannelsPerSubband(), parset.CNintegrationSteps(), parset.coherentStokesTimeIntegrationFactor(), allocator); } diff --git a/RTCP/Storage/include/Storage/MSWriterLDA.h b/RTCP/Storage/include/Storage/MSWriterLDA.h index e38e9293852437539e1c1dc8c34429e0ce8cd48f..21f6fdcddc81cee6aeaa07e714b11c217fa963b9 100644 --- a/RTCP/Storage/include/Storage/MSWriterLDA.h +++ b/RTCP/Storage/include/Storage/MSWriterLDA.h @@ -37,7 +37,6 @@ #include <Interface/Parset.h> #include <Interface/StreamableData.h> -#include <Interface/TransposeLogic.h> #include <Storage/MSWriter.h> #include <Storage/MSWriterFile.h> @@ -60,7 +59,7 @@ namespace LOFAR #ifdef USE_LDA virtual void write(StreamableData *data); private: - const Transpose2 itsTransposeLogic; + const Transpose2 &itsTransposeLogic; const unsigned itsNrChannels; unsigned itsNrSamples; unsigned itsNextSeqNr; diff --git a/RTCP/Storage/src/MSWriterLDA.cc b/RTCP/Storage/src/MSWriterLDA.cc index b1b933f4d22b936991e9476389030682e05de91e..9621c74e6e0288672c59e74eed824f6e3282ce14 100644 --- a/RTCP/Storage/src/MSWriterLDA.cc +++ b/RTCP/Storage/src/MSWriterLDA.cc @@ -106,7 +106,7 @@ namespace LOFAR template <typename T,unsigned DIM> MSWriterLDA<T,DIM>::MSWriterLDA (const string &filename, const Parset &parset, OutputType outputType, unsigned fileno, bool isBigEndian) : MSWriterFile(forceextension(string(filename),".raw"),false), - itsTransposeLogic(parset), + itsTransposeLogic(parset.transposeLogic()), itsNrChannels(parset.nrChannelsPerSubband() * itsTransposeLogic.nrSubbands(fileno)), itsNextSeqNr(0) { diff --git a/SAS/OTB/CMakeLists.txt b/SAS/OTB/CMakeLists.txt index dd27d10fd4327a42a9ab762c8fa6e740610892bc..d59d19d9d92cdaa5211d595d2dcfed777dd7154a 100644 --- a/SAS/OTB/CMakeLists.txt +++ b/SAS/OTB/CMakeLists.txt @@ -1,5 +1,16 @@ # $Id$ -lofar_add_package(jOTDB3) -add_subdirectory(scripts) +lofar_package(jOTDB3 1.0 DEPENDS Common OTDB) +include(LofarFindPackage) +lofar_find_package(Boost REQUIRED COMPONENTS date_time) +lofar_find_package(PQXX REQUIRED) + +# Don't use lofar_find_package(JNI), because we don't need to link in the +# JNI libraries; we only need the JNI header files. +find_package(JNI REQUIRED) +include_directories(${JNI_INCLUDE_DIRS}) + +add_subdirectory(include/jOTDB3) +add_subdirectory(src) +#add_subdirectory(test) 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 7e0a529667f0459e83e5bc1a236c368662bc605f..b733af16896f6acb5341eed129ea3719fd44dc9d 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 @@ -47,6 +47,8 @@ public class BeamformerConfigurationTableModel extends javax.swing.table.Default private String itsTreeType; private boolean isChanged=false; + + private int offset=1; /** Creates a new instance of BeamConfigurationTableModel */ public BeamformerConfigurationTableModel() { @@ -73,7 +75,6 @@ public class BeamformerConfigurationTableModel extends javax.swing.table.Default int length = stations.size(); // need to skip first entry because it is the default (dummy) TBBsetting in other then VHTree's - int offset=1; if (itsTreeType.equals("VHtree")) { offset=0; } @@ -102,7 +103,7 @@ public class BeamformerConfigurationTableModel extends javax.swing.table.Default // need to skip first entry because it is the default (dummy) TBBsetting // empty all elements except the default - stations.setSize(1); + stations.setSize(offset); for (int i=0; i<getRowCount(); i++) { stations.addElement(getValueAt(i,1).toString()); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.form index a7a2d2d525a35ce50908ea9cf741ac8bc4df439f..584158ab388a0e492fede75b99ea209b9286d698 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.form @@ -34,42 +34,29 @@ <Component id="jScrollPane1" min="-2" pref="343" max="-2" attributes="1"/> </Group> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="applyMSNameMask" min="-2" max="-2" attributes="0"/> - <Component id="applyStorageNodes" min="-2" max="-2" attributes="0"/> - <Component id="applyStationList" alignment="1" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="storageNodeSelectionPanel" alignment="0" min="-2" max="-2" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> - <Component id="coreStationSelectionPanel" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="remoteStationSelectionPanel" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="europeStationSelectionPanel" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Component id="labelMSNameMask" min="-2" pref="84" max="-2" attributes="1"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="inputMSNameMask" min="-2" pref="777" max="-2" attributes="1"/> - </Group> - </Group> - <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Component id="restoreButton" pref="142" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + <Component id="restoreButton" pref="161" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="cancelButton" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="saveButton" min="-2" pref="90" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="statusLabel" min="-2" pref="575" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="applyStationList" min="-2" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="statusLabel" pref="627" max="32767" attributes="0"/> + <Component id="coreStationSelectionPanel" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="remoteStationSelectionPanel" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="europeStationSelectionPanel" min="-2" max="-2" attributes="0"/> </Group> </Group> + <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> </Group> </Group> <EmptySpace max="-2" attributes="0"/> @@ -88,34 +75,22 @@ <Component id="remoteStationSelectionPanel" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="europeStationSelectionPanel" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="storageNodeSelectionPanel" min="-2" pref="207" max="-2" attributes="1"/> </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="131" max="-2" attributes="0"/> <Component id="applyStationList" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="192" max="-2" attributes="0"/> - <Component id="applyStorageNodes" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="inputMSNameMask" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="labelMSNameMask" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <Component id="applyMSNameMask" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="57" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> <Group type="103" groupAlignment="1" max="-2" attributes="0"> - <Component id="statusLabel" max="32767" attributes="1"/> - <Group type="103" alignment="0" groupAlignment="3" attributes="0"> - <Component id="restoreButton" alignment="1" max="32767" attributes="1"/> - <Component id="cancelButton" alignment="1" max="32767" attributes="1"/> - <Component id="saveButton" alignment="1" max="32767" attributes="1"/> + <Component id="restoreButton" alignment="1" max="32767" attributes="1"/> + <Component id="cancelButton" alignment="1" max="32767" attributes="1"/> + <Group type="103" alignment="1" groupAlignment="3" attributes="0"> + <Component id="saveButton" alignment="3" max="32767" attributes="1"/> + <Component id="statusLabel" alignment="3" max="32767" attributes="1"/> </Group> </Group> - <EmptySpace pref="162" max="32767" attributes="0"/> + <EmptySpace pref="23" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -187,28 +162,6 @@ <Property name="enabled" type="boolean" value="false"/> </Properties> </Component> - <Component class="nl.astron.lofar.sas.otbcomponents.StorageSelectionPanel" name="storageNodeSelectionPanel"> - <Properties> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> - <TitledBorder justification="2" title="StorageNode List"> - <Font PropertyName="font" name="Tahoma" size="11" style="1"/> - </TitledBorder> - </Border> - </Property> - <Property name="enabled" type="boolean" value="false"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="labelMSNameMask"> - <Properties> - <Property name="text" type="java.lang.String" value="MSNameMask:"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="inputMSNameMask"> - <Properties> - <Property name="enabled" type="boolean" value="false"/> - </Properties> - </Component> <Component class="javax.swing.JButton" name="restoreButton"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> @@ -231,15 +184,5 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="applyStationListActionPerformed"/> </Events> </Component> - <Component class="javax.swing.JCheckBox" name="applyStorageNodes"> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="applyStorageNodesActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JCheckBox" name="applyMSNameMask"> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="applyMSNameMaskActionPerformed"/> - </Events> - </Component> </SubComponents> </Form> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.java index 0cf6f0e7dba2f1a63c9046a48b36a265af873c00..7c7b180cf9b2b258d7b9e9bff4dcb881fe42f9f6 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.java @@ -23,7 +23,6 @@ package nl.astron.lofar.sas.otbcomponents; import java.rmi.RemoteException; import java.util.Enumeration; import java.util.Vector; -import javax.swing.JLabel; import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.sas.otb.MainFrame; import nl.astron.lofar.sas.otb.jotdb3.jOTDBnode; @@ -93,13 +92,9 @@ public class MultiEditDialog extends javax.swing.JDialog { europeStationSelectionPanel.setTitle("Europe"); europeStationSelectionPanel.init(); europeStationSelectionPanel.setEnabled(false); - storageNodeSelectionPanel.init(); - storageNodeSelectionPanel.setEnabled(false); statusLabel.setText(""); applyStationList.setSelected(false); - applyStorageNodes.setSelected(false); - applyMSNameMask.setSelected(false); isAdministrator = itsMainFrame.getUserAccount().isAdministrator(); jOTDBparam aParam=null; @@ -108,7 +103,6 @@ public class MultiEditDialog extends javax.swing.JDialog { //We are looking for: // VirtualInstrument.stationList - // VirtualInstrument.storageNodeList Vector<jOTDBnode> node = OtdbRmi.getRemoteMaintenance().getItemList(itsTreeIDs[0], "VirtualInstrument"); if (node.size() > 0) { jOTDBnode aNode = node.firstElement(); @@ -126,24 +120,6 @@ public class MultiEditDialog extends javax.swing.JDialog { } } - // Observation.MSNameMask - node = OtdbRmi.getRemoteMaintenance().getItemList(itsTreeIDs[0], "Observation"); - if (node.size() > 0) { - jOTDBnode aNode = node.firstElement(); - Vector<jOTDBnode> childs = OtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1); - // get all the params per child - Enumeration e = childs.elements(); - while (e.hasMoreElements()) { - jOTDBnode anotherNode = (jOTDBnode) e.nextElement(); - aParam = null; - // We need to keep all the params needed by this panel - if (anotherNode.leaf) { - aParam = OtdbRmi.getRemoteMaintenance().getParam(anotherNode); - } - setField("Observation", aParam, anotherNode); - } - } - restore(); isInitialized = true; @@ -197,25 +173,8 @@ public class MultiEditDialog extends javax.swing.JDialog { this.europeStationSelectionPanel.setToolTipText(aParam.description); this.itsStationList = aNode; setStationLists(aNode.limits); - } else if (aKeyName.equals("storageNodeList")) { - this.storageNodeSelectionPanel.setToolTipText(aParam.description); - this.itsStorageNodeList = aNode; - setStorageNodeLists(aNode.limits); - } - } else if (parentName.equals("Observation")) { - // Observation VirtualInstrument parameters - - if (aKeyName.equals("MSNameMask")) { - inputMSNameMask.setToolTipText(aParam.description); - itsMSNameMask=aNode; - if (isRef && aParam != null) { - inputMSNameMask.setText(aNode.limits + " : " + aParam.limits); - } else { - inputMSNameMask.setText(aNode.limits); - } } } - } /** @@ -252,19 +211,8 @@ public class MultiEditDialog extends javax.swing.JDialog { if (aKeyName.equals("stationList") && setStationList) { aNode.limits=getUsedStations(); saveNode(aNode); - } else if (aKeyName.equals("storageNodeList") && setStorageNodes) { - aNode.limits=getUsedStorageNodes(); - saveNode(aNode); - } - } else if (parentName.equals("Observation")) { - // Observation VirtualInstrument parameters - - if (aKeyName.equals("MSNameMask") && setMSNameMask) { - aNode.limits = inputMSNameMask.getText(); - saveNode(aNode); } } - } /** @@ -322,40 +270,6 @@ public class MultiEditDialog extends javax.swing.JDialog { return aS; } - public String getUsedStorageNodes() { - this.itsUsedStorageNodes = this.storageNodeSelectionPanel.getUsedStorageNodeList(); - String aS= "["; - boolean first=true; - for (int i=0; i< itsUsedStorageNodes.size();i++) { - if (first) { - first=false; - aS+=itsUsedStorageNodes.get(i); - } else { - aS+=","+itsUsedStorageNodes.get(i); - } - } - aS+="]"; - return aS; - } - - private void setStorageNodeLists(String nodes) { - itsUsedStorageNodes.clear(); - - if (nodes.startsWith("[")) { - nodes = nodes.substring(1, nodes.length()); - } - if (nodes.endsWith("]")) { - nodes = nodes.substring(0, nodes.length() - 1); - } - if (!nodes.equals("")) { - String[] aS = nodes.split("\\,"); - for (int i = 0; i < aS.length; i++) { - itsUsedStorageNodes.add(aS[i]); - } - this.storageNodeSelectionPanel.setUsedStorageNodeList(itsUsedStorageNodes); - } - } - private void setStationLists(String stations) { itsUsedCoreStations.clear(); itsUsedRemoteStations.clear(); @@ -412,11 +326,6 @@ public class MultiEditDialog extends javax.swing.JDialog { // determine what fields need to be gathered and rewritten. // only the ones that have actually been changed should be written - // Virtual Instrument storageNodes - if (this.itsStorageNodeList != null && setStorageNodes) { - itsStorageNodeList.limits = getUsedStorageNodes(); - saveNode(itsStorageNodeList); - } // Virtual Instrument StationList if (this.itsStationList != null && setStationList) { @@ -424,11 +333,6 @@ public class MultiEditDialog extends javax.swing.JDialog { saveNode(itsStationList); } - // Observation MSNameMask - if (itsMSNameMask != null && setMSNameMask) { - itsMSNameMask.limits = inputMSNameMask.getText(); - saveNode(itsMSNameMask); - } @@ -439,12 +343,9 @@ public class MultiEditDialog extends javax.swing.JDialog { // the nodes only need to be collected if the data actually was changed. for (int i = 1; i < itsTreeIDs.length; i++) { - if (setStationList || setStorageNodes) { + if (setStationList ) { collectAndSaveVirtualInstrumentNodes(itsTreeIDs[i]); } - if(setMSNameMask) { - collectAndSaveObservationNodes(itsTreeIDs[i]); - } } return true; @@ -471,14 +372,9 @@ public class MultiEditDialog extends javax.swing.JDialog { coreStationSelectionPanel = new nl.astron.lofar.sas.otbcomponents.StationSelectionPanel(); remoteStationSelectionPanel = new nl.astron.lofar.sas.otbcomponents.StationSelectionPanel(); europeStationSelectionPanel = new nl.astron.lofar.sas.otbcomponents.StationSelectionPanel(); - storageNodeSelectionPanel = new nl.astron.lofar.sas.otbcomponents.StorageSelectionPanel(); - labelMSNameMask = new javax.swing.JLabel(); - inputMSNameMask = new javax.swing.JTextField(); restoreButton = new javax.swing.JButton(); statusLabel = new javax.swing.JLabel(); applyStationList = new javax.swing.JCheckBox(); - applyStorageNodes = new javax.swing.JCheckBox(); - applyMSNameMask = new javax.swing.JCheckBox(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("LOFAR View TreeInfo"); @@ -524,13 +420,6 @@ public class MultiEditDialog extends javax.swing.JDialog { europeStationSelectionPanel.setEnabled(false); - storageNodeSelectionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "StorageNode List", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N - storageNodeSelectionPanel.setEnabled(false); - - labelMSNameMask.setText("MSNameMask:"); - - inputMSNameMask.setEnabled(false); - restoreButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_undo.png"))); // NOI18N restoreButton.setText("Restore"); restoreButton.addMouseListener(new java.awt.event.MouseAdapter() { @@ -548,18 +437,6 @@ public class MultiEditDialog extends javax.swing.JDialog { } }); - applyStorageNodes.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - applyStorageNodesActionPerformed(evt); - } - }); - - applyMSNameMask.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - applyMSNameMaskActionPerformed(evt); - } - }); - org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -570,35 +447,26 @@ public class MultiEditDialog extends javax.swing.JDialog { .add(235, 235, 235) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 343, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() - .addContainerGap() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(applyMSNameMask) - .add(applyStorageNodes) - .add(applyStationList)) - .add(18, 18, 18) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(storageNodeSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(layout.createSequentialGroup() - .add(coreStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(remoteStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(europeStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(layout.createSequentialGroup() - .add(labelMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(inputMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 777, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .add(53, 53, 53)) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createSequentialGroup() - .add(restoreButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE) + .add(14, 14, 14) + .add(restoreButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(saveButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 90, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(statusLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 575, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() + .addContainerGap() + .add(applyStationList) .add(18, 18, 18) - .add(statusLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 627, Short.MAX_VALUE))))) + .add(coreStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(remoteStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(europeStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .add(53, 53, 53))) .addContainerGap()) ); layout.setVerticalGroup( @@ -611,28 +479,18 @@ public class MultiEditDialog extends javax.swing.JDialog { .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(coreStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(remoteStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(europeStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) - .add(storageNodeSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(europeStationSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createSequentialGroup() .add(131, 131, 131) - .add(applyStationList) - .add(192, 192, 192) - .add(applyStorageNodes))) - .add(18, 18, 18) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(inputMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(labelMSNameMask)) - .add(applyMSNameMask)) - .add(57, 57, 57) + .add(applyStationList))) + .add(27, 27, 27) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) - .add(statusLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(restoreButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(cancelButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(saveButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - .addContainerGap(162, Short.MAX_VALUE)) + .add(restoreButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(cancelButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(saveButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(statusLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addContainerGap(23, Short.MAX_VALUE)) ); pack(); @@ -713,10 +571,6 @@ public class MultiEditDialog extends javax.swing.JDialog { */ private void restore() { - // Observation Specific parameters - inputMSNameMask.setText(itsMSNameMask.limits); - //Virtual Instrument storageNodeList - setStorageNodeLists(itsStorageNodeList.limits); //Virtual Instrument stationList setStationLists(itsStationList.limits); } @@ -746,16 +600,6 @@ public class MultiEditDialog extends javax.swing.JDialog { this.setStationList = applyStationList.isSelected(); }//GEN-LAST:event_applyStationListActionPerformed - private void applyStorageNodesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyStorageNodesActionPerformed - this.storageNodeSelectionPanel.setEnabled(applyStorageNodes.isSelected()); - this.setStorageNodes = applyStorageNodes.isSelected(); - }//GEN-LAST:event_applyStorageNodesActionPerformed - - private void applyMSNameMaskActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyMSNameMaskActionPerformed - this.inputMSNameMask.setEnabled(applyMSNameMask.isSelected()); - this.setMSNameMask = applyMSNameMask.isSelected(); - }//GEN-LAST:event_applyMSNameMaskActionPerformed - private MainFrame itsMainFrame = null; private jOTDBtree itsTree = null; @@ -769,36 +613,24 @@ public class MultiEditDialog extends javax.swing.JDialog { private Vector<String> itsUsedCoreStations = new Vector<String>(); private Vector<String> itsUsedRemoteStations = new Vector<String>(); private Vector<String> itsUsedEuropeStations = new Vector<String>(); - private Vector<String> itsUsedStorageNodes = new Vector<String>(); // Observation Virtual Instrument parameters private jOTDBnode itsStationList=null; - private jOTDBnode itsStorageNodeList=null; - - // Obsservation.MSNameMask - private jOTDBnode itsMSNameMask=null; private boolean isInitialized=false; private boolean setStationList=false; - private boolean setStorageNodes=false; - private boolean setMSNameMask=false; // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JCheckBox applyMSNameMask; private javax.swing.JCheckBox applyStationList; - private javax.swing.JCheckBox applyStorageNodes; private javax.swing.JButton cancelButton; private nl.astron.lofar.sas.otbcomponents.StationSelectionPanel coreStationSelectionPanel; private nl.astron.lofar.sas.otbcomponents.StationSelectionPanel europeStationSelectionPanel; - private javax.swing.JTextField inputMSNameMask; private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JLabel labelMSNameMask; private nl.astron.lofar.sas.otbcomponents.StationSelectionPanel remoteStationSelectionPanel; private javax.swing.JButton restoreButton; private javax.swing.JButton saveButton; private javax.swing.JLabel statusLabel; - private nl.astron.lofar.sas.otbcomponents.StorageSelectionPanel storageNodeSelectionPanel; private javax.swing.JTextArea topLabel; // End of variables declaration//GEN-END:variables diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParSetViewPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParSetViewPanel.java index e15103f0e348140c4a86a77c87e452d56607d261..ba8b8a25fd1cb2143ae3f9ea455bc8f7b3f6adfb 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParSetViewPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParSetViewPanel.java @@ -125,23 +125,16 @@ public class ParSetViewPanel extends javax.swing.JPanel implements IViewPanel{ JMenuItem aMenuItem=null; aPopupMenu= new JPopupMenu(); - // For VIC trees - if (itsTreeType.equals("VHtree")) { - // Fill in menu as in the example above - aMenuItem=new JMenuItem("Create ParSet File"); - aMenuItem.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - popupMenuHandler(evt); - } - }); - aMenuItem.setActionCommand("Create ParSet File"); - aPopupMenu.add(aMenuItem); + // Fill in menu as in the example above + aMenuItem=new JMenuItem("Create ParSet File"); + aMenuItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + popupMenuHandler(evt); + } + }); + aMenuItem.setActionCommand("Create ParSet File"); + aPopupMenu.add(aMenuItem); - // For template trees - } else if (itsTreeType.equals("VItemplate")) { - - } - aPopupMenu.setOpaque(true); aPopupMenu.show(aComponent, x, y ); } @@ -296,6 +289,9 @@ public class ParSetViewPanel extends javax.swing.JPanel implements IViewPanel{ if (keyval.length>1) aS=keyval[1]; // String aS=lines[i].replaceFirst(keyval[0]+"=", ""); + // no values available for PIC trees. + if (itsTreeType.equals("hardware")) aS=""; + String [] str={keyval[0],aS}; aModel.addRow(str); } 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 e9eaafdf6b78c76c47894eb695936f1b68856ea4..ca91f998a04efd6c0e22b795b34bfe1a259bf54b 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 @@ -282,6 +282,14 @@ public class ParameterViewPanel extends javax.swing.JPanel implements IViewPanel // enable/disable certain controls } + try { + itsTreeType = OtdbRmi.getRemoteTypes().getTreeType(OtdbRmi.getRemoteOTDB().getTreeInfo(itsNode.treeID(), false).type); + } catch (RemoteException ex) { + String aS="Error getting treetype "+ ex; + logger.error(aS); + LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif"))); + } + if (itsParam != null) { setParamName(itsParam.name); setIndex(String.valueOf(itsParam.index)); @@ -317,6 +325,14 @@ public class ParameterViewPanel extends javax.swing.JPanel implements IViewPanel } else { logger.error("no Param given"); } + if (itsTreeType.equals("hardware")) { + CardPanel.setVisible(false); + this.setButtonsVisible(false); + } else { + CardPanel.setVisible(true); + this.setButtonsVisible(true); + } + } private String getParamName() { @@ -800,6 +816,7 @@ public class ParameterViewPanel extends javax.swing.JPanel implements IViewPanel private jOTDBnode itsNode; private jOTDBparam itsParam; private AccessRights itsAccessRights; + private String itsTreeType=""; // Variables declaration - do not modify//GEN-BEGIN:variables diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.form index 9365d93dc729a38e98e6a117b9f902abd5d2d806..4117b28bf6f6459d63fa65dcc14cdffcf8a12623 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.form @@ -11,7 +11,7 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,3,-54,0,0,4,-119"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,3,113,0,0,5,36"/> </AuxValues> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> @@ -99,23 +99,20 @@ <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> - <Component id="treeDescriptionScrollPane" alignment="0" max="32767" attributes="1"/> - <Component id="descriptionScrollPane" alignment="0" max="32767" attributes="1"/> - <Component id="jPanel10" alignment="0" max="32767" attributes="1"/> - <Group type="102" alignment="0" attributes="0"> - <Component id="jPanel4" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel5" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> - <Component id="jPanel3" alignment="0" pref="1277" max="32767" attributes="1"/> - <Component id="anaBeamConfiguration" alignment="0" max="32767" attributes="1"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jPanel4" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel5" min="-2" pref="175" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <Component id="jPanel10" min="-2" max="-2" attributes="1"/> </Group> + <Component id="descriptionScrollPane" alignment="0" max="32767" attributes="1"/> + <Component id="jPanel3" alignment="0" pref="1277" max="32767" attributes="1"/> + <Component id="anaBeamConfiguration" alignment="0" max="32767" attributes="1"/> + <Component id="treeDescriptionScrollPane" alignment="0" max="32767" attributes="1"/> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace pref="30" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -125,18 +122,24 @@ <Component id="jPanel3" min="-2" pref="180" max="-2" attributes="1"/> <EmptySpace max="-2" attributes="0"/> <Component id="anaBeamConfiguration" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="jPanel5" max="32767" attributes="1"/> - <Component id="jPanel4" alignment="0" max="32767" attributes="1"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jPanel10" min="-2" max="-2" attributes="1"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel5" alignment="0" min="-2" max="-2" attributes="1"/> + <Component id="jPanel4" alignment="0" min="-2" max="-2" attributes="1"/> + </Group> + </Group> </Group> - <EmptySpace pref="39" max="32767" attributes="0"/> - <Component id="jPanel10" min="-2" max="-2" attributes="1"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> <Component id="descriptionScrollPane" min="-2" pref="54" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="treeDescriptionScrollPane" min="-2" pref="68" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> + <Component id="treeDescriptionScrollPane" min="-2" pref="101" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="144" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -209,27 +212,20 @@ <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="0" max="-2" attributes="0"> <Component id="labelNrChannelsPerSubband" max="32767" attributes="1"/> - <Component id="labelMSNameMask" alignment="0" pref="178" max="32767" attributes="1"/> - <Component id="labelNrSlotsInFrame" alignment="0" max="32767" attributes="1"/> + <Component id="labelNrSlotsInFrame" alignment="0" min="-2" max="-2" attributes="1"/> </Group> <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="inputMSNameMask" pref="886" max="32767" attributes="1"/> - <Component id="inputNrSlotsInFrame" alignment="0" pref="886" max="32767" attributes="1"/> - <Component id="inputNrChannelsPerSubband" alignment="0" min="-2" pref="102" max="-2" attributes="1"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="inputNrSlotsInFrame" max="32767" attributes="1"/> + <Component id="inputNrChannelsPerSubband" alignment="0" pref="102" max="32767" attributes="1"/> </Group> - <EmptySpace min="-2" pref="273" max="-2" attributes="0"/> + <EmptySpace pref="22" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="labelMSNameMask" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputMSNameMask" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="labelNrSlotsInFrame" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="inputNrSlotsInFrame" alignment="3" min="-2" max="-2" attributes="0"/> @@ -239,22 +235,11 @@ <Component id="labelNrChannelsPerSubband" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="inputNrChannelsPerSubband" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> - <Component class="javax.swing.JLabel" name="labelMSNameMask"> - <Properties> - <Property name="text" type="java.lang.String" value="MSNameMask:"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="inputMSNameMask"> - <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputMSNameMaskFocusGained"/> - </Events> - </Component> <Component class="javax.swing.JLabel" name="labelNrSlotsInFrame"> <Properties> <Property name="text" type="java.lang.String" value="# Slots In Frame"/> @@ -422,18 +407,14 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="32767" attributes="0"/> <Component id="stationsPanel" min="-2" pref="145" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="storageNodeSelectionPanel" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="308" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="1" max="-2" attributes="0"> - <Component id="storageNodeSelectionPanel" alignment="0" min="0" pref="0" max="32767" attributes="1"/> - <Component id="stationsPanel" alignment="0" pref="176" max="32767" attributes="1"/> - </Group> + <Component id="stationsPanel" min="-2" pref="176" max="-2" attributes="1"/> <EmptySpace pref="12" max="32767" attributes="0"/> </Group> </Group> @@ -504,15 +485,6 @@ </Container> </SubComponents> </Container> - <Component class="nl.astron.lofar.sas.otbcomponents.StorageSelectionPanel" name="storageNodeSelectionPanel"> - <Properties> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> - <TitledBorder title="StorageNode List"/> - </Border> - </Property> - </Properties> - </Component> </SubComponents> </Container> <Container class="javax.swing.JPanel" name="jPanel4"> 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 561926d8fb5f4a41db3ed5f08f23e1706b58171f..ddfa61e6d73bcb2fb895449de180bd022074aa95 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 @@ -115,7 +115,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ this.antennaConfigPanel.setContent(this.itsNode); this.campaignInfoPanel.setMainFrame(this.itsMainFrame,false); - this.storageNodeSelectionPanel.init(); jOTDBparam aParam=null; try { @@ -198,22 +197,16 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ JMenuItem aMenuItem=null; aPopupMenu= new JPopupMenu(); - // For VIC trees - if (itsTreeType.equals("VHtree")) { - // Fill in menu as in the example above - aMenuItem=new JMenuItem("Create ParSet File"); - aMenuItem.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - popupMenuHandler(evt); - } - }); - aMenuItem.setActionCommand("Create ParSet File"); - aPopupMenu.add(aMenuItem); + // Fill in menu as in the example above + aMenuItem=new JMenuItem("Create ParSet File"); + aMenuItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + popupMenuHandler(evt); + } + }); + aMenuItem.setActionCommand("Create ParSet File"); + aPopupMenu.add(aMenuItem); - // For template trees - } else if (itsTreeType.equals("VItemplate")) { - - } aPopupMenu.setOpaque(true); aPopupMenu.show(aComponent, x, y ); @@ -330,15 +323,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ if(parentName.equals("Observation")){ // Observation Specific parameters - if (aKeyName.equals("MSNameMask")) { - inputMSNameMask.setToolTipText(aParam.description); - itsMSNameMask=aNode; - if (isRef && aParam != null) { - inputMSNameMask.setText(aNode.limits + " : " + aParam.limits); - } else { - inputMSNameMask.setText(aNode.limits); - } - } else if (aKeyName.equals("channelsPerSubband")) { + if (aKeyName.equals("channelsPerSubband")) { inputNrChannelsPerSubband.setToolTipText(aParam.description); itsChannelsPerSubband=aNode; if (isRef && aParam != null) { @@ -475,10 +460,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ // Observation VirtualInstrument parameters if (aKeyName.equals("stationList")) { - } else if (aKeyName.equals("storageNodeList")) { - this.storageNodeSelectionPanel.setToolTipText(aParam.description); - this.itsStorageNodeList = aNode; - setStorageNodeLists(aNode.limits); } } } @@ -568,7 +549,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ setStationList(antennaConfigPanel.getStationList()); // Observation Specific parameters - inputMSNameMask.setText(itsMSNameMask.limits); inputNrChannelsPerSubband.setText(itsChannelsPerSubband.limits); inputNrSlotsInFrame.setText(itsNrSlotsInFrame.limits); inputDescription.setText(""); @@ -625,10 +605,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ fillBeamformerStationList(); - //Virtual Instrument storageNodeList - setStorageNodeLists(itsStorageNodeList.limits); - - if (beamConfigurationPanel.getTableModel().getRowCount() == 8) { this.addBeamButton.setEnabled(false); } else { @@ -710,7 +686,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ UserAccount userAccount = itsMainFrame.getUserAccount(); // for now: - setAllEnabled(true); + setAllEnabled(true); if(userAccount.isAdministrator()) { // enable/disable certain controls @@ -817,7 +793,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ */ public void setAllEnabled(boolean enabled) { this.inputDescription.setEnabled(enabled); - this.inputMSNameMask.setEnabled(enabled); this.inputNrChannelsPerSubband.setEnabled(enabled); this.inputTreeDescription.setEnabled(enabled); } @@ -1116,19 +1091,9 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ aDefaultBFNode.instances=bforms; saveNode(aDefaultBFNode); - // Virtual Instrument storageNodes - if (this.itsStorageNodeList != null && !getUsedStorageNodes().equals(itsStorageNodeList.limits)) { - itsStorageNodeList.limits = getUsedStorageNodes(); - saveNode(itsStorageNodeList); - } - // Generic Observation - if (itsMSNameMask != null && !this.inputMSNameMask.getText().equals(itsMSNameMask.limits)) { - itsMSNameMask.limits = inputMSNameMask.getText(); - saveNode(itsMSNameMask); - } if (itsChannelsPerSubband != null && !inputNrChannelsPerSubband.getText().equals(itsChannelsPerSubband.limits)) { itsChannelsPerSubband.limits = inputNrChannelsPerSubband.getText(); saveNode(itsChannelsPerSubband); @@ -1209,45 +1174,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ } } - /** returns a [a,b,c] string that contain all used stations - * - * @return a List with all used stations - */ - public String getUsedStorageNodes() { - this.itsUsedStorageNodes = this.storageNodeSelectionPanel.getUsedStorageNodeList(); - String aS= "["; - boolean first=true; - for (int i=0; i< itsUsedStorageNodes.size();i++) { - if (first) { - first=false; - aS+=itsUsedStorageNodes.get(i); - } else { - aS+=","+itsUsedStorageNodes.get(i); - } - } - aS+="]"; - return aS; - } - - private void setStorageNodeLists(String nodes) { - itsUsedStorageNodes.clear(); - - if (nodes.startsWith("[")) { - nodes = nodes.substring(1, nodes.length()); - } - if (nodes.endsWith("]")) { - nodes = nodes.substring(0, nodes.length() - 1); - } - if (!nodes.equals("")) { - String[] aS = nodes.split("\\,"); - for (int i = 0; i < aS.length; i++) { - itsUsedStorageNodes.add(aS[i]); - } - this.storageNodeSelectionPanel.setUsedStorageNodeList(itsUsedStorageNodes); - } - } - - private void deleteBeamformer() { String selection = itsBeamformerConfigurationTableModel.getSelection(beamformerConfigurationPanel.getSelectedRow()); if (selection== null) { @@ -1716,8 +1642,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ descriptionScrollPane = new javax.swing.JScrollPane(); inputDescription = new javax.swing.JTextArea(); jPanel10 = new javax.swing.JPanel(); - labelMSNameMask = new javax.swing.JLabel(); - inputMSNameMask = new javax.swing.JTextField(); labelNrSlotsInFrame = new javax.swing.JLabel(); inputNrSlotsInFrame = new javax.swing.JTextField(); inputNrChannelsPerSubband = new javax.swing.JTextField(); @@ -1735,7 +1659,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ stationList = new javax.swing.JList(); stationsModPanel = new javax.swing.JPanel(); stationsButtonPanel = new javax.swing.JPanel(); - storageNodeSelectionPanel = new nl.astron.lofar.sas.otbcomponents.StorageSelectionPanel(); jPanel4 = new javax.swing.JPanel(); beamformerConfigurationPanel = new nl.astron.lofar.sas.otbcomponents.TablePanel(); jLabel2 = new javax.swing.JLabel(); @@ -1798,14 +1721,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Generic Observation Input", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N - labelMSNameMask.setText("MSNameMask:"); - - inputMSNameMask.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusGained(java.awt.event.FocusEvent evt) { - inputMSNameMaskFocusGained(evt); - } - }); - labelNrSlotsInFrame.setText("# Slots In Frame"); inputNrSlotsInFrame.addFocusListener(new java.awt.event.FocusAdapter() { @@ -1830,30 +1745,23 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ .add(jPanel10Layout.createSequentialGroup() .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(labelNrChannelsPerSubband, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(labelMSNameMask, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE) - .add(labelNrSlotsInFrame, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .add(labelNrSlotsInFrame)) .add(18, 18, 18) - .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(inputMSNameMask, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 886, Short.MAX_VALUE) - .add(inputNrSlotsInFrame, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 886, Short.MAX_VALUE) - .add(inputNrChannelsPerSubband, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 102, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(273, 273, 273)) + .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) + .add(inputNrSlotsInFrame) + .add(inputNrChannelsPerSubband, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)) + .addContainerGap(22, Short.MAX_VALUE)) ); jPanel10Layout.setVerticalGroup( jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel10Layout.createSequentialGroup() - .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(labelMSNameMask) - .add(inputMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(labelNrSlotsInFrame) .add(inputNrSlotsInFrame, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(12, 12, 12) .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(labelNrChannelsPerSubband) - .add(inputNrChannelsPerSubband, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .add(inputNrChannelsPerSubband, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) ); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Digital Beam Configuration", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N @@ -1971,8 +1879,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ stationsPanel.add(stationsModPanel, java.awt.BorderLayout.SOUTH); - storageNodeSelectionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("StorageNode List")); - org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( @@ -1980,15 +1886,12 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ .add(jPanel5Layout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(stationsPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 145, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(18, 18, 18) - .add(storageNodeSelectionPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(308, 308, 308)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() - .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) - .add(org.jdesktop.layout.GroupLayout.LEADING, storageNodeSelectionPanel, 0, 0, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.LEADING, stationsPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)) + .add(stationsPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(12, Short.MAX_VALUE)) ); @@ -2162,19 +2065,18 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() - .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) - .add(org.jdesktop.layout.GroupLayout.LEADING, treeDescriptionScrollPane) - .add(org.jdesktop.layout.GroupLayout.LEADING, descriptionScrollPane) - .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2Layout.createSequentialGroup() - .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) - .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1277, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.LEADING, anaBeamConfiguration, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - .addContainerGap()) + .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) + .add(jPanel2Layout.createSequentialGroup() + .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 175, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(30, 30, 30) + .add(jPanel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(descriptionScrollPane) + .add(jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1277, Short.MAX_VALUE) + .add(anaBeamConfiguration, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(treeDescriptionScrollPane)) + .addContainerGap(30, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -2182,17 +2084,20 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 180, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(anaBeamConfiguration, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(11, 11, 11) - .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 39, Short.MAX_VALUE) - .add(jPanel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel2Layout.createSequentialGroup() + .add(18, 18, 18) + .add(jPanel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jPanel2Layout.createSequentialGroup() + .add(11, 11, 11) + .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) .add(descriptionScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(treeDescriptionScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 68, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) + .add(treeDescriptionScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 101, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(144, 144, 144)) ); jScrollPane1.setViewportView(jPanel2); @@ -2230,10 +2135,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ copyBeamButton.setEnabled(true); }//GEN-LAST:event_beamConfigurationPanelMouseClicked - private void inputMSNameMaskFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputMSNameMaskFocusGained - changeDescription(itsMSNameMask); - }//GEN-LAST:event_inputMSNameMaskFocusGained - private void buttonPanel1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPanel1ActionPerformed if(evt.getActionCommand().equals("Apply")) { itsMainFrame.setHourglassCursor(); @@ -2368,7 +2269,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ private BeamFileDialog beamFileDialog = null; // Observation Specific parameters - private jOTDBnode itsMSNameMask=null; private jOTDBnode itsChannelsPerSubband=null; private jOTDBnode itsNrSlotsInFrame=null; private jOTDBnode itsNrBeams=null; @@ -2409,7 +2309,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ // Observation Virtual Instrument parameters private jOTDBnode itsStationList=null; - private jOTDBnode itsStorageNodeList=null; // keeps lists of available (unused) and all used stations for Beamformer creation private Vector<String> itsAvailableBeamformStations = new Vector<String>(); @@ -2448,7 +2347,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ private javax.swing.JButton editAnaBeamButton; private javax.swing.JButton editBeamButton; private javax.swing.JTextArea inputDescription; - private javax.swing.JTextField inputMSNameMask; private javax.swing.JTextField inputNrChannelsPerSubband; private javax.swing.JTextField inputNrSlotsInFrame; private javax.swing.JTextArea inputTreeDescription; @@ -2464,7 +2362,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ private javax.swing.JPanel jPanel5; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTabbedPane jTabbedPane1; - private javax.swing.JLabel labelMSNameMask; private javax.swing.JLabel labelNrChannelsPerSubband; private javax.swing.JLabel labelNrSlotsInFrame; private javax.swing.JButton loadAnaBeamsButton; @@ -2474,7 +2371,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ private javax.swing.JPanel stationsModPanel; private javax.swing.JPanel stationsPanel; private javax.swing.JScrollPane stationsScrollPane; - private nl.astron.lofar.sas.otbcomponents.StorageSelectionPanel storageNodeSelectionPanel; private javax.swing.JScrollPane treeDescriptionScrollPane; // End of variables declaration//GEN-END:variables diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.java index d284ad7659341f97b6afcf9c1703d011e9bba45b..9f9c15e3c125674251adcd4ebf1f482b28ead8d4 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.java @@ -151,6 +151,35 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ this.retrieveAndDisplayChildDataForNode(aNode); } } + + //we also need the Output_ nodes from the Dataproducts here + Vector OUchilds = OtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(),"%Output_%"); + + // get all the params per child + Enumeration eOU = OUchilds.elements(); + while( eOU.hasMoreElements() ) { + aParam=null; + + jOTDBnode aNode = (jOTDBnode)eOU.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. + if (aNode.leaf) { + aParam = OtdbRmi.getRemoteMaintenance().getParam(aNode); + setField(itsNode,aParam,aNode); + }else if (LofarUtils.keyName(aNode.name).equals("Output_Beamformed")) { + this.retrieveAndDisplayChildDataForNode(aNode); + }else if (LofarUtils.keyName(aNode.name).equals("Output_CoherentStokes")) { + this.retrieveAndDisplayChildDataForNode(aNode); + }else if (LofarUtils.keyName(aNode.name).equals("Output_Correlated")) { + this.retrieveAndDisplayChildDataForNode(aNode); + }else if (LofarUtils.keyName(aNode.name).equals("Output_Filtered")) { + this.retrieveAndDisplayChildDataForNode(aNode); + }else if (LofarUtils.keyName(aNode.name).equals("Output_IncoherentStokes")) { + this.retrieveAndDisplayChildDataForNode(aNode); + } + } + } catch (RemoteException ex) { String aS="Error during getComponentParam: "+ ex; logger.error(aS); @@ -514,9 +543,29 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ } } inputCorrectBandPass.setSelected(aSelection); - } else if (aKeyName.equals("outputCorrelatedData")) { - inputOutputCorrelatedData.setToolTipText(aParam.description); - itsOutputCorrelatedData=aNode; + } else if (aKeyName.equals("nrPencils")) { + itsNrPencils=aNode; + } + } else if(parentName.contains("Pencil") && !parentName.equals("PencilInfo")){ + // Observation Pencil parameters + if (aKeyName.equals("angle1")) { + if (isRef && aParam != null) { + itsAngle1.add(aNode.limits + " : " + aParam.limits); + } else { + itsAngle1.add(aNode.limits); + } + itsCoordTypes.add("rad"); + } else if (aKeyName.equals("angle2")) { + if (isRef && aParam != null) { + itsAngle2.add(aNode.limits + " : " + aParam.limits); + } else { + itsAngle2.add(aNode.limits); + } + } + } else if (parentName.equals("Output_Beamformed")) { + if (aKeyName.equals("enabled")) { + inputOutputBeamFormedData.setToolTipText(aParam.description); + itsOutputBeamFormedData=aNode; boolean aSelection = false; if (isRef && aParam != null) { if (aParam.limits.equals("true")||aParam.limits.equals("TRUE")) { @@ -527,11 +576,13 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ aSelection = true; } } - inputOutputCorrelatedData.setSelected(aSelection); - inputIntegrationTime.setEnabled(aSelection); - } else if (aKeyName.equals("outputFilteredData")) { - inputOutputFilteredData.setToolTipText(aParam.description); - itsOutputFilteredData=aNode; + inputOutputBeamFormedData.setSelected(aSelection); + checkSettings(); + } + } else if (parentName.equals("Output_Correlated")) { + if (aKeyName.equals("enabled")) { + inputOutputCorrelatedData.setToolTipText(aParam.description); + itsOutputCorrelatedData=aNode; boolean aSelection = false; if (isRef && aParam != null) { if (aParam.limits.equals("true")||aParam.limits.equals("TRUE")) { @@ -542,10 +593,14 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ aSelection = true; } } - inputOutputFilteredData.setSelected(aSelection); - } else if (aKeyName.equals("outputBeamFormedData")) { - inputOutputBeamFormedData.setToolTipText(aParam.description); - itsOutputBeamFormedData=aNode; + inputOutputCorrelatedData.setSelected(aSelection); + inputIntegrationTime.setEnabled(aSelection); + checkSettings(); + } + } else if (parentName.equals("Output_Filtered")) { + if (aKeyName.equals("enabled")) { + inputOutputFilteredData.setToolTipText(aParam.description); + itsOutputFilteredData=aNode; boolean aSelection = false; if (isRef && aParam != null) { if (aParam.limits.equals("true")||aParam.limits.equals("TRUE")) { @@ -556,9 +611,11 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ aSelection = true; } } - inputOutputBeamFormedData.setSelected(aSelection); + inputOutputFilteredData.setSelected(aSelection); checkSettings(); - } else if (aKeyName.equals("outputCoherentStokes")) { + } + } else if (parentName.equals("Output_CoherentStokes")) { + if (aKeyName.equals("enabled")) { inputOutputCoherentStokes.setToolTipText(aParam.description); itsOutputCoherentStokes=aNode; boolean aSelection = false; @@ -573,8 +630,9 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ } inputOutputCoherentStokes.setSelected(aSelection); checkSettings(); - - } else if (aKeyName.equals("outputIncoherentStokes")) { + } + } else if (parentName.equals("Output_IncoherentStokes")) { + if (aKeyName.equals("enabled")) { inputOutputIncoherentStokes.setToolTipText(aParam.description); itsOutputIncoherentStokes=aNode; boolean aSelection = false; @@ -589,26 +647,8 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ } inputOutputIncoherentStokes.setSelected(aSelection); checkSettings(); - } else if (aKeyName.equals("nrPencils")) { - itsNrPencils=aNode; } - } else if(parentName.contains("Pencil") && !parentName.equals("PencilInfo")){ - // Observation Pencil parameters - if (aKeyName.equals("angle1")) { - if (isRef && aParam != null) { - itsAngle1.add(aNode.limits + " : " + aParam.limits); - } else { - itsAngle1.add(aNode.limits); - } - itsCoordTypes.add("rad"); - } else if (aKeyName.equals("angle2")) { - if (isRef && aParam != null) { - itsAngle2.add(aNode.limits + " : " + aParam.limits); - } else { - itsAngle2.add(aNode.limits); - } - } - } + } } // check all settings to make a choice about enabled/disables fields 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 e70346fc06f44471574943d3f2e5504592c8d9a7..9ea11798d482868c9b7d9f7806525d2431be52b4 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 @@ -13,8 +13,6 @@ extern "C" 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_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); 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..0fd33ccc07f3c4002b9d9c62d11c7cd1b62757aa 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 @@ -1,96 +1,88 @@ -//# jTreeValue.java: Interface for access to the tree (KVT) values -//# -//# Copyright (C) 2002-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 -//# - -package nl.astron.lofar.sas.otb.jotdb3; - - -import java.rmi.RemoteException; -import java.util.Vector; - -public class jTreeValue implements jTreeValueInterface -{ - - public String itsErrorMsg; - public int itsTreeID; - private String itsName = ""; - - public jTreeValue (String ext) - { - itsName=ext; - itsErrorMsg=""; - itsTreeID=0; - } - - public void setTreeID(int aTreeID) { - itsTreeID=aTreeID; - } - - public int TreeID() { - return itsTreeID; - } - - // 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. - public native boolean addKVT( String key, String value, String time) throws RemoteException; - 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. - 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; - public native Vector<jOTDBvalue> getBrokenHardware () throws RemoteException; - - //# SHM queries - // With searchInPeriod a list of all valuechanges in the OTDB tree can - // be retrieved from the database. - // By chosing the topItem right one node or a sub tree of the whole tree - // (you probably don't want this!) can be retrieved. - // When the endDate is not specified all value changes from beginDate - // till 'now' are retrieved, otherwise the selection is limited to - // [beginDate..endDate>. - public native Vector<jOTDBvalue> searchInPeriod (int topNode, - int depth, - String beginDate, - String endDate, - boolean mostRecentlyOnly) throws RemoteException; - public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate, - String endDate) throws RemoteException; - public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate) throws RemoteException; - public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth) throws RemoteException; - - //# 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 - // this function. - // TBW: Is this realy what SAS needs??? - public native Vector<jOTDBvalue> getSchedulableItems (int topNode) throws RemoteException; - public native Vector<jOTDBvalue> getSchedulableItems () throws RemoteException; - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public String errorMsg() { - return itsErrorMsg; - } -} +//# jTreeValue.java: Interface for access to the tree (KVT) values +//# +//# Copyright (C) 2002-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 +//# + +package nl.astron.lofar.sas.otb.jotdb3; + + +import java.rmi.RemoteException; +import java.util.Vector; + +public class jTreeValue implements jTreeValueInterface +{ + + public String itsErrorMsg; + public int itsTreeID; + private String itsName = ""; + + public jTreeValue (String ext) + { + itsName=ext; + itsErrorMsg=""; + itsTreeID=0; + } + + public void setTreeID(int aTreeID) { + itsTreeID=aTreeID; + } + + // 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. + public native boolean addKVT( String key, String value, String time) throws RemoteException; + 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. + public native boolean addKVTlist(Vector<jOTDBvalue> aValueList) throws RemoteException; + // public native boolean addKVTparamSet(jParamterSet aPS) throws Exception; + + //# SHM queries + // With searchInPeriod a list of all valuechanges in the OTDB tree can + // be retrieved from the database. + // By chosing the topItem right one node or a sub tree of the whole tree + // (you probably don't want this!) can be retrieved. + // When the endDate is not specified all value changes from beginDate + // till 'now' are retrieved, otherwise the selection is limited to + // [beginDate..endDate>. + public native Vector<jOTDBvalue> searchInPeriod (int topNode, + int depth, + String beginDate, + String endDate, + boolean mostRecentlyOnly) throws RemoteException; + public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate, + String endDate) throws RemoteException; + public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate) throws RemoteException; + public native Vector<jOTDBvalue> searchInPeriod (int topNode, int depth) throws RemoteException; + + //# 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 + // this function. + // TBW: Is this realy what SAS needs??? + public native Vector<jOTDBvalue> getSchedulableItems (int topNode) throws RemoteException; + public native Vector<jOTDBvalue> getSchedulableItems () throws RemoteException; + + // Whenever an error occurs in one the OTDB functions the message can + // be retrieved with this function. + 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..ffd651602bbe0db8c0a66cefe1d401daad2535f6 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 @@ -32,7 +32,6 @@ public interface jTreeValueInterface extends Remote public static final String SERVICENAME = "jTreeValue"; public void setTreeID(int aTreeID) throws RemoteException; - public int TreeID() throws RemoteException; // PVSS will continuously add value-changes to the offline PIC. // There two ways PVSS can do this. @@ -46,13 +45,6 @@ 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; - public Vector<jOTDBvalue> getBrokenHardware () throws RemoteException; - - - //# SHM queries // With searchInPeriod a list of all valuechanges in the OTDB tree can // be retrieved from the database. 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 0bf5491acef4ec2aafdda0b2a1fa1fb86c1235e8..78b0fccc31a7994412b0d592b9bc310338cb028f 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,89 +146,6 @@ 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/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb3_jTreeValue_getBrokenHardware__Ljava_lang_String_2 (JNIEnv *env, jobject jTreeValue, jstring atTime ) { - - // create the connection with the c++ TreeVal - setTreeValConnection(env,jTreeValue); - - - - - const char* at = env->GetStringUTFChars (atTime, 0); - const string time (at); - - - const ptime ts (time_from_string (time)); - jobject valueVector; - - try { - vector<OTDBvalue> valueList = ((TreeValue*)getCObjectPtr(env,jTreeValue,"_TreeValue"))->getBrokenHardware (ts); - 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 (atTime, at); - - setErrorMsg(env,jTreeValue); - } catch (exception &ex) { - cout << "Exception during treeValue::getBrokenHardware(" << ts << ") "<< ex.what() << endl; - - env->ReleaseStringUTFChars (atTime, at); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - - } - return valueVector; -} - -/* - * 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 *env, jobject jTreeValue) { - - // create the connection with the c++ TreeVal - setTreeValConnection(env,jTreeValue); - - jobject valueVector; - - try { - vector<OTDBvalue> valueList = ((TreeValue*)getCObjectPtr(env,jTreeValue,"_TreeValue"))->getBrokenHardware (); - 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)); - - setErrorMsg(env,jTreeValue); - } catch (exception &ex) { - cout << "Exception during treeValue::getBrokenHardware() "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - - } - return valueVector; -} - /* * Class: nl_astron_lofar_sas_otb_jotdb3_jTreeValue * Method: searchInPeriod diff --git a/SAS/OTDB/sql/getSchedulerInfo_func.sql b/SAS/OTDB/sql/getSchedulerInfo_func.sql index 3012ebacdc84f8e97eab138974fa05c7caa4e888..d7e7c233c12b0f368181414667a637dc5fb99c87 100644 --- a/SAS/OTDB/sql/getSchedulerInfo_func.sql +++ b/SAS/OTDB/sql/getSchedulerInfo_func.sql @@ -36,6 +36,7 @@ CREATE TYPE schedulerInfo AS ( predMaxTimeDif VARCHAR(10), predMinTimeDif VARCHAR(10), priority FLOAT, + reason VARCHAR(40), referenceFrame INT4, reservation INT4, storageSelectionMode INT4, @@ -68,6 +69,7 @@ CREATE OR REPLACE FUNCTION getSchedulerInfo(INT4) FETCH fieldList INTO vRecord.predMaxTimeDif; FETCH fieldList INTO vRecord.predMinTimeDif; FETCH fieldList INTO vRecord.priority; + FETCH fieldList INTO vRecord.reason; FETCH fieldList INTO vRecord.referenceFrame; FETCH fieldList INTO vRecord.reservation; FETCH fieldList INTO vRecord.storageSelectionMode; diff --git a/SAS/OTDB/sql/saveSchedulerInfo_func.sql b/SAS/OTDB/sql/saveSchedulerInfo_func.sql index 76e3a426f2e8e5603bae869d8f547955341b1759..a69cbd15f6194fb90783d3f6ffb112171d5d3302 100644 --- a/SAS/OTDB/sql/saveSchedulerInfo_func.sql +++ b/SAS/OTDB/sql/saveSchedulerInfo_func.sql @@ -34,7 +34,7 @@ -- -- Types: none -- -CREATE OR REPLACE FUNCTION saveSchedulerInfo(INT4, INT4, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT) +CREATE OR REPLACE FUNCTION saveSchedulerInfo(INT4, INT4, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT) RETURNS BOOLEAN AS $$ DECLARE TThierarchy CONSTANT INT2 := 30; @@ -119,8 +119,12 @@ CREATE OR REPLACE FUNCTION saveSchedulerInfo(INT4, INT4, TEXT, TEXT, TEXT, TEXT, UPDATE VIChierarchy SET value=$23 WHERE treeID=$2 AND nodeID=vRecord.nodeID; FETCH fieldList INTO vRecord; UPDATE VIChierarchy SET value=$24 WHERE treeID=$2 AND nodeID=vRecord.nodeID; + FETCH fieldList INTO vRecord; + UPDATE VIChierarchy SET value=$25 WHERE treeID=$2 AND nodeID=vRecord.nodeID; -- FETCH fieldList INTO vRecord; --- UPDATE VIChierarchy SET value=$25 WHERE treeID=$2 AND nodeID=vRecord.nodeID; +-- UPDATE VIChierarchy SET value=$26 WHERE treeID=$2 AND nodeID=vRecord.nodeID; +-- FETCH fieldList INTO vRecord; +-- UPDATE VIChierarchy SET value=$27 WHERE treeID=$2 AND nodeID=vRecord.nodeID; -- FETCH fieldList INTO vRecord; -- UPDATE VIChierarchy SET value=$26 WHERE treeID=$2 AND nodeID=vRecord.nodeID; -- FETCH fieldList INTO vRecord; diff --git a/SAS/OTDB/test/tPICvalue.cc b/SAS/OTDB/test/tPICvalue.cc index 27b08d76d8969b5f67532f665439944741a91058..7cd6167c98a6fdaacc8f14e821b597d3fd3d12fe 100644 --- a/SAS/OTDB/test/tPICvalue.cc +++ b/SAS/OTDB/test/tPICvalue.cc @@ -95,10 +95,10 @@ void showNodeList(const vector<OTDBnode>& nodes) { void showValueList(const vector<OTDBvalue>& items) { - cout << "name |value |time" << endl; - cout << "-----------------------------------------------------------------+------+--------------------" << endl; + cout << "name |value |time" << endl; + cout << "-----------------------------------+------+--------------------" << endl; for (uint32 i = 0; i < items.size(); ++i) { - string row(formatString("%-65.65s|%-7.7s|%s", + 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())); @@ -236,55 +236,45 @@ int main (int argc, char* argv[]) { LOG_INFO("ParameterSet added, going to query it"); LOG_INFO ("Searching Node: LOFAR.PIC.Rack1.status"); - vector<OTDBvalue> valueList; vector<OTDBnode> nodeList=tm.getItemList(treeID, "LOFAR.PIC.Rack1.status"); showNodeList(nodeList); - if (!nodeList.empty()) { - nodeIDType nodeID = nodeList[nodeList.size()-1].nodeID(); - LOG_INFO_STR("Parameter ID = : " << nodeID); - LOG_INFO_STR("Getting all the values back"); - valueList = tv.searchInPeriod(nodeID,0); - ASSERTSTR(valueList.size(), "No values of PIC item found"); - showValueList(valueList); - - LOG_INFO_STR("Getting all the values back from 2005 on"); - valueList = tv.searchInPeriod(nodeID,0, - time_from_string("2005-01-01")); - ASSERTSTR(valueList.size(), "No values of PIC item found"); - showValueList(valueList); - - LOG_INFO_STR("Getting all the values back till 2005"); - valueList = tv.searchInPeriod(nodeID,0, - ptime(min_date_time), - time_from_string("2005-01-01")); - ASSERTSTR(valueList.size(), "No values of PIC item found"); - showValueList(valueList); - - LOG_INFO_STR("Getting only the latest value back"); - valueList = tv.searchInPeriod(nodeID,0, - ptime(min_date_time), - ptime(max_date_time), - true); - ASSERTSTR(valueList.size(), "No values of PIC item found"); - showValueList(valueList); - - LOG_INFO_STR("Getting latest values from whole tree"); - valueList = tv.searchInPeriod(topNode.nodeID(),3, - ptime(min_date_time), - ptime(max_date_time), - true); - ASSERTSTR(valueList.size(), "No values of PIC item found"); - showValueList(valueList); - } + nodeIDType nodeID = nodeList[nodeList.size()-1].nodeID(); + LOG_INFO_STR("Parameter ID = : " << nodeID); + LOG_INFO_STR("Getting all the values back"); + vector<OTDBvalue> valueList = tv.searchInPeriod(nodeID,0); + ASSERTSTR(valueList.size(), "No values of PIC item found"); + showValueList(valueList); + + LOG_INFO_STR("Getting all the values back from 2005 on"); + valueList = tv.searchInPeriod(nodeID,0, + time_from_string("2005-01-01")); + ASSERTSTR(valueList.size(), "No values of PIC item found"); + showValueList(valueList); - LOG_INFO_STR("Getting broken hardware (now)"); - valueList = tv.getBrokenHardware(); + LOG_INFO_STR("Getting all the values back till 2005"); + valueList = tv.searchInPeriod(nodeID,0, + ptime(min_date_time), + time_from_string("2005-01-01")); + ASSERTSTR(valueList.size(), "No values of PIC item found"); showValueList(valueList); - LOG_INFO_STR("Getting broken hardware (2010-05-26 07:30:00)"); - valueList = tv.getBrokenHardware(time_from_string("2010-05-26 07:30:00")); + LOG_INFO_STR("Getting only the latest value back"); + valueList = tv.searchInPeriod(nodeID,0, + ptime(min_date_time), + ptime(max_date_time), + true); + ASSERTSTR(valueList.size(), "No values of PIC item found"); showValueList(valueList); + + LOG_INFO_STR("Getting latest values from whole tree"); + valueList = tv.searchInPeriod(topNode.nodeID(),3, + ptime(min_date_time), + ptime(max_date_time), + true); + ASSERTSTR(valueList.size(), "No values of PIC item found"); + showValueList(valueList); + } catch (std::exception& ex) { LOG_FATAL_STR("Unexpected exception: " << ex.what());