Commit 6f873fa3 authored by wangwanxh@sina.com's avatar wangwanxh@sina.com

报警值

parent c4156cc6
...@@ -96,11 +96,13 @@ ...@@ -96,11 +96,13 @@
// //
// textBox1 // textBox1
// //
this.textBox1.BackColor = System.Drawing.SystemColors.Window;
this.textBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(6, 67); this.textBox1.Location = new System.Drawing.Point(6, 67);
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(116, 29); this.textBox1.Size = new System.Drawing.Size(116, 29);
this.textBox1.TabIndex = 5; this.textBox1.TabIndex = 5;
this.textBox1.DoubleClick += new System.EventHandler(this.textBox1_DoubleClick);
// //
// textBox2 // textBox2
// //
...@@ -139,7 +141,7 @@ ...@@ -139,7 +141,7 @@
this.groupBox1.Size = new System.Drawing.Size(131, 413); this.groupBox1.Size = new System.Drawing.Size(131, 413);
this.groupBox1.TabIndex = 8; this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "结果(ppm)"; this.groupBox1.Text = "结果(ppm)";
// //
// textBox6 // textBox6
// //
......
...@@ -29,6 +29,24 @@ namespace GcDevicePc.CK_UI ...@@ -29,6 +29,24 @@ namespace GcDevicePc.CK_UI
GraphPane myPanejiaben; GraphPane myPanejiaben;
GraphPane myPaneerjiaben; GraphPane myPaneerjiaben;
public int Systemtype { get; set; } public int Systemtype { get; set; }
/// <summary>
/// true ppm false mg/m³
/// </summary>
public bool isppm = false;
/// <summary>
/// 系统故障
/// </summary>
Color errcolor = Color.Magenta;
/// <summary>
/// 超标报警
/// </summary>
Color waringcolor = Color.Crimson;
/// <summary>
/// 正常
/// </summary>
Color zcolor = Color.White;
public UserCtl() public UserCtl()
{ {
InitializeComponent(); InitializeComponent();
...@@ -39,7 +57,7 @@ namespace GcDevicePc.CK_UI ...@@ -39,7 +57,7 @@ namespace GcDevicePc.CK_UI
try try
{ {
Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype; Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype;
switch (Systemtype) switch (Systemtype)
{ {
default: //非甲烷总烃 default: //非甲烷总烃
...@@ -243,9 +261,73 @@ namespace GcDevicePc.CK_UI ...@@ -243,9 +261,73 @@ namespace GcDevicePc.CK_UI
return; return;
} }
textBox1.Text =Math.Round(listNmoc[listNmoc.Count - 1].Y,2).ToString() + "ppm";
textBox2.Text =Math.Round(listTHC[listTHC.Count - 1].Y,2).ToString() + "ppm"; for (int i = 0; i < CKVocAnalyzer.GlobalCKV.vocparamlist.Count; i++)
textBox3.Text =Math.Round(listCH4[listCH4.Count - 1].Y,2).ToString() + "ppm"; {
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[0].name)
{
if (isppm)
{
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listNmoc[listNmoc.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox1.BackColor = waringcolor;
}
else
textBox1.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[1].name)
{
if (isppm)
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listTHC[listTHC.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox2.BackColor = waringcolor;
}
else
textBox2.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[2].name)
{
if (isppm)
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listCH4[listCH4.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox3.BackColor = waringcolor;
}
else
textBox3.BackColor = zcolor;
}
}
mster.PaneList.Clear(); mster.PaneList.Clear();
myPaneCh4.CurveList.Clear(); myPaneCh4.CurveList.Clear();
myPaneNmoc.CurveList.Clear(); myPaneNmoc.CurveList.Clear();
...@@ -306,6 +388,129 @@ namespace GcDevicePc.CK_UI ...@@ -306,6 +388,129 @@ namespace GcDevicePc.CK_UI
textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString() + "ppm"; textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString() + "ppm";
textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString() + "ppm"; textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString() + "ppm";
textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString() + "ppm"; textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString() + "ppm";
for (int i = 0; i < CKVocAnalyzer.GlobalCKV.vocparamlist.Count; i++)
{
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[0].name)
{
if (isppm)
{
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listNmoc[listNmoc.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox1.BackColor = waringcolor;
}
else
textBox1.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[1].name)
{
if (isppm)
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listTHC[listTHC.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox2.BackColor = waringcolor;
}
else
textBox2.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[2].name)
{
if (isppm)
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listCH4[listCH4.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox3.BackColor = waringcolor;
}
else
textBox3.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[3].name)
{
if (isppm)
{
textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox4.Text = Math.Round(listben[listben.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listben[listben.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox4.BackColor = waringcolor;
}
else
textBox4.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[4].name)
{
if (isppm)
{
textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listjiaben[listjiaben.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox5.BackColor = waringcolor;
}
else
textBox5.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[5].name)
{
if (isppm)
{
textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listerjiaben[listerjiaben.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox6.BackColor = waringcolor;
}
else
textBox6.BackColor = zcolor;
}
}
mster.PaneList.Clear(); mster.PaneList.Clear();
myPaneCh4.CurveList.Clear(); myPaneCh4.CurveList.Clear();
myPaneNmoc.CurveList.Clear(); myPaneNmoc.CurveList.Clear();
...@@ -533,5 +738,38 @@ namespace GcDevicePc.CK_UI ...@@ -533,5 +738,38 @@ namespace GcDevicePc.CK_UI
} }
private void textBox1_DoubleClick(object sender, EventArgs e)
{
isppm = !isppm;
if(isppm)
{
groupBox1.Text = "结果(ppm)";
}else
groupBox1.Text = "结果(mg/m³)";
try
{
switch (Systemtype)
{
default: //非甲烷总烃
data();
datadisp();
UIVisible(false);
break;
case 1:
data2();
datadisp2();
break;
}
// Trace.WriteLine("绘图","sys");
}
catch (Exception ex)
{
Trace.Write(ex);
}
}
} }
} }
...@@ -398,7 +398,7 @@ namespace GcDevicePc ...@@ -398,7 +398,7 @@ namespace GcDevicePc
float fDetvalueold = 0.0f; float fDetvalueold = 0.0f;
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
this.Text = String.Format("VOCs在线监测-1.1.3.07 {0}",Formstr); this.Text = String.Format("VOCs在线监测-1.1.3.08 {0}",Formstr);
if (LandIn.Island) if (LandIn.Island)
{ {
HmiStatus.Text = String.Format("状态:{0}", statestr); HmiStatus.Text = String.Format("状态:{0}", statestr);
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment