gccDppConsole Test C++ SDK
20170920
DPP C++ Console Demonstration
|
#include <ConsoleHelper.h>
Public Member Functions | |
CConsoleHelper (void) | |
~CConsoleHelper (void) | |
bool | LibUsb_Connect_Default_DPP () |
LibUsb connect to the default DPP. | |
void | LibUsb_Close_Connection () |
LibUsb close the current connection. | |
bool | LibUsb_SendCommand (TRANSMIT_PACKET_TYPE XmtCmd) |
LibUsb send a command that does not require additional processing. | |
bool | LibUsb_SendCommand_Config (TRANSMIT_PACKET_TYPE XmtCmd, CONFIG_OPTIONS CfgOptions) |
LibUsb send a command that requires configuration options processing. | |
bool | LibUsb_ReceiveData () |
LibUsb receive data. | |
bool | ReceiveData () |
Processes DPP data from all communication interfaces (USB,RS232,INET) | |
void | ProcessSpectrumEx (Packet_In PIN, DppStateType DppState) |
Processes spectrum packets. | |
void | ClearConfigReadFormatFlags () |
Clears configuration readback format flags. | |
void | ProcessCfgReadEx (Packet_In PIN, DppStateType DppState) |
Processes configuration packets. | |
void | CreateConfigOptions (CONFIG_OPTIONS *CfgOptions, string strCfg, CDP5Status DP5Stat, bool bUseCoarseFineGain) |
Populates the configuration command options data structure. | |
void | ConsoleGraph (long lData[], long chan, bool bLog, std::string strStatus) |
Provides a low resolution text console graph. | |
string | GetCmdData (string strCmd, string strCfgData) |
Returns the configuration command data from a configuration command string. | |
string | ReplaceCmdDesc (string strCmd, string strCfgData) |
Replaces (or inserts a command description (comment) in a configuration command string. | |
string | AppendCmdDesc (string strCmd, string strCfgData) |
Appends a command description (comment) in a configuration command string. | |
string | GetCmdDesc (string strCmd) |
Returns the command decription (comment) in a configuration command string. | |
string | CreateMCAData (long m_larDataBuffer[], SpectrumFileType sfInfo, DP4_FORMAT_STATUS cfgStatusLst) |
void | SaveSpectrumStringToFile (string strData) |
Saves a spectrum data string to a default file (SpectrumData.mca). | |
string | CreateSpectrumConfig (string strRawCfgIn) |
vector< string > | MakeDp5CmdList () |
Public Attributes | |
CDppLibUsb | DppLibUsb |
LibUsb communications class. | |
bool | LibUsb_isConnected |
LibUsb is connected if true. | |
int | LibUsb_NumDevices |
LibUsb number of devices found. | |
CDP5Protocol | DP5Proto |
Defines and implements DPP protocol. | |
CSendCommand | SndCmd |
Generates command packet to be sent. | |
CParsePacket | ParsePkt |
DPP packet parsing. | |
CDP5Status | DP5Stat |
DPP status processing. | |
string | DppStatusString |
DPP status display string. | |
bool | b80MHzMode |
FPGA 80MHz clock when true, 20MHz clock otherwise. | |
string | strMcaMode |
Holds MCA MODE display string. (NORM=MCA, MCS, FAST, etc.) | |
vector< string > | Dp5CmdList |
DPP configuration command array. | |
bool | DisplayCfg |
format configuration for display | |
bool | DisplaySca |
format sca for display (sca config sent separately) | |
bool | CfgReadBack |
format configuration for general readback | |
bool | SaveCfg |
format configuration for file save | |
bool | PrintCfg |
format configuration for print | |
bool | HwCfgReady |
configuration ready flag | |
bool | ScaReadBack |
sca readback ready flag | |
string | HwCfgDP5 |
Holds the hardware configuration readback. | |
int | mcaCH |
Number of data channels. | |
double | SlowThresholdPct |
Slow threshold in percent. | |
int | FastChThreshold |
Fast channel threshold. | |
double | RiseUS |
Peaking time value. | |
string | strGainDisplayValue |
Total gain display string. | |
int | AcqMode |
Acquisition mode. (0=MCA, 1=MCS) | |
int | PresetCount |
preset count setting | |
double | PresetAcq |
preset acquisition time setting | |
double | PresetRt |
preset real time setting | |
string | strPresetCmd |
presets mode summary (counts,accum. time,real time) | |
string | strPresetVal |
presets settings summary (preset values, counts,times) | |
bool | UpdateScopeCfg |
string | strInputOffset |
string | strAnalogOut |
string | strOutputOffset |
string | strTriggerSource |
string | strTriggerSlope |
string | strTriggerPosition |
string | strScopeGain |
SpectrumFileType | sfInfo |
Definition at line 26 of file ConsoleHelper.h.
CConsoleHelper::CConsoleHelper | ( | void | ) |
Definition at line 10 of file ConsoleHelper.cpp.
CConsoleHelper::~CConsoleHelper | ( | void | ) |
Definition at line 18 of file ConsoleHelper.cpp.
string CConsoleHelper::AppendCmdDesc | ( | string | strCmd, |
string | strCfgData | ||
) |
Appends a command description (comment) in a configuration command string.
Definition at line 433 of file ConsoleHelper.cpp.
Clears configuration readback format flags.
Definition at line 223 of file ConsoleHelper.cpp.
void CConsoleHelper::ConsoleGraph | ( | long | lData[], |
long | chan, | ||
bool | bLog, | ||
std::string | strStatus | ||
) |
Provides a low resolution text console graph.
Definition at line 593 of file ConsoleHelper.cpp.
void CConsoleHelper::CreateConfigOptions | ( | CONFIG_OPTIONS * | CfgOptions, |
string | strCfg, | ||
CDP5Status | DP5Stat, | ||
bool | bUseCoarseFineGain | ||
) |
Populates the configuration command options data structure.
Definition at line 93 of file ConsoleHelper.cpp.
string CConsoleHelper::CreateMCAData | ( | long | m_larDataBuffer[], |
SpectrumFileType | sfInfo, | ||
DP4_FORMAT_STATUS | cfgStatusLst | ||
) |
Definition at line 682 of file ConsoleHelper.cpp.
string CConsoleHelper::CreateSpectrumConfig | ( | string | strRawCfgIn | ) |
string CConsoleHelper::GetCmdData | ( | string | strCmd, |
string | strCfgData | ||
) |
Returns the configuration command data from a configuration command string.
Definition at line 391 of file ConsoleHelper.cpp.
string CConsoleHelper::GetCmdDesc | ( | string | strCmd | ) |
Returns the command decription (comment) in a configuration command string.
Definition at line 455 of file ConsoleHelper.cpp.
LibUsb close the current connection.
Definition at line 51 of file ConsoleHelper.cpp.
LibUsb connect to the default DPP.
Definition at line 22 of file ConsoleHelper.cpp.
bool CConsoleHelper::LibUsb_ReceiveData | ( | ) |
LibUsb receive data.
Definition at line 143 of file ConsoleHelper.cpp.
bool CConsoleHelper::LibUsb_SendCommand | ( | TRANSMIT_PACKET_TYPE | XmtCmd | ) |
LibUsb send a command that does not require additional processing.
Definition at line 62 of file ConsoleHelper.cpp.
bool CConsoleHelper::LibUsb_SendCommand_Config | ( | TRANSMIT_PACKET_TYPE | XmtCmd, |
CONFIG_OPTIONS | CfgOptions | ||
) |
LibUsb send a command that requires configuration options processing.
Definition at line 123 of file ConsoleHelper.cpp.
vector< string > CConsoleHelper::MakeDp5CmdList | ( | ) |
void CConsoleHelper::ProcessCfgReadEx | ( | Packet_In | PIN, |
DppStateType | DppState | ||
) |
Processes configuration packets.
Definition at line 236 of file ConsoleHelper.cpp.
void CConsoleHelper::ProcessSpectrumEx | ( | Packet_In | PIN, |
DppStateType | DppState | ||
) |
Processes spectrum packets.
Definition at line 203 of file ConsoleHelper.cpp.
bool CConsoleHelper::ReceiveData | ( | ) |
Processes DPP data from all communication interfaces (USB,RS232,INET)
ReceiveData receives the incoming packet, parses the packet, then routes the packet to its final destination for further processing.
Definition at line 159 of file ConsoleHelper.cpp.
string CConsoleHelper::ReplaceCmdDesc | ( | string | strCmd, |
string | strCfgData | ||
) |
Replaces (or inserts a command description (comment) in a configuration command string.
Definition at line 410 of file ConsoleHelper.cpp.
void CConsoleHelper::SaveSpectrumStringToFile | ( | string | strData | ) |
Saves a spectrum data string to a default file (SpectrumData.mca).
Definition at line 749 of file ConsoleHelper.cpp.
Acquisition mode. (0=MCA, 1=MCS)
Definition at line 122 of file ConsoleHelper.h.
FPGA 80MHz clock when true, 20MHz clock otherwise.
Definition at line 83 of file ConsoleHelper.h.
format configuration for general readback
Definition at line 97 of file ConsoleHelper.h.
format configuration for display
Definition at line 93 of file ConsoleHelper.h.
format sca for display (sca config sent separately)
Definition at line 95 of file ConsoleHelper.h.
vector<string> CConsoleHelper::Dp5CmdList |
DPP configuration command array.
Definition at line 87 of file ConsoleHelper.h.
Defines and implements DPP protocol.
Definition at line 52 of file ConsoleHelper.h.
DPP status processing.
Definition at line 58 of file ConsoleHelper.h.
LibUsb communications class.
Definition at line 33 of file ConsoleHelper.h.
DPP status display string.
Definition at line 78 of file ConsoleHelper.h.
Fast channel threshold.
Definition at line 116 of file ConsoleHelper.h.
string CConsoleHelper::HwCfgDP5 |
Holds the hardware configuration readback.
Definition at line 110 of file ConsoleHelper.h.
configuration ready flag
Definition at line 103 of file ConsoleHelper.h.
LibUsb is connected if true.
Definition at line 35 of file ConsoleHelper.h.
LibUsb number of devices found.
Definition at line 37 of file ConsoleHelper.h.
Number of data channels.
Definition at line 112 of file ConsoleHelper.h.
DPP packet parsing.
Definition at line 56 of file ConsoleHelper.h.
double CConsoleHelper::PresetAcq |
preset acquisition time setting
Definition at line 129 of file ConsoleHelper.h.
preset count setting
Definition at line 127 of file ConsoleHelper.h.
double CConsoleHelper::PresetRt |
preset real time setting
Definition at line 131 of file ConsoleHelper.h.
format configuration for print
Definition at line 101 of file ConsoleHelper.h.
double CConsoleHelper::RiseUS |
Peaking time value.
Definition at line 118 of file ConsoleHelper.h.
format configuration for file save
Definition at line 99 of file ConsoleHelper.h.
sca readback ready flag
Definition at line 105 of file ConsoleHelper.h.
Definition at line 165 of file ConsoleHelper.h.
Slow threshold in percent.
Definition at line 114 of file ConsoleHelper.h.
Generates command packet to be sent.
Definition at line 54 of file ConsoleHelper.h.
string CConsoleHelper::strAnalogOut |
Definition at line 153 of file ConsoleHelper.h.
Total gain display string.
Definition at line 120 of file ConsoleHelper.h.
Definition at line 152 of file ConsoleHelper.h.
string CConsoleHelper::strMcaMode |
Holds MCA MODE display string. (NORM=MCA, MCS, FAST, etc.)
Definition at line 85 of file ConsoleHelper.h.
Definition at line 154 of file ConsoleHelper.h.
string CConsoleHelper::strPresetCmd |
presets mode summary (counts,accum. time,real time)
Definition at line 133 of file ConsoleHelper.h.
string CConsoleHelper::strPresetVal |
presets settings summary (preset values, counts,times)
Definition at line 135 of file ConsoleHelper.h.
string CConsoleHelper::strScopeGain |
Definition at line 158 of file ConsoleHelper.h.
Definition at line 157 of file ConsoleHelper.h.
Definition at line 156 of file ConsoleHelper.h.
Definition at line 155 of file ConsoleHelper.h.
Definition at line 151 of file ConsoleHelper.h.