MSMDisplay.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /*
  2. This software is subject to the license described in the License.txt file
  3. included with this software distribution. You may not use this file except in compliance
  4. with this license.
  5. Copyright (c) Dynastream Innovations Inc. 2012
  6. All rights reserved.
  7. */
  8. #pragma once
  9. #include "StdAfx.h"
  10. #include "MSMDisplay.h"
  11. /**************************************************************************
  12. * MSMDisplay::InitializeSim
  13. *
  14. * Initialize the simulator variables
  15. *
  16. * returns: N/A
  17. *
  18. **************************************************************************/
  19. void MSMDisplay::InitializeSim()
  20. {
  21. dbDispAcumDist = 0;
  22. usPreviousDist = 0;
  23. dbDispAcumTime = 0;
  24. usPreviousTime = 0;
  25. eCalStatus = MSM::CalibrationStatus::NONE;
  26. // initialize calibration stuff
  27. msmData->ucMode = System::Convert::ToByte (this->numericUpDownMode->Value);
  28. ucPreviousMode = msmData->ucMode;
  29. msmData->usScaleFactor10000 = System::Convert::ToUInt16 (this->numericUpDownScaleFactor->Value * msmData->CAL_SF_SCALE_FACTOR);
  30. usPreviousScale = msmData->usScaleFactor10000;
  31. }
  32. /**************************************************************************
  33. * MSMDisplay::ANT_eventNotification
  34. *
  35. * Process ANT channel event
  36. *
  37. * ucEventCode_: code of ANT channel event
  38. * pucEventBuffer_: pointer to buffer containing data received from ANT,
  39. * or a pointer to the transmit buffer in the case of an EVENT_TX
  40. *
  41. * returns: N/A
  42. *
  43. **************************************************************************/
  44. void MSMDisplay::ANT_eventNotification(UCHAR ucEventCode_, UCHAR* pucEventBuffer_)
  45. {
  46. UCHAR ucPageNum = pucEventBuffer_[0];
  47. switch(ucEventCode_)
  48. {
  49. case EVENT_RX_ACKNOWLEDGED:
  50. case EVENT_RX_BURST_PACKET: // intentional fall thru
  51. case EVENT_RX_BROADCAST:
  52. // check if this is common pages or msm pages
  53. if (ucPageNum < commonData->START_COMMON_PAGE)
  54. {
  55. msmData->Decode(pucEventBuffer_);
  56. // check if calibration page
  57. if (ucPageNum == msmData->PAGE_CALIBRATION)
  58. UpdateCalibration();
  59. }
  60. else
  61. commonData->Decode(pucEventBuffer_);
  62. UpdateDisplay();
  63. break;
  64. case EVENT_TRANSFER_TX_COMPLETED:
  65. UpdateDisplayAckStatus(msmData->ACK_SUCCESS); // Tx successful
  66. break;
  67. case EVENT_TRANSFER_TX_FAILED:
  68. case EVENT_ACK_TIMEOUT: // Intentional fall thru
  69. UpdateDisplayAckStatus(msmData->ACK_FAIL);
  70. break;
  71. default:
  72. break;
  73. }
  74. }
  75. /**************************************************************************
  76. * MSMDisplay::UpdateDisplay
  77. *
  78. * Updates the variables found on the GUI
  79. *
  80. * returns: N/A
  81. *
  82. **************************************************************************/
  83. void MSMDisplay::UpdateDisplay()
  84. {
  85. // update the acumulated variables
  86. UpdateAcumValues();
  87. // update the accumulated vaules on the display
  88. this->labelDisplayAcumDistance->Text = dbDispAcumDist.ToString("N2");
  89. this->labelDisplayAcumTime->Text = dbDispAcumTime.ToString("N2");
  90. // check for invalid speed
  91. if (msmData->IsSpeedValid(msmData->usInstSpeed1000))
  92. this->labelDisplayInstSpeed->Text = ((double) msmData->usInstSpeed1000 / msmData->SPEED_SCALE_FACTOR).ToString("N3");
  93. else
  94. this->labelDisplayInstSpeed->Text = "INVALID SPEED";
  95. // check for page 2 data, display it if found
  96. if (msmData->bPage2Enabled)
  97. {
  98. this->labelDisplayLat->Text = (msmData->slLatitude_SC / msmData->SEMI_CIRCLE_CONVERSION).ToString("N6");
  99. this->labelDisplayLong->Text = (msmData->slLongitude_SC / msmData->SEMI_CIRCLE_CONVERSION).ToString("N6");
  100. // update the Rx labels
  101. this->labelRxLat->Text = msmData->slLatitude_SC.ToString();
  102. this->labelRxLon->Text = msmData->slLongitude_SC.ToString();
  103. }
  104. // check if page 3 data has been received if so, show the data
  105. if (msmData->bPage3Enabled)
  106. {
  107. // check that elevation is valid
  108. if (msmData->IsElevationValid())
  109. this->labelDisplayElevation->Text = (((double) msmData->usElevation5 / msmData->ELEVATION_SCALE_FACTOR) - msmData->ELEVATION_OFFSET).ToString("N1");
  110. else
  111. this->labelDisplayElevation->Text = "Invalid";
  112. // check that heading data is valid
  113. if (msmData->IsHeadingValid())
  114. this->labelDisplayHeading->Text = ((double) msmData->usHeading10 / msmData->HEADING_SCALE_FACTOR).ToString("N1");
  115. else
  116. this->labelDisplayHeading->Text = "Invalid";
  117. // set the GPS Fix stuff
  118. switch (msmData->ucFixType)
  119. {
  120. case MSM::GpsFix::NONE:
  121. this->labelDisplayFixType->Text = "None";
  122. break;
  123. case MSM::GpsFix::INVALID:
  124. this->labelDisplayFixType->Text = "Invalid";
  125. break;
  126. case MSM::GpsFix::PROPAGATING:
  127. this->labelDisplayFixType->Text = "Propagating";
  128. break;
  129. case MSM::GpsFix::LAST_KNOWN:
  130. this->labelDisplayFixType->Text = "Last Known";
  131. break;
  132. case MSM::GpsFix::SEARCHING:
  133. this->labelDisplayFixType->Text = "Searching";
  134. break;
  135. case MSM::GpsFix::THREE_D:
  136. this->labelDisplayFixType->Text = "3D Fix";
  137. break;
  138. case MSM::GpsFix::THREE_D_DIF:
  139. this->labelDisplayFixType->Text = "3D Differential";
  140. break;
  141. case MSM::GpsFix::THREE_D_WAAS:
  142. this->labelDisplayFixType->Text = "3D WAAS";
  143. break;
  144. case MSM::GpsFix::TWO_D:
  145. this->labelDisplayFixType->Text = "2D Fix";
  146. break;
  147. case MSM::GpsFix::TWO_D_DIF:
  148. this->labelDisplayFixType->Text = "2D Differential";
  149. break;
  150. case MSM::GpsFix::TWO_D_WAAS:
  151. this->labelDisplayFixType->Text = "2D WAAS";
  152. break;
  153. default:
  154. this->labelDisplayFixType->Text = "Error";
  155. break;
  156. }
  157. // update the RX labels
  158. this->labelRxElev->Text = msmData->usElevation5.ToString();
  159. this->labelRxHeading->Text = msmData->usHeading10.ToString();
  160. this->labelRxFix->Text = msmData->ucFixType.ToString();
  161. }
  162. // the tx variables will show the raw transmitted data decoded, but not scaled into proper units
  163. this->labelTxAcumDist->Text = msmData->usAcumDist10.ToString();
  164. this->labelTxAcumTime->Text = msmData->usAcumTime1024.ToString();
  165. this->labelTxInstSpeed->Text = msmData->usInstSpeed1000.ToString();
  166. // update the values for the HW common data page
  167. if (commonData->usMfgID != 0)
  168. {
  169. this->label_Glb_ManfIDDisplay->Text = commonData->usMfgID.ToString();
  170. this->label_Glb_HardwareVerDisplay->Text = commonData->ucHwVersion.ToString();
  171. this->label_Glb_ModelNumDisplay->Text = commonData->usModelNum.ToString();
  172. }
  173. // update the values for the SW common data page
  174. if (commonData->ulSerialNum != 0)
  175. {
  176. if(commonData->ulSerialNum == 0xFFFFFFFF)
  177. this->label_Glb_SerialNumDisplay->Text = "N/A";
  178. else
  179. this->label_Glb_SerialNumDisplay->Text = commonData->ulSerialNum.ToString();
  180. this->label_Glb_SoftwareVerDisplay->Text = commonData->ucSwVersion.ToString();
  181. }
  182. // update the values for the battery common data page
  183. if (commonData->ulOpTime != 0)
  184. {
  185. this->labelBattVolt->Text = System::Math::Round((double)commonData->usBatVoltage256/256,4).ToString("N2");
  186. if (commonData->eTimeResolution == CommonData::TimeResolution::SIXTEEN)
  187. this->labelTimeRes->Text = "16";
  188. else
  189. this->labelTimeRes->Text = "2";
  190. // now that we know the time resolution we can display the run time
  191. this->labelOpTime->Text = (commonData->ulOpTime * (UCHAR) commonData->eTimeResolution).ToString();
  192. switch (commonData->eBatStatus)
  193. {
  194. case CommonData::BatStatus::CRITICAL:
  195. this->labelBattStatus->Text = "Critical";
  196. break;
  197. case CommonData::BatStatus::GOOD:
  198. this->labelBattStatus->Text = "Good";
  199. break;
  200. case CommonData::BatStatus::INVALID:
  201. this->labelBattStatus->Text = "Invalid";
  202. break;
  203. case CommonData::BatStatus::LOW:
  204. this->labelBattStatus->Text = "Low";
  205. break;
  206. case CommonData::BatStatus::NEW:
  207. this->labelBattStatus->Text = "New";
  208. break;
  209. case CommonData::BatStatus::OK:
  210. this->labelBattStatus->Text = "Ok";
  211. break;
  212. default:
  213. break;
  214. }
  215. }
  216. // update the date and time info
  217. if (commonData->ucDays != 0)
  218. {
  219. this->labelHours->Text = commonData->ucHours.ToString("D2");
  220. this->labelMinutes->Text = commonData->ucMinutes.ToString("D2");
  221. this->labelSeconds->Text = commonData->ucSeconds.ToString("D2");
  222. this->labelDay->Text = commonData->ucDays.ToString("D2");
  223. this->labelMonth->Text = commonData->ucMonth.ToString("D2");
  224. this->labelYear->Text = commonData->ucYears.ToString("D2");
  225. switch (commonData->eDayOfWeek)
  226. {
  227. case CommonData::DayOfWeek::SUNDAY:
  228. this->labelDayOfWeek->Text = "Sunday";
  229. break;
  230. case CommonData::DayOfWeek::MONDAY:
  231. this->labelDayOfWeek->Text = "Monday";
  232. break;
  233. case CommonData::DayOfWeek::TUESDAY:
  234. this->labelDayOfWeek->Text = "Tuesday";
  235. break;
  236. case CommonData::DayOfWeek::WEDNESDAY:
  237. this->labelDayOfWeek->Text = "Wednesday";
  238. break;
  239. case CommonData::DayOfWeek::THURSDAY:
  240. this->labelDayOfWeek->Text = "Thursday";
  241. break;
  242. case CommonData::DayOfWeek::FRIDAY:
  243. this->labelDayOfWeek->Text = "Friday";
  244. break;
  245. case CommonData::DayOfWeek::SATURDAY:
  246. this->labelDayOfWeek->Text = "Saturday";
  247. break;
  248. case CommonData::DayOfWeek::INVALID:
  249. this->labelDayOfWeek->Text = "Invalid";
  250. break;
  251. default:
  252. break;
  253. }
  254. }
  255. }
  256. /**************************************************************************
  257. * MSMDisplay::UpdateAcumValues
  258. *
  259. * Updates the accumulated values
  260. *
  261. * returns: N/A
  262. *
  263. **************************************************************************/
  264. void MSMDisplay::UpdateAcumValues()
  265. {
  266. USHORT usRollover; // this is to help protect against rollover using integer math for accumulated values
  267. if (usPreviousDist == 0 && usPreviousTime == 0) // check if this is the first transmission
  268. {
  269. // update the previous values to be current next time
  270. usPreviousDist = msmData->usAcumDist10;
  271. usPreviousTime = msmData->usAcumTime1024;
  272. }
  273. else
  274. {
  275. // update the internal display value for distance
  276. usRollover = msmData->usAcumDist10 - usPreviousDist;
  277. dbDispAcumDist += (double) usRollover / msmData->DIST_SCALE_FACTOR;
  278. // update the internal display value for time
  279. usRollover = msmData->usAcumTime1024 - usPreviousTime;
  280. dbDispAcumTime += (double) usRollover / msmData->TIME_SCALE_FACTOR;
  281. // update the previous values to be current next time
  282. usPreviousDist = msmData->usAcumDist10;
  283. usPreviousTime = msmData->usAcumTime1024;
  284. }
  285. }
  286. /**************************************************************************
  287. * MSMDisplay::UpdateCalibration
  288. *
  289. * Updates the calibration values and progress
  290. *
  291. * returns: N/A
  292. *
  293. **************************************************************************/
  294. void MSMDisplay::UpdateCalibration()
  295. {
  296. if (eCalStatus == MSM::CalibrationStatus::REQUEST_IN_PROGRESS)
  297. {
  298. // update the scale factor if it is valid
  299. if (msmData->usScaleFactor10000 == msmData->CAL_SCALE_CONF)
  300. {
  301. // update the scale factor box
  302. this->numericUpDownScaleFactor->Value = System::Convert::ToDecimal(msmData->usScaleFactor10000 / msmData->CAL_SF_SCALE_FACTOR);
  303. if (msmData->ucMode == ucPreviousMode)
  304. {
  305. this->labelCalibrationProgress->Text = "Calibration Request Confirmed \nMode Data Supported";
  306. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Green;
  307. }
  308. else if (!msmData->IsCalModeValid(msmData->ucMode))
  309. {
  310. this->labelCalibrationProgress->Text = "Calibration Request Confirmed \nMode Data Not Supported";
  311. this->labelCalibrationProgress->BackColor = System::Drawing::Color::CadetBlue;
  312. }
  313. else
  314. {
  315. this->labelCalibrationProgress->Text = "Calibration Request Confirmed \nMode Data Invaild";
  316. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Red;
  317. }
  318. }
  319. // calibration not supported response is valid
  320. else if (!msmData->IsCalScaleValid(msmData->usScaleFactor10000))
  321. {
  322. eCalStatus = MSM::CalibrationStatus::NONE;
  323. this->labelCalibrationProgress->Text = "Calibration Not Supported";
  324. this->labelCalibrationProgress->BackColor = System::Drawing::Color::CadetBlue;
  325. if (msmData->IsCalModeValid(msmData->ucMode))
  326. {
  327. this->labelCalibrationProgress->Text = "Calibration Not Supported \nMode Data Invaild: " + msmData->ucMode.ToString();
  328. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Red;
  329. }
  330. }
  331. // any other respone is invalid
  332. else
  333. {
  334. this->labelCalibrationProgress->Text = "Scale Factor Invalid: " + msmData->usScaleFactor10000.ToString();
  335. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Red;
  336. }
  337. }
  338. if (eCalStatus == MSM::CalibrationStatus::SET_SCALE_IN_PROGRESS)
  339. {
  340. // confirmation is given if both the scale factor and mode are the same as was previously sent
  341. if (msmData->usScaleFactor10000 == usPreviousScale)
  342. {
  343. // set the status
  344. eCalStatus = MSM::CalibrationStatus::COMPLETE;
  345. if (msmData->ucMode == ucPreviousMode)
  346. {
  347. this->labelCalibrationProgress->Text = "Set Scale Factor Confirmed \nMode Data Supported";
  348. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Green;
  349. }
  350. else if (!msmData->IsCalModeValid(msmData->ucMode))
  351. {
  352. this->labelCalibrationProgress->Text = "Set Scale Factor Confirmed \nMode Data Not Supported";
  353. this->labelCalibrationProgress->BackColor = System::Drawing::Color::CadetBlue;
  354. }
  355. else
  356. {
  357. this->labelCalibrationProgress->Text = "Set Scale Factor Confirmed \nMode Data Invalid" + msmData->ucMode.ToString();
  358. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Red;
  359. }
  360. }
  361. // sensor does not support calibration
  362. else if (!msmData->IsCalScaleValid(msmData->usScaleFactor10000))
  363. {
  364. // set the status
  365. eCalStatus = MSM::CalibrationStatus::NONE;
  366. this->labelCalibrationProgress->Text = "Set Scale Factor Confirmed \nCalibration Not Supported";
  367. this->labelCalibrationProgress->BackColor = System::Drawing::Color::CadetBlue;
  368. // invalid response for the mode
  369. if (msmData->IsCalModeValid(msmData->ucMode))
  370. {
  371. this->labelCalibrationProgress->Text = "Calibration Not Supported \nMode Data Invalid" + msmData->ucMode.ToString();
  372. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Red;
  373. }
  374. }
  375. // any other response is invalid
  376. else
  377. {
  378. this->labelCalibrationProgress->Text = "Scale Factor Invalid: " + msmData->usScaleFactor10000.ToString();
  379. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Red;
  380. }
  381. }
  382. if(eCalStatus == MSM::CalibrationStatus::COMPLETE)
  383. {
  384. this->labelCalibrationProgress->Text = "Calibration Process Complete";
  385. this->labelCalibrationProgress->BackColor = System::Drawing::SystemColors::Control;
  386. }
  387. }
  388. /**************************************************************************
  389. * MSMDisplay::sendCalibrationMsg
  390. *
  391. * Sends calibration data pages from the display device to the sensor
  392. *
  393. * MSM::CalibartionStatus calType_: Determines what type of calibration message to send to the sensor
  394. *
  395. * returns: N/A
  396. *
  397. **************************************************************************/
  398. void MSMDisplay::SendCalibrationMsg(MSM::CalibrationStatus calType_)
  399. {
  400. // declare buffer for the acknowledged messages
  401. UCHAR aucAckBuffer[8] = {0,0,0,0,0,0,0,0};
  402. switch (calType_)
  403. {
  404. case MSM::CalibrationStatus::REQUEST_IN_PROGRESS:
  405. // set the scale factor to 0
  406. msmData->usScaleFactor10000 = msmData->CAL_SCALE_REQUEST;
  407. break;
  408. case MSM::CalibrationStatus::SET_SCALE_IN_PROGRESS:
  409. // set the scale factor according to the GUI
  410. msmData->usScaleFactor10000 = USHORT (this->numericUpDownScaleFactor->Value * msmData->CAL_SF_SCALE_FACTOR);
  411. break;
  412. default:
  413. break;
  414. }
  415. // update the previous variables to enable checking on return
  416. ucPreviousMode = msmData->ucMode;
  417. usPreviousScale = msmData->usScaleFactor10000;
  418. // get the data loaded into the buffer
  419. msmData->EncodeData(msmData->PAGE_CALIBRATION, aucAckBuffer);
  420. // make sure the buffer has something in it
  421. if (aucAckBuffer[0])
  422. {
  423. // send the acknowledged message
  424. requestAckMsg(aucAckBuffer);
  425. }
  426. }
  427. /**************************************************************************
  428. * MSMDisplay::UpdateDisplayAckStatus
  429. *
  430. * Updates the display relative to the calibration process after the ACK is received
  431. *
  432. * UCHAR ackStatus_: this determines if the ACK was a success or a fail
  433. *
  434. * returns: N/A
  435. *
  436. **************************************************************************/
  437. void MSMDisplay::UpdateDisplayAckStatus(UCHAR ackStatus_)
  438. {
  439. switch (ackStatus_)
  440. {
  441. case msmData->ACK_SUCCESS:
  442. if (eCalStatus == MSM::CalibrationStatus::REQUEST_IN_PROGRESS)
  443. {
  444. this->labelCalibrationProgress->Text = "Calibration Request \nAcknowledgement Recieved";
  445. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Orange;
  446. }
  447. if (eCalStatus == MSM::CalibrationStatus::SET_SCALE_IN_PROGRESS)
  448. {
  449. this->labelCalibrationProgress->Text = "Set Scale \nAcknowledgement Recieved";
  450. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Orange;
  451. }
  452. break;
  453. case msmData->ACK_FAIL:
  454. if (eCalStatus == MSM::CalibrationStatus::REQUEST_IN_PROGRESS)
  455. {
  456. this->labelCalibrationProgress->Text = "Calibration Request \nAcknowledgement Failed";
  457. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Red;
  458. }
  459. if (eCalStatus == MSM::CalibrationStatus::SET_SCALE_IN_PROGRESS)
  460. {
  461. this->labelCalibrationProgress->Text = "Set Scale \nAcknowledgement Failed";
  462. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Red;
  463. }
  464. break;
  465. default:
  466. break;
  467. }
  468. }
  469. /**************************************************************************
  470. * MSMDisplay::numericUpDownMode_ValueChanged
  471. *
  472. * Handles the change to the calibration Mode value
  473. *
  474. * returns: N/A
  475. *
  476. **************************************************************************/
  477. void MSMDisplay::numericUpDownMode_ValueChanged(System::Object^ sender, System::EventArgs^ e)
  478. {
  479. msmData->ucMode = System::Convert::ToByte(this->numericUpDownMode->Value);
  480. }
  481. /**************************************************************************
  482. * MSMDisplay::numericUpDownScaleFactor_ValueChanged
  483. *
  484. * Handles the change to the calibration Scale Factor value
  485. *
  486. * returns: N/A
  487. *
  488. **************************************************************************/
  489. void MSMDisplay::numericUpDownScaleFactor_ValueChanged(System::Object^ sender, System::EventArgs^ e)
  490. {
  491. msmData->usScaleFactor10000 = System::Convert::ToUInt16(this->numericUpDownScaleFactor->Value * msmData->CAL_SF_SCALE_FACTOR);
  492. }
  493. /**************************************************************************
  494. * MSMDisplay::buttonCalibrationRequest_Click
  495. *
  496. * Initiates the Calibration request to the MSM sensor
  497. *
  498. * returns: N/A
  499. *
  500. **************************************************************************/
  501. void MSMDisplay::buttonCalibrationRequest_Click(System::Object^ sender, System::EventArgs^ e)
  502. {
  503. eCalStatus = MSM::CalibrationStatus::REQUEST_IN_PROGRESS;
  504. SendCalibrationMsg(eCalStatus);
  505. // update the display
  506. this->numericUpDownScaleFactor->Value = System::Convert::ToDecimal(msmData->usScaleFactor10000 / msmData->CAL_SF_SCALE_FACTOR);
  507. this->labelCalibrationProgress->Text = "Calibration Request Sent";
  508. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Yellow;
  509. }
  510. /**************************************************************************
  511. * MSMDisplay::buttonSetScaleFactor_Click
  512. *
  513. * Sends a Set Mode/Scale Factor message to the sensor
  514. *
  515. * returns: N/A
  516. *
  517. **************************************************************************/
  518. void MSMDisplay::buttonSetScaleFactor_Click(System::Object^ sender, System::EventArgs^ e)
  519. {
  520. eCalStatus = MSM::CalibrationStatus::SET_SCALE_IN_PROGRESS;
  521. SendCalibrationMsg(eCalStatus);
  522. // update the display
  523. this->labelCalibrationProgress->Text = "Set Scale Factor Sent";
  524. this->labelCalibrationProgress->BackColor = System::Drawing::Color::Yellow;
  525. }