ICP
1
|
#include <Poco/Tuple.h>
Go to the source code of this file.
Classes | |
class | SEBLOCK_DETAILS |
struct | SEBLOCK |
struct | RUNBLOCK |
struct | epics_thread_data_t |
Macros | |
#define | SELOGGER_API __declspec(dllexport) |
Typedefs | |
typedef Poco::Tuple < std::string, std::string, std::string, std::string, std::string, std::string, int, std::string, float, float, std::string, std::string, int, std::string, std::string, std::string > | SEBLOCK_DETAILS_tuple |
typedef std::map< std::string, SEBLOCK > | seblock_map_t |
Enumerations | |
enum | BlockOptions { Enabled =0x1, RunControl =0x2, LogAtBegin =0x4, LogAtEnd =0x8 } |
Functions | |
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_start_epics_thread (epics_thread_data_t *arg) |
SELOGGER_API int __stdcall | se_close () |
SELOGGER_API const char *__stdcall | se_get_errmsg () |
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) |
SELOGGER_API int __stdcall | se_get_block_details (const char *block_name, SEBLOCK_DETAILS &details) |
SELOGGER_API int __stdcall | se_new_seci_config (const char *config_name) |
SELOGGER_API int __stdcall | se_log_run (int run_number, const char *source, const char *iso_time, int period, int run_status, int is_running, int is_waiting, int good_frames, int raw_frames, float good_uamph, float raw_uamph, int64_t monitor_sum0, float dae_beam_current, int64_t total_counts, float count_rate, float npratio_current) |
SELOGGER_API int __stdcall | se_get_num_blocks () |
SELOGGER_API int __stdcall | se_get_seci_config (std::string &seci_config) |
SELOGGER_API int __stdcall | se_set_block_value (const char *block_name, const char *block_value) |
SELOGGER_API int __stdcall | se_get_blocks (int run_number, time_t ref_time, seblock_map_t &blocks) |
SELOGGER_API int __stdcall | se_get_run_status (int run_number, time_t ref_time, RUNBLOCK &blocks) |
SELOGGER_API int __stdcall | se_set_run_state (int run_number, const char *state, int is_start) |
SELOGGER_API int __stdcall | se_set_run_state_async (int run_number, const char *state, int is_start) |
SELOGGER_API int __stdcall | se_set_run_number (int run_number) |
SELOGGER_API int __stdcall | se_set_period (int period) |
SELOGGER_API int __stdcall | se_set_period_async (int period) |
SELOGGER_API int __stdcall | se_new_measurement (const char *label, std::string &res) |
SELOGGER_API int __stdcall | se_get_measurement_label (const char *measurement_id, std::string &res) |
SELOGGER_API int __stdcall | se_set_measurement_label (const char *measurement_id, const char *label) |
SELOGGER_API int __stdcall | se_get_measurement_id (const char *label, std::string &measurement_id) |
SELOGGER_API int __stdcall | se_clear_values (int run_start, int run_finish) |
SELOGGER_API int __stdcall | se_profile (const char *filename) |
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) |
SELOGGER_API int __stdcall | se_log_fvalues (long run_number, const char *source, const std::vector< std::string > &iso_times, const std::vector< std::string > &block_names, const std::vector< float > &block_values) |
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_log_value_async (long run_number, const char *source, const char *iso_time, const char *block_name, const char *block_value) |
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) |
SELOGGER_API int __stdcall | se_wait_for_async () |
SELOGGER_API int __stdcall | se_get_measurement_first_run (const char *measurement_id, long &run_number) |
SELOGGER_API int __stdcall | se_get_block_values (seblock_map_t &blocks) |
SELOGGER_API int __stdcall | se_set_block_setpoint (const char *block_name, const char *block_setpoint) |
SELOGGER_API int __stdcall | se_set_block_setpoints (const std::vector< std::string > &block_names, const std::vector< std::string > &block_setpoints) |
SELOGGER_API const char *__stdcall | se_version () |
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_exec_sql (const char *sql, std::string &result) |
#define SELOGGER_API __declspec(dllexport) |
Definition at line 12 of file selogger.h.
typedef Poco::Tuple<std::string, std::string, std::string, std::string, std::string, std::string, int, std::string, float, float, std::string, std::string, int, std::string, std::string, std::string> SEBLOCK_DETAILS_tuple |
Definition at line 26 of file selogger.h.
typedef std::map<std::string, SEBLOCK> seblock_map_t |
Definition at line 128 of file selogger.h.
enum BlockOptions |
Enumerator | |
---|---|
Enabled | |
RunControl | |
LogAtBegin | |
LogAtEnd |
Definition at line 19 of file selogger.h.
SELOGGER_API int __stdcall se_clear_values | ( | int | run_start, |
int | run_finish | ||
) |
Definition at line 1040 of file selogger.cpp.
References se_clear_values2_async(), and se_get_config_param().
Referenced by InstAPILib::clearDatabaseLogs(), ISISinstrumentControl::endRunTask(), and Cselog::SEClearLoggedValues().
SELOGGER_API int __stdcall se_close | ( | ) |
Definition at line 691 of file selogger.cpp.
Referenced by Cselog::SEClose(), and ISISinstrumentControl::~ISISinstrumentControl().
SELOGGER_API int __stdcall se_exec_sql | ( | const char * | sql, |
std::string & | result | ||
) |
Definition at line 1503 of file selogger.cpp.
References OPEN_DATABASE, se_exec_sql(), SQLITE_HANDLE_EXCEPTION, and sqlite_session_pool.
Referenced by se_exec_sql(), and Cselog::SEExecSQL().
SELOGGER_API int __stdcall se_get_block_details | ( | const char * | block_name, |
SEBLOCK_DETAILS & | details | ||
) |
Definition at line 1481 of file selogger.cpp.
References get_run_number(), OPEN_DATABASE, se_get_block_details(), SQLITE_HANDLE_EXCEPTION, sqlite_session_pool, and SEBLOCK_DETAILS::tuple().
Referenced by InstAPILib::getBlockSetpoint(), InstAPILib::getBlockValue(), InstAPILib::pushBlockButton(), se_get_block_details(), and InstAPILib::setBlockSetpoint().
SELOGGER_API int __stdcall se_get_block_values | ( | seblock_map_t & | blocks | ) |
Definition at line 1388 of file selogger.cpp.
References get_run_number(), OPEN_DATABASE, seblock_rows_callback(), and SQLITE_CHECK_RC.
Referenced by ISISinstrumentControl::setBeamlineParameters(), ISISinstrumentControl::setSampleParameters(), and ISISinstrumentControl::updateFunc().
SELOGGER_API int __stdcall se_get_blocks | ( | int | run_number, |
time_t | ref_time, | ||
seblock_map_t & | blocks | ||
) |
Definition at line 1060 of file selogger.cpp.
References SEBLOCK::current_value, SEBLOCK::fcurrent_spread, SEBLOCK::fcurrent_value, SEBLOCK::fsetpoint_spread, SEBLOCK::fsetpoint_value, SEBLOCK::fvalues, SEBLOCK::is_real, my_sqlite3_exec(), OPEN_DATABASE, SEBLOCK::ref_time, se_wait_for_async(), seblock_rows_callback(), SEBLOCK::setpoint_value, SQLITE_CHECK_RC, SEBLOCK::svalues, and SEBLOCK::time.
Referenced by ISISinstrumentControl::getSE().
SELOGGER_API const char* __stdcall se_get_errmsg | ( | ) |
retrieve the error message after a return code of -1 from another se_* call. The pointer is to static storage and should not be deallocated - the error message will remain there until the next error on calling a se_* function, so you should make a copy if not using it immediately.
Definition at line 696 of file selogger.cpp.
References last_error.
Referenced by ISISinstrumentControl::changePeriod(), ISISinstrumentControl::endRunMain(), ISISinstrumentControl::endRunTask(), InstAPILib::getBlockSetpoint(), InstAPILib::getBlockValue(), ISISinstrumentControl::getSE(), ISISinstrumentControl::ISISinstrumentControl(), InstAPILib::logBlocksNow(), ISISinstrumentControl::logEvent(), InstAPILib::pushBlockButton(), Cselog::SEClearLoggedValues(), Cselog::SEClose(), Cselog::SEExecSQL(), Cselog::SEGetMeasurementID(), Cselog::SEGetMeasurementLabel(), Cselog::SEGetSECIConfig(), Cselog::SEGetValues(), Cselog::SELogValue(), Cselog::SELogValues(), Cselog::SELogValuesAsync(), Cselog::SENewMeasurement(), Cselog::SENewSECIConfig(), Cselog::SESetBlockDetails(), Cselog::SESetBlockSetpoint(), Cselog::SESetBlockSetpoints(), Cselog::SESetBlockValue(), Cselog::SESetBlockValues(), Cselog::SESetMeasurementLabel(), InstAPILib::setBlockSetpoint(), ISISinstrumentControl::setRunStatusImp(), ISISinstrumentControl::updateFunc(), ISISinstrumentControl::updateICPTimeDiffLog(), ISISinstrumentControl::updateMonitoringLog(), ISISinstrumentControl::updateStatusLog(), NeXusWriter::writeISISNeXus(), and ISISinstrumentControl::~ISISinstrumentControl().
SELOGGER_API int __stdcall se_get_measurement_first_run | ( | const char * | measurement_id, |
long & | run_number | ||
) |
Definition at line 974 of file selogger.cpp.
References OPEN_DATABASE, se_get_measurement_first_run(), SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by se_get_measurement_first_run(), NeXusWriter::writeISISNeXus(), ISISinstrumentControl::writeJournal(), and writeSummaryNeXus().
SELOGGER_API int __stdcall se_get_measurement_id | ( | const char * | label, |
std::string & | measurement_id | ||
) |
Definition at line 947 of file selogger.cpp.
References OPEN_DATABASE, se_get_measurement_id(), SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by InstAPILib::getMeasurementId(), se_get_measurement_id(), and Cselog::SEGetMeasurementID().
SELOGGER_API int __stdcall se_get_measurement_label | ( | const char * | measurement_id, |
std::string & | res | ||
) |
Definition at line 905 of file selogger.cpp.
References OPEN_DATABASE, se_get_measurement_label(), SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by InstAPILib::getMeasurementLabel(), se_get_measurement_label(), Cselog::SEGetMeasurementLabel(), NeXusWriter::writeISISNeXus(), ISISinstrumentControl::writeJournal(), and writeSummaryNeXus().
SELOGGER_API int __stdcall se_get_num_blocks | ( | ) |
SELOGGER_API int __stdcall se_get_run_status | ( | int | run_number, |
time_t | ref_time, | ||
RUNBLOCK & | blocks | ||
) |
Definition at line 1248 of file selogger.cpp.
References RUNBLOCK::count_rate, RUNBLOCK::dae_beam_current, RUNBLOCK::good_frames, RUNBLOCK::good_uamps, RUNBLOCK::is_running, RUNBLOCK::is_waiting, RUNBLOCK::monitor1_sum, RUNBLOCK::np_ratio, OPEN_DATABASE, RUNBLOCK::period, RUNBLOCK::raw_frames, RUNBLOCK::raw_uamps, RUNBLOCK::ref_time, RUNBLOCK::run_status, SQLITE_CHECK_RC, RUNBLOCK::time, and RUNBLOCK::total_counts.
Referenced by NeXusWriter::writeISISNeXus().
SELOGGER_API int __stdcall se_get_seci_config | ( | std::string & | seci_config | ) |
Definition at line 739 of file selogger.cpp.
References se_get_config_param().
Referenced by InstAPILib::getSeciConfig(), Cselog::SEGetSECIConfig(), NeXusWriter::writeISISNeXus(), and ISISinstrumentControl::writeJournal().
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 | ||
) |
Definition at line 1446 of file selogger.cpp.
References OPEN_DATABASE, se_get_config_param(), se_get_values(), SQLITE_HANDLE_EXCEPTION, and sqlite_session_pool.
Referenced by se_get_values(), and Cselog::SEGetValues().
SELOGGER_API int __stdcall se_log_fvalues | ( | long | run_number, |
const char * | source, | ||
const std::vector< std::string > & | iso_times, | ||
const std::vector< std::string > & | block_names, | ||
const std::vector< float > & | block_values | ||
) |
Definition at line 578 of file selogger.cpp.
References se_log_values().
Referenced by run_epics_db().
SELOGGER_API int __stdcall se_log_run | ( | int | run_number, |
const char * | source, | ||
const char * | iso_time, | ||
int | period, | ||
int | run_status, | ||
int | is_running, | ||
int | is_waiting, | ||
int | good_frames, | ||
int | raw_frames, | ||
float | good_uamph, | ||
float | raw_uamph, | ||
int64_t | monitor_sum0, | ||
float | dae_beam_current, | ||
int64_t | total_counts, | ||
float | count_rate, | ||
float | npratio_current | ||
) |
Log run status (used by ICP only)
Definition at line 701 of file selogger.cpp.
References my_sqlite3_exec(), OPEN_DATABASE, se_log_run(), SQLITE_CHECK_RC, SQLITE_HANDLE_EXCEPTION, and unixTime().
Referenced by se_log_run(), and ISISinstrumentControl::updateStatusLog().
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 | ||
) |
Log a value to the SE sqlite database. The database is opened automatically by this call if it is not already open and kept open for subsequent calls. You should call se_close() when your process is shutting down.
[in] | run_number | Run number for which value corresponds |
[in] | source | Name of program generating value (e.g. SECI, ISISICP) |
[in] | iso_time | ISO8660 time format string "2008-01-01T12:26:23" (NULL means current time) |
[in] | block_name | Name of SE block beging logged |
[in] | block_value | Value of SE block block_name |
0 | success |
-1 | Error - call se_get_errmsg() to retrieve error message |
Definition at line 525 of file selogger.cpp.
References se_log_values().
Referenced by Cselog::SELogValue().
SELOGGER_API int __stdcall se_log_value_async | ( | long | run_number, |
const char * | source, | ||
const char * | iso_time, | ||
const char * | block_name, | ||
const char * | block_value | ||
) |
Definition at line 567 of file selogger.cpp.
References se_async().
Referenced by ISISinstrumentControl::logEvent(), ISISinstrumentControl::sqliteReportFunction(), and ISISinstrumentControl::updateICPTimeDiffLog().
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 | ||
) |
Definition at line 589 of file selogger.cpp.
References appendToFileAsync(), database_debug, database_debug_file, isReal(), my_sqlite3_exec(), OPEN_DATABASE, se_get_config_param(), se_log_values(), SQLITE_CHECK_RC, SQLITE_HANDLE_EXCEPTION, and unixTime().
Referenced by se_log_fvalues(), se_log_value(), se_log_values(), and Cselog::SELogValues().
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 | ||
) |
Definition at line 572 of file selogger.cpp.
References se_async().
Referenced by InstAPILib::logBlocksNow(), Cselog::SELogValuesAsync(), and ISISinstrumentControl::updateMonitoringLog().
SELOGGER_API int __stdcall se_new_measurement | ( | const char * | label, |
std::string & | res | ||
) |
Definition at line 872 of file selogger.cpp.
References ISOtime(), my_sqlite3_exec(), OPEN_DATABASE, se_get_config_param(), se_new_measurement(), SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by InstAPILib::getMeasurementId(), se_new_measurement(), and Cselog::SENewMeasurement().
SELOGGER_API int __stdcall se_new_seci_config | ( | const char * | config_name | ) |
called when seci opens a config. This will clear out the current block list, so this will need to be repopulated via calls to se_set_block_details()
Definition at line 764 of file selogger.cpp.
References get_run_number(), my_sqlite3_exec(), OPEN_DATABASE, se_new_seci_config(), se_set_config_param(), SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by se_new_seci_config(), and Cselog::SENewSECIConfig().
SELOGGER_API int __stdcall se_profile | ( | const char * | filename | ) |
Definition at line 1328 of file selogger.cpp.
References db_profile_func(), and OPEN_DATABASE.
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 | ||
) |
Set details of a block. This should be called for all blocks on a program startup, and then called for an individual block when its parameters change.
[in] | block_name | Name of SE block |
[in] | setpoint_value | The setpoint, as opposed to current value, of this block. Current values are specified via se_log_value() |
[in] | vi_name | Name of LabVIEW VI associated with block |
[in] | read_control_label | Label of control/indicator on vi_name used to obtain the current value for logging purposes |
[in] | set_control_label | Label of control/indicator on vi_name used to specify setpoint_value |
[in] | button_control_label | Label of button on vi_name to press after set_control_label |
[in] | options | ORed list of BlockOptions |
[in] | nexus_name | path to nexus file location for block |
[in] | low_limit | Low limit when run control is being used |
[in] | high_limit | High limit when run control is being used |
[in] | units | Scientific units applicable to values read from this block |
[in] | current_value | Pass "NULL" if not known; can be set later using se_set_block_value() |
Definition at line 784 of file selogger.cpp.
References get_run_number(), ISOtime(), isReal(), my_sqlite3_exec(), OPEN_DATABASE, se_set_block_details(), SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by se_set_block_details(), se_set_run_state(), and Cselog::SESetBlockDetails().
SELOGGER_API int __stdcall se_set_block_setpoint | ( | const char * | block_name, |
const char * | block_setpoint | ||
) |
Definition at line 1404 of file selogger.cpp.
References se_set_block_setpoints().
Referenced by Cselog::SESetBlockSetpoint().
SELOGGER_API int __stdcall se_set_block_setpoints | ( | const std::vector< std::string > & | block_names, |
const std::vector< std::string > & | block_setpoints | ||
) |
Definition at line 1413 of file selogger.cpp.
References get_run_number(), ISOtime(), my_sqlite3_exec(), OPEN_DATABASE, se_set_block_setpoints(), SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by se_set_block_setpoint(), se_set_block_setpoints(), and Cselog::SESetBlockSetpoints().
SELOGGER_API int __stdcall se_set_block_value | ( | const char * | block_name, |
const char * | block_value | ||
) |
Definition at line 475 of file selogger.cpp.
References se_set_block_values().
Referenced by Cselog::SESetBlockValue(), and InstAPILib::setBlockSetpoint().
SELOGGER_API int __stdcall se_set_block_values | ( | const std::vector< std::string > & | block_names, |
const std::vector< std::string > & | block_values | ||
) |
Definition at line 484 of file selogger.cpp.
References appendToFileAsync(), database_debug, database_debug_file, get_run_number(), ISOtime(), isReal(), my_sqlite3_exec(), OPEN_DATABASE, se_set_block_values(), SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by se_set_block_value(), se_set_block_values(), and Cselog::SESetBlockValues().
SELOGGER_API int __stdcall se_set_measurement_label | ( | const char * | measurement_id, |
const char * | label | ||
) |
Definition at line 931 of file selogger.cpp.
References my_sqlite3_exec(), OPEN_DATABASE, se_set_measurement_label(), and SQLITE_HANDLE_EXCEPTION.
Referenced by se_set_measurement_label(), Cselog::SESetMeasurementLabel(), and InstAPILib::setMeasurementLabel().
SELOGGER_API int __stdcall se_set_period | ( | int | period | ) |
Definition at line 734 of file selogger.cpp.
References se_set_config_param().
Referenced by se_set_period_t::execute(), and ISISinstrumentControl::ISISinstrumentControl().
SELOGGER_API int __stdcall se_set_period_async | ( | int | period | ) |
Definition at line 1356 of file selogger.cpp.
References se_async().
Referenced by ISISinstrumentControl::changePeriod().
SELOGGER_API int __stdcall se_set_run_number | ( | int | run_number | ) |
Definition at line 729 of file selogger.cpp.
References se_set_config_param().
Referenced by ISISinstrumentControl::endRunMain(), and ISISinstrumentControl::ISISinstrumentControl().
SELOGGER_API int __stdcall se_set_run_state | ( | int | run_number, |
const char * | state, | ||
int | is_start | ||
) |
Definition at line 744 of file selogger.cpp.
References ISOtime(), my_sqlite3_exec(), OPEN_DATABASE, se_set_block_details(), SQLITE_CHECK_RC, SQLITE_HANDLE_EXCEPTION, and unixTime().
Referenced by se_set_run_state_t::execute(), and ISISinstrumentControl::setRunStatusImp().
SELOGGER_API int __stdcall se_set_run_state_async | ( | int | run_number, |
const char * | state, | ||
int | is_start | ||
) |
Definition at line 1382 of file selogger.cpp.
References se_async().
SELOGGER_API int __stdcall se_start_epics_thread | ( | epics_thread_data_t * | arg | ) |
Close database during a process shutdown.
Definition at line 469 of file selogger.cpp.
References run_epics_db().
Referenced by ISISinstrumentControl::ISISinstrumentControl().
SELOGGER_API const char* __stdcall se_version | ( | ) |
Definition at line 345 of file selogger.cpp.
References OPEN_DATABASE.
Referenced by ISISinstrumentControl::ISISinstrumentControl().
SELOGGER_API int __stdcall se_wait_for_async | ( | ) |
Definition at line 537 of file selogger.cpp.
References general_init().
Referenced by se_get_blocks(), NeXusWriter::writeISISNeXus(), and NeXusWriter::writeMuonFile().