gccDppConsole Test C++ SDK  1.0.0.0
DPP C++ Console Demonstration
ConsoleHelper.h
Go to the documentation of this file.
00001 
00006 #pragma once
00007 
00008 #include <string>
00009 #include <vector>
00010 #include "DppLibUsb.h"                  // LibUsb Support
00011 #include "DP5Protocol.h"                // DPP Protocol Support
00012 #include "ParsePacket.h"                // Packet Parser
00013 #include "SendCommand.h"                // Command Generator
00014 #include "DP5Status.h"                  // Status Decoder
00015 
00016 class CConsoleHelper
00017 {
00018 public:
00019         CConsoleHelper(void);
00020         ~CConsoleHelper(void);
00021 
00023         CDppLibUsb DppLibUsb;
00025         bool LibUsb_isConnected;
00027         int  LibUsb_NumDevices;
00029         bool LibUsb_Connect_Default_DPP();
00031         void LibUsb_Close_Connection();
00033         bool LibUsb_SendCommand(TRANSMIT_PACKET_TYPE XmtCmd);
00035         bool LibUsb_SendCommand_Config(TRANSMIT_PACKET_TYPE XmtCmd, CONFIG_OPTIONS CfgOptions);
00037         bool LibUsb_ReceiveData();
00038 
00039         // communications helper functions
00040 
00042         CDP5Protocol DP5Proto;
00044         CSendCommand SndCmd;
00046         CParsePacket ParsePkt;
00048         CDP5Status DP5Stat;                     
00049         
00050         // DPP packet processing functions.
00051 
00053         bool ReceiveData();
00055         void ProcessSpectrumEx(Packet_In PIN, DppStateType DppState);
00057         void ClearConfigReadFormatFlags();
00059         void ProcessCfgReadEx(Packet_In PIN, DppStateType DppState);
00061         void CreateConfigOptions(CONFIG_OPTIONS *CfgOptions, string strCfg, CDP5Status DP5Stat, bool bUseCoarseFineGain);
00062 
00063         //display support
00064 
00066         void ConsoleGraph(long lData[], long chan, bool bLog, std::string strStatus);
00068         string DppStatusString;
00069 
00070         // DPP configuration information variables 
00071 
00073         bool b80MHzMode;
00075         string strMcaMode;
00077         vector<string> Dp5CmdList;
00078 
00079         // configuration readback format control flags
00080         // these flags control how the configuration readback is formatted and processed
00081 
00083         bool DisplayCfg;
00085         bool DisplaySca;
00087         bool CfgReadBack;
00089         bool SaveCfg;
00091         bool PrintCfg;
00093         bool HwCfgReady;
00095         bool ScaReadBack;
00096 
00097         // Tuning and display variables.
00098 
00100         string HwCfgDP5;
00102         int mcaCH;
00104         double SlowThresholdPct;
00106         int FastChThreshold;
00108         double RiseUS;
00110         string strGainDisplayValue;
00112         int AcqMode;                            
00113 
00114         // configuration presets for display (status updates preset progress)
00115 
00117         int PresetCount;
00119         double PresetAcq;
00121         double PresetRt;
00123         string strPresetCmd;
00125         string strPresetVal;
00126 
00127         // configuration support functions
00128 
00130         string GetCmdData(string strCmd, string strCfgData);
00132         string ReplaceCmdDesc(string strCmd, string strCfgData);
00134         string GetCmdDesc(string strCmd);
00135 
00136         // oscilloscope support
00137 
00138 
00139         bool UpdateScopeCfg;
00140         string strInputOffset;
00141         string strAnalogOut;
00142         string strOutputOffset;
00143         string strTriggerSource;
00144         string strTriggerSlope;
00145         string strTriggerPosition;
00146         string strScopeGain;
00147 
00148 };
00149 
00150 
00151 
00152 
00153 
00154 
00155 
00156 
00157 
00158 
00159 
00160 
00161 
00162 
00163 
00164 
00165 
00166 
00167 
00168 
00169 
00170