Skip to content

Commit c85474b

Browse files
Add function to send DefineSpectrumLVS command.
Co-authored-by: Guilherme Rodrigues de Lima <guilherme.lima@lnls.br>
1 parent f63080e commit c85474b

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

specsAnalyserApp/src/specsAnalyser.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,43 @@ asynStatus SpecsAnalyser::validateSpectrum()
11901190
return status;
11911191
}
11921192

1193+
asynStatus SpecsAnalyser::defineSpectrumLVS()
1194+
{
1195+
static const char *functionName = "SpecsAnalyser::defineSpectrumLVS";
1196+
1197+
asynStatus status = asynSuccess;
1198+
std::stringstream command;
1199+
std::string response = "";
1200+
std::map<std::string, std::string> data;
1201+
double dvalue = 0.0;
1202+
int ivalue = 0;
1203+
1204+
command << SPECS_CMD_DEFINE_LVS << " ";
1205+
getDoubleParam(SPECSStart_, &dvalue);
1206+
command << "Start:" << dvalue << " ";
1207+
getDoubleParam(SPECSEnd_, &dvalue);
1208+
command << "End:" << dvalue << " ";
1209+
getDoubleParam(SPECSStepWidth_, &dvalue);
1210+
command << "StepWidth:" << dvalue << " ";
1211+
getDoubleParam(SPECSKineticEnergy_, &dvalue);
1212+
command << "KinEnergy:" << dvalue << " ";
1213+
getDoubleParam(ADAcquireTime, &dvalue);
1214+
command << "DwellTime:" << dvalue << " ";
1215+
getDoubleParam(SPECSPassEnergy_, &dvalue);
1216+
command << "PassEnergy:" << dvalue << " ";
1217+
getIntegerParam(SPECSLensMode_, &ivalue);
1218+
command << "LensMode:\"" << lensModes_[ivalue] << "\" ";
1219+
getIntegerParam(SPECSScanRange_, &ivalue);
1220+
command << "ScanRange:\"" << scanRanges_[ivalue] << "\" ";
1221+
getIntegerParam(SPECSScanVariable_, &ivalue);
1222+
command << "ScanVariable:\"" << scanVariable_[ivalue] << "\"";
1223+
1224+
debug(functionName, "Sending command", command.str());
1225+
1226+
status = sendSimpleCommand(command.str(), &data);
1227+
return status;
1228+
}
1229+
11931230
/**
11941231
* Send the start command to the analyser
11951232
*/

specsAnalyserApp/src/specsAnalyser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#define SPECS_CMD_DEFINE_SFAT "DefineSpectrumSFAT"
5757
#define SPECS_CMD_DEFINE_FRR "DefineSpectrumFRR"
5858
#define SPECS_CMD_DEFINE_FE "DefineSpectrumFE"
59+
#define SPECS_CMD_DEFINE_LVS "DefineSpectrumLVS"
5960
#define SPECS_CMD_VALIDATE "ValidateSpectrum"
6061
#define SPECS_CMD_START "Start"
6162
#define SPECS_CMD_PAUSE "Pause"
@@ -142,6 +143,7 @@ class SpecsAnalyser : public ADDriver {
142143
asynStatus defineSpectrumSFAT();
143144
asynStatus defineSpectrumFRR();
144145
asynStatus defineSpectrumFE();
146+
asynStatus defineSpectrumLVS();
145147
asynStatus readAcquisitionData(
146148
int startIndex, int endIndex, std::vector<double> &values);
147149
asynStatus sendStartCommand(bool safeAfter);

0 commit comments

Comments
 (0)