ISDisplay.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2020 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #ifndef IS_DISPLAY_H
14 #define IS_DISPLAY_H
15 
16 #include <stdlib.h>
17 #include <inttypes.h>
18 #include <vector>
19 #include <string>
20 
21 #include "com_manager.h"
22 #include "data_sets.h"
23 #include "ISConstants.h"
24 
25 using namespace std;
26 
31 {
32 public:
34  {
38  DMODE_QUIET
39  };
40 
42 
43  void SetDisplayMode(eDisplayMode mode) { m_displayMode = mode; };
44  eDisplayMode GetDisplayMode() { return m_displayMode; }
45  void ShowCursor(bool visible);
46  void ShutDown();
47  void Clear(void);
48  void Home(void);
49  void GoToRow(int y);
50  void GoToColumnAndRow(int x, int y);
51  string Hello();
52  string Connected();
53  string Replay(double speed=1.0);
54  string Goodbye();
55  int ReadKey(); // non-block, returns -1 if no key available
56  bool ControlCWasPressed();
57 
58  // for the binary protocol, this processes a packet of data
59  void ProcessData(p_data_t *data, bool enableReplay = false, double replaySpeedX = 1.0);
60  void DataToStats(const p_data_t* data);
61  string DataToString(const p_data_t* data);
62  char* StatusToString(char* ptr, char* ptrEnd, const uint32_t insStatus, const uint32_t hdwStatus);
63  char* InsStatusToSolStatusString(char* ptr, char* ptrEnd, const uint32_t insStatus);
64  string DataToStringINS1(const ins_1_t &ins1, const p_data_hdr_t& hdr);
65  string DataToStringINS2(const ins_2_t &ins2, const p_data_hdr_t& hdr);
66  string DataToStringINS3(const ins_3_t &ins3, const p_data_hdr_t& hdr);
67  string DataToStringINS4(const ins_4_t &ins4, const p_data_hdr_t& hdr);
68  string DataToStringDualIMU(const dual_imu_t &imu, const p_data_hdr_t& hdr);
69  string DataToStringIMU(const imu_t &imu, const p_data_hdr_t& hdr);
70  string DataToStringPreintegratedImu(const preintegrated_imu_t &imu, const p_data_hdr_t& hdr);
71  string DataToStringMag(const magnetometer_t &mag, const p_data_hdr_t& hdr);
72  string DataToStringMagCal(const mag_cal_t &mag, const p_data_hdr_t& hdr);
73  string DataToStringBaro(const barometer_t &baro, const p_data_hdr_t& hdr);
74  string DataToStringGpsPos(const gps_pos_t &gps, const p_data_hdr_t& hdr, const string didName);
75  string DataToStringRtkRel(const gps_rtk_rel_t &gps, const p_data_hdr_t& hdr, const string didName);
76  string DataToStringRtkMisc(const gps_rtk_misc_t& sol, const p_data_hdr_t& hdr, const string didName);
77  string DataToStringRawGPS(const gps_raw_t& raw, const p_data_hdr_t& hdr);
78  string DataToStringSurveyIn(const survey_in_t &survey, const p_data_hdr_t& hdr);
79  string DataToStringSysParams(const sys_params_t& sys, const p_data_hdr_t& hdr);
80  string DataToStringSysSensors(const sys_sensors_t& sensors, const p_data_hdr_t& hdr);
81  string DataToStringRTOS(const rtos_info_t& info, const p_data_hdr_t& hdr);
82  string DataToStringDevInfo(const dev_info_t &info, const p_data_hdr_t& hdr);
83  string DataToStringSensorsADC(const sys_sensors_adc_t &sensorsADC, const p_data_hdr_t& hdr);
84 
85 private:
86  string VectortoString();
87  void DataToVector(const p_data_t* data);
88 
89  vector<string> m_didMsgs;
91  uint16_t m_rxCount;
92 
93  struct sDidStats
94  {
96  int dtMs;
97  int count;
98  };
99 
100  vector<sDidStats> m_didStats;
101 
102 #if PLATFORM_IS_WINDOWS
103 
104  HANDLE m_windowsConsoleIn;
105  HANDLE m_windowsConsoleOut;
106 
107 #endif
108 
109 };
110 
111 ostream& boldOn(ostream& os);
112 ostream& boldOff(ostream& os);
113 ostream& endlbOn(ostream& os); // Bold on with newline
114 ostream& endlbOff(ostream& os); // Bold off with newline
115 
116 #endif // IS_DISPLAY_H
ostream & boldOn(ostream &os)
Definition: ISDisplay.cpp:1386
void SetDisplayMode(eDisplayMode mode)
Definition: ISDisplay.h:43
ostream & boldOff(ostream &os)
Definition: ISDisplay.cpp:1401
def hdwStatus(hstatus)
Hardware Status #####.
ostream & endlbOff(ostream &os)
Definition: ISDisplay.cpp:1433
vector< string > m_didMsgs
Definition: ISDisplay.h:89
ostream & endlbOn(ostream &os)
Definition: ISDisplay.cpp:1417
USBInterfaceDescriptor data
def insStatus(istatus)
INS Status #####.
eDisplayMode GetDisplayMode()
Definition: ISDisplay.h:44
eDisplayMode m_displayMode
Definition: ISDisplay.h:90
vector< sDidStats > m_didStats
Definition: ISDisplay.h:100


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04