Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
SimSensorSensorBoard.h
Go to the documentation of this file.
1 #ifndef SIMSENSORSENSORBOARD_H
2 #define SIMSENSORSENSORBOARD_H
3 
4 #include <string>
5 #include <chrono>
6 
7 #include "Utility/Timer.h"
8 #include "Utility/Types.h"
10 #include "CameraTypes.h"
11 
12 #include "Sensors/SensorBoard.h"
13 #include "Utility/ImageGenerator.h"
14 
15 #define SIMSENSORSENSORBOARD_ID 13
16 
17 
20 namespace SocCamera
21 {
22 
23 class tcAbstractHandler;
24 
43 {
44 public:
50  tcSimSensorSensorBoard(const std::string &asArgs);
51  virtual ~tcSimSensorSensorBoard() override;
52 
58  virtual tcAbstractHandler* getCustomHandlers(tcAbstractHandler* apTailHandler, std::map<std::string, tcAbstractHandler*> *apStringMap) override;
59  virtual void resetFpga() override;
60  virtual int GetCameraInfo(tsCameraInfo* apInfo) override;
61  virtual int32 initialize() override;
62  virtual teNackCode setExposure(int32 anMicroseconds, uint32_t anExpIndex = 0) override;
63  virtual int32 getExposure(uint32_t anExpIndex = 0) override;
64  virtual uint32 getMinFrameIntervalMicroS() override { return 1000; }; // TODO Change minimum frame interval
65  virtual teNackCode setFrameInterval(int32 anMicroseconds) override;
66  virtual int32 getFrameInterval() override;
67  virtual teNackCode setROI(ROI region) override;
68  virtual ROI getROI() override;
69  virtual teNackCode setVerticalBin(int32 anPixels) override;
70  virtual int32 getVerticalBin() override;
71  virtual teNackCode setHorizontalBin(int32 anPixels) override;
72  virtual int32 getHorizontalBin() override;
73  virtual teNackCode setShutterMode(teShutterMode eeMode) override;
74  virtual int32 getShutterMode() override;
75  virtual teNackCode setBPP(teBPPMode eeMode) override;
76  virtual teNackCode setTestPattern(teTestPattern eeSelection) override;
77  virtual int32 getTestPattern() override;
78  virtual teNackCode setTrigger(teTriggerMode eeTrigger) override;
79  virtual int32 getTrigger() override;
80  virtual int32 validate() override;
81  virtual bool isCapturing() override;
82  virtual teNackCode start() override;
83  virtual teNackCode stop() override;
84  virtual std::string getTemperature(int32 anSensor = 0) override;
85  virtual std::string getVersion() override;
86  virtual teNackCode save(int32 anConfiguration) override;
87  virtual teNackCode recall(int32 anConfiguration) override;
88  virtual uint64_t fpgaVersion() override { return 0; }
89 
90  // timer callback for simulated frame outputs
91  virtual void timerTicked(tcTimer*) override;
92 
97 protected:
98  bool mbCapturing;
100  std::chrono::microseconds mcEmulatedPorchTime;
101  std::chrono::microseconds mcExpTime;
102  std::chrono::microseconds mcFrameIntervalTime;
103 
106 
107  static const int mnPatternGeneratorPixelsPerClock = 4;
108  static constexpr float mnPatternGeneratorClockMhz = 125.0f;
110 };
111 
112 }
113 
114 #endif // SIMSENSORSENSORBOARD_H
SocCamera::tcSimSensorSensorBoard::setVerticalBin
virtual teNackCode setVerticalBin(int32 anPixels) override
Definition: SimSensorSensorBoard.cpp:212
SocCamera::tcSimSensorSensorBoard::getTemperature
virtual std::string getTemperature(int32 anSensor=0) override
Definition: SimSensorSensorBoard.cpp:386
int32
int32_t int32
Definition: Types.h:8
SocCamera::tcSimSensorSensorBoard::setROI
virtual teNackCode setROI(ROI region) override
Definition: SimSensorSensorBoard.cpp:179
SocCamera::tsCameraInfo
Definition: CameraTypes.h:52
SocCamera::tcSimSensorSensorBoard::setTestPattern
virtual teNackCode setTestPattern(teTestPattern eeSelection) override
Definition: SimSensorSensorBoard.cpp:262
SocCamera::tcSimSensorSensorBoard::getShutterMode
virtual int32 getShutterMode() override
Definition: SimSensorSensorBoard.cpp:237
SocCamera::tcSimSensorSensorBoard::save
virtual teNackCode save(int32 anConfiguration) override
Definition: SimSensorSensorBoard.cpp:432
Types.h
SocCamera::tcSimSensorSensorBoard::start
virtual teNackCode start() override
Definition: SimSensorSensorBoard.cpp:312
SocCamera::teTestPattern
teTestPattern
Definition: CameraTypes.h:122
SocCamera::tcSimSensorSensorBoard::setBPP
virtual teNackCode setBPP(teBPPMode eeMode) override
Definition: SimSensorSensorBoard.cpp:242
SensorBoard.h
SocCamera::tcSimSensorSensorBoard::getTrigger
virtual int32 getTrigger() override
Definition: SimSensorSensorBoard.cpp:297
SocCamera::tcSimSensorSensorBoard::setFrameInterval
virtual teNackCode setFrameInterval(int32 anMicroseconds) override
Definition: SimSensorSensorBoard.cpp:151
SocCamera::tcSimSensorSensorBoard::getMinFrameIntervalMicroS
virtual uint32 getMinFrameIntervalMicroS() override
Definition: SimSensorSensorBoard.h:64
SocCamera::tcSimSensorSensorBoard::mcFrameIntervalTime
std::chrono::microseconds mcFrameIntervalTime
the desired Frame Interval Time
Definition: SimSensorSensorBoard.h:102
CameraTypes.h
SocCamera::tcSimSensorSensorBoard::mcImageGenerator
tcImageGenerator mcImageGenerator
utility for building simulated images
Definition: SimSensorSensorBoard.h:105
SocCamera::tcSimSensorSensorBoard::setExposure
virtual teNackCode setExposure(int32 anMicroseconds, uint32_t anExpIndex=0) override
Definition: SimSensorSensorBoard.cpp:132
SocCamera::tcSimSensorSensorBoard::msROI
ROI msROI
Selected ROI.
Definition: SimSensorSensorBoard.h:99
SocCamera::tcSimSensorSensorBoard::getTestPattern
virtual int32 getTestPattern() override
Definition: SimSensorSensorBoard.cpp:287
SocCamera::tcSimSensorSensorBoard::validate
virtual int32 validate() override
Definition: SimSensorSensorBoard.cpp:302
SocCamera::tcSimSensorSensorBoard::fpgaVersion
virtual uint64_t fpgaVersion() override
Definition: SimSensorSensorBoard.h:88
SocCamera::tcSimSensorSensorBoard::mcTimer
tcTimer mcTimer
timer to kick sending frames
Definition: SimSensorSensorBoard.h:104
SocCamera::tcSimSensorSensorBoard::setHorizontalBin
virtual teNackCode setHorizontalBin(int32 anPixels) override
Definition: SimSensorSensorBoard.cpp:222
tcTimer
Definition: Timer.h:25
SocCamera::tcAbstractHandler
Definition: AbstractHandler.h:24
SocCamera::teNackCode
teNackCode
Definition: CameraTypes.h:62
SocCamera::teBPPMode
teBPPMode
Definition: CameraTypes.h:133
SocCamera::tcSimSensorSensorBoard::timerTicked
virtual void timerTicked(tcTimer *) override
Definition: SimSensorSensorBoard.cpp:444
SocCamera::tcSimSensorSensorBoard::recall
virtual teNackCode recall(int32 anConfiguration) override
Definition: SimSensorSensorBoard.cpp:438
SocCamera::teShutterMode
teShutterMode
Definition: CameraTypes.h:141
SocCamera::tcSimSensorSensorBoard::mnPatternGeneratorClockMhz
static constexpr float mnPatternGeneratorClockMhz
Definition: SimSensorSensorBoard.h:108
Timer.h
SocCamera::tcSimSensorSensorBoard::tcSimSensorSensorBoard
tcSimSensorSensorBoard(const std::string &asArgs)
Definition: SimSensorSensorBoard.cpp:47
SocCamera::tcSimSensorSensorBoard::isCapturing
virtual bool isCapturing() override
Definition: SimSensorSensorBoard.cpp:307
SocCamera::tcSimSensorSensorBoard::~tcSimSensorSensorBoard
virtual ~tcSimSensorSensorBoard() override
Definition: SimSensorSensorBoard.cpp:86
SocCamera::tcSimSensorSensorBoard::getCustomHandlers
virtual tcAbstractHandler * getCustomHandlers(tcAbstractHandler *apTailHandler, std::map< std::string, tcAbstractHandler * > *apStringMap) override
Definition: SimSensorSensorBoard.cpp:91
SocCamera::tcSimSensorSensorBoard::setTrigger
virtual teNackCode setTrigger(teTriggerMode eeTrigger) override
Definition: SimSensorSensorBoard.cpp:292
SocCamera::tcSimSensorSensorBoard::initialize
virtual int32 initialize() override
Definition: SimSensorSensorBoard.cpp:113
tcTimedObject
Definition: Timer.h:17
SocCamera::tcSimSensorSensorBoard
The tcSimSensorSensorBoard class. SimSensor Main class manager for a given sensor board.
Definition: SimSensorSensorBoard.h:42
SocCamera::tcSimSensorSensorBoard::mcEmulatedPorchTime
std::chrono::microseconds mcEmulatedPorchTime
Definition: SimSensorSensorBoard.h:100
SocCamera
Definition: CameraTypes.h:7
SocCamera::tcSimSensorSensorBoard::mbCapturing
bool mbCapturing
true when running a capture
Definition: SimSensorSensorBoard.h:98
SocCamera::tcSimSensorSensorBoard::getVerticalBin
virtual int32 getVerticalBin() override
Definition: SimSensorSensorBoard.cpp:217
SocCamera::tcSimSensorSensorBoard::getExposure
virtual int32 getExposure(uint32_t anExpIndex=0) override
Definition: SimSensorSensorBoard.cpp:146
SocCamera::tcSimSensorSensorBoard::GetCameraInfo
virtual int GetCameraInfo(tsCameraInfo *apInfo) override
Definition: SimSensorSensorBoard.cpp:100
SocCamera::tcSimSensorSensorBoard::getVersion
virtual std::string getVersion() override
Definition: SimSensorSensorBoard.cpp:402
uint32
uint32_t uint32
Definition: Types.h:11
SocCamera::tcSimSensorSensorBoard::resetFpga
virtual void resetFpga() override
Definition: SimSensorSensorBoard.cpp:96
SocCamera::tcSimSensorSensorBoard::stop
virtual teNackCode stop() override
Definition: SimSensorSensorBoard.cpp:366
SocCamera::teTriggerMode
teTriggerMode
Definition: CameraTypes.h:113
SocCamera::ROI
Definition: ROI.h:10
SocCamera::tcSimSensorSensorBoard::mnPatternGeneratorPixelsPerClock
static const int mnPatternGeneratorPixelsPerClock
Definition: SimSensorSensorBoard.h:107
SocCamera::tcSimSensorSensorBoard::getROI
virtual ROI getROI() override
Definition: SimSensorSensorBoard.cpp:207
SocCamera::tcSensorBoard
Definition: SensorBoard.h:40
ImageGenerator.h
TestPatternGenerator.h
tcImageGenerator
Utility class for building image patterns for simulation, etc.
Definition: ImageGenerator.h:15
SocCamera::tcSimSensorSensorBoard::mpTestPatternGenerator
tcTestPatternGenerator * mpTestPatternGenerator
a valid FPGA pointer
Definition: SimSensorSensorBoard.h:109
SocCamera::tcSimSensorSensorBoard::mcExpTime
std::chrono::microseconds mcExpTime
the desired exposure time
Definition: SimSensorSensorBoard.h:101
SocCamera::tcSimSensorSensorBoard::setShutterMode
virtual teNackCode setShutterMode(teShutterMode eeMode) override
Definition: SimSensorSensorBoard.cpp:232
tcTestPatternGenerator
User Space Control Class for the MityCAM test_pattern_gen FPGA block.
Definition: TestPatternGenerator.h:18
SocCamera::tcSimSensorSensorBoard::getFrameInterval
virtual int32 getFrameInterval() override
Definition: SimSensorSensorBoard.cpp:174
SocCamera::tcSimSensorSensorBoard::getHorizontalBin
virtual int32 getHorizontalBin() override
Definition: SimSensorSensorBoard.cpp:227