7 #include "../../libMagAOX/libMagAOX.hpp"
8 #include "../../magaox_git_version.h"
39 std::vector<double>
m_maxAmp = {1.2801, 1.2801, 1.0201};
142 const std::string & command
234 const std::string & newOutp
243 const pcf::IndiProperty &
ipRecv
261 const pcf::IndiProperty &
ipRecv
279 const pcf::IndiProperty &
ipRecv
297 const pcf::IndiProperty &
ipRecv
315 const pcf::IndiProperty &
ipRecv
333 const pcf::IndiProperty &
ipRecv
343 const std::string & newWvtp
352 const pcf::IndiProperty &
ipRecv
370 const pcf::IndiProperty &
ipRecv
454 config.add(
"device.address",
"a",
"device.address", argType::Required,
"device",
"address",
false,
"string",
"The device address.");
455 config.add(
"device.port",
"p",
"device.port", argType::Required,
"device",
"port",
false,
"string",
"The device port.");
457 config.add(
"timeouts.write",
"",
"timeouts.write", argType::Required,
"timeouts",
"write",
false,
"int",
"The timeout for writing to the device [msec]. Default = 1000");
458 config.add(
"timeouts.read",
"",
"timeouts.read", argType::Required,
"timeouts",
"read",
false,
"int",
"The timeout for reading the device [msec]. Default = 2000");
460 config.add(
"fxngen.C1outpOn",
"",
"fxngen.C1outpOn", argType::Required,
"fxngen",
"C1outpOn",
false,
"bool",
"Whether (true) or not (false) C1 output is enabled at startup. Only effective wavefrom is pulse. Default is false.");
461 config.add(
"fxngen.waveform",
"w",
"fxngen.waveform", argType::Required,
"fxngen",
"waveform",
false,
"string",
"The waveform to populate function.");
463 config.add(
"fxngen.C1ampDefault",
"",
"fxngen.C1ampDefault", argType::Required,
"fxngen",
"C1ampDefault",
false,
"float",
"C1 Default P2V Amplitude of waveform . Default = 0.0");
464 config.add(
"fxngen.C2ampDefault",
"",
"fxngen.C2ampDefault", argType::Required,
"fxngen",
"C2ampDefault",
false,
"float",
"C2 Default P2V Amplitude of waveform . Default = 0.0");
551 log<software_error>({__FILE__,__LINE__});
608 log<software_error>({__FILE__,__LINE__});
672 log<software_critical>({__FILE__, __LINE__,
"No response from device. Time to power cycle."});
683 std::stringstream logs;
685 log<text_log>(logs.str());
694 std::stringstream logs;
696 log<text_log>(logs.str());
716 log<software_critical>({__FILE__, __LINE__});
752 log<software_critical>({__FILE__, __LINE__});
795 log<software_error>({__FILE__, __LINE__});
811 log<software_error>({__FILE__, __LINE__});
837 log<software_error>({__FILE__, __LINE__});
868 log<software_error>({__FILE__, __LINE__});
878 log<software_error>({__FILE__, __LINE__});
898 log<software_error>({__FILE__, __LINE__});
1005 const std::string & command
1015 std::cout <<
"writeRead return val was " << rv <<
"\n";
1070 const std::string & afterColon
1073 std::string command =
"C";
1074 command += mx::ioutils::convertToString<int>(channel);
1076 command += afterColon;
1089 if(channel < 1 || channel > 2)
return -1;
1091 std::string strRead;
1104 std::string resp_state;
1106 rv =
parseMDWV(resp_channel, resp_state, strRead );
1110 if(resp_channel != channel)
1134 if(channel < 1 || channel > 2)
return -1;
1136 std::string strRead;
1149 std::string resp_state;
1151 rv =
parseSWWV(resp_channel, resp_state, strRead );
1155 if(resp_channel != channel)
1179 if(channel < 1 || channel > 2)
return -1;
1181 std::string strRead;
1194 std::string resp_state;
1196 rv =
parseBTWV(resp_channel, resp_state, strRead );
1200 if(resp_channel != channel)
1224 if(channel < 1 || channel > 2)
return -1;
1226 std::string strRead;
1241 rv =
parseARWV(resp_channel, resp_index, strRead );
1245 if(resp_channel != channel)
1267 if(channel < 1 || channel > 2)
return -1;
1269 std::string strRead;
1282 std::string resp_wvtp;
1283 double resp_freq, resp_peri, resp_amp, resp_ampvrms, resp_ofst, resp_hlev, resp_llev, resp_phse, resp_wdth;
1285 rv =
parseBSWV(resp_channel, resp_wvtp, resp_freq, resp_peri, resp_amp, resp_ampvrms, resp_ofst, resp_hlev, resp_llev, resp_phse, resp_wdth, strRead );
1289 if(resp_channel != channel)
1322 else if(channel == 2)
1350 log<software_error>({__FILE__,__LINE__, 0, rv,
"parse error"});
1364 if(channel < 1 || channel > 2)
return -1;
1366 std::string strRead;
1381 rv =
parseSYNC(resp_channel, resp_sync, strRead );
1385 if(resp_channel != channel)
1407 if(channel < 1 || channel > 2)
return -1;
1409 std::string strRead;
1424 rv =
parseOUTP(resp_channel, resp_output, strRead );
1428 if(resp_channel != channel)
1435 if(resp_output > 0) ro =
"On";
1436 else if(resp_output == 0 ) ro =
"Off";
1446 else if(channel == 2)
1612 std::string afterColon;
1613 std::string command;
1615 afterColon =
"MDWV STATE,OFF";
1622 afterColon =
"SWWV STATE,OFF";
1629 afterColon =
"BTWV STATE,OFF";
1636 afterColon =
"ARWV INDEX,0";
1694 const std::string & newOutp
1697 if(channel < 1 || channel > 2)
return -1;
1701 if(newOutp ==
"Off" || newOutp ==
"OFF" || newOutp ==
"off") no =
"OFF";
1702 else if(newOutp ==
"On" || newOutp ==
"ON" || newOutp ==
"on") no =
"ON";
1705 log<software_error>({__FILE__, __LINE__,
"Invalid OUTP spec: " + newOutp});
1709 std::string afterColon =
"OUTP " + no;
1710 std::string command =
makeCommand(channel, afterColon);
1712 log<text_log>(
"Ch. " + std::to_string(channel) +
" OUTP to " + newOutp,
logPrio::LOG_NOTICE);
1725 if(channel == 1 && no ==
"ON")
1737 const pcf::IndiProperty &
ipRecv
1740 if(channel < 1 || channel > 2)
return -1;
1744 std::string newOutp;
1747 newOutp =
ipRecv[
"value"].get<std::string>();
1751 log<software_error>({__FILE__, __LINE__,
"Exception caught."});
1762 if(rv < 0) log<software_error>({__FILE__, __LINE__});
1774 if(channel < 1 || channel > 2)
return -1;
1803 log<text_log>(
"Ch. " + std::to_string(channel) +
" FREQ not set due to amplitude exceeding limit for " + std::to_string(newFreq),
logPrio::LOG_WARNING);
1820 std::string afterColon =
"BSWV FRQ," + mx::ioutils::convertToString<double>(newFreq);
1821 std::string command =
makeCommand(channel, afterColon);
1823 log<text_log>(
"Ch. " + std::to_string(channel) +
" FREQ to " + std::to_string(newFreq),
logPrio::LOG_NOTICE);
1838 double wdthLim = 0.5 / newFreq ;
1839 double wdth250 = 1 / newFreq - 0.000250;
1840 double newWdth = wdth250;
1842 if(wdthLim > wdth250){
1844 log<text_log>(
"Ch. " + std::to_string(channel) +
" WDTH auto-changing to duty cycle limit: " + std::to_string(newWdth),
logPrio::LOG_NOTICE);
1846 log<text_log>(
"Ch. " + std::to_string(channel) +
" WDTH auto-changing to 250us ideal case: " + std::to_string(newWdth),
logPrio::LOG_NOTICE);
1858 const pcf::IndiProperty &
ipRecv
1861 if(channel < 1 || channel > 2)
return -1;
1868 newFreq =
ipRecv[
"target"].get<
double>();
1872 log<software_error>({__FILE__, __LINE__,
"Exception caught."});
1882 if(rv < 0) log<software_error>({__FILE__, __LINE__});
1894 if(channel < 1 || channel > 2)
return -1;
1904 if(offst + 0.5*newAmp > 10)
1906 newAmp = 2.*(10.0 - offst);
1907 log<text_log>(
"Ch. " + std::to_string(channel) +
" AMP limited at 10 V by OFST to " + std::to_string(newAmp),
logPrio::LOG_WARNING);
1910 if(offst - 0.5*newAmp < 0)
1913 log<text_log>(
"Ch. " + std::to_string(channel) +
" AMP limited at 0 V by OFST to " + std::to_string(newAmp),
logPrio::LOG_WARNING);
1928 std::cerr <<
"Max Amp @ " << freq <<
" = " << maxAmp <<
"\n";
1934 log<text_log>(
"Ch. " + std::to_string(channel) +
" AMP max-limited to " + std::to_string(newAmp),
logPrio::LOG_WARNING);
1940 log<text_log>(
"Ch. " + std::to_string(channel) +
" AMP min-limited to " + std::to_string(newAmp),
logPrio::LOG_WARNING);
1955 std::string afterColon =
"BSWV AMP," + mx::ioutils::convertToString<double>(newAmp);
1956 std::string command =
makeCommand(channel, afterColon);
1958 log<text_log>(
"Ch. " + std::to_string(channel) +
" AMP set to " + std::to_string(newAmp),
logPrio::LOG_NOTICE);
1975 const pcf::IndiProperty &
ipRecv
1978 if(channel < 1 || channel > 2)
return -1;
1985 newAmp =
ipRecv[
"target"].get<
double>();
1989 log<software_error>({__FILE__, __LINE__,
"Exception caught."});
2000 if(rv < 0) log<software_error>({__FILE__, __LINE__});
2012 if(channel < 1 || channel > 2)
return -1;
2015 if(channel == 2) amp =
m_C2vpp;
2017 if(newOfst + 0.5*amp > 10)
2019 newOfst = 10 - 0.5*amp;
2020 log<text_log>(
"Ch. " + std::to_string(channel) +
" OFST limited at 10 V by AMP to " + std::to_string(newOfst),
logPrio::LOG_WARNING);
2023 if(newOfst - 0.5*amp < 0)
2026 log<text_log>(
"Ch. " + std::to_string(channel) +
" OFST limited at 0 V by AMP to " + std::to_string(newOfst),
logPrio::LOG_WARNING);
2032 log<text_log>(
"Ch. " + std::to_string(channel) +
" OFST max-limited to " + std::to_string(newOfst),
logPrio::LOG_WARNING);
2038 log<text_log>(
"Ch. " + std::to_string(channel) +
" OFST min-limited to " + std::to_string(newOfst),
logPrio::LOG_WARNING);
2041 std::string afterColon =
"BSWV OFST," + mx::ioutils::convertToString<double>(newOfst);
2042 std::string command =
makeCommand(channel, afterColon);
2044 log<text_log>(
"Ch. " + std::to_string(channel) +
" OFST set to " + std::to_string(newOfst),
logPrio::LOG_NOTICE);
2059 const pcf::IndiProperty &
ipRecv
2062 if(channel < 1 || channel > 2)
return -1;
2069 newOfst =
ipRecv[
"value"].get<
double>();
2073 log<software_error>({__FILE__, __LINE__,
"Exception caught."});
2084 if(rv < 0) log<software_error>({__FILE__, __LINE__});
2096 if(channel < 1 || channel > 2)
return -1;
2099 log<text_log>(
"Ch. " + std::to_string(channel) +
" PHSE not set for PULSE waveform.",
logPrio::LOG_WARNING);
2103 std::string afterColon =
"BSWV PHSE," + mx::ioutils::convertToString<double>(newPhse);
2104 std::string command =
makeCommand(channel, afterColon);
2106 log<text_log>(
"Ch. " + std::to_string(channel) +
" PHSE to " + std::to_string(newPhse),
logPrio::LOG_NOTICE);
2121 const pcf::IndiProperty &
ipRecv
2124 if(channel < 1 || channel > 2)
return -1;
2131 newPhse =
ipRecv[
"value"].get<
double>();
2135 log<software_error>({__FILE__, __LINE__,
"Exception caught."});
2146 if(rv < 0) log<software_error>({__FILE__, __LINE__});
2158 if(channel < 1 || channel > 2)
return -1;
2161 log<text_log>(
"Ch. " + std::to_string(channel) +
" WDTH can not be set, waveforem not PULSE.",
logPrio::LOG_WARNING);
2165 std::string afterColon =
"BSWV WIDTH," + mx::ioutils::convertToString<double>(newWdth);
2166 std::string command =
makeCommand(channel, afterColon);
2168 log<text_log>(
"Ch. " + std::to_string(channel) +
" WDTH to " + std::to_string(newWdth),
logPrio::LOG_NOTICE);
2183 const pcf::IndiProperty &
ipRecv
2186 if(channel < 1 || channel > 2)
return -1;
2193 newWdth =
ipRecv[
"value"].get<
double>();
2197 log<software_error>({__FILE__, __LINE__,
"Exception caught."});
2208 if(rv < 0) log<software_error>({__FILE__, __LINE__});
2218 const std::string & newWvtp
2221 if(channel < 1 || channel > 2)
return -1;
2223 std::string afterColon =
"BSWV WVTP," + newWvtp;
2224 std::string command =
makeCommand(channel, afterColon);
2226 log<text_log>(
"Ch. " + std::to_string(channel) +
" WVTP to " + newWvtp,
logPrio::LOG_NOTICE);
2241 const pcf::IndiProperty &
ipRecv
2244 if(channel < 1 || channel > 2)
return -1;
2248 std::string newWvtp;
2251 newWvtp =
ipRecv[
"value"].get<std::string>();
2255 log<software_error>({__FILE__, __LINE__,
"Exception caught."});
2266 if(rv < 0) log<software_error>({__FILE__, __LINE__});
2278 if(channel < 1 || channel > 2)
return -1;
2280 std::string afterColon =
"SYNC ";
2281 if(newSync) afterColon +=
"ON";
2282 else afterColon +=
"OFF";
2284 std::string command =
makeCommand(channel, afterColon);
2286 if(newSync) log<text_log>(
"Ch. " + std::to_string(channel) +
" SYNC to ON",
logPrio::LOG_NOTICE);
2287 else log<text_log>(
"Ch. " + std::to_string(channel) +
" SYNC to OFF",
logPrio::LOG_NOTICE);
2304 const pcf::IndiProperty &
ipRecv
2307 if(channel < 1 || channel > 2)
return -1;
2313 if(!
ipRecv.find(
"toggle"))
return 0;
2315 if(
ipRecv[
"toggle"].getSwitchState() == pcf::IndiElement::Off )
2320 if(
ipRecv[
"toggle"].getSwitchState() == pcf::IndiElement::On )
2332 if(rv < 0) log<software_error>({__FILE__, __LINE__});
2343 return changeOutp(1,
ipRecv);
2351 return changeFreq(1,
ipRecv);
2358 return changeAmp(1,
ipRecv);
2365 return changeOfst(1,
ipRecv);
2372 return changePhse(1,
ipRecv);
2379 return changeWdth(1,
ipRecv);
2386 return changeWvtp(1,
ipRecv);
2393 return changeSync(1,
ipRecv);
2400 return changeOutp(2,
ipRecv);
2407 return changeFreq(2,
ipRecv);
2414 return changeAmp(2,
ipRecv);
2421 return changeOfst(2,
ipRecv);
2428 return changePhse(2,
ipRecv);
2435 return changeWdth(2,
ipRecv);
2442 return changeWvtp(2,
ipRecv);
2449 return changeSync(2,
ipRecv);
2471 static double old_C1outp = -1e30;
2473 static double old_C1vpp =
m_C1vpp;
2474 static double old_C1ofst =
m_C1ofst;
2475 static double old_C1phse =
m_C1phse;
2476 static double old_C1wdth =
m_C1wdth;
2477 static std::string old_C1wvtp =
m_C1wvtp;
2479 static double old_C2outp =
m_C2outp;
2481 static double old_C2vpp =
m_C2vpp;
2482 static double old_C2ofst =
m_C2ofst;
2483 static double old_C2phse =
m_C2phse;
2484 static double old_C2wdth =
m_C2wdth;
2485 static std::string old_C2wvtp =
m_C2wvtp;
2492 if( old_C1outp !=
m_C1outp ) write =
true;
2494 else if( old_C1vpp !=
m_C1vpp ) write =
true;
2495 else if( old_C1ofst !=
m_C1ofst ) write =
true;
2496 else if( old_C1phse !=
m_C1phse ) write =
true;
2497 else if( old_C1wdth !=
m_C1wdth ) write =
true;
2498 else if( old_C1wvtp !=
m_C1wvtp ) write =
true;
2499 else if( old_C1sync !=
m_C1sync ) write =
true;
2500 else if( old_C2outp !=
m_C2outp ) write =
true;
2502 else if( old_C2vpp !=
m_C2vpp ) write =
true;
2503 else if( old_C2ofst !=
m_C2ofst ) write =
true;
2504 else if( old_C2phse !=
m_C2phse ) write =
true;
2505 else if( old_C2wdth !=
m_C2wdth ) write =
true;
2506 else if( old_C2wvtp !=
m_C2wvtp ) write =
true;
2507 else if( old_C2sync !=
m_C2sync ) write =
true;
The base-class for MagAO-X applications.
void updateIfChanged(pcf::IndiProperty &p, const std::string &el, const T &newVal, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
Update an INDI property element value if it has changed.
stateCodes::stateCodeT state()
Get the current state code.
int registerIndiPropertyNew(pcf::IndiProperty &prop, int(*)(void *, const pcf::IndiProperty &))
Register an INDI property which is exposed for others to request a New Property for.
int createStandardIndiToggleSw(pcf::IndiProperty &prop, const std::string &name, const std::string &label="", const std::string &group="")
Create a standard R/W INDI switch with a single toggle element.
unsigned long m_loopPause
int m_shutdown
Flag to signal it's time to shutdown. When not 0, the main loop exits.
int m_powerState
Current power state, 1=On, 0=Off, -1=Unk.
void updateSwitchIfChanged(pcf::IndiProperty &p, const std::string &el, const pcf::IndiElement::SwitchStateType &newVal, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
Update an INDI switch element value if it has changed.
int stateLogged()
Updates and returns the value of m_stateLogged. Will be 0 on first call after a state change,...
static int log(const typename logT::messageT &msg, logPrioT level=logPrio::LOG_DEFAULT)
Make a log entry.
std::mutex m_indiMutex
Mutex for locking INDI communications.
int m_powerTargetState
Current target power state, 1=On, 0=Off, -1=Unk.
int writeCommand(const std::string &commmand)
Write a command to the device.
int querySYNC(bool &sync, int channel)
Send the SYNC? query for a channel.
int writeRead(std::string &strRead, const std::string &command)
Write a command to the device and get the response. Not mutex-ed.
double m_C1ofst
The offset voltage of channel 1.
double m_C1vpp
The peak-2-peak voltage of channel 1.
int changePhse(int channel, double newPhse)
Send a change phase command to the device.
constexpr static double cs_MaxOfst
virtual int onPowerOff()
Implementation of the on-power-off FSM logic.
int queryOUTP(int channel)
Send the OUTP? query for a channel.
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C1outp)
int recordParams(bool force=false)
int querySWWV(std::string &state, int channel)
Send the SWWV? query and get the response state.
int checkSetup()
Check the setup is correct and safe for PI TTM control.
double m_bootDelay
Time in seconds it takes the device to boot.
tty::telnetConn m_telnetConn
The telnet connection manager.
double m_C1frequency
The output frequency of channel 1.
std::string m_devicePort
The device port.
uint8_t m_C2outp
The output status channel 2.
double m_C1vppDefault
default value for vpp of channel 1
virtual int appStartup()
Startup functions.
int changeAmp(int channel, double newAmp)
Send a change amplitude command to the device.
pcf::IndiProperty m_indiP_C2sync
pcf::IndiProperty m_indiP_C2wvtp
double m_C2phse
The phase of channel 2 (SINE only)
pcf::IndiProperty m_indiP_C2freq
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C1wvtp)
std::string m_C1wvtp
The wave type of channel 1.
int changeWdth(int channel, double newWdth)
Send a width command to the device.
double m_powerOnCounter
Counts the number of loops since power-on, used to control logging of connect failures.
~siglentSDG() noexcept
D'tor, declared and defined for noexcept.
virtual void loadConfig()
load the configuration system results (called by MagAOXApp::setup())
std::vector< double > m_maxAmp
int changeWvtp(int channel, const std::string &newWvtp)
Send a change wavetype command to the device.
pcf::IndiProperty m_indiP_C1amp
pcf::IndiProperty m_indiP_C2wdth
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C2phse)
pcf::IndiProperty m_indiP_status
pcf::IndiProperty m_indiP_C1peri
pcf::IndiProperty m_indiP_C2ofst
int queryMDWV(std::string &state, int channel)
Send the MDWV? query and get the response state.
double m_C2wdth
The width of channel 2 (PULSE only)
pcf::IndiProperty m_indiP_C2llev
double m_C2vppDefault
default value for vpp of channel 2
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C1sync)
pcf::IndiProperty m_indiP_C1ofst
virtual int whilePowerOff()
Implementation of the while-powered-off FSM.
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C1phse)
int changeOfst(int channel, double newOfst)
Send a change offset command to the device.
pcf::IndiProperty m_indiP_C2amp
pcf::IndiProperty m_indiP_C1wdth
pcf::IndiProperty m_indiP_C1wvtp
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C2sync)
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C2wdth)
int queryBSWV(int channel)
Send the BSWV? query for a channel.
pcf::IndiProperty m_indiP_C2peri
std::vector< double > m_maxFreq
pcf::IndiProperty m_indiP_C1freq
double m_C1phse
The phase of channel 1 (SINE only)
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C2outp)
double m_C2setVoltage
the set position voltage of Ch. 2.
virtual int appLogic()
Implementation of the FSM for the Siglent SDG.
pcf::IndiProperty m_indiP_C2ampvrms
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C2wvtp)
pcf::IndiProperty m_indiP_C1hlev
siglentSDG()
Default c'tor.
virtual void setupConfig()
Setup the configuration system (called by MagAOXApp::setup())
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C1amp)
std::string m_deviceAddr
The device address.
pcf::IndiProperty m_indiP_C2hlev
int changeSync(int channel, bool newSync)
Send a change sync command to the device.
pcf::IndiProperty m_indiP_C1phse
pcf::IndiProperty m_indiP_C1outp
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C1freq)
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C2ofst)
int changeOutp(int channel, const std::string &newOutp)
Change the output status (on/off) of one channel.
pcf::IndiProperty m_indiP_C2outp
int recordTelem(const telem_fxngen *)
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C2amp)
double m_C1wdth
The width of channel 1 (PULSE only)
constexpr static double cs_MaxVolts
int m_readTimeOut
The timeout for reading from the device [msec].
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C1wdth)
int queryARWV(int &index, int channel)
Send the ARWV? query and get the response index.
pcf::IndiProperty m_indiP_C1llev
double m_C2frequency
The output frequency of channel 2.
virtual int appShutdown()
Do any needed shutdown tasks. Currently nothing in this app.
int m_writeTimeOut
The timeout for writing to the device [msec].
int normalizeSetup()
Normalize the setup, called during connection if checkSetup shows a problem, or on power-up.
friend class siglentSDG_test
uint8_t m_C1outp
std::string m_clock; ///<INTernal or EXTernal
pcf::IndiProperty m_indiP_C2phse
int changeFreq(int channel, double newFreq)
Send a change frequency command to the device.
double m_C2vpp
The peak-2-peak voltage of channel 2.
double m_C2ofst
The offset voltage of channel 2.
double m_C1setVoltage
the set position voltage of Ch. 1.
std::string m_C2wvtp
The wave type of channel 2.
pcf::IndiProperty m_indiP_C1sync
int queryBTWV(std::string &state, int channel)
Send the BTWV? query and get the response state.
pcf::IndiProperty m_indiP_C1ampvrms
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C1ofst)
INDI_NEWCALLBACK_DECL(siglentSDG, m_indiP_C2freq)
#define REG_INDI_NEWPROP_NOCB(prop, propName, type)
Register a NEW INDI property with the class, with no callback.
#define REG_INDI_NEWPROP(prop, propName, type)
Register a NEW INDI property with the class, using the standard callback name.
#define CREATE_REG_INDI_NEW_NUMBERF(prop, name, min, max, step, format, label, group)
Create and register a NEW INDI property as a standard number as float, using the standard callback na...
@ OPERATING
The device is operating, other than homing.
@ CONFIGURING
The application is configuring the device.
@ ERROR
The application has encountered an error, from which it is recovering (with or without intervention)
@ READY
The device is ready for operation, but is not operating.
@ CONNECTED
The application has connected to the device or service.
@ NOTCONNECTED
The application is not connected to the device or service.
@ POWERON
The device power is on.
std::string ttyErrorString(int ec)
Get a text explanation of a TTY_E_ error code.
int parseOUTP(int &channel, int &output, const std::string &strRead)
Parse the SDG response to the OUTP query.
int parseSWWV(int &channel, std::string &state, const std::string &strRead)
Parse the SDG response to the SWWV query.
int parseMDWV(int &channel, std::string &state, const std::string &strRead)
Parse the SDG response to the MDWV query.
std::string makeCommand(int channel, const std::string &afterColon)
INDI_VALIDATE_CALLBACK_PROPS(function, ipRecv)
int parseBSWV(int &channel, std::string &wvtp, double &freq, double &peri, double &, double &vrms, double &ofst, double &hlev, double &llev, double &phse, double &wdth, const std::string &strRead)
Parse the SDG response to the BSWV query.
const pcf::IndiProperty & ipRecv
int parseBTWV(int &channel, std::string &state, const std::string &strRead)
Parse the SDG response to the BTWV query.
int parseARWV(int &channel, int &index, const std::string &strRead)
Parse the SDG response to the ARWV query.
INDI_NEWCALLBACK_DEFN(acesxeCtrl, m_indiP_windspeed)(const pcf
int parseSYNC(int &channel, bool &sync, const std::string &strRead)
Parse the SDG response to the SYNC query.
std::unique_lock< std::mutex > lock(m_indiMutex)
constexpr static logPrioT LOG_CRITICAL
The process can not continue and will shut down (fatal)
constexpr static logPrioT LOG_ERROR
An error has occured which the software will attempt to correct.
constexpr static logPrioT LOG_WARNING
A condition has occurred which may become an error, but the process continues.
constexpr static logPrioT LOG_NOTICE
A normal but significant condition.
#define SDG_PARSEERR_WVTP
A device base class which saves telemetry.
int appShutdown()
Perform telemeter application shutdown.
int loadConfig(appConfigurator &config)
Load the device section from an application configurator.
int appLogic()
Perform telemeter application logic.
int setupConfig(appConfigurator &config)
Setup an application configurator for the device section.
int checkRecordTimes(const telT &tel, telTs... tels)
Check the time of the last record for each telemetry type and make an entry if needed.
int16_t stateCodeT
The type of the state code.
static std::string codeText(const stateCodeT &stateCode)
Get an ASCII string corresponding to an application stateCode.
Log entry recording the function generator parameters.
A Telnet connection manager, wrapping libtelnet.
int write(const std::string &buffWrite, int timeoutWrite)
Write to a telnet connection.
std::string m_strRead
The accumulated string read from the device.
int noLogin()
Set flags as if we're logged in, used when device doesn't require it.
std::string m_prompt
The device's prompt, used for detecting end of transmission.
int writeRead(const std::string &strWrite, bool swallowEcho, int timeoutWrite, int timeoutRead)
Write to a telnet connection, then get the reply.
int read(const std::string &eot, int timeoutRead, bool clear=true)
Read from a telnet connection, until end-of-transmission string is read.
int connect(const std::string &host, const std::string &port)
Connect to the device.
#define TELEM_FXNGEN_WVTP_DC
#define TELEM_FXNGEN_WVTP_PULSE
#define TELEM_FXNGEN_WVTP_SINE