21 #define END_IMMEDIATELY_FILE "c:\\data\\end_now.dae"
23 #define ENV_FUNCTION(__func) \
24 ( (m_envCards.size() > 0) ? (m_envCards[0]->__func) : \
25 ((m_envPeriodCards.size() > 0) ? (m_envPeriodCards[0]->__func) : 0) )
27 #define PERIOD_FUNCTION(__func) \
28 ((m_envPeriodCards.size() > 0) ? (m_envPeriodCards[0]->__func) : 0)
42 for(
int i=0; i<ncards; ++i)
47 while(ncomplete < ncards)
50 for(
int i=0; i<ncards; ++i)
57 setProgress((
float)ncomplete / (
float)ncards);
63 if (ncomplete < ncards)
107 Poco::Task::cancel();
113 m_lenAddmap(0), m_dae_type(type), m_period_mode(
ISISDAE::PeriodTypeSoftware), m_simulate(simulate),
114 m_num_async_requests(0),m_async_complete_event(NULL), m_uamp_scale(1.0),m_event_mode(false)
119 static SECURITY_ATTRIBUTES sec_attr = {
sizeof(SECURITY_ATTRIBUTES), NULL, FALSE };
120 InitializeCriticalSection(&
m_dae_cs);
144 template <
typename T>
161 std::for_each(
m_vme.begin(),
m_vme.end(), deletePtr<ISISVME>);
226 (*it)->changePeriod(daq_period, status);
236 (*it)->changeNumberOfPeriods(nperiod, status);
244 os <<
"VME DAE with " <<
m_envCards.size() <<
" ENVIRONMENT card(s), "
246 <<
m_detCards.size() <<
" DETECTOR card(s)\n";
247 os <<
"Number of DAE crates = " <<
m_vme.size() <<
"\n";
250 os <<
"Number of DAE1 spectra = " <<
m_lenAddmap <<
"\n";
271 os <<
"DAE Address map" << std::endl;
272 os <<
"dae1_spec dae1_add dae2_card dae2_spec dae2_add dae2_len" << std::endl;
289 os <<
"Spectrum " << spec <<
"\n";
290 os <<
"Channel 0 contains " << buffer[0] <<
" counts" <<
"\n";
291 for(i=0; i < nchan-1; i++)
318 int step[],
int nblocks,
DAEstatus& status)
322 for(i=0; i<nblocks; i++)
328 for(i=0; i<nblocks; i++)
330 for(j=0; j<nbound[i]; j++)
332 tcb[k++] = start[i] + j * step[i];
366 int mpos[],
int spec[],
int ndet,
369 int i, specmax, dae1persize;
372 for(i=0; i<ndet; i++)
374 if (specmax < spec[i])
381 dae1persize = specmax + 1;
385 dae1persize = specmax + 1;
387 int* crate_used =
new int[maxcrate+1];
388 for(i=0; i<=maxcrate; i++)
392 for(i=0; i<ndet; i++)
394 crate_used[crat[i]] = 1;
396 for(i=0; i<=maxcrate; i++)
399 if ( (dc == 0) && (crate_used[i] == 1) )
407 m_detCards[i]->programDAE1POSLUT(crat, modn, mpos, spec, ndet, nper_daq, dae1persize, status);
414 int npos[],
int spec[],
int spec_step[],
420 m_detCards[i]->programPOSLUT(cards, dims, pos_start, npos, spec, spec_step, nblocks, 1, 0, status);
445 m_detCards[0]->getSpectrumSize(&nchan, status);
464 vec[j] = spec_map[j];
472 len_specmap = m_nDetCards * (3+DAESPECMAX);
473 int *specmap_array =
new int[len_specmap];
475 for(i=0; i<m_nDetCards; i++)
477 offset =
m_detCards[i]->saveDAE2SpecmapToArray(specmap_array, offset, len_specmap);
479 FILE* f = fopen(
"c:\\daevme_specmap.dat",
"wb");
482 if (fwrite(specmap_array,
sizeof(
int), offset, f) != offset)
484 *m_pErr <<
"Error updating addmap" << std::endl;
490 *m_pErr <<
"error updating addmap" << std::endl;
492 delete []specmap_array;
503 if (dae1_spectrum == 0)
505 memset(buffer, 0, nbuffer *
sizeof(
isisU32_t));
511 for(j=0; j<nbuffer; j++)
513 buffer[j] += tmp_buffer[j];
544 m_detCards[i]->readDAE1Spectra(buffer, nbuffer, spec_to_crpt_offset, spec_start + spec0, nspec - spec0, period, persize, status);
550 if ( nchan != spec_to_crpt_offset[1] )
552 status.
addInfoVa(
FAC_DAE,
"Correcting spectrum 0 size from %d to %d", nchan, spec_to_crpt_offset[1]);
553 nchan = spec_to_crpt_offset[1];
568 buffer, nbuffer, spec_to_crpt_offset, persize, status));
573 if ( nchan != spec_to_crpt_offset[1] )
575 status.
addInfoVa(
FAC_DAE,
"Correcting spectrum 0 size from %d to %d", nchan, spec_to_crpt_offset[1]);
576 nchan = spec_to_crpt_offset[1];
580 if (Poco::Util::Application::instance().config().getBool(
"isisicp.testHistogramCheck",
false))
584 memset(dat1, 4, nbuffer*
sizeof(
isisU32_t));
586 compareBuffers(
"readHistogramMemory", dat1, buffer, nbuffer, status);
587 memset(dat1, 4, nbuffer*
sizeof(
isisU32_t));
588 int nperiod = nbuffer / persize;
590 for(i=0; i < nperiod; ++i)
592 readDAE1Spectra(dat1, nbuffer, spec_to_crpt_offset, 0, perspec, i, persize, status);
595 memset(dat1, 4, nbuffer*
sizeof(
isisU32_t));
596 readDAE1Spectra(dat1, nbuffer, spec_to_crpt_offset, 0, perspec*nperiod, 0, persize, status);
597 compareBuffers(
"readDAE1Spectra2", dat1, buffer, nbuffer, status);
606 status.
addInfoVa(
FAC_DAE,
"Opening connection to VISA resource %s\n", dae_name_bp);
617 status.
addInfoVa(
FAC_DAE,
"Opening connection to VISA resource %s\n", dae_name);
642 int dae_number =
static_cast<int>(
m_vme.size() - 1);
646 if (getenv(
"ISISVME_SCANBUS") != NULL)
652 "SCAN ERROR - there should be 3 VXI?::*::INSTR devices on the VME bus\n"
653 "You must add a dummy device covering the whole A32 address range\n"
654 "Using the T&M explorer National Instruments program");
659 status.
addInfo(
FAC_DAE,
"ScanBus skipped - set ISISVME_SCANBUS environment variable to enable");
662 vme->
open(dae_name, status);
665 locateCards<DAE3Policy>(vme, dae_number, status);
669 locateCards<DAE2Policy>(vme, dae_number, status);
677 static long frame_count = 0;
678 static long run_count = 0;
697 "Error - Found %u environment cards (must have 1) and %u detector cards", i,
m_detCards.size());
703 "Error - Found %u period cards (only 0 or 1 allowed) and %u detector cards", i,
m_detCards.size());
713 for(vme_list_t::iterator it =
m_vme.begin(); it !=
m_vme.end(); ++it)
715 (*it)->unlockDevice(status);
716 (*it)->close(status);
722 template <
class DAEPolicy>
727 int i, j, len_specmap = 0, num_neutron_dc = 0, num_muon_dc = 0;
730 int *specmap_array = 0;
731 std::ostringstream message;
733 FILE* f = fopen(
"c:\\daevme_specmap.dat",
"rb");
736 if (fstat(fileno(f), &st) == 0)
738 len_specmap = st.st_size /
sizeof(int);
739 specmap_array =
new int[len_specmap];
740 std::cerr <<
"Reading saved specmap length " << len_specmap << std::endl;
741 fread(specmap_array,
sizeof(
int), len_specmap, f);
747 std::cerr <<
"No previous daevme_specmap.dat found" << std::endl;
754 i = j + MyDAE2Card::CRATE_MOD * dae_number;
755 if (MyDAE2Card::isCardPresent(i, vme, status))
757 message <<
"Card " << j <<
" is present on dae " << dae_number <<
" (" << vme->
device() <<
")";
758 card_type = MyDAE2Card::getCardType(i, vme, status);
761 message <<
"(" << MyDAE2Card::card_type;
762 case MyDAE2Card::EnvCard:
763 message <<
" Environment card)\n";
767 case MyDAE2Card::NeutronDetectorCard:
768 message <<
" Neutron Detector card)\n";
774 case MyDAE2Card::MuonDetectorCard:
775 message <<
" Muon Detector card)\n";
780 case MyDAE2Card::EnvPeriodCard:
781 message <<
" Combined Environment and Period card)\n";
786 message <<
" *UNKNOWN*)\n";
792 if (specmap_array != 0)
794 delete []specmap_array;
796 if ( (num_muon_dc > 0) && (num_neutron_dc > 0) )
879 std::ostringstream message;
880 unsigned per_seq_check_counter = 0;
882 uint64_t nremain = 0;
885 bool early_exit =
false;
891 while(!early_exit && !(
PERIOD_FUNCTION(isRunEndedAndSequenceComplete(status))))
894 ++per_seq_check_counter;
895 if ( per_seq_check_counter % 120 == 0 )
897 LOGSTR_WARNING(
"Still waiting for period card to complete hardware period sequence - restart and use END/IMMEDIATE to finish early");
919 Poco::Thread::sleep(200);
933 LOGSTR_INFORMATION(
"StopRunDiscard mode - ignoring unread dae data events " << nremain);
940 Poco::Thread::sleep(200);
949 Poco::Thread::sleep(1000);
954 total_veto = value = 0;
955 std::string veto_text;
957 message << veto_text <<
"\n";
970 ENV_FUNCTION(getFChopperVetoedFrames(0, &value, status));
974 m_detCards[i]->printVetoStatus(message,
true, status);
1155 int i, offset, n, start = -1, end = -1;
1157 for(i=0; (i<
m_lenAddmap) && (start == -1 || end == -1); i++)
1161 if (address ==
m_addmap[i].dae1add)
1165 else if (address <
m_addmap[i].dae1add)
1170 if ((end == -1) && ((address + 4*len) <=
1178 OUTPUT_MESSAGE(*m_pErr ,
"readHistogramMemory error - cannot find start address " << address <<
" in map" << std::endl);
1183 OUTPUT_MESSAGE(*m_pErr ,
"readHistogramMemory error - cannot find end address in map" << std::endl);
1186 for(i=start; i<=end; i++)
1189 if (offset/4 + len >
m_addmap[i].len)
1199 OUTPUT_MESSAGE(*m_pErr ,
"readHistogramMemory error - offset < 0" << std::endl);
1209 OUTPUT_MESSAGE(*m_pErr ,
"readHistogramMemory error: only read " << keep_len - len <<
1210 "/" << keep_len <<
" words" << std::endl);
1223 int i = 0, j = 0, offset_i, offset_j, n, nj, len_j;
1227 unsigned long address_j;
1228 bool do_spec0 = (address == 0);
1239 if (offset_i/4 + len >
m_addmap[i].len)
1255 address_j = address;
1270 if (offset_j/4 + len_j >
m_addmap[j].len)
1308 std::ostringstream message;
1309 message <<
"readHistogramMemory error: only read " << keep_len - len <<
1310 "/" << keep_len <<
" words";
1329 sum +=
m_detCards[i]->sumHistogramMemory(status);
1336 return m_detCards[det_card]->readDescriptorTimeBinLimitRegister(value, status);
1341 return m_detCards[det_card]->writeDescriptorTimeBinLimitRegister(value, status);
1346 return m_detCards[det_card]->readTCGTimeBinLimitRegister(value, status);
1351 return m_detCards[det_card]->writeTCGTimeBinLimitRegister(value, status);
1369 if ( (n > 0) && (vetos[0] == 1) )
1380 for(i=1; i <= 4; i++)
1382 if ( (n > i) && (vetos[i] == 1) )
1394 if ( (n > 7) && (vetos[5] == 1) )
1397 ENV_FUNCTION(enableFChopperVeto(0, vetos[6], vetos[7], status));
1405 if ( (n > 8) && (vetos[8] == 1) )
1416 if ( (n > 9) && (vetos[9] == 1) )
1429 m_detCards[i]->clearVetoOccurredFlag(status);
1430 m_detCards[i]->enableDIMVetos(0xffff, status);
1592 m_detCards[i]->setPeriodType(hardware_periods, single_daq_period, status);;
1623 return m_detCards[0]->getCurrentHardwarePeriod(period, status);
1639 for(i=0; i < ntc+1; i++)
1692 m_detCards[i]->getTotalCounts(&counts, status);
1693 *value = *value + counts;
1703 m_detCards[i]->clearTotalCountsRegister(status);
1711 int period_output_delay,
DAEstatus& status)
1741 if (nperseq_request > 0)
1772 *period_sequence = 0;
1789 template <
class DAECardPolicy>
1793 unsigned long old_value;
1796 ISISVME* vme =
m_vme[card_id / DAECardPolicy::CRATE_MOD];
1830 status.
addInfoVa(
FAC_DAE,
"Setting 0x%x = 0x%x (%s bit)", add, value, (sixteen_bit ?
"16" :
"32"));
1842 template <
class DAECardPolicy>
1847 ISISVME* vme =
m_vme[card_id / DAECardPolicy::CRATE_MOD];
1864 template <
class DAECardPolicy>
1868 ISISVME* vme =
m_vme[card_id / DAECardPolicy::CRATE_MOD];
1872 template <
class DAECardPolicy>
1876 ISISVME* vme =
m_vme[card_id / DAECardPolicy::CRATE_MOD];
1882 "HardwareInternal (period card)",
1883 "HardwareExternal (period card)"
1921 icptimer.
info(
"Async checks queued...", status);
1923 icptimer.
info(
"checkTestPatternAsync", status);
1929 ICPTimer icptimer(
"fillWithTestPattern", status);
1932 m_detCards[i]->fillWithTestPattern(pattern, status);
1934 status.
addInfoVa(
FAC_DAE,
"Memory filled with test pattern %lu ready for checking", pattern);
1940 ICPTimer icptimer(
"checkTestPattern", status);
1941 std::ostringstream oss;
1944 m_detCards[i]->checkTestPattern(pattern, status);
1952 std::ostringstream oss;
1954 veto_text = oss.str();
1960 std::ostringstream oss;
1966 veto_text = oss.str();
2006 m_envCards[0]->enableHardwarePeriods(status);
2020 m_envCards[0]->disableHardwarePeriods(status);
2080 return !
PERIOD_FUNCTION(isEndRunAfterSequenceCompletesInProgress(status));
2087 static std::string detectorcmd = Poco::Util::Application::instance().config().getString(
"isisicp.daereset.detectorcmd");
2088 static std::string environmentcmd = Poco::Util::Application::instance().config().getString(
"isisicp.daereset.environmentcmd");
2089 static std::string envperiodcmd = Poco::Util::Application::instance().config().getString(
"isisicp.daereset.envperiodcmd");
2093 BOOST_FOREACH(
const env_list_t::value_type& c,
m_envCards)
2095 commands.push_back(std::pair<std::string,std::string>(environmentcmd, Poco::format(
"%s %d", c->daeDevice(), c->position())));
2099 commands.push_back(std::pair<std::string,std::string>(envperiodcmd, Poco::format(
"%s %d", c->daeDevice(), c->position())));
2101 BOOST_FOREACH(
const det_list_t::value_type& c,
m_detCards)
2103 commands.push_back(std::pair<std::string,std::string>(detectorcmd, Poco::format(
"%s %d", c->daeDevice(), c->position())));
2108 template int ISISDAE::VMEWriteValue<DAE3CardPolicy>(
unsigned long card_id,
unsigned long card_address,
bool sixteen_bit,
unsigned long value,
unsigned long mode,
DAEstatus& status);
2109 template int ISISDAE::VMEReadValue<DAE3CardPolicy>(
unsigned long card_id,
unsigned long card_address,
bool sixteen_bit,
unsigned long *value,
DAEstatus& status);
2110 template int ISISDAE::VMEWriteArray<DAE3CardPolicy>(
unsigned long card_id,
unsigned long card_address,
isisU32_t* values,
unsigned long num_values,
DAEstatus& status);
2111 template int ISISDAE::VMEReadArray<DAE3CardPolicy>(
unsigned long card_id,
unsigned long card_address,
isisU32_t* values,
unsigned long num_values,
DAEstatus& status);
2113 template int ISISDAE::VMEWriteValue<DAE2CardPolicy>(
unsigned long card_id,
unsigned long card_address,
bool sixteen_bit,
unsigned long value,
unsigned long mode,
DAEstatus& status);
2114 template int ISISDAE::VMEReadValue<DAE2CardPolicy>(
unsigned long card_id,
unsigned long card_address,
bool sixteen_bit,
unsigned long *value,
DAEstatus& status);
2115 template int ISISDAE::VMEWriteArray<DAE2CardPolicy>(
unsigned long card_id,
unsigned long card_address,
isisU32_t* values,
unsigned long num_values,
DAEstatus& status);
2116 template int ISISDAE::VMEReadArray<DAE2CardPolicy>(
unsigned long card_id,
unsigned long card_address,
isisU32_t* values,
unsigned long num_values,
DAEstatus& status);
env_veto_set_func_t ec_disable
int getVetoStatus(std::string &veto_text, DAEstatus &status)
int setPeriodType(ISISDAE::PeriodType type, bool single_daq_period, DAEstatus &status)
virtual int resetPeriodCard(DAEstatus &status)=0
CRITICAL_SECTION m_dae_cs
bool isMultiplePeriodSequenceComplete(DAEstatus &status)
virtual int zeroPeriodFrameCounters(DAEstatus &status)=0
int setVeto(const std::string &name, bool enable, DAEstatus &status)
void pollUntilTasksComplete(const Poco::TaskManager &tm, int poll_time_in_ms)
virtual int openBackplane(const char *device_bp, DAEstatus &status)=0
float getGoodUAmpHoursPeriod(int period, DAEstatus &status)
int whichVeto(std::string &veto_text, DAEstatus &status)
virtual int clearPeriodCounters(DAEstatus &status)=0
virtual int readU32(unsigned long address, isisU32_t *data32, TransferProps props, DAEstatus &status)=0
int addVa(int facility, int severity, int errtype, const char *format,...)
int getRawPPPLowerPeriod(int period, isisU32_t *value, DAEstatus &status)
int setDAE1Vetos(int vetos[], int n, DAEstatus &status)
int getGoodPPPLower(isisU32_t *value, DAEstatus &status)
int writePOSLUTMemory(int card_id, isisU32_t *buffer, int len, DAEstatus &status)
float getRawUAmpHoursPeriod(int period, DAEstatus &status)
void printAddmap(std::ostream &os, DAEstatus &status)
int compareBuffers(const std::string &title, const isisU32_t *buffer1, const isisU32_t *buffer2, int nbuffer, DAEstatus &status)
virtual int enablePeriodMode(bool external_mode, DAEstatus &status)=0
int getGoodPPPUpperPeriod(int period, isisU32_t *value, DAEstatus &status)
env_period_list_t m_envPeriodCards
virtual int highspec() const =0
int stopRun(StopRunMode mode, DAEstatus &status)
const int * m_spec_to_crpt_offset
int getGoodPPPUpper(isisU32_t *value, DAEstatus &status)
bool isFinalSequenceComplete(DAEstatus &status)
int readDAE1Spectra(isisU32_t *buffer, int nbuffer, int spec_to_crpt_offset[], int spec_start, int nspec, int period, int persize, DAEstatus &status)
int getNTimeChannels(int spectrum, isisU32_t *ntc, DAEstatus &status)
virtual int setTimeChannels(isisU32_t *tcb, int ntc, DAEstatus &status)=0
void clearDCEventMode(DAEstatus &status)
bool isRunning(DAEstatus &status)
void onFinished(Poco::TaskFinishedNotification *pNf)
void setDCEventMode(unsigned long card_id, bool value, DAEstatus &status)
virtual int writeBlockU32(unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &status)=0
virtual void setCardMode(DetectorCardMode mode)=0
void setDCCardMode(unsigned long card_id, bool neutron_data, DAEstatus &status)
int getRawFramesPeriod(isisU32_t *value, int period, DAEstatus &status)
virtual int setMultiplePeriodSequenceMode(int nseq, DAEstatus &status)=0
isis32_t open(const char *dae_name, DAEstatus &status)
int add(DAEstatus &dstatus, bool clear)
int programPOSLUT(int cards[], int dims[], int pos_start[], int npos[], int spec[], int spec_step[], int nblocks, DAEstatus &status)
virtual int getTimeChannels(isisU32_t *tcb, int ntc, DAEstatus &status)=0
virtual int readAllDAE1Spectra(isisU32_t *buffer, int nbuffer, const int spec_to_crpt_offset[], int persize, DAEstatus &status)=0
HANDLE m_async_complete_event
int clearHistogramMemory(DAEstatus &status)
int clearCounters(DAEstatus &status)
static DWORD __stdcall readDCHistogramThread(void *arg)
virtual int writePOSLUTMemory(unsigned long start, isisU32_t *buffer, int len, DAEstatus &status)=0
int getTotalCounts(int64_t *value, DAEstatus &status)
int getExternalResetCommands(std::list< std::pair< std::string, std::string > > &commands, DAEstatus &status)
env_pc_veto_set_func_t pc_enable
#define ENV_FUNCTION(__func)
virtual int setSinglePeriodSequenceMode(DAEstatus &status)=0
int getRawPPPLower(isisU32_t *value, DAEstatus &status)
std::vector< DetectorCardIntf * > & m_detCards
int getSMPVetoedFrames(isisU32_t *value, DAEstatus &status)
virtual int readU16(unsigned long address, isisU16_t *data16, TransferProps props, DAEstatus &status)=0
void setOutputFileName(int run_number, bool new_run, DAEstatus &status)
int locateCards(ISISVME *vme, int dae_number, DAEstatus &status)
virtual int writeU16(unsigned long address, isisU16_t data16, TransferProps props, DAEstatus &status)=0
#define PERIOD_FUNCTION(__func)
void setCardStatus(int id, bool enable)
void addCard(DAEEventSource *det_card, bool enable=false)
int writeHistogramMemory(int card_id, isisU32_t *buffer, int start, int len, DAEstatus &status)
int changeNumberOfPeriods(int nperiod, DAEstatus &status)
#define LOGSTR_WARNING(__arg)
static veto_desc veto_setters[]
int VMEWriteArray(unsigned long card_id, unsigned long card_address, isisU32_t *values, unsigned long num_values, DAEstatus &status)
static const char * DAEType_desc[]
Poco::TaskManager m_taskmgr
int getExternalVetoedFrames(int veto_number, isisU32_t *value, DAEstatus &status)
int getGoodFramesPeriod(isisU32_t *value, int period, DAEstatus &status)
void closeOutputFile(DAEstatus &status)
void stop(bool immediate)
virtual int position() const =0
static void setEndianWorkaround(bool endian_workaround)
virtual int disableMSMode(DAEstatus &status)=0
int resetRunController(DAEstatus &status)
int clearTotalCountsRegisters(DAEstatus &status)
virtual int disableFIFOVeto(DAEstatus &status)=0
virtual int writeU32(unsigned long address, isisU32_t data32, TransferProps props, DAEstatus &status)=0
static const unsigned DAESPECMAX
should be same as ISISCRPT_MAX_DETECTOR
ClearHistogramMemoryTask(const std::string &name, std::vector< DetectorCardIntf * > &det_cards, DAEstatus &status)
#define END_IMMEDIATELY_FILE
int getTS2PulseVetoedFrames(isisU32_t *value, DAEstatus &status)
volatile LONG m_num_async_requests
virtual int readBlockU32(unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &status)=0
int setDCFrameSyncDelay(int crat, isisU32_t delay, DAEstatus &status)
static void deletePtr(T *pCard)
uint64_t nNewEventWords(DAEstatus &status)
int getTimeChannels(int spec, isisU32_t *tcb, int ntc, DAEstatus &status)
int setTimeChannels(int crat, isisU32_t *tcb, int ntc, DAEstatus &status)
virtual int disableFIFOVeto(DAEstatus &status)=0
int getFIFOVetoedFrames(isisU32_t *value, DAEstatus &status)
int writeTCGTimeBinLimitRegister(int det_card, isisU32_t value, DAEstatus &status)
virtual int getSpectrumSize(isisU32_t *value, DAEstatus &status)=0
int getISIS50HzVetoedFrames(isisU32_t *value, DAEstatus &status)
#define LOGSTR_INFORMATION(__arg)
int getSpectrumSize(int spectrum, isisU32_t *nchan, DAEstatus &status)
void printStatus(std::ostream &os, DAEstatus &status)
virtual int lockDevice(int timeout, DAEstatus &dstatus)=0
int startRun(bool clear_counters, int run_number, time_t &start_time, DAEstatus &status)
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
env_pc_veto_set_func_t pc_disable
virtual int programPERLUT(isisU16_t *dwell_flags, isisU16_t *frames, int nperiod, DAEstatus &status)=0
isis32_t openBackplane(const char *dae_name_bp, DAEstatus &status)
int VMEReadValue(unsigned long card_id, unsigned long card_address, bool sixteen_bit, unsigned long *value, DAEstatus &status)
int getRawFrames(isisU32_t *value, DAEstatus &status)
int enableDelayedStart(DAEstatus &status)
virtual int setNumberOfPeriods(isisU16_t n, DAEstatus &status)=0
int getGoodPPPLowerPeriod(int period, isisU32_t *value, DAEstatus &status)
env_veto_set_func_t ec_enable
double info(const char *title, std::ostream &os, bool add_nl=true)
int clearFramesVetosAndPPP(DAEstatus &status)
int checkTestPattern(unsigned long pattern, DAEstatus &status)
DAEProgressHandler m_task_ph
virtual int scanBus(DAEstatus &status)=0
int disablePeriodCard(DAEstatus &status)
int clearPOSLUTMemory(DAEstatus &status)
void closeAndDeleteOutputFile(int run_number, DAEstatus &status)
virtual int programOUTLUT(isisU32_t *outputs, int nperiod, DAEstatus &status)=0
int disableDelayedStart(DAEstatus &status)
int updateAddmap(DAEstatus &status)
int VMEWriteValue(unsigned long card_id, unsigned long card_address, bool sixteen_bit, unsigned long value, unsigned long mode, DAEstatus &status)
isis32_t close(DAEstatus &status)
virtual int readHistogramMemory(unsigned long start, isisU32_t *buffer, int len, DAEstatus &status)=0
static const int NOSPECTRUM
static const char * PeriodType_desc[]
isis32_t check(DAEstatus &status)
float getRawUAmpHours(DAEstatus &status)
virtual int enableMSMode(DAEstatus &status)=0
static unsigned long makeAddress(int position, unsigned long address)
float getGoodUAmpHours(DAEstatus &status)
static DWORD __stdcall checkTestPatternThread(void *arg)
dae2spec_map_t m_dae2_spec_map
int changePeriod(int period, int daq_period, DAEstatus &status)
virtual int setFrameSyncDelay(isisU32_t value, DAEstatus &status)=0
DetectorCardIntf * findDetectorCard(int position, DAEstatus &status)
virtual FrameSync getFrameSync(DAEstatus &status)=0
int fillWithTestPattern(unsigned long pattern, DAEstatus &status)
virtual int enableFIFOVeto(DAEstatus &status)=0
int getRawPPPUpperPeriod(int period, isisU32_t *value, DAEstatus &status)
virtual int setPeriodOutputDelay(isisU32_t delay, DAEstatus &status)=0
isisU32_t sumAllHistogramMemory(DAEstatus &status)
static int daeTriggerFunc(void *arg, time_t the_secs, unsigned short the_ms, int trig_id)
int getFrameSyncDelay(isisU32_t *delay, DAEstatus &status)
void setLoggerName(const std::string &logger_name)
virtual const int * getDAE2SpecMap()=0
int getRawPPPUpper(isisU32_t *value, DAEstatus &status)
int setFrameSync(FrameSync fs, int muon_pulse, DAEstatus &status)
virtual int setEventCollectionMode(bool enable, DAEstatus &status)=0
int requestEndRunAfterNextSequenceCompletes(DAEstatus &status)
void closeEventFiles(DAEstatus &status)
int programDAE1POSLUT(int crat[], int maxcrate, int modn[], int mpos[], int spec[], int ndet, int nper_daq, DAEstatus &status)
void onProgress(Poco::TaskProgressNotification *pNf)
int readDAE1Spectrum(int dae1_spectrum, isisU32_t *buffer, int nbuffer, DAEstatus &status)
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)
int readHistogramMemory(unsigned long start, isisU32_t *buffer, int len, DAEstatus &status)
int addInfo(int facility, const std::string &text)
int setFrameSyncDelay(isisU32_t delay, DAEstatus &status)
int writeDescriptorTimeBinLimitRegister(int det_card, isisU32_t value, DAEstatus &status)
virtual int writeHistogramMemory(unsigned long start, isisU32_t *buffer, int len, DAEstatus &status)=0
int getDCFrameSyncDelay(int crat, isisU32_t *delay, DAEstatus &status)
virtual int zeroPeriodProtonCounters(DAEstatus &status)=0
virtual const char * device()=0
virtual int getNTimeChannels(isisU32_t *ntc, DAEstatus &status)=0
virtual int open(const char *device, DAEstatus &status)=0
int doneAsync()
called by async worker thread when it has completed its work
dae1spec_map_t m_dae1_spec_map
int addInfoVa(int facility, const char *format,...)
int checkTestPatternAsync(unsigned long pattern, DAEstatus &status)
int getCurrentPeriodSequence(isisU32_t *period_sequence, DAEstatus &status)
double frameTimerDrift(DAEstatus &status)
frame timer drift (icp - dae)
int readDescriptorTimeBinLimitRegister(int det_card, isisU32_t *value, DAEstatus &status)
int VMEReadArray(unsigned long card_id, unsigned long card_address, isisU32_t *values, unsigned long num_values, DAEstatus &status)
void printSpectrum(int spec, std::ostream &os, DAEstatus &status)
int getCurrentHardwarePeriod(isisU32_t *period, DAEstatus &status)
int getCurrentDAQHardwarePeriod(isisU32_t *period, DAEstatus &status)
virtual void setTriggerFunc(trigger_func_t *func, void *arg)=0
int readDCHistogramAsync(DetectorCardIntf *dc, unsigned long start, isisU32_t *buffer, int len, DAEstatus &dstatus)
ReadAllDAE1SpectraTask(const std::string &name, DetectorCardIntf *dc, isisU32_t *buffer, int nbuffer, const int *spec_to_crpt_offset, int persize, DAEstatus &status)
virtual int getFrameSyncDelay(isisU32_t *value, DAEstatus &status)=0
virtual int enableFIFOVeto(DAEstatus &status)=0
int getMSModeVetoedFrames(isisU32_t *value, DAEstatus &status)
int getGoodFrames(isisU32_t *value, DAEstatus &status)
virtual int setPeriodControlBits(isisU32_t mask, bool preserve, DAEstatus &status)=0
DetectorCardIntf * getDCForSpectrum(int spec) const
int readTCGTimeBinLimitRegister(int det_card, isisU32_t *value, DAEstatus &status)
virtual int checkTestPattern(unsigned long pattern, DAEstatus &status)=0