提交 abca2ec5 authored 作者: yangbinjay's avatar yangbinjay

v6增加电阻校准

上级 fe106ea5
......@@ -18,6 +18,7 @@ using GKHTRBC16P.RunLibrary;
using GKHTRBC16P.Protocol.Driboard;
using Newtonsoft.Json;
using OxyPlot;
using Sunny.UI.Win32;
namespace GKHTRBC16P.Jurisdiction
{
......@@ -186,92 +187,122 @@ namespace GKHTRBC16P.Jurisdiction
{
int WayId = uiComboBox1.Text.ToInt() -1;
worksheet = reoGridControl1.CurrentWorksheet;
var thor = CalculationAo.Thorous.Values.FirstOrDefault(x => x.Waytype == 0 || x.Waytype == 2);
if (Routinedr.Instance.Fboarddata(this, thor.ComId -1, WayId, 0X80 + WayId, CalculationAo.HTRBOT[WayId, 5], CalculationAo.HTRBOT[WayId, 6], CalculationAo.DevClickFlagSel) == 0)
//var thor = CalculationAo.Thorous.Values.FirstOrDefault(x => x.Waytype == 0 || x.Waytype == 2);
var thor = CalculationAo.Thorous[WayId + 1];
int comrx = -1;
if (new int[2] { 0, 2 }.Contains(thor.Waytype))
{
comrx = Routinedr.Instance.Fboarddata(this, thor.ComId - 1, WayId, 0X80 + WayId, CalculationAo.HTRBOT[WayId, 5], CalculationAo.HTRBOT[WayId, 6], CalculationAo.DevClickFlagSel);
}
else if (thor.Waytype == 7)//80V6
{
comrx = R80v6.Instance.FboarddataTestxw(this, thor.ComId - 1, WayId + 1, 0xA004, 0xA5, 0x03, 25);
}
else
{
return;
}
if (comrx == 0)
{
int[] ComdData = CalculationAo.ComdData[WayId];
if (ComdData[2] != 0xff)
if (ComdData[2] != 0xff && new int[2] { 0, 2 }.Contains(thor.Waytype))
return;
worksheet["A1"] = "Standard resistance Test NO." + uiComboBox1.Text;
worksheet["I3"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
double Vx = txt_LoadVolvate.IntValue;
double Sv = 0;
int Xa = 0;
int Xb = 0;
int AllCount = ComdData[7] * 256 + ComdData[8];
double IrDunit = 1;
if (AllCount < CalculationAo.ThisDevConfig.Editions)
{
worksheet["A1"] = "Standard resistance Test NO."+ uiComboBox1.Text;
worksheet["I3"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
double Vx = txt_LoadVolvate.IntValue;
double Sv = 0;
int Xa = 0;
int Xb = 0;
int AllCount = ComdData[7] * 256 + ComdData[8];
if (AllCount < CalculationAo.ThisDevConfig.Editions)
{
if (new int[2] { 0, 2 }.Contains(thor.Waytype))
Vx = ConvertDataOpear.OutV(ComdData[9], ComdData[11], ComdData[12], ComdData[13]);
double Ixmax = 0;
double Ixmin = 0;
var tdint = Convert.ToInt16(uiComboBox1.Text);
for (int i = 5; i < CalculationAo.Thorous[tdint].Snum + 5; i++)
else if (thor.Waytype == 7)//80V6
{
Vx = (double)Convert.ToUInt32(ComdData[339].ToString("X2") + ComdData[338].ToString("X2") + ComdData[337].ToString("X2") + ComdData[336].ToString("X2"), 16) / 100;
IrDunit = ConvertDataOpear.Unitmultiplier(WayId + 1, "nA");
}
double Ixmax = 0;
double Ixmin = 0;
var tdint = Convert.ToInt16(uiComboBox1.Text);
for (int i = 5; i < CalculationAo.Thorous[tdint].Snum + 5; i++)
{
if (Check_Actual.Checked)
{
if (Check_Actual.Checked)
{
worksheet["C" + i] = Vx;
int Rx = Convert.ToInt32(worksheet["B" + i]);
double Ix = 0;
if (Rx == 0)
Ix = 0;
else
Ix = Math.Round((double)Vx * 1000000 / Rx, 1);
worksheet["D" + i] = Ix;
Xa = txt_PerBegin.IntValue;
Xb = txt_PerEnd.IntValue;
Ixmax = Math.Round(Ix * (1 + (double)Xa / 100), 1) + Xb;
Ixmin = Math.Round(Ix * (1 - (double)Xa / 100), 1) - Xb;
worksheet["E" + i] = Ixmin;
worksheet["F" + i] = Ixmax;
}
double SI = ConvertDataOpear.OutI(ComdData[9], ComdData[5], ComdData[14 + 2 * (i-5)], ComdData[14 + 2 * (i-5) + 1]);
worksheet["G" + i] = Math.Round(SI, CalculationAo.ThisDevConfig.DataLength.Length - 2);
Ixmin = Convert.ToDouble(worksheet["E" + i]);
Ixmax = Convert.ToDouble(worksheet["F" + i]);
if (SI < Ixmin)
{
worksheet["H" + i] = " UL";
worksheet.Ranges["G" + i].Style.BackColor = Color.FromArgb(255, 204, 0);
}
else if (SI > Ixmax)
{
worksheet["H" + i] = " UH";
worksheet.Ranges["G" + i].Style.BackColor = Color.FromArgb(153, 204, 255);
}
worksheet["C" + i] = Vx;
int Rx = Convert.ToInt32(worksheet["B" + i]);
double Ix = 0;
if (Rx == 0)
Ix = 0;
else
{
worksheet["H" + i] = " OK";
worksheet.Ranges["G" + i].Style.BackColor = Color.FromArgb(255, 255, 255);
}
Ix = Math.Round((double)Vx * 1000000 / Rx, 1);
worksheet["D" + i] = Ix;
Xa = txt_PerBegin.IntValue;
Xb = txt_PerEnd.IntValue;
Ixmax = Math.Round(Ix * (1 + (double)Xa / 100), 1) + Xb;
Ixmin = Math.Round(Ix * (1 - (double)Xa / 100), 1) - Xb;
worksheet["E" + i] = Ixmin;
worksheet["F" + i] = Ixmax;
}
double SI = 0;
if (new int[2] { 0, 2 }.Contains(thor.Waytype))
SI = ConvertDataOpear.OutI(ComdData[9], ComdData[5], ComdData[14 + 2 * (i - 5)], ComdData[14 + 2 * (i - 5) + 1]);
else if (thor.Waytype == 7)//80V6
{
SI = (double)Convert.ToUInt32(ComdData[(i-5) * 4 + 18].ToString("X2") + ComdData[(i - 5) * 4 + 17].ToString("X2") + ComdData[(i - 5) * 4 + 16].ToString("X2") + ComdData[(i - 5) * 4 + 15].ToString("X2"), 16) * IrDunit;
SI = Math.Round(SI, CalculationAo.ThisDevConfig.DataLength.Length - 2);
}
worksheet["G" + i] = Math.Round(SI, CalculationAo.ThisDevConfig.DataLength.Length - 2);
Ixmin = Convert.ToDouble(worksheet["E" + i]);
Ixmax = Convert.ToDouble(worksheet["F" + i]);
if (SI < Ixmin)
{
worksheet["H" + i] = " UL";
worksheet.Ranges["G" + i].Style.BackColor = Color.FromArgb(255, 204, 0);
}
else if (SI > Ixmax)
{
worksheet["H" + i] = " UH";
worksheet.Ranges["G" + i].Style.BackColor = Color.FromArgb(153, 204, 255);
}
else
{
worksheet["H" + i] = " OK";
worksheet.Ranges["G" + i].Style.BackColor = Color.FromArgb(255, 255, 255);
}
uPublic.WriteLog((sender as UISymbolButton).Text);
}
else
{
for (int i = 5; i < CalculationAo.ThisDevConfig.Station + 5; i++)
worksheet["G" + i] = 0;
}
uPublic.WriteLog((sender as UISymbolButton).Text);
}
else
{
for (int i = 5; i < CalculationAo.ThisDevConfig.Station + 5; i++)
worksheet["G" + i] = 0;
}
if (new int[2] { 0, 2 }.Contains(thor.Waytype))
Sv = ConvertDataOpear.OutV(ComdData[9], ComdData[11], ComdData[12], ComdData[13]);
worksheet["E2"] = "Vol Meas: " + Sv + "V";
double Svx = txt_LoadVolvate.DoubleValue;
int Xa1 = txt_PerBegin.IntValue;
int Xa2 = txt_PerEnd.IntValue;
if (Sv < Svx * (1 - Xa1))
{
worksheet["H2"] = " UL";
worksheet.Ranges["H2"].Style.BackColor = Color.FromArgb(255, 204, 0);
}
else if (Sv > Svx * (1 + Xb))
{
worksheet["H2"] = " UH";
worksheet.Ranges["H2"].Style.BackColor = Color.FromArgb(153, 204, 255);
}
else
{
worksheet["H2"] = " OK";
worksheet.Ranges["H2"].Style.BackColor = Color.FromArgb(255, 255, 255);
}
else if (thor.Waytype == 7)//80V6
Sv = (double)Convert.ToUInt32(ComdData[339].ToString("X2") + ComdData[338].ToString("X2") + ComdData[337].ToString("X2") + ComdData[336].ToString("X2"), 16) / 100;
worksheet["E2"] = "Vol Meas: " + Sv + "V";
double Svx = txt_LoadVolvate.DoubleValue;
int Xa1 = txt_PerBegin.IntValue;
int Xa2 = txt_PerEnd.IntValue;
if (Sv < Svx * (1 - Xa1))
{
worksheet["H2"] = " UL";
worksheet.Ranges["H2"].Style.BackColor = Color.FromArgb(255, 204, 0);
}
else if (Sv > Svx * (1 + Xb))
{
worksheet["H2"] = " UH";
worksheet.Ranges["H2"].Style.BackColor = Color.FromArgb(153, 204, 255);
}
else
{
worksheet["H2"] = " OK";
worksheet.Ranges["H2"].Style.BackColor = Color.FromArgb(255, 255, 255);
}
uiLight1.State = UILightState.Off;
}
......
......@@ -37,10 +37,12 @@
this.uiDataGridView1 = new Sunny.UI.UIDataGridView();
this.uiSymbolButton1 = new Sunny.UI.UISymbolButton();
this.uiSymbolButton2 = new Sunny.UI.UISymbolButton();
this.uiLabel1 = new Sunny.UI.UILabel();
this.Column3 = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewComboBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).BeginInit();
this.SuspendLayout();
//
......@@ -72,7 +74,7 @@
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle3;
this.uiDataGridView1.Dock = System.Windows.Forms.DockStyle.Left;
this.uiDataGridView1.Dock = System.Windows.Forms.DockStyle.Top;
this.uiDataGridView1.EnableHeadersVisualStyles = false;
this.uiDataGridView1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiDataGridView1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(173)))), ((int)(((byte)(255)))));
......@@ -96,7 +98,7 @@
this.uiDataGridView1.RowTemplate.Height = 23;
this.uiDataGridView1.ScrollBarRectColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.uiDataGridView1.SelectedIndex = -1;
this.uiDataGridView1.Size = new System.Drawing.Size(306, 489);
this.uiDataGridView1.Size = new System.Drawing.Size(391, 404);
this.uiDataGridView1.TabIndex = 0;
this.uiDataGridView1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.uiDataGridView1.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.uiDataGridView1_DataError);
......@@ -105,7 +107,7 @@
//
this.uiSymbolButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiSymbolButton1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolButton1.Location = new System.Drawing.Point(312, 486);
this.uiSymbolButton1.Location = new System.Drawing.Point(286, 486);
this.uiSymbolButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiSymbolButton1.Name = "uiSymbolButton1";
this.uiSymbolButton1.Size = new System.Drawing.Size(100, 35);
......@@ -119,7 +121,7 @@
//
this.uiSymbolButton2.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiSymbolButton2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolButton2.Location = new System.Drawing.Point(313, 430);
this.uiSymbolButton2.Location = new System.Drawing.Point(152, 486);
this.uiSymbolButton2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiSymbolButton2.Name = "uiSymbolButton2";
this.uiSymbolButton2.Size = new System.Drawing.Size(100, 35);
......@@ -131,12 +133,39 @@
this.uiSymbolButton2.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.uiSymbolButton2.Click += new System.EventHandler(this.uiSymbolButton2_Click);
//
// uiLabel1
//
this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel1.Location = new System.Drawing.Point(3, 442);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(385, 29);
this.uiLabel1.TabIndex = 3;
this.uiLabel1.Text = "注意:多个通道以逗号分隔,如:PS1,PS2";
this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.uiLabel1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// Column3
//
this.Column3.DataPropertyName = "OvenId";
this.Column3.HeaderText = "烘箱";
this.Column3.Name = "Column3";
this.Column3.Width = 130;
//
// dataGridViewTextBoxColumn1
//
this.dataGridViewTextBoxColumn1.DataPropertyName = "PassagewayId";
this.dataGridViewTextBoxColumn1.HeaderText = "通道";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
//
// dataGridViewTextBoxColumn2
//
this.dataGridViewTextBoxColumn2.DataPropertyName = "PowerId";
this.dataGridViewTextBoxColumn2.HeaderText = "电源";
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
this.dataGridViewTextBoxColumn2.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewTextBoxColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn2.Width = 130;
//
// Column1
//
this.Column1.DataPropertyName = "PassagewayId";
......@@ -150,17 +179,13 @@
this.Column2.Name = "Column2";
this.Column2.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column3
//
this.Column3.DataPropertyName = "OvenId";
this.Column3.HeaderText = "烘箱";
this.Column3.Name = "Column3";
this.Column2.Width = 150;
//
// Frm_Correspondence
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(416, 524);
this.ClientSize = new System.Drawing.Size(391, 524);
this.Controls.Add(this.uiLabel1);
this.Controls.Add(this.uiDataGridView1);
this.Controls.Add(this.uiSymbolButton2);
this.Controls.Add(this.uiSymbolButton1);
......@@ -183,8 +208,10 @@
private Sunny.UI.UISymbolButton uiSymbolButton1;
private Sunny.UI.UISymbolButton uiSymbolButton2;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
private Sunny.UI.UILabel uiLabel1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewComboBoxColumn Column3;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
}
}
\ No newline at end of file
......@@ -31,6 +31,7 @@ namespace GKHTRBC16P.Jurisdiction
uiDataGridView1.AutoGenerateColumns = false;
uiDataGridView1.EditMode = DataGridViewEditMode.EditOnEnter;
FirstBind(true);
uiLabel1.AutoSize = true;
MultiLanguage.LoadLanguage(this, CalculationAo.ThisDevConfig.Language);
}
public override void Final()
......
......@@ -674,6 +674,7 @@
<Name>Frm_Correspondence</Name>
<Controls>
<Control name="Frm_Correspondence" text="设备对应关系维护"/>
<Control name="uiLabel1" text="注意:多个通道以逗号分隔,如:PS1,PS2"/>
<Control name="uiSymbolButton2" text="清空"/>
<Control name="uiSymbolButton1" text="保存"/>
</Controls>
......
......@@ -661,6 +661,7 @@
<Name>Frm_Correspondence</Name>
<Controls>
<Control name="Frm_Correspondence" text="Equipment Correspondence Maintenance"/>
<Control name="uiLabel1" text="Multiple channels are separated by commas, such as PS1, PS2"/>
<Control name="uiSymbolButton2" text="Empty"/>
<Control name="uiSymbolButton1" text="Save"/>
</Controls>
......
......@@ -1262,10 +1262,10 @@ namespace GKHTRBC16P.ToolLibrary
return;
}
if(value > 200000)
if(value > 2000000)
{
UIMessageBox.Show("IR上限不允许超过200000",true,false);
Txt_EleUpper.Text = "200000";
UIMessageBox.Show("IR上限不允许超过2000000",true,false);
Txt_EleUpper.Text = "2000000";
}
}
/// <summary>
......
......@@ -674,6 +674,7 @@
<Name>Frm_Correspondence</Name>
<Controls>
<Control name="Frm_Correspondence" text="设备对应关系维护"/>
<Control name="uiLabel1" text="注意:多个通道以逗号分隔,如:PS1,PS2"/>
<Control name="uiSymbolButton2" text="清空"/>
<Control name="uiSymbolButton1" text="保存"/>
</Controls>
......
......@@ -661,6 +661,7 @@
<Name>Frm_Correspondence</Name>
<Controls>
<Control name="Frm_Correspondence" text="Equipment Correspondence Maintenance"/>
<Control name="uiLabel1" text="Multiple channels are separated by commas, such as PS1, PS2"/>
<Control name="uiSymbolButton2" text="Empty"/>
<Control name="uiSymbolButton1" text="Save"/>
</Controls>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论