11 #ifndef LV_DCOM_INTERFACE_H
12 #define LV_DCOM_INTERFACE_H
23 #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
41 #include <epicsMutex.h>
42 #include <epicsThread.h>
43 #include <epicsExit.h>
47 #include "labview.tlh"
58 LabVIEW::VirtualInstrumentPtr
vi_ref;
79 lvDCOMInterface(
const char* configSection,
const char *configFile,
const char* host,
int options,
const char* progid,
const char* username,
const char* password);
81 void getParams(std::map<std::string,std::string>& res);
82 template<
typename T>
void setLabviewValue(
const char* param,
const T& value);
84 template<
typename T>
void getLabviewValue(
const char* param, T* value,
size_t nElements,
size_t& nIn);
86 std::string
doPath(
const std::string& xpath);
87 std::string
doXPATH(
const std::string& xpath);
89 void report(FILE* fp,
int details);
107 CComPtr<LabVIEW::_Application>
m_lv;
113 void getViRef(BSTR vi_name,
bool reentrant, LabVIEW::VirtualInstrumentPtr &vi);
114 void createViRef(BSTR vi_name,
bool reentrant, LabVIEW::VirtualInstrumentPtr &vi);
116 void setLabviewValue(BSTR vi_name, BSTR control_name,
const VARIANT& value);
117 void setLabviewValueExt(BSTR vi_name, BSTR control_name,
const VARIANT& value, VARIANT* results);
118 void callLabview(BSTR vi_name, VARIANT& names, VARIANT& values, VARIANT_BOOL reentrant, VARIANT* results);
120 COAUTHIDENTITY*
createIdentity(
const std::string& user,
const std::string& domain,
const std::string& pass);
121 HRESULT
setIdentity(COAUTHIDENTITY* pidentity, IUnknown* pUnk);
123 void stopVis(
bool only_ones_we_started);
lvDCOMOptions
Options that can be passed from EPICS iocsh via lvDCOMConfigure command.
COAUTHIDENTITY * m_pidentity
std::string m_configSection
section of configFile to load information from
(4) On IOC exit, stop any LabVIEW VIs that we started due to viStartIfIdle being specified ...
CComPtr< LabVIEW::_Application > m_lv
bool started
did we start this vi because it was idle and viStartIfIdle was specified
void waitForLabviewBoolean(BSTR vi_name, BSTR control_name, bool value)
(8) On IOC exit, stop any LabVIEW VIs that we have connected to
std::string doPath(const std::string &xpath)
IXMLDOMDocument2 * m_pxmldom
void callLabview(BSTR vi_name, VARIANT &names, VARIANT &values, VARIANT_BOOL reentrant, VARIANT *results)
void report(FILE *fp, int details)
Helper for EPICS driver report function.
bool reentrant
is the VI reentrant
int m_options
the various lvDCOMOptions currently in use
std::map< std::string, bool > m_xpath_bool_map
void getParams(std::map< std::string, std::string > &res)
std::string doXPATH(const std::string &xpath)
std::map< std::string, std::string > m_xpath_map
static void epicsExitFunc(void *arg)
void stopVis(bool only_ones_we_started)
Manager class for LabVIEW DCOM Interaction. Parses an lvinput.xml file and provides access to the Lab...
void setLabviewValue(const char *param, const T &value)
std::map< std::wstring, ViRef > vi_map_t
ViRef(LabVIEW::VirtualInstrumentPtr vi_ref_, bool reentrant_, bool started_)
HRESULT setIdentity(COAUTHIDENTITY *pidentity, IUnknown *pUnk)
(1) If the LabVIEW VI is idle when we connect to it, issue a warning message
Hold a reference to a LabVIEW VI.
void getLabviewValue(const char *param, T *value)
(2) If the LabVIEW VI is idle when we connect to it, attempt to start it
COAUTHIDENTITY * createIdentity(const std::string &user, const std::string &domain, const std::string &pass)
bool checkOption(lvDCOMOptions option)
void createViRef(BSTR vi_name, bool reentrant, LabVIEW::VirtualInstrumentPtr &vi)
void setLabviewValueExt(BSTR vi_name, BSTR control_name, const VARIANT &value, VARIANT *results)
LabVIEW::VirtualInstrumentPtr vi_ref
bool doXPATHbool(const std::string &xpath)
lvDCOMInterface(const char *configSection, const char *configFile, const char *host, int options, const char *progid, const char *username, const char *password)
section name of configFile to use to configure this asyn port
void getViRef(BSTR vi_name, bool reentrant, LabVIEW::VirtualInstrumentPtr &vi)