21 public CComObjectRootEx<CComMultiThreadModel>,
22 public CComCoClass<Cdae, &CLSID_dae>,
23 public ISupportErrorInfo,
24 public IConnectionPointContainerImpl<Cdae>,
26 public IDispatchImpl<Idae, &IID_Idae, &LIBID_isisicpLib, 1, 0>
33 DECLARE_REGISTRY_RESOURCEID(
IDR_DAE)
36 COM_INTERFACE_ENTRY(Idae)
37 COM_INTERFACE_ENTRY(IDispatch)
38 COM_INTERFACE_ENTRY(ISupportErrorInfo)
39 COM_INTERFACE_ENTRY(IConnectionPointContainer)
42 BEGIN_CONNECTION_POINT_MAP(
Cdae)
43 CONNECTION_POINT_ENTRY(__uuidof(_IdaeEvents))
44 END_CONNECTION_POINT_MAP()
46 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
49 DECLARE_PROTECT_FINAL_CONSTRUCT()
51 HRESULT FinalConstruct()
53 if (m_critical == NULL)
55 m_critical =
new CRITICAL_SECTION;
56 InitializeCriticalSection(m_critical);
58 registerICPCallbacks();
71 unregisterICPCallbacks();
82 HRESULT makeResult(
DAEstatus& status, BSTR* messages,
bool force_success_result =
false);
85 int reallocBSTR(BSTR* bstr,
const char* str);
89 HRESULT getSettings(BSTR xml_in, BSTR* xml_out, BSTR* messages, xml_get_func_t func);
90 HRESULT updateSettings(BSTR xml_in, BSTR* messages, xml_set_func_t func);
92 typedef int (
ISISinstrumentControl::*spec_int_func_t)(
long n,
const long spec_no[],
long period,
const float t_low[],
const float t_high[],
long integral[],
long max_val[],
DAEstatus& status);
93 HRESULT getSpectraIntegralHelper(spec_int_func_t func, VARIANT spectrum_numbers, LONG period, VARIANT time_low, VARIANT time_high, VARIANT* counts, BSTR* messages);
97 void registerICPCallbacks();
98 void unregisterICPCallbacks();
101 static BSTR makeBSTR(
const char* str);
103 STDMETHOD(updateStatusXML)(BSTR* cluster_xml, BSTR* messages);
104 STDMETHOD(beginRun)(BSTR* messages);
105 STDMETHOD(endRun)(BSTR* messages);
106 STDMETHOD(pauseRun)(BSTR* messages);
107 STDMETHOD(resumeRun)(BSTR* messages);
108 STDMETHOD(saveRun)(BSTR* messages);
109 STDMETHOD(abortRun)(BSTR* messages);
110 STDMETHOD(startSEWait)(BSTR* messages);
111 STDMETHOD(endSEWait)(BSTR* messages);
112 STDMETHOD(getSpectrum)(LONG spectrum_number, LONG period, VARIANT* time_channels, VARIANT* signal, LONG as_histogram, LONG as_distribution, LONG* sum, BSTR* messages);
113 STDMETHOD(changeTCB)(BSTR tcb_xml, BSTR* messages);
114 STDMETHOD(changeDAEsettings)(BSTR dae_xml, BSTR* messages);
115 STDMETHOD(getSpectrumIntegral)(LONG spectrum_number, LONG period, FLOAT time_low, FLOAT time_high, LONG* counts, BSTR* messages);
116 STDMETHOD(getSpectraIntegral)(VARIANT spectrum_numbers, LONG period, VARIANT time_low, VARIANT time_high, VARIANT* counts, BSTR* messages);
117 STDMETHOD(getsect)(LONG start, LONG length, VARIANT* values, BSTR* messages);
118 STDMETHOD(rio)(LONG address, LONG* value, BSTR* messages);
119 STDMETHOD(getValue)(BSTR name, BSTR* messages, VARIANT* result);
120 STDMETHOD(getRawFramesTotal)(BSTR* messages, LONG* value);
121 STDMETHOD(getGoodFramesTotal)(BSTR* messages, LONG* value);
122 STDMETHOD(getGoodUAmpH)(BSTR* messages, DOUBLE* value);
123 STDMETHOD(getSpectraSum)(LONG period, LONG first_spec, LONG num_spec, LONG spec_type, DOUBLE time_low, DOUBLE time_high, VARIANT* sums, VARIANT* max_vals, VARIANT* spec_nums, BSTR* messages);
124 STDMETHOD(changeSample)(BSTR sample_xml, BSTR* messages);
125 STDMETHOD(changeUser)(BSTR user_xml, BSTR* messages);
126 STDMETHOD(changeHardwarePeriods)(BSTR periods_xml, BSTR* messages);
127 STDMETHOD(changePeriod)(LONG period_number, BSTR* messages);
128 STDMETHOD(dumpDebugInfo)(BSTR* messages);
129 STDMETHOD(VMEWriteValue)(ULONG card_id, ULONG card_address, ULONG word_size, ULONG value, ULONG mode, BSTR* messages);
130 STDMETHOD(VMEReadValue)(ULONG card_id, ULONG card_address, ULONG word_size, ULONG* value, BSTR* messages);
131 STDMETHOD(sumAllSpectra)(LONG* counts, LONG* bin0_counts, BSTR* messages);
132 STDMETHOD(sumAllHistogramMemory)(LONG* counts, BSTR* messages);
133 STDMETHOD(VMEReadArray)(ULONG card_id, ULONG card_address, VARIANT* values, ULONG num_values, BSTR* messages);
134 STDMETHOD(VMEWriteArray)(ULONG card_id, ULONG card_address, VARIANT values, BSTR* messages);
135 STDMETHOD(VMEReadValuesToString)(ULONG card_id, ULONG card_address, ULONG word_size, ULONG num_values, BSTR* values, BSTR* messages);
136 STDMETHOD(refreshCachedValues)(BSTR* messages);
137 STDMETHOD(setOptions)(BSTR options_xml, BSTR* messages);
138 STDMETHOD(getOptions)(BSTR* options_xml, BSTR* messages);
139 STDMETHOD(getArrayValue)(BSTR name, VARIANT arg, BSTR* messages, VARIANT* result);
140 STDMETHOD(updateCRPT)(BSTR* messages);
141 STDMETHOD(storeCRPT)(BSTR* messages);
142 STDMETHOD(setICPValueLong)(BSTR name, LONG value, BSTR* messages);
143 STDMETHOD(notifyICP)(LONG event_id, BSTR param, BSTR* messages);
144 STDMETHOD(setBlocksTable)(VARIANT table, BSTR* messages);
145 STDMETHOD(setSampleParameters)(VARIANT table, BSTR* messages);
146 STDMETHOD(setBeamlineParameters)(VARIANT table, BSTR* messages);
147 STDMETHOD(setUserParameters)(LONG rbno, VARIANT table, BSTR* messages);
148 STDMETHOD(areYouThere)(void);
149 STDMETHOD(changeUpdateSettings)(BSTR update_xml, BSTR* messages);
150 STDMETHOD(getNPRatio)(FLOAT* current, FLOAT* average, BSTR* messages);
151 STDMETHOD(getTotalCounts)(BSTR* messages, LONG* counts);
152 STDMETHOD(getMEvents)(BSTR* messages, DOUBLE* mevents);
153 STDMETHOD(getCurrentPeriodNumber)(LONG* period, LONG* daq_period, BSTR* messages);
154 STDMETHOD(snapshotCRPT)(BSTR filename, LONG do_update, LONG do_pause, BSTR* messages);
155 STDMETHOD(changePeriodWhileRunning)(LONG period, LONG pause_first, BSTR* messages);
156 STDMETHOD(getDAEsettings)(BSTR dae_xml_in, BSTR* dae_xml_out, BSTR* messages);
157 STDMETHOD(getHardwarePeriods)(BSTR periods_xml_in, BSTR* periods_xml_out, BSTR* messages);
158 STDMETHOD(getTCB)(BSTR tcb_xml_in, BSTR* tcb_xml_out, BSTR* messages);
159 STDMETHOD(getUpdateSettings)(BSTR update_xml_in, BSTR* update_xml_out, BSTR* messages);
160 STDMETHOD(changeNumberOfSoftwarePeriods)(LONG nperiod, BSTR* messages);
161 STDMETHOD(getRunState)(BSTR* messages, LONG* state);
162 STDMETHOD(beginRunEx)(LONG options, LONG period, BSTR* messages);
163 STDMETHOD(fillWithTestPattern)(ULONG pattern, BSTR* messages);
164 STDMETHOD(getVetoStatus)(BSTR* veto_status, BSTR* messages);
165 STDMETHOD(loadDAEWithData)(BSTR file_name, LONG options, BSTR* messages);
166 STDMETHOD(setVeto)(BSTR name, LONG enable, BSTR* messages);
167 STDMETHOD(checkTestPattern)(ULONG pattern, BSTR* messages);
168 STDMETHOD(getRunNumber)(BSTR* messages, LONG* run_number);
169 STDMETHOD(changeMonitoringSettings)(BSTR monitor_xml, BSTR* messages);
170 STDMETHOD(getMonitoringSettings)(BSTR monitor_xml_in, BSTR* monitor_xml_out, BSTR* messages);
171 STDMETHOD(getStatusMessages)(LONG stream, VARIANT* messages);
172 STDMETHOD(getGoodFramesPeriod)(BSTR* messages, LONG* value);
173 STDMETHOD(getGoodUAmpHPeriod)(BSTR* messages, DOUBLE* value);
174 STDMETHOD(getFramesAllPeriods)(VARIANT* good_frames, VARIANT* raw_frames, BSTR* messages);
175 STDMETHOD(getUAmpHAllPeriods)(VARIANT* good_uamph, VARIANT* raw_uamph, BSTR* messages);
176 STDMETHOD(getMEventsPeriod)(LONG period, BSTR* messages, DOUBLE* mevents);
177 STDMETHOD(updateCRPTSpectra)(LONG period, LONG spec_start, LONG nspec, BSTR* messages);
178 STDMETHOD(getCRPTSpectraIntegral)(VARIANT spectrum_numbers, LONG period, VARIANT time_low, VARIANT time_high, VARIANT* counts, BSTR* messages);
179 STDMETHOD(quit)(BSTR* messages);
180 STDMETHOD(requestEndRunAfterNextSequenceCompletes)(BSTR* messages);
181 STDMETHOD(isFinalSequenceComplete)(BSTR* messages, LONG* complete);
182 STDMETHOD(getSpectrumNumbersForTR)(LONG time_regime, LONG* spec_min, LONG* spec_max, BSTR* messages);
183 STDMETHOD(getSpectraIntegral2)(LONG spec_start, LONG nspectra, LONG period, FLOAT time_low, FLOAT time_high, VARIANT* counts, BSTR* messages);
184 STDMETHOD(getNumberOfPeriods)(BSTR* messages, LONG* nperiod);
185 STDMETHOD(updateStatusXML2)(BSTR status_xml_in, BSTR* status_xml_out, BSTR* messages);
188 OBJECT_ENTRY_AUTO(__uuidof(
dae),
Cdae)
std::list< boost::signals2::connection > m_connection
static CRITICAL_SECTION * m_critical