9#ifndef UniDetectorPARAMETER_H
10#define UniDetectorPARAMETER_H 1
32 TString str_detector_name;
46 unsigned char* blob_parameter_value;
48 Long_t sz_parameter_value;
50 TDatime* ts_expiry_date;
55 TString detector_name,
62 unsigned char* parameter_value,
63 Long_t size_parameter_value,
64 TDatime* expiry_date);
80 unsigned char* parameter_value,
81 Long_t size_parameter_value,
82 TDatime* expiry_date);
112 unsigned char* tmp_parameter_value =
new unsigned char[sz_parameter_value];
113 memcpy(tmp_parameter_value, blob_parameter_value, sz_parameter_value);
114 return tmp_parameter_value;
121 if (ts_expiry_date ==
nullptr)
124 return new TDatime(*ts_expiry_date);
143 int SetParameterValue(
unsigned char* parameter_value, Long_t size_parameter_value);
153 TString parameter_name,
158 vector<UniValue*> parameter_value,
162 TString parameter_name,
172 TString parameter_name,
175 TDatime* usage_time =
nullptr,
180 TString parameter_name,
189 int GetValue(vector<UniValue*>& parameter_value);
193 int SetValue(vector<UniValue*> parameter_value);
199 static int WriteFile(
const char* detector_name,
200 const char* parameter_name,
205 const char* file_path);
208 static int ReadFile(
const char* detector_name,
209 const char* parameter_name,
212 const char* file_path);
219 static TObjArray*
Search(TObjArray& search_conditions);
227 void GetStart(
int& start_period,
int& start_run);
229 void GetEnd(
int& end_period,
int& end_run);
231 int SetStart(
int start_period,
int start_run);
233 int SetEnd(
int end_period,
int end_run);
253 int SetUNC(
unsigned char* p_parameter_value, Long_t size_parameter_value);
257 TString parameter_name,
262 unsigned char* parameter_value,
263 Long_t size_parameter_value,
Long_t GetParameterValueSize()
get size of parameter value of the current detector parameter
int SetStart(int start_period, int start_run)
set start period and run of the current parameter value
int SetValue(vector< UniValue * > parameter_value)
set value to detector parameter presented by an array
enumValueType GetParameterType()
get parameter type of the current parameter value
int SetValueKey(int value_key)
set value key of the current detector parameter
int SetDetectorName(TString detector_name)
set detector name of the current detector parameter
void GetStart(int &start_period, int &start_run)
get start period and run of the current parameter value
int GetStartPeriod()
get start period of the current detector parameter
int SetExpiryDate(TDatime *expiry_date)
set expiry date of the current detector parameter
TString GetParameterName()
get parameter name of the current parameter value
void GetEnd(int &end_period, int &end_run)
get end period and run of the current parameter value
UniValue * GetValue()
get value of detector parameter presented by a single value
int SetEnd(int end_period, int end_run)
set end period and run of the current parameter value
unsigned char * GetParameterValue()
get parameter value of the current detector parameter
TDatime * GetExpiryDate()
get expiry date of the current detector parameter
static int DeleteDetectorParameter(int value_id)
delete detector parameter from the database
int SetParameterId(int parameter_id)
set parameter id of the current detector parameter
static TObjArray * Search(UniSearchCondition &search_condition)
ClassDef(UniDetectorParameter, 1)
int SetEndPeriod(int end_period)
set end period of the current detector parameter
static int WriteFile(const char *detector_name, const char *parameter_name, int start_period, int start_run, int end_period, int end_run, const char *file_path)
TString GetDetectorName()
get detector name of the current detector parameter
int GetParameterId()
get parameter id of the current detector parameter
int SetEndRun(int end_run)
set end run of the current detector parameter
int SetStartRun(int start_run)
set start run of the current detector parameter
int GetEndPeriod()
get end period of the current detector parameter
void Print()
print information about current detector parameter
int SetUNC(unsigned char *p_parameter_value, Long_t size_parameter_value)
int GetEndRun()
get end run of the current detector parameter
static int PrintAll()
print all detector parameters
int GetValueId()
get value id of the current detector parameter
int SetStartPeriod(int start_period)
set start period of the current detector parameter
static UniDetectorParameter * GetDetectorParameter(int value_id)
get detector parameter from the database
static int CheckDetectorParameterExists(int value_id)
check detector parameter exists in the database: 1- true, 0 - false, <0 - database operation error
static int ReadFile(const char *detector_name, const char *parameter_name, int period_number, int run_number, const char *file_path)
int GetValueKey()
get value key of the current detector parameter
int GetStartRun()
get start run of the current detector parameter
virtual ~UniDetectorParameter()
static UniDetectorParameter * CreateDetectorParameter(TString detector_name, int parameter_id, int start_period, int start_run, int end_period, int end_run, int value_key, unsigned char *parameter_value, Long_t size_parameter_value, TDatime *expiry_date)
add new detector parameter to the database
int SetParameterValue(unsigned char *parameter_value, Long_t size_parameter_value)
set parameter value of the current detector parameter
unsigned char * GetUNC(enumValueType enum_parameter_type=UndefinedType)