BikeSpdCadSensor.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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 "bsc.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 BikeSpdCadSensor : public System::Windows::Forms::Form, public ISimBase{
  21. public:
  22. BikeSpdCadSensor(System::Timers::Timer^ channelTimer){
  23. InitializeComponent();
  24. timerHandle = channelTimer; // Get timer handle
  25. InitializeSim();
  26. }
  27. ~BikeSpdCadSensor(){
  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. if (components)
  35. {
  36. delete components;
  37. }
  38. }
  39. public:
  40. virtual void onTimerTock(USHORT eventTime);
  41. virtual void ANT_eventNotification(UCHAR ucEventCode_, UCHAR* pucEventBuffer_);
  42. virtual UCHAR getDeviceType(){return BSC_DEVICE_TYPE;}
  43. virtual UCHAR getTransmissionType(){return BSC_TX_TYPE;}
  44. virtual USHORT getTransmitPeriod(){return BSC_MSG_PERIOD;}
  45. virtual DOUBLE getTimerInterval(){return (double) ulTimerInterval;}
  46. virtual System::Windows::Forms::Panel^ getSimSettingsPanel(){return this->panel_Settings;}
  47. virtual System::Windows::Forms::Panel^ getSimTranslatedDisplay(){return this->panel_Display;}
  48. private:
  49. void InitializeSim();
  50. void HandleTransmit(UCHAR* pucTxBuffer_);
  51. void UpdateDisplay();
  52. void ForceUpdate();
  53. System::Void numericUpDown_Sim_WheelCircumference_ValueChanged(System::Object^ sender, System::EventArgs^ e);
  54. System::Void numericUpDown_Sim_CadCurOutput_ValueChanged(System::Object^ sender, System::EventArgs^ e);
  55. System::Void numericUpDown_Sim_CadMinMaxOutput_ValueChanged(System::Object^ sender, System::EventArgs^ e);
  56. System::Void numericUpDown_Sim_SpdCurOutput_ValueChanged(System::Object^ sender, System::EventArgs^ e);
  57. System::Void numericUpDown_Sim_SpdMinMaxOutput_ValueChanged(System::Object^ sender, System::EventArgs^ e);
  58. System::Void checkBox_Sim_SpeedSweeping_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
  59. System::Void checkBox_Sim_CadenceSweeping_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
  60. private:
  61. // Simulator timer
  62. System::Timers::Timer^ timerHandle; // Timer handle
  63. ULONG ulRunTime16000; // Time in 1/16000s, for conversion between time base of ms to 1/1024s
  64. ULONG ulTimerInterval; // Timer interval between simulated events (ms)
  65. ULONG ulNextCadInterval; // Time interval until the next cadence event (ms)
  66. ULONG ulNextSpdInterval; // Time interval until the next speed event (ms)
  67. // Cadence
  68. USHORT usCadEventCount; // Bike cadence event count (pedal revolutions)
  69. USHORT usCadTime1024; // Time of last bike cadence event (1/1024s)
  70. UCHAR ucMinCadence; // Minimum bike cadence (rpm)
  71. UCHAR ucCurCadence; // Current bike cadence (rpm)
  72. UCHAR ucMaxCadence; // Maximum bike cadence (rpm)
  73. UCHAR ucCadSimDataType; // Method to generate simulated data
  74. BOOL bCadSweepAscending; // Sweep through values in an ascending manner
  75. // Speed
  76. USHORT usSpdEventCount; // Bike speed event count (wheel revolutions)
  77. USHORT usSpdTime1024; // Time of last bike speed event (1/1024s)
  78. ULONG ulMinSpeed; // Minimum bike speed (meters/h)
  79. ULONG ulCurSpeed; // Current bike speed (meters/h)
  80. ULONG ulMaxSpeed; // Maximum bike speed (meters/h)
  81. UCHAR ucWheelCircumference; // Wheel circumference (cm)
  82. UCHAR ucSpdSimDataType; // Method to generate simulated data
  83. BOOL bSpdSweepAscending; // Sweep through values in an ascending manner
  84. private: System::Windows::Forms::Panel^ panel_Settings;
  85. private: System::Windows::Forms::Panel^ panel_Display;
  86. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_CadMaxOutput;
  87. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_CadCurOutput;
  88. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_CadMinOutput;
  89. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_WheelCircumference;
  90. private: System::Windows::Forms::Label^ label_Sim_WheelCircumferenceConst;
  91. private: System::Windows::Forms::CheckBox^ checkBox_Sim_CadSweeping;
  92. private: System::Windows::Forms::Label^ label_Sim_CadMax;
  93. private: System::Windows::Forms::Label^ label_Sim_CadCurrent;
  94. private: System::Windows::Forms::Label^ label_Sim_CadMin;
  95. private: System::Windows::Forms::Label^ label_Sim_CadLabel;
  96. private: System::Windows::Forms::Label^ label_Trn_Title;
  97. private: System::Windows::Forms::Label^ label_Trn_Speed;
  98. private: System::Windows::Forms::Label^ label_Trn_SpeedTimeDisplay;
  99. private: System::Windows::Forms::Label^ label_Trn_CadenceTimeDisplay;
  100. private: System::Windows::Forms::Label^ label_Trn_Time;
  101. private: System::Windows::Forms::Label^ label_Sim_SpdMin;
  102. private: System::Windows::Forms::Label^ label_Sim_SpdCur;
  103. private: System::Windows::Forms::Label^ label_Sim_SpdMax;
  104. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_SpdMaxOutput;
  105. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_SpdMinOutput;
  106. private: System::Windows::Forms::CheckBox^ checkBox_Sim_SpdSweeping;
  107. private: System::Windows::Forms::Label^ label_Sim_SpdLabel;
  108. private: System::Windows::Forms::NumericUpDown^ numericUpDown_Sim_SpdCurOutput;
  109. private: System::Windows::Forms::Label^ label_Trn_SpdCountDisplay;
  110. private: System::Windows::Forms::Label^ label_Trn_CadCountDisplay;
  111. private: System::Windows::Forms::Label^ label_Trn_Count;
  112. private: System::Windows::Forms::Label^ label_Trn_TimeUnit;
  113. private: System::Windows::Forms::Label^ label_Trn_Cadence;
  114. private:
  115. /// <summary>
  116. /// Required designer variable.
  117. /// </summary>
  118. System::ComponentModel::Container ^components;
  119. #pragma region Windows Form Designer generated code
  120. /// <summary>
  121. /// Required method for Designer support - do not modify
  122. /// the contents of this method with the code editor.
  123. /// </summary>
  124. void InitializeComponent(void)
  125. {
  126. this->panel_Settings = (gcnew System::Windows::Forms::Panel());
  127. this->label_Sim_SpdMin = (gcnew System::Windows::Forms::Label());
  128. this->label_Sim_SpdCur = (gcnew System::Windows::Forms::Label());
  129. this->checkBox_Sim_SpdSweeping = (gcnew System::Windows::Forms::CheckBox());
  130. this->label_Sim_SpdMax = (gcnew System::Windows::Forms::Label());
  131. this->numericUpDown_Sim_SpdMaxOutput = (gcnew System::Windows::Forms::NumericUpDown());
  132. this->numericUpDown_Sim_SpdMinOutput = (gcnew System::Windows::Forms::NumericUpDown());
  133. this->label_Sim_SpdLabel = (gcnew System::Windows::Forms::Label());
  134. this->numericUpDown_Sim_SpdCurOutput = (gcnew System::Windows::Forms::NumericUpDown());
  135. this->numericUpDown_Sim_WheelCircumference = (gcnew System::Windows::Forms::NumericUpDown());
  136. this->label_Sim_CadMin = (gcnew System::Windows::Forms::Label());
  137. this->numericUpDown_Sim_CadMaxOutput = (gcnew System::Windows::Forms::NumericUpDown());
  138. this->numericUpDown_Sim_CadMinOutput = (gcnew System::Windows::Forms::NumericUpDown());
  139. this->label_Sim_WheelCircumferenceConst = (gcnew System::Windows::Forms::Label());
  140. this->label_Sim_CadCurrent = (gcnew System::Windows::Forms::Label());
  141. this->checkBox_Sim_CadSweeping = (gcnew System::Windows::Forms::CheckBox());
  142. this->label_Sim_CadMax = (gcnew System::Windows::Forms::Label());
  143. this->label_Sim_CadLabel = (gcnew System::Windows::Forms::Label());
  144. this->numericUpDown_Sim_CadCurOutput = (gcnew System::Windows::Forms::NumericUpDown());
  145. this->panel_Display = (gcnew System::Windows::Forms::Panel());
  146. this->label_Trn_TimeUnit = (gcnew System::Windows::Forms::Label());
  147. this->label_Trn_SpdCountDisplay = (gcnew System::Windows::Forms::Label());
  148. this->label_Trn_Speed = (gcnew System::Windows::Forms::Label());
  149. this->label_Trn_Cadence = (gcnew System::Windows::Forms::Label());
  150. this->label_Trn_CadCountDisplay = (gcnew System::Windows::Forms::Label());
  151. this->label_Trn_Count = (gcnew System::Windows::Forms::Label());
  152. this->label_Trn_SpeedTimeDisplay = (gcnew System::Windows::Forms::Label());
  153. this->label_Trn_CadenceTimeDisplay = (gcnew System::Windows::Forms::Label());
  154. this->label_Trn_Time = (gcnew System::Windows::Forms::Label());
  155. this->label_Trn_Title = (gcnew System::Windows::Forms::Label());
  156. this->panel_Settings->SuspendLayout();
  157. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdMaxOutput))->BeginInit();
  158. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdMinOutput))->BeginInit();
  159. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdCurOutput))->BeginInit();
  160. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_WheelCircumference))->BeginInit();
  161. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_CadMaxOutput))->BeginInit();
  162. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_CadMinOutput))->BeginInit();
  163. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_CadCurOutput))->BeginInit();
  164. this->panel_Display->SuspendLayout();
  165. this->SuspendLayout();
  166. //
  167. // panel_Settings
  168. //
  169. this->panel_Settings->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
  170. this->panel_Settings->Controls->Add(this->label_Sim_SpdMin);
  171. this->panel_Settings->Controls->Add(this->label_Sim_SpdCur);
  172. this->panel_Settings->Controls->Add(this->checkBox_Sim_SpdSweeping);
  173. this->panel_Settings->Controls->Add(this->label_Sim_SpdMax);
  174. this->panel_Settings->Controls->Add(this->numericUpDown_Sim_SpdMaxOutput);
  175. this->panel_Settings->Controls->Add(this->numericUpDown_Sim_SpdMinOutput);
  176. this->panel_Settings->Controls->Add(this->label_Sim_SpdLabel);
  177. this->panel_Settings->Controls->Add(this->numericUpDown_Sim_SpdCurOutput);
  178. this->panel_Settings->Controls->Add(this->numericUpDown_Sim_WheelCircumference);
  179. this->panel_Settings->Controls->Add(this->label_Sim_CadMin);
  180. this->panel_Settings->Controls->Add(this->numericUpDown_Sim_CadMaxOutput);
  181. this->panel_Settings->Controls->Add(this->numericUpDown_Sim_CadMinOutput);
  182. this->panel_Settings->Controls->Add(this->label_Sim_WheelCircumferenceConst);
  183. this->panel_Settings->Controls->Add(this->label_Sim_CadCurrent);
  184. this->panel_Settings->Controls->Add(this->checkBox_Sim_CadSweeping);
  185. this->panel_Settings->Controls->Add(this->label_Sim_CadMax);
  186. this->panel_Settings->Controls->Add(this->label_Sim_CadLabel);
  187. this->panel_Settings->Controls->Add(this->numericUpDown_Sim_CadCurOutput);
  188. this->panel_Settings->Location = System::Drawing::Point(322, 50);
  189. this->panel_Settings->Name = L"panel_Settings";
  190. this->panel_Settings->Size = System::Drawing::Size(400, 140);
  191. this->panel_Settings->TabIndex = 0;
  192. //
  193. // label_Sim_SpdMin
  194. //
  195. this->label_Sim_SpdMin->AutoSize = true;
  196. this->label_Sim_SpdMin->Location = System::Drawing::Point(171, 38);
  197. this->label_Sim_SpdMin->Name = L"label_Sim_SpdMin";
  198. this->label_Sim_SpdMin->Size = System::Drawing::Size(24, 13);
  199. this->label_Sim_SpdMin->TabIndex = 49;
  200. this->label_Sim_SpdMin->Text = L"Min";
  201. //
  202. // label_Sim_SpdCur
  203. //
  204. this->label_Sim_SpdCur->AutoSize = true;
  205. this->label_Sim_SpdCur->Location = System::Drawing::Point(154, 62);
  206. this->label_Sim_SpdCur->Name = L"label_Sim_SpdCur";
  207. this->label_Sim_SpdCur->Size = System::Drawing::Size(41, 13);
  208. this->label_Sim_SpdCur->TabIndex = 50;
  209. this->label_Sim_SpdCur->Text = L"Current";
  210. //
  211. // checkBox_Sim_SpdSweeping
  212. //
  213. this->checkBox_Sim_SpdSweeping->AutoSize = true;
  214. this->checkBox_Sim_SpdSweeping->Location = System::Drawing::Point(189, 109);
  215. this->checkBox_Sim_SpdSweeping->Name = L"checkBox_Sim_SpdSweeping";
  216. this->checkBox_Sim_SpdSweeping->Size = System::Drawing::Size(73, 17);
  217. this->checkBox_Sim_SpdSweeping->TabIndex = 19;
  218. this->checkBox_Sim_SpdSweeping->Text = L"Sweeping";
  219. this->checkBox_Sim_SpdSweeping->UseVisualStyleBackColor = true;
  220. this->checkBox_Sim_SpdSweeping->CheckedChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::checkBox_Sim_SpeedSweeping_CheckedChanged);
  221. //
  222. // label_Sim_SpdMax
  223. //
  224. this->label_Sim_SpdMax->AutoSize = true;
  225. this->label_Sim_SpdMax->Location = System::Drawing::Point(168, 86);
  226. this->label_Sim_SpdMax->Name = L"label_Sim_SpdMax";
  227. this->label_Sim_SpdMax->Size = System::Drawing::Size(27, 13);
  228. this->label_Sim_SpdMax->TabIndex = 51;
  229. this->label_Sim_SpdMax->Text = L"Max";
  230. //
  231. // numericUpDown_Sim_SpdMaxOutput
  232. //
  233. this->numericUpDown_Sim_SpdMaxOutput->DecimalPlaces = 3;
  234. this->numericUpDown_Sim_SpdMaxOutput->Enabled = false;
  235. this->numericUpDown_Sim_SpdMaxOutput->Location = System::Drawing::Point(198, 83);
  236. this->numericUpDown_Sim_SpdMaxOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  237. this->numericUpDown_Sim_SpdMaxOutput->Name = L"numericUpDown_Sim_SpdMaxOutput";
  238. this->numericUpDown_Sim_SpdMaxOutput->Size = System::Drawing::Size(64, 20);
  239. this->numericUpDown_Sim_SpdMaxOutput->TabIndex = 17;
  240. this->numericUpDown_Sim_SpdMaxOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  241. this->numericUpDown_Sim_SpdMaxOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {80, 0, 0, 0});
  242. this->numericUpDown_Sim_SpdMaxOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::numericUpDown_Sim_SpdMinMaxOutput_ValueChanged);
  243. //
  244. // numericUpDown_Sim_SpdMinOutput
  245. //
  246. this->numericUpDown_Sim_SpdMinOutput->DecimalPlaces = 3;
  247. this->numericUpDown_Sim_SpdMinOutput->Enabled = false;
  248. this->numericUpDown_Sim_SpdMinOutput->Location = System::Drawing::Point(198, 35);
  249. this->numericUpDown_Sim_SpdMinOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  250. this->numericUpDown_Sim_SpdMinOutput->Name = L"numericUpDown_Sim_SpdMinOutput";
  251. this->numericUpDown_Sim_SpdMinOutput->Size = System::Drawing::Size(64, 20);
  252. this->numericUpDown_Sim_SpdMinOutput->TabIndex = 15;
  253. this->numericUpDown_Sim_SpdMinOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  254. this->numericUpDown_Sim_SpdMinOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
  255. this->numericUpDown_Sim_SpdMinOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::numericUpDown_Sim_SpdMinMaxOutput_ValueChanged);
  256. //
  257. // label_Sim_SpdLabel
  258. //
  259. this->label_Sim_SpdLabel->AutoSize = true;
  260. this->label_Sim_SpdLabel->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Underline,
  261. System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
  262. this->label_Sim_SpdLabel->Location = System::Drawing::Point(199, 14);
  263. this->label_Sim_SpdLabel->Name = L"label_Sim_SpdLabel";
  264. this->label_Sim_SpdLabel->Size = System::Drawing::Size(68, 13);
  265. this->label_Sim_SpdLabel->TabIndex = 43;
  266. this->label_Sim_SpdLabel->Text = L"Speed (kph):";
  267. //
  268. // numericUpDown_Sim_SpdCurOutput
  269. //
  270. this->numericUpDown_Sim_SpdCurOutput->DecimalPlaces = 3;
  271. this->numericUpDown_Sim_SpdCurOutput->Location = System::Drawing::Point(198, 59);
  272. this->numericUpDown_Sim_SpdCurOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  273. this->numericUpDown_Sim_SpdCurOutput->Name = L"numericUpDown_Sim_SpdCurOutput";
  274. this->numericUpDown_Sim_SpdCurOutput->Size = System::Drawing::Size(64, 20);
  275. this->numericUpDown_Sim_SpdCurOutput->TabIndex = 16;
  276. this->numericUpDown_Sim_SpdCurOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  277. this->numericUpDown_Sim_SpdCurOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {30, 0, 0, 0});
  278. this->numericUpDown_Sim_SpdCurOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::numericUpDown_Sim_SpdCurOutput_ValueChanged);
  279. //
  280. // numericUpDown_Sim_WheelCircumference
  281. //
  282. this->numericUpDown_Sim_WheelCircumference->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {5, 0, 0, 0});
  283. this->numericUpDown_Sim_WheelCircumference->Location = System::Drawing::Point(311, 55);
  284. this->numericUpDown_Sim_WheelCircumference->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  285. this->numericUpDown_Sim_WheelCircumference->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
  286. this->numericUpDown_Sim_WheelCircumference->Name = L"numericUpDown_Sim_WheelCircumference";
  287. this->numericUpDown_Sim_WheelCircumference->Size = System::Drawing::Size(47, 20);
  288. this->numericUpDown_Sim_WheelCircumference->TabIndex = 20;
  289. this->numericUpDown_Sim_WheelCircumference->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {207, 0, 0, 0});
  290. this->numericUpDown_Sim_WheelCircumference->ValueChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::numericUpDown_Sim_WheelCircumference_ValueChanged);
  291. //
  292. // label_Sim_CadMin
  293. //
  294. this->label_Sim_CadMin->AutoSize = true;
  295. this->label_Sim_CadMin->Location = System::Drawing::Point(40, 38);
  296. this->label_Sim_CadMin->Name = L"label_Sim_CadMin";
  297. this->label_Sim_CadMin->Size = System::Drawing::Size(24, 13);
  298. this->label_Sim_CadMin->TabIndex = 31;
  299. this->label_Sim_CadMin->Text = L"Min";
  300. //
  301. // numericUpDown_Sim_CadMaxOutput
  302. //
  303. this->numericUpDown_Sim_CadMaxOutput->Enabled = false;
  304. this->numericUpDown_Sim_CadMaxOutput->Location = System::Drawing::Point(67, 83);
  305. this->numericUpDown_Sim_CadMaxOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  306. this->numericUpDown_Sim_CadMaxOutput->Name = L"numericUpDown_Sim_CadMaxOutput";
  307. this->numericUpDown_Sim_CadMaxOutput->Size = System::Drawing::Size(64, 20);
  308. this->numericUpDown_Sim_CadMaxOutput->TabIndex = 12;
  309. this->numericUpDown_Sim_CadMaxOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  310. this->numericUpDown_Sim_CadMaxOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {120, 0, 0, 0});
  311. this->numericUpDown_Sim_CadMaxOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::numericUpDown_Sim_CadMinMaxOutput_ValueChanged);
  312. //
  313. // numericUpDown_Sim_CadMinOutput
  314. //
  315. this->numericUpDown_Sim_CadMinOutput->Enabled = false;
  316. this->numericUpDown_Sim_CadMinOutput->Location = System::Drawing::Point(67, 35);
  317. this->numericUpDown_Sim_CadMinOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  318. this->numericUpDown_Sim_CadMinOutput->Name = L"numericUpDown_Sim_CadMinOutput";
  319. this->numericUpDown_Sim_CadMinOutput->Size = System::Drawing::Size(64, 20);
  320. this->numericUpDown_Sim_CadMinOutput->TabIndex = 10;
  321. this->numericUpDown_Sim_CadMinOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  322. this->numericUpDown_Sim_CadMinOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
  323. this->numericUpDown_Sim_CadMinOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::numericUpDown_Sim_CadMinMaxOutput_ValueChanged);
  324. //
  325. // label_Sim_WheelCircumferenceConst
  326. //
  327. this->label_Sim_WheelCircumferenceConst->AutoSize = true;
  328. this->label_Sim_WheelCircumferenceConst->Location = System::Drawing::Point(293, 12);
  329. this->label_Sim_WheelCircumferenceConst->Name = L"label_Sim_WheelCircumferenceConst";
  330. this->label_Sim_WheelCircumferenceConst->Size = System::Drawing::Size(78, 39);
  331. this->label_Sim_WheelCircumferenceConst->TabIndex = 40;
  332. this->label_Sim_WheelCircumferenceConst->Text = L"Wheel \r\nCircumference \r\n(cm)";
  333. this->label_Sim_WheelCircumferenceConst->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
  334. //
  335. // label_Sim_CadCurrent
  336. //
  337. this->label_Sim_CadCurrent->AutoSize = true;
  338. this->label_Sim_CadCurrent->Location = System::Drawing::Point(23, 62);
  339. this->label_Sim_CadCurrent->Name = L"label_Sim_CadCurrent";
  340. this->label_Sim_CadCurrent->Size = System::Drawing::Size(41, 13);
  341. this->label_Sim_CadCurrent->TabIndex = 32;
  342. this->label_Sim_CadCurrent->Text = L"Current";
  343. //
  344. // checkBox_Sim_CadSweeping
  345. //
  346. this->checkBox_Sim_CadSweeping->AutoSize = true;
  347. this->checkBox_Sim_CadSweeping->Location = System::Drawing::Point(58, 109);
  348. this->checkBox_Sim_CadSweeping->Name = L"checkBox_Sim_CadSweeping";
  349. this->checkBox_Sim_CadSweeping->Size = System::Drawing::Size(73, 17);
  350. this->checkBox_Sim_CadSweeping->TabIndex = 14;
  351. this->checkBox_Sim_CadSweeping->Text = L"Sweeping";
  352. this->checkBox_Sim_CadSweeping->UseVisualStyleBackColor = true;
  353. this->checkBox_Sim_CadSweeping->CheckedChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::checkBox_Sim_CadenceSweeping_CheckedChanged);
  354. //
  355. // label_Sim_CadMax
  356. //
  357. this->label_Sim_CadMax->AutoSize = true;
  358. this->label_Sim_CadMax->Location = System::Drawing::Point(37, 86);
  359. this->label_Sim_CadMax->Name = L"label_Sim_CadMax";
  360. this->label_Sim_CadMax->Size = System::Drawing::Size(27, 13);
  361. this->label_Sim_CadMax->TabIndex = 35;
  362. this->label_Sim_CadMax->Text = L"Max";
  363. //
  364. // label_Sim_CadLabel
  365. //
  366. this->label_Sim_CadLabel->AutoSize = true;
  367. this->label_Sim_CadLabel->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Underline,
  368. System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
  369. this->label_Sim_CadLabel->Location = System::Drawing::Point(52, 14);
  370. this->label_Sim_CadLabel->Name = L"label_Sim_CadLabel";
  371. this->label_Sim_CadLabel->Size = System::Drawing::Size(79, 13);
  372. this->label_Sim_CadLabel->TabIndex = 29;
  373. this->label_Sim_CadLabel->Text = L"Cadence (rpm):";
  374. //
  375. // numericUpDown_Sim_CadCurOutput
  376. //
  377. this->numericUpDown_Sim_CadCurOutput->Location = System::Drawing::Point(67, 59);
  378. this->numericUpDown_Sim_CadCurOutput->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {255, 0, 0, 0});
  379. this->numericUpDown_Sim_CadCurOutput->Name = L"numericUpDown_Sim_CadCurOutput";
  380. this->numericUpDown_Sim_CadCurOutput->Size = System::Drawing::Size(64, 20);
  381. this->numericUpDown_Sim_CadCurOutput->TabIndex = 11;
  382. this->numericUpDown_Sim_CadCurOutput->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  383. this->numericUpDown_Sim_CadCurOutput->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {90, 0, 0, 0});
  384. this->numericUpDown_Sim_CadCurOutput->ValueChanged += gcnew System::EventHandler(this, &BikeSpdCadSensor::numericUpDown_Sim_CadCurOutput_ValueChanged);
  385. //
  386. // panel_Display
  387. //
  388. this->panel_Display->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
  389. this->panel_Display->Controls->Add(this->label_Trn_TimeUnit);
  390. this->panel_Display->Controls->Add(this->label_Trn_SpdCountDisplay);
  391. this->panel_Display->Controls->Add(this->label_Trn_Speed);
  392. this->panel_Display->Controls->Add(this->label_Trn_Cadence);
  393. this->panel_Display->Controls->Add(this->label_Trn_CadCountDisplay);
  394. this->panel_Display->Controls->Add(this->label_Trn_Count);
  395. this->panel_Display->Controls->Add(this->label_Trn_SpeedTimeDisplay);
  396. this->panel_Display->Controls->Add(this->label_Trn_CadenceTimeDisplay);
  397. this->panel_Display->Controls->Add(this->label_Trn_Time);
  398. this->panel_Display->Controls->Add(this->label_Trn_Title);
  399. this->panel_Display->Location = System::Drawing::Point(58, 188);
  400. this->panel_Display->Name = L"panel_Display";
  401. this->panel_Display->Size = System::Drawing::Size(200, 90);
  402. this->panel_Display->TabIndex = 1;
  403. //
  404. // label_Trn_TimeUnit
  405. //
  406. this->label_Trn_TimeUnit->AutoSize = true;
  407. this->label_Trn_TimeUnit->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.25F, System::Drawing::FontStyle::Regular,
  408. System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
  409. this->label_Trn_TimeUnit->Location = System::Drawing::Point(143, 26);
  410. this->label_Trn_TimeUnit->Name = L"label_Trn_TimeUnit";
  411. this->label_Trn_TimeUnit->Size = System::Drawing::Size(44, 12);
  412. this->label_Trn_TimeUnit->TabIndex = 11;
  413. this->label_Trn_TimeUnit->Text = L"(1/1024s)";
  414. //
  415. // label_Trn_SpdCountDisplay
  416. //
  417. this->label_Trn_SpdCountDisplay->AutoSize = true;
  418. this->label_Trn_SpdCountDisplay->Location = System::Drawing::Point(71, 62);
  419. this->label_Trn_SpdCountDisplay->Name = L"label_Trn_SpdCountDisplay";
  420. this->label_Trn_SpdCountDisplay->Size = System::Drawing::Size(16, 13);
  421. this->label_Trn_SpdCountDisplay->TabIndex = 10;
  422. this->label_Trn_SpdCountDisplay->Text = L"---";
  423. //
  424. // label_Trn_Speed
  425. //
  426. this->label_Trn_Speed->AutoSize = true;
  427. this->label_Trn_Speed->Location = System::Drawing::Point(13, 62);
  428. this->label_Trn_Speed->Name = L"label_Trn_Speed";
  429. this->label_Trn_Speed->Size = System::Drawing::Size(41, 13);
  430. this->label_Trn_Speed->TabIndex = 2;
  431. this->label_Trn_Speed->Text = L"Speed:";
  432. //
  433. // label_Trn_Cadence
  434. //
  435. this->label_Trn_Cadence->AutoSize = true;
  436. this->label_Trn_Cadence->Location = System::Drawing::Point(13, 44);
  437. this->label_Trn_Cadence->Name = L"label_Trn_Cadence";
  438. this->label_Trn_Cadence->Size = System::Drawing::Size(53, 13);
  439. this->label_Trn_Cadence->TabIndex = 0;
  440. this->label_Trn_Cadence->Text = L"Cadence:";
  441. //
  442. // label_Trn_CadCountDisplay
  443. //
  444. this->label_Trn_CadCountDisplay->AutoSize = true;
  445. this->label_Trn_CadCountDisplay->Location = System::Drawing::Point(71, 44);
  446. this->label_Trn_CadCountDisplay->Name = L"label_Trn_CadCountDisplay";
  447. this->label_Trn_CadCountDisplay->Size = System::Drawing::Size(16, 13);
  448. this->label_Trn_CadCountDisplay->TabIndex = 9;
  449. this->label_Trn_CadCountDisplay->Text = L"---";
  450. //
  451. // label_Trn_Count
  452. //
  453. this->label_Trn_Count->AutoSize = true;
  454. this->label_Trn_Count->Location = System::Drawing::Point(66, 26);
  455. this->label_Trn_Count->Name = L"label_Trn_Count";
  456. this->label_Trn_Count->Size = System::Drawing::Size(38, 13);
  457. this->label_Trn_Count->TabIndex = 8;
  458. this->label_Trn_Count->Text = L"Count:";
  459. //
  460. // label_Trn_SpeedTimeDisplay
  461. //
  462. this->label_Trn_SpeedTimeDisplay->AutoSize = true;
  463. this->label_Trn_SpeedTimeDisplay->Location = System::Drawing::Point(113, 62);
  464. this->label_Trn_SpeedTimeDisplay->Name = L"label_Trn_SpeedTimeDisplay";
  465. this->label_Trn_SpeedTimeDisplay->Size = System::Drawing::Size(16, 13);
  466. this->label_Trn_SpeedTimeDisplay->TabIndex = 7;
  467. this->label_Trn_SpeedTimeDisplay->Text = L"---";
  468. //
  469. // label_Trn_CadenceTimeDisplay
  470. //
  471. this->label_Trn_CadenceTimeDisplay->AutoSize = true;
  472. this->label_Trn_CadenceTimeDisplay->Location = System::Drawing::Point(113, 44);
  473. this->label_Trn_CadenceTimeDisplay->Name = L"label_Trn_CadenceTimeDisplay";
  474. this->label_Trn_CadenceTimeDisplay->Size = System::Drawing::Size(16, 13);
  475. this->label_Trn_CadenceTimeDisplay->TabIndex = 6;
  476. this->label_Trn_CadenceTimeDisplay->Text = L"---";
  477. //
  478. // label_Trn_Time
  479. //
  480. this->label_Trn_Time->AutoSize = true;
  481. this->label_Trn_Time->Location = System::Drawing::Point(109, 26);
  482. this->label_Trn_Time->Name = L"label_Trn_Time";
  483. this->label_Trn_Time->Size = System::Drawing::Size(33, 13);
  484. this->label_Trn_Time->TabIndex = 5;
  485. this->label_Trn_Time->Text = L"Time:";
  486. //
  487. // label_Trn_Title
  488. //
  489. this->label_Trn_Title->AutoSize = true;
  490. this->label_Trn_Title->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Underline,
  491. System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
  492. this->label_Trn_Title->Location = System::Drawing::Point(2, 2);
  493. this->label_Trn_Title->Name = L"label_Trn_Title";
  494. this->label_Trn_Title->Size = System::Drawing::Size(160, 13);
  495. this->label_Trn_Title->TabIndex = 4;
  496. this->label_Trn_Title->Text = L"Current Speed and Cadence Tx:";
  497. //
  498. // BikeSpdCadSensor
  499. //
  500. this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  501. this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  502. this->ClientSize = System::Drawing::Size(786, 317);
  503. this->Controls->Add(this->panel_Display);
  504. this->Controls->Add(this->panel_Settings);
  505. this->Name = L"BikeSpdCadSensor";
  506. this->Text = L"Bike Speed and Cadence Simulator";
  507. this->panel_Settings->ResumeLayout(false);
  508. this->panel_Settings->PerformLayout();
  509. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdMaxOutput))->EndInit();
  510. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdMinOutput))->EndInit();
  511. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_SpdCurOutput))->EndInit();
  512. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_WheelCircumference))->EndInit();
  513. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_CadMaxOutput))->EndInit();
  514. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_CadMinOutput))->EndInit();
  515. (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown_Sim_CadCurOutput))->EndInit();
  516. this->panel_Display->ResumeLayout(false);
  517. this->panel_Display->PerformLayout();
  518. this->ResumeLayout(false);
  519. }
  520. #pragma endregion
  521. };