BikeSpeedSensor.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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 "ISimBase.h"
  11. #include "bs.h"
  12. #include "types.h"
  13. #include "antdefines.h"
  14. using namespace System;
  15. using namespace System::ComponentModel;
  16. using namespace System::Collections;
  17. using namespace System::Windows::Forms;
  18. using namespace System::Data;
  19. using namespace System::Drawing;
  20. public ref class BikeSpeedSensor : public System::Windows::Forms::Form, public ISimBase{
  21. public:
  22. BikeSpeedSensor(System::Timers::Timer^ channelTimer){
  23. InitializeComponent();
  24. timerHandle = channelTimer; // Get timer handle
  25. InitializeSim();
  26. }
  27. ~BikeSpeedSensor(){
  28. this->panel_Display->Controls->Clear();
  29. this->panel_Settings->Controls->Clear();
  30. delete this->panel_Display;
  31. delete this->panel_Settings;
  32. //clean up floating resources with the garbage collector
  33. GC::Collect(2);
  34. //Deletion of designer component
  35. if (components)
  36. {
  37. delete components;
  38. }
  39. }
  40. public:
  41. virtual void onTimerTock(USHORT eventTime);
  42. virtual void ANT_eventNotification(UCHAR ucEventCode_, UCHAR* pucEventBuffer_);
  43. virtual UCHAR getDeviceType(){return BS_DEVICE_TYPE;}
  44. virtual UCHAR getTransmissionType(){return BS_TX_TYPE;}
  45. virtual USHORT getTransmitPeriod(){return BS_MSG_PERIOD;}
  46. virtual DOUBLE getTimerInterval(){return (double) ulTimerInterval;}
  47. virtual System::Windows::Forms::Panel^ getSimSettingsPanel(){return this->panel_Settings;}
  48. virtual System::Windows::Forms::Panel^ getSimTranslatedDisplay(){return this->panel_Display;}
  49. private:
  50. void InitializeSim();
  51. void HandleTransmit(UCHAR* pucTxBuffer_);
  52. void UpdateDisplay();
  53. void ForceUpdate();
  54. System::Void numericUpDown_Sim_SpdCurOutput_ValueChanged(System::Object^ sender, System::EventArgs^ e);
  55. System::Void numericUpDown_Sim_SpdMinMaxOutput_ValueChanged(System::Object^ sender, System::EventArgs^ e);
  56. System::Void numericUpDown_Sim_WheelCircumference_ValueChanged(System::Object^ sender, System::EventArgs^ e);
  57. System::Void radioButton_SimTypeChanged (System::Object^ sender, System::EventArgs^ e);
  58. System::Void button_AdvancedUpdate_Click(System::Object^ sender, System::EventArgs^ e);
  59. System::Void button_UpdateTime_Click(System::Object^ sender, System::EventArgs^ e);
  60. System::Void checkBox_Legacy_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
  61. System::Void checkBox_SendBasicPage_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
  62. private:
  63. // Simulator timer
  64. System::Timers::Timer^ timerHandle; // Timer handle
  65. ULONG ulTimerInterval; // Timer interval between simulated events
  66. // Simulator variables
  67. ULONG ulRunTime; // Time in ms
  68. ULONG ulRunTime16000; // Time in 1/16000s, for conversion between time base of ms to 1/1024s
  69. UCHAR ucReserved; // Reserved field
  70. SHORT usEventCount; // Bike speed (wheel revolutions) event count
  71. UCHAR ucWheelCircumference; // Wheel circumference (in cm)
  72. ULONG ulMinSpeed; // Minimum bike speed (meters/h)
  73. ULONG ulCurSpeed; // Current bike speed (meters/h)
  74. ULONG ulMaxSpeed; // Maximum bike speed (meters/h)
  75. ULONG ulElapsedTime2; // Cumulative operating time (elapsed time) in 2 second resolution
  76. USHORT usTime1024; // Time of last bike speed event (1/1024 seconds)
  77. UCHAR ucBackgroundCount; // To send multiple times the same extended message
  78. UCHAR ucNextBackgroundPage; // Next extended page to send
  79. // Background Data
  80. UCHAR ucMfgID; // Manufacturing ID
  81. UCHAR ucHwVersion; // Hardware version
  82. UCHAR ucSwVersion; // Software version
  83. UCHAR ucModelNum; // Model number
  84. USHORT usSerialNum; // Serial number
  85. // Status
  86. UCHAR ucSimDataType; // Method to generate simulated data
  87. BOOL bLegacy; // Enable simulation of legacy sensors
  88. BOOL bSweepAscending; // Sweep through values in an ascending manner
  89. BOOL bTxMinimum; // Use minimum data set (do not transmit optional Page 1)
  90. private: System::Windows::Forms::Button^ button_AdvancedUpdate;
  91. private: System::Windows::Forms::Button^ button_UpdateTime;
  92. private: System::Windows::Forms::CheckBox^ checkBox_Legacy;
  93. private: System::Windows::Forms::Label^ label_AdvancedError;
  94. private: System::Windows::Forms::Label^ label_ElapsedSecsDisplay;
  95. private: System::Windows::Forms::Label^ label_ElpTime;
  96. private: System::Windows::Forms::Label^ label_HardwareVer;
  97. private: System::Windows::Forms::Label^ label_ManfID;
  98. private: System::Windows::Forms::Label^ label_ModelNum;
  99. private: System::Windows::Forms::Label^ label_SerialNum;
  100. private: System::Windows::Forms::Label^ label_Sim_SimType;
  101. private: System::Windows::Forms::Label^ label_Sim_SpdCur;
  102. private: System::Windows::Forms::Label^ label_Sim_SpdMax;
  103. private: System::Windows::Forms::Label^ label_Sim_SpdMin;
  104. private: System::Windows::Forms::Label^ label_Sim_Speed;
  105. private: System::Windows::Forms::Label^ label_Sim_WheelCircumferenceConst;
  106. private: System::Windows::Forms::Label^ label_SoftwareVer;
  107. private: System::Windows::Forms::Label^ label_Trn_EventCount;
  108. private: System::Windows::Forms::Label^ label_Trn_EventCountDisplay;
  109. private: System::Windows::Forms::Label^ label_Trn_Time;
  110. private: System::Windows::Forms::Label^ label_Trn_TimeDisplay;
  111. private: System::Windows::Forms::Label^ label_Trn_TranslatedDisplayLabel;
  112. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_SpdCurOutput;
  113. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_SpdMaxOutput;
  114. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_SpdMinOutput;
  115. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_WheelCircumference;
  116. private: System::Windows::Forms::Panel^ panel_Display;
  117. private: System::Windows::Forms::Panel^ panel_Settings;
  118. private: System::Windows::Forms::RadioButton^ radioButton_Sim_Fixed;
  119. private: System::Windows::Forms::RadioButton^ radioButton_Sim_Sweep;
  120. private: System::Windows::Forms::TabControl^ tabControl_Settings;
  121. private: System::Windows::Forms::TabPage^ tabPage_GlobalData;
  122. private: System::Windows::Forms::TabPage^ tabPage_Simulation;
  123. private: System::Windows::Forms::TextBox^ textBox_ElpTimeChange;
  124. private: System::Windows::Forms::TextBox^ textBox_HardwareVerChange;
  125. private: System::Windows::Forms::TextBox^ textBox_ManfIDChange;
  126. private: System::Windows::Forms::TextBox^ textBox_ModelNumChange;
  127. private: System::Windows::Forms::TextBox^ textBox_SerialNumChange;
  128. private: System::Windows::Forms::TextBox^ textBox_SoftwareVerChange;
  129. private: System::Windows::Forms::CheckBox^ checkBox_SendBasicPage;
  130. private:
  131. /// <summary>
  132. /// Required designer variable.
  133. /// </summary>
  134. System::ComponentModel::Container ^components;
  135. #pragma region Windows Form Designer generated code
  136. /// <summary>
  137. /// Required method for Designer support - do not modify
  138. /// the contents of this method with the code editor.
  139. /// </summary>
  140. void InitializeComponent(void)
  141. {
  142. this->panel_Settings = (gcnew System::Windows::Forms::Panel());
  143. this->tabControl_Settings = (gcnew System::Windows::Forms::TabControl());
  144. this->tabPage_Simulation = (gcnew System::Windows::Forms::TabPage());
  145. this->checkBox_SendBasicPage = (gcnew System::Windows::Forms::CheckBox());
  146. this->checkBox_Legacy = (gcnew System::Windows::Forms::CheckBox());
  147. this->numericUpDown_Sim_WheelCircumference = (gcnew System::Windows::Forms::NumericUpDown());
  148. this->label_Sim_SpdMin = (gcnew System::Windows::Forms::Label());
  149. this->label_Sim_SpdCur = (gcnew System::Windows::Forms::Label());
  150. this->label_Sim_SpdMax = (gcnew System::Windows::Forms::Label());
  151. this->label_Sim_WheelCircumferenceConst = (gcnew System::Windows::Forms::Label());
  152. this->numericUpDown_Sim_SpdMaxOutput = (gcnew System::Windows::Forms::NumericUpDown());
  153. this->label_Sim_SimType = (gcnew System::Windows::Forms::Label());
  154. this->radioButton_Sim_Fixed = (gcnew System::Windows::Forms::RadioButton());
  155. this->numericUpDown_Sim_SpdMinOutput = (gcnew System::Windows::Forms::NumericUpDown());
  156. this->radioButton_Sim_Sweep = (gcnew System::Windows::Forms::RadioButton());
  157. this->numericUpDown_Sim_SpdCurOutput = (gcnew System::Windows::Forms::NumericUpDown());
  158. this->label_Sim_Speed = (gcnew System::Windows::Forms::Label());
  159. this->tabPage_GlobalData = (gcnew System::Windows::Forms::TabPage());
  160. this->button_UpdateTime = (gcnew System::Windows::Forms::Button());
  161. this->label_SoftwareVer = (gcnew System::Windows::Forms::Label());
  162. this->label_HardwareVer = (gcnew System::Windows::Forms::Label());
  163. this->label_ManfID = (gcnew System::Windows::Forms::Label());
  164. this->label_ModelNum = (gcnew System::Windows::Forms::Label());
  165. this->label_AdvancedError = (gcnew System::Windows::Forms::Label());
  166. this->textBox_ElpTimeChange = (gcnew System::Windows::Forms::TextBox());
  167. this->textBox_SoftwareVerChange = (gcnew System::Windows::Forms::TextBox());
  168. this->button_AdvancedUpdate = (gcnew System::Windows::Forms::Button());
  169. this->textBox_HardwareVerChange = (gcnew System::Windows::Forms::TextBox());
  170. this->textBox_ModelNumChange = (gcnew System::Windows::Forms::TextBox());
  171. this->textBox_SerialNumChange = (gcnew System::Windows::Forms::TextBox());
  172. this->textBox_ManfIDChange = (gcnew System::Windows::Forms::TextBox());
  173. this->label_ElapsedSecsDisplay = (gcnew System::Windows::Forms::Label());
  174. this->label_SerialNum = (gcnew System::Windows::Forms::Label());
  175. this->label_ElpTime = (gcnew System::Windows::Forms::Label());
  176. this->panel_Display = (gcnew System::Windows::Forms::Panel());
  177. this->label_Trn_TimeDisplay = (gcnew System::Windows::Forms::Label());
  178. this->label_Trn_Time = (gcnew System::Windows::Forms::Label());
  179. this->label_Trn_TranslatedDisplayLabel = (gcnew System::Windows::Forms::Label());
  180. this->label_Trn_EventCountDisplay = (gcnew System::Windows::Forms::Label());
  181. this->label_Trn_EventCount = (gcnew System::Windows::Forms::Label());
  182. this->panel_Settings->SuspendLayout();
  183. this->tabControl_Settings->SuspendLayout();
  184. this->tabPage_Simulation->SuspendLayout();
  185. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_WheelCircumference))->BeginInit();
  186. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdMaxOutput))->BeginInit();
  187. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdMinOutput))->BeginInit();
  188. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdCurOutput))->BeginInit();
  189. this->tabPage_GlobalData->SuspendLayout();
  190. this->panel_Display->SuspendLayout();
  191. this->SuspendLayout();
  192. //
  193. // panel_Settings
  194. //
  195. this->panel_Settings->Controls->Add(this->tabControl_Settings);
  196. this->panel_Settings->Location = System::Drawing::Point(322, 50);
  197. this->panel_Settings->Name = L"panel_Settings";
  198. this->panel_Settings->Size = System::Drawing::Size(400, 140);
  199. this->panel_Settings->TabIndex = 0;
  200. //
  201. // tabControl_Settings
  202. //
  203. this->tabControl_Settings->Controls->Add(this->tabPage_Simulation);
  204. this->tabControl_Settings->Controls->Add(this->tabPage_GlobalData);
  205. this->tabControl_Settings->Location = System::Drawing::Point(0, 3);
  206. this->tabControl_Settings->Name = L"tabControl_Settings";
  207. this->tabControl_Settings->SelectedIndex = 0;
  208. this->tabControl_Settings->Size = System::Drawing::Size(397, 137);
  209. this->tabControl_Settings->TabIndex = 10;
  210. //
  211. // tabPage_Simulation
  212. //
  213. this->tabPage_Simulation->Controls->Add(this->checkBox_SendBasicPage);
  214. this->tabPage_Simulation->Controls->Add(this->checkBox_Legacy);
  215. this->tabPage_Simulation->Controls->Add(this->numericUpDown_Sim_WheelCircumference);
  216. this->tabPage_Simulation->Controls->Add(this->label_Sim_SpdMin);
  217. this->tabPage_Simulation->Controls->Add(this->label_Sim_SpdCur);
  218. this->tabPage_Simulation->Controls->Add(this->label_Sim_SpdMax);
  219. this->tabPage_Simulation->Controls->Add(this->label_Sim_WheelCircumferenceConst);
  220. this->tabPage_Simulation->Controls->Add(this->numericUpDown_Sim_SpdMaxOutput);
  221. this->tabPage_Simulation->Controls->Add(this->label_Sim_SimType);
  222. this->tabPage_Simulation->Controls->Add(this->radioButton_Sim_Fixed);
  223. this->tabPage_Simulation->Controls->Add(this->numericUpDown_Sim_SpdMinOutput);
  224. this->tabPage_Simulation->Controls->Add(this->radioButton_Sim_Sweep);
  225. this->tabPage_Simulation->Controls->Add(this->numericUpDown_Sim_SpdCurOutput);
  226. this->tabPage_Simulation->Controls->Add(this->label_Sim_Speed);
  227. this->tabPage_Simulation->Location = System::Drawing::Point(4, 22);
  228. this->tabPage_Simulation->Name = L"tabPage_Simulation";
  229. this->tabPage_Simulation->Padding = System::Windows::Forms::Padding(3);
  230. this->tabPage_Simulation->Size = System::Drawing::Size(389, 111);
  231. this->tabPage_Simulation->TabIndex = 0;
  232. this->tabPage_Simulation->Text = L"Simulation";
  233. this->tabPage_Simulation->UseVisualStyleBackColor = true;
  234. //
  235. // checkBox_SendBasicPage
  236. //
  237. this->checkBox_SendBasicPage->AutoSize = true;
  238. this->checkBox_SendBasicPage->Location = System::Drawing::Point(261, 50);
  239. this->checkBox_SendBasicPage->Name = L"checkBox_SendBasicPage";
  240. this->checkBox_SendBasicPage->Size = System::Drawing::Size(112, 17);
  241. this->checkBox_SendBasicPage->TabIndex = 61;
  242. this->checkBox_SendBasicPage->Text = L"Minimum Data Set";
  243. this->checkBox_SendBasicPage->UseVisualStyleBackColor = true;
  244. this->checkBox_SendBasicPage->CheckedChanged += gcnew System::EventHandler(this, &BikeSpeedSensor::checkBox_SendBasicPage_CheckedChanged);
  245. //
  246. // checkBox_Legacy
  247. //
  248. this->checkBox_Legacy->AutoSize = true;
  249. this->checkBox_Legacy->Location = System::Drawing::Point(261, 27);
  250. this->checkBox_Legacy->Name = L"checkBox_Legacy";
  251. this->checkBox_Legacy->Size = System::Drawing::Size(61, 17);
  252. this->checkBox_Legacy->TabIndex = 60;
  253. this->checkBox_Legacy->Text = L"Legacy";
  254. this->checkBox_Legacy->UseVisualStyleBackColor = true;
  255. this->checkBox_Legacy->CheckedChanged += gcnew System::EventHandler(this, &BikeSpeedSensor::checkBox_Legacy_CheckedChanged);
  256. //
  257. // numericUpDown_Sim_WheelCircumference
  258. //
  259. this->numericUpDown_Sim_WheelCircumference->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {5, 0, 0, 0});
  260. this->numericUpDown_Sim_WheelCircumference->Location = System::Drawing::Point(297, 78);
  261. this->numericUpDown_Sim_WheelCircumference->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  262. this->numericUpDown_Sim_WheelCircumference->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
  263. this->numericUpDown_Sim_WheelCircumference->Name = L"numericUpDown_Sim_WheelCircumference";
  264. this->numericUpDown_Sim_WheelCircumference->Size = System::Drawing::Size(47, 20);
  265. this->numericUpDown_Sim_WheelCircumference->TabIndex = 17;
  266. this->numericUpDown_Sim_WheelCircumference->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {207, 0, 0, 0});
  267. this->numericUpDown_Sim_WheelCircumference->ValueChanged += gcnew System::EventHandler(this, &BikeSpeedSensor::numericUpDown_Sim_WheelCircumference_ValueChanged);
  268. //
  269. // label_Sim_SpdMin
  270. //
  271. this->label_Sim_SpdMin->AutoSize = true;
  272. this->label_Sim_SpdMin->Location = System::Drawing::Point(36, 33);
  273. this->label_Sim_SpdMin->Name = L"label_Sim_SpdMin";
  274. this->label_Sim_SpdMin->Size = System::Drawing::Size(24, 13);
  275. this->label_Sim_SpdMin->TabIndex = 57;
  276. this->label_Sim_SpdMin->Text = L"Min";
  277. //
  278. // label_Sim_SpdCur
  279. //
  280. this->label_Sim_SpdCur->AutoSize = true;
  281. this->label_Sim_SpdCur->Location = System::Drawing::Point(19, 57);
  282. this->label_Sim_SpdCur->Name = L"label_Sim_SpdCur";
  283. this->label_Sim_SpdCur->Size = System::Drawing::Size(41, 13);
  284. this->label_Sim_SpdCur->TabIndex = 58;
  285. this->label_Sim_SpdCur->Text = L"Current";
  286. //
  287. // label_Sim_SpdMax
  288. //
  289. this->label_Sim_SpdMax->AutoSize = true;
  290. this->label_Sim_SpdMax->Location = System::Drawing::Point(33, 81);
  291. this->label_Sim_SpdMax->Name = L"label_Sim_SpdMax";
  292. this->label_Sim_SpdMax->Size = System::Drawing::Size(27, 13);
  293. this->label_Sim_SpdMax->TabIndex = 59;
  294. this->label_Sim_SpdMax->Text = L"Max";
  295. //
  296. // label_Sim_WheelCircumferenceConst
  297. //
  298. this->label_Sim_WheelCircumferenceConst->AutoSize = true;
  299. this->label_Sim_WheelCircumferenceConst->Location = System::Drawing::Point(162, 80);
  300. this->label_Sim_WheelCircumferenceConst->Name = L"label_Sim_WheelCircumferenceConst";
  301. this->label_Sim_WheelCircumferenceConst->Size = System::Drawing::Size(132, 13);
  302. this->label_Sim_WheelCircumferenceConst->TabIndex = 53;
  303. this->label_Sim_WheelCircumferenceConst->Text = L"Wheel Circumference (cm)";
  304. //
  305. // numericUpDown_Sim_SpdMaxOutput
  306. //
  307. this->numericUpDown_Sim_SpdMaxOutput->DecimalPlaces = 3;
  308. this->numericUpDown_Sim_SpdMaxOutput->Enabled = false;
  309. this->numericUpDown_Sim_SpdMaxOutput->Location = System::Drawing::Point(63, 78);
  310. this->numericUpDown_Sim_SpdMaxOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  311. this->numericUpDown_Sim_SpdMaxOutput->Name = L"numericUpDown_Sim_SpdMaxOutput";
  312. this->numericUpDown_Sim_SpdMaxOutput->Size = System::Drawing::Size(64, 20);
  313. this->numericUpDown_Sim_SpdMaxOutput->TabIndex = 15;
  314. this->numericUpDown_Sim_SpdMaxOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  315. this->numericUpDown_Sim_SpdMaxOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {80, 0, 0, 0});
  316. this->numericUpDown_Sim_SpdMaxOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpeedSensor::numericUpDown_Sim_SpdMinMaxOutput_ValueChanged);
  317. //
  318. // label_Sim_SimType
  319. //
  320. this->label_Sim_SimType->AutoSize = true;
  321. this->label_Sim_SimType->Location = System::Drawing::Point(162, 11);
  322. this->label_Sim_SimType->Name = L"label_Sim_SimType";
  323. this->label_Sim_SimType->Size = System::Drawing::Size(85, 13);
  324. this->label_Sim_SimType->TabIndex = 12;
  325. this->label_Sim_SimType->Text = L"Simulation Type:";
  326. this->label_Sim_SimType->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
  327. //
  328. // radioButton_Sim_Fixed
  329. //
  330. this->radioButton_Sim_Fixed->AutoSize = true;
  331. this->radioButton_Sim_Fixed->Checked = true;
  332. this->radioButton_Sim_Fixed->Location = System::Drawing::Point(176, 27);
  333. this->radioButton_Sim_Fixed->Name = L"radioButton_Sim_Fixed";
  334. this->radioButton_Sim_Fixed->Size = System::Drawing::Size(50, 17);
  335. this->radioButton_Sim_Fixed->TabIndex = 11;
  336. this->radioButton_Sim_Fixed->TabStop = true;
  337. this->radioButton_Sim_Fixed->Text = L"Fixed";
  338. this->radioButton_Sim_Fixed->UseVisualStyleBackColor = true;
  339. //
  340. // numericUpDown_Sim_SpdMinOutput
  341. //
  342. this->numericUpDown_Sim_SpdMinOutput->DecimalPlaces = 3;
  343. this->numericUpDown_Sim_SpdMinOutput->Enabled = false;
  344. this->numericUpDown_Sim_SpdMinOutput->Location = System::Drawing::Point(63, 30);
  345. this->numericUpDown_Sim_SpdMinOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  346. this->numericUpDown_Sim_SpdMinOutput->Name = L"numericUpDown_Sim_SpdMinOutput";
  347. this->numericUpDown_Sim_SpdMinOutput->Size = System::Drawing::Size(64, 20);
  348. this->numericUpDown_Sim_SpdMinOutput->TabIndex = 13;
  349. this->numericUpDown_Sim_SpdMinOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  350. this->numericUpDown_Sim_SpdMinOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
  351. this->numericUpDown_Sim_SpdMinOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpeedSensor::numericUpDown_Sim_SpdMinMaxOutput_ValueChanged);
  352. //
  353. // radioButton_Sim_Sweep
  354. //
  355. this->radioButton_Sim_Sweep->AutoSize = true;
  356. this->radioButton_Sim_Sweep->Location = System::Drawing::Point(176, 50);
  357. this->radioButton_Sim_Sweep->Name = L"radioButton_Sim_Sweep";
  358. this->radioButton_Sim_Sweep->Size = System::Drawing::Size(58, 17);
  359. this->radioButton_Sim_Sweep->TabIndex = 12;
  360. this->radioButton_Sim_Sweep->Text = L"Sweep";
  361. this->radioButton_Sim_Sweep->UseVisualStyleBackColor = true;
  362. this->radioButton_Sim_Sweep->CheckedChanged += gcnew System::EventHandler(this, &BikeSpeedSensor::radioButton_SimTypeChanged);
  363. //
  364. // numericUpDown_Sim_SpdCurOutput
  365. //
  366. this->numericUpDown_Sim_SpdCurOutput->DecimalPlaces = 3;
  367. this->numericUpDown_Sim_SpdCurOutput->Location = System::Drawing::Point(63, 54);
  368. this->numericUpDown_Sim_SpdCurOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  369. this->numericUpDown_Sim_SpdCurOutput->Name = L"numericUpDown_Sim_SpdCurOutput";
  370. this->numericUpDown_Sim_SpdCurOutput->Size = System::Drawing::Size(64, 20);
  371. this->numericUpDown_Sim_SpdCurOutput->TabIndex = 14;
  372. this->numericUpDown_Sim_SpdCurOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  373. this->numericUpDown_Sim_SpdCurOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {30, 0, 0, 0});
  374. this->numericUpDown_Sim_SpdCurOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpeedSensor::numericUpDown_Sim_SpdCurOutput_ValueChanged);
  375. //
  376. // label_Sim_Speed
  377. //
  378. this->label_Sim_Speed->AutoSize = true;
  379. this->label_Sim_Speed->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Underline,
  380. System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
  381. this->label_Sim_Speed->Location = System::Drawing::Point(49, 11);
  382. this->label_Sim_Speed->Name = L"label_Sim_Speed";
  383. this->label_Sim_Speed->Size = System::Drawing::Size(68, 13);
  384. this->label_Sim_Speed->TabIndex = 0;
  385. this->label_Sim_Speed->Text = L"Speed (kph):";
  386. //
  387. // tabPage_GlobalData
  388. //
  389. this->tabPage_GlobalData->Controls->Add(this->button_UpdateTime);
  390. this->tabPage_GlobalData->Controls->Add(this->label_SoftwareVer);
  391. this->tabPage_GlobalData->Controls->Add(this->label_HardwareVer);
  392. this->tabPage_GlobalData->Controls->Add(this->label_ManfID);
  393. this->tabPage_GlobalData->Controls->Add(this->label_ModelNum);
  394. this->tabPage_GlobalData->Controls->Add(this->label_AdvancedError);
  395. this->tabPage_GlobalData->Controls->Add(this->textBox_ElpTimeChange);
  396. this->tabPage_GlobalData->Controls->Add(this->textBox_SoftwareVerChange);
  397. this->tabPage_GlobalData->Controls->Add(this->button_AdvancedUpdate);
  398. this->tabPage_GlobalData->Controls->Add(this->textBox_HardwareVerChange);
  399. this->tabPage_GlobalData->Controls->Add(this->textBox_ModelNumChange);
  400. this->tabPage_GlobalData->Controls->Add(this->textBox_SerialNumChange);
  401. this->tabPage_GlobalData->Controls->Add(this->textBox_ManfIDChange);
  402. this->tabPage_GlobalData->Controls->Add(this->label_ElapsedSecsDisplay);
  403. this->tabPage_GlobalData->Controls->Add(this->label_SerialNum);
  404. this->tabPage_GlobalData->Controls->Add(this->label_ElpTime);
  405. this->tabPage_GlobalData->Location = System::Drawing::Point(4, 22);
  406. this->tabPage_GlobalData->Name = L"tabPage_GlobalData";
  407. this->tabPage_GlobalData->Padding = System::Windows::Forms::Padding(3);
  408. this->tabPage_GlobalData->Size = System::Drawing::Size(389, 111);
  409. this->tabPage_GlobalData->TabIndex = 1;
  410. this->tabPage_GlobalData->Text = L"Global Data";
  411. this->tabPage_GlobalData->UseVisualStyleBackColor = true;
  412. //
  413. // button_UpdateTime
  414. //
  415. this->button_UpdateTime->Location = System::Drawing::Point(9, 76);
  416. this->button_UpdateTime->Name = L"button_UpdateTime";
  417. this->button_UpdateTime->Size = System::Drawing::Size(97, 20);
  418. this->button_UpdateTime->TabIndex = 24;
  419. this->button_UpdateTime->Text = L"Update Time";
  420. this->button_UpdateTime->UseVisualStyleBackColor = true;
  421. this->button_UpdateTime->Click += gcnew System::EventHandler(this, &BikeSpeedSensor::button_UpdateTime_Click);
  422. //
  423. // label_SoftwareVer
  424. //
  425. this->label_SoftwareVer->AutoSize = true;
  426. this->label_SoftwareVer->Location = System::Drawing::Point(147, 83);
  427. this->label_SoftwareVer->Name = L"label_SoftwareVer";
  428. this->label_SoftwareVer->Size = System::Drawing::Size(71, 13);
  429. this->label_SoftwareVer->TabIndex = 4;
  430. this->label_SoftwareVer->Text = L"Software Ver:";
  431. //
  432. // label_HardwareVer
  433. //
  434. this->label_HardwareVer->AutoSize = true;
  435. this->label_HardwareVer->Location = System::Drawing::Point(143, 61);
  436. this->label_HardwareVer->Name = L"label_HardwareVer";
  437. this->label_HardwareVer->Size = System::Drawing::Size(75, 13);
  438. this->label_HardwareVer->TabIndex = 3;
  439. this->label_HardwareVer->Text = L"Hardware Ver:";
  440. //
  441. // label_ManfID
  442. //
  443. this->label_ManfID->AutoSize = true;
  444. this->label_ManfID->Location = System::Drawing::Point(167, 13);
  445. this->label_ManfID->Name = L"label_ManfID";
  446. this->label_ManfID->Size = System::Drawing::Size(51, 13);
  447. this->label_ManfID->TabIndex = 1;
  448. this->label_ManfID->Text = L"Manf. ID:";
  449. //
  450. // label_ModelNum
  451. //
  452. this->label_ModelNum->AutoSize = true;
  453. this->label_ModelNum->Location = System::Drawing::Point(169, 37);
  454. this->label_ModelNum->Name = L"label_ModelNum";
  455. this->label_ModelNum->Size = System::Drawing::Size(49, 13);
  456. this->label_ModelNum->TabIndex = 5;
  457. this->label_ModelNum->Text = L"Model #:";
  458. //
  459. // label_AdvancedError
  460. //
  461. this->label_AdvancedError->AutoSize = true;
  462. this->label_AdvancedError->Location = System::Drawing::Point(280, 81);
  463. this->label_AdvancedError->Name = L"label_AdvancedError";
  464. this->label_AdvancedError->Size = System::Drawing::Size(32, 13);
  465. this->label_AdvancedError->TabIndex = 20;
  466. this->label_AdvancedError->Text = L"Error:";
  467. this->label_AdvancedError->Visible = false;
  468. //
  469. // textBox_ElpTimeChange
  470. //
  471. this->textBox_ElpTimeChange->Location = System::Drawing::Point(28, 41);
  472. this->textBox_ElpTimeChange->MaxLength = 8;
  473. this->textBox_ElpTimeChange->Name = L"textBox_ElpTimeChange";
  474. this->textBox_ElpTimeChange->Size = System::Drawing::Size(63, 20);
  475. this->textBox_ElpTimeChange->TabIndex = 17;
  476. this->textBox_ElpTimeChange->Text = L"0";
  477. this->textBox_ElpTimeChange->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  478. //
  479. // textBox_SoftwareVerChange
  480. //
  481. this->textBox_SoftwareVerChange->Location = System::Drawing::Point(233, 81);
  482. this->textBox_SoftwareVerChange->MaxLength = 3;
  483. this->textBox_SoftwareVerChange->Name = L"textBox_SoftwareVerChange";
  484. this->textBox_SoftwareVerChange->Size = System::Drawing::Size(29, 20);
  485. this->textBox_SoftwareVerChange->TabIndex = 21;
  486. this->textBox_SoftwareVerChange->Text = L"1";
  487. //
  488. // button_AdvancedUpdate
  489. //
  490. this->button_AdvancedUpdate->Location = System::Drawing::Point(283, 41);
  491. this->button_AdvancedUpdate->Name = L"button_AdvancedUpdate";
  492. this->button_AdvancedUpdate->Size = System::Drawing::Size(97, 20);
  493. this->button_AdvancedUpdate->TabIndex = 23;
  494. this->button_AdvancedUpdate->Text = L"Update Prod Info";
  495. this->button_AdvancedUpdate->UseVisualStyleBackColor = true;
  496. this->button_AdvancedUpdate->Click += gcnew System::EventHandler(this, &BikeSpeedSensor::button_AdvancedUpdate_Click);
  497. //
  498. // textBox_HardwareVerChange
  499. //
  500. this->textBox_HardwareVerChange->Location = System::Drawing::Point(233, 59);
  501. this->textBox_HardwareVerChange->MaxLength = 3;
  502. this->textBox_HardwareVerChange->Name = L"textBox_HardwareVerChange";
  503. this->textBox_HardwareVerChange->Size = System::Drawing::Size(29, 20);
  504. this->textBox_HardwareVerChange->TabIndex = 20;
  505. this->textBox_HardwareVerChange->Text = L"1";
  506. //
  507. // textBox_ModelNumChange
  508. //
  509. this->textBox_ModelNumChange->Location = System::Drawing::Point(233, 35);
  510. this->textBox_ModelNumChange->MaxLength = 3;
  511. this->textBox_ModelNumChange->Name = L"textBox_ModelNumChange";
  512. this->textBox_ModelNumChange->Size = System::Drawing::Size(29, 20);
  513. this->textBox_ModelNumChange->TabIndex = 19;
  514. this->textBox_ModelNumChange->Text = L"1";
  515. //
  516. // textBox_SerialNumChange
  517. //
  518. this->textBox_SerialNumChange->Location = System::Drawing::Point(332, 9);
  519. this->textBox_SerialNumChange->MaxLength = 5;
  520. this->textBox_SerialNumChange->Name = L"textBox_SerialNumChange";
  521. this->textBox_SerialNumChange->Size = System::Drawing::Size(49, 20);
  522. this->textBox_SerialNumChange->TabIndex = 22;
  523. this->textBox_SerialNumChange->Text = L"12345";
  524. //
  525. // textBox_ManfIDChange
  526. //
  527. this->textBox_ManfIDChange->Location = System::Drawing::Point(233, 10);
  528. this->textBox_ManfIDChange->MaxLength = 3;
  529. this->textBox_ManfIDChange->Name = L"textBox_ManfIDChange";
  530. this->textBox_ManfIDChange->Size = System::Drawing::Size(29, 20);
  531. this->textBox_ManfIDChange->TabIndex = 18;
  532. this->textBox_ManfIDChange->Text = L"123";
  533. //
  534. // label_ElapsedSecsDisplay
  535. //
  536. this->label_ElapsedSecsDisplay->Location = System::Drawing::Point(34, 23);
  537. this->label_ElapsedSecsDisplay->Name = L"label_ElapsedSecsDisplay";
  538. this->label_ElapsedSecsDisplay->Size = System::Drawing::Size(55, 13);
  539. this->label_ElapsedSecsDisplay->TabIndex = 7;
  540. this->label_ElapsedSecsDisplay->Text = L"0";
  541. this->label_ElapsedSecsDisplay->TextAlign = System::Drawing::ContentAlignment::BottomRight;
  542. //
  543. // label_SerialNum
  544. //
  545. this->label_SerialNum->AutoSize = true;
  546. this->label_SerialNum->Location = System::Drawing::Point(280, 13);
  547. this->label_SerialNum->Name = L"label_SerialNum";
  548. this->label_SerialNum->Size = System::Drawing::Size(46, 13);
  549. this->label_SerialNum->TabIndex = 2;
  550. this->label_SerialNum->Text = L"Serial #:";
  551. //
  552. // label_ElpTime
  553. //
  554. this->label_ElpTime->AutoSize = true;
  555. this->label_ElpTime->Location = System::Drawing::Point(6, 6);
  556. this->label_ElpTime->Name = L"label_ElpTime";
  557. this->label_ElpTime->Size = System::Drawing::Size(88, 13);
  558. this->label_ElpTime->TabIndex = 0;
  559. this->label_ElpTime->Text = L"Elapsed Time (s):";
  560. //
  561. // panel_Display
  562. //
  563. this->panel_Display->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
  564. this->panel_Display->Controls->Add(this->label_Trn_TimeDisplay);
  565. this->panel_Display->Controls->Add(this->label_Trn_Time);
  566. this->panel_Display->Controls->Add(this->label_Trn_TranslatedDisplayLabel);
  567. this->panel_Display->Controls->Add(this->label_Trn_EventCountDisplay);
  568. this->panel_Display->Controls->Add(this->label_Trn_EventCount);
  569. this->panel_Display->Location = System::Drawing::Point(58, 188);
  570. this->panel_Display->Name = L"panel_Display";
  571. this->panel_Display->Size = System::Drawing::Size(200, 90);
  572. this->panel_Display->TabIndex = 1;
  573. //
  574. // label_Trn_TimeDisplay
  575. //
  576. this->label_Trn_TimeDisplay->AutoSize = true;
  577. this->label_Trn_TimeDisplay->Location = System::Drawing::Point(141, 51);
  578. this->label_Trn_TimeDisplay->Name = L"label_Trn_TimeDisplay";
  579. this->label_Trn_TimeDisplay->Size = System::Drawing::Size(16, 13);
  580. this->label_Trn_TimeDisplay->TabIndex = 6;
  581. this->label_Trn_TimeDisplay->Text = L"---";
  582. this->label_Trn_TimeDisplay->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;
  583. //
  584. // label_Trn_Time
  585. //
  586. this->label_Trn_Time->AutoSize = true;
  587. this->label_Trn_Time->Location = System::Drawing::Point(22, 51);
  588. this->label_Trn_Time->Name = L"label_Trn_Time";
  589. this->label_Trn_Time->Size = System::Drawing::Size(113, 13);
  590. this->label_Trn_Time->TabIndex = 5;
  591. this->label_Trn_Time->Text = L"Event Time (1/1024s):";
  592. this->label_Trn_Time->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
  593. //
  594. // label_Trn_TranslatedDisplayLabel
  595. //
  596. this->label_Trn_TranslatedDisplayLabel->AutoSize = true;
  597. this->label_Trn_TranslatedDisplayLabel->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Underline,
  598. System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
  599. this->label_Trn_TranslatedDisplayLabel->Location = System::Drawing::Point(2, 2);
  600. this->label_Trn_TranslatedDisplayLabel->Name = L"label_Trn_TranslatedDisplayLabel";
  601. this->label_Trn_TranslatedDisplayLabel->Size = System::Drawing::Size(169, 13);
  602. this->label_Trn_TranslatedDisplayLabel->TabIndex = 4;
  603. this->label_Trn_TranslatedDisplayLabel->Text = L"Current Bike Speed Transmission :";
  604. //
  605. // label_Trn_EventCountDisplay
  606. //
  607. this->label_Trn_EventCountDisplay->AutoSize = true;
  608. this->label_Trn_EventCountDisplay->Location = System::Drawing::Point(141, 28);
  609. this->label_Trn_EventCountDisplay->Name = L"label_Trn_EventCountDisplay";
  610. this->label_Trn_EventCountDisplay->Size = System::Drawing::Size(16, 13);
  611. this->label_Trn_EventCountDisplay->TabIndex = 2;
  612. this->label_Trn_EventCountDisplay->Text = L"---";
  613. this->label_Trn_EventCountDisplay->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;
  614. //
  615. // label_Trn_EventCount
  616. //
  617. this->label_Trn_EventCount->AutoSize = true;
  618. this->label_Trn_EventCount->Location = System::Drawing::Point(66, 28);
  619. this->label_Trn_EventCount->Name = L"label_Trn_EventCount";
  620. this->label_Trn_EventCount->Size = System::Drawing::Size(69, 13);
  621. this->label_Trn_EventCount->TabIndex = 0;
  622. this->label_Trn_EventCount->Text = L"Event Count:";
  623. this->label_Trn_EventCount->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
  624. //
  625. // BikeSpeedSensor
  626. //
  627. this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  628. this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  629. this->ClientSize = System::Drawing::Size(794, 351);
  630. this->Controls->Add(this->panel_Display);
  631. this->Controls->Add(this->panel_Settings);
  632. this->Name = L"BikeSpeedSensor";
  633. this->Text = L"BikeSpeedSensor";
  634. this->panel_Settings->ResumeLayout(false);
  635. this->tabControl_Settings->ResumeLayout(false);
  636. this->tabPage_Simulation->ResumeLayout(false);
  637. this->tabPage_Simulation->PerformLayout();
  638. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_WheelCircumference))->EndInit();
  639. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdMaxOutput))->EndInit();
  640. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdMinOutput))->EndInit();
  641. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdCurOutput))->EndInit();
  642. this->tabPage_GlobalData->ResumeLayout(false);
  643. this->tabPage_GlobalData->PerformLayout();
  644. this->panel_Display->ResumeLayout(false);
  645. this->panel_Display->PerformLayout();
  646. this->ResumeLayout(false);
  647. }
  648. #pragma endregion
  649. };