appmodel.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. #ifndef APPMODEL_H
  2. #define APPMODEL_H
  3. #include "EgoInterface.h"
  4. #include "ImageProvider.h"
  5. #include <QObject>
  6. #include <QtCore/QObject>
  7. #include <QtCore/QString>
  8. #include <QtGui>
  9. #include <QtQml/qqml.h>
  10. #include "mqtt/async_client.h"
  11. class CarData : public QObject {
  12. Q_OBJECT
  13. Q_PROPERTY(int32_t uid READ uid WRITE setUid NOTIFY dataChanged)
  14. Q_PROPERTY(QString name READ name WRITE setName NOTIFY dataChanged)
  15. Q_PROPERTY(QString type READ type WRITE setType NOTIFY dataChanged)
  16. Q_PROPERTY(QString state READ state WRITE setState NOTIFY dataChanged)
  17. public:
  18. explicit CarData(QObject *parent = 0);
  19. CarData(const CarData &other);
  20. int32_t uid() const;
  21. QString name() const;
  22. QString type() const;
  23. QString state() const;
  24. int32_t carType() const;
  25. void setUid(const int32_t &value);
  26. void setName(const QString &value);
  27. void setType(const QString &value);
  28. void setState(const QString &value);
  29. void setCarType(const int32_t& value);
  30. signals:
  31. void dataChanged();
  32. private:
  33. int32_t m_uid;
  34. int32_t m_carType;
  35. QString m_name;
  36. QString m_type;
  37. QString m_state;
  38. };
  39. Q_DECLARE_METATYPE(CarData)
  40. class AppModelPrivate;
  41. class CFishEyeWindow;
  42. class AppModel : public QObject {
  43. Q_OBJECT
  44. Q_PROPERTY(bool ready READ ready WRITE setReady NOTIFY readyChanged)
  45. Q_PROPERTY(QQmlListProperty<CarData> car READ car NOTIFY carChanged)
  46. Q_PROPERTY(int32_t radar1 READ radar1 WRITE setRadar1 NOTIFY radar1Changed)
  47. Q_PROPERTY(int32_t radar2 READ radar2 WRITE setRadar2 NOTIFY radar2Changed)
  48. Q_PROPERTY(int32_t radar3 READ radar3 WRITE setRadar3 NOTIFY radar3Changed)
  49. Q_PROPERTY(int32_t radar4 READ radar4 WRITE setRadar4 NOTIFY radar4Changed)
  50. Q_PROPERTY(int32_t radar5 READ radar5 WRITE setRadar5 NOTIFY radar5Changed)
  51. Q_PROPERTY(int32_t radar6 READ radar6 WRITE setRadar6 NOTIFY radar6Changed)
  52. Q_PROPERTY(int32_t radar7 READ radar7 WRITE setRadar7 NOTIFY radar7Changed)
  53. Q_PROPERTY(int32_t radar8 READ radar8 WRITE setRadar8 NOTIFY radar8Changed)
  54. Q_PROPERTY(float Steer READ Steer WRITE setSteerAngle NOTIFY steerAngleChanged)
  55. Q_PROPERTY(int32_t ping READ ping WRITE setPing NOTIFY pingChanged)
  56. Q_PROPERTY(int32_t temp READ temp WRITE setTemp NOTIFY tempChanged)
  57. Q_PROPERTY(int32_t alertSound READ alertSound NOTIFY playAlertSound)
  58. Q_PROPERTY(int32_t Speed READ Speed WRITE SetSpeed NOTIFY speedChanged)
  59. Q_PROPERTY(int32_t Visible READ Visible WRITE SetVisible NOTIFY visibleChanged)
  60. // Q_PROPERTY(int32_t Gear READ Gear WRITE SetGear NOTIFY gearChanged)
  61. Q_PROPERTY(QString Account READ Account WRITE setAccount NOTIFY accountChanged)
  62. Q_PROPERTY(QString Password READ Password WRITE setPassword NOTIFY passwordChanged)
  63. Q_PROPERTY(QString CarName READ CarName WRITE setCarName NOTIFY carNameChanged)
  64. Q_PROPERTY(QString DriveName READ DriveName WRITE setDriveName NOTIFY driveNameChanged)
  65. Q_PROPERTY(int32_t BrakePressure READ BrakePressure WRITE SetBrakePressure NOTIFY brakePressureChanged)
  66. Q_PROPERTY(int32_t GearboxOilPressure READ GearboxOilPressure WRITE SetGearBoxOilPressure NOTIFY gearboxOilPressureChanged)
  67. Q_PROPERTY(int32_t GearboxOilTemp READ GearboxOilTemp WRITE SetGearBoxOilTemp NOTIFY gearboxOilTempChanged)
  68. Q_PROPERTY(int32_t EnginRpm READ EnginRpm WRITE SetEngingRpm NOTIFY engineRpmChanged)
  69. Q_PROPERTY(int32_t EngineOilPressure READ EngineOilPressure WRITE SetEngineOilPressure NOTIFY engineoilPressureChanged)
  70. Q_PROPERTY(int32_t OilPos READ OilPos WRITE SetOilPos NOTIFY oilPosChanged)
  71. Q_PROPERTY(int32_t WorkPressure READ WorkPressure WRITE setWorkPressure NOTIFY workPressureChanged)
  72. Q_PROPERTY(int32_t Cold READ Cold WRITE SetCold NOTIFY coldChanged)
  73. Q_PROPERTY(int32_t leftAngle READ leftAngle WRITE setLeftAngle NOTIFY leftAngleChanged)
  74. Q_PROPERTY(int32_t rightAngle READ rightAngle WRITE setRightAngle NOTIFY rightAngleChanged)
  75. //RTK定位惯导数据
  76. Q_PROPERTY(float imux READ imux WRITE setImux NOTIFY imuxChanged)
  77. Q_PROPERTY(float imuy READ imuy WRITE setImuy NOTIFY imuyChanged)
  78. Q_PROPERTY(bool cautionLight READ cautionLight WRITE setCautionLight NOTIFY cautionLightChanged)
  79. Q_PROPERTY(bool lightL READ lightL WRITE setLightL NOTIFY lightLChanged)
  80. Q_PROPERTY(bool lightR READ lightR WRITE setLightR NOTIFY lightRChanged)
  81. Q_PROPERTY(bool gearF READ gearF WRITE setGearF NOTIFY gearFChanged)
  82. Q_PROPERTY(bool gearR READ gearR WRITE setGearR NOTIFY gearRChanged)
  83. Q_PROPERTY(bool carPark READ carPark WRITE setCarPark NOTIFY carParkChanged)
  84. Q_PROPERTY(bool buzzerPlay READ buzzerPlay WRITE setBuzzerPlay NOTIFY buzzerPlayChanged)
  85. Q_PROPERTY(bool lightFront READ lightFront WRITE setLightFront NOTIFY lightFrontChanged)
  86. Q_PROPERTY(bool lightWork READ lightWork WRITE setLightWork NOTIFY lightWorkChanged)
  87. Q_PROPERTY(bool emergency1 READ emergency1 WRITE setEmergency NOTIFY emergencyChanged)
  88. Q_PROPERTY(int32_t engineSpeed READ engineSpeed WRITE setEngineSpeed NOTIFY engineSpeedChanged)
  89. Q_PROPERTY(int32_t travelSpeed READ travelSpeed WRITE setTravelSpeed NOTIFY travelSpeedChanged)
  90. Q_PROPERTY(int32_t fuelLevel READ fuelLevel WRITE setFuelLevel NOTIFY fuelLevelChanged)
  91. Q_PROPERTY(int32_t engineTemperature READ engineTemperature WRITE setEngineTemperature NOTIFY engineTemperatureChanged)
  92. Q_PROPERTY(int32_t hydraulicOilTemperature READ hydraulicOilTemperature WRITE setHydraulicOilTemperature NOTIFY hydraulicOilTemperatureChanged)
  93. Q_PROPERTY(int32_t mainPump1Pressure READ mainPump1Pressure WRITE setMainPump1Pressure NOTIFY mainPump1PressureChanged)
  94. Q_PROPERTY(int32_t mainPump2Pressure READ mainPump2Pressure WRITE setMainPump2Pressure NOTIFY mainPump2PressureChanged)
  95. Q_PROPERTY(int32_t handGear READ handGear WRITE setHandGear NOTIFY handGearChanged)
  96. Q_PROPERTY(int32_t actualGear READ actualGear WRITE setActualGear NOTIFY actualGearChanged)
  97. Q_PROPERTY(float gripperHeight READ gripperHeight WRITE setGripperHeight NOTIFY gripperHeightChanged)
  98. Q_PROPERTY(float amplitude1 READ amplitude1 WRITE setAmplitude NOTIFY amplitudeChanged)
  99. Q_PROPERTY(int64_t boomAngle READ boomAngle WRITE setBoomAngle NOTIFY boomAngleChanged)
  100. Q_PROPERTY(int64_t stickAngle READ stickAngle WRITE setStickAngle NOTIFY stickAngleChanged)
  101. Q_PROPERTY(bool idleProtection READ idleProtection WRITE setIdleProtection NOTIFY idleProtectionChanged)
  102. Q_PROPERTY(bool frontToggle READ frontToggle WRITE setFrontToggle NOTIFY frontToggleChanged)
  103. Q_PROPERTY(bool backToggle READ backToggle WRITE setBackToggle NOTIFY backToggleChanged)
  104. Q_PROPERTY(int32_t interLock READ interLock WRITE setInterLock NOTIFY interLockChanged)
  105. Q_PROPERTY(int32_t safetySwitch READ safetySwitch WRITE setSafetySwitch NOTIFY safetySwitchChanged)
  106. Q_PROPERTY(int32_t armLiftPilot READ armLiftPilot WRITE setArmLiftPilot NOTIFY armLiftPilotChanged)
  107. Q_PROPERTY(int32_t armLoweringPilot READ armLoweringPilot WRITE setArmLoweringPilot NOTIFY armLoweringPilotChanged)
  108. Q_PROPERTY(int32_t leverLiftingLilot READ leverLiftingLilot WRITE setLeverLiftingLilot NOTIFY leverLiftingLilotChanged)
  109. Q_PROPERTY(int32_t rodLoweringPilot READ rodLoweringPilot WRITE setRodLoweringPilot NOTIFY rodLoweringPilotChanged)
  110. Q_PROPERTY(int32_t leftRotaryPilot READ leftRotaryPilot WRITE setLeftRotaryPilot NOTIFY leftRotaryPilotChanged)
  111. Q_PROPERTY(int32_t rightRotaryPilot READ rightRotaryPilot WRITE setRightRotaryPilot NOTIFY rightRotaryPilotChanged)
  112. Q_PROPERTY(int32_t grabOpenPilot READ grabOpenPilot WRITE setGrabOpenPilot NOTIFY grabOpenPilotChanged)
  113. Q_PROPERTY(int32_t grabClosePilot READ grabClosePilot WRITE setGrabClosePilot NOTIFY grabClosePilotChanged)
  114. Q_PROPERTY(int32_t safetyValves READ safetyValves WRITE setSafetyValves NOTIFY safetyValvesChanged)
  115. Q_PROPERTY(bool liftPilotPressureSensor_F READ liftPilotPressureSensor_F WRITE setLiftPilotPressureSensor_F NOTIFY liftPilotPressureSensor_FChanged)
  116. Q_PROPERTY(bool loweringPilotPressureSensor_F READ loweringPilotPressureSensor_F WRITE setLoweringPilotPressureSensor_F NOTIFY loweringPilotPressureSensor_FChanged)
  117. Q_PROPERTY(bool leverLiftPilotPressureSensor_F READ leverLiftPilotPressureSensor_F WRITE setLeverLiftPilotPressureSensor_F NOTIFY leverLiftPilotPressureSensor_FChanged)
  118. Q_PROPERTY(bool rodLoweringPilotPressurePensor_F READ rodLoweringPilotPressurePensor_F WRITE setRodLoweringPilotPressurePensor_F NOTIFY rodLoweringPilotPressurePensor_FChanged)
  119. Q_PROPERTY(bool leftTurnPilotPressureSensor_F READ leftTurnPilotPressureSensor_F WRITE setLeftTurnPilotPressureSensor_F NOTIFY leftTurnPilotPressureSensor_FChanged)
  120. Q_PROPERTY(bool rightTurnPilotPressureSensor_F READ rightTurnPilotPressureSensor_F WRITE setRightTurnPilotPressureSensor_F NOTIFY rightTurnPilotPressureSensor_FChanged)
  121. Q_PROPERTY(bool legExtensionPilotPressureSensor_F READ legExtensionPilotPressureSensor_F WRITE setLegExtensionPilotPressureSensor_F NOTIFY legExtensionPilotPressureSensor_FChanged)
  122. Q_PROPERTY(bool legRetractPilotPressureSensor_F READ legRetractPilotPressureSensor_F WRITE setLegRetractPilotPressureSensor_F NOTIFY legRetractPilotPressureSensor_FChanged)
  123. Q_PROPERTY(bool grabOpenPilotPressureSensor_F READ grabOpenPilotPressureSensor_F WRITE setGrabOpenPilotPressureSensor_F NOTIFY grabOpenPilotPressureSensor_FChanged)
  124. Q_PROPERTY(bool grabClosurePilotPressureSensor_F READ grabClosurePilotPressureSensor_F WRITE setGrabClosurePilotPressureSensor_F NOTIFY grabClosurePilotPressureSensor_FChanged)
  125. Q_PROPERTY(bool mainPump1PressureSensor_F READ mainPump1PressureSensor_F WRITE setMainPump1PressureSensor_F NOTIFY mainPump1PressureSensor_FChanged)
  126. Q_PROPERTY(bool mainPump2PressureSensor_F READ mainPump2PressureSensor_F WRITE setMainPump2PressureSensor_F NOTIFY mainPump2PressureSensor_FChanged)
  127. Q_PROPERTY(bool chamberPressureSensor_F READ chamberPressureSensor_F WRITE setChamberPressureSensor_F NOTIFY chamberPressureSensor_FChanged)
  128. Q_PROPERTY(bool bucketRodPressureSensor_F READ bucketRodPressureSensor_F WRITE setBucketRodPressureSensor_F NOTIFY bucketRodPressureSensor_FChanged)
  129. Q_PROPERTY(bool parkingPressureSensor_F READ parkingPressureSensor_F WRITE setParkingPressureSensor_F NOTIFY parkingPressureSensor_FChanged)
  130. Q_PROPERTY(bool accumulatorPressureSensor_F READ accumulatorPressureSensor_F WRITE setAccumulatorPressureSensor_F NOTIFY accumulatorPressureSensor_FChanged)
  131. Q_PROPERTY(bool gasPedal_F READ gasPedal_F WRITE setGasPedal_F NOTIFY gasPedal_FChanged)
  132. Q_PROPERTY(bool throttleKnob_F READ throttleKnob_F WRITE setThrottleKnob_F NOTIFY throttleKnob_FChanged)
  133. Q_PROPERTY(bool legHandle_F READ legHandle_F WRITE setLegHandle_F NOTIFY legHandle_FChanged)
  134. Q_PROPERTY(bool gripKnob_F READ gripKnob_F WRITE setGripKnob_F NOTIFY gripKnob_FChanged)
  135. Q_PROPERTY(bool hydraulicOilTemperatureSensor_F READ hydraulicOilTemperatureSensor_F WRITE setHydraulicOilTemperatureSensor_F NOTIFY hydraulicOilTemperatureSensor_FChanged)
  136. Q_PROPERTY(bool fuelLevelSensor_F READ fuelLevelSensor_F WRITE setFuelLevelSensor_F NOTIFY fuelLevelSensor_FChanged)
  137. Q_PROPERTY(bool boomAngleSensor_F READ boomAngleSensor_F WRITE setBoomAngleSensor_F NOTIFY boomAngleSensor_FChanged)
  138. Q_PROPERTY(bool bucketLeverTiltSensor_F READ bucketLeverTiltSensor_F WRITE setBucketLeverTiltSensor_F NOTIFY bucketLeverTiltSensor_FChanged)
  139. Q_PROPERTY(bool expansionModule_F READ expansionModule_F WRITE setExpansionModule_F NOTIFY expansionModule_FChanged)
  140. Q_PROPERTY(bool workingDistanceOverrun_F READ workingDistanceOverrun_F WRITE setWorkingDistanceOverrun_F NOTIFY workingDistanceOverrun_FChanged)
  141. Q_PROPERTY(bool lowOilLevel_F READ lowOilLevel_F WRITE setLowOilLevel_F NOTIFY lowOilLevel_FChanged)
  142. Q_PROPERTY(bool batteryLowVoltage_F READ batteryLowVoltage_F WRITE setBatteryLowVoltage_F NOTIFY batteryLowVoltage_FChanged)
  143. Q_PROPERTY(bool batteryHighVoltage_F READ batteryHighVoltage_F WRITE setBatteryHighVoltage_F NOTIFY batteryHighVoltage_FChanged)
  144. Q_PROPERTY(bool accumulatorPressure_F READ accumulatorPressure_F WRITE setAccumulatorPressure_F NOTIFY accumulatorPressure_FChanged)
  145. Q_PROPERTY(bool highHydraulicOilTemperature_F READ highHydraulicOilTemperature_F WRITE setHighHydraulicOilTemperature_F NOTIFY highHydraulicOilTemperature_FChanged)
  146. Q_PROPERTY(bool lowOilPressure_F READ lowOilPressure_F WRITE setLowOilPressure_F NOTIFY lowOilPressure_FChanged)
  147. Q_PROPERTY(bool coolantLevelLow_F READ coolantLevelLow_F WRITE setCoolantLevelLow_F NOTIFY coolantLevelLow_FChanged)
  148. Q_PROPERTY(bool coolantTemperatureHigh_F READ coolantTemperatureHigh_F WRITE setCoolantTemperatureHigh_F NOTIFY coolantTemperatureHigh_FChanged)
  149. Q_PROPERTY(bool systemOverload_F READ systemOverload_F WRITE setSystemOverload_F NOTIFY systemOverload_FChanged)
  150. Q_PROPERTY(bool safebypassPressDown_F READ safebypassPressDown_F WRITE setSafebypassPressDown_F NOTIFY safebypassPressDown_FChanged)
  151. Q_PROPERTY(bool engineSPN_F READ engineSPN_F WRITE setEngineSPN_F NOTIFY engineSPN_FChanged)
  152. Q_PROPERTY(bool engineWarmUp_F READ engineWarmUp_F WRITE setEngineWarmUp_F NOTIFY engineWarmUp_FChanged)
  153. Q_PROPERTY(bool engineWarmUpTimeout_F READ engineWarmUpTimeout_F WRITE setEngineWarmUpTimeout_F NOTIFY engineWarmUpTimeout_FChanged)
  154. Q_PROPERTY(bool emergencyStopPress_F READ emergencyStopPress_F WRITE setEmergencyStopPress_F NOTIFY emergencyStopPress_FChanged)
  155. Q_PROPERTY(bool leftFrontLegChosed READ leftFrontLegChosed WRITE setLeftFrontLegChosed NOTIFY leftFrontLegChosedChanged)
  156. Q_PROPERTY(bool rightFrontLegChosed READ rightFrontLegChosed WRITE setRightFrontLegChosed NOTIFY rightFrontLegChosedChanged)
  157. Q_PROPERTY(bool leftRearLegChosed READ leftRearLegChosed WRITE setLeftRearLegChosed NOTIFY leftRearLegChosedChanged)
  158. Q_PROPERTY(bool rightRearLegChosed READ rightRearLegChosed WRITE setRightRearLegChosed NOTIFY rightRearLegChosedChanged)
  159. // Q_PROPERTY(int32_t ModelX READ ModelX WRITE setModelX NOTIFY modelXChanged)
  160. // Q_PROPERTY(int32_t ModelY READ ModelY WRITE setModelY NOTIFY modelYChanged)
  161. // Q_PROPERTY(int32_t ModelZ READ ModelZ WRITE setModelZ NOTIFY modelZChanged)
  162. public:
  163. explicit AppModel(IEgoNotify *n , IEgoControl *c , QObject* qmlObj, QObject *parent = 0);
  164. ~AppModel();
  165. Q_INVOKABLE void userLogin(QString useName, QString password);
  166. Q_INVOKABLE void connectCar(int id);
  167. //退出程序时下线车辆
  168. Q_INVOKABLE void leaveCar(int carID);
  169. Q_INVOKABLE void logout();
  170. Q_INVOKABLE void moveBegin(int32_t area,int32_t no);
  171. // Q_INVOKABLE void switchDriver();
  172. //Q_INVOKABLE void areaChanged(int32_t area);
  173. Q_INVOKABLE void controlCar(int id);
  174. Q_INVOKABLE void cancelControl();
  175. Q_INVOKABLE void showBackDlg(QString content, WorkArea area, int32_t no, int32_t uid);
  176. Q_INVOKABLE void showMoveDlg(MoveDesc desc);
  177. Q_INVOKABLE bool idle(int32_t uid);
  178. //Q_INVOKABLE void showTrackDlg();
  179. // Q_INVOKABLE void track();
  180. //Q_INVOKABLE void unTrack();
  181. //Q_INVOKABLE bool autoClose();
  182. //Q_INVOKABLE QString ReadyText();
  183. bool ready() const;
  184. int radar1() const;
  185. int radar2() const;
  186. int radar3() const;
  187. int radar4() const;
  188. int radar5() const;
  189. int radar6() const;
  190. int radar7() const;
  191. int radar8() const;
  192. QString Account() const;
  193. QString Password() const;
  194. QString CarName() const;
  195. QString DriveName() const;
  196. float imux() const;
  197. float imuy() const;
  198. int ping() const;
  199. double temp() const;
  200. bool cautionLight() const;
  201. bool lightL() const;
  202. bool lightR() const;
  203. bool gearF() const;
  204. bool gearR() const;
  205. bool carPark() const;
  206. bool buzzerPlay() const;
  207. bool lightFront() const;
  208. bool lightWork() const;
  209. bool emergency1() const;
  210. int engineSpeed() const;
  211. int travelSpeed() const;
  212. int fuelLevel() const;
  213. int engineTemperature() const;
  214. int hydraulicOilTemperature() const;
  215. int mainPump1Pressure() const;
  216. int mainPump2Pressure() const;
  217. int handGear() const;
  218. int actualGear() const;
  219. float gripperHeight() const;
  220. float amplitude1() const;
  221. int64_t boomAngle() const;
  222. int64_t stickAngle() const;
  223. bool idleProtection() const;//怠速保护是报警信息,需要加入到滚动窗口里
  224. bool frontToggle() const;
  225. bool backToggle() const;
  226. int interLock() const;
  227. int safetySwitch() const;
  228. int armLiftPilot() const;
  229. int armLoweringPilot() const;
  230. int leverLiftingLilot() const;
  231. int rodLoweringPilot() const;
  232. int leftRotaryPilot() const;
  233. int rightRotaryPilot() const;
  234. int grabOpenPilot() const;
  235. int grabClosePilot() const;
  236. int safetyValves() const;
  237. bool liftPilotPressureSensor_F() const;
  238. bool loweringPilotPressureSensor_F() const;
  239. bool leverLiftPilotPressureSensor_F() const;
  240. bool rodLoweringPilotPressurePensor_F() const;
  241. bool leftTurnPilotPressureSensor_F() const;
  242. bool rightTurnPilotPressureSensor_F() const;
  243. bool legExtensionPilotPressureSensor_F() const;
  244. bool legRetractPilotPressureSensor_F() const;
  245. bool grabOpenPilotPressureSensor_F() const;
  246. bool grabClosurePilotPressureSensor_F() const;
  247. bool mainPump1PressureSensor_F() const;
  248. bool mainPump2PressureSensor_F() const;
  249. bool chamberPressureSensor_F() const;
  250. bool bucketRodPressureSensor_F() const;
  251. bool parkingPressureSensor_F() const;
  252. bool accumulatorPressureSensor_F() const;
  253. bool gasPedal_F() const;
  254. bool throttleKnob_F() const;
  255. bool legHandle_F() const;
  256. bool gripKnob_F() const;
  257. bool hydraulicOilTemperatureSensor_F() const;
  258. bool fuelLevelSensor_F() const;
  259. bool boomAngleSensor_F() const;
  260. bool bucketLeverTiltSensor_F() const;
  261. bool expansionModule_F() const;
  262. bool workingDistanceOverrun_F() const;
  263. bool lowOilLevel_F() const;
  264. bool batteryLowVoltage_F() const;
  265. bool batteryHighVoltage_F() const;
  266. bool accumulatorPressure_F() const;
  267. bool highHydraulicOilTemperature_F() const;
  268. bool lowOilPressure_F() const;
  269. bool coolantLevelLow_F() const;
  270. bool coolantTemperatureHigh_F() const;
  271. bool systemOverload_F() const;
  272. bool safebypassPressDown_F() const;
  273. bool engineSPN_F() const;
  274. bool engineWarmUp_F() const;
  275. bool engineWarmUpTimeout_F() const;
  276. bool emergencyStopPress_F() const;
  277. bool leftFrontLegChosed() const;
  278. bool rightFrontLegChosed() const;
  279. bool leftRearLegChosed() const;
  280. bool rightRearLegChosed() const;
  281. int alertSound() const;
  282. int32_t BrakePressure() const;
  283. int32_t OilPos() const;
  284. int32_t GearboxOilPressure()const;
  285. int32_t GearboxOilTemp()const;
  286. int32_t EnginRpm()const;
  287. int32_t EngineOilPressure()const;
  288. int32_t Speed()const;
  289. bool Visible() const;
  290. //int32_t Gear() const;
  291. int32_t Cold() const;
  292. //int32_t ModelX() const;
  293. // int32_t ModelY() const;
  294. // int32_t ModelZ() const;
  295. int32_t leftAngle() const;
  296. int32_t rightAngle() const;
  297. float Steer() const;
  298. int32_t WorkPressure() const;
  299. void SetBrakePressure(const int32_t value);
  300. void SetOilPos(const int32_t value);
  301. void SetGearBoxOilPressure(const int32_t value);
  302. void SetGearBoxOilTemp(const int32_t value);
  303. void SetEngingRpm(const int32_t value);
  304. void SetEngineOilPressure(const int32_t value);
  305. void SetSpeed(const int32_t value);
  306. void SetVisible(const bool value);
  307. //void SetGear(const int32_t value);
  308. void SetCold(const int32_t value);
  309. void setReady(const bool value);
  310. void setForward(const int32_t& value);
  311. void setBackward(const int32_t& value);
  312. void setGear_D(const int32_t& value);
  313. void setDirectionLight(const int32_t& value);
  314. void setWiper(const bool& value);
  315. void setFrontLight(const bool& value);
  316. void setBackLight(const bool& value);
  317. void setBuzzer(const bool& value);
  318. void setRadar1(const int32_t &value);
  319. void setRadar2(const int32_t &value);
  320. void setRadar3(const int32_t &value);
  321. void setRadar4(const int32_t &value);
  322. void setRadar5(const int32_t &value);
  323. void setRadar6(const int32_t& value);
  324. void setRadar7(const int32_t& value);
  325. void setRadar8(const int32_t& value);
  326. void setAccount(const QString& value);
  327. void setPassword(const QString& password);
  328. void setCarName(const QString& carname);
  329. void setDriveName(const QString& drivename);
  330. void setWorkPressure(const int32_t value);
  331. //void setModelX(const int32_t value);
  332. //void setModelY(const int32_t value);
  333. //void setModelZ(const int32_t value);
  334. void setLeftAngle(const int32_t value);
  335. void setRightAngle(const int32_t value);
  336. //void setRadar6(const int32_t &value);
  337. void setPing(const int32_t &value);
  338. void setTemp(const double& value);
  339. void setSteerAngle(const float& value);
  340. void setImux(const float& value);
  341. void setImuy(const float& value);
  342. void setCautionLight(const bool& value);
  343. void setLightL(const bool& value);
  344. void setLightR(const bool& value);
  345. void setGearF(const bool& value);
  346. void setGearR(const bool& value);
  347. void setCarPark(const bool& value);
  348. void setBuzzerPlay(const bool& value);
  349. void setLightFront(const bool& value);
  350. void setLightWork(const bool& value);
  351. void setEmergency(const bool& value);
  352. //void setMqttToSever(cannet_frame* frames);
  353. void setEngineSpeed(const int32_t& value);
  354. void setTravelSpeed(const int32_t& value);
  355. void setFuelLevel(const int32_t& value);
  356. void setEngineTemperature(const int32_t& value);
  357. void setHydraulicOilTemperature(const int32_t& value);
  358. void setMainPump1Pressure(const int32_t& value);
  359. void setMainPump2Pressure(const int32_t& value);
  360. void setHandGear(const int32_t& value);
  361. void setActualGear(const int32_t& value);
  362. void setGripperHeight(const float& value);
  363. void setAmplitude(const float& value);
  364. void setBoomAngle(const int32_t& value);
  365. void setStickAngle(const int32_t& value);
  366. void setIdleProtection(const bool& value);
  367. void setFrontToggle(const bool& value);
  368. void setBackToggle(const bool& value);
  369. void setInterLock(const int32_t& value);
  370. void setSafetySwitch(const int32_t& value);
  371. void setArmLiftPilot(const int32_t& value);
  372. void setArmLoweringPilot(const int32_t& value);
  373. void setLeverLiftingLilot(const int32_t& value);
  374. void setRodLoweringPilot(const int32_t& value);
  375. void setLeftRotaryPilot(const int32_t& value);
  376. void setRightRotaryPilot(const int32_t& value);
  377. void setGrabOpenPilot(const int32_t& value);
  378. void setGrabClosePilot(const int32_t& value);
  379. void setSafetyValves(const int32_t& value);
  380. void setLiftPilotPressureSensor_F(const bool& value);
  381. void setLoweringPilotPressureSensor_F(const bool& value);
  382. void setLeverLiftPilotPressureSensor_F(const bool& value);
  383. void setRodLoweringPilotPressurePensor_F(const bool& value);
  384. void setLeftTurnPilotPressureSensor_F(const bool& value);
  385. void setRightTurnPilotPressureSensor_F(const bool& value);
  386. void setLegExtensionPilotPressureSensor_F(const bool& value);
  387. void setLegRetractPilotPressureSensor_F(const bool& value);
  388. void setGrabOpenPilotPressureSensor_F(const bool& value);
  389. void setGrabClosurePilotPressureSensor_F(const bool& value);
  390. void setMainPump1PressureSensor_F(const bool& value);
  391. void setMainPump2PressureSensor_F(const bool& value);
  392. void setChamberPressureSensor_F(const bool& value);
  393. void setBucketRodPressureSensor_F(const bool& value);
  394. void setParkingPressureSensor_F(const bool& value);
  395. void setAccumulatorPressureSensor_F(const bool& value);
  396. void setGasPedal_F(const bool& value);
  397. void setThrottleKnob_F(const bool& value);
  398. void setLegHandle_F(const bool& value);
  399. void setGripKnob_F(const bool& value);
  400. void setHydraulicOilTemperatureSensor_F(const bool& value);
  401. void setFuelLevelSensor_F(const bool& value);
  402. void setBoomAngleSensor_F(const bool& value);
  403. void setBucketLeverTiltSensor_F(const bool& value);
  404. void setExpansionModule_F(const bool& value);
  405. void setWorkingDistanceOverrun_F(const bool& value);
  406. void setLowOilLevel_F(const bool& value);
  407. void setBatteryLowVoltage_F(const bool& value);
  408. void setBatteryHighVoltage_F(const bool& value);
  409. void setAccumulatorPressure_F(const bool& value);
  410. void setHighHydraulicOilTemperature_F(const bool& value);
  411. void setLowOilPressure_F(const bool& value);
  412. void setCoolantLevelLow_F(const bool& value);
  413. void setCoolantTemperatureHigh_F(const bool& value);
  414. void setSystemOverload_F(const bool& value);
  415. void setSafebypassPressDown_F(const bool& value);
  416. void setEngineSPN_F(const bool& value);
  417. void setEngineWarmUp_F(const bool& value);
  418. void setEngineWarmUpTimeout_F(const bool& value);
  419. void setEmergencyStopPress_F(const bool& value);
  420. void setLeftFrontLegChosed(const bool& value);
  421. void setRightFrontLegChosed(const bool& value);
  422. void setLeftRearLegChosed(const bool& value);
  423. void setRightRearLegChosed(const bool& value);
  424. QQmlListProperty<CarData> car() const;
  425. public slots:
  426. void onLoginRst(bool rst);
  427. //处理车辆信息被追加到应用模型时的操作
  428. void onCarAppend(const UserCamera &info);
  429. void onRadarUpadte(int32_t r0, int32_t r1, int32_t r2, int32_t r3, int32_t r4,
  430. int32_t r5, int32_t r6, int32_t r7);
  431. void onEncodeUpdate(int32_t left, int32_t right);
  432. void onFeedData(const FeedData& data);
  433. void onNotifyState(int32_t uid, UserState state);
  434. void onPing(int32_t value,double temp);
  435. //接收CHANNEL_IMU通道数据信号的槽函数
  436. void onImuUpdate(float x, float y);
  437. void onMoveEnd(int32_t rid, WorkArea area, int32_t no);
  438. void onNotifyDel(int32_t peer);
  439. void onKickoff();
  440. void onNotifyLeave(int32_t peer);
  441. void onNotifyFail(int32_t peer);
  442. void onMoveRet(MoveDesc desc);
  443. //关闭程序
  444. void OnClose();
  445. void egoGearChanged(int gear);
  446. void egoGear_DChanged(int gear_d);
  447. void egoDirectionLightChanged(int light);
  448. void egoWiperChanged(bool wiper);
  449. void egoFrontLightChanged(bool frontlight);
  450. void egoBackLightChanged(bool backlight);
  451. void egoBuzzerChanged(bool buzzer);
  452. void egoCautionLightChanged(bool cautionLight);
  453. void egoLightLChanged(bool lightL);
  454. void egoLightRChanged(bool lightR);
  455. void egoGearFChanged(bool gearF);
  456. void egoGearRChanged(bool gearR);
  457. void egoCarParkChanged(bool carPark);
  458. void egoBuzzerPlayChanged(bool buzzerPlay);
  459. void egoLightFrontChanged(bool lightFront);
  460. void egoLightWorkChanged(bool lightWork);
  461. void egoEmergencyChanged(bool emergency);
  462. void egoMqttChanged(cannet_frame* frames);
  463. //void OnPosition(float x, float y, float z);
  464. signals:
  465. void readyChanged();
  466. void carChanged();
  467. void radar1Changed();
  468. void radar2Changed();
  469. void radar3Changed();
  470. void radar4Changed();
  471. void radar5Changed();
  472. void radar6Changed();
  473. void radar7Changed();
  474. void radar8Changed();
  475. void accountChanged();
  476. void passwordChanged();
  477. void carNameChanged();
  478. void driveNameChanged();
  479. void sectionTextChanged();
  480. void steerAngleChanged();
  481. void pingChanged();
  482. void tempChanged();
  483. void speedChanged();
  484. void visibleChanged();
  485. void gearChanged();
  486. void coldChanged();
  487. void gearboxOilPressureChanged();
  488. void gearboxOilTempChanged();
  489. void engineRpmChanged();
  490. void engineoilPressureChanged();
  491. void brakePressureChanged();
  492. void playAlertSound();
  493. void carConnected();
  494. void closeWin();
  495. void oilPosChanged();
  496. void workPressureChanged();
  497. void leftAngleChanged();
  498. void rightAngleChanged();
  499. void engineSpeedPlay(int par2);
  500. void lightLPlay(bool par3);
  501. void lightRPlay(bool par4);
  502. void gearRPlay(bool par5);
  503. void setRadar1Play(int Radar1Value);
  504. void setRadar2Play(int Radar2Value);
  505. void setRadar3Play(int Radar3Value);
  506. void setRadar4Play(int Radar4Value);
  507. void setRadar5Play(int Radar5Value);
  508. void setRadar6Play(int Radar6Value);
  509. void setRadar7Play(int Radar7Value);
  510. void setRadar8Play(int Radar8Value);
  511. void buzzerPlayIt(bool par6);
  512. void forwardChanged();
  513. void backwardChanged();
  514. void gear_dChanged();
  515. void directionlightChanged();
  516. void wiperChanged();
  517. void frontlightChanged();
  518. void backlightChanged();
  519. void buzzerChanged();
  520. void imuxChanged();
  521. void imuyChanged();
  522. void cautionLightChanged();
  523. void lightLChanged();
  524. void lightRChanged();
  525. void gearFChanged();
  526. void gearRChanged();
  527. void carParkChanged();
  528. void buzzerPlayChanged();
  529. void lightFrontChanged();
  530. void lightWorkChanged();
  531. void emergencyChanged();
  532. void engineSpeedChanged();
  533. void travelSpeedChanged();
  534. void fuelLevelChanged();
  535. void engineTemperatureChanged();
  536. void hydraulicOilTemperatureChanged();
  537. void mainPump1PressureChanged();
  538. void mainPump2PressureChanged();
  539. void handGearChanged();
  540. void actualGearChanged();
  541. void gripperHeightChanged();
  542. void amplitudeChanged();
  543. void boomAngleChanged();
  544. void stickAngleChanged();
  545. void idleProtectionChanged();
  546. void frontToggleChanged();
  547. void backToggleChanged();
  548. void interLockChanged();
  549. void safetySwitchChanged();
  550. void armLiftPilotChanged();
  551. void armLoweringPilotChanged();
  552. void leverLiftingLilotChanged();
  553. void rodLoweringPilotChanged();
  554. void leftRotaryPilotChanged();
  555. void rightRotaryPilotChanged();
  556. void grabOpenPilotChanged();
  557. void grabClosePilotChanged();
  558. void safetyValvesChanged();
  559. void liftPilotPressureSensor_FChanged();
  560. void loweringPilotPressureSensor_FChanged();
  561. void leverLiftPilotPressureSensor_FChanged();
  562. void rodLoweringPilotPressurePensor_FChanged();
  563. void leftTurnPilotPressureSensor_FChanged();
  564. void rightTurnPilotPressureSensor_FChanged();
  565. void legExtensionPilotPressureSensor_FChanged();
  566. void legRetractPilotPressureSensor_FChanged();
  567. void grabOpenPilotPressureSensor_FChanged();
  568. void grabClosurePilotPressureSensor_FChanged();
  569. void mainPump1PressureSensor_FChanged();
  570. void mainPump2PressureSensor_FChanged();
  571. void chamberPressureSensor_FChanged();
  572. void bucketRodPressureSensor_FChanged();
  573. void parkingPressureSensor_FChanged();
  574. void accumulatorPressureSensor_FChanged();
  575. void gasPedal_FChanged();
  576. void throttleKnob_FChanged();
  577. void legHandle_FChanged();
  578. void gripKnob_FChanged();
  579. void hydraulicOilTemperatureSensor_FChanged();
  580. void fuelLevelSensor_FChanged();
  581. void boomAngleSensor_FChanged();
  582. void bucketLeverTiltSensor_FChanged();
  583. void expansionModule_FChanged();
  584. void workingDistanceOverrun_FChanged();
  585. void lowOilLevel_FChanged();
  586. void batteryLowVoltage_FChanged();
  587. void batteryHighVoltage_FChanged();
  588. void accumulatorPressure_FChanged();
  589. void highHydraulicOilTemperature_FChanged();
  590. void lowOilPressure_FChanged();
  591. void coolantLevelLow_FChanged();
  592. void coolantTemperatureHigh_FChanged();
  593. void systemOverload_FChanged();
  594. void safebypassPressDown_FChanged();
  595. void engineSPN_FChanged();
  596. void engineWarmUp_FChanged();
  597. void engineWarmUpTimeout_FChanged();
  598. void emergencyStopPress_FChanged();
  599. void leftFrontLegChosedChanged();
  600. void rightFrontLegChosedChanged();
  601. void leftRearLegChosedChanged();
  602. void rightRearLegChosedChanged();
  603. private:
  604. IEgoNotify *_notify;
  605. IEgoControl *_control;
  606. // std::unique_ptr<CFishEyeWindow> _window;
  607. AppModelPrivate *d;
  608. std::vector<UserCamera> _users;
  609. QString m_account;
  610. QString m_password;
  611. QString m_carName;
  612. QString m_driveName;
  613. int32_t m_forward;
  614. int32_t m_backward;
  615. int32_t m_gear_d;
  616. int32_t m_light;
  617. bool m_wiper;
  618. bool m_frontlight;
  619. bool m_backlight;
  620. bool m_buzzer;
  621. int32_t m_radar1 = 5000;
  622. int32_t m_radar2 = 5000;
  623. int32_t m_radar3 = 5000;
  624. int32_t m_radar4 = 5000;
  625. int32_t m_radar5 = 5000;
  626. int32_t m_radar6 = 5000;
  627. int32_t m_radar7 = 5000;
  628. int32_t m_radar8 = 5000;
  629. int32_t m_ping =0;
  630. float m_imux = 0;
  631. float m_imuy = 0;
  632. double m_temp = 0.f;
  633. int32_t m_alert;
  634. int32_t m_peer;
  635. int32_t m_work_pressure =0; //工作系统压力
  636. int32_t m_brake_pressure =0;//制动系统压力
  637. int32_t m_gearbox_oil_temp =0;//变速箱油温
  638. int32_t m_gearbox_oil_pressure=0;//变速箱油压
  639. int32_t m_oil_pos = 0;
  640. int32_t m_cold_water = 0;
  641. int32_t m_engine_rpm =0;//发动机转速
  642. int32_t m_engine_oil_pressure =0;// 发动机油压
  643. int32_t m_speed =0;
  644. bool m_visible = true;
  645. //int32_t m_gear =0;
  646. //WorkArea m_area= WorkArea::Area_A;
  647. // int32_t m_no;
  648. bool m_ready;
  649. QObject* m_qmlObj = nullptr;
  650. //int32_t m_modelx = 0;
  651. //int32_t m_modely = 0;
  652. int32_t m_steerAngle = 0;
  653. // int32_t m_modelz = 0;
  654. int32_t m_leftAngle = 0;
  655. int32_t m_rightAngle = 0;
  656. Lock_Status m_leftlock;
  657. Lock_Status m_rightlock;
  658. bool m_cautionLight = false;
  659. bool m_lightL = false;
  660. bool m_lightR = false;
  661. bool m_gearF = false;
  662. bool m_gearR = false;
  663. bool m_carPark = false;
  664. bool m_buzzerPlay = false;
  665. bool m_lightFront = false;
  666. bool m_lightWork = false;
  667. bool m_emergency = true;
  668. int32_t m_engineSpeed = 0;
  669. int32_t m_travelSpeed = 0;
  670. int32_t m_fuelLevel = 0;
  671. int32_t m_engineTemperature = 10000;
  672. int32_t m_hydraulicOilTemperature = 0;
  673. int32_t m_mainPump1Pressure = 0;
  674. int32_t m_mainPump2Pressure = 0;
  675. int32_t m_handGear = 0;
  676. int32_t m_actualGear = 0;
  677. float m_gripperHeight = 0.0;
  678. float m_amplitude = 0.0;
  679. int64_t m_boomAngle = 10000;
  680. int64_t m_stickAngle = 18000;
  681. bool m_idleProtection = false;//此处也是报警信息
  682. bool m_frontToggle = true;
  683. bool m_backToggle = true;
  684. int32_t m_interLock = 0;
  685. int32_t m_safetyValves = 0;
  686. int32_t m_safetySwitch = 1;
  687. int32_t m_armLiftPilot = 1;
  688. int32_t m_armLoweringPilot = 1;
  689. int32_t m_leverLiftingLilot = 1;
  690. int32_t m_rodLoweringPilot = 1;
  691. int32_t m_leftRotaryPilot = 1;
  692. int32_t m_rightRotaryPilot = 1;
  693. int32_t m_grabOpenPilot = 1;
  694. int32_t m_grabClosePilot = 1;
  695. bool m_liftPilotPressureSensor_F = false;
  696. bool m_loweringPilotPressureSensor_F = false;
  697. bool m_leverLiftPilotPressureSensor_F = false;
  698. bool m_rodLoweringPilotPressurePensor_F = false;
  699. bool m_leftTurnPilotPressureSensor_F = false;
  700. bool m_rightTurnPilotPressureSensor_F = false;
  701. bool m_legExtensionPilotPressureSensor_F = false;
  702. bool m_legRetractPilotPressureSensor_F = false;
  703. bool m_grabOpenPilotPressureSensor_F = false;
  704. bool m_grabClosurePilotPressureSensor_F = false;
  705. bool m_mainPump1PressureSensor_F = false;
  706. bool m_mainPump2PressureSensor_F = false;
  707. bool m_chamberPressureSensor_F = false;
  708. bool m_bucketRodPressureSensor_F = false;
  709. bool m_parkingPressureSensor_F = false;
  710. bool m_accumulatorPressureSensor_F = false;
  711. bool m_gasPedal_F = false;
  712. bool m_throttleKnob_F = false;
  713. bool m_legHandle_F = false;
  714. bool m_gripKnob_F = false;
  715. bool m_hydraulicOilTemperatureSensor_F = false;
  716. bool m_fuelLevelSensor_F = false;
  717. bool m_boomAngleSensor_F = false;
  718. bool m_bucketLeverTiltSensor_F = false;
  719. bool m_expansionModule_F = false;
  720. bool m_workingDistanceOverrun_F = false;
  721. bool m_lowOilLevel_F = false;
  722. bool m_batteryLowVoltage_F = false;
  723. bool m_batteryHighVoltage_F = false;
  724. bool m_accumulatorPressure_F = false;
  725. bool m_highHydraulicOilTemperature_F = false;
  726. bool m_lowOilPressure_F = false;
  727. bool m_coolantLevelLow_F = false;
  728. bool m_coolantTemperatureHigh_F = false;
  729. bool m_systemOverload_F = false;
  730. bool m_safebypassPressDown_F = false;
  731. bool m_engineSPN_F = false;
  732. bool m_engineWarmUp_F = false;
  733. bool m_engineWarmUpTimeout_F = false;
  734. bool m_emergencyStopPress_F = false;
  735. bool m_leftFrontLegChosed = false;
  736. bool m_rightFrontLegChosed = false;
  737. bool m_leftRearLegChosed = false;
  738. bool m_rightRearLegChosed = false;
  739. };
  740. #endif // APPMODEL_H