appmodel.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  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. /*
  11. 车辆数据类
  12. */
  13. class CarData : public QObject {
  14. Q_OBJECT
  15. Q_PROPERTY(int32_t uid READ uid WRITE setUid NOTIFY dataChanged) //读取器函数uid,写入器函数setuid
  16. Q_PROPERTY(QString name READ name WRITE setName NOTIFY dataChanged)
  17. Q_PROPERTY(QString type READ type WRITE setType NOTIFY dataChanged)
  18. Q_PROPERTY(QString state READ state WRITE setState NOTIFY dataChanged)
  19. public:
  20. explicit CarData(QObject *parent = 0);
  21. CarData(const CarData &other);
  22. int32_t uid() const;
  23. QString name() const;
  24. QString type() const;
  25. QString state() const;
  26. int32_t carType() const;
  27. void setUid(const int32_t &value);
  28. void setName(const QString &value);
  29. void setType(const QString &value);
  30. void setState(const QString &value);
  31. void setCarType(const int32_t& value);
  32. signals:
  33. void dataChanged();
  34. private:
  35. int32_t m_uid; //车辆唯一标识id,整数类型
  36. int32_t m_carType;
  37. QString m_name; //车辆名称,字符型
  38. QString m_type; //车辆类型
  39. QString m_state; //车辆状态
  40. };
  41. Q_DECLARE_METATYPE(CarData)
  42. class AppModelPrivate;
  43. class CFishEyeWindow; //前向声明
  44. /*
  45. 车辆信号接口(遥操)
  46. */
  47. class AppModel : public QObject {
  48. Q_OBJECT
  49. Q_PROPERTY(bool ready READ ready WRITE setReady NOTIFY readyChanged)//设置准备好了
  50. Q_PROPERTY(QQmlListProperty<CarData> car READ car NOTIFY carChanged)//车辆清单
  51. Q_PROPERTY(int32_t radar1 READ radar1 WRITE setRadar1 NOTIFY radar1Changed)
  52. Q_PROPERTY(int32_t radar2 READ radar2 WRITE setRadar2 NOTIFY radar2Changed)
  53. Q_PROPERTY(int32_t radar3 READ radar3 WRITE setRadar3 NOTIFY radar3Changed)
  54. Q_PROPERTY(int32_t radar4 READ radar4 WRITE setRadar4 NOTIFY radar4Changed)
  55. Q_PROPERTY(int32_t radar5 READ radar5 WRITE setRadar5 NOTIFY radar5Changed)
  56. Q_PROPERTY(int32_t radar6 READ radar6 WRITE setRadar6 NOTIFY radar6Changed)
  57. Q_PROPERTY(int32_t radar7 READ radar7 WRITE setRadar7 NOTIFY radar7Changed)
  58. Q_PROPERTY(int32_t radar8 READ radar8 WRITE setRadar8 NOTIFY radar8Changed)
  59. Q_PROPERTY(int32_t radar9 READ radar9 WRITE setRadar9 NOTIFY radar9Changed)
  60. Q_PROPERTY(int32_t ping READ ping WRITE setPing NOTIFY pingChanged)//ping值
  61. Q_PROPERTY(int32_t temp READ temp WRITE setTemp NOTIFY tempChanged)//ping时间戳
  62. Q_PROPERTY(int32_t alertSound READ alertSound NOTIFY playAlertSound)//播放声音
  63. Q_PROPERTY(int32_t Visible READ Visible WRITE SetVisible NOTIFY visibleChanged)//可视功能 根据车的类型设定可视与否
  64. // Q_PROPERTY(int32_t Gear READ Gear WRITE SetGear NOTIFY gearChanged)
  65. Q_PROPERTY(QString Account READ Account WRITE setAccount NOTIFY accountChanged)//账号
  66. Q_PROPERTY(QString Password READ Password WRITE setPassword NOTIFY passwordChanged)//密码
  67. Q_PROPERTY(QString CarName READ CarName WRITE setCarName NOTIFY carNameChanged)//车辆名字
  68. Q_PROPERTY(QString DriveName READ DriveName WRITE setDriveName NOTIFY driveNameChanged)//座舱名字
  69. Q_PROPERTY(int32_t BrakePressure READ BrakePressure WRITE SetBrakePressure NOTIFY brakePressureChanged)//制动气压 附件2
  70. Q_PROPERTY(int32_t GearboxOilPressure READ GearboxOilPressure WRITE SetGearBoxOilPressure NOTIFY gearboxOilPressureChanged)//变速箱油压 canJ1939
  71. Q_PROPERTY(int32_t GearboxOilTemp READ GearboxOilTemp WRITE SetGearBoxOilTemp NOTIFY gearboxOilTempChanged)//变速箱油温 canJ1939
  72. Q_PROPERTY(int32_t EnginRpm READ EnginRpm WRITE SetEngingRpm NOTIFY engineRpmChanged)//发动机转速 canJ1939
  73. Q_PROPERTY(int32_t EngineOilPressure READ EngineOilPressure WRITE SetEngineOilPressure NOTIFY engineoilPressureChanged)//发动机压力 canJ1939
  74. Q_PROPERTY(int32_t OilPos READ OilPos WRITE SetOilPos NOTIFY oilPosChanged)//油位---没有地方赋值
  75. Q_PROPERTY(int32_t WorkPressure READ WorkPressure WRITE setWorkPressure NOTIFY workPressureChanged)//工作压力--没有展示到qt
  76. Q_PROPERTY(int32_t Cold READ Cold WRITE SetCold NOTIFY coldChanged)//发动机水温 canJ1939
  77. Q_PROPERTY(int32_t leftAngle READ leftAngle WRITE setLeftAngle NOTIFY leftAngleChanged)//左支腿高度 金川使用角度传感器提供的支腿高度
  78. Q_PROPERTY(int32_t rightAngle READ rightAngle WRITE setRightAngle NOTIFY rightAngleChanged)//右支腿高度 金川使用角度传感器提供的支腿高度
  79. // Q_PROPERTY(int32_t ModelX READ ModelX WRITE setModelX NOTIFY modelXChanged)
  80. // Q_PROPERTY(int32_t ModelY READ ModelY WRITE setModelY NOTIFY modelYChanged)
  81. // Q_PROPERTY(int32_t ModelZ READ ModelZ WRITE setModelZ NOTIFY modelZChanged)
  82. //外加传感器
  83. Q_PROPERTY(float Steer READ Steer WRITE setSteerAngle NOTIFY steerAngleChanged)//转向角度 车辆姿态 外加传感器 铰接转向姿态编码器
  84. Q_PROPERTY(int32_t Speed READ Speed WRITE SetSpeed NOTIFY speedChanged)//行驶速度 驱动轮角度编码器
  85. //大冶新增
  86. Q_PROPERTY(int32_t engineTime READ engineTime WRITE setEngineTime NOTIFY engineTimeChanged)//发动机工作小时 canJ1939
  87. Q_PROPERTY(int32_t wireSensorL READ wireSensorL WRITE setWireSensorL NOTIFY wireSensorLChanged)//左支腿高度 外加传感器 大冶使用拉线传感器提供的支腿高度
  88. Q_PROPERTY(int32_t wireSensorR READ wireSensorR WRITE setWireSensorR NOTIFY wireSensorRChanged)//右支腿高度 外加传感器 大冶使用拉线传感器提供的支腿高度
  89. Q_PROPERTY(int32_t fuelLevel READ fuelLevel WRITE setFuelLevel NOTIFY fuelLevelChanged)//燃油油位油量 附件2
  90. Q_PROPERTY(int32_t lockSwitchL READ lockSwitchL WRITE setLockSwitchL NOTIFY lockSwitchLChanged)//锁钩到位开关L 附件2
  91. Q_PROPERTY(int32_t lockSwitchR READ lockSwitchR WRITE setLockSwitchR NOTIFY lockSwitchRChanged)//锁钩到位开关R 附件2
  92. Q_PROPERTY(int32_t tipLimit READ tipLimit WRITE setTipLimit NOTIFY tipLimitChanged)//倾翻限位 附件2
  93. Q_PROPERTY(int32_t turnLeft READ turnLeft WRITE setTurnLeft NOTIFY turnLeftChanged)//左转 附件2
  94. Q_PROPERTY(int32_t turnRight READ turnRight WRITE setTurnRight NOTIFY turnRightChanged)//右转 附件2
  95. Q_PROPERTY(int32_t hightBeam READ hightBeam WRITE setHightBeam NOTIFY hightBeamChanged)//远光灯 附件2
  96. Q_PROPERTY(int32_t lowBeam READ lowBeam WRITE setLowBeam NOTIFY lowBeamChanged)//近光灯 附件2
  97. Q_PROPERTY(int32_t parking READ parking WRITE setParking NOTIFY parkingChanged)//驻车 附件2
  98. Q_PROPERTY(int32_t brake READ brake WRITE setBrake NOTIFY brakeChanged)//刹车 附件2
  99. Q_PROPERTY(int32_t backCar READ backCar WRITE setBackCar NOTIFY backCarChanged)//倒车 附件2
  100. Q_PROPERTY(int32_t frontWorkLamp READ frontWorkLamp WRITE setFrontWorkLamp NOTIFY frontWorkLampChanged)//前工作灯 附件2
  101. Q_PROPERTY(int32_t rearWorkLamp READ rearWorkLamp WRITE setRearWorkLamp NOTIFY rearWorkLampChanged)//后工作灯 附件2
  102. Q_PROPERTY(int32_t cargoWeight READ cargoWeight WRITE setCargoWeight NOTIFY cargoWeightChanged)//渣包重量 附件2
  103. Q_PROPERTY(int32_t systemVol READ systemVol WRITE setSystemVol NOTIFY systemVolChanged)//系统电压 附件2
  104. Q_PROPERTY(int32_t fGear READ fGear WRITE setFGear NOTIFY fGearChanged)//档位信息1F 2R 3N
  105. Q_PROPERTY(int32_t gear1 READ gear1 WRITE setGear1 NOTIFY gear1Changed)//档位1234
  106. //下面都是报警信息解析
  107. Q_PROPERTY(int32_t lowOilPressureAlarm READ lowOilPressureAlarm WRITE setLowOilPressureAlarm NOTIFY lowOilPressureAlarmChanged)
  108. Q_PROPERTY(int32_t engineWaterTemperatureAlarm READ engineWaterTemperatureAlarm WRITE setEngineWaterTemperatureAlarm NOTIFY engineWaterTemperatureAlarmChanged)
  109. Q_PROPERTY(int32_t highEngineOilTemperatureAlarm READ highEngineOilTemperatureAlarm WRITE setHighEngineOilTemperatureAlarm NOTIFY highEngineOilTemperatureAlarmChanged)
  110. Q_PROPERTY(int32_t engineWaterLevelLowAlarm READ engineWaterLevelLowAlarm WRITE setEngineWaterLevelLowAlarm NOTIFY engineWaterLevelLowAlarmChanged)
  111. Q_PROPERTY(int32_t lowFuelOilAlarm READ lowFuelOilAlarm WRITE setLowFuelOilAlarm NOTIFY lowFuelOilAlarmChanged)
  112. Q_PROPERTY(int32_t returnOilFilterBlockedAlarm READ returnOilFilterBlockedAlarm WRITE setReturnOilFilterBlockedAlarm NOTIFY returnOilFilterBlockedAlarmChanged)
  113. Q_PROPERTY(int32_t oilFilterBlockedAlarm READ oilFilterBlockedAlarm WRITE setOilFilterBlockedAlarm NOTIFY oilFilterBlockedAlarmChanged)
  114. Q_PROPERTY(int32_t controlScreenBlockageAlarm READ controlScreenBlockageAlarm WRITE setControlScreenBlockageAlarm NOTIFY controlScreenBlockageAlarmChanged)
  115. Q_PROPERTY(int32_t emergencyFilterBlockingAlarm READ emergencyFilterBlockingAlarm WRITE setEmergencyFilterBlockingAlarm NOTIFY emergencyFilterBlockingAlarmChanged)
  116. Q_PROPERTY(int32_t coolingFilterBlockedAlarm READ coolingFilterBlockedAlarm WRITE setCoolingFilterBlockedAlarm NOTIFY coolingFilterBlockedAlarmChanged)
  117. Q_PROPERTY(int32_t electricPumpScreenBlockedAlarm READ electricPumpScreenBlockedAlarm WRITE setElectricPumpScreenBlockedAlarm NOTIFY electricPumpScreenBlockedAlarmChanged)
  118. Q_PROPERTY(int32_t brakeFilterBlockedAlarm READ brakeFilterBlockedAlarm WRITE setBrakeFilterBlockedAlarm NOTIFY brakeFilterBlockedAlarmChanged)
  119. Q_PROPERTY(int32_t variableSpeedFilterBlockedAlarm READ variableSpeedFilterBlockedAlarm WRITE setVariableSpeedFilterBlockedAlarm NOTIFY variableSpeedFilterBlockedAlarmChanged)
  120. Q_PROPERTY(int32_t lowVoltageAlarm READ lowVoltageAlarm WRITE setLowVoltageAlarm NOTIFY lowVoltageAlarmChanged)
  121. Q_PROPERTY(int32_t highTransmissionOilTemperature READ highTransmissionOilTemperature WRITE setHighTransmissionOilTemperature NOTIFY highTransmissionOilTemperatureChanged)
  122. Q_PROPERTY(int32_t transmissionOilPressureIsLow READ transmissionOilPressureIsLow WRITE setTransmissionOilPressureIsLow NOTIFY transmissionOilPressureIsLowChanged)
  123. Q_PROPERTY(int32_t oilTemperatureSensor1IsFaulty READ oilTemperatureSensor1IsFaulty WRITE setOilTemperatureSensor1IsFaulty NOTIFY oilTemperatureSensor1IsFaultyChanged)
  124. Q_PROPERTY(int32_t oilTemperatureSensor2IsFaulty READ oilTemperatureSensor2IsFaulty WRITE setOilTemperatureSensor2IsFaulty NOTIFY oilTemperatureSensor2IsFaultyChanged)
  125. Q_PROPERTY(int32_t oilLevelSensorIsFaulty READ oilLevelSensorIsFaulty WRITE setOilLevelSensorIsFaulty NOTIFY oilLevelSensorIsFaultyChanged)
  126. Q_PROPERTY(int32_t frontThrottleFault READ frontThrottleFault WRITE setFrontThrottleFault NOTIFY frontThrottleFaultChanged)
  127. Q_PROPERTY(int32_t rearThrottleFault READ rearThrottleFault WRITE setRearThrottleFault NOTIFY rearThrottleFaultChanged)
  128. Q_PROPERTY(int32_t handleOfTheUpperArmIsFaulty READ handleOfTheUpperArmIsFaulty WRITE setHandleOfTheUpperArmIsFaulty NOTIFY handleOfTheUpperArmIsFaultyChanged)
  129. Q_PROPERTY(int32_t leftLegHandleIsFaulty READ leftLegHandleIsFaulty WRITE setLeftLegHandleIsFaulty NOTIFY leftLegHandleIsFaultyChanged)
  130. Q_PROPERTY(int32_t rightLegHandleIsFaulty READ rightLegHandleIsFaulty WRITE setRightLegHandleIsFaulty NOTIFY rightLegHandleIsFaultyChanged)
  131. Q_PROPERTY(int32_t engineBusFault READ engineBusFault WRITE setEngineBusFault NOTIFY engineBusFaultChanged)
  132. Q_PROPERTY(int32_t transmissionBusFault READ transmissionBusFault WRITE setTransmissionBusFault NOTIFY transmissionBusFaultChanged)
  133. Q_PROPERTY(int32_t remoteControlBusFault READ remoteControlBusFault WRITE setRemoteControlBusFault NOTIFY remoteControlBusFaultChanged)
  134. Q_PROPERTY(int32_t rodChamberPressureSensorIsFaulty READ rodChamberPressureSensorIsFaulty WRITE setRodChamberPressureSensorIsFaulty NOTIFY rodChamberPressureSensorIsFaultyChanged)
  135. Q_PROPERTY(int32_t noRodChamberPressureSensorIsFaulty READ noRodChamberPressureSensorIsFaulty WRITE setNoRodChamberPressureSensorIsFaulty NOTIFY noRodChamberPressureSensorIsFaultyChanged)
  136. Q_PROPERTY(int32_t brakePressureSensorIsFaulty READ brakePressureSensorIsFaulty WRITE setBrakePressureSensorIsFaulty NOTIFY brakePressureSensorIsFaultyChanged)
  137. Q_PROPERTY(int32_t systemPressureSensorIsFaulty READ systemPressureSensorIsFaulty WRITE setSystemPressureSensorIsFaulty NOTIFY systemPressureSensorIsFaultyChanged)
  138. Q_PROPERTY(int32_t controlPressureSensorIsFaulty READ controlPressureSensorIsFaulty WRITE setControlPressureSensorIsFaulty NOTIFY controlPressureSensorIsFaultyChanged)
  139. Q_PROPERTY(int32_t steeringPressureSensorIsFaulty READ steeringPressureSensorIsFaulty WRITE setSteeringPressureSensorIsFaulty NOTIFY steeringPressureSensorIsFaultyChanged)
  140. Q_PROPERTY(int32_t pressureSensorOfTheLowerArmIsFaulty READ pressureSensorOfTheLowerArmIsFaulty WRITE setPressureSensorOfTheLowerArmIsFaulty NOTIFY pressureSensorOfTheLowerArmIsFaultyChanged)
  141. Q_PROPERTY(int32_t lockingPinDisplacementSensorLIsFaulty READ lockingPinDisplacementSensorLIsFaulty WRITE setLockingPinDisplacementSensorLIsFaulty NOTIFY lockingPinDisplacementSensorLIsFaultyChanged)
  142. Q_PROPERTY(int32_t lockingPinDisplacementSensorRIsFaulty READ lockingPinDisplacementSensorRIsFaulty WRITE setLockingPinDisplacementSensorRIsFaulty NOTIFY lockingPinDisplacementSensorRIsFaultyChanged)
  143. Q_PROPERTY(int32_t legDisplacementSensorLIsFaulty READ legDisplacementSensorLIsFaulty WRITE setLegDisplacementSensorLIsFaulty NOTIFY legDisplacementSensorLIsFaultyChanged)
  144. Q_PROPERTY(int32_t legDisplacementSensorRIsFaulty READ legDisplacementSensorRIsFaulty WRITE setLegDisplacementSensorRIsFaulty NOTIFY legDisplacementSensorRIsFaultyChanged)
  145. Q_PROPERTY(int32_t steeringEncoderFailure READ steeringEncoderFailure WRITE setSteeringEncoderFailure NOTIFY steeringEncoderFailureChanged)
  146. public:
  147. explicit AppModel(IEgoNotify *n , IEgoControl *c , QObject* qmlObj, QObject *parent = 0);
  148. ~AppModel();
  149. Q_INVOKABLE void userLogin(QString useName, QString password);
  150. Q_INVOKABLE void connectCar(int id);
  151. Q_INVOKABLE void leaveCar();
  152. Q_INVOKABLE void logout();
  153. Q_INVOKABLE void moveBegin(int32_t area,int32_t no);
  154. // Q_INVOKABLE void switchDriver();
  155. //Q_INVOKABLE void areaChanged(int32_t area);
  156. Q_INVOKABLE void controlCar(int id);
  157. Q_INVOKABLE void cancelControl();
  158. Q_INVOKABLE void showBackDlg(QString content, WorkArea area, int32_t no, int32_t uid);
  159. Q_INVOKABLE void showMoveDlg(MoveDesc desc);
  160. Q_INVOKABLE bool idle(int32_t uid);
  161. //Q_INVOKABLE void showTrackDlg();
  162. // Q_INVOKABLE void track();
  163. //Q_INVOKABLE void unTrack();
  164. //Q_INVOKABLE bool autoClose();
  165. //Q_INVOKABLE QString ReadyText();
  166. bool ready() const;
  167. int radar1() const;
  168. int radar2() const;
  169. int radar3() const;
  170. int radar4() const;
  171. int radar5() const;
  172. int radar6() const;
  173. int radar7() const;
  174. int radar8() const;
  175. int radar9() const;
  176. QString Account() const;
  177. QString Password() const;
  178. QString CarName() const;
  179. QString DriveName() const;
  180. /*int radar6() const;*/
  181. int ping() const;
  182. double temp() const;
  183. int alertSound() const;
  184. int32_t BrakePressure() const;
  185. int32_t OilPos() const;
  186. int32_t GearboxOilPressure()const;
  187. int32_t GearboxOilTemp()const;
  188. int32_t EnginRpm()const;
  189. int32_t EngineOilPressure()const;
  190. float Steer()const;
  191. int32_t Speed()const;
  192. bool Visible() const;
  193. //int32_t Gear() const;
  194. int32_t Cold() const;
  195. //int32_t ModelX() const;
  196. // int32_t ModelY() const;
  197. // int32_t ModelZ() const;
  198. int32_t leftAngle() const;
  199. int32_t rightAngle() const;
  200. int32_t WorkPressure() const;
  201. //大冶新增
  202. int32_t engineTime() const;
  203. int32_t wireSensorL() const;
  204. int32_t wireSensorR() const;
  205. int32_t fuelLevel() const;
  206. int32_t lockSwitchL() const;
  207. int32_t lockSwitchR() const;
  208. int32_t tipLimit() const;
  209. int32_t turnLeft() const;
  210. int32_t turnRight() const;
  211. int32_t hightBeam() const;
  212. int32_t lowBeam() const;
  213. int32_t parking() const;
  214. int32_t brake() const;
  215. int32_t backCar() const;
  216. int32_t frontWorkLamp() const;
  217. int32_t rearWorkLamp() const;
  218. int32_t cargoWeight() const;
  219. int32_t systemVol() const;
  220. int32_t fGear() const;
  221. int32_t gear1() const;
  222. int32_t lowOilPressureAlarm() const;
  223. int32_t engineWaterTemperatureAlarm() const;
  224. int32_t highEngineOilTemperatureAlarm() const;
  225. int32_t engineWaterLevelLowAlarm() const;
  226. int32_t lowFuelOilAlarm() const;
  227. int32_t returnOilFilterBlockedAlarm() const;
  228. int32_t oilFilterBlockedAlarm() const;
  229. int32_t controlScreenBlockageAlarm() const;
  230. int32_t emergencyFilterBlockingAlarm() const;
  231. int32_t coolingFilterBlockedAlarm() const;
  232. int32_t electricPumpScreenBlockedAlarm() const;
  233. int32_t brakeFilterBlockedAlarm() const;
  234. int32_t variableSpeedFilterBlockedAlarm() const;
  235. int32_t lowVoltageAlarm() const;
  236. int32_t highTransmissionOilTemperature() const;
  237. int32_t transmissionOilPressureIsLow() const;
  238. int32_t oilTemperatureSensor1IsFaulty() const;
  239. int32_t oilTemperatureSensor2IsFaulty() const;
  240. int32_t oilLevelSensorIsFaulty() const;
  241. int32_t frontThrottleFault() const;
  242. int32_t rearThrottleFault() const;
  243. int32_t handleOfTheUpperArmIsFaulty() const;
  244. int32_t leftLegHandleIsFaulty() const;
  245. int32_t rightLegHandleIsFaulty() const;
  246. int32_t engineBusFault() const;
  247. int32_t transmissionBusFault() const;
  248. int32_t remoteControlBusFault() const;
  249. int32_t rodChamberPressureSensorIsFaulty() const;
  250. int32_t noRodChamberPressureSensorIsFaulty() const;
  251. int32_t brakePressureSensorIsFaulty() const;
  252. int32_t systemPressureSensorIsFaulty() const;
  253. int32_t controlPressureSensorIsFaulty() const;
  254. int32_t steeringPressureSensorIsFaulty() const;
  255. int32_t pressureSensorOfTheLowerArmIsFaulty() const;
  256. int32_t lockingPinDisplacementSensorLIsFaulty() const;
  257. int32_t lockingPinDisplacementSensorRIsFaulty() const;
  258. int32_t legDisplacementSensorLIsFaulty() const;
  259. int32_t legDisplacementSensorRIsFaulty() const;
  260. int32_t steeringEncoderFailure() const;
  261. void SetBrakePressure(const int32_t value);
  262. void SetOilPos(const int32_t value);
  263. void SetGearBoxOilPressure(const int32_t value);
  264. void SetGearBoxOilTemp(const int32_t value);
  265. void SetEngingRpm(const int32_t value);
  266. void SetEngineOilPressure(const int32_t value);
  267. void SetSpeed(const int32_t value);
  268. void SetVisible(const bool value);
  269. //void SetGear(const int32_t value);
  270. void SetCold(const int32_t value);
  271. void setReady(const bool value);
  272. void setRadar1(const int32_t &value);
  273. void setRadar2(const int32_t &value);
  274. void setRadar3(const int32_t &value);
  275. void setRadar4(const int32_t &value);
  276. void setRadar5(const int32_t &value);
  277. void setRadar6(const int32_t& value);
  278. void setRadar7(const int32_t& value);
  279. void setRadar8(const int32_t& value);
  280. void setRadar9(const int32_t& value);
  281. void setAccount(const QString& value);
  282. void setPassword(const QString& password);
  283. void setCarName(const QString& carname);
  284. void setDriveName(const QString& drivename);
  285. void setWorkPressure(const int32_t value);
  286. //void setModelX(const int32_t value);
  287. //void setModelY(const int32_t value);
  288. //void setModelZ(const int32_t value);
  289. void setLeftAngle(const int32_t value);
  290. void setRightAngle(const int32_t value);
  291. //void setRadar6(const int32_t &value);
  292. void setPing(const int32_t &value);
  293. void setTemp(const double& value);
  294. void setSteerAngle(const float& value);
  295. //大冶新增
  296. void setEngineTime(const int32_t value);
  297. void setWireSensorL(const int32_t value);
  298. void setWireSensorR(const int32_t value);
  299. void setFuelLevel(const int32_t value);
  300. void setLockSwitchL(const int32_t value);
  301. void setLockSwitchR(const int32_t value);
  302. void setTipLimit(const int32_t value);
  303. void setTurnLeft(const int32_t value);
  304. void setTurnRight(const int32_t value);
  305. void setHightBeam(const int32_t value);
  306. void setLowBeam(const int32_t value);
  307. void setParking(const int32_t value);
  308. void setBrake(const int32_t value);
  309. void setBackCar(const int32_t value);
  310. void setFrontWorkLamp(const int32_t value);
  311. void setRearWorkLamp(const int32_t value);
  312. void setCargoWeight(const int32_t value);
  313. void setSystemVol(const int32_t value);
  314. void setFGear(const int32_t value);
  315. void setGear1(const int32_t value);
  316. void setLowOilPressureAlarm(const int32_t value);
  317. void setEngineWaterTemperatureAlarm(const int32_t value);
  318. void setHighEngineOilTemperatureAlarm(const int32_t value);
  319. void setEngineWaterLevelLowAlarm(const int32_t value);
  320. void setLowFuelOilAlarm(const int32_t value);
  321. void setReturnOilFilterBlockedAlarm(const int32_t value);
  322. void setOilFilterBlockedAlarm(const int32_t value);
  323. void setControlScreenBlockageAlarm(const int32_t value);
  324. void setEmergencyFilterBlockingAlarm(const int32_t value);
  325. void setCoolingFilterBlockedAlarm(const int32_t value);
  326. void setElectricPumpScreenBlockedAlarm(const int32_t value);
  327. void setBrakeFilterBlockedAlarm(const int32_t value);
  328. void setVariableSpeedFilterBlockedAlarm(const int32_t value);
  329. void setLowVoltageAlarm(const int32_t value);
  330. void setHighTransmissionOilTemperature(const int32_t value);
  331. void setTransmissionOilPressureIsLow(const int32_t value);
  332. void setOilTemperatureSensor1IsFaulty(const int32_t value);
  333. void setOilTemperatureSensor2IsFaulty(const int32_t value);
  334. void setOilLevelSensorIsFaulty(const int32_t value);
  335. void setFrontThrottleFault(const int32_t value);
  336. void setRearThrottleFault(const int32_t value);
  337. void setHandleOfTheUpperArmIsFaulty(const int32_t value);
  338. void setLeftLegHandleIsFaulty(const int32_t value);
  339. void setRightLegHandleIsFaulty(const int32_t value);
  340. void setEngineBusFault(const int32_t value);
  341. void setTransmissionBusFault(const int32_t value);
  342. void setRemoteControlBusFault(const int32_t value);
  343. void setRodChamberPressureSensorIsFaulty(const int32_t value);
  344. void setNoRodChamberPressureSensorIsFaulty(const int32_t value);
  345. void setBrakePressureSensorIsFaulty(const int32_t value);
  346. void setSystemPressureSensorIsFaulty(const int32_t value);
  347. void setControlPressureSensorIsFaulty(const int32_t value);
  348. void setSteeringPressureSensorIsFaulty(const int32_t value);
  349. void setPressureSensorOfTheLowerArmIsFaulty(const int32_t value);
  350. void setLockingPinDisplacementSensorLIsFaulty(const int32_t value);
  351. void setLockingPinDisplacementSensorRIsFaulty(const int32_t value);
  352. void setLegDisplacementSensorLIsFaulty(const int32_t value);
  353. void setLegDisplacementSensorRIsFaulty(const int32_t value);
  354. void setSteeringEncoderFailure(const int32_t value);
  355. QQmlListProperty<CarData> car() const;
  356. public slots:
  357. void onLoginRst(bool rst);
  358. void onCarAppend(const UserCamera &info);
  359. void onRadarUpadte(int32_t r0, int32_t r1, int32_t r2, int32_t r3, int32_t r4,
  360. int32_t r5, int32_t r6,int32_t r7,int32_t r8);
  361. void onEncodeUpdate(int32_t left, int32_t right);
  362. void onFeedData(const FeedData& data);
  363. void onNotifyState(int32_t uid, UserState state);
  364. void onPing(int32_t value,double temp);
  365. void onMoveEnd(int32_t rid, WorkArea area, int32_t no);
  366. void onNotifyDel(int32_t peer);
  367. void onKickoff();
  368. void onNotifyLeave(int32_t peer);
  369. void onNotifyFail(int32_t peer);
  370. void onMoveRet(MoveDesc desc);
  371. void OnClose();
  372. //void OnPosition(float x, float y, float z);
  373. signals:
  374. void readyChanged();
  375. void carChanged();
  376. void radar1Changed();
  377. void radar2Changed();
  378. void radar3Changed();
  379. void radar4Changed();
  380. void radar5Changed();
  381. void radar6Changed();
  382. void radar7Changed();
  383. void radar8Changed();
  384. void radar9Changed();
  385. void accountChanged();
  386. void passwordChanged();
  387. void carNameChanged();
  388. void driveNameChanged();
  389. void sectionTextChanged();
  390. void steerAngleChanged();
  391. void pingChanged();
  392. void tempChanged();
  393. void speedChanged();
  394. void visibleChanged();
  395. void gearChanged();
  396. void coldChanged();
  397. void gearboxOilPressureChanged();
  398. void gearboxOilTempChanged();
  399. void engineRpmChanged();
  400. void engineoilPressureChanged();
  401. void brakePressureChanged();
  402. void playAlertSound();
  403. void carConnected();
  404. void closeWin();
  405. void oilPosChanged();
  406. void workPressureChanged();
  407. void leftAngleChanged();
  408. void rightAngleChanged();
  409. //大冶新增
  410. void engineTimeChanged();
  411. void wireSensorLChanged();
  412. void wireSensorRChanged();
  413. void fuelLevelChanged();
  414. void lockSwitchLChanged();
  415. void lockSwitchRChanged();
  416. void tipLimitChanged();
  417. void turnLeftChanged();
  418. void turnRightChanged();
  419. void hightBeamChanged();
  420. void lowBeamChanged();
  421. void parkingChanged();
  422. void brakeChanged();
  423. void backCarChanged();
  424. void frontWorkLampChanged();
  425. void rearWorkLampChanged();
  426. void cargoWeightChanged();
  427. void systemVolChanged();
  428. void fGearChanged();
  429. void gear1Changed();
  430. void lowOilPressureAlarmChanged();
  431. void engineWaterTemperatureAlarmChanged();
  432. void highEngineOilTemperatureAlarmChanged();
  433. void engineWaterLevelLowAlarmChanged();
  434. void lowFuelOilAlarmChanged();
  435. void returnOilFilterBlockedAlarmChanged();
  436. void oilFilterBlockedAlarmChanged();
  437. void controlScreenBlockageAlarmChanged();
  438. void emergencyFilterBlockingAlarmChanged();
  439. void coolingFilterBlockedAlarmChanged();
  440. void electricPumpScreenBlockedAlarmChanged();
  441. void brakeFilterBlockedAlarmChanged();
  442. void variableSpeedFilterBlockedAlarmChanged();
  443. void lowVoltageAlarmChanged();
  444. void highTransmissionOilTemperatureChanged();
  445. void transmissionOilPressureIsLowChanged();
  446. void oilTemperatureSensor1IsFaultyChanged();
  447. void oilTemperatureSensor2IsFaultyChanged();
  448. void oilLevelSensorIsFaultyChanged();
  449. void frontThrottleFaultChanged();
  450. void rearThrottleFaultChanged();
  451. void handleOfTheUpperArmIsFaultyChanged();
  452. void leftLegHandleIsFaultyChanged();
  453. void rightLegHandleIsFaultyChanged();
  454. void engineBusFaultChanged();
  455. void transmissionBusFaultChanged();
  456. void remoteControlBusFaultChanged();
  457. void rodChamberPressureSensorIsFaultyChanged();
  458. void noRodChamberPressureSensorIsFaultyChanged();
  459. void brakePressureSensorIsFaultyChanged();
  460. void systemPressureSensorIsFaultyChanged();
  461. void controlPressureSensorIsFaultyChanged();
  462. void steeringPressureSensorIsFaultyChanged();
  463. void pressureSensorOfTheLowerArmIsFaultyChanged();
  464. void lockingPinDisplacementSensorLIsFaultyChanged();
  465. void lockingPinDisplacementSensorRIsFaultyChanged();
  466. void legDisplacementSensorLIsFaultyChanged();
  467. void legDisplacementSensorRIsFaultyChanged();
  468. void steeringEncoderFailureChanged();
  469. private:
  470. IEgoNotify *_notify;
  471. IEgoControl *_control;
  472. // std::unique_ptr<CFishEyeWindow> _window;
  473. AppModelPrivate *d;
  474. std::vector<UserCamera> _users;
  475. QString m_account;
  476. QString m_password;
  477. QString m_carName;
  478. QString m_driveName;
  479. int32_t m_radar1 = 5000;
  480. int32_t m_radar2 = 5000;
  481. int32_t m_radar3 = 5000;
  482. int32_t m_radar4 = 5000;
  483. int32_t m_radar5 = 5000;
  484. int32_t m_radar6 = 5000;
  485. int32_t m_radar7 = 5000;
  486. int32_t m_radar8 = 5000;
  487. int32_t m_radar9 = 5000;
  488. int32_t m_ping =0;
  489. double m_temp = 0.f;
  490. int32_t m_alert;
  491. int32_t m_peer;
  492. int32_t m_work_pressure =0; //工作系统压力
  493. int32_t m_brake_pressure =0;//制动系统压力
  494. int32_t m_gearbox_oil_temp =0;//变速箱油温
  495. int32_t m_gearbox_oil_pressure=0;//变速箱油压
  496. int32_t m_oil_pos = 0;
  497. int32_t m_cold_water = 0;
  498. int32_t m_engine_rpm =0;//发动机转速
  499. int32_t m_engine_oil_pressure =0;// 发动机油压
  500. float m_steer = 1.3;
  501. int32_t m_speed =0;
  502. bool m_visible = true;
  503. //int32_t m_gear =0;
  504. //WorkArea m_area= WorkArea::Area_A;
  505. // int32_t m_no;
  506. bool m_ready;
  507. QObject* m_qmlObj = nullptr;
  508. //int32_t m_modelx = 0;
  509. //int32_t m_modely = 0;
  510. int32_t m_steerAngle = 0;
  511. // int32_t m_modelz = 0;
  512. int32_t m_leftAngle = 0;
  513. int32_t m_rightAngle = 0;
  514. Lock_Status m_leftlock;
  515. Lock_Status m_rightlock;
  516. //大冶新增
  517. int32_t m_engineTime = 0;
  518. int32_t m_wireSensorL;
  519. int32_t m_wireSensorR;
  520. int32_t m_fuelLevel = 0;
  521. int32_t m_lockSwitchL;
  522. int32_t m_lockSwitchR;
  523. int32_t m_tipLimit = 0;
  524. int32_t m_turnLeft;
  525. int32_t m_turnRight;
  526. int32_t m_hightBeam;
  527. int32_t m_lowBeam;
  528. int32_t m_parking;
  529. int32_t m_brake;
  530. int32_t m_backCar;
  531. int32_t m_frontWorkLamp;
  532. int32_t m_rearWorkLamp;
  533. int32_t m_cargoWeight = 0;
  534. int32_t m_systemVol = 0;
  535. int32_t m_fGear;
  536. int32_t m_gear1;
  537. int32_t m_lowOilPressureAlarm;
  538. int32_t m_engineWaterTemperatureAlarm;
  539. int32_t m_highEngineOilTemperatureAlarm;
  540. int32_t m_engineWaterLevelLowAlarm;
  541. int32_t m_lowFuelOilAlarm;
  542. int32_t m_returnOilFilterBlockedAlarm;
  543. int32_t m_oilFilterBlockedAlarm;
  544. int32_t m_controlScreenBlockageAlarm;
  545. int32_t m_emergencyFilterBlockingAlarm;
  546. int32_t m_coolingFilterBlockedAlarm;
  547. int32_t m_electricPumpScreenBlockedAlarm;
  548. int32_t m_brakeFilterBlockedAlarm;
  549. int32_t m_variableSpeedFilterBlockedAlarm;
  550. int32_t m_lowVoltageAlarm;
  551. int32_t m_highTransmissionOilTemperature;
  552. int32_t m_transmissionOilPressureIsLow;
  553. int32_t m_oilTemperatureSensor1IsFaulty;
  554. int32_t m_oilTemperatureSensor2IsFaulty;
  555. int32_t m_oilLevelSensorIsFaulty;
  556. int32_t m_frontThrottleFault;
  557. int32_t m_rearThrottleFault;
  558. int32_t m_handleOfTheUpperArmIsFaulty;
  559. int32_t m_leftLegHandleIsFaulty;
  560. int32_t m_rightLegHandleIsFaulty;
  561. int32_t m_engineBusFault;
  562. int32_t m_transmissionBusFault;
  563. int32_t m_remoteControlBusFault;
  564. int32_t m_rodChamberPressureSensorIsFaulty;
  565. int32_t m_noRodChamberPressureSensorIsFaulty;
  566. int32_t m_brakePressureSensorIsFaulty;
  567. int32_t m_systemPressureSensorIsFaulty;
  568. int32_t m_controlPressureSensorIsFaulty;
  569. int32_t m_steeringPressureSensorIsFaulty;
  570. int32_t m_pressureSensorOfTheLowerArmIsFaulty;
  571. int32_t m_lockingPinDisplacementSensorLIsFaulty;
  572. int32_t m_lockingPinDisplacementSensorRIsFaulty;
  573. int32_t m_legDisplacementSensorLIsFaulty;
  574. int32_t m_legDisplacementSensorRIsFaulty;
  575. int32_t m_steeringEncoderFailure;
  576. };
  577. #endif // APPMODEL_H