ICP  1
Classes | Macros | Typedefs | Enumerations | Functions
selogger.h File Reference
#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)
 

Macro Definition Documentation

#define SELOGGER_API   __declspec(dllexport)

Definition at line 12 of file selogger.h.

Typedef Documentation

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.

Enumeration Type Documentation

Enumerator
Enabled 
RunControl 
LogAtBegin 
LogAtEnd 

Definition at line 19 of file selogger.h.

Function Documentation

SELOGGER_API int __stdcall se_clear_values ( int  run_start,
int  run_finish 
)
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 
)
SELOGGER_API int __stdcall se_get_block_details ( const char *  block_name,
SEBLOCK_DETAILS details 
)
SELOGGER_API int __stdcall se_get_block_values ( seblock_map_t blocks)
SELOGGER_API int __stdcall se_get_blocks ( int  run_number,
time_t  ref_time,
seblock_map_t blocks 
)
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.

See Also
se_log_value

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 
)
SELOGGER_API int __stdcall se_get_measurement_id ( const char *  label,
std::string &  measurement_id 
)
SELOGGER_API int __stdcall se_get_measurement_label ( const char *  measurement_id,
std::string &  res 
)
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 
)
SELOGGER_API int __stdcall se_get_seci_config ( std::string &  seci_config)
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_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.

Parameters
[in]run_numberRun number for which value corresponds
[in]sourceName of program generating value (e.g. SECI, ISISICP)
[in]iso_timeISO8660 time format string "2008-01-01T12:26:23" (NULL means current time)
[in]block_nameName of SE block beging logged
[in]block_valueValue of SE block block_name
Returns
status
Return values
0success
-1Error - call se_get_errmsg() to retrieve error message
See Also
se_close, se_get_errmsg

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 
)
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_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_new_measurement ( const char *  label,
std::string &  res 
)
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.

Parameters
[in]block_nameName of SE block
[in]setpoint_valueThe setpoint, as opposed to current value, of this block. Current values are specified via se_log_value()
[in]vi_nameName of LabVIEW VI associated with block
[in]read_control_labelLabel of control/indicator on vi_name used to obtain the current value for logging purposes
[in]set_control_labelLabel of control/indicator on vi_name used to specify setpoint_value
[in]button_control_labelLabel of button on vi_name to press after set_control_label
[in]optionsORed list of BlockOptions
[in]nexus_namepath to nexus file location for block
[in]low_limitLow limit when run control is being used
[in]high_limitHigh limit when run control is being used
[in]unitsScientific units applicable to values read from this block
[in]current_valuePass "NULL" if not known; can be set later using se_set_block_value()
See Also
se_log_value, 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 
)
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_set_measurement_label ( const char *  measurement_id,
const char *  label 
)
SELOGGER_API int __stdcall se_set_period ( int  period)
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)
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 
)

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().