BikeCadenceSensor.h 31 KB

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