Skip to content

Commit a3afba0

Browse files
committed
Minor bux fixes, correctly visible items based on type, buttons now not disappearing
1 parent f3f7625 commit a3afba0

3 files changed

Lines changed: 75 additions & 6 deletions

File tree

QS_DS_Program/QS_DS_Program.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@
120120
<metadata name="Tips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121121
<value>17, 17</value>
122122
</metadata>
123-
<metadata name="Tips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124-
<value>17, 17</value>
125-
</metadata>
126123
<metadata name="MainSerialPort.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127124
<value>90, 17</value>
128125
</metadata>

QS_DS_Program/QS_DS_Program_Data_Handling.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private void ReceivedDataHandle(object sender, EventArgs e)
1919
}
2020
else if (SplitData[0].Equals("T"))
2121
{
22-
DisableFunctionAll();
22+
DisableFunctionsWorking();
2323
FunctionsAssignValues(SplitData);
2424
FunctionsShowTable();
2525
}

QS_DS_Program/QS_DS_Program_Interface_Control.cs

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,76 @@ private void DisableFunctionAll()
195195
{
196196
QS1Numerics[i].Visible = false;
197197
}
198+
for (int i = 0; i < QS2Labels.Count; i++)
199+
{
200+
QS2Labels[i].Visible = false;
201+
}
202+
for (int i = 0; i < QS2Numerics.Count; i++)
203+
{
204+
QS2Numerics[i].Visible = false;
205+
}
206+
for (int i = 0; i < DSCheckbox.Count; i++)
207+
{
208+
DSCheckbox[i].Visible = false;
209+
}
210+
for (int i = 0; i < DSButton.Count; i++)
211+
{
212+
DSButton[i].Visible = false;
213+
}
214+
for (int i = 0; i < DS1Labels.Count; i++)
215+
{
216+
DS1Labels[i].Visible = false;
217+
}
218+
for (int i = 0; i < DS1Numerics.Count; i++)
219+
{
220+
DS1Numerics[i].Visible = false;
221+
}
222+
}
223+
224+
private void DisableFunctionsWorking()
225+
{
226+
Tabs_All.Visible = false;
227+
Tabs_All.TabPages.Remove(GeneralPage);
228+
Tabs_All.TabPages.Remove(QSPage);
229+
Tabs_All.TabPages.Remove(DSPage);
230+
231+
for (int i = 0; i < GeneralLabels.Count; i++)
232+
{
233+
GeneralLabels[i].Visible = false;
234+
}
235+
236+
for (int i = 0; i < GeneralNumerics.Count; i++)
237+
{
238+
GeneralNumerics[i].Visible = false;
239+
}
240+
for (int i = 0; i < GeneralBar.Count; i++)
241+
{
242+
GeneralBar[i].Visible = false;
243+
}
244+
for (int i = 0; i < QSCheckbox.Count; i++)
245+
{
246+
QSCheckbox[i].Visible = false;
247+
}
248+
for (int i = 0; i < QSButton.Count; i++)
249+
{
250+
QSButton[i].Visible = false;
251+
}
252+
for (int i = 0; i < QS1Labels.Count; i++)
253+
{
254+
QS1Labels[i].Visible = false;
255+
}
256+
for (int i = 0; i < QS1Numerics.Count; i++)
257+
{
258+
QS1Numerics[i].Visible = false;
259+
}
260+
for (int i = 0; i < QS2Labels.Count; i++)
261+
{
262+
QS2Labels[i].Visible = false;
263+
}
264+
for (int i = 0; i < QS2Numerics.Count; i++)
265+
{
266+
QS2Numerics[i].Visible = false;
267+
}
198268
for (int i = 0; i < DSCheckbox.Count; i++)
199269
{
200270
DSCheckbox[i].Visible = false;
@@ -250,7 +320,7 @@ private string GenerateNumericData()
250320
}
251321
for (int i = 1; i < NumericData.Count; i++)
252322
{
253-
message += NumericData[i] + ",";
323+
message += NumericData[i].Value + ",";
254324
}
255325
return message;
256326
}
@@ -270,6 +340,7 @@ private void FunctionsEnableConnection()
270340
}
271341
Connect_BTN.Text = "Disconnect";
272342
comboBox1.Enabled = false;
343+
Refresh_BTN.Enabled = false;
273344
}
274345

275346
private void FunctionsEnableGeneral()
@@ -299,6 +370,7 @@ private void FunctionsBase()
299370
Connect_BTN.Text = "Connect";
300371
DisableFunctionAll();
301372
comboBox1.Enabled = true;
373+
Refresh_BTN.Enabled = true;
302374
}
303375
private void FunctionsAssignValues(string[] splitData)
304376
{
@@ -341,7 +413,7 @@ private void FunctionsAssignValues(string[] splitData)
341413

342414
for (int i = 1; i < NumericData.Count; i++)
343415
{
344-
NumericData[i].Value = Int32.Parse(splitData[i + 9]);
416+
NumericData[i].Value = Int32.Parse(splitData[i + 8]);
345417
}
346418
}
347419

0 commit comments

Comments
 (0)