7 template <
class EnvPeriodPolicy>
13 addMapping(
ISISVME::TransferIORegisterSpace, FCOUNTR, 1, &
m_raw_frames,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
14 addMapping(
ISISVME::TransferIORegisterSpace, FCOUNTG, 1, &
m_good_frames,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
15 addMapping(
ISISVME::TransferIORegisterSpace, PCOUNTR0, 1, &
m_raw_proton_low,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
16 addMapping(
ISISVME::TransferIORegisterSpace, PCOUNTR1, 1, &
m_raw_proton_high,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
17 addMapping(
ISISVME::TransferIORegisterSpace, PCOUNTG0, 1, &
m_good_proton_low,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
18 addMapping(
ISISVME::TransferIORegisterSpace, PCOUNTG1, 1, &
m_good_proton_high,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
19 addMapping(
ISISVME::TransferIORegisterSpace, FIFOVETFRM, 1, &
m_fifo_veto,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
20 addMapping(
ISISVME::TransferIORegisterSpace, SMPVETFRM, 1, &
m_smp_veto,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
21 addMapping(
ISISVME::TransferIORegisterSpace, FC0VETFRM, 1, &
m_chopper_veto,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
22 addMapping(
ISISVME::TransferIORegisterSpace, TS2PVETFRM, 1, &
m_ts2_pulse_veto,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
23 addMapping(
ISISVME::TransferIORegisterSpace, HZ50VETFRM, 1, &
m_50hz_veto,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
24 addMapping(
ISISVME::TransferIORegisterSpace, EXT0VETFRM, 1, &
m_ext_veto0,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
25 addMapping(
ISISVME::TransferIORegisterSpace, EXT1VETFRM, 1, &
m_ext_veto1,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
26 addMapping(
ISISVME::TransferIORegisterSpace, EXT2VETFRM, 1, &
m_ext_veto2,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
27 addMapping(
ISISVME::TransferIORegisterSpace, EXT3VETFRM, 1, &
m_ext_veto3,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
28 addMapping(
ISISVME::TransferIORegisterSpace, FSDELAY, 1, &
m_fs_delay,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
29 addMapping(
ISISVME::TransferIORegisterSpace, RCONTROL, 1, &
m_run_control,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
30 addMapping(
ISISVME::TransferIORegisterSpace, RVETO, 1, &
m_veto,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
31 addMapping(
ISISVME::TransferIORegisterSpace, FC0WINDLY, 1, &
m_chopper_window_delay,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
32 addMapping(
ISISVME::TransferIORegisterSpace, FC0WINWTH, 1, &
m_chopper_window_width,
"",
true,
true, NULL, 0,
false,
false, fault_mode);
43 template <
class EnvPeriodPolicy>
46 os <<
"SIMEnv card at position " << m_position;
50 template <
class EnvPeriodPolicy>
53 if (m_run_control & RCFCLEAR)
59 m_ext_veto0 = m_ext_veto1 = m_ext_veto2 = m_ext_veto3 = 0;
61 if (m_run_control & RCPCLEAR)
63 m_raw_proton_low = m_raw_proton_high = 0;
64 m_good_proton_low = m_good_proton_high = 0;
66 if (m_run_control & RCSTART)
78 template <
class EnvPeriodPolicy>
84 template <
class EnvPeriodPolicy>
88 int frame_incr = delay / 20;
89 int proton_incr = (int)( 180.0 * (
double)delay / (1000.0 * 3600.0 * 1.738e-6) ) ;
95 if (m_vme->isRunning())
97 increment(frame_incr, m_raw_frames);
98 increment32(proton_incr, m_raw_proton_low, m_raw_proton_high);
99 if ( !m_vme->isVetoing() )
101 increment(frame_incr, m_good_frames);
102 increment32(proton_incr, m_good_proton_low, m_good_proton_high);
108 template <
class EnvPeriodPolicy>
virtual void updateCardAfterWrite(DAEstatus &status)
virtual void printStatus(std::ostream &os)
isisU32_t m_good_proton_high
isisU32_t m_good_proton_low
isisU32_t m_ts2_pulse_veto
isisU32_t m_raw_proton_high
SIMEnvCard(int position, VMESimulationIface *vme, FaultMode fault_mode, DAEstatus &status)
int addMapping(ISISVME::TransferProps props, isisU32_t address, int n, isisU32_t *var, const char *name, bool readable, bool writable, isisU32_t *access_reg, unsigned access_bit, bool wrap, bool sixteen_bit_access, FaultMode fault_mode)
isisU32_t m_chopper_window_delay
isisU32_t m_chopper_window_width
void setLoggerName(const std::string &logger_name)
virtual void simulate(int delay)
virtual void updateCardAfterRead(DAEstatus &status)
isisU32_t m_raw_proton_low