gps_collect.cpp 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295
  1. #include "gps_collect.h"
  2. #include <iomanip>
  3. #include<QDebug>
  4. #include <iomanip>
  5. // General constants.
  6. #define NOUTPUT_PACKET_LENGTH (72) //!< NCom packet length.
  7. #define NCOM_SYNC (0xE7) //!< NCom sync byte.
  8. #define PKT_PERIOD (0.01) //!< 10ms updates.
  9. #define TIME2SEC (1e-3) //!< Units of 1 ms.
  10. #define FINETIME2SEC (4e-6) //!< Units of 4 us.
  11. #define TIMECYCLE (60000) //!< Units of TIME2SEC (i.e. 60 seconds).
  12. #define WEEK2CYCLES (10080) //!< Time cycles in a week.
  13. #define ACC2MPS2 (1e-4) //!< Units of 0.1 mm/s^2.
  14. #define RATE2RPS (1e-5) //!< Units of 0.01 mrad/s.
  15. #define VEL2MPS (1e-4) //!< Units of 0.1 mm/s.
  16. #define ANG2RAD (1e-6) //!< Units of 0.001 mrad.
  17. #define INNFACTOR (0.1) //!< Resolution of 0.1.
  18. #define POSA2M (1e-3) //!< Units of 1 mm.
  19. #define VELA2MPS (1e-3) //!< Units of 1 mm/s.
  20. #define ANGA2RAD (1e-5) //!< Units of 0.01 mrad.
  21. #define GB2RPS (5e-6) //!< Units of 0.005 mrad/s.
  22. #define AB2MPS2 (1e-4) //!< Units of 0.1 mm/s^2.
  23. #define GSFACTOR (1e-6) //!< Units of 1 ppm.
  24. #define ASFACTOR (1e-6) //!< Units of 1 ppm.
  25. #define GBA2RPS (1e-6) //!< Units of 0.001 mrad/s.
  26. #define ABA2MPS2 (1e-5) //!< Units of 0.01 mm/s^2.
  27. #define GSAFACTOR (1e-6) //!< Units of 1 ppm.
  28. #define ASAFACTOR (1e-6) //!< Units of 1 ppm.
  29. #define GPSPOS2M (1e-3) //!< Units of 1 mm.
  30. #define GPSATT2RAD (1e-4) //!< Units of 0.1 mrad.
  31. #define GPSPOSA2M (1e-4) //!< Units of 0.1 mm.
  32. #define GPSATTA2RAD (1e-5) //!< Units of 0.01 mrad.
  33. #define INNFACTOR (0.1) //!< Resolution of 0.1.
  34. #define DIFFAGE2SEC (1e-2) //!< Units of 0.01 s.
  35. #define REFPOS2M (0.0012) //!< Units of 1.2 mm.
  36. #define REFANG2RAD (1e-4) //!< Units of 0.1 mrad.
  37. #define OUTPOS2M (1e-3) //!< Units of 1 mm.
  38. #define ZVPOS2M (1e-3) //!< Units of 1 mm.
  39. #define ZVPOSA2M (1e-4) //!< Units of 0.1 mm.
  40. #define NSPOS2M (1e-3) //!< Units of 1 mm.
  41. #define NSPOSA2M (1e-4) //!< Units of 0.1 mm.
  42. #define ALIGN2RAD (1e-4) //!< Units of 0.1 mrad.
  43. #define ALIGNA2RAD (1e-5) //!< Units of 0.01 mrad.
  44. #define SZVDELAY2S (1.0) //!< Units of 1.0 s.
  45. #define SZVPERIOD2S (0.1) //!< Units of 0.1 s.
  46. #define TOPSPEED2MPS (0.5) //!< Units of 0.5 m/s.
  47. #define NSDELAY2S (0.1) //!< Units of 0.1 s.
  48. #define NSPERIOD2S (0.02) //!< Units of 0.02 s.
  49. #define NSACCEL2MPS2 (0.04) //!< Units of 0.04 m/s^2.
  50. #define NSSPEED2MPS (0.1) //!< Units of 0.1 m/s.
  51. #define NSRADIUS2M (0.5) //!< Units of 0.5 m.
  52. #define INITSPEED2MPS (0.1) //!< Units of 0.1 m/s.
  53. #define HLDELAY2S (1.0) //!< Units of 1.0 s.
  54. #define HLPERIOD2S (0.1) //!< Units of 0.1 s.
  55. #define STATDELAY2S (1.0) //!< Units of 1.0 s.
  56. #define STATSPEED2MPS (0.01) //!< Units of 1.0 cm/s.
  57. #define WSPOS2M (1e-3) //!< Units of 1 mm.
  58. #define WSPOSA2M (1e-4) //!< Units of 0.1 mm.
  59. #define WSSF2PPM (0.1) //!< Units of 0.1 pulse per metre (ppm).
  60. #define WSSFA2PC (0.002) //!< Units of 0.002% of scale factor.
  61. #define WSDELAY2S (0.1) //!< Units of 0.1 s.
  62. #define WSNOISE2CNT (0.1) //!< Units of 0.1 count for wheel speed noise.
  63. #define UNDUL2M (0.005) //!< Units of 5 mm.
  64. #define DOPFACTOR (0.1) //!< Resolution of 0.1.
  65. #define OMNISTAR_MIN_FREQ (1.52e9) //!< (Hz) i.e. 1520.0 MHz.
  66. #define OMNIFREQ2HZ (1000.0) //!< Resolution of 1 kHz.
  67. #define SNR2DB (0.2) //!< Resolution of 0.2 dB.
  68. #define LTIME2SEC (1.0) //!< Resolution of 1.0 s.
  69. #define TEMPK_OFFSET (203.15) //!< Temperature offset in degrees K.
  70. #define ABSZERO_TEMPC (-273.15) //!< Absolute zero (i.e. 0 deg K) in deg C.
  71. // For more accurate and complete local coordinates
  72. #define FINEANG2RAD (1.74532925199433e-9) //!< Units of 0.1 udeg.
  73. #define ALT2M (1e-3) //!< Units of 1 mm.
  74. // For GPS supply voltage
  75. #define SUPPLYV2V (0.1) //!< Units of 0.1 V.
  76. // Mathematical constant definitions
  77. #ifndef M_PI
  78. #define M_PI (3.1415926535897932384626433832795) //!< Pi.
  79. #endif
  80. #define DEG2RAD (M_PI/180.0) //!< Convert degrees to radians.
  81. #define RAD2DEG (180.0/M_PI) //!< Convert radians to degrees.
  82. #define POS_INT_24 (8388607) //!< Maximum value of a two's complement 24 bit integer.
  83. #define NEG_INT_24 (-8388607) //!< Minimum value of a two's complement 24 bit integer.
  84. #define INV_INT_24 (-8388608) //!< Represents an invalid two's complement 24 bit integer.
  85. #define NCOM_COUNT_TOO_OLD (150) //!< Cycle counter for data too old.
  86. #define NCOM_STDCNT_MAX (0xFF) //!< Definition for the RTBNS accuracy counter.
  87. #define MIN_HORZ_SPEED (0.07) //!< 0.07 m/s hold distance.
  88. #define MIN_VERT_SPEED (0.07) //!< 0.07 m/s hold distance.
  89. #define SPEED_HOLD_FACTOR (2.0) //!< Hold distance when speed within 2 sigma of 0.
  90. #define MINUTES_IN_WEEK (10080) //!< Number of minutes in a week.
  91. // OmniStar status definitions
  92. #define NCOM_OMNI_STATUS_UNKNOWN (0xFF)
  93. #define NCOM_OMNI_STATUS_VBSEXPIRED (0x01)
  94. #define NCOM_OMNI_STATUS_VBSREGION (0x02)
  95. #define NCOM_OMNI_STATUS_VBSNOBASE (0x04)
  96. #define NCOM_OMNI_STATUS_HPEXPIRED (0x08)
  97. #define NCOM_OMNI_STATUS_HPREGION (0x10)
  98. #define NCOM_OMNI_STATUS_HPNOBASE (0x20)
  99. #define NCOM_OMNI_STATUS_HPNOCONVERGE (0x40)
  100. #define NCOM_OMNI_STATUS_HPKEYINVALID (0x80)
  101. // GPS hardware status definitions
  102. #define NCOM_GPS_ANT_STATUS_BITMASK (0x03)
  103. #define NCOM_GPS_ANT_STATUS_DONTKNOW (0x03)
  104. #define NCOM_GPS_ANT_STATUS_BITSHIFT (0)
  105. #define NCOM_GPS_ANT_POWER_BITMASK (0x0C)
  106. #define NCOM_GPS_ANT_POWER_DONTKNOW (0x0C)
  107. #define NCOM_GPS_ANT_POWER_BITSHIFT (2)
  108. // GPS feature set 1 definitions
  109. #define NCOM_GPS_FEATURE_PSRDIFF (0x01)
  110. #define NCOM_GPS_FEATURE_SBAS (0x02)
  111. #define NCOM_GPS_FEATURE_OMNIVBS (0x08)
  112. #define NCOM_GPS_FEATURE_OMNIHP (0x10)
  113. #define NCOM_GPS_FEATURE_L1DIFF (0x20)
  114. #define NCOM_GPS_FEATURE_L1L2DIFF (0x40)
  115. // GPS feature set 2 definitions
  116. #define NCOM_GPS_FEATURE_GLONASS (0x01)
  117. #define NCOM_GPS_FEATURE_GALILEO (0x02)
  118. #define NCOM_GPS_FEATURE_RAWRNG (0x04)
  119. #define NCOM_GPS_FEATURE_RAWDOP (0x08)
  120. #define NCOM_GPS_FEATURE_RAWL1 (0x10)
  121. #define NCOM_GPS_FEATURE_RAWL2 (0x20)
  122. #define NCOM_GPS_FEATURE_RAWL5 (0x40)
  123. // GPS feature valid definition
  124. #define NCOM_GPS_FEATURE_VALID (0x80)
  125. // The start of GPS time in a time_t style. In this version it is a constant, but this constant assumes that
  126. // the local machine uses 00:00:00 01/01/1970 as its Epoch time. If your machine is different then you need to
  127. // convert 00:00:00 06/01/1980 in to the local machine's time_t time.
  128. #define GPS_TIME_START_TIME_T (315964800)
  129. // Second order filter class
  130. #define INPUT_JITTER_TOLERANCE (0.01) // i.e. 1%
  131. /*index*/
  132. #define PI_SYNC 0
  133. #define PI_TIME 1
  134. #define PI_ACCEL_X 3
  135. #define PI_ACCEL_Y 6
  136. #define PI_ACCEL_Z 9
  137. #define PI_ANG_RATE_X 12
  138. #define PI_ANG_RATE_Y 15
  139. #define PI_ANG_RATE_Z 18
  140. #define PI_INS_NAV_MODE 21
  141. #define PI_CHECKSUM_1 22
  142. #define PI_POS_LAT 23
  143. #define PI_POS_LON 31
  144. #define PI_POS_ALT 39
  145. #define PI_VEL_N 43
  146. #define PI_VEL_E 46
  147. #define PI_VEL_D 49
  148. #define PI_ORIEN_H 52
  149. #define PI_ORIEN_P 55
  150. #define PI_ORIEN_R 58
  151. #define PI_CHECKSUM_2 61
  152. #define PI_CHANNEL_INDEX 62
  153. #define PI_CHANNEL_STATUS 63
  154. #define PI_SAT_NUM 67
  155. #define PI_RTK_STATUS 68
  156. #define PI_CHECKSUM_3 71
  157. /*RTK IMU status check*/
  158. #define RTK_IMU_OK 0
  159. #define IMU_STATUS_ERR 1
  160. #define RTK_STATUS_ERR 2
  161. #define UNKNOWN 0xFF
  162. #define map_coefficient 1
  163. static int coutt=1;
  164. static double xx;
  165. static double yy;
  166. static QVector<QPointF> pointf;
  167. static QPointF pointf_t;
  168. static double road_width=3.5;
  169. struct GPS_INS
  170. {
  171. int valid = 0xff;
  172. int index = 0; //gps点序号
  173. double gps_lat = 0;//纬度
  174. double gps_lng = 0;//经度
  175. double gps_x = 0;
  176. double gps_y = 0;
  177. double gps_z = 0;
  178. double ins_roll_angle = 0; //横滚角 一般定义载体的右、前、上三个方向构成右手系,绕向前的轴旋转就是横滚角,绕向右的轴旋转就是俯仰角,绕向上的轴旋转就是航向角
  179. double ins_pitch_angle = 0; //俯仰角
  180. double ins_heading_angle = 0; //航向角
  181. int ins_status = 0; //惯导状态 4
  182. int rtk_status = 0; //rtk状态 6 -5 -3
  183. int gps_satelites_num = 0;
  184. //-----加速度--------------
  185. double accel_x = 0;
  186. double accel_y = 0;
  187. double accel_z = 0;
  188. //-------角速度------------
  189. double ang_rate_x = 0;
  190. double ang_rate_y = 0;
  191. double ang_rate_z = 0;
  192. //-----------方向速度--------------
  193. double vel_N = 0;
  194. double vel_E = 0;
  195. double vel_D = 0;
  196. int speed_mode = 0;
  197. int mode2 = 0;
  198. double speed = 0; //速度 若导航点则为导航预设速度 若为当前点则为当前车速
  199. };
  200. typedef boost::shared_ptr<GPS_INS> GPSData;
  201. class CarStatus : public boost::noncopyable {
  202. public:
  203. float speed; //车速
  204. std::int16_t wheel_angle; //方向盘转角
  205. std::uint8_t braking_pressure; //刹车压力
  206. GPSData location; //当前车辆位置
  207. CarStatus() {
  208. speed = 0;
  209. braking_pressure = 0;
  210. wheel_angle = 0;
  211. location = boost::shared_ptr<GPS_INS>(new GPS_INS);
  212. }
  213. ~CarStatus() {
  214. }
  215. };
  216. typedef boost::serialization::singleton<CarStatus> CarStatusSingleton;
  217. #define ServiceCarStatus CarStatusSingleton::get_mutable_instance()
  218. static double cast_8_byte_to_double(const uint8_t *b);
  219. static int32_t cast_3_byte_to_int32(const uint8_t *b);
  220. extern char gstr_memname[256];
  221. GPS_Collect * gw;
  222. GPSData data(new GPS_INS);
  223. void ListenRaw(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
  224. {
  225. iv::gps::gpsimu xgpsimu;
  226. if(!xgpsimu.ParseFromArray(strdata,nSize))
  227. {
  228. std::cout<<"ListenRaw Parse error."<<std::endl;
  229. }
  230. gw->mMutexraw.lock();
  231. data->gps_lat = xgpsimu.lat();
  232. data->gps_lng = xgpsimu.lon();
  233. data->ins_heading_angle = xgpsimu.heading();
  234. gw->mMutexraw.unlock();
  235. }
  236. GPSSensor::GPSSensor() {
  237. }
  238. GPSSensor::~GPSSensor() {
  239. }
  240. void GPSSensor::start()
  241. {
  242. thread_sensor_run_ = new boost::thread(boost::bind(&GPSSensor::processSensor, this));
  243. }
  244. void GPSSensor::stop()
  245. {
  246. thread_sensor_run_->interrupt();
  247. thread_sensor_run_->join();
  248. }
  249. void GPSSensor::obs_modechange(int rec)
  250. {
  251. _mtx.lock();
  252. obs_modes = rec;
  253. _mtx.unlock();
  254. }
  255. void GPSSensor::speed_modechange(int rec)
  256. {
  257. _mtx.lock();
  258. speed_modes = rec;
  259. _mtx.unlock();
  260. }
  261. void GPSSensor::lane_num_modechange(int rec)
  262. {
  263. _mtx.lock();
  264. lane_num = rec;
  265. _mtx.unlock();
  266. }
  267. void GPSSensor::lane_status_modechange(int rec)
  268. {
  269. _mtx.lock();
  270. lane_status = rec;
  271. _mtx.unlock();
  272. }
  273. void GPSSensor::start_or_end(bool rec)
  274. {
  275. _mtx2.lock();
  276. writegps = rec;
  277. _mtx2.unlock();
  278. }
  279. void GPSSensor::collect_modechange(bool rec)
  280. {
  281. _mtx3.lock();
  282. is_forbidden = rec;
  283. _mtx3.unlock();
  284. }
  285. void GPSSensor::jianju_change(double rec)
  286. {
  287. _mtx4.lock();
  288. jianju = rec;
  289. _mtx4.unlock();
  290. }
  291. bool GPSSensor::isRunning() const
  292. {
  293. return (thread_sensor_run_ != NULL && !thread_sensor_run_->timed_join(boost::posix_time::milliseconds(10)));
  294. }
  295. #include <QNetworkDatagram>
  296. #include "gnss_coordinate_convert.h"
  297. extern char gstr_mappath[256];
  298. void GPSSensor::processSensor()
  299. {
  300. int x;
  301. ServiceCarStatus.location->gps_x = 0;
  302. ServiceCarStatus.location->gps_y = 0;
  303. std::string sk;
  304. std::stringstream ss;
  305. while (true)
  306. {
  307. if(should_exit == true)
  308. {
  309. ready_exit = 1;
  310. return;
  311. }
  312. if(!writegps)
  313. {
  314. #ifdef Q_OS_WIN
  315. Sleep(1);
  316. #else
  317. usleep(1000);
  318. #endif
  319. continue;
  320. }
  321. ss.clear();
  322. ss.str("");
  323. sk.clear();
  324. gps_index = 0;
  325. std::ofstream fout;
  326. fout.setf(std::ios::fixed, std::ios::floatfield); // 设定为 fixed 模式,以小数点表示浮点数
  327. fout.precision(12); // 设置精度 2
  328. time_t now;
  329. struct tm *timenow;
  330. time(&now);
  331. timenow = localtime(&now);
  332. ss << "" << timenow->tm_year+1900 << "-" << timenow->tm_mon+1 << "-" << timenow->tm_mday << "-" << timenow->tm_hour << "h-" << timenow->tm_min << "m-" << timenow->tm_sec << "s.txt";
  333. sk = ss.str();
  334. QString path = QString("%1/%2-%3-%4-%5-%6-%7%8").arg(gstr_mappath).arg(timenow->tm_year+1900)
  335. .arg(timenow->tm_mon+1).arg(timenow->tm_mday).arg(timenow->tm_hour)
  336. .arg(timenow->tm_min).arg(timenow->tm_sec).arg(".txt");
  337. fout.open(path.toStdString());
  338. while (writegps)
  339. {
  340. if(should_exit == true)
  341. {
  342. fout.close();
  343. ready_exit = 1;
  344. return;
  345. }
  346. // char *buf = new char[100];
  347. // memset(buf,0,100);
  348. std::cout<<"run "<<std::endl;
  349. if (data->ins_heading_angle < 0.0)
  350. {
  351. data->ins_heading_angle += 360.0;
  352. }
  353. //std::cout<<"x = "<<std::endl;
  354. GaussProjCal(data->gps_lng, data->gps_lat, &data->gps_x, &data->gps_y);
  355. ServiceCarStatus.location->gps_lat = data->gps_lat;
  356. ServiceCarStatus.location->gps_lng = data->gps_lng;
  357. ServiceCarStatus.location->ins_heading_angle = data->ins_heading_angle;
  358. double x = (ServiceCarStatus.location->gps_x - data->gps_x)*(ServiceCarStatus.location->gps_x - data->gps_x) + (ServiceCarStatus.location->gps_y - data->gps_y)*(ServiceCarStatus.location->gps_y - data->gps_y);
  359. if (x > (jianju*jianju))
  360. {
  361. fout << gps_index << "\t" << data->gps_lng << "\t" << data->gps_lat << "\t" << ServiceCarStatus.location->speed_mode << "\t" << ServiceCarStatus.location->mode2 << "\t" << data->ins_heading_angle << "\t" << obs_modes << "\t" << speed_modes << "\t" << lane_num << "\t" << lane_status <<std::endl;
  362. gps_index++;
  363. ServiceCarStatus.location->gps_x = data->gps_x;
  364. ServiceCarStatus.location->gps_y = data->gps_y;
  365. }
  366. }
  367. fout.close(); //关闭文件
  368. }
  369. }
  370. void GPSSensor::wait_exit()
  371. {
  372. while(true)
  373. {
  374. should_exit = true;
  375. #ifdef linux
  376. usleep(5000);
  377. #endif
  378. #ifdef WIN32
  379. boost::this_thread::sleep(boost::posix_time::milliseconds(5));
  380. // Sleep(5);
  381. #endif
  382. if(ready_exit == 1)
  383. {
  384. return;
  385. }
  386. }
  387. }
  388. static double cast_8_byte_to_double(const uint8_t *b)
  389. {
  390. union { double x; uint8_t c[8]; } u;
  391. u.c[0] = b[0];
  392. u.c[1] = b[1];
  393. u.c[2] = b[2];
  394. u.c[3] = b[3];
  395. u.c[4] = b[4];
  396. u.c[5] = b[5];
  397. u.c[6] = b[6];
  398. u.c[7] = b[7];
  399. return u.x;
  400. }
  401. static int32_t cast_3_byte_to_int32(const uint8_t *b)
  402. {
  403. union { int32_t x; uint8_t c[4]; } u;
  404. u.c[1] = b[0];
  405. u.c[2] = b[1];
  406. u.c[3] = b[2];
  407. return u.x >> 8;
  408. }
  409. GPS_Collect::GPS_Collect(QWidget *parent):
  410. QWidget(parent)
  411. {
  412. gw = this;
  413. //gps_collector_close = new boost::signals2::signal<void()>();
  414. this->setObjectName(QStringLiteral("GPS_Collector"));
  415. this->resize(1600, 650);
  416. frame = new QFrame(this);
  417. frame->setObjectName(QStringLiteral("frame"));
  418. frame->setGeometry(QRect(440, 390, 120, 80));
  419. frame->setFrameShape(QFrame::StyledPanel);
  420. frame->setFrameShadow(QFrame::Raised);
  421. label = new QLabel(this);
  422. label->setObjectName(QStringLiteral("label"));
  423. label->setGeometry(QRect(20, 20, 90, 35));
  424. comboBox = new QComboBox(this);
  425. comboBox->setObjectName(QStringLiteral("comboBox"));
  426. comboBox->setCurrentIndex(0);
  427. comboBox->setGeometry(QRect(120, 60, 100, 35));
  428. comboBox_2=new QComboBox(this);
  429. comboBox_2->setObjectName(QStringLiteral("comboBox_2"));
  430. comboBox_2->setCurrentIndex(0);
  431. comboBox_2->setGeometry(QRect(120,95,100,35));
  432. QFont font;//设置字号
  433. font.setPointSize(16);
  434. comboBox->setFont(font);
  435. comboBox_2->setFont(font);
  436. label_2 = new QLabel(this);
  437. label_2->setObjectName(QStringLiteral("label_2"));
  438. label_2->setGeometry(QRect(20, 60, 90, 35));
  439. lineEdit = new QLineEdit(this);
  440. lineEdit->setObjectName(QStringLiteral("lineEdit"));
  441. lineEdit->setGeometry(QRect(120, 20, 100, 35));
  442. lineEdit->setFont(font);
  443. lineEdit->setAlignment(Qt::AlignCenter);
  444. label_3 = new QLabel(this);
  445. label_3->setObjectName(QStringLiteral("label_3"));
  446. label_3->setGeometry(QRect(270, 20, 30, 16));
  447. label_4 = new QLabel(this);
  448. label_4->setObjectName(QStringLiteral("label_4"));
  449. label_4->setGeometry(QRect(270, 40, 30, 16));
  450. label_5 = new QLabel(this);
  451. label_5->setObjectName(QStringLiteral("label_5"));
  452. label_5->setGeometry(QRect(270, 60, 60, 16));
  453. label_6 = new QLabel(this);
  454. label_6->setObjectName(QStringLiteral("label_6"));
  455. label_6->setGeometry(QRect(440, 20, 80, 16));
  456. label_7 = new QLabel(this);
  457. label_7->setObjectName(QStringLiteral("label_7"));
  458. label_7->setGeometry(QRect(440, 80, 80, 16));
  459. label_8 = new QLabel(this);
  460. label_8->setObjectName(QStringLiteral("label_8"));
  461. label_8->setGeometry(QRect(440, 40, 80, 16));
  462. label_9 = new QLabel(this);
  463. label_9->setObjectName(QStringLiteral("label_9"));
  464. label_9->setGeometry(QRect(440, 60, 80, 16));
  465. label_10=new QLabel(this);
  466. label_10->setText("路宽附加属性");
  467. label_10->setAlignment(Qt::AlignCenter);
  468. label_10->setGeometry((QRect(20, 100, 90, 35)));
  469. lineEdit_2 = new QLineEdit(this);
  470. lineEdit_2->setObjectName(QStringLiteral("lineEdit_2"));
  471. lineEdit_2->setGeometry(QRect(310, 20, 120, 20));
  472. lineEdit_3 = new QLineEdit(this);
  473. lineEdit_3->setObjectName(QStringLiteral("lineEdit_3"));
  474. lineEdit_3->setGeometry(QRect(310, 40, 120, 20));
  475. lineEdit_4 = new QLineEdit(this);
  476. lineEdit_4->setObjectName(QStringLiteral("lineEdit_4"));
  477. lineEdit_4->setGeometry(QRect(340, 60, 90, 20));
  478. lineEdit_5 = new QLineEdit(this);
  479. lineEdit_5->setObjectName(QStringLiteral("lineEdit_5"));
  480. lineEdit_5->setGeometry(QRect(520, 20, 90, 20));
  481. lineEdit_6 = new QLineEdit(this);
  482. lineEdit_6->setObjectName(QStringLiteral("lineEdit_6"));
  483. lineEdit_6->setGeometry(QRect(520, 40, 90, 20));
  484. lineEdit_7 = new QLineEdit(this);
  485. lineEdit_7->setObjectName(QStringLiteral("lineEdit_7"));
  486. lineEdit_7->setGeometry(QRect(520, 60, 90, 20));
  487. lineEdit_8 = new QLineEdit(this);
  488. lineEdit_8->setObjectName(QStringLiteral("lineEdit_8"));
  489. lineEdit_8->setGeometry(QRect(520, 80, 90, 20));
  490. this->setWindowTitle(QApplication::translate("GPS_Collector", "GPS_Collector", nullptr));
  491. label->setText(QApplication::translate("GPS_Collector", "\351\207\207\351\233\206\347\202\271\351\227\264\350\267\235(m)", nullptr));
  492. label_2->setText(QApplication::translate("GPS_Collector", "\347\246\201\347\224\250\351\231\204\345\212\240\345\261\236\346\200\247", nullptr));
  493. label_3->setText(QApplication::translate("GPS_Collector", "\347\273\217\345\272\246", nullptr));
  494. label_4->setText(QApplication::translate("GPS_Collector", "\347\272\254\345\272\246", nullptr));
  495. label_5->setText(QApplication::translate("GPS_Collector", "\345\267\262\351\207\207\351\233\206\347\202\271\346\225\260", nullptr));
  496. label_6->setText(QApplication::translate("GPS_Collector", "\351\201\277\351\232\234\346\250\241\345\274\217", nullptr));
  497. label_7->setText(QApplication::translate("GPS_Collector", "\346\211\200\345\234\250\350\275\246\351\201\223", nullptr));
  498. label_8->setText(QApplication::translate("GPS_Collector", "\351\200\237\345\272\246\346\216\247\345\210\266\346\250\241\345\274\217", nullptr));
  499. label_9->setText(QApplication::translate("GPS_Collector", "\350\275\246\351\201\223\346\200\273\346\225\260", nullptr));
  500. // label_10->setText(QApplication::translate("GPS_Collector", "\347\246\201\347\224\250\351\231\204\345\212\240\345\261\236\346\200\247", nullptr));
  501. pushButtonstart = new QPushButton(this);
  502. pushButtonstart->setObjectName(QStringLiteral("pushButtonstart"));
  503. pushButtonstart->setGeometry(QRect(630, 11, 158, 50));
  504. pushButtonstart->setText("start");
  505. connect(pushButtonstart, SIGNAL(clicked()), this, SLOT(ClickButton_start()));
  506. pushButtonend = new QPushButton(this);
  507. pushButtonend->setObjectName(QStringLiteral("pushButtonend"));
  508. pushButtonend->setGeometry(QRect(630, 70, 158, 50));
  509. pushButtonend->setText("end");
  510. connect(pushButtonend, SIGNAL(clicked()), this, SLOT(ClickButton_end()));
  511. pushButton0 = new QPushButton(this);
  512. pushButton0->setObjectName(QStringLiteral("pushButton0"));
  513. pushButton0->setGeometry(QRect(20, 130, 192, 93));
  514. pushButton0->setText(QStringLiteral("停障"));
  515. connect(pushButton0, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_0()));
  516. pushButton1 = new QPushButton(this);
  517. pushButton1->setObjectName(QStringLiteral("pushButton1"));
  518. pushButton1->setGeometry(QRect(20, 223, 192, 93));
  519. pushButton1->setText(QStringLiteral("避障"));
  520. connect(pushButton1, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_1()));
  521. pushButton2 = new QPushButton(this);
  522. pushButton2->setObjectName(QStringLiteral("pushButton2"));
  523. pushButton2->setGeometry(QRect(20, 316, 192, 93));
  524. pushButton2->setText(QStringLiteral("不停不避"));
  525. connect(pushButton2, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_2()));
  526. pushButton33 = new QPushButton(this);
  527. pushButton33->setObjectName(QStringLiteral("保留"));
  528. pushButton33->setGeometry(QRect(20, 409, 192, 93));
  529. pushButton33->setText(QStringLiteral("保留"));
  530. connect(pushButton33, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_33()));
  531. pushButton34 = new QPushButton(this);
  532. pushButton34->setObjectName(QStringLiteral("pushButton34"));
  533. pushButton34->setGeometry(QRect(20, 502, 192, 93));
  534. pushButton34->setText(QStringLiteral("保留"));
  535. connect(pushButton34, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_34()));
  536. pushButton3 = new QPushButton(this);
  537. pushButton3->setObjectName(QStringLiteral("pushButton3"));
  538. pushButton3->setGeometry(QRect(212, 130, 96, 46));
  539. pushButton3->setText(QStringLiteral("常速行驶"));
  540. connect(pushButton3, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_3()));
  541. pushButton4 = new QPushButton(this);
  542. pushButton4->setObjectName(QStringLiteral("pushButton4"));
  543. pushButton4->setGeometry(QRect(308, 130, 96, 46));
  544. pushButton4->setText(QStringLiteral("入口"));
  545. connect(pushButton4, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_4()));
  546. pushButton5 = new QPushButton(this);
  547. pushButton5->setObjectName(QStringLiteral("pushButton5"));
  548. pushButton5->setGeometry(QRect(212, 176, 96, 47));
  549. pushButton5->setText(QStringLiteral("事故区"));
  550. connect(pushButton5, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_5()));
  551. pushButton6 = new QPushButton(this);
  552. pushButton6->setObjectName(QStringLiteral("pushButton6"));
  553. pushButton6->setGeometry(QRect(308, 176, 96, 47));
  554. pushButton6->setText(QStringLiteral("驻车点"));
  555. connect(pushButton6, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_6()));
  556. pushButton7 = new QPushButton(this);
  557. pushButton7->setObjectName(QStringLiteral("pushButton7"));
  558. pushButton7->setGeometry(QRect(212, 223, 96, 46));
  559. pushButton7->setText(QStringLiteral("隧道"));
  560. connect(pushButton7, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_7()));
  561. pushButton18 = new QPushButton(this);
  562. pushButton18->setObjectName(QStringLiteral("pushButton18"));
  563. pushButton18->setGeometry(QRect(308, 223, 96, 46));
  564. pushButton18->setText(QStringLiteral("低速"));
  565. connect(pushButton18, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_18()));
  566. pushButton19 = new QPushButton(this);
  567. pushButton19->setObjectName(QStringLiteral("pushButton19"));
  568. pushButton19->setGeometry(QRect(212, 269, 96, 47));
  569. pushButton19->setText(QStringLiteral("红绿灯"));
  570. connect(pushButton19, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_19()));
  571. pushButton20 = new QPushButton(this);
  572. pushButton20->setObjectName(QStringLiteral("pushButton20"));
  573. pushButton20->setGeometry(QRect(308, 269, 96, 47));
  574. pushButton20->setText(QStringLiteral("行人"));
  575. connect(pushButton20, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_20()));
  576. pushButton21 = new QPushButton(this);
  577. pushButton21->setObjectName(QStringLiteral("pushButton21"));
  578. pushButton21->setGeometry(QRect(212, 316, 96, 46));
  579. pushButton21->setText(QStringLiteral("雾区"));
  580. connect(pushButton21, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_21()));
  581. pushButton22 = new QPushButton(this);
  582. pushButton22->setObjectName(QStringLiteral("pushButton22"));
  583. pushButton22->setGeometry(QRect(308, 316, 96, 46));
  584. pushButton22->setText(QStringLiteral("变道停车"));
  585. connect(pushButton22, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_22()));
  586. pushButton23 = new QPushButton(this);
  587. pushButton23->setObjectName(QStringLiteral("pushButton23"));
  588. pushButton23->setGeometry(QRect(212, 362, 96, 47));
  589. pushButton23->setText(QStringLiteral("等人停车"));
  590. connect(pushButton23, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_23()));
  591. pushButton24 = new QPushButton(this);
  592. pushButton24->setObjectName(QStringLiteral("pushButton24"));
  593. pushButton24->setGeometry(QRect(308, 362, 96, 47));
  594. pushButton24->setText(QStringLiteral("疯狂加速"));
  595. connect(pushButton24, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_24()));
  596. pushButton25 = new QPushButton(this);
  597. pushButton25->setObjectName(QStringLiteral("pushButton25"));
  598. pushButton25->setGeometry(QRect(212, 409, 96, 46));
  599. pushButton25->setText(QStringLiteral("跟随"));
  600. connect(pushButton25, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_25()));
  601. pushButton26 = new QPushButton(this);
  602. pushButton26->setObjectName(QStringLiteral("pushButton26"));
  603. pushButton26->setGeometry(QRect(308, 409, 96, 46));
  604. pushButton26->setText(QStringLiteral("倒车"));
  605. connect(pushButton26, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_26()));
  606. pushButton27 = new QPushButton(this);
  607. pushButton27->setObjectName(QStringLiteral("pushButton27"));
  608. pushButton27->setGeometry(QRect(212, 455, 96, 47));
  609. pushButton27->setText(QStringLiteral("左转弯"));
  610. connect(pushButton27, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_27()));
  611. pushButton28 = new QPushButton(this);
  612. pushButton28->setObjectName(QStringLiteral("pushButton28"));
  613. pushButton28->setGeometry(QRect(308, 455, 96, 47));
  614. pushButton28->setText(QStringLiteral("右转弯"));
  615. connect(pushButton28, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_28()));
  616. pushButton29 = new QPushButton(this);
  617. pushButton29->setObjectName(QStringLiteral("pushButton29"));
  618. pushButton29->setGeometry(QRect(212, 502, 96, 46));
  619. pushButton29->setText(QStringLiteral("低速左转"));
  620. connect(pushButton29, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_29()));
  621. pushButton30 = new QPushButton(this);
  622. pushButton30->setObjectName(QStringLiteral("pushButton30"));
  623. pushButton30->setGeometry(QRect(308, 502, 96, 46));
  624. pushButton30->setText(QStringLiteral("低速右转"));
  625. connect(pushButton30, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_30()));
  626. pushButton31 = new QPushButton(this);
  627. pushButton31->setObjectName(QStringLiteral("pushButton31"));
  628. pushButton31->setGeometry(QRect(212, 548, 96, 47));
  629. pushButton31->setText(QStringLiteral("超低速"));
  630. connect(pushButton31, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_31()));
  631. pushButton32 = new QPushButton(this);
  632. pushButton32->setObjectName(QStringLiteral("pushButton32"));
  633. pushButton32->setGeometry(QRect(308, 548, 96, 47));
  634. pushButton32->setText(QStringLiteral("保留"));
  635. connect(pushButton32, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_32()));
  636. pushButton8 = new QPushButton(this);
  637. pushButton8->setObjectName(QStringLiteral("pushButton8"));
  638. pushButton8->setGeometry(QRect(404, 130, 192, 93));
  639. pushButton8->setText(QStringLiteral("单车道"));
  640. connect(pushButton8, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_8()));
  641. pushButton9 = new QPushButton(this);
  642. pushButton9->setObjectName(QStringLiteral("pushButton9"));
  643. pushButton9->setGeometry(QRect(404, 223, 192, 93));
  644. pushButton9->setText(QStringLiteral("双车道"));
  645. connect(pushButton9, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_9()));
  646. pushButton10 = new QPushButton(this);
  647. pushButton10->setObjectName(QStringLiteral("pushButton10"));
  648. pushButton10->setGeometry(QRect(404, 316, 192, 93));
  649. pushButton10->setText(QStringLiteral("三车道"));
  650. connect(pushButton10, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_10()));
  651. pushButton11 = new QPushButton(this);
  652. pushButton11->setObjectName(QStringLiteral("pushButton11"));
  653. pushButton11->setGeometry(QRect(404, 409, 192, 93));
  654. pushButton11->setText(QStringLiteral("四车道"));
  655. connect(pushButton11, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_11()));
  656. pushButton12 = new QPushButton(this);
  657. pushButton12->setObjectName(QStringLiteral("pushButton12"));
  658. pushButton12->setGeometry(QRect(404, 502, 192, 93));
  659. pushButton12->setText(QStringLiteral("五车道"));
  660. connect(pushButton12, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_12()));
  661. pushButton13 = new QPushButton(this);
  662. pushButton13->setObjectName(QStringLiteral("pushButton13"));
  663. pushButton13->setGeometry(QRect(596, 130, 192, 93));
  664. pushButton13->setText(QStringLiteral("在车道0"));
  665. connect(pushButton13, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_13()));
  666. pushButton14 = new QPushButton(this);
  667. pushButton14->setObjectName(QStringLiteral("pushButton0"));
  668. pushButton14->setGeometry(QRect(596, 223, 192, 93));
  669. pushButton14->setText(QStringLiteral("在车道1"));
  670. connect(pushButton14, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_14()));
  671. pushButton15 = new QPushButton(this);
  672. pushButton15->setObjectName(QStringLiteral("pushButton0"));
  673. pushButton15->setGeometry(QRect(596, 316, 192, 93));
  674. pushButton15->setText(QStringLiteral("在车道2"));
  675. connect(pushButton15, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_15()));
  676. pushButton16 = new QPushButton(this);
  677. pushButton16->setObjectName(QStringLiteral("pushButton0"));
  678. pushButton16->setGeometry(QRect(596, 409, 192, 93));
  679. pushButton16->setText(QStringLiteral("在车道3"));
  680. connect(pushButton16, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_16()));
  681. pushButton17 = new QPushButton(this);
  682. pushButton17->setObjectName(QStringLiteral("pushButton0"));
  683. pushButton17->setGeometry(QRect(596, 502, 192, 93));
  684. pushButton17->setText(QStringLiteral("在车道4"));
  685. connect(pushButton17, SIGNAL(clicked()), this, SLOT(ClickButton_nomall_17()));
  686. lineEdit->setText(QStringLiteral("0.1"));
  687. connect(lineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(savestabuyEditinfo(const QString &)));
  688. comboBox->addItem(QStringLiteral(" 禁用"));
  689. comboBox->addItem(QStringLiteral(" 不禁用"));
  690. connect(comboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(mycombox(const QString &)));
  691. comboBox_2->addItem(QStringLiteral("3.5"));
  692. comboBox_2->addItem(QStringLiteral("1.0"));
  693. comboBox_2->addItem(QStringLiteral("1.5"));
  694. comboBox_2->addItem(QStringLiteral("2.0"));
  695. comboBox_2->addItem(QStringLiteral("2.5"));
  696. comboBox_2->addItem(QStringLiteral("3.0"));
  697. comboBox_2->addItem(QStringLiteral("4.0"));
  698. comboBox_2->addItem(QStringLiteral("4.5"));
  699. comboBox_2->addItem(QStringLiteral("5.0"));
  700. comboBox_2->currentText();
  701. lineEdit_9= new QLineEdit;
  702. lineEdit_9->setReadOnly(true);
  703. lineEdit_9->setAlignment(Qt::AlignCenter);
  704. comboBox_2->setLineEdit(lineEdit_9);
  705. connect(comboBox_2, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(mycombox_2(const QString &)));
  706. timer = new QTimer(this);
  707. connect(timer, SIGNAL(timeout()), this, SLOT(timeoutslot1()));
  708. connect(timer, SIGNAL(timeout()), this, SLOT(timeoutslot2()));
  709. connect(timer, SIGNAL(timeout()), this, SLOT(timeoutslot3()));
  710. timer->start(20);
  711. myview = new MyView(this);
  712. myview->setObjectName(QStringLiteral("graphicsView"));
  713. myview->setGeometry(QRect(820, 10,500, 585));
  714. image = new QImage(2000, 2000, QImage::Format_RGB32);//画布的初始化大小设为300*300,使用32位颜色
  715. myview->setCacheMode(myview->CacheBackground);
  716. painter=new QPainter(this);
  717. painter->end();
  718. scene = new QGraphicsScene;
  719. sensor_gps = new GPSSensor();
  720. sensor_gps->start();
  721. void * paraw = iv::modulecomm::RegisterRecv(gstr_memname,ListenRaw);
  722. }
  723. GPS_Collect::~GPS_Collect()
  724. {
  725. }
  726. //刷新
  727. void GPS_Collect::paintEvent(QPaintEvent *)
  728. {
  729. if(pointf.isEmpty()){
  730. return;
  731. }
  732. painter->begin(image);
  733. image->fill(QColor(255, 255, 255));//对画布进行填充
  734. // std::vector<iv::GPSData> navigation_data = brain->navigation_data;
  735. painter->setRenderHint(QPainter::Antialiasing, true);//设置反锯齿模式,好看一点
  736. QPixmap pixmap(":/timerget/timercopy.png");
  737. painter->drawPixmap(468,465,120,120,pixmap);
  738. painter->setWindow(-1060,1060,4040,-4000);
  739. painter->drawLine(-100000,0,100000,0);
  740. painter->drawLine(0,-100000,0,100000);
  741. QPen mypen;
  742. mypen.setColor(Qt::blue);
  743. mypen.setWidth(2);//5 表示点的大小(形状为方形)
  744. painter->setPen(mypen);
  745. QString str;
  746. for(int i=0;i<pointf.size();i++){
  747. painter->drawPoint(map_coefficient*(pointf[i].x()-pointf[0].x()),map_coefficient*(pointf[i].y()-pointf[0].y()));
  748. //qDebug()<<(map_coefficient*(pointf[i].x()-pointf[0].x()));
  749. // qDebug()<<(map_coefficient*pointf[0].x());
  750. // qDebug()<<pointf[i];
  751. }
  752. painter->end();
  753. scene->clear();
  754. scene->addPixmap(QPixmap::fromImage(*image));
  755. myview->setScene(scene);
  756. myview->show();
  757. }
  758. void GPS_Collect::savestabuyEditinfo(const QString &txt)
  759. {
  760. jianju = txt.toDouble();
  761. if (jianju > 0.01)
  762. {
  763. sensor_gps->jianju_change(jianju);
  764. }
  765. }
  766. void GPS_Collect::mycombox(const QString &txt)
  767. {
  768. if (txt == QStringLiteral(" 禁用"))
  769. {
  770. is_forbidden = true;
  771. }
  772. else
  773. {
  774. is_forbidden = false;
  775. }
  776. sensor_gps->collect_modechange(is_forbidden);
  777. }
  778. void GPS_Collect::mycombox_2(const QString &txt){
  779. //road_width=txt.toInt();
  780. road_width = txt.toDouble();
  781. qDebug()<<"road_width"<<road_width<<endl;
  782. }
  783. void GPS_Collect::timeoutslot1()
  784. {
  785. update();
  786. }
  787. void GPS_Collect::timeoutslot2()
  788. {
  789. lineEdit_2->setText(QString::number(ServiceCarStatus.location->gps_lng));
  790. lineEdit_3->setText(QString::number(ServiceCarStatus.location->gps_lat));
  791. lineEdit_4->setText(QString::number(sensor_gps->gps_index));
  792. lineEdit_5->setText(QString::number(obs_modes));
  793. lineEdit_6->setText(QString::number(speed_modes));
  794. lineEdit_7->setText(QString::number(lane_num));
  795. lineEdit_8->setText(QString::number(lane_status));
  796. }
  797. void GPS_Collect::timeoutslot3(){
  798. double xxx, yyy;
  799. coutt++;
  800. //xxx=205.1234567123456-0;
  801. //yyy=205.1234567123456-0;
  802. xxx=ServiceCarStatus.location->gps_x;
  803. yyy=ServiceCarStatus.location->gps_y;
  804. if((xxx==0)&&(yyy==0)){return;};
  805. //qDebug() << xxx;
  806. //qDebug()<< ServiceCarStatus.location->gps_x;
  807. pointf_t.setX(xxx);
  808. pointf_t.setY(yyy);
  809. // mutex1.lock();
  810. pointf.push_back(pointf_t);
  811. // mutex1.unlock();
  812. // qDebug() << pointf_t.x();
  813. }
  814. void GPS_Collect::ClickButton_start()
  815. {
  816. starts = true;
  817. sensor_gps->start_or_end(starts);
  818. pointf.clear();
  819. this->paintEvent(NULL);
  820. /*if(clicked_start==true){
  821. pushButtonstart->setStyleSheet("background-color: green");
  822. clicked_start=false;
  823. }else{
  824. pushButtonstart->setStyleSheet("background-color: white");
  825. clicked_start=true;
  826. }*/
  827. pushButtonstart->setStyleSheet("background-color: green");
  828. pushButtonend->setStyleSheet("background-color: white");
  829. clicked_end=true;
  830. }
  831. void GPS_Collect::ClickButton_end()
  832. {
  833. starts = false;
  834. sensor_gps->start_or_end(starts);
  835. /*if(clicked_end==true){
  836. pushButtonend->setStyleSheet("background-color: green");
  837. clicked_end=false;
  838. }else{
  839. pushButtonend->setStyleSheet("background-color: white");
  840. clicked_end=true;
  841. }*/
  842. pushButtonend->setStyleSheet("background-color: green");
  843. pushButton0->setStyleSheet("background-color: white");
  844. pushButton1->setStyleSheet("background-color: white");
  845. pushButton2->setStyleSheet("background-color: white");
  846. pushButton3->setStyleSheet("background-color: white");
  847. pushButton4->setStyleSheet("background-color: white");
  848. pushButton5->setStyleSheet("background-color: white");
  849. pushButton6->setStyleSheet("background-color: white");
  850. pushButton7->setStyleSheet("background-color: white");
  851. pushButton8->setStyleSheet("background-color: white");
  852. pushButton9->setStyleSheet("background-color: white");
  853. pushButton10->setStyleSheet("background-color: white");
  854. pushButton11->setStyleSheet("background-color: white");
  855. pushButton12->setStyleSheet("background-color: white");
  856. pushButton13->setStyleSheet("background-color: white");
  857. pushButton14->setStyleSheet("background-color: white");
  858. pushButton15->setStyleSheet("background-color: white");
  859. pushButton16->setStyleSheet("background-color: white");
  860. pushButton17->setStyleSheet("background-color: white");
  861. pushButton18->setStyleSheet("background-color: white");
  862. pushButton19->setStyleSheet("background-color: white");
  863. pushButton20->setStyleSheet("background-color: white");
  864. pushButton21->setStyleSheet("background-color: white");
  865. pushButton22->setStyleSheet("background-color: white");
  866. pushButton23->setStyleSheet("background-color: white");
  867. pushButton24->setStyleSheet("background-color: white");
  868. pushButton25->setStyleSheet("background-color: white");
  869. pushButton26->setStyleSheet("background-color: white");
  870. pushButton27->setStyleSheet("background-color: white");
  871. pushButton28->setStyleSheet("background-color: white");
  872. pushButton29->setStyleSheet("background-color: white");
  873. pushButton30->setStyleSheet("background-color: white");
  874. pushButton31->setStyleSheet("background-color: white");
  875. pushButton32->setStyleSheet("background-color: white");
  876. pushButton33->setStyleSheet("background-color: white");
  877. pushButton34->setStyleSheet("background-color: white");
  878. pushButtonstart->setStyleSheet("background-color: white");
  879. clicked_0=true;
  880. clicked_1=true;
  881. clicked_2=true;
  882. clicked_3=true;
  883. clicked_4=true;
  884. clicked_5=true;
  885. clicked_6=true;
  886. clicked_7=true;
  887. clicked_8=true;
  888. clicked_9=true;
  889. clicked_10=true;
  890. clicked_11=true;
  891. clicked_12=true;
  892. clicked_13=true;
  893. clicked_14=true;
  894. clicked_15=true;
  895. clicked_16=true;
  896. clicked_17=true;
  897. clicked_18=true;
  898. clicked_19=true;
  899. clicked_20=true;
  900. clicked_21=true;
  901. clicked_22=true;
  902. clicked_23=true;
  903. clicked_24=true;
  904. clicked_25=true;
  905. clicked_26=true;
  906. clicked_27=true;
  907. clicked_28=true;
  908. clicked_29=true;
  909. clicked_30=true;
  910. clicked_31=true;
  911. clicked_32=true;
  912. clicked_33=true;
  913. clicked_34=true;
  914. clicked_start=true;
  915. }
  916. /////////////////////////////////////////////////////
  917. void GPS_Collect::ClickButton_nomall_0()
  918. {
  919. obs_modes = 0;
  920. sensor_gps->obs_modechange(obs_modes);
  921. /*单击自己按钮切换自己按钮颜色
  922. if(clicked_0==true){
  923. pushButton0->setStyleSheet("background-color: green");
  924. clicked_0=false;
  925. }else{
  926. pushButton0->setStyleSheet("background-color: white");
  927. clicked_0=true;
  928. }*/
  929. pushButton0->setStyleSheet("background-color: green");//单击自己按钮,自己按钮一直为绿色一直为绿色
  930. pushButton1->setStyleSheet("background-color: white");//单击自己按钮,改变其他按钮为白色
  931. pushButton2->setStyleSheet("background-color: white");//单击自己按钮,改变其他按钮为白色
  932. pushButton33->setStyleSheet("background-color: white");
  933. pushButton34->setStyleSheet("background-color: white");
  934. clicked_1=true;//单击自己按钮,改变其他按钮为白色
  935. clicked_2=true;//单击自己按钮,改变其他按钮为白色
  936. }
  937. void GPS_Collect::ClickButton_nomall_1()
  938. {
  939. obs_modes = 1;
  940. sensor_gps->obs_modechange(obs_modes);
  941. /* if(clicked_1==true){
  942. pushButton1->setStyleSheet("background-color: green");
  943. clicked_1=false;
  944. }else{
  945. pushButton1->setStyleSheet("background-color: white");
  946. clicked_1=true;
  947. }*/
  948. pushButton1->setStyleSheet("background-color: green");
  949. pushButton0->setStyleSheet("background-color: white");
  950. pushButton2->setStyleSheet("background-color: white");
  951. pushButton33->setStyleSheet("background-color: white");
  952. pushButton34->setStyleSheet("background-color: white");
  953. clicked_0=true;
  954. clicked_2=true;
  955. }
  956. void GPS_Collect::ClickButton_nomall_2()
  957. {
  958. obs_modes = 2;
  959. sensor_gps->obs_modechange(obs_modes);
  960. /*if(clicked_2==true){
  961. pushButton2->setStyleSheet("background-color: green");
  962. clicked_2=false;
  963. }else{
  964. pushButton2->setStyleSheet("background-color: white");
  965. clicked_2=true;
  966. }*/
  967. pushButton2->setStyleSheet("background-color: green");
  968. pushButton0->setStyleSheet("background-color: white");
  969. pushButton1->setStyleSheet("background-color: white");
  970. pushButton33->setStyleSheet("background-color: white");
  971. pushButton34->setStyleSheet("background-color: white");
  972. clicked_0=true;
  973. clicked_1=true;
  974. }
  975. ////////////////////////////////////////////////////////
  976. void GPS_Collect::ClickButton_nomall_3()
  977. {
  978. speed_modes = 0;
  979. sensor_gps->speed_modechange(speed_modes);
  980. /*if(clicked_3==true){
  981. pushButton3->setStyleSheet("background-color: green");
  982. clicked_3=false;
  983. }else{
  984. pushButton3->setStyleSheet("background-color: white");
  985. clicked_3=true;
  986. }*/
  987. pushButton3->setStyleSheet("background-color: green");
  988. pushButton4->setStyleSheet("background-color: white");
  989. pushButton5->setStyleSheet("background-color: white");
  990. pushButton6->setStyleSheet("background-color: white");
  991. pushButton7->setStyleSheet("background-color: white");
  992. pushButton18->setStyleSheet("background-color: white");
  993. pushButton19->setStyleSheet("background-color: white");
  994. pushButton20->setStyleSheet("background-color: white");
  995. pushButton21->setStyleSheet("background-color: white");
  996. pushButton22->setStyleSheet("background-color: white");
  997. pushButton23->setStyleSheet("background-color: white");
  998. pushButton24->setStyleSheet("background-color: white");
  999. pushButton25->setStyleSheet("background-color: white");
  1000. pushButton26->setStyleSheet("background-color: white");
  1001. pushButton27->setStyleSheet("background-color: white");
  1002. pushButton28->setStyleSheet("background-color: white");
  1003. pushButton29->setStyleSheet("background-color: white");
  1004. pushButton30->setStyleSheet("background-color: white");
  1005. pushButton31->setStyleSheet("background-color: white");
  1006. pushButton32->setStyleSheet("background-color: white");
  1007. clicked_5=true;
  1008. clicked_7=true;
  1009. clicked_19=true;
  1010. clicked_21=true;
  1011. clicked_23=true;
  1012. clicked_25=true;
  1013. clicked_27=true;
  1014. clicked_18=true;
  1015. clicked_28=true;
  1016. }
  1017. void GPS_Collect::ClickButton_nomall_4()
  1018. {
  1019. speed_modes = 1;
  1020. sensor_gps->speed_modechange(speed_modes);
  1021. /*if(clicked_4==true){
  1022. pushButton4->setStyleSheet("background-color: green");
  1023. clicked_4=false;
  1024. }else{
  1025. pushButton4->setStyleSheet("background-color: white");
  1026. clicked_4=true;
  1027. }*/
  1028. pushButton4->setStyleSheet("background-color: green");
  1029. pushButton3->setStyleSheet("background-color: white");
  1030. // pushButton4->setStyleSheet("background-color: white");
  1031. pushButton5->setStyleSheet("background-color: white");
  1032. pushButton6->setStyleSheet("background-color: white");
  1033. pushButton7->setStyleSheet("background-color: white");
  1034. pushButton18->setStyleSheet("background-color: white");
  1035. pushButton19->setStyleSheet("background-color: white");
  1036. pushButton20->setStyleSheet("background-color: white");
  1037. pushButton21->setStyleSheet("background-color: white");
  1038. pushButton22->setStyleSheet("background-color: white");
  1039. pushButton23->setStyleSheet("background-color: white");
  1040. pushButton24->setStyleSheet("background-color: white");
  1041. pushButton25->setStyleSheet("background-color: white");
  1042. pushButton26->setStyleSheet("background-color: white");
  1043. pushButton27->setStyleSheet("background-color: white");
  1044. pushButton28->setStyleSheet("background-color: white");
  1045. pushButton29->setStyleSheet("background-color: white");
  1046. pushButton30->setStyleSheet("background-color: white");
  1047. pushButton31->setStyleSheet("background-color: white");
  1048. pushButton32->setStyleSheet("background-color: white");
  1049. clicked_6=true;
  1050. clicked_18=true;
  1051. clicked_20=true;
  1052. clicked_22=true;
  1053. clicked_24=true;
  1054. clicked_26=true;
  1055. clicked_28=true;
  1056. }
  1057. void GPS_Collect::ClickButton_nomall_5()
  1058. {
  1059. speed_modes = 2;
  1060. sensor_gps->speed_modechange(speed_modes);
  1061. /*if(clicked_5==true){
  1062. pushButton5->setStyleSheet("background-color: green");
  1063. clicked_5=false;
  1064. }else{
  1065. pushButton5->setStyleSheet("background-color: white");
  1066. clicked_5=true;
  1067. }*/
  1068. pushButton5->setStyleSheet("background-color: green");
  1069. pushButton3->setStyleSheet("background-color: white");
  1070. pushButton4->setStyleSheet("background-color: white");
  1071. //pushButton5->setStyleSheet("background-color: white");
  1072. pushButton6->setStyleSheet("background-color: white");
  1073. pushButton7->setStyleSheet("background-color: white");
  1074. pushButton18->setStyleSheet("background-color: white");
  1075. pushButton19->setStyleSheet("background-color: white");
  1076. pushButton20->setStyleSheet("background-color: white");
  1077. pushButton21->setStyleSheet("background-color: white");
  1078. pushButton22->setStyleSheet("background-color: white");
  1079. pushButton23->setStyleSheet("background-color: white");
  1080. pushButton24->setStyleSheet("background-color: white");
  1081. pushButton25->setStyleSheet("background-color: white");
  1082. pushButton26->setStyleSheet("background-color: white");
  1083. pushButton27->setStyleSheet("background-color: white");
  1084. pushButton28->setStyleSheet("background-color: white");
  1085. pushButton29->setStyleSheet("background-color: white");
  1086. pushButton30->setStyleSheet("background-color: white");
  1087. pushButton31->setStyleSheet("background-color: white");
  1088. pushButton32->setStyleSheet("background-color: white");
  1089. clicked_3=true;
  1090. clicked_7=true;
  1091. clicked_19=true;
  1092. clicked_21=true;
  1093. clicked_23=true;
  1094. clicked_25=true;
  1095. clicked_27=true;
  1096. }
  1097. void GPS_Collect::ClickButton_nomall_6()
  1098. {
  1099. speed_modes = 3;
  1100. sensor_gps->speed_modechange(speed_modes);
  1101. /* if(clicked_6==true){
  1102. pushButton6->setStyleSheet("background-color: green");
  1103. clicked_6=false;
  1104. }else{
  1105. pushButton6->setStyleSheet("background-color: white");
  1106. clicked_6=true;
  1107. }*/
  1108. pushButton6->setStyleSheet("background-color: green");
  1109. pushButton3->setStyleSheet("background-color: white");
  1110. pushButton4->setStyleSheet("background-color: white");
  1111. pushButton5->setStyleSheet("background-color: white");
  1112. //pushButton6->setStyleSheet("background-color: white");
  1113. pushButton7->setStyleSheet("background-color: white");
  1114. pushButton18->setStyleSheet("background-color: white");
  1115. pushButton19->setStyleSheet("background-color: white");
  1116. pushButton20->setStyleSheet("background-color: white");
  1117. pushButton21->setStyleSheet("background-color: white");
  1118. pushButton22->setStyleSheet("background-color: white");
  1119. pushButton23->setStyleSheet("background-color: white");
  1120. pushButton24->setStyleSheet("background-color: white");
  1121. pushButton25->setStyleSheet("background-color: white");
  1122. pushButton26->setStyleSheet("background-color: white");
  1123. pushButton27->setStyleSheet("background-color: white");
  1124. pushButton28->setStyleSheet("background-color: white");
  1125. pushButton29->setStyleSheet("background-color: white");
  1126. pushButton30->setStyleSheet("background-color: white");
  1127. pushButton31->setStyleSheet("background-color: white");
  1128. pushButton32->setStyleSheet("background-color: white");
  1129. clicked_4=true;
  1130. clicked_18=true;
  1131. clicked_20=true;
  1132. clicked_22=true;
  1133. clicked_24=true;
  1134. clicked_26=true;
  1135. clicked_28=true;
  1136. }
  1137. void GPS_Collect::ClickButton_nomall_7()
  1138. {
  1139. speed_modes = 4;
  1140. sensor_gps->speed_modechange(speed_modes);
  1141. /*if(clicked_7==true){
  1142. pushButton7->setStyleSheet("background-color: green");
  1143. clicked_7=false;
  1144. }else{
  1145. pushButton7->setStyleSheet("background-color: white");
  1146. clicked_7=true;
  1147. }*/
  1148. pushButton7->setStyleSheet("background-color: green");
  1149. pushButton3->setStyleSheet("background-color: white");
  1150. pushButton4->setStyleSheet("background-color: white");
  1151. pushButton5->setStyleSheet("background-color: white");
  1152. pushButton6->setStyleSheet("background-color: white");
  1153. //pushButton7->setStyleSheet("background-color: white");
  1154. pushButton18->setStyleSheet("background-color: white");
  1155. pushButton19->setStyleSheet("background-color: white");
  1156. pushButton20->setStyleSheet("background-color: white");
  1157. pushButton21->setStyleSheet("background-color: white");
  1158. pushButton22->setStyleSheet("background-color: white");
  1159. pushButton23->setStyleSheet("background-color: white");
  1160. pushButton24->setStyleSheet("background-color: white");
  1161. pushButton25->setStyleSheet("background-color: white");
  1162. pushButton26->setStyleSheet("background-color: white");
  1163. pushButton27->setStyleSheet("background-color: white");
  1164. pushButton28->setStyleSheet("background-color: white");
  1165. pushButton29->setStyleSheet("background-color: white");
  1166. pushButton30->setStyleSheet("background-color: white");
  1167. pushButton31->setStyleSheet("background-color: white");
  1168. pushButton32->setStyleSheet("background-color: white");
  1169. clicked_5=true;
  1170. clicked_3=true;
  1171. clicked_19=true;
  1172. clicked_21=true;
  1173. clicked_23=true;
  1174. clicked_25=true;
  1175. clicked_27=true;
  1176. pushButton18->setStyleSheet("background-color: white");
  1177. pushButton28->setStyleSheet("background-color: white");
  1178. clicked_18=true;
  1179. clicked_28=true;
  1180. }
  1181. /////////////////////////////////////////////////////////
  1182. void GPS_Collect::ClickButton_nomall_8()
  1183. {
  1184. lane_num = 1;
  1185. sensor_gps->lane_num_modechange(lane_num);
  1186. /*if(clicked_8==true){
  1187. pushButton8->setStyleSheet("background-color: green");
  1188. clicked_8=false;
  1189. }else{
  1190. pushButton8->setStyleSheet("background-color: white");
  1191. clicked_8=true;
  1192. }*/
  1193. pushButton8->setStyleSheet("background-color: green");
  1194. pushButton9->setStyleSheet("background-color: white");
  1195. pushButton10->setStyleSheet("background-color: white");
  1196. pushButton11->setStyleSheet("background-color: white");
  1197. pushButton12->setStyleSheet("background-color: white");
  1198. clicked_9=true;
  1199. clicked_10=true;
  1200. clicked_11=true;
  1201. clicked_12=true;
  1202. }
  1203. void GPS_Collect::ClickButton_nomall_9()
  1204. {
  1205. lane_num = 2;
  1206. sensor_gps->lane_num_modechange(lane_num);
  1207. /* if(clicked_9==true){
  1208. pushButton9->setStyleSheet("background-color: green");
  1209. clicked_9=false;
  1210. }else{
  1211. pushButton9->setStyleSheet("background-color: white");
  1212. clicked_9=true;
  1213. }*/
  1214. pushButton9->setStyleSheet("background-color: green");
  1215. pushButton8->setStyleSheet("background-color: white");
  1216. pushButton10->setStyleSheet("background-color: white");
  1217. pushButton11->setStyleSheet("background-color: white");
  1218. pushButton12->setStyleSheet("background-color: white");
  1219. clicked_8=true;
  1220. clicked_10=true;
  1221. clicked_11=true;
  1222. clicked_12=true;
  1223. }
  1224. void GPS_Collect::ClickButton_nomall_10()
  1225. {
  1226. lane_num = 3;
  1227. sensor_gps->lane_num_modechange(lane_num);
  1228. /*if(clicked_10==true){
  1229. pushButton10->setStyleSheet("background-color: green");
  1230. clicked_10=false;
  1231. }else{
  1232. pushButton10->setStyleSheet("background-color: white");
  1233. clicked_10=true;
  1234. }*/
  1235. pushButton10->setStyleSheet("background-color: green");
  1236. pushButton9->setStyleSheet("background-color: white");
  1237. pushButton8->setStyleSheet("background-color: white");
  1238. pushButton11->setStyleSheet("background-color: white");
  1239. pushButton12->setStyleSheet("background-color: white");
  1240. clicked_9=true;
  1241. clicked_8=true;
  1242. clicked_11=true;
  1243. clicked_12=true;
  1244. }
  1245. void GPS_Collect::ClickButton_nomall_11()
  1246. {
  1247. lane_num = 4;
  1248. sensor_gps->lane_num_modechange(lane_num);
  1249. /*if(clicked_11==true){
  1250. pushButton11->setStyleSheet("background-color: green");
  1251. clicked_11=false;
  1252. }else{
  1253. pushButton11->setStyleSheet("background-color: white");
  1254. clicked_11=true;
  1255. }*/
  1256. pushButton11->setStyleSheet("background-color: green");
  1257. pushButton9->setStyleSheet("background-color: white");
  1258. pushButton10->setStyleSheet("background-color: white");
  1259. pushButton8->setStyleSheet("background-color: white");
  1260. pushButton12->setStyleSheet("background-color: white");
  1261. clicked_9=true;
  1262. clicked_10=true;
  1263. clicked_8=true;
  1264. clicked_12=true;
  1265. }
  1266. void GPS_Collect::ClickButton_nomall_12()
  1267. {
  1268. lane_num = 5;
  1269. sensor_gps->lane_num_modechange(lane_num);
  1270. /*if(clicked_12==true){
  1271. pushButton12->setStyleSheet("background-color: green");
  1272. clicked_12=false;
  1273. }else{
  1274. pushButton12->setStyleSheet("background-color: white");
  1275. clicked_12=true;
  1276. }*/
  1277. pushButton12->setStyleSheet("background-color: green");
  1278. pushButton9->setStyleSheet("background-color: white");
  1279. pushButton10->setStyleSheet("background-color: white");
  1280. pushButton11->setStyleSheet("background-color: white");
  1281. pushButton8->setStyleSheet("background-color: white");
  1282. clicked_9=true;
  1283. clicked_10=true;
  1284. clicked_11=true;
  1285. clicked_8=true;
  1286. }
  1287. //////////////////////////////////////////////////////////
  1288. void GPS_Collect::ClickButton_nomall_13()
  1289. {
  1290. lane_status = 0;
  1291. sensor_gps->lane_status_modechange(lane_status);
  1292. /*if(clicked_13==true){
  1293. pushButton13->setStyleSheet("background-color: green");
  1294. clicked_13=false;
  1295. }else{
  1296. pushButton13->setStyleSheet("background-color: white");
  1297. clicked_13=true;
  1298. }*/
  1299. pushButton13->setStyleSheet("background-color: green");
  1300. pushButton14->setStyleSheet("background-color: white");
  1301. pushButton15->setStyleSheet("background-color: white");
  1302. pushButton16->setStyleSheet("background-color: white");
  1303. pushButton17->setStyleSheet("background-color: white");
  1304. clicked_14=true;
  1305. clicked_15=true;
  1306. clicked_16=true;
  1307. clicked_17=true;
  1308. }
  1309. void GPS_Collect::ClickButton_nomall_14()
  1310. {
  1311. lane_status = 1;
  1312. sensor_gps->lane_status_modechange(lane_status);
  1313. /*if(clicked_14==true){
  1314. pushButton14->setStyleSheet("background-color: green");
  1315. clicked_14=false;
  1316. }else{
  1317. pushButton14->setStyleSheet("background-color: white");
  1318. clicked_14=true;
  1319. }*/
  1320. pushButton14->setStyleSheet("background-color: green");
  1321. pushButton13->setStyleSheet("background-color: white");
  1322. pushButton15->setStyleSheet("background-color: white");
  1323. pushButton16->setStyleSheet("background-color: white");
  1324. pushButton17->setStyleSheet("background-color: white");
  1325. clicked_13=true;
  1326. clicked_15=true;
  1327. clicked_16=true;
  1328. clicked_17=true;
  1329. }
  1330. void GPS_Collect::ClickButton_nomall_15()
  1331. {
  1332. lane_status = 2;
  1333. sensor_gps->lane_status_modechange(lane_status);
  1334. /*if(clicked_15==true){
  1335. pushButton15->setStyleSheet("background-color: green");
  1336. clicked_15=false;
  1337. }else{
  1338. pushButton15->setStyleSheet("background-color: white");
  1339. clicked_15=true;
  1340. }*/
  1341. pushButton15->setStyleSheet("background-color: green");
  1342. pushButton14->setStyleSheet("background-color: white");
  1343. pushButton13->setStyleSheet("background-color: white");
  1344. pushButton16->setStyleSheet("background-color: white");
  1345. pushButton17->setStyleSheet("background-color: white");
  1346. clicked_14=true;
  1347. clicked_13=true;
  1348. clicked_16=true;
  1349. clicked_17=true;
  1350. }
  1351. void GPS_Collect::ClickButton_nomall_16()
  1352. {
  1353. lane_status = 3;
  1354. sensor_gps->lane_status_modechange(lane_status);
  1355. /*if(clicked_16==true){
  1356. pushButton16->setStyleSheet("background-color: green");
  1357. clicked_16=false;
  1358. }else{
  1359. pushButton16->setStyleSheet("background-color: white");
  1360. clicked_16=true;
  1361. }*/
  1362. pushButton16->setStyleSheet("background-color: green");
  1363. pushButton14->setStyleSheet("background-color: white");
  1364. pushButton15->setStyleSheet("background-color: white");
  1365. pushButton13->setStyleSheet("background-color: white");
  1366. pushButton17->setStyleSheet("background-color: white");
  1367. clicked_14=true;
  1368. clicked_15=true;
  1369. clicked_13=true;
  1370. clicked_17=true;
  1371. }
  1372. void GPS_Collect::ClickButton_nomall_17()
  1373. {
  1374. lane_status = 4;
  1375. sensor_gps->lane_status_modechange(lane_status);
  1376. /*if(clicked_17==true){
  1377. pushButton17->setStyleSheet("background-color: green");
  1378. clicked_17=false;
  1379. }else{
  1380. pushButton17->setStyleSheet("background-color: white");
  1381. clicked_17=true;
  1382. }*/
  1383. pushButton17->setStyleSheet("background-color: green");
  1384. pushButton14->setStyleSheet("background-color: white");
  1385. pushButton15->setStyleSheet("background-color: white");
  1386. pushButton16->setStyleSheet("background-color: white");
  1387. pushButton13->setStyleSheet("background-color: white");
  1388. clicked_14=true;
  1389. clicked_15=true;
  1390. clicked_16=true;
  1391. clicked_13=true;
  1392. }
  1393. /////////////////////////////////////////////////////////
  1394. void GPS_Collect::ClickButton_nomall_18()
  1395. {
  1396. speed_modes = 5;
  1397. sensor_gps->speed_modechange(speed_modes);
  1398. /*if(clicked_18==true){
  1399. pushButton18->setStyleSheet("background-color: green");
  1400. clicked_18=false;
  1401. }else{
  1402. pushButton18->setStyleSheet("background-color: white");
  1403. clicked_18=true;
  1404. }*/
  1405. pushButton18->setStyleSheet("background-color: green");
  1406. pushButton3->setStyleSheet("background-color: white");
  1407. pushButton4->setStyleSheet("background-color: white");
  1408. pushButton5->setStyleSheet("background-color: white");
  1409. pushButton6->setStyleSheet("background-color: white");
  1410. pushButton7->setStyleSheet("background-color: white");
  1411. //pushButton18->setStyleSheet("background-color: white");
  1412. pushButton19->setStyleSheet("background-color: white");
  1413. pushButton20->setStyleSheet("background-color: white");
  1414. pushButton21->setStyleSheet("background-color: white");
  1415. pushButton22->setStyleSheet("background-color: white");
  1416. pushButton23->setStyleSheet("background-color: white");
  1417. pushButton24->setStyleSheet("background-color: white");
  1418. pushButton25->setStyleSheet("background-color: white");
  1419. pushButton26->setStyleSheet("background-color: white");
  1420. pushButton27->setStyleSheet("background-color: white");
  1421. pushButton28->setStyleSheet("background-color: white");
  1422. pushButton29->setStyleSheet("background-color: white");
  1423. pushButton30->setStyleSheet("background-color: white");
  1424. pushButton31->setStyleSheet("background-color: white");
  1425. pushButton32->setStyleSheet("background-color: white");
  1426. clicked_5=true;
  1427. clicked_7=true;
  1428. clicked_19=true;
  1429. clicked_21=true;
  1430. clicked_23=true;
  1431. clicked_25=true;
  1432. clicked_3=true;
  1433. clicked_27=true;
  1434. }
  1435. void GPS_Collect::ClickButton_nomall_19()
  1436. {
  1437. speed_modes = 6;
  1438. sensor_gps->speed_modechange(speed_modes);
  1439. /*if(clicked_19==true){
  1440. pushButton19->setStyleSheet("background-color: green");
  1441. clicked_19=false;
  1442. }else{
  1443. pushButton19->setStyleSheet("background-color: white");
  1444. clicked_19=true;
  1445. }*/
  1446. pushButton19->setStyleSheet("background-color: green");
  1447. pushButton3->setStyleSheet("background-color: white");
  1448. pushButton4->setStyleSheet("background-color: white");
  1449. pushButton5->setStyleSheet("background-color: white");
  1450. pushButton6->setStyleSheet("background-color: white");
  1451. pushButton7->setStyleSheet("background-color: white");
  1452. pushButton18->setStyleSheet("background-color: white");
  1453. //pushButton19->setStyleSheet("background-color: white");
  1454. pushButton20->setStyleSheet("background-color: white");
  1455. pushButton21->setStyleSheet("background-color: white");
  1456. pushButton22->setStyleSheet("background-color: white");
  1457. pushButton23->setStyleSheet("background-color: white");
  1458. pushButton24->setStyleSheet("background-color: white");
  1459. pushButton25->setStyleSheet("background-color: white");
  1460. pushButton26->setStyleSheet("background-color: white");
  1461. pushButton27->setStyleSheet("background-color: white");
  1462. pushButton28->setStyleSheet("background-color: white");
  1463. pushButton29->setStyleSheet("background-color: white");
  1464. pushButton30->setStyleSheet("background-color: white");
  1465. pushButton31->setStyleSheet("background-color: white");
  1466. pushButton32->setStyleSheet("background-color: white");
  1467. }
  1468. void GPS_Collect::ClickButton_nomall_20()
  1469. {
  1470. speed_modes = 7;
  1471. sensor_gps->speed_modechange(speed_modes);
  1472. /*if(clicked_20==true){
  1473. pushButton20->setStyleSheet("background-color: green");
  1474. clicked_20=false;
  1475. }else{
  1476. pushButton20->setStyleSheet("background-color: white");
  1477. clicked_20=true;
  1478. }*/
  1479. pushButton20->setStyleSheet("background-color: green");
  1480. pushButton3->setStyleSheet("background-color: white");
  1481. pushButton4->setStyleSheet("background-color: white");
  1482. pushButton5->setStyleSheet("background-color: white");
  1483. pushButton6->setStyleSheet("background-color: white");
  1484. pushButton7->setStyleSheet("background-color: white");
  1485. pushButton18->setStyleSheet("background-color: white");
  1486. pushButton19->setStyleSheet("background-color: white");
  1487. //pushButton20->setStyleSheet("background-color: white");
  1488. pushButton21->setStyleSheet("background-color: white");
  1489. pushButton22->setStyleSheet("background-color: white");
  1490. pushButton23->setStyleSheet("background-color: white");
  1491. pushButton24->setStyleSheet("background-color: white");
  1492. pushButton25->setStyleSheet("background-color: white");
  1493. pushButton26->setStyleSheet("background-color: white");
  1494. pushButton27->setStyleSheet("background-color: white");
  1495. pushButton28->setStyleSheet("background-color: white");
  1496. pushButton29->setStyleSheet("background-color: white");
  1497. pushButton30->setStyleSheet("background-color: white");
  1498. pushButton31->setStyleSheet("background-color: white");
  1499. pushButton32->setStyleSheet("background-color: white");
  1500. }
  1501. void GPS_Collect::ClickButton_nomall_21()
  1502. {
  1503. speed_modes = 8;
  1504. sensor_gps->speed_modechange(speed_modes);
  1505. /*if(clicked_21==true){
  1506. pushButton21->setStyleSheet("background-color: green");
  1507. clicked_21=false;
  1508. }else{
  1509. pushButton21->setStyleSheet("background-color: white");
  1510. clicked_21=true;
  1511. }*/
  1512. pushButton21->setStyleSheet("background-color: green");
  1513. pushButton3->setStyleSheet("background-color: white");
  1514. pushButton4->setStyleSheet("background-color: white");
  1515. pushButton5->setStyleSheet("background-color: white");
  1516. pushButton6->setStyleSheet("background-color: white");
  1517. pushButton7->setStyleSheet("background-color: white");
  1518. pushButton18->setStyleSheet("background-color: white");
  1519. pushButton19->setStyleSheet("background-color: white");
  1520. pushButton20->setStyleSheet("background-color: white");
  1521. //pushButton21->setStyleSheet("background-color: white");
  1522. pushButton22->setStyleSheet("background-color: white");
  1523. pushButton23->setStyleSheet("background-color: white");
  1524. pushButton24->setStyleSheet("background-color: white");
  1525. pushButton25->setStyleSheet("background-color: white");
  1526. pushButton26->setStyleSheet("background-color: white");
  1527. pushButton27->setStyleSheet("background-color: white");
  1528. pushButton28->setStyleSheet("background-color: white");
  1529. pushButton29->setStyleSheet("background-color: white");
  1530. pushButton30->setStyleSheet("background-color: white");
  1531. pushButton31->setStyleSheet("background-color: white");
  1532. pushButton32->setStyleSheet("background-color: white");
  1533. }
  1534. void GPS_Collect::ClickButton_nomall_22()
  1535. {
  1536. speed_modes = 9;
  1537. sensor_gps->speed_modechange(speed_modes);
  1538. /*if(clicked_22==true){
  1539. pushButton22->setStyleSheet("background-color: green");
  1540. clicked_22=false;
  1541. }else{
  1542. pushButton22->setStyleSheet("background-color: white");
  1543. clicked_22=true;
  1544. }*/
  1545. pushButton22->setStyleSheet("background-color: green");
  1546. pushButton3->setStyleSheet("background-color: white");
  1547. pushButton4->setStyleSheet("background-color: white");
  1548. pushButton5->setStyleSheet("background-color: white");
  1549. pushButton6->setStyleSheet("background-color: white");
  1550. pushButton7->setStyleSheet("background-color: white");
  1551. pushButton18->setStyleSheet("background-color: white");
  1552. pushButton19->setStyleSheet("background-color: white");
  1553. pushButton20->setStyleSheet("background-color: white");
  1554. pushButton21->setStyleSheet("background-color: white");
  1555. //pushButton22->setStyleSheet("background-color: white");
  1556. pushButton23->setStyleSheet("background-color: white");
  1557. pushButton24->setStyleSheet("background-color: white");
  1558. pushButton25->setStyleSheet("background-color: white");
  1559. pushButton26->setStyleSheet("background-color: white");
  1560. pushButton27->setStyleSheet("background-color: white");
  1561. pushButton28->setStyleSheet("background-color: white");
  1562. pushButton29->setStyleSheet("background-color: white");
  1563. pushButton30->setStyleSheet("background-color: white");
  1564. pushButton31->setStyleSheet("background-color: white");
  1565. pushButton32->setStyleSheet("background-color: white");
  1566. }
  1567. void GPS_Collect::ClickButton_nomall_23()
  1568. {
  1569. speed_modes = 10;
  1570. sensor_gps->speed_modechange(speed_modes);
  1571. /*if(clicked_23==true){
  1572. pushButton23->setStyleSheet("background-color: green");
  1573. clicked_23=false;
  1574. }else{
  1575. pushButton23->setStyleSheet("background-color: white");
  1576. clicked_23=true;
  1577. }*/
  1578. pushButton23->setStyleSheet("background-color: green");
  1579. pushButton3->setStyleSheet("background-color: white");
  1580. pushButton4->setStyleSheet("background-color: white");
  1581. pushButton5->setStyleSheet("background-color: white");
  1582. pushButton6->setStyleSheet("background-color: white");
  1583. pushButton7->setStyleSheet("background-color: white");
  1584. pushButton18->setStyleSheet("background-color: white");
  1585. pushButton19->setStyleSheet("background-color: white");
  1586. pushButton20->setStyleSheet("background-color: white");
  1587. pushButton21->setStyleSheet("background-color: white");
  1588. pushButton22->setStyleSheet("background-color: white");
  1589. //pushButton23->setStyleSheet("background-color: white");
  1590. pushButton24->setStyleSheet("background-color: white");
  1591. pushButton25->setStyleSheet("background-color: white");
  1592. pushButton26->setStyleSheet("background-color: white");
  1593. pushButton27->setStyleSheet("background-color: white");
  1594. pushButton28->setStyleSheet("background-color: white");
  1595. pushButton29->setStyleSheet("background-color: white");
  1596. pushButton30->setStyleSheet("background-color: white");
  1597. pushButton31->setStyleSheet("background-color: white");
  1598. pushButton32->setStyleSheet("background-color: white");
  1599. }
  1600. void GPS_Collect::ClickButton_nomall_24()
  1601. {
  1602. speed_modes = 11;
  1603. sensor_gps->speed_modechange(speed_modes);
  1604. /*if(clicked_24==true){
  1605. pushButton24->setStyleSheet("background-color: green");
  1606. clicked_24=false;
  1607. }else{
  1608. pushButton24->setStyleSheet("background-color: white");
  1609. clicked_24=true;
  1610. }*/
  1611. pushButton24->setStyleSheet("background-color: green");
  1612. pushButton3->setStyleSheet("background-color: white");
  1613. pushButton4->setStyleSheet("background-color: white");
  1614. pushButton5->setStyleSheet("background-color: white");
  1615. pushButton6->setStyleSheet("background-color: white");
  1616. pushButton7->setStyleSheet("background-color: white");
  1617. pushButton18->setStyleSheet("background-color: white");
  1618. pushButton19->setStyleSheet("background-color: white");
  1619. pushButton20->setStyleSheet("background-color: white");
  1620. pushButton21->setStyleSheet("background-color: white");
  1621. pushButton22->setStyleSheet("background-color: white");
  1622. pushButton23->setStyleSheet("background-color: white");
  1623. //pushButton24->setStyleSheet("background-color: white");
  1624. pushButton25->setStyleSheet("background-color: white");
  1625. pushButton26->setStyleSheet("background-color: white");
  1626. pushButton27->setStyleSheet("background-color: white");
  1627. pushButton28->setStyleSheet("background-color: white");
  1628. pushButton29->setStyleSheet("background-color: white");
  1629. pushButton30->setStyleSheet("background-color: white");
  1630. pushButton31->setStyleSheet("background-color: white");
  1631. pushButton32->setStyleSheet("background-color: white");
  1632. }
  1633. void GPS_Collect::ClickButton_nomall_25()
  1634. {
  1635. speed_modes = 12;
  1636. sensor_gps->speed_modechange(speed_modes);
  1637. /* if(clicked_25==true){
  1638. pushButton25->setStyleSheet("background-color: green");
  1639. clicked_25=false;
  1640. }else{
  1641. pushButton25->setStyleSheet("background-color: white");
  1642. clicked_25=true;
  1643. }*/
  1644. pushButton25->setStyleSheet("background-color: green");
  1645. pushButton3->setStyleSheet("background-color: white");
  1646. pushButton4->setStyleSheet("background-color: white");
  1647. pushButton5->setStyleSheet("background-color: white");
  1648. pushButton6->setStyleSheet("background-color: white");
  1649. pushButton7->setStyleSheet("background-color: white");
  1650. pushButton18->setStyleSheet("background-color: white");
  1651. pushButton19->setStyleSheet("background-color: white");
  1652. pushButton20->setStyleSheet("background-color: white");
  1653. pushButton21->setStyleSheet("background-color: white");
  1654. pushButton22->setStyleSheet("background-color: white");
  1655. pushButton23->setStyleSheet("background-color: white");
  1656. pushButton24->setStyleSheet("background-color: white");
  1657. //pushButton25->setStyleSheet("background-color: white");
  1658. pushButton26->setStyleSheet("background-color: white");
  1659. pushButton27->setStyleSheet("background-color: white");
  1660. pushButton28->setStyleSheet("background-color: white");
  1661. pushButton29->setStyleSheet("background-color: white");
  1662. pushButton30->setStyleSheet("background-color: white");
  1663. pushButton31->setStyleSheet("background-color: white");
  1664. pushButton32->setStyleSheet("background-color: white");
  1665. }
  1666. void GPS_Collect::ClickButton_nomall_26()
  1667. {
  1668. speed_modes = 13;
  1669. sensor_gps->speed_modechange(speed_modes);
  1670. /*if(clicked_26==true){
  1671. pushButton26->setStyleSheet("background-color: green");
  1672. clicked_26=false;
  1673. }else{
  1674. pushButton26->setStyleSheet("background-color: white");
  1675. clicked_26=true;
  1676. }*/
  1677. pushButton26->setStyleSheet("background-color: green");
  1678. pushButton3->setStyleSheet("background-color: white");
  1679. pushButton4->setStyleSheet("background-color: white");
  1680. pushButton5->setStyleSheet("background-color: white");
  1681. pushButton6->setStyleSheet("background-color: white");
  1682. pushButton7->setStyleSheet("background-color: white");
  1683. pushButton18->setStyleSheet("background-color: white");
  1684. pushButton19->setStyleSheet("background-color: white");
  1685. pushButton20->setStyleSheet("background-color: white");
  1686. pushButton21->setStyleSheet("background-color: white");
  1687. pushButton22->setStyleSheet("background-color: white");
  1688. pushButton23->setStyleSheet("background-color: white");
  1689. pushButton24->setStyleSheet("background-color: white");
  1690. pushButton25->setStyleSheet("background-color: white");
  1691. //pushButton26->setStyleSheet("background-color: white");
  1692. pushButton27->setStyleSheet("background-color: white");
  1693. pushButton28->setStyleSheet("background-color: white");
  1694. pushButton29->setStyleSheet("background-color: white");
  1695. pushButton30->setStyleSheet("background-color: white");
  1696. pushButton31->setStyleSheet("background-color: white");
  1697. pushButton32->setStyleSheet("background-color: white");
  1698. }
  1699. void GPS_Collect::ClickButton_nomall_27()
  1700. {
  1701. speed_modes = 14;
  1702. sensor_gps->speed_modechange(speed_modes);
  1703. /*if(clicked_27==true){
  1704. pushButton27->setStyleSheet("background-color: green");
  1705. clicked_27=false;
  1706. }else{
  1707. pushButton27->setStyleSheet("background-color: white");
  1708. clicked_27=true;
  1709. }*/
  1710. pushButton27->setStyleSheet("background-color: green");
  1711. pushButton3->setStyleSheet("background-color: white");
  1712. pushButton4->setStyleSheet("background-color: white");
  1713. pushButton5->setStyleSheet("background-color: white");
  1714. pushButton6->setStyleSheet("background-color: white");
  1715. pushButton7->setStyleSheet("background-color: white");
  1716. pushButton18->setStyleSheet("background-color: white");
  1717. pushButton19->setStyleSheet("background-color: white");
  1718. pushButton20->setStyleSheet("background-color: white");
  1719. pushButton21->setStyleSheet("background-color: white");
  1720. pushButton22->setStyleSheet("background-color: white");
  1721. pushButton23->setStyleSheet("background-color: white");
  1722. pushButton24->setStyleSheet("background-color: white");
  1723. pushButton25->setStyleSheet("background-color: white");
  1724. pushButton26->setStyleSheet("background-color: white");
  1725. //pushButton27->setStyleSheet("background-color: white");
  1726. pushButton28->setStyleSheet("background-color: white");
  1727. pushButton29->setStyleSheet("background-color: white");
  1728. pushButton30->setStyleSheet("background-color: white");
  1729. pushButton31->setStyleSheet("background-color: white");
  1730. pushButton32->setStyleSheet("background-color: white");
  1731. }
  1732. void GPS_Collect::ClickButton_nomall_28()
  1733. {
  1734. speed_modes = 15;
  1735. sensor_gps->speed_modechange(speed_modes);
  1736. /*if(clicked_28==true){
  1737. pushButton28->setStyleSheet("background-color: green");
  1738. clicked_28=false;
  1739. }else{
  1740. pushButton28->setStyleSheet("background-color: white");
  1741. clicked_28=true;
  1742. }*/
  1743. pushButton28->setStyleSheet("background-color: green");
  1744. pushButton3->setStyleSheet("background-color: white");
  1745. pushButton4->setStyleSheet("background-color: white");
  1746. pushButton5->setStyleSheet("background-color: white");
  1747. pushButton6->setStyleSheet("background-color: white");
  1748. pushButton7->setStyleSheet("background-color: white");
  1749. pushButton18->setStyleSheet("background-color: white");
  1750. pushButton19->setStyleSheet("background-color: white");
  1751. pushButton20->setStyleSheet("background-color: white");
  1752. pushButton21->setStyleSheet("background-color: white");
  1753. pushButton22->setStyleSheet("background-color: white");
  1754. pushButton23->setStyleSheet("background-color: white");
  1755. pushButton24->setStyleSheet("background-color: white");
  1756. pushButton25->setStyleSheet("background-color: white");
  1757. pushButton26->setStyleSheet("background-color: white");
  1758. pushButton27->setStyleSheet("background-color: white");
  1759. //pushButton28->setStyleSheet("background-color: white");
  1760. pushButton29->setStyleSheet("background-color: white");
  1761. pushButton30->setStyleSheet("background-color: white");
  1762. pushButton31->setStyleSheet("background-color: white");
  1763. pushButton32->setStyleSheet("background-color: white");
  1764. }
  1765. void GPS_Collect::ClickButton_nomall_29()
  1766. {
  1767. speed_modes = 16;
  1768. sensor_gps->speed_modechange(speed_modes);
  1769. /*if(clicked_29==true){
  1770. pushButton29->setStyleSheet("background-color: green");
  1771. clicked_29=false;
  1772. }else{
  1773. pushButton29->setStyleSheet("background-color: white");
  1774. clicked_29=true;
  1775. }*/
  1776. pushButton29->setStyleSheet("background-color: green");
  1777. pushButton3->setStyleSheet("background-color: white");
  1778. pushButton4->setStyleSheet("background-color: white");
  1779. pushButton5->setStyleSheet("background-color: white");
  1780. pushButton6->setStyleSheet("background-color: white");
  1781. pushButton7->setStyleSheet("background-color: white");
  1782. pushButton18->setStyleSheet("background-color: white");
  1783. pushButton19->setStyleSheet("background-color: white");
  1784. pushButton20->setStyleSheet("background-color: white");
  1785. pushButton21->setStyleSheet("background-color: white");
  1786. pushButton22->setStyleSheet("background-color: white");
  1787. pushButton23->setStyleSheet("background-color: white");
  1788. pushButton24->setStyleSheet("background-color: white");
  1789. pushButton25->setStyleSheet("background-color: white");
  1790. pushButton26->setStyleSheet("background-color: white");
  1791. pushButton27->setStyleSheet("background-color: white");
  1792. pushButton28->setStyleSheet("background-color: white");
  1793. //pushButton29->setStyleSheet("background-color: white");
  1794. pushButton30->setStyleSheet("background-color: white");
  1795. pushButton31->setStyleSheet("background-color: white");
  1796. pushButton32->setStyleSheet("background-color: white");
  1797. }
  1798. void GPS_Collect::ClickButton_nomall_30()
  1799. {
  1800. speed_modes = 17;
  1801. sensor_gps->speed_modechange(speed_modes);
  1802. /*if(clicked_30==true){
  1803. pushButton30->setStyleSheet("background-color: green");
  1804. clicked_30=false;
  1805. }else{
  1806. pushButton30->setStyleSheet("background-color: white");
  1807. clicked_30=true;
  1808. }*/
  1809. pushButton30->setStyleSheet("background-color: green");
  1810. pushButton3->setStyleSheet("background-color: white");
  1811. pushButton4->setStyleSheet("background-color: white");
  1812. pushButton5->setStyleSheet("background-color: white");
  1813. pushButton6->setStyleSheet("background-color: white");
  1814. pushButton7->setStyleSheet("background-color: white");
  1815. pushButton18->setStyleSheet("background-color: white");
  1816. pushButton19->setStyleSheet("background-color: white");
  1817. pushButton20->setStyleSheet("background-color: white");
  1818. pushButton21->setStyleSheet("background-color: white");
  1819. pushButton22->setStyleSheet("background-color: white");
  1820. pushButton23->setStyleSheet("background-color: white");
  1821. pushButton24->setStyleSheet("background-color: white");
  1822. pushButton25->setStyleSheet("background-color: white");
  1823. pushButton26->setStyleSheet("background-color: white");
  1824. pushButton27->setStyleSheet("background-color: white");
  1825. pushButton28->setStyleSheet("background-color: white");
  1826. pushButton29->setStyleSheet("background-color: white");
  1827. //pushButton30->setStyleSheet("background-color: white");
  1828. pushButton31->setStyleSheet("background-color: white");
  1829. pushButton32->setStyleSheet("background-color: white");
  1830. }
  1831. void GPS_Collect::ClickButton_nomall_31()
  1832. {
  1833. speed_modes = 18;
  1834. sensor_gps->speed_modechange(speed_modes);
  1835. /*if(clicked_31==true){
  1836. pushButton31->setStyleSheet("background-color: green");
  1837. clicked_31=false;
  1838. }else{
  1839. pushButton31->setStyleSheet("background-color: white");
  1840. clicked_31=true;
  1841. }*/
  1842. pushButton31->setStyleSheet("background-color: green");
  1843. pushButton3->setStyleSheet("background-color: white");
  1844. pushButton4->setStyleSheet("background-color: white");
  1845. pushButton5->setStyleSheet("background-color: white");
  1846. pushButton6->setStyleSheet("background-color: white");
  1847. pushButton7->setStyleSheet("background-color: white");
  1848. pushButton18->setStyleSheet("background-color: white");
  1849. pushButton19->setStyleSheet("background-color: white");
  1850. pushButton20->setStyleSheet("background-color: white");
  1851. pushButton21->setStyleSheet("background-color: white");
  1852. pushButton22->setStyleSheet("background-color: white");
  1853. pushButton23->setStyleSheet("background-color: white");
  1854. pushButton24->setStyleSheet("background-color: white");
  1855. pushButton25->setStyleSheet("background-color: white");
  1856. pushButton26->setStyleSheet("background-color: white");
  1857. pushButton27->setStyleSheet("background-color: white");
  1858. pushButton28->setStyleSheet("background-color: white");
  1859. pushButton29->setStyleSheet("background-color: white");
  1860. pushButton30->setStyleSheet("background-color: white");
  1861. //pushButton31->setStyleSheet("background-color: white");
  1862. pushButton32->setStyleSheet("background-color: white");
  1863. }
  1864. void GPS_Collect::ClickButton_nomall_32()
  1865. {
  1866. speed_modes = 19;
  1867. sensor_gps->speed_modechange(speed_modes);
  1868. /* if(clicked_32==true){
  1869. pushButton32->setStyleSheet("background-color: green");
  1870. clicked_32=false;
  1871. }else{
  1872. pushButton32->setStyleSheet("background-color: white");
  1873. clicked_32=true;
  1874. }*/
  1875. pushButton32->setStyleSheet("background-color: green");
  1876. pushButton3->setStyleSheet("background-color: white");
  1877. pushButton4->setStyleSheet("background-color: white");
  1878. pushButton5->setStyleSheet("background-color: white");
  1879. pushButton6->setStyleSheet("background-color: white");
  1880. pushButton7->setStyleSheet("background-color: white");
  1881. pushButton18->setStyleSheet("background-color: white");
  1882. pushButton19->setStyleSheet("background-color: white");
  1883. pushButton20->setStyleSheet("background-color: white");
  1884. pushButton21->setStyleSheet("background-color: white");
  1885. pushButton22->setStyleSheet("background-color: white");
  1886. pushButton23->setStyleSheet("background-color: white");
  1887. pushButton24->setStyleSheet("background-color: white");
  1888. pushButton25->setStyleSheet("background-color: white");
  1889. pushButton26->setStyleSheet("background-color: white");
  1890. pushButton27->setStyleSheet("background-color: white");
  1891. pushButton28->setStyleSheet("background-color: white");
  1892. pushButton29->setStyleSheet("background-color: white");
  1893. pushButton30->setStyleSheet("background-color: white");
  1894. pushButton31->setStyleSheet("background-color: white");
  1895. //pushButton32->setStyleSheet("background-color: white");
  1896. }
  1897. void GPS_Collect::ClickButton_nomall_33()
  1898. {
  1899. obs_modes = 3;
  1900. sensor_gps->obs_modechange(obs_modes);
  1901. /*if(clicked_33==true){
  1902. pushButton33->setStyleSheet("background-color: green");
  1903. clicked_33=false;
  1904. }else{
  1905. pushButton33->setStyleSheet("background-color: white");
  1906. clicked_33=true;
  1907. }*/
  1908. pushButton33->setStyleSheet("background-color: green");
  1909. pushButton0->setStyleSheet("background-color: white");//单击自己按钮,自己按钮一直为绿色一直为绿色
  1910. pushButton1->setStyleSheet("background-color: white");//单击自己按钮,改变其他按钮为白色
  1911. pushButton2->setStyleSheet("background-color: white");//单击自己按钮,改变其他按钮为白色
  1912. pushButton34->setStyleSheet("background-color: white");//单击自己按钮,改变其他按钮为白色
  1913. }
  1914. void GPS_Collect::ClickButton_nomall_34()
  1915. {
  1916. obs_modes = 4;
  1917. sensor_gps->obs_modechange(obs_modes);
  1918. /*if(clicked_34==true){
  1919. pushButton34->setStyleSheet("background-color: green");
  1920. clicked_34=false;
  1921. }else{
  1922. pushButton34->setStyleSheet("background-color: white");
  1923. clicked_34=true;
  1924. }*/
  1925. pushButton34->setStyleSheet("background-color: green");
  1926. pushButton0->setStyleSheet("background-color: white");//单击自己按钮,自己按钮一直为绿色一直为绿色
  1927. pushButton1->setStyleSheet("background-color: white");//单击自己按钮,改变其他按钮为白色
  1928. pushButton2->setStyleSheet("background-color: white");//单击自己按钮,改变其他按钮为白色
  1929. pushButton33->setStyleSheet("background-color: white");//单击自己按钮,改变其他按钮为白色
  1930. }
  1931. void GPS_Collect::ClickButton_nomall_35()
  1932. {
  1933. }
  1934. void GPS_Collect::closeEvent(QCloseEvent *event)
  1935. {
  1936. if(should_close == false)
  1937. {
  1938. QMessageBox::StandardButton button;
  1939. button=QMessageBox::question(this,QStringLiteral("退出程序"),QStringLiteral("确认退出程序"),QMessageBox::Yes|QMessageBox::No);
  1940. if(button==QMessageBox::No)
  1941. {
  1942. event->ignore(); // 忽略退出信号,程序继续进行
  1943. }
  1944. else if(button==QMessageBox::Yes)
  1945. {
  1946. sensor_gps->wait_exit();
  1947. event->accept(); // 接受退出信号,程序退出
  1948. gps_collector_close();
  1949. }
  1950. }
  1951. else
  1952. {
  1953. event->accept(); // 接受退出信号,程序退出
  1954. }
  1955. }
  1956. void GPSSensor::convertStrToUnChar(char* str, unsigned char* UnChar)
  1957. {
  1958. int i = strlen(str), j = 0, counter = 0;
  1959. char c[2];
  1960. unsigned int bytes[2];
  1961. for (j = 0; j < i; j += 2)
  1962. {
  1963. if(0 == j % 2)
  1964. {
  1965. c[0] = str[j];
  1966. c[1] = str[j + 1];
  1967. sscanf(c, "%02x" , &bytes[0]);
  1968. UnChar[counter] = bytes[0];
  1969. counter++;
  1970. }
  1971. }
  1972. }