Scope
FPGAInterface.h
1 #pragma once
2 
3 #include "helpers/FPGAException.h"
4 #include "NiFpga.h"
5 
6 // Forward declaration
7 namespace scope {
8  class DaqChunk;
9  namespace parameters {
10  class InputsFPGA;
11  }
12 }
13 
14 namespace scope {
15 
19 
20 protected:
24 
26  NiFpga_Session session;
27 
30 
31 public:
32  FPGAInterface();
33 
35  virtual ~FPGAInterface();
36 
38  virtual void Initialize(parameters::InputsFPGA* _parameters) { initialized = true; }
39 
44  virtual double SetPixeltime(const uint32_t& _area, const double& _pixeltime) { return _pixeltime; }
45 
50  virtual double SetLinetime(const uint32_t& _area, const double& _linetime) { return _linetime; }
51 
54  virtual void SetTriggering(const bool& _waitfortrigger) { }
55 
58  virtual void SetContinuousAcquisition(const bool& _cont) { }
59 
63  virtual void SetRequestedPixels(const uint32_t& _area, const uint32_t& _reqpixels) { }
64 
66  virtual void StartAcquisition() { }
67 
75  virtual int32_t ReadPixels(DaqChunk& _chunk, const double& _timeout, bool& _timedout) = 0;
76 
78  virtual void StopAcquisition() { }
79 
81  virtual void SetScannerdelay(const uint32_t& _scannerdelay) {}
82 
84  FPGAStatusSafe CurrentStatus() const { return status; }
85 };
86 
87 }
Abstract base class for FPGA classes.
Definition: FPGAInterface.h:18
virtual void SetScannerdelay(const uint32_t &_scannerdelay)
Sets the scanner delay on the FPGA (used currently for resonance scanners only)
Definition: FPGAInterface.h:81
virtual int32_t ReadPixels(DaqChunk &_chunk, const double &_timeout, bool &_timedout)=0
Read only pixels from the FPGA FIFO.
virtual double SetPixeltime(const uint32_t &_area, const double &_pixeltime)
Sets the time per pixel/dwell time (in seconds)
Definition: FPGAInterface.h:44
virtual ~FPGAInterface()
Ends the FPGA program.
virtual void StartAcquisition()
Starts the acquisition on the FPGA.
Definition: FPGAInterface.h:66
virtual void SetContinuousAcquisition(const bool &_cont)
Sets if the FPGA should acquire data continuously or acquire the number of pixels per channel set wit...
Definition: FPGAInterface.h:58
virtual void StopAcquisition()
Stops the acquisition on the FPGA.
Definition: FPGAInterface.h:78
A DaqChunk contains data from all channels sequentially.
Definition: DaqChunk.h:9
bool initialized
true if already initialized
Definition: FPGAInterface.h:29
FPGAStatusSafe CurrentStatus() const
Definition: FPGAInterface.h:84
FPGAStatusSafe status
current FPGA status.
Definition: FPGAInterface.h:23
virtual void SetRequestedPixels(const uint32_t &_area, const uint32_t &_reqpixels)
Sets the number of pixels per channel the FPGA should acquire, set to -1 for live scanning...
Definition: FPGAInterface.h:63
virtual double SetLinetime(const uint32_t &_area, const double &_linetime)
Sets the time per line (in seconds) for the generation of the line clock (if implemented) ...
Definition: FPGAInterface.h:50
virtual void Initialize(parameters::InputsFPGA *_parameters)
Set initial parameters.
Definition: FPGAInterface.h:38
virtual void SetTriggering(const bool &_waitfortrigger)
Sets if the FPGA should wait for a trigger before starting acquisition.
Definition: FPGAInterface.h:54
Parameters for pixel acquisition with NI-FPGA.
Definition: IO.h:117
NiFpga_Session session
NI FPGA session handle.
Definition: FPGAInterface.h:26