updating function signature
This commit is contained in:
@@ -24,6 +24,11 @@ itcPressureOptimizer::HandleInit(const std::vector<std::string> &args) {
|
||||
return TMFeResult();
|
||||
}
|
||||
|
||||
void itcPressureOptimizer::HandlePeriodic() {
|
||||
for (int i = 0; i < info.num_channels; i++) {
|
||||
}
|
||||
}
|
||||
|
||||
INT itcPressureOptimizer::mitc_pressc_init() {
|
||||
/*
|
||||
cm_get_experiment_database(&hDB, NULL);
|
||||
@@ -31,6 +36,8 @@ INT itcPressureOptimizer::mitc_pressc_init() {
|
||||
int status = SUCCESS;
|
||||
bool isDefaultNameExists;
|
||||
bool isDefaultThresholdExists;
|
||||
bool isDemandExists;
|
||||
bool isMeasuredExists;
|
||||
isDefaultNameExists = midas::odb::exists(this->equipmentPath + "/" +
|
||||
Configuration::SETTINGS_DIR + "/" +
|
||||
Configuration::NAMES_VARNAME);
|
||||
@@ -39,6 +46,14 @@ INT itcPressureOptimizer::mitc_pressc_init() {
|
||||
this->equipmentPath + "/" + Configuration::SETTINGS_DIR + "/" +
|
||||
Configuration::UPDATE_THRESHOLD_MEASURED_VARNAME);
|
||||
|
||||
isDemandExists = midas::odb::exists(this->equipmentPath + "/" +
|
||||
Configuration::VARIABLE_DIR + "/" +
|
||||
Configuration::DEMAND_VARNAME);
|
||||
|
||||
isMeasuredExists = midas::odb::exists(this->equipmentPath + "/" +
|
||||
Configuration::VARIABLE_DIR + "/" +
|
||||
Configuration::MEASURED_VARNAME);
|
||||
|
||||
if (!isDefaultNameExists || !isDefaultThresholdExists) {
|
||||
midas::odb o = {
|
||||
{Configuration::VARIABLE_DIR.c_str(),
|
||||
@@ -92,6 +107,22 @@ INT itcPressureOptimizer::mitc_pressc_init() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!isDemandExists) {
|
||||
midas::odb o(this->equipmentPath + "/" + Configuration::VARIABLE_DIR);
|
||||
std::vector<float> demandLists =
|
||||
o[Configuration::DEMAND_VARNAME.c_str()];
|
||||
demandLists.resize(info.num_channels);
|
||||
o[Configuration::DEMAND_VARNAME.c_str()] = demandLists;
|
||||
}
|
||||
|
||||
if (!isMeasuredExists) {
|
||||
midas::odb o(this->equipmentPath + "/" + Configuration::VARIABLE_DIR);
|
||||
std::vector<float> measuredLists =
|
||||
o[Configuration::MEASURED_VARNAME.c_str()];
|
||||
measuredLists.resize(info.num_channels);
|
||||
o[Configuration::MEASURED_VARNAME.c_str()] = measuredLists;
|
||||
}
|
||||
|
||||
/*
|
||||
Caching all the value of /DD folder
|
||||
*/
|
||||
@@ -719,7 +750,6 @@ float itcPressureOptimizer::getDefaultThreshold(int channel) {
|
||||
case 1:
|
||||
return 0.001f;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
return 0.0001f;
|
||||
break;
|
||||
|
||||
@@ -10,6 +10,8 @@ class itcPressureOptimizer : public TMFeEquipment {
|
||||
|
||||
TMFeResult HandleInit(const std::vector<std::string> &args);
|
||||
|
||||
void HandlePeriodic();
|
||||
|
||||
private:
|
||||
std::string equipmentPath;
|
||||
itcPressureOptimizerInfo info;
|
||||
|
||||
Reference in New Issue
Block a user