ICP
1
|
#include "stdafx.h"
#include "selogger.h"
#include "isisdb.h"
#include "epicsdb.h"
#include "icputils.h"
Go to the source code of this file.
Classes | |
struct | MyOverlapped |
struct | my_overlap_t |
struct | workpacket |
struct | se_log_values_t |
struct | se_clear_values2_t |
struct | se_set_period_t |
struct | se_set_run_state_t |
Macros | |
#define | SQLITE_CHECK_RC(__rc) |
#define | SQLITE_HANDLE_EXCEPTION(__func_name) |
#define | OPEN_DATABASE |
Functions | |
static void | my_overlap (void *arg) |
static void | my_io_complete (void *arg) |
static HANDLE | createAppendFile (const char *filename) |
static void | appendToFileAsync (HANDLE h, const char *message, bool close_after_write) |
static void | appendToFileAsync (const char *filename, const char *message) |
BOOL APIENTRY | DllMain (HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) |
static time_t | unixTime (const char *isotime) |
static int | ISOtime (time_t time, char *buffer, int len) |
static int __stdcall | se_log_values_list (const std::list< se_log_values_t * > *tlist) |
static void | process_requests (void *arg) |
static int | general_init () |
static int __stdcall | se_async (workpacket *work) |
static int | count_rows_callback (void *arg, int argc, char **argv, char **azColName) |
const char *__stdcall | se_version () |
static int | my_sqlite3_exec (sqlite3 *db, const char *sql, int(*callback)(void *, int, char **, char **), void *arg, char **errmsg) |
static int | se_set_config_param (const char *name, const char *value) |
static int | se_get_config_param (const char *name, std::string &value) |
static int | se_set_config_param (const char *name, long value) |
static long | get_run_number () |
static long | get_period () |
static int | isReal (const char *value) |
SELOGGER_API int __stdcall | se_start_epics_thread (epics_thread_data_t *arg) |
SELOGGER_API int __stdcall | se_set_block_value (const char *block_name, const char *block_value) |
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 (long run_number, const char *source, const char *iso_time, const char *block_name, const char *block_value) |
SELOGGER_API int __stdcall | se_wait_for_async () |
static int __stdcall | se_async (se_log_values_t *work) |
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_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_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_close () |
SELOGGER_API const char *__stdcall | se_get_errmsg () |
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_set_run_number (int run_number) |
SELOGGER_API int __stdcall | se_set_period (int period) |
SELOGGER_API int __stdcall | se_get_seci_config (std::string &seci_config) |
SELOGGER_API int __stdcall | se_set_run_state (int run_number, const char *state, int is_start) |
SELOGGER_API int __stdcall | se_new_seci_config (const char *config_name) |
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) |
static int | seblock_rows_callback (void *arg, int argc, char **argv, char **) |
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_get_measurement_first_run (const char *measurement_id, long &run_number) |
static int | se_clear_values2 (int run_start, int run_finish) |
SELOGGER_API int __stdcall | se_clear_values2_async (int run_start, int run_finish) |
SELOGGER_API int __stdcall | se_clear_values (int run_start, int run_finish) |
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) |
static void | db_profile_func (void *arg, const char *sql, sqlite3_uint64 tim) |
SELOGGER_API int __stdcall | se_profile (const char *filename) |
SELOGGER_API int __stdcall | se_set_period_async (int period) |
SELOGGER_API int __stdcall | se_set_run_state_async (int run_number, const char *state, int is_start) |
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 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_block_details (const char *block_name, SEBLOCK_DETAILS &block) |
SELOGGER_API int __stdcall | se_exec_sql (const char *sql, std::string &result) |
Variables | |
static bool | database_debug = (getenv("ICP_DATABASE_DEBUG") != NULL) |
static const char * | database_debug_file = "c:\\data\\log\\database_debug.txt" |
static HANDLE | file_complete = NULL |
static char | last_error [1024] |
static volatile LONG | num_async_requests = 0 |
static volatile uint64_t | num_work_iterations = 0 |
static volatile HANDLE | async_complete_event = NULL |
static CRITICAL_SECTION | work_critical |
static volatile HANDLE | work_queued = NULL |
static std::list< workpacket * > | worklist |
static std::list < se_log_values_t * > * | se_worklist = NULL |
#define OPEN_DATABASE |
Definition at line 340 of file selogger.cpp.
Referenced by se_clear_values2(), se_exec_sql(), se_get_block_details(), se_get_block_values(), se_get_blocks(), se_get_config_param(), se_get_measurement_first_run(), se_get_measurement_id(), se_get_measurement_label(), se_get_run_status(), se_get_values(), se_log_run(), se_log_values(), se_log_values_list(), se_new_measurement(), se_new_seci_config(), se_profile(), se_set_block_details(), se_set_block_setpoints(), se_set_block_values(), se_set_config_param(), se_set_measurement_label(), se_set_run_state(), and se_version().
#define SQLITE_CHECK_RC | ( | __rc | ) |
Definition at line 325 of file selogger.cpp.
Referenced by se_clear_values2(), se_get_block_values(), se_get_blocks(), se_get_config_param(), se_get_measurement_first_run(), se_get_measurement_id(), se_get_measurement_label(), se_get_run_status(), se_log_run(), se_log_values(), se_log_values_list(), se_new_measurement(), se_new_seci_config(), se_set_block_details(), se_set_block_setpoints(), se_set_block_values(), se_set_config_param(), and se_set_run_state().
#define SQLITE_HANDLE_EXCEPTION | ( | __func_name | ) |
Definition at line 333 of file selogger.cpp.
Referenced by se_clear_values2(), se_exec_sql(), se_get_block_details(), se_get_config_param(), se_get_measurement_first_run(), se_get_measurement_id(), se_get_measurement_label(), se_get_values(), se_log_run(), se_log_values(), se_log_values_list(), se_new_measurement(), se_new_seci_config(), se_set_block_details(), se_set_block_setpoints(), se_set_block_values(), se_set_config_param(), se_set_measurement_label(), and se_set_run_state().
|
static |
Definition at line 89 of file selogger.cpp.
References my_overlap_t::data, and my_overlap().
|
static |
Definition at line 111 of file selogger.cpp.
References appendToFileAsync(), and createAppendFile().
|
static |
Definition at line 317 of file selogger.cpp.
|
static |
Definition at line 71 of file selogger.cpp.
References file_complete, and my_io_complete().
|
static |
Definition at line 1322 of file selogger.cpp.
Referenced by se_profile().
BOOL APIENTRY DllMain | ( | HMODULE | hModule, |
DWORD | ul_reason_for_call, | ||
LPVOID | lpReserved | ||
) |
Definition at line 131 of file selogger.cpp.
|
static |
Definition at line 290 of file selogger.cpp.
References process_requests().
Referenced by se_async(), and se_wait_for_async().
|
static |
Definition at line 432 of file selogger.cpp.
References se_get_config_param().
|
static |
Definition at line 419 of file selogger.cpp.
References se_get_config_param().
Referenced by se_get_block_details(), se_get_block_values(), se_new_seci_config(), se_set_block_details(), se_set_block_setpoints(), and se_set_block_values().
|
static |
Definition at line 181 of file selogger.cpp.
Referenced by IXNeXusFile::addLog(), se_new_measurement(), se_set_block_details(), se_set_block_setpoints(), se_set_block_values(), and se_set_run_state().
|
static |
Definition at line 445 of file selogger.cpp.
Referenced by se_log_values(), se_log_values_list(), se_set_block_details(), and se_set_block_values().
|
static |
Definition at line 57 of file selogger.cpp.
References MyOverlapped::arg, file_complete, and MyOverlapped::func.
|
static |
Definition at line 49 of file selogger.cpp.
Referenced by appendToFileAsync().
|
static |
Definition at line 358 of file selogger.cpp.
Referenced by se_clear_values2(), se_get_blocks(), se_log_run(), se_log_values(), se_log_values_list(), se_new_measurement(), se_new_seci_config(), se_set_block_details(), se_set_block_setpoints(), se_set_block_values(), se_set_config_param(), se_set_measurement_label(), and se_set_run_state().
|
static |
Definition at line 251 of file selogger.cpp.
References workpacket::do_work(), num_work_iterations, se_log_values_list(), and se_worklist.
Referenced by general_init().
|
static |
Definition at line 305 of file selogger.cpp.
References general_init().
Referenced by se_clear_values2_async(), se_log_value_async(), se_log_values_async(), se_set_period_async(), and se_set_run_state_async().
|
static |
Definition at line 552 of file selogger.cpp.
References general_init().
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().
|
static |
Definition at line 1000 of file selogger.cpp.
References my_sqlite3_exec(), OPEN_DATABASE, SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by se_clear_values2_t::execute().
SELOGGER_API int __stdcall se_clear_values2_async | ( | int | run_start, |
int | run_finish | ||
) |
Definition at line 1035 of file selogger.cpp.
References se_async().
Referenced by se_clear_values().
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 & | block | ||
) |
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().
|
static |
Definition at line 385 of file selogger.cpp.
References OPEN_DATABASE, SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by get_period(), get_run_number(), se_clear_values(), se_get_seci_config(), se_get_values(), se_log_values(), se_log_values_list(), and se_new_measurement().
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_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().
|
static |
Definition at line 641 of file selogger.cpp.
References se_log_values_t::block_names, se_log_values_t::block_values, se_log_values_t::iso_times, isReal(), my_sqlite3_exec(), OPEN_DATABASE, se_log_values_t::run_number, se_get_config_param(), se_log_values_t::source, SQLITE_CHECK_RC, SQLITE_HANDLE_EXCEPTION, and unixTime().
Referenced by process_requests().
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().
|
static |
Definition at line 365 of file selogger.cpp.
References my_sqlite3_exec(), OPEN_DATABASE, SQLITE_CHECK_RC, and SQLITE_HANDLE_EXCEPTION.
Referenced by se_new_seci_config(), se_set_config_param(), se_set_period(), and se_set_run_number().
|
static |
Definition at line 412 of file selogger.cpp.
References se_set_config_param().
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().
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().
|
static |
Definition at line 815 of file selogger.cpp.
References SEBLOCK::button_control, SEBLOCK::current_value, SEBLOCK::fcurrent_spread, SEBLOCK::fcurrent_value, SEBLOCK::fsetpoint_spread, SEBLOCK::fsetpoint_value, SEBLOCK::high_limit, SEBLOCK::is_real, SEBLOCK::low_limit, SEBLOCK::nexus_name, SEBLOCK::options, SEBLOCK::read_control, SEBLOCK::set_control, SEBLOCK::setpoint_value, SEBLOCK::units, and SEBLOCK::vi_name.
Referenced by se_get_block_values(), and se_get_blocks().
|
static |
Definition at line 153 of file selogger.cpp.
Referenced by IXNeXusFile::addLog(), se_log_run(), se_log_values(), se_log_values_list(), and se_set_run_state().
|
static |
Definition at line 202 of file selogger.cpp.
|
static |
Definition at line 10 of file selogger.cpp.
Referenced by se_log_values(), and se_set_block_values().
|
static |
Definition at line 11 of file selogger.cpp.
Referenced by se_log_values(), and se_set_block_values().
|
static |
Definition at line 55 of file selogger.cpp.
Referenced by createAppendFile(), and my_io_complete().
|
static |
Definition at line 198 of file selogger.cpp.
Referenced by ISISDB::closeDatabase(), ISISDB::exec(), ISISDB::ISISDB(), and se_get_errmsg().
|
static |
Definition at line 200 of file selogger.cpp.
|
static |
Definition at line 201 of file selogger.cpp.
Referenced by process_requests().
|
static |
Definition at line 247 of file selogger.cpp.
Referenced by process_requests().
|
static |
Definition at line 203 of file selogger.cpp.
|
static |
Definition at line 204 of file selogger.cpp.
|
static |
Definition at line 230 of file selogger.cpp.