Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
tcMityViewerApp Class Reference

#include <MityViewerApp.h>

Inheritance diagram for tcMityViewerApp:
Collaboration diagram for tcMityViewerApp:

Public Member Functions

 tcMityViewerApp (tcSensorBoard *apSensor, tcIOChannel *apChannel, uint64 anMaxFramesInQueue=MAX_NUM_FRAMES_IN_QUEUE)
 
virtual ~tcMityViewerApp (void)
 
int Initialize (tcCommandInterface *apInterface)
 
int Shutdown (void)
 
virtual void Report (const char *fmt,...)
 
virtual void ReportError (const char *buffer)
 
virtual void sendUpdate (tsNewFrameMsg *apMsg)
 tcMityViewerApp::sendUpdate Called when new frame data is available to transmit to host. More...
 
void setTECHandler (SocCamera::tcTECHandler *apHandler)
 
virtual SocCamera::teNackCode setBpp (SocCamera::teBPPMode aeBppMode)
 
virtual SocCamera::teNackCode capture (tsCaptureRequest asRequest)
 
- Public Member Functions inherited from tcIOChannel
 tcIOChannel (SocCamera::teIOChannels aeIOId, SocCamera::tcSensorBoard *apSensor)
 Construct a new tcIOChannel::tcIOChannel object. More...
 
virtual ~tcIOChannel ()
 
virtual void initialized ()
 
SocCamera::teBPPMode getBpp ()
 
virtual void processUpdate (tsNewFrameMsg *apMsg)
 
void setEnable (bool abEnable)
 
tcImagegrabImage ()
 
SocCamera::teIOChannels id ()
 
virtual void invalidateCache (void *apMem, size_t anSize)
 
virtual void * memory ()
 
- Public Member Functions inherited from tcIOCallback
 tcIOCallback ()
 
virtual ~tcIOCallback ()
 

Protected Types

typedef void(tcMityViewerApp::* MsgHandler) (tuCameraMessages *apMsg)
 

Protected Member Functions

void NetworkPoll (void)
 
void NetworkServer (void)
 
void MainLoop (void)
 
bool MessageHandler (int anStatus, void *apData, int anLength, unsigned int anInfo)
 
int SendNetworkData (char *data, int len)
 
int SendMessage (tsMsgHeader *Msg, int len, void *apPayload=NULL, int payload_len=0)
 
const char * MsgToText (unsigned int MsgId)
 
void WriteConfig (void)
 
void Send16BitFrame (tsNewFrameMsg *apMsg)
 
void Send32BitFrame (tsNewFrameMsg *apMsg)
 tcMityViewerApp::Send32BitFrame More...
 
tcImagemkImage (tsNewFrameMsg *apMsg)
 
void SetExposure (tuCameraMessages *msg)
 
void SetExposureEx (tuCameraMessages *msg)
 
void GetExposure (tuCameraMessages *msg)
 
void GetExposureEx (tuCameraMessages *msg)
 
void SetCooling (tuCameraMessages *msg)
 
void Reset (tuCameraMessages *msg)
 
void Clear (tuCameraMessages *msg)
 
void ReadArea (tuCameraMessages *msg)
 
void SetOffset (tuCameraMessages *msg)
 
void SetImageInterval (tuCameraMessages *msg)
 
void Loopback (tuCameraMessages *msg)
 
void GetHardwareParams (tuCameraMessages *msg)
 
void SetHardwareParams (tuCameraMessages *msg)
 
void GetCooling (tuCameraMessages *msg)
 
void GetSetPoint (tuCameraMessages *msg)
 
void SetSetPoint (tuCameraMessages *msg)
 
void SetGPIO (tuCameraMessages *msg)
 
void GetGPIO (tuCameraMessages *msg)
 
void SetTrigger (tuCameraMessages *msg)
 
void GetTrigger (tuCameraMessages *msg)
 
void SetTriggerMode (tuCameraMessages *msg)
 
void GetTriggerMode (tuCameraMessages *msg)
 
void SetImageMirrorCfg (tuCameraMessages *msg)
 
void GetImageMirrorCfg (tuCameraMessages *msg)
 
void GetNetConfig (tuCameraMessages *msg)
 
void GetImageIntervals (tuCameraMessages *msg)
 
void GetPID (tuCameraMessages *msg)
 
void SetPID (tuCameraMessages *msg)
 
void GetTimingFileData (tuCameraMessages *msg)
 
void AbortRead (tuCameraMessages *msg)
 
void CISSetShutterMode (tuCameraMessages *msg)
 
void CISCalibrate (tuCameraMessages *msg)
 
void CISSetChannelSelect (tuCameraMessages *msg)
 
void SetRecordParams (tuCameraMessages *msg)
 
void SetFanCtrl (tuCameraMessages *msg)
 
void CISGetCalibrationState (tuCameraMessages *msg)
 
void SetAreaParam (tuCameraMessages *msg)
 
void NoOpCtrl (tuCameraMessages *msg)
 
void GetBinParam (tuCameraMessages *msg)
 
void SetBinParam (tuCameraMessages *msg)
 
void SetSimulationMode (tuCameraMessages *msg)
 
void GetSimulationMode (tuCameraMessages *msg)
 
void Read32 (tuCameraMessages *msg)
 
void Write32 (tuCameraMessages *msg)
 
void GetMultipleROIState (tuCameraMessages *msg)
 
void SetMultipleROIState (tuCameraMessages *msg)
 
void SetSimpleBinning (tuCameraMessages *msg)
 
void GetSimpleBinning (tuCameraMessages *msg)
 
void SetParameter (tuCameraMessages *msg)
 
void GetParameter (tuCameraMessages *msg)
 
void SetHorBinParam (tuCameraMessages *msg)
 
void GetHorBinParam (tuCameraMessages *msg)
 
void OpComplete (tuCameraMessages *msg)
 
void WriteDAC (tuCameraMessages *msg)
 
void GetCCDTemp (tuCameraMessages *msg)
 
void ReadCCDBin (tuCameraMessages *msg)
 
void GetBoardTemp (tuCameraMessages *msg)
 
void GetReadoutNoise (tuCameraMessages *msg)
 
void WriteNetConfig (tuCameraMessages *msg)
 
void SetShutterCloseDel (tuCameraMessages *msg)
 
void GetShutterDel (tuCameraMessages *msg)
 
void SetBinningSeq (tuCameraMessages *msg)
 
void GetBinningSeq (tuCameraMessages *msg)
 
void SetGain (tuCameraMessages *msg)
 
void GetGain (tuCameraMessages *msg)
 
void SetFilter (tuCameraMessages *msg)
 
void GetFilter (tuCameraMessages *msg)
 
void SetShearCtrl (tuCameraMessages *msg)
 
void SendCaptureConfig (void)
 
void SendNackCode (teNackCode aeCode, const char *asMessage)
 
void Shear (uint16_t *apData, unsigned int rows, unsigned int cols)
 implements legacy MityCCD shearing operation on RAW CCD data More...
 
- Protected Member Functions inherited from tcIOChannel
void invalidateCache (tsNewFrameMsg *apMsg)
 
void invalidateCache ()
 
void Report (const char *fmt,...)
 This method routes text to stderr. More...
 
void ReportError (const char *fmt,...)
 

Static Protected Member Functions

static void * DispatchNetworkPoll (void *apThis)
 
static void * DispatchNetworkServer (void *apThis)
 
static void * DispatchMainLoop (void *apThis)
 
static bool DispatchMessageHandler (int anStatus, void *apData, int anLength, unsigned int anInfo, void *apThis)
 

Protected Attributes

MsgHandler maHandlers [256]
 function handler table. More...
 
SocCamera::tcTECHandlermpTECHandler
 
bool mbHasChannel
 
bool mbUseChannel
 
tcSensorBoardmpSensor
 
tcLegacyCCDmpCCD
 
tcIOChannelmpChannel
 
tcCommandInterfacempInterface
 
bool mbCalibrated
 
volatile bool mbNetworkActive
 Indicates network socket is connected and active. More...
 
tcCamParsermpNetworkParser
 pointer to parser for Network Interface More...
 
bool mbConfigChange
 flag indicating the config data has changed (from API) More...
 
float mnMean
 mean value (from set Offset Target processing) More...
 
float mnStdDev
 StdDev value (from set Offset Target processing) More...
 
unsigned int mnAreaIntervalms
 area mode update interval More...
 
unsigned int mnDesiredIntervalms
 last desired setting known More...
 
unsigned int mnNumAreaRows
 number of rows for an area read More...
 
unsigned int mnNumAreaCols
 number of columns for an area read More...
 
unsigned int mnLoopBackErrorCnt
 number of errors encountered on loopback testing More...
 
int mnMessageInCount
 number of Client messages (from PC) More...
 
int mnMessageOutCount
 number of Outbound messages to client (PC) More...
 
unsigned short mnFPGARev
 copy of the FPGA revision level More...
 
unsigned short mnDSPRev
 copy of the DSP code revision level More...
 
bool mbConfigValid
 when true, our configuration is OK More...
 
tsSimulationModeMsg msSimMode
 active simulation mode data More...
 
volatile bool mbSendHeartBeats
 when true, send heartbeats out interface More...
 
int mnSocket
 our active network socket connection More...
 
CrcCalcmpCRC
 CRC engine for loopback mode. More...
 
tcMutex mhOutputMutex
 
pthread_t mhNetworkSrvThread
 thread object for network server More...
 
pthread_t mhNetworkPollThread
 thread object for network poll server More...
 
pthread_t mhMainThread
 thread object for heatbeat/status processsing More...
 
volatile int maShutdownPipes [3 *2]
 pipes used to shut stuff down (reader/writer) More...
 
volatile bool mbShutdown
 true when app should shut down More...
 
tsHdwrParamMsg msHdwrParamMsg
 copy of our hardware parameters More...
 
tsCaptureConfigMsg msCaptureConfigMsg
 copy of the capture configuration More...
 
volatile unsigned int mnMillisecsToGo
 number of milliseconds of exp on current frame More...
 
unsigned int mnFanEnable
 1 when FAN is enabled More...
 
unsigned int mnTECEnable
 1 when TEC is enabled More...
 
float mnTargetTemp
 target setpoin, degrees C More...
 
volatile float mnPID [3]
 P,I,D controls. More...
 
float mnCoolingDuty
 cooling duty (0 to 1) More...
 
unsigned int mnGpioPinState
 GPIO pin state. More...
 
volatile bool mbDSPShutdown
 true when DSP is shutdown More...
 
volatile bool mbSendNoOps
 when true, send NO OP packets More...
 
volatile int mnNoOpCounter
 NOOP counter. More...
 
volatile int mnMsPerNoOp
 time between NOOP sends More...
 
uint64 mnMaxFramesInQueue
 
bool mbCancelUpdate
 
unsigned int * mp32BitBuffer
 local buffer for expanding 16-bit data to 32-bit data More...
 
uint32_t mn32BitBufferWords
 size of the mp32BitBuffer in 32-bit words More...
 
char ** mp16BitHeaders
 pointer vector for 16 bit headers More...
 
char ** mp32BitHeaders
 pointer vector for 16 bit headers More...
 
struct iovec * mpIOV
 IOV structure for iov write calls. More...
 
uint32_t * mpOutputBinning
 cached copy of bin params for processing binned images More...
 
bool mbShear
 enable flag for shearing More...
 
unsigned int mnShearThresh
 shearing threshold More...
 
unsigned int mnShearWinX
 number of columns to average in shearing process More...
 
unsigned int mnShearWinY
 number of rows to average in shearing process More...
 
bool mbFlipY
 
- Protected Attributes inherited from tcIOChannel
std::string m_name
 
SocCamera::teIOChannels meIOId
 
SocCamera::tcSensorBoardmpSensor
 
SocCamera::teBPPMode meBppMode
 
int64 mnImgCount
 
std::list< tsNewFrameMsgmlUpdates
 
tcMutex mcMutex
 
tcCondition mcCond
 
void * mpMemory
 
tcIOChannelThread mcThread
 
tsNewFrameMsg msLastUpdate
 
bool mbSimRAM
 

Static Protected Attributes

static const int gnPacketsPerWrite = 64
 number of packets in an iov write call for TCP writev() More...
 
- Static Protected Attributes inherited from tcIOChannel
static uint32 CAPTURE_START_ADDR = (0x20000000)
 
static uint32 MEMORY_BLOCK_SIZE = (0x20000000)
 
static bool CMEM_USED = (true)
 
static bool MMAP_USED = (true)
 

Member Typedef Documentation

◆ MsgHandler

typedef void(tcMityViewerApp::* tcMityViewerApp::MsgHandler) (tuCameraMessages *apMsg)
protected

Constructor & Destructor Documentation

◆ tcMityViewerApp()

tcMityViewerApp::tcMityViewerApp ( tcSensorBoard apSensor,
tcIOChannel apChannel,
uint64  anMaxFramesInQueue = MAX_NUM_FRAMES_IN_QUEUE 
)

SCMOS Application Class Constructor.

The main purpose of this class is to inialize all of the class context fields to sane values. Users of this class (or deriving from this class) can override the MityDSP Core base address values, task priorities, and interface parsers prior to calling the Initialize method.

◆ ~tcMityViewerApp()

tcMityViewerApp::~tcMityViewerApp ( void  )
virtual

Application destructor.

The application is designed to run indefinitately. This method should never be called.

Member Function Documentation

◆ AbortRead()

void tcMityViewerApp::AbortRead ( tuCameraMessages msg)
protected

◆ capture()

teNackCode tcMityViewerApp::capture ( tsCaptureRequest  asRequest)
virtual

Start a capture with this request. If the requests number of frames is tsNewRequest::CANCEL_CAPTURE then the current capture is stopped if possible.

Parameters
asRequest- the request for capture being made.
Returns
a nack code if the capture parameters are inelligable for this IOChannel.

Implements tcIOChannel.

◆ CISCalibrate()

void tcMityViewerApp::CISCalibrate ( tuCameraMessages msg)
protected

◆ CISGetCalibrationState()

void tcMityViewerApp::CISGetCalibrationState ( tuCameraMessages msg)
protected

◆ CISSetChannelSelect()

void tcMityViewerApp::CISSetChannelSelect ( tuCameraMessages msg)
protected

◆ CISSetShutterMode()

void tcMityViewerApp::CISSetShutterMode ( tuCameraMessages msg)
protected

◆ Clear()

void tcMityViewerApp::Clear ( tuCameraMessages msg)
protected

Clear a CCD Sensor

Returns
none.

◆ DispatchMainLoop()

void * tcMityViewerApp::DispatchMainLoop ( void *  apThis)
staticprotected

Dispatch Main Loop Thread

This method is a static C++ method/utility to launch the MainLoop method with appropriate object context in place.

Parameters
[in]apThispointer to a valid tcSCMOSApp object.

◆ DispatchMessageHandler()

bool tcMityViewerApp::DispatchMessageHandler ( int  anStatus,
void *  apData,
int  anLength,
unsigned int  anInfo,
void *  apThis 
)
staticprotected

Dispatch Message Handler

Called by either mpUSBParser or mpNetworkParser class. Interface handler for PC/client messages. Routes commands to local object.

◆ DispatchNetworkPoll()

void * tcMityViewerApp::DispatchNetworkPoll ( void *  apThis)
staticprotected

Dispatch Network Poll Thread

This method is a static C++ method/utility to launch the NetworkPoll method with appropriate object context in place.

Parameters
apThispointer to a valid tcSCMOSApp object.

◆ DispatchNetworkServer()

void * tcMityViewerApp::DispatchNetworkServer ( void *  apThis)
staticprotected

Dispatch Network Server Thread

This method is a static C++ method/utility to launch the NetworkServer method with appropriate object context in place.

Parameters
apThispointer to a valid tcSCMOSApp object.

◆ GetBinningSeq()

void tcMityViewerApp::GetBinningSeq ( tuCameraMessages msg)
protected

◆ GetBinParam()

void tcMityViewerApp::GetBinParam ( tuCameraMessages msg)
protected

◆ GetBoardTemp()

void tcMityViewerApp::GetBoardTemp ( tuCameraMessages msg)
protected

◆ GetCCDTemp()

void tcMityViewerApp::GetCCDTemp ( tuCameraMessages msg)
protected

◆ GetCooling()

void tcMityViewerApp::GetCooling ( tuCameraMessages msg)
protected

◆ GetExposure()

void tcMityViewerApp::GetExposure ( tuCameraMessages msg)
protected

Get the exposure time of the CCD.

◆ GetExposureEx()

void tcMityViewerApp::GetExposureEx ( tuCameraMessages msg)
protected

Get the exposure time of the CCD.

◆ GetFilter()

void tcMityViewerApp::GetFilter ( tuCameraMessages msg)
protected

◆ GetGain()

void tcMityViewerApp::GetGain ( tuCameraMessages msg)
protected

◆ GetGPIO()

void tcMityViewerApp::GetGPIO ( tuCameraMessages msg)
protected

◆ GetHardwareParams()

void tcMityViewerApp::GetHardwareParams ( tuCameraMessages msg)
protected

◆ GetHorBinParam()

void tcMityViewerApp::GetHorBinParam ( tuCameraMessages msg)
protected

◆ GetImageIntervals()

void tcMityViewerApp::GetImageIntervals ( tuCameraMessages msg)
protected

◆ GetImageMirrorCfg()

void tcMityViewerApp::GetImageMirrorCfg ( tuCameraMessages msg)
protected

◆ GetMultipleROIState()

void tcMityViewerApp::GetMultipleROIState ( tuCameraMessages msg)
protected

◆ GetNetConfig()

void tcMityViewerApp::GetNetConfig ( tuCameraMessages msg)
protected

◆ GetParameter()

void tcMityViewerApp::GetParameter ( tuCameraMessages msg)
protected

◆ GetPID()

void tcMityViewerApp::GetPID ( tuCameraMessages msg)
protected

◆ GetReadoutNoise()

void tcMityViewerApp::GetReadoutNoise ( tuCameraMessages msg)
protected

◆ GetSetPoint()

void tcMityViewerApp::GetSetPoint ( tuCameraMessages msg)
protected

◆ GetShutterDel()

void tcMityViewerApp::GetShutterDel ( tuCameraMessages msg)
protected

◆ GetSimpleBinning()

void tcMityViewerApp::GetSimpleBinning ( tuCameraMessages msg)
protected

◆ GetSimulationMode()

void tcMityViewerApp::GetSimulationMode ( tuCameraMessages msg)
protected

◆ GetTimingFileData()

void tcMityViewerApp::GetTimingFileData ( tuCameraMessages msg)
protected

◆ GetTrigger()

void tcMityViewerApp::GetTrigger ( tuCameraMessages msg)
protected

◆ GetTriggerMode()

void tcMityViewerApp::GetTriggerMode ( tuCameraMessages msg)
protected

◆ Initialize()

int tcMityViewerApp::Initialize ( tcCommandInterface apInterface)

Main Initialization routine.

This routine performs the following funtions:

  • Loads Network and configuration info from FLASH
  • initializes USB, RS232, and Network interfaces
  • initializes tcCameraApp (which initializes the CCD hardware)
  • initializes the USB and Network Parsers if needed.
  • launches runtime tasks
Note
This method, though virtual, should in general be called by classes deriving from the tcSCMOSApp class. Usually custom applications do not require altering the initialization of the CCDsp interface hardware or the CCD hardware, but may require to overload the interface parsers (mpUSBParser, mpNetworkParser) if a custom protocol is required.
Returns
non-zero on error

◆ Loopback()

void tcMityViewerApp::Loopback ( tuCameraMessages msg)
protected

◆ MainLoop()

void tcMityViewerApp::MainLoop ( void  )
protected

Main Loop

This method performs any processing that is independent of input messages/commands. This is a virtual method and may be overridden for custom applications.

For the base tcSCMOSApp class, the Main Loop collects temperature data from the CCD and the I/O Board on the CCDsp camera hardware and issues a status message every 2 seconds.

◆ MessageHandler()

bool tcMityViewerApp::MessageHandler ( int  anStatus,
void *  apData,
int  anLength,
unsigned int  anInfo 
)
protected

Client Command Message Handler

Called by either mpUSBParser or mpNetworkParser class. Interface handler for PC/client messages. Routes commands to local object.

Returns
true if message processed OK.

◆ mkImage()

tcImage* tcMityViewerApp::mkImage ( tsNewFrameMsg apMsg)
protected

build/validate a tcImage from a new frame msg

Returns
tcImage pointer (may be nullptr)

◆ MsgToText()

const char * tcMityViewerApp::MsgToText ( unsigned int  MsgId)
protected

◆ NetworkPoll()

void tcMityViewerApp::NetworkPoll ( void  )
protected

Network Poll Request Handler

This method looks for UDP poll/discovery requests from potential camera controllers (PCs, etc.) and responds with the camera configuration and network information.

< 19200 is fine, no reason to make this configurable..

◆ NetworkServer()

void tcMityViewerApp::NetworkServer ( void  )
protected

Network Socket / Server Thread

This method/task handles the network interface for the tcSCMOSApp communication. The method creates a server socket which listens on the configured server port. When a client connects, the task accepts the connection. As net data is received, it is routed to the mpNetworkParser (if not NULL). If an error is detected on the socket, then it is closed and the process starts over on the next client connection request.

◆ NoOpCtrl()

void tcMityViewerApp::NoOpCtrl ( tuCameraMessages msg)
protected

◆ OpComplete()

void tcMityViewerApp::OpComplete ( tuCameraMessages msg)
protected

◆ Read32()

void tcMityViewerApp::Read32 ( tuCameraMessages msg)
protected

◆ ReadArea()

void tcMityViewerApp::ReadArea ( tuCameraMessages msg)
protected

Read the CCD in area mode.

Returns
none

◆ ReadCCDBin()

void tcMityViewerApp::ReadCCDBin ( tuCameraMessages msg)
protected

◆ Report()

void tcMityViewerApp::Report ( const char *  fmt,
  ... 
)
virtual

◆ ReportError()

void tcMityViewerApp::ReportError ( const char *  buffer)
virtual

Report Error Fucntion

This method routes error text to the CCDsp RS232 serial port.

Parameters
[in]buffererror text to display (NULL terminated C string)

◆ Reset()

void tcMityViewerApp::Reset ( tuCameraMessages msg)
protected

◆ Send16BitFrame()

void tcMityViewerApp::Send16BitFrame ( tsNewFrameMsg apMsg)
protected

Send a 16 bit frame back to the MityViewer.

Parameters
apMsg

Write image data out using writev() with at least 32 packets per writev system call. Should noticably improve efficiency.

◆ Send32BitFrame()

void tcMityViewerApp::Send32BitFrame ( tsNewFrameMsg apMsg)
protected

tcMityViewerApp::Send32BitFrame

Send a 32 bit frame back to the MityViewer.

Parameters
apMsg
apMsg

Write image data out using writev() with at least 32 packets per writev system call. Should noticably improve efficiency.

◆ SendCaptureConfig()

void tcMityViewerApp::SendCaptureConfig ( void  )
protected

Misc Functions

◆ SendMessage()

int tcMityViewerApp::SendMessage ( tsMsgHeader Msg,
int  len,
void *  apPayload = NULL,
int  payload_len = 0 
)
protected

Send a Message

This method sends a data message to Network Interface (if it is connected) or the USB interface (if the network is not connected). An optional apPayload buffer may be provided in order to allow reduction of memcpys() for efficiency.

Prior to sending the message, this method will call the tcCamParser::PrepareOutput method, which usually performs such tasks as updating sequence numbers and computing checksums, etc.

Note
By default, interface messages cannot be sent to the RS232 port.
the design of the tcSCMOSApp assumes only one controlling interface is used at a time.
Parameters
[in]Msgpointer to a valid camera message
[in]lenlength of the Msg buffer to be transmitted
[in]apPayloadpointer to additional payload buffer to append to Msg
[in]payload_lenlength of the apPayload buffer to be appended
Returns
non-zero on failure

◆ SendNackCode()

void tcMityViewerApp::SendNackCode ( teNackCode  aeCode,
const char *  asMessage 
)
protected

Sends a message when there is an error nack code.

Parameters
aeCode- the nack code of the operation
asMessage- a message for the operation that was done.

◆ SendNetworkData()

int tcMityViewerApp::SendNetworkData ( char *  data,
int  len 
)
protected

◆ sendUpdate()

void tcMityViewerApp::sendUpdate ( tsNewFrameMsg apMsg)
virtual

tcMityViewerApp::sendUpdate Called when new frame data is available to transmit to host.

Parameters
apMsginformation on the frame.

if we are a legacy CCD sensor and were in binning mode, then we need to assemble and transmit the 32 bit frame (summing digitial any rows with the BINCODE_SUM opcode). Otherwise, if we are not the legacy CCD sensor, we always transmit 16 bit data. This is a limitation of the MityCCD interface protocol.

Implements tcIOChannel.

◆ SetAreaParam()

void tcMityViewerApp::SetAreaParam ( tuCameraMessages msg)
protected

◆ SetBinningSeq()

void tcMityViewerApp::SetBinningSeq ( tuCameraMessages msg)
protected

◆ SetBinParam()

void tcMityViewerApp::SetBinParam ( tuCameraMessages msg)
protected

◆ setBpp()

teNackCode tcMityViewerApp::setBpp ( SocCamera::teBPPMode  aeBppMode)
virtual

Sets the bits-per-pixel output of the camera.

Parameters
aeBppMode- the bits per pixel mode.
Returns
the nack code for the operation

Implements tcIOChannel.

◆ SetCooling()

void tcMityViewerApp::SetCooling ( tuCameraMessages msg)
protected

◆ SetExposure()

void tcMityViewerApp::SetExposure ( tuCameraMessages msg)
protected

Client API INTERFACE FUNCTIONS

Set the Exposure time of the CCD.

This routine sets the time the image acquisition cycle will wait prior to acquiring a new image.

◆ SetExposureEx()

void tcMityViewerApp::SetExposureEx ( tuCameraMessages msg)
protected

◆ SetFanCtrl()

void tcMityViewerApp::SetFanCtrl ( tuCameraMessages msg)
protected

◆ SetFilter()

void tcMityViewerApp::SetFilter ( tuCameraMessages msg)
protected

◆ SetGain()

void tcMityViewerApp::SetGain ( tuCameraMessages msg)
protected

◆ SetGPIO()

void tcMityViewerApp::SetGPIO ( tuCameraMessages msg)
protected

◆ SetHardwareParams()

void tcMityViewerApp::SetHardwareParams ( tuCameraMessages msg)
protected

◆ SetHorBinParam()

void tcMityViewerApp::SetHorBinParam ( tuCameraMessages msg)
protected

◆ SetImageInterval()

void tcMityViewerApp::SetImageInterval ( tuCameraMessages msg)
protected

Set the desired imaging rate for multi-frame CCD captures.

This routine will allow continuous sampling of CCD images at a fixed image rate (start of exposure to start of exposure timing). The routine computes the closest frame rate that can be achieved that matches the desired interval rate for area captures and binning captures for binning sequence number 0.

The results are stored in the mnDesiredIntervalms, mnAreaIntervalms, mnBinIntervalms, and mnAreaIntervalms parameters. Times computed include an estimate of the overhead associated with link transfer as well as CCD transfer.

Returns
none.

◆ SetImageMirrorCfg()

void tcMityViewerApp::SetImageMirrorCfg ( tuCameraMessages msg)
protected

◆ SetMultipleROIState()

void tcMityViewerApp::SetMultipleROIState ( tuCameraMessages msg)
protected

◆ SetOffset()

void tcMityViewerApp::SetOffset ( tuCameraMessages msg)
protected

Set the background (bias).

Returns
none.

◆ SetParameter()

void tcMityViewerApp::SetParameter ( tuCameraMessages msg)
protected

◆ SetPID()

void tcMityViewerApp::SetPID ( tuCameraMessages msg)
protected

◆ SetRecordParams()

void tcMityViewerApp::SetRecordParams ( tuCameraMessages msg)
protected

◆ SetSetPoint()

void tcMityViewerApp::SetSetPoint ( tuCameraMessages msg)
protected

◆ SetShearCtrl()

void tcMityViewerApp::SetShearCtrl ( tuCameraMessages msg)
protected

◆ SetShutterCloseDel()

void tcMityViewerApp::SetShutterCloseDel ( tuCameraMessages msg)
protected

◆ SetSimpleBinning()

void tcMityViewerApp::SetSimpleBinning ( tuCameraMessages msg)
protected

◆ SetSimulationMode()

void tcMityViewerApp::SetSimulationMode ( tuCameraMessages msg)
protected

◆ setTECHandler()

void tcMityViewerApp::setTECHandler ( SocCamera::tcTECHandler apHandler)

◆ SetTrigger()

void tcMityViewerApp::SetTrigger ( tuCameraMessages msg)
protected

[MAW] right now, some cameras limit which pins can be trigger pins. The limitations are documented in the user guides. Try applying setting if a valid pin is identified. Low level setters should raise errors.

◆ SetTriggerMode()

void tcMityViewerApp::SetTriggerMode ( tuCameraMessages msg)
protected

◆ Shear()

void tcMityViewerApp::Shear ( uint16_t *  apData,
unsigned int  anRows,
unsigned int  anCols 
)
protected

implements legacy MityCCD shearing operation on RAW CCD data

Parameters
[in,out]apDataPointer to the RAW data buffer to manipulate
[in]rowsnumber of rows in the image data
[in]colsnumber of columns in the image data

◆ Shutdown()

int tcMityViewerApp::Shutdown ( void  )

Shutdown all threads spawned directly or indirectly from application

  • Network threads.
  • USB threads.
  • DSPLINK inbound / outbound threads

◆ Write32()

void tcMityViewerApp::Write32 ( tuCameraMessages msg)
protected

◆ WriteConfig()

void tcMityViewerApp::WriteConfig ( void  )
protected

Write updated configuration file back out to disk.

◆ WriteDAC()

void tcMityViewerApp::WriteDAC ( tuCameraMessages msg)
protected

◆ WriteNetConfig()

void tcMityViewerApp::WriteNetConfig ( tuCameraMessages msg)
protected

Member Data Documentation

◆ gnPacketsPerWrite

const int tcMityViewerApp::gnPacketsPerWrite = 64
staticprotected

number of packets in an iov write call for TCP writev()

◆ maHandlers

MsgHandler tcMityViewerApp::maHandlers[256]
protected

function handler table.

◆ maShutdownPipes

volatile int tcMityViewerApp::maShutdownPipes[3 *2]
protected

pipes used to shut stuff down (reader/writer)

◆ mbCalibrated

bool tcMityViewerApp::mbCalibrated
protected

◆ mbCancelUpdate

bool tcMityViewerApp::mbCancelUpdate
protected

◆ mbConfigChange

bool tcMityViewerApp::mbConfigChange
protected

flag indicating the config data has changed (from API)

◆ mbConfigValid

bool tcMityViewerApp::mbConfigValid
protected

when true, our configuration is OK

◆ mbDSPShutdown

volatile bool tcMityViewerApp::mbDSPShutdown
protected

true when DSP is shutdown

◆ mbFlipY

bool tcMityViewerApp::mbFlipY
protected

◆ mbHasChannel

bool tcMityViewerApp::mbHasChannel
protected

◆ mbNetworkActive

volatile bool tcMityViewerApp::mbNetworkActive
protected

Indicates network socket is connected and active.

◆ mbSendHeartBeats

volatile bool tcMityViewerApp::mbSendHeartBeats
protected

when true, send heartbeats out interface

◆ mbSendNoOps

volatile bool tcMityViewerApp::mbSendNoOps
protected

when true, send NO OP packets

◆ mbShear

bool tcMityViewerApp::mbShear
protected

enable flag for shearing

◆ mbShutdown

volatile bool tcMityViewerApp::mbShutdown
protected

true when app should shut down

◆ mbUseChannel

bool tcMityViewerApp::mbUseChannel
protected

◆ mhMainThread

pthread_t tcMityViewerApp::mhMainThread
protected

thread object for heatbeat/status processsing

◆ mhNetworkPollThread

pthread_t tcMityViewerApp::mhNetworkPollThread
protected

thread object for network poll server

◆ mhNetworkSrvThread

pthread_t tcMityViewerApp::mhNetworkSrvThread
protected

thread object for network server

◆ mhOutputMutex

tcMutex tcMityViewerApp::mhOutputMutex
protected

◆ mn32BitBufferWords

uint32_t tcMityViewerApp::mn32BitBufferWords
protected

size of the mp32BitBuffer in 32-bit words

◆ mnAreaIntervalms

unsigned int tcMityViewerApp::mnAreaIntervalms
protected

area mode update interval

◆ mnCoolingDuty

float tcMityViewerApp::mnCoolingDuty
protected

cooling duty (0 to 1)

◆ mnDesiredIntervalms

unsigned int tcMityViewerApp::mnDesiredIntervalms
protected

last desired setting known

◆ mnDSPRev

unsigned short tcMityViewerApp::mnDSPRev
protected

copy of the DSP code revision level

◆ mnFanEnable

unsigned int tcMityViewerApp::mnFanEnable
protected

1 when FAN is enabled

◆ mnFPGARev

unsigned short tcMityViewerApp::mnFPGARev
protected

copy of the FPGA revision level

◆ mnGpioPinState

unsigned int tcMityViewerApp::mnGpioPinState
protected

GPIO pin state.

◆ mnLoopBackErrorCnt

unsigned int tcMityViewerApp::mnLoopBackErrorCnt
protected

number of errors encountered on loopback testing

◆ mnMaxFramesInQueue

uint64 tcMityViewerApp::mnMaxFramesInQueue
protected

◆ mnMean

float tcMityViewerApp::mnMean
protected

mean value (from set Offset Target processing)

◆ mnMessageInCount

int tcMityViewerApp::mnMessageInCount
protected

number of Client messages (from PC)

◆ mnMessageOutCount

int tcMityViewerApp::mnMessageOutCount
protected

number of Outbound messages to client (PC)

◆ mnMillisecsToGo

volatile unsigned int tcMityViewerApp::mnMillisecsToGo
protected

number of milliseconds of exp on current frame

◆ mnMsPerNoOp

volatile int tcMityViewerApp::mnMsPerNoOp
protected

time between NOOP sends

◆ mnNoOpCounter

volatile int tcMityViewerApp::mnNoOpCounter
protected

NOOP counter.

◆ mnNumAreaCols

unsigned int tcMityViewerApp::mnNumAreaCols
protected

number of columns for an area read

◆ mnNumAreaRows

unsigned int tcMityViewerApp::mnNumAreaRows
protected

number of rows for an area read

◆ mnPID

volatile float tcMityViewerApp::mnPID[3]
protected

P,I,D controls.

◆ mnShearThresh

unsigned int tcMityViewerApp::mnShearThresh
protected

shearing threshold

◆ mnShearWinX

unsigned int tcMityViewerApp::mnShearWinX
protected

number of columns to average in shearing process

◆ mnShearWinY

unsigned int tcMityViewerApp::mnShearWinY
protected

number of rows to average in shearing process

◆ mnSocket

int tcMityViewerApp::mnSocket
protected

our active network socket connection

◆ mnStdDev

float tcMityViewerApp::mnStdDev
protected

StdDev value (from set Offset Target processing)

◆ mnTargetTemp

float tcMityViewerApp::mnTargetTemp
protected

target setpoin, degrees C

◆ mnTECEnable

unsigned int tcMityViewerApp::mnTECEnable
protected

1 when TEC is enabled

◆ mp16BitHeaders

char** tcMityViewerApp::mp16BitHeaders
protected

pointer vector for 16 bit headers

◆ mp32BitBuffer

unsigned int* tcMityViewerApp::mp32BitBuffer
protected

local buffer for expanding 16-bit data to 32-bit data

◆ mp32BitHeaders

char** tcMityViewerApp::mp32BitHeaders
protected

pointer vector for 16 bit headers

◆ mpCCD

tcLegacyCCD* tcMityViewerApp::mpCCD
protected

◆ mpChannel

tcIOChannel* tcMityViewerApp::mpChannel
protected

◆ mpCRC

CrcCalc* tcMityViewerApp::mpCRC
protected

CRC engine for loopback mode.

◆ mpInterface

tcCommandInterface* tcMityViewerApp::mpInterface
protected

◆ mpIOV

struct iovec* tcMityViewerApp::mpIOV
protected

IOV structure for iov write calls.

◆ mpNetworkParser

tcCamParser* tcMityViewerApp::mpNetworkParser
protected

pointer to parser for Network Interface

◆ mpOutputBinning

uint32_t* tcMityViewerApp::mpOutputBinning
protected

cached copy of bin params for processing binned images

◆ mpSensor

tcSensorBoard* tcMityViewerApp::mpSensor
protected

◆ mpTECHandler

SocCamera::tcTECHandler* tcMityViewerApp::mpTECHandler
protected

◆ msCaptureConfigMsg

tsCaptureConfigMsg tcMityViewerApp::msCaptureConfigMsg
protected

copy of the capture configuration

◆ msHdwrParamMsg

tsHdwrParamMsg tcMityViewerApp::msHdwrParamMsg
protected

copy of our hardware parameters

◆ msSimMode

tsSimulationModeMsg tcMityViewerApp::msSimMode
protected

active simulation mode data


The documentation for this class was generated from the following files: