ICP  1
isisdae.h
Go to the documentation of this file.
1 /*
2  * This file contains the RIO interface that is callable from FORTRAN
3  *
4  * Author: Freddie Akeroyd
5  */
6 
7 #ifndef ISISDAE_H
8 #define ISISDAE_H
9 
10 #include "isisvme_types.h"
11 #include "isiscrpt_types.h"
12 #include "event_store.h"
13 #include "TCPEventStreamer.h"
14 
15 #include "dae2_card.h"
16 
17 class ISISVME;
18 struct Addmap;
20 class DAE2DetCardPolicy;
22 class DAE3DetCardPolicy;
23 class DetectorCardIntf;
24 class DAE2CardIntf;
25 class EnvPeriodCardIntf;
27 template <class DetCardPolicy> class DetectorCard;
28 template <class EnvPeriodPolicy> class EnvironmentCard;
29 template <class EnvPeriodPolicy> class EnvPeriodCard;
30 
32 {
34  LONG m_ntasks;
35 
36 public:
38 
39 
40  void onProgress(Poco::TaskProgressNotification* pNf)
41  {
42  pNf->release();
43  }
44 
45  void onFinished(Poco::TaskFinishedNotification* pNf)
46  {
47  InterlockedIncrement(&m_nfinished);
48  pNf->task()->name();
49  pNf->release();
50  }
51 
52  void setNumTasks(long ntasks) { m_nfinished = 0; m_ntasks = ntasks; }
53  long nFinished() { return m_nfinished; }
54 };
55 
56 
57 class ISISDAE : public ISIS::Base
58 {
59 private:
60  ISISDAE() {}
61 
62 public:
64  typedef Addmap MyAddmap;
65 
66  static const char* DAEType_desc[]; // list must agree with DAEType enum
68  static const char* PeriodType_desc[]; // list must agree with PeriodType enum
70  {
72  int card_id;
73  int spec;
74  spec_map_info(DetectorCardIntf* _card, int _card_id, int _spec) : card(_card), card_id(_card_id), spec(_spec) { }
75  spec_map_info() : card(NULL), card_id(-1), spec(-1) { }
76  };
77  typedef std::map< int, spec_map_info > dae1spec_map_t;
78  typedef std::map< int, std::vector<int> > dae2spec_map_t;
79  const dae1spec_map_t& getDAE1Specmap() const { return m_dae1_spec_map; }
80  const dae2spec_map_t& getDAE2Specmap() const { return m_dae2_spec_map; }
81 
82 protected:
86  {
89  unsigned long start;
91  int len;
93  histogram_async_t(ISISDAE* dae_, DetectorCardIntf* dc_, unsigned long start_, isisU32_t*buffer_,
94  int len_, DAEstatus& status_) : dae(dae_), dc(dc_), start(start_), buffer(buffer_), len(len_), status(status_) {}
95  };
96  struct test_async_t
97  {
100  unsigned long pattern;
102  test_async_t(ISISDAE* dae_, DetectorCardIntf* dc_, unsigned long pattern_, DAEstatus& status_) :
103  dae(dae_), dc(dc_), pattern(pattern_), status(status_) {}
104  };
105 
106  struct veto_desc
107  {
108  const char* name;
113  };
115  typedef std::vector<ISISVME*> vme_list_t;
116  typedef std::vector<DetectorCardIntf*> det_list_t;
117  typedef std::vector<EnvironmentCardIntf*> env_list_t;
118  typedef std::vector<EnvPeriodCardIntf*> env_period_list_t;
128 // int m_nspectra;
129 // int m_nperiod; // number of periods
130 // int m_period; // current period number
133  Poco::TaskManager m_taskmgr;
135  int updateAddmap(DAEstatus& status);
136  template <class DAEPolicy> int locateCards(ISISVME* vme, int dae_number, DAEstatus& status);
139  CRITICAL_SECTION m_dae_cs;
142  int waitForAsync();
143  int doneAsync();
145  volatile LONG m_num_async_requests;
146  static DWORD __stdcall readDCHistogramThread(void* arg);
147  int readDCHistogramAsync(DetectorCardIntf* dc, unsigned long start, isisU32_t* buffer, int len, DAEstatus& dstatus);
148  static DWORD __stdcall checkTestPatternThread(void* arg);
149  static int daeTriggerFunc(void* arg, time_t the_secs, unsigned short the_ms, int trig_id);
150 
151 public:
152  ISISDAE(DAEType type, DAEstatus& status, bool endian_workaround, bool simulate);
153  virtual ~ISISDAE();
155  isis32_t open(const char* dae_name, DAEstatus& status);
156  isis32_t openBackplane(const char* dae_name_bp, DAEstatus& status);
157  isis32_t close(DAEstatus& status);
158 // int clearPPP(DAEstatus& status);
159  bool isRunning(DAEstatus& status);
160  void printStatus(std::ostream& os, DAEstatus& status);
161  void printAddmap(std::ostream& os, DAEstatus& status);
162  void printSpectrum(int spec, std::ostream& os, DAEstatus& status);
163 
164  DetectorCardIntf* findDetectorCard(int position, DAEstatus& status);
165 
166  int readHistogramMemory(unsigned long start, isisU32_t* buffer, int len, DAEstatus& status);
168 
169 // int writeHistogramMemory(unsigned long start, isisU32_t* buffer, int len);
170  int clearHistogramMemory(DAEstatus& status);
171 // int readPOSLUTMemory(unsigned long start, isisU32_t* buffer, int len, DAEstatus& status);
172  int writePOSLUTMemory(int card_id, isisU32_t* buffer, int len, DAEstatus& status);
173  int clearPOSLUTMemory(DAEstatus& status);
174 // int readTCGLUTMemory(unsigned long start, isisU32_t* buffer, int len, DAEstatus& status);
175 // int writeTCGLUTMemory(unsigned long start, isisU32_t* buffer, int len, DAEstatus& status);
176  int writeHistogramMemory(int card_id, isisU32_t* buffer, int start, int len, DAEstatus& status);
177 
178  int getRawFrames(isisU32_t* value, DAEstatus& status);
179  int getGoodFrames(isisU32_t* value, DAEstatus& status);
180 
181  int getRawPPPLower(isisU32_t* value, DAEstatus& status);
182  int getRawPPPUpper(isisU32_t* value, DAEstatus& status);
183 
184  int getGoodPPPLower(isisU32_t* value, DAEstatus& status);
185  int getGoodPPPUpper(isisU32_t* value, DAEstatus& status);
186 
187  int getRawFramesPeriod(isisU32_t* value, int period, DAEstatus& status);
188  int getGoodFramesPeriod(isisU32_t* value, int period, DAEstatus& status);
189 
190  float getRawUAmpHours(DAEstatus& status);
191  float getGoodUAmpHours(DAEstatus& status);
192 
193  float getRawUAmpHoursPeriod(int period, DAEstatus& status);
194  float getGoodUAmpHoursPeriod(int period, DAEstatus& status);
195  int getRawPPPLowerPeriod(int period, isisU32_t* value, DAEstatus& status);
196  int getRawPPPUpperPeriod(int period, isisU32_t* value, DAEstatus& status);
197  int getGoodPPPLowerPeriod(int period, isisU32_t* value, DAEstatus& status);
198  int getGoodPPPUpperPeriod(int period, isisU32_t* value, DAEstatus& status);
199 
200  int setTimeChannels(int crat, isisU32_t* tcb, int ntc, DAEstatus& status);
201  int setTimeChannels(int crat, int start[], int nbound[], int step[], int nblocks, DAEstatus& status);
202  int readDAE1Spectrum(int dae1_spectrum, isisU32_t* buffer, int nbuffer, DAEstatus& status);
203  int readDAE1Spectra(isisU32_t* buffer, int nbuffer, int spec_to_crpt_offset[], int spec_start, int nspec, int period, int persize, DAEstatus& status);
204  int readAllDAE1Spectra(isisU32_t* buffer, int nbuffer, int spec_to_crpt_offset[], int persize, DAEstatus& status);
205  int programDAE1POSLUT(int crat[], int maxcrate, int modn[],
206  int mpos[], int spec[], int ndet,
207  int nper_daq, DAEstatus& status);
208  int programPOSLUT(int cards[], int dims[], int pos_start[],
209  int npos[], int spec[], int spec_step[],
210  int nblocks, DAEstatus& status);
211  int startRun(bool clear_counters, int run_number, time_t& start_time, DAEstatus& status);
212  int stopRun(StopRunMode mode, DAEstatus& status);
213  int changePeriod(int period, int daq_period, DAEstatus& status);
214  int changeNumberOfPeriods(int nperiod, DAEstatus& status);
215  int resetRunController(DAEstatus& status);
216  int setDAE1Vetos(int vetos[], int n, DAEstatus& status);
217 // int addTimeChannels(int offset_chan, int start, int nchan, int step, DAEstatus& status);
218  int setFrameSync(FrameSync fs, int muon_pulse, DAEstatus& status);
219  int setFrameSyncDelay(isisU32_t delay, DAEstatus& status); // in us
220  int getFrameSyncDelay(isisU32_t* delay, DAEstatus& status); // in us
221  int setDCFrameSyncDelay(int crat, isisU32_t delay, DAEstatus& status); // in us
222  int getDCFrameSyncDelay(int crat, isisU32_t* delay, DAEstatus& status); // in us
223  int setPeriodType(ISISDAE::PeriodType type, bool single_daq_period, DAEstatus& status);
224  int getCurrentHardwarePeriod(isisU32_t *period, DAEstatus& status);
225  int getCurrentDAQHardwarePeriod(isisU32_t *period, DAEstatus& status);
226  int getCurrentPeriodSequence(isisU32_t *period_sequence, DAEstatus& status);
227  int getSMPVetoedFrames(isisU32_t* value, DAEstatus& status);
228  int getExternalVetoedFrames(int veto_number, isisU32_t* value, DAEstatus& status);
229  int getFIFOVetoedFrames(isisU32_t* value, DAEstatus& status);
230  int getTS2PulseVetoedFrames(isisU32_t* value, DAEstatus& status);
231  int getISIS50HzVetoedFrames(isisU32_t* value, DAEstatus& status);
232  int getMSModeVetoedFrames(isisU32_t* value, DAEstatus& status);
233  int getTotalCounts(int64_t* value, DAEstatus& status);
234  int programPeriodCard(PeriodType period_type, int nper, int nperseq_request, isisU32_t* outputs, isisU16_t *dwell_flags, isisU16_t *frames,
235  int period_output_delay, DAEstatus& status);
236  int disablePeriodCard(DAEstatus& status);
238  template <class DAECardPolicy> int VMEWriteValue(unsigned long card_id, unsigned long card_address, bool sixteen_bit, unsigned long value, unsigned long mode, DAEstatus& status);
239  template <class DAECardPolicy> int VMEReadValue(unsigned long card_id, unsigned long card_address, bool sixteen_bit, unsigned long *value, DAEstatus& status);
240  template <class DAECardPolicy> int VMEWriteArray(unsigned long card_id, unsigned long card_address, isisU32_t* values, unsigned long num_values, DAEstatus& status);
241  template <class DAECardPolicy> int VMEReadArray(unsigned long card_id, unsigned long card_address, isisU32_t* values, unsigned long num_values, DAEstatus& status);
242  int clearCounters(DAEstatus& status);
243  int clearCounters(int run_number, DAEstatus& status);
244  int fillWithTestPattern(unsigned long pattern, DAEstatus& status);
245  int checkTestPattern(unsigned long pattern, DAEstatus& status);
246  int checkTestPatternAsync(unsigned long pattern, DAEstatus& status);
247  int getVetoStatus(std::string& veto_text, DAEstatus& status);
248  int whichVeto(std::string& veto_text, DAEstatus& status);
249  int setVeto(const std::string& name, bool enable, DAEstatus& status);
250  void setUAmpScale(float scale) { m_uamp_scale = scale; }
251  int enableDelayedStart(DAEstatus& status);
252  int disableDelayedStart(DAEstatus& status);
253 
254  void setEventMode(bool value) { m_event_mode = value; }
255 // bool isEventMode() const { return m_event_mode; }
256  void clearDCEventMode(DAEstatus& status);
257  void setDCEventMode(unsigned long card_id, bool value, DAEstatus& status);
258  void setDCCardMode(unsigned long card_id, bool neutron_data, DAEstatus& status);
259 
260  isis32_t check(DAEstatus& status);
261 
263  bool isFinalSequenceComplete(DAEstatus& status);
264 
265  std::list<boost::signals2::connection> addGoodEventCallback(const EventCallbackSlotType& slot)
266  {
267  return m_es.addGoodEventCallback(slot);
268  }
269  std::list<boost::signals2::connection> addAllEventCallback(const EventCallbackSlotType& slot)
270  {
271  return m_es.addAllEventCallback(slot);
272  }
273  std::list<boost::signals2::connection> addGoodFrameCallback(const FrameCallbackSlotType& slot)
274  {
275  return m_es.addGoodFrameCallback(slot);
276  }
277  std::list<boost::signals2::connection> addAllFrameCallback(const FrameCallbackSlotType& slot)
278  {
279  return m_es.addAllFrameCallback(slot);
280  }
281  std::list<boost::signals2::connection> addNoFrameCallback(const NoFrameCallbackSlotType& slot)
282  {
283  return m_es.addNoFrameCallback(slot);
284  }
285  void clearCallbacks(const std::list<boost::signals2::connection>& callback_list)
286  {
287  m_es.clearCallbacks(callback_list);
288  }
289  void getEventSourceIDs(std::vector<int>& ids)
290  {
291  m_es.getEventSourceIDs(ids);
292  }
293  void getEnabledEventSourceIDs(std::vector<int>& ids)
294  {
296  }
297 
298  double frameTimerDrift(DAEstatus& status); // icp - dae
299  void closeEventFiles(DAEstatus& status);
300  int getExternalResetCommands(std::list< std::pair<std::string,std::string> >& commands, DAEstatus& status);
301 
302  void startEventBroadcaster(const CRPTProxy& crpt) { new TCPEventStreamer(m_es, crpt); }
303 
304 protected:
305  int clearFramesVetosAndPPP(DAEstatus& status);
307  int readDescriptorTimeBinLimitRegister(int det_card, isisU32_t* value, DAEstatus& status);
308  int writeDescriptorTimeBinLimitRegister(int det_card, isisU32_t value, DAEstatus& status);
309  int readTCGTimeBinLimitRegister(int det_card, isisU32_t* value, DAEstatus& status);
310  int writeTCGTimeBinLimitRegister(int det_card, isisU32_t value, DAEstatus& status);
311  DetectorCardIntf* getDCForSpectrum(int spec) const;
312  int getDCSpecForSpectrum(int spec) const;
313  void getDCSpecInfoForSpectrum(int spec, spec_map_info& info) const;
314  int getNTimeChannels(int spectrum, isisU32_t* ntc, DAEstatus& status);
315  int getSpectrumSize(int spectrum, isisU32_t* nchan, DAEstatus& status);
316  int getTimeChannels(int spec, isisU32_t* tcb, int ntc, DAEstatus& status);
317  int getTimeChannels(int spec, double* tcb, int ntc, DAEstatus& status);
318 };
319 
321 {
322  dae1spec_map_t::const_iterator it = m_dae1_spec_map.find(spec);
323  return (it != m_dae1_spec_map.end() ? it->second.card : NULL);
324 }
325 
326 inline int ISISDAE::getDCSpecForSpectrum(int spec) const
327 {
328  dae1spec_map_t::const_iterator it = m_dae1_spec_map.find(spec);
329  return (it != m_dae1_spec_map.end() ? it->second.spec : -1);
330 }
331 
332 inline void ISISDAE::getDCSpecInfoForSpectrum(int spec, spec_map_info& info) const
333 {
334  dae1spec_map_t::const_iterator it = m_dae1_spec_map.find(spec);
335  if (it != m_dae1_spec_map.end())
336  {
337  info = it->second;
338  }
339  else
340  {
341  info.card = NULL;
342  info.spec = -1;
343  }
344 }
345 
346 #endif /* ISISDAE_H */
env_veto_set_func_t ec_disable
Definition: isisdae.h:111
env_list_t m_envCards
Definition: isisdae.h:121
int getVetoStatus(std::string &veto_text, DAEstatus &status)
Definition: isisdae.cpp:1950
int setPeriodType(ISISDAE::PeriodType type, bool single_daq_period, DAEstatus &status)
Definition: isisdae.cpp:1576
CRITICAL_SECTION m_dae_cs
Definition: isisdae.h:139
bool isMultiplePeriodSequenceComplete(DAEstatus &status)
Definition: isisdae.cpp:1777
int(EnvironmentCardIntf::* env_veto_set_func_t)(DAEstatus &status)
Definition: isisdae.h:83
int setVeto(const std::string &name, bool enable, DAEstatus &status)
Definition: isisdae.cpp:1447
int m_clock_frequency
Definition: isisdae.h:131
float getGoodUAmpHoursPeriod(int period, DAEstatus &status)
Definition: isisdae.cpp:1065
int whichVeto(std::string &veto_text, DAEstatus &status)
Definition: isisdae.cpp:1958
int getRawPPPLowerPeriod(int period, isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1077
int setDAE1Vetos(int vetos[], int n, DAEstatus &status)
Definition: isisdae.cpp:1362
int getGoodPPPLower(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1043
int writePOSLUTMemory(int card_id, isisU32_t *buffer, int len, DAEstatus &status)
Definition: isisdae.cpp:1970
PeriodType
Definition: isisdae.h:67
std::list< boost::signals2::connection > addGoodFrameCallback(const FrameCallbackSlotType &slot)
float getRawUAmpHoursPeriod(int period, DAEstatus &status)
Definition: isisdae.cpp:1053
void printAddmap(std::ostream &os, DAEstatus &status)
Definition: isisdae.cpp:268
int getGoodPPPUpperPeriod(int period, isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1116
void setEventMode(bool value)
Definition: isisdae.h:254
env_period_list_t m_envPeriodCards
Definition: isisdae.h:122
int stopRun(StopRunMode mode, DAEstatus &status)
Definition: isisdae.cpp:877
int getGoodPPPUpper(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1048
bool isFinalSequenceComplete(DAEstatus &status)
Definition: isisdae.cpp:2074
StopRunMode
Definition: isisdae.h:154
int readDAE1Spectra(isisU32_t *buffer, int nbuffer, int spec_to_crpt_offset[], int spec_start, int nspec, int period, int persize, DAEstatus &status)
Definition: isisdae.cpp:535
int getNTimeChannels(int spectrum, isisU32_t *ntc, DAEstatus &status)
Definition: isisdae.cpp:305
void getEventSourceIDs(std::vector< int > &ids)
Definition: isisdae.h:289
DAEType m_dae_type
Definition: isisdae.h:137
int spec
spectrum on card
Definition: isisdae.h:73
void clearDCEventMode(DAEstatus &status)
Definition: isisdae.cpp:2056
bool isRunning(DAEstatus &status)
Definition: isisdae.cpp:1129
float m_uamp_scale
Definition: isisdae.h:132
void onFinished(Poco::TaskFinishedNotification *pNf)
Definition: isisdae.h:45
void setDCEventMode(unsigned long card_id, bool value, DAEstatus &status)
Definition: isisdae.cpp:2029
std::list< boost::signals2::connection > addGoodFrameCallback(const FrameCallbackSlotType &slot)
Definition: isisdae.h:273
void getEnabledEventSourceIDs(std::vector< int > &ids)
Definition: isisdae.h:293
std::vector< EnvPeriodCardIntf * > env_period_list_t
Definition: isisdae.h:118
NoFrameCallbackType::slot_type NoFrameCallbackSlotType
Definition: event_store.h:22
void setDCCardMode(unsigned long card_id, bool neutron_data, DAEstatus &status)
Definition: isisdae.cpp:2043
unsigned long isisU32_t
Definition: isisvme_types.h:8
int getRawFramesPeriod(isisU32_t *value, int period, DAEstatus &status)
Definition: isisdae.cpp:1002
unsigned long start
Definition: isisdae.h:89
isis32_t open(const char *dae_name, DAEstatus &status)
Definition: isisdae.cpp:613
det_list_t m_detCards
Definition: isisdae.h:120
int programPOSLUT(int cards[], int dims[], int pos_start[], int npos[], int spec[], int spec_step[], int nblocks, DAEstatus &status)
Definition: isisdae.cpp:413
bool m_simulate
Definition: isisdae.h:140
int m_lenAddmap
Definition: isisdae.h:127
HANDLE m_async_complete_event
Definition: isisdae.h:144
int clearHistogramMemory(DAEstatus &status)
Definition: isisdae.cpp:815
int clearCounters(DAEstatus &status)
Definition: isisdae.cpp:836
static DWORD __stdcall readDCHistogramThread(void *arg)
Definition: isisdae.cpp:196
int getTotalCounts(int64_t *value, DAEstatus &status)
Definition: isisdae.cpp:1685
histogram_async_t(ISISDAE *dae_, DetectorCardIntf *dc_, unsigned long start_, isisU32_t *buffer_, int len_, DAEstatus &status_)
Definition: isisdae.h:93
int getExternalResetCommands(std::list< std::pair< std::string, std::string > > &commands, DAEstatus &status)
Definition: isisdae.cpp:2085
void setNumTasks(long ntasks)
Definition: isisdae.h:52
env_pc_veto_set_func_t pc_enable
Definition: isisdae.h:110
int getRawPPPLower(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1033
int getSMPVetoedFrames(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1647
void getEnabledEventSourceIDs(std::vector< int > &ids)
Definition: event_store.cpp:43
test_async_t(ISISDAE *dae_, DetectorCardIntf *dc_, unsigned long pattern_, DAEstatus &status_)
Definition: isisdae.h:102
int locateCards(ISISVME *vme, int dae_number, DAEstatus &status)
Definition: isisdae.cpp:723
int writeHistogramMemory(int card_id, isisU32_t *buffer, int start, int len, DAEstatus &status)
Definition: isisdae.cpp:1985
void startEventBroadcaster(const CRPTProxy &crpt)
Definition: isisdae.h:302
int changeNumberOfPeriods(int nperiod, DAEstatus &status)
Definition: isisdae.cpp:231
DetectorCardIntf * dc
Definition: isisdae.h:99
static veto_desc veto_setters[]
Definition: isisdae.h:114
int getDCSpecForSpectrum(int spec) const
Definition: isisdae.h:326
int VMEWriteArray(unsigned long card_id, unsigned long card_address, isisU32_t *values, unsigned long num_values, DAEstatus &status)
Definition: isisdae.cpp:1865
std::map< int, spec_map_info > dae1spec_map_t
Definition: isisdae.h:77
static const char * DAEType_desc[]
Definition: isisdae.h:66
Poco::TaskManager m_taskmgr
Definition: isisdae.h:133
std::list< boost::signals2::connection > addAllEventCallback(const EventCallbackSlotType &slot)
Definition: isisdae.h:269
const char * name
Definition: isisdae.h:108
int getExternalVetoedFrames(int veto_number, isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1662
int getGoodFramesPeriod(isisU32_t *value, int period, DAEstatus &status)
Definition: isisdae.cpp:1015
EventStore m_es
Definition: isisdae.h:126
int resetRunController(DAEstatus &status)
Definition: isisdae.cpp:987
int clearTotalCountsRegisters(DAEstatus &status)
Definition: isisdae.cpp:1698
std::vector< ISISVME * > vme_list_t
Definition: isisdae.h:115
int getTS2PulseVetoedFrames(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1652
volatile LONG m_num_async_requests
Definition: isisdae.h:145
void clearCallbacks(const std::list< boost::signals2::connection > &callback_list)
Definition: event_store.h:91
int setDCFrameSyncDelay(int crat, isisU32_t delay, DAEstatus &status)
Definition: isisdae.cpp:1524
int getTimeChannels(int spec, isisU32_t *tcb, int ntc, DAEstatus &status)
Definition: isisdae.cpp:311
int setTimeChannels(int crat, isisU32_t *tcb, int ntc, DAEstatus &status)
Definition: isisdae.cpp:341
std::list< boost::signals2::connection > addAllFrameCallback(const FrameCallbackSlotType &slot)
int getFIFOVetoedFrames(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1667
void clearCallbacks(const std::list< boost::signals2::connection > &callback_list)
Definition: isisdae.h:285
int writeTCGTimeBinLimitRegister(int det_card, isisU32_t value, DAEstatus &status)
Definition: isisdae.cpp:1349
std::list< boost::signals2::connection > addGoodEventCallback(const EventCallbackSlotType &slot)
int getISIS50HzVetoedFrames(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1657
int getSpectrumSize(int spectrum, isisU32_t *nchan, DAEstatus &status)
Definition: isisdae.cpp:299
std::vector< EnvironmentCardIntf * > env_list_t
Definition: isisdae.h:117
void printStatus(std::ostream &os, DAEstatus &status)
Definition: isisdae.cpp:241
unsigned long pattern
Definition: isisdae.h:100
int startRun(bool clear_counters, int run_number, time_t &start_time, DAEstatus &status)
Definition: isisdae.cpp:843
int readAllDAE1Spectra(isisU32_t *buffer, int nbuffer, int spec_to_crpt_offset[], int persize, DAEstatus &status)
@ todo specttrum 0 may have differet size for time regimes
Definition: isisdae.cpp:561
env_pc_veto_set_func_t pc_disable
Definition: isisdae.h:112
vme_list_t m_vme
Definition: isisdae.h:119
DetectorCardIntf * card
Definition: isisdae.h:71
isis32_t openBackplane(const char *dae_name_bp, DAEstatus &status)
Definition: isisdae.cpp:604
int VMEReadValue(unsigned long card_id, unsigned long card_address, bool sixteen_bit, unsigned long *value, DAEstatus &status)
Definition: isisdae.cpp:1843
int getRawFrames(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:997
unsigned short isisU16_t
Definition: isisvme_types.h:7
int enableDelayedStart(DAEstatus &status)
Definition: isisdae.cpp:2001
FrameSync
Definition: isiscrpt_types.h:5
std::list< boost::signals2::connection > addAllFrameCallback(const FrameCallbackSlotType &slot)
Definition: isisdae.h:277
int getGoodPPPLowerPeriod(int period, isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1103
env_veto_set_func_t ec_enable
Definition: isisdae.h:109
PeriodType m_period_mode
Definition: isisdae.h:138
int clearFramesVetosAndPPP(DAEstatus &status)
Definition: isisdae.cpp:1562
int checkTestPattern(unsigned long pattern, DAEstatus &status)
Definition: isisdae.cpp:1938
DAEProgressHandler m_task_ph
Definition: isisdae.h:134
int disablePeriodCard(DAEstatus &status)
Definition: isisdae.cpp:1755
bool m_event_mode
Definition: isisdae.h:141
std::vector< DetectorCardIntf * > det_list_t
Definition: isisdae.h:116
int clearPOSLUTMemory(DAEstatus &status)
Definition: isisdae.cpp:355
void getDCSpecInfoForSpectrum(int spec, spec_map_info &info) const
Definition: isisdae.h:332
int disableDelayedStart(DAEstatus &status)
Definition: isisdae.cpp:2016
int waitForAsync()
Definition: isisdae.cpp:168
int updateAddmap(DAEstatus &status)
Definition: isisdae.cpp:426
DetectorCardIntf * dc
Definition: isisdae.h:88
spec_map_info(DetectorCardIntf *_card, int _card_id, int _spec)
Definition: isisdae.h:74
void setUAmpScale(float scale)
Definition: isisdae.h:250
int VMEWriteValue(unsigned long card_id, unsigned long card_address, bool sixteen_bit, unsigned long value, unsigned long mode, DAEstatus &status)
Definition: isisdae.cpp:1790
long nFinished()
Definition: isisdae.h:53
isis32_t close(DAEstatus &status)
Definition: isisdae.cpp:710
Addmap MyAddmap
Definition: isisdae.h:64
static const char * PeriodType_desc[]
Definition: isisdae.h:68
isis32_t check(DAEstatus &status)
Definition: isisdae.cpp:691
float getRawUAmpHours(DAEstatus &status)
Definition: isisdae.cpp:1557
float getGoodUAmpHours(DAEstatus &status)
Definition: isisdae.cpp:1552
static DWORD __stdcall checkTestPatternThread(void *arg)
Definition: isisdae.cpp:1895
dae2spec_map_t m_dae2_spec_map
Definition: isisdae.h:125
const dae1spec_map_t & getDAE1Specmap() const
Definition: isisdae.h:79
int changePeriod(int period, int daq_period, DAEstatus &status)
Definition: isisdae.cpp:221
DetectorCardIntf * findDetectorCard(int position, DAEstatus &status)
Definition: isisdae.cpp:1135
int fillWithTestPattern(unsigned long pattern, DAEstatus &status)
Definition: isisdae.cpp:1927
int(EnvPeriodCardIntf::* env_pc_veto_set_func_t)(DAEstatus &status)
Definition: isisdae.h:84
int getRawPPPUpperPeriod(int period, isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1090
std::list< boost::signals2::connection > addNoFrameCallback(const NoFrameCallbackSlotType &slot)
MyAddmap * m_addmap
Definition: isisdae.h:123
FrameCallbackType::slot_type FrameCallbackSlotType
Definition: event_store.h:18
isisU32_t sumAllHistogramMemory(DAEstatus &status)
Definition: isisdae.cpp:1323
static int daeTriggerFunc(void *arg, time_t the_secs, unsigned short the_ms, int trig_id)
Definition: isisdae.cpp:675
int getFrameSyncDelay(isisU32_t *delay, DAEstatus &status)
Definition: isisdae.cpp:1519
int getRawPPPUpper(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1038
int setFrameSync(FrameSync fs, int muon_pulse, DAEstatus &status)
Definition: isisdae.cpp:1491
virtual ~ISISDAE()
Definition: isisdae.cpp:150
int requestEndRunAfterNextSequenceCompletes(DAEstatus &status)
Definition: isisdae.cpp:2062
void closeEventFiles(DAEstatus &status)
Definition: isisdae.cpp:872
int card_id
position() or crate
Definition: isisdae.h:72
DAEstatus & status
Definition: isisdae.h:101
int programDAE1POSLUT(int crat[], int maxcrate, int modn[], int mpos[], int spec[], int ndet, int nper_daq, DAEstatus &status)
Definition: isisdae.cpp:365
void onProgress(Poco::TaskProgressNotification *pNf)
Definition: isisdae.h:40
int readDAE1Spectrum(int dae1_spectrum, isisU32_t *buffer, int nbuffer, DAEstatus &status)
Definition: isisdae.cpp:498
int programPeriodCard(PeriodType period_type, int nper, int nperseq_request, isisU32_t *outputs, isisU16_t *dwell_flags, isisU16_t *frames, int period_output_delay, DAEstatus &status)
Definition: isisdae.cpp:1710
int readHistogramMemory(unsigned long start, isisU32_t *buffer, int len, DAEstatus &status)
Definition: isisdae.cpp:1220
int setFrameSyncDelay(isisU32_t delay, DAEstatus &status)
Definition: isisdae.cpp:1501
int writeDescriptorTimeBinLimitRegister(int det_card, isisU32_t value, DAEstatus &status)
Definition: isisdae.cpp:1339
int getDCFrameSyncDelay(int crat, isisU32_t *delay, DAEstatus &status)
Definition: isisdae.cpp:1538
EventCallbackType::slot_type EventCallbackSlotType
Definition: event_store.h:15
long isis32_t
Definition: isisvme_types.h:14
ISISDAE()
Definition: isisdae.h:60
std::list< boost::signals2::connection > addNoFrameCallback(const NoFrameCallbackSlotType &slot)
Definition: isisdae.h:281
int doneAsync()
called by async worker thread when it has completed its work
Definition: isisdae.cpp:188
dae1spec_map_t m_dae1_spec_map
Definition: isisdae.h:124
std::map< int, std::vector< int > > dae2spec_map_t
Definition: isisdae.h:78
void getEventSourceIDs(std::vector< int > &ids)
Definition: event_store.cpp:34
std::list< boost::signals2::connection > addAllEventCallback(const EventCallbackSlotType &slot)
int checkTestPatternAsync(unsigned long pattern, DAEstatus &status)
Definition: isisdae.cpp:1904
int getCurrentPeriodSequence(isisU32_t *period_sequence, DAEstatus &status)
Definition: isisdae.cpp:1764
const dae2spec_map_t & getDAE2Specmap() const
Definition: isisdae.h:80
double frameTimerDrift(DAEstatus &status)
frame timer drift (icp - dae)
Definition: isisdae.cpp:1507
int readDescriptorTimeBinLimitRegister(int det_card, isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1334
int VMEReadArray(unsigned long card_id, unsigned long card_address, isisU32_t *values, unsigned long num_values, DAEstatus &status)
Definition: isisdae.cpp:1873
void printSpectrum(int spec, std::ostream &os, DAEstatus &status)
Definition: isisdae.cpp:280
int getCurrentHardwarePeriod(isisU32_t *period, DAEstatus &status)
Definition: isisdae.cpp:1597
int getCurrentDAQHardwarePeriod(isisU32_t *period, DAEstatus &status)
Definition: isisdae.cpp:1619
std::list< boost::signals2::connection > addGoodEventCallback(const EventCallbackSlotType &slot)
Definition: isisdae.h:265
int readDCHistogramAsync(DetectorCardIntf *dc, unsigned long start, isisU32_t *buffer, int len, DAEstatus &dstatus)
Definition: isisdae.cpp:205
int getMSModeVetoedFrames(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1672
int getGoodFrames(isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1028
DetectorCardIntf * getDCForSpectrum(int spec) const
Definition: isisdae.h:320
int readTCGTimeBinLimitRegister(int det_card, isisU32_t *value, DAEstatus &status)
Definition: isisdae.cpp:1344
DAEType
Definition: isisdae.h:63