5 #include "..\selogger\selogger.h"
12 static const IID* arr[] =
17 for (
int i=0; i <
sizeof(arr) /
sizeof(arr[0]); i++)
19 if (InlineIsEqualGUID(*arr[i],riid))
25 STDMETHODIMP
Cselog::SELogValue(LONG run_number, BSTR source, BSTR iso_time, BSTR block_name, BSTR block_value)
27 AFX_MANAGE_STATE(AfxGetStaticModuleState());
28 COLE2CT c_source(source), c_iso_time(iso_time), c_block_name(block_name), c_block_value(block_value);
29 if (
se_log_value(run_number, c_source, c_iso_time, c_block_name, c_block_value) == 0)
41 AFX_MANAGE_STATE(AfxGetStaticModuleState());
54 AFX_MANAGE_STATE(AfxGetStaticModuleState());
55 COLE2CT config_name_c(config_name);
68 AFX_MANAGE_STATE(AfxGetStaticModuleState());
69 COLE2CT block_name_c(block_name), block_value_c(block_value);
81 BSTR read_control_label, BSTR set_control_label,
82 BSTR button_control_label, LONG options, BSTR nexus_name,
83 FLOAT low_limit, FLOAT high_limit, BSTR units, BSTR current_value)
85 AFX_MANAGE_STATE(AfxGetStaticModuleState());
87 COLE2CT(vi_name), COLE2CT(read_control_label), COLE2CT(set_control_label),
88 COLE2CT(button_control_label), (
BlockOptions)options, COLE2CT(nexus_name),
89 low_limit, high_limit, COLE2CT(units), COLE2CT(current_value)) == 0)
101 AFX_MANAGE_STATE(AfxGetStaticModuleState());
106 CComBSTR bstr_wrapper(id_s.c_str());
107 *
id = bstr_wrapper.Detach();
118 AFX_MANAGE_STATE(AfxGetStaticModuleState());
123 CComBSTR bstr_wrapper(label_s.c_str());
124 *label = bstr_wrapper.Detach();
133 #include "variant_utils.h"
137 BSTR* bstr_values = NULL;
138 VARIANT* variant_values = NULL;
147 for(
int i=0; i<n; i++)
149 if (bstr_values != NULL)
151 sv[i] = COLE2CT(bstr_values[i]);
153 else if (variant_values != NULL)
155 sv[i] = COLE2CT(variant_values[i].bstrVal);
164 AFX_MANAGE_STATE(AfxGetStaticModuleState());
165 std::vector<std::string> names_list;
166 std::vector<std::string> values_list;
179 STDMETHODIMP
Cselog::SELogValues(LONG run_number, BSTR source, VARIANT iso_times, VARIANT block_names, VARIANT block_values)
181 AFX_MANAGE_STATE(AfxGetStaticModuleState());
182 std::vector<std::string> names_list;
183 std::vector<std::string> values_list;
184 std::vector<std::string> times_list;
188 if (
se_log_values(run_number, COLE2CT(source), times_list, names_list, values_list) == 0)
200 AFX_MANAGE_STATE(AfxGetStaticModuleState());
202 *measurement_id = NULL;
205 CComBSTR bstr_wrapper(id_s.c_str());
206 *measurement_id = bstr_wrapper.Detach();
217 AFX_MANAGE_STATE(AfxGetStaticModuleState());
231 AFX_MANAGE_STATE(AfxGetStaticModuleState());
232 COLE2CT block_name_c(block_name), block_setpoint_c(block_setpoint);
247 AFX_MANAGE_STATE(AfxGetStaticModuleState());
248 std::vector<std::string> names_list;
249 std::vector<std::string> setpoints_list;
264 AFX_MANAGE_STATE(AfxGetStaticModuleState());
265 std::string seci_config_s;
269 CComBSTR bstr_wrapper(seci_config_s.c_str());
270 *seci_config = bstr_wrapper.Detach();
282 AFX_MANAGE_STATE(AfxGetStaticModuleState());
283 std::vector<std::string> names_list;
284 std::vector<std::string> values_list;
285 std::vector<std::string> times_list;
289 if (
se_log_values_async(run_number, COLE2CT(source), times_list, names_list, values_list) == 0)
300 STDMETHODIMP
Cselog::SEGetValues(LONG run_number, BSTR source, BSTR block_name, VARIANT* iso_times, VARIANT* block_values)
302 AFX_MANAGE_STATE(AfxGetStaticModuleState());
303 std::vector<std::string> block_values_v;
304 std::vector<std::string> iso_times_v;
305 if (
se_get_values(run_number, COLE2CT(source), COLE2CT(block_name), iso_times_v, block_values_v) != 0)
317 AFX_MANAGE_STATE(AfxGetStaticModuleState());
328 std::string result_s;
329 AFX_MANAGE_STATE(AfxGetStaticModuleState());
333 CComBSTR bstr_wrapper(result_s.c_str());
334 *result = bstr_wrapper.Detach();
HRESULT SELogValues(LONG run_number, BSTR source, VARIANT iso_times, VARIANT block_names, VARIANT block_values)
SELOGGER_API int __stdcall se_new_seci_config(const char *config_name)
HRESULT SESetBlockDetails(BSTR block_name, BSTR setpoint_value, BSTR vi_name, BSTR read_control_label, BSTR set_control_label, BSTR button_control_label, LONG options, BSTR nexus_name, FLOAT low_limit, FLOAT high_limit, BSTR units, BSTR current_value)
SELOGGER_API int __stdcall se_new_measurement(const char *label, std::string &res)
SELOGGER_API int __stdcall se_get_measurement_id(const char *label, std::string &measurement_id)
HRESULT SEExecSQL(BSTR sql, BSTR *result)
HRESULT SENewMeasurement(BSTR label, BSTR *id)
static int build_string_vector(VARIANT &v, std::vector< std::string > &sv)
HRESULT SELogValue(LONG run_number, BSTR source, BSTR iso_time, BSTR block_name, BSTR block_value)
HRESULT SEGetSECIConfig(BSTR *seci_config)
SELOGGER_API int __stdcall se_log_values(long run_number, const char *source, const std::vector< std::string > &iso_times, const std::vector< std::string > &block_names, const std::vector< std::string > &block_values)
HRESULT SESetBlockSetpoint(BSTR block_name, BSTR block_setpoint)
SELOGGER_API const char *__stdcall se_get_errmsg()
HRESULT SESetMeasurementLabel(BSTR measurement_id, BSTR label)
SELOGGER_API int __stdcall se_log_value(long run_number, const char *source, const char *iso_time, const char *block_name, const char *block_value)
SELOGGER_API int __stdcall se_get_measurement_label(const char *measurement_id, std::string &res)
HRESULT SEGetMeasurementID(BSTR label, BSTR *measurement_id)
SELOGGER_API int __stdcall se_set_block_setpoints(const std::vector< std::string > &block_names, const std::vector< std::string > &block_setpoints)
HRESULT SELogValuesAsync(LONG run_number, BSTR source, VARIANT iso_times, VARIANT block_names, VARIANT block_values)
HRESULT SEGetMeasurementLabel(BSTR id, BSTR *label)
HRESULT InterfaceSupportsErrorInfo(REFIID riid)
SELOGGER_API int __stdcall se_close()
SELOGGER_API int __stdcall se_get_values(long run_number, const char *source, const char *block_name, std::vector< std::string > &iso_times, std::vector< std::string > &block_values)
SELOGGER_API int __stdcall se_get_seci_config(std::string &seci_config)
HRESULT SEGetValues(LONG run_number, BSTR source, BSTR block_name, VARIANT *iso_times, VARIANT *block_values)
HRESULT SESetBlockValues(VARIANT block_names, VARIANT block_values)
SELOGGER_API int __stdcall se_exec_sql(const char *sql, std::string &result)
static int accessArrayVariant(VARIANT *v, void **values, VARTYPE vt)
SELOGGER_API int __stdcall se_set_block_setpoint(const char *block_name, const char *block_setpoint)
SELOGGER_API int __stdcall se_clear_values(int run_start, int run_finish)
HRESULT SESetBlockSetpoints(VARIANT block_names, VARIANT block_setpoints)
SELOGGER_API int __stdcall se_set_block_value(const char *block_name, const char *block_value)
HRESULT SEClearLoggedValues(LONG run_number)
SELOGGER_API int __stdcall se_set_measurement_label(const char *measurement_id, const char *label)
SELOGGER_API int __stdcall se_set_block_values(const std::vector< std::string > &block_names, const std::vector< std::string > &block_values)
SELOGGER_API int __stdcall se_set_block_details(const char *block_name, const char *setpoint_value, const char *vi_name, const char *read_control_label, const char *set_control_label, const char *button_control_label, unsigned options, const char *nexus_name, float low_limit, float high_limit, const char *units, const char *current_value)
int arrayVariantLength(VARIANT *v)
HRESULT SESetBlockValue(BSTR block_name, BSTR block_value)
int unaccessArrayVariant(VARIANT *v)
HRESULT SENewSECIConfig(BSTR config_name)
int makeVariantFromArray(VARIANT *v, const std::vector< T > &the_array)
SELOGGER_API int __stdcall se_log_values_async(long run_number, const char *source, const std::vector< std::string > &iso_times, const std::vector< std::string > &block_names, const std::vector< std::string > &block_values)