appmodel.h 34 KB

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