API
 
Loading...
Searching...
No Matches
cred2Utils.hpp File Reference

Utilities for the C-RED 2 camera controller. More...

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <string>
#include <vector>
#include <mx/ioutils/stringUtils.hpp>
Include dependency graph for cred2Utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MagAOX::app::cred2Temps
 Structure holding the temperature values reported by the C-RED 2. More...
 
struct  MagAOX::app::cred2Roi
 C-RED 2 ROI expressed as 0-based inclusive column and row limits. More...
 

Namespaces

namespace  MagAOX
 
namespace  MagAOX::app
 

Functions

std::string MagAOX::app::cred2CleanResponse (const std::string &response)
 Strip an optional prompt and surrounding whitespace from a C-RED 2 CLI response.
 
int MagAOX::app::cred2ParseFloat (float &value, const std::string &response)
 Parse a raw numeric response into a float.
 
int MagAOX::app::cred2ParseFloatVector (std::vector< float > &values, const std::string &response, size_t expectedValues)
 Parse a delimited list of raw numeric responses into a float vector.
 
int MagAOX::app::cred2ParseBool (bool &value, const std::string &response)
 Parse a raw on/off response into a boolean.
 
int MagAOX::app::cred2ParseRange (int &firstValue, int &secondValue, const std::string &response)
 Parse a raw range response such as 0-639.
 
int MagAOX::app::cred2ParseCropState (bool &enabled, int &startColumn, int &endColumn, int &startRow, int &endRow, const std::string &response)
 Parse a raw cropping status response such as on or on:192-447:128-383.
 
bool MagAOX::app::cred2ResponseOK (const std::string &response)
 Check whether a command response looks successful.
 
int MagAOX::app::cred2RoiFromCenter (cred2Roi &roi, float centerX, float centerY, int width, int height, int fullWidth, int fullHeight)
 Convert a MagAO-X ROI center/size description into C-RED 2 corners.
 
int MagAOX::app::cred2RoiToCenter (float &centerX, float &centerY, int &width, int &height, const cred2Roi &roi, int fullWidth, int fullHeight)
 Convert C-RED 2 ROI corners into a MagAO-X ROI center/size description.
 
std::string MagAOX::app::cred2ColumnsSpec (const cred2Roi &roi)
 Format the column command payload for set cropping columns.
 
std::string MagAOX::app::cred2RowsSpec (const cred2Roi &roi)
 Format the row command payload for set cropping rows.
 

Detailed Description

Utilities for the C-RED 2 camera controller.

Author
Jared R. Males (jared.nosp@m.male.nosp@m.s@gma.nosp@m.il.c.nosp@m.om)

Definition in file cred2Utils.hpp.