Newer
Older
* seqIDataMgr.cpp
*
* Created on: Mar 18, 2022
* Author: Fulvio Laudisio
*/
#include <pthread.h>
#include <ctime>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "seqIDataMgr.hpp"
#include "base64.h" // from64tobits
SeqDataMgr * SeqDataMgr::m_pSeqDataMgr = NULL;
double gDrotRef = 0.;
int gIndiPort = 0;
std::string gIndiAddress;
SeqDataMgr::SeqDataMgr(Ltcs::IifServiceWorkerInterfacePtr &_iif, Ice::PropertiesPtr props):
m_props(props),
sashaSave(IProperty::Switch, "sasha_save", "enable_save"),
sashaObjName(IProperty::Text, "sasha", "OBJNAME"),
sashaNumSeqs(IProperty::Number, "sasha", "num_seqs"),
sashaSeqNum(IProperty::Number, "sasha", "seq_num"),
sashaAcquire(IProperty::Number, "sasha", "acquire"),
sashaNumCoadds(IProperty::Number, "sasha", "num_coadds"),
sashaNumDrops(IProperty::Number, "sasha", "num_drops"),
sashaNumReads(IProperty::Number, "sasha", "num_reads"),
sashaNumGroups(IProperty::Number, "sasha", "num_groups"),
sashaNumResets(IProperty::Number, "sasha", "num_resets"),
sashaReadout(IProperty::Text, "sasha", "def_readout_region_name"),
sashaReadoutRegion(IProperty::Text, "sasha", "readout_region"),
sashaBlob(IProperty::Unknown, "sasha_save", "save_image"),
sashaLargestFileNumber(IProperty::Number, "sasha_save", "largest_filenum"),
sashaExposeProp(IProperty::Switch, "sasha", "start_acquire"),
sharknirTemperatureDetector(IProperty::Unknown, "sharknir_temp", "sensor"),
sharknirTemperatureColdFinger(IProperty::Unknown, "sharknir_temp", "sensor"),
sharknirTemperatureInnerVessel(IProperty::Unknown, "sharknir_temp", "sensor"),
sharknirTemperatureOuterVessel(IProperty::Unknown, "sharknir_temp", "sensor"),
sashaPressure(IProperty::Unknown, "sharknir_pres1", "sensor"),
sashaStop(IProperty::Switch, "sasha", "stop"),
sashaFrequencyMode(IProperty::Text, "sasha", "def_mode_name"),
sashaIntegrationTime(IProperty::Text, "sasha", "int_time"),
sashaExposureTime(IProperty::Text, "sasha", "exp_time"),
sashaEnableCont(IProperty::Switch, "sasha" , "enable_cont" )
{
U6_LLOG(__FUNCTION__);
m_iif = _iif;
SeqDataMgr::m_pSeqDataMgr = this;
su::getValue<double>(m_props->getProperty("Shins.Tracking.Adc.DrotRefAngle"), gDrotRef);
gIndiAddress = m_props->getProperty("Shins.SashaWs.IP");
su::getValue<int>(m_props->getProperty("Shins.SashaWs.IndiPort"), gIndiPort);
su::SetDataSaveDirectory(m_props->getProperty("Shins.DataMgr.DataSaveDirectory"));
U9_LLOG(m_props->getProperty("Shins.DataMgr.DataSaveDirectory"));
// sashaBlob.add(IElement("file"));
// sashaBlob.setBLOBEnable(IProperty::Never);
// sashaNumCoadds.add(IElement("value"));
// sashaNumCoadds["value"].setValue<int>(1);
m_sashaProps.insert(std::pair<std::string, IProperty & >("NDIT", sashaNumSeqs));
m_sashaProps.insert(std::pair<std::string, IProperty & >("NDITINDEX", sashaSeqNum));
m_sashaProps.insert(std::pair<std::string, IProperty & >("READOUT", sashaReadout));
m_sashaProps.insert(std::pair<std::string, IProperty & >("READOUTREGION", sashaReadoutRegion));
m_sashaProps.insert(std::pair<std::string, IProperty & >("SAVE", sashaSave));
m_sashaProps.insert(std::pair<std::string, IProperty & >("OBJECTNAME", sashaObjName));
m_sashaProps.insert(std::pair<std::string, IProperty & >("ACQUIRE", sashaAcquire));
m_sashaProps.insert(std::pair<std::string, IProperty & >("NCOADDS", sashaNumCoadds));
m_sashaProps.insert(std::pair<std::string, IProperty & >("NDROPS", sashaNumDrops));
m_sashaProps.insert(std::pair<std::string, IProperty & >("NGROUPS", sashaNumGroups));
m_sashaProps.insert(std::pair<std::string, IProperty & >("NREADS", sashaNumReads));
m_sashaProps.insert(std::pair<std::string, IProperty & >("NRESETS", sashaNumResets));
m_sashaProps.insert(std::pair<std::string, IProperty & >("EXPOSE", sashaExposeProp));
m_sashaProps.insert(std::pair<std::string, IProperty & >("STOP", sashaStop));
m_sashaProps.insert(std::pair<std::string, IProperty & >("FREQUENCY", sashaFrequencyMode));
m_sashaProps.insert(std::pair<std::string, IProperty & >("CONTINUOUS", sashaEnableCont));
m_sashaProps.insert(std::pair<std::string, IProperty & >("EXPTIME", sashaExposureTime));
m_sashaProps.insert(std::pair<std::string, IProperty & >("INTTIME", sashaIntegrationTime));
m_sashaProps.insert(std::pair<std::string, IProperty & >("LARGESTFILENUM", sashaLargestFileNumber));
m_sashaProps.insert(std::pair<std::string, IProperty & >("SENSORTEMPDET", sharknirTemperatureDetector));
m_sashaProps.insert(std::pair<std::string, IProperty & >("SENSORTEMPCF", sharknirTemperatureColdFinger));
m_sashaProps.insert(std::pair<std::string, IProperty & >("SENSORTEMPIV", sharknirTemperatureInnerVessel));
m_sashaProps.insert(std::pair<std::string, IProperty & >("SENSORTEMPOV", sharknirTemperatureOuterVessel));
m_sashaProps.insert(std::pair<std::string, IProperty & >("SENSORPRES1", sashaPressure));
m_sashaPropsSet["NDIT"] = true;
m_sashaPropsSet["NDITINDEX"] = true;
m_sashaPropsSet["READOUT"] = true;
m_sashaPropsSet["SAVE"] = true;
m_sashaPropsSet["OBJECTNAME"] = true;
m_sashaPropsSet["NCOADDS"] = true;
m_sashaPropsSet["NDROPS"] = true;
m_sashaPropsSet["NGROUPS"] = true;
m_sashaPropsSet["NREADS"] = true;
m_sashaPropsSet["NRESETS"] = true;
m_sashaPropsSet["EXPOSE"] = true;
m_sashaPropsSet["FREQUENCY"] = true;
m_sashaPropsSet["STOP"] = true;
m_sashaPropsSet["CONTINUOUS"] = true;
m_sashaPropsSet["INTTIME"] = true;
m_sashaPropsSet["EXPTIME"] = true;
m_sashaTiming["Center"] = 2.6751f;
m_sashaTiming["Bottom"] = 1.0719f;
m_sashaTiming["Top"] = 1.0719f;
m_sashaTiming["256x256"] = 0.2745f;
m_sashaTiming["128x128"] = 0.0718f;
m_sashaTiming["64x64"] = 0.0190;
m_sashaTiming["32x32"] = 0.0054f;
m_sashaTiming["1000x1000"] = 4.0481;
m_sashaTiming["coro_stripe"] = 0.1283;
m_sashaTiming["PD_wollaston_stripe_small"] = 0.1701;
m_sashaTiming["PD_wollaston_stripe_large"] = 0.2953;
m_sashaTiming["run2"] = 0.0718;
m_sashaTiming["neptune_stripe_200px"] = 0.4206f;
m_sashaTiming["obs_stripe_512px"] = 1.0719f;
m_sashaSizes["Full_Image"] = 8388608;
m_sashaSizes["Center"] = 5242880;
m_sashaSizes["Bottom"] = 2097152;
m_sashaSizes["Top"] = 2097152;
m_sashaSizes["256x256"] = 131072;
m_sashaSizes["128x128"] = 32768;
m_sashaSizes["64x64"] = 8192;
m_sashaSizes["32x32"] = 2048;
m_sashaSizes["1000x1000"] = 2000000;
m_sashaSizes["coro_stripe"] = 245760;
m_sashaSizes["PD_wollaston_stripe_small"] = 327680;
m_sashaSizes["PD_wollaston_stripe_large"] = 573440;
m_sashaSizes["run2"] = 33282;
m_sashaSizes["neptune_stripe_200px"] = 819200;
m_sashaSizes["obs_stripe_512px"] = 2097152;
m_getFitsAbortFlag = 0;
m_bReceivingFitsFile = false;
StartIndiClientThread();
//Flags
m_bFlagChanged = true;
m_bSaveOnlyExposedFiles = true;
m_bSaveIncomingBlob = false;
m_instrumentHeader.init = true;
m_sashaSetup["OBJECTNAME"] = "";
m_sashaSetup["NGROUPS"] = "";
m_sashaSetup["NREADS"] = "";
m_sashaSetup["NDROPS"] = "";
m_sashaSetup["NCOADDS"] = "";
m_sashaSetup["NRESETS"] = "";
m_sashaSetup["NDIT"] = "";
m_sashaSetup["SAVE"] = "";
m_sashaSetup["READOUT"] = "";
m_sashaSetup["DIT"] = "";
m_timeoutSetup.push_back("NGROUPS");
m_timeoutSetup.push_back("NREADS");
m_timeoutSetup.push_back("NDROPS");
m_timeoutSetup.push_back("NCOADDS");
m_timeoutSetup.push_back("NRESETS");
m_rtcKeywords["TTBIASFILE"] = "";
m_rtcKeywords["TTDMFLATFILE"] = "";
m_rtcKeywords["TTSENSORTEMP"] = "-1000.";
m_rtcKeywords["TTWINCOORDX"] = "";
m_rtcKeywords["TTWINCOORDY"] = "";
m_rtcKeywords["TTWINROWS"] = "";
m_rtcKeywords["TTWINCOLS"] = "";
m_rtcKeywords["TTDMMAXPOWER"] = "";
m_rtcKeywords["TTCENTROIDGAINX"] = "";
m_rtcKeywords["TTCENTROIDGAINY"] = "";
Loading
Loading full blame...