AFHBA404
AFHBA404 connects ACQ2106 to PCI-Express
Custom1SystemInterface.cpp
Go to the documentation of this file.
1 
9 #include "AcqSys.h"
10 
11 #include <string.h>
12 #include <stdio.h> // because sprintf()
13 #include <assert.h>
14 
15 
17 public:
19  SystemInterface(hba)
20  {}
21  virtual void ringDoorbell(int sample){
22  HBA& the_hba(HBA::instance());
23  int imax = the_hba.vo.AO16;
24  short xx = IN.AI16[0];
25  for (int ii = 0; ii < imax; ++ii){
26  OUT.AO16[ii] = xx;
27  }
28  unsigned tl = the_hba.uuts[0]->tlatch();
29  for (int ii = 0; ii < the_hba.vo.DO32; ++ii){
30  OUT.DO32[ii] = tl;
31  }
32  }
33 };
34 
36 {
37  fprintf(stderr, "SystemInterface::factory CUSTOM INTERFACE\n");
38  const char* key = getenv("SINGLE_THREAD_CONTROL");
39  if (key){
40  if (strcmp(key, "control_dup1")){
42  }
43  }
44 
45  return * new SystemInterface(hba);
46 }
47 
HBA
Models a Host Bus Adapter like AFHBA404.
Definition: AcqSys.h:123
Custom1SingleThreadControlSystemInterface::Custom1SingleThreadControlSystemInterface
Custom1SingleThreadControlSystemInterface(const HBA &hba)
Definition: Custom1SystemInterface.cpp:18
Custom1SingleThreadControlSystemInterface::ringDoorbell
virtual void ringDoorbell(int sample)
Definition: Custom1SystemInterface.cpp:21
AcqSys.h
acqproc global class interface definition.
SystemInterface::Outputs::AO16
short * AO16
Definition: AcqSys.h:178
SystemInterface::Outputs::DO32
unsigned * DO32
Definition: AcqSys.h:179
HBA::uuts
vector< ACQ * > uuts
vector of ACQ UUT's
Definition: AcqSys.h:129
HBA::instance
static HBA & instance()
Definition: AcqSys.h:136
VO::AO16
int AO16
AO16 values from the algorithm.
Definition: AcqSys.h:53
SystemInterface::SystemInterface
SystemInterface(const HBA &_hba)
Definition: AcqSys.cpp:401
SystemInterface::IN
struct SystemInterface::Inputs IN
Custom1SingleThreadControlSystemInterface
Definition: Custom1SystemInterface.cpp:16
VO::DO32
int DO32
DO32 values from the algorithm.
Definition: AcqSys.h:54
SystemInterface::OUT
struct SystemInterface::Outputs OUT
SystemInterface::Inputs::AI16
short * AI16
Definition: AcqSys.h:170
SystemInterface
Models interface with external PCS.
Definition: AcqSys.h:161
HBA::vo
const VO vo
total system size each Output type.
Definition: AcqSys.h:132
SystemInterface::factory
static SystemInterface & factory(const HBA &)
Definition: BroadcastSystemInterface.cpp:71
getenv
int getenv(const char *key, int def, int(*cvt)(const char *key))
Definition: acqproc.cpp:23