|
|
@@ -46,47 +46,12 @@ namespace crusherScanner
|
|
|
backgroundWorker1.RunWorkerAsync(scanned);
|
|
|
}
|
|
|
TextBox1.Text = "";
|
|
|
+
|
|
|
+ ContaminateAlert(scanned.sampleData.HammerOil, scanned.barcode, "Hammer Oil", label5, Color.Maroon);
|
|
|
+ ContaminateAlert(scanned.sampleData.Manganese, scanned.barcode, "Manganese", label4, Color.Blue);
|
|
|
+ ContaminateAlert(scanned.sampleData.Plastic, scanned.barcode, "Plastic", label3, Color.Orange);
|
|
|
+ ContaminateAlert(scanned.sampleData.Pyrite, scanned.barcode, "Pyrite", label2, Color.Fuchsia);
|
|
|
|
|
|
- if (scanned.sampleData.HammerOil)
|
|
|
- {
|
|
|
- label5.Text = $"Sample {scanned.barcode} contains Hammer Oil";
|
|
|
- BackColor = Color.Maroon;
|
|
|
- label5.Show();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- label5.Hide();
|
|
|
- }
|
|
|
- if (scanned.sampleData.Manganese)
|
|
|
- {
|
|
|
- label4.Text = $"Sample {scanned.barcode} contains Manganese";
|
|
|
- BackColor = Color.Blue;
|
|
|
- label4.Show();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- label4.Hide();
|
|
|
- }
|
|
|
- if (scanned.sampleData.Plastic)
|
|
|
- {
|
|
|
- label3.Text = $"Sample {scanned.barcode} contains Plastic";
|
|
|
- BackColor = Color.Orange;
|
|
|
- label3.Show();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- label3.Hide();
|
|
|
- }
|
|
|
- if (scanned.sampleData.Pyrite)
|
|
|
- {
|
|
|
- label2.Text = $"Sample {scanned.barcode} contains Pyrite";
|
|
|
- BackColor = Color.Fuchsia;
|
|
|
- label2.Show();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- label2.Hide();
|
|
|
- }
|
|
|
if (!scanned.Contaminated)
|
|
|
{
|
|
|
label1.Text = scanned.message;
|
|
|
@@ -96,6 +61,7 @@ namespace crusherScanner
|
|
|
{
|
|
|
label1.Hide();
|
|
|
}
|
|
|
+
|
|
|
if (scanned.sampleData.Job != null)
|
|
|
{
|
|
|
label8.Text = $"Job in progress : {scanned.sampleData.Job}";
|
|
|
@@ -104,6 +70,7 @@ namespace crusherScanner
|
|
|
{
|
|
|
label8.Text = "";
|
|
|
}
|
|
|
+
|
|
|
if (scanned.BufferCount != -1)
|
|
|
{
|
|
|
toolStripStatusLabel2.Text = scanned.BufferCount.ToString();
|
|
|
@@ -111,6 +78,20 @@ namespace crusherScanner
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void ContaminateAlert(bool check,string bCode, string name,Label rtLabel, Color bColor)
|
|
|
+ {
|
|
|
+ if (check)
|
|
|
+ {
|
|
|
+ rtLabel.Text = $"Sample {bCode} contains {name}";
|
|
|
+ BackColor = bColor;
|
|
|
+ rtLabel.Show();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ rtLabel.Hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
this.Close();
|