Commit 09148522 几米阳光

增加同时放两种料盘的测高。

1 个父辈 60c246fe
......@@ -215,14 +215,20 @@ namespace OnlineStore.ACSingleStore
double ai1Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI1_Addr);
double ai2Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI2_Addr);
double ai3Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI3_Addr);
double ai4Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI4_Addr);
//double ai3Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, 3);
txtAI1.Text = ai1Value.ToString();
txtAI2.Text = ai2Value.ToString();
txtAI3.Text = ai3Value.ToString();
txtAI4.Text = ai4Value.ToString();
//txtAI3.Text = ai3Value.ToString();
txtAIResult1.Text = KNDAIManager.ConvertAI(ai1Value,boxBean.Config.AIDI1_DefaultPosition).ToString();
txtAIResult2.Text = KNDAIManager.ConvertAI(ai2Value, boxBean.Config.AIDI2_DefaultPosition).ToString();
txtAIResult3.Text = KNDAIManager.ConvertAI(ai1Value, boxBean.Config.AIDI3_DefaultPosition).ToString();
txtAIResult4.Text = KNDAIManager.ConvertAI(ai2Value, boxBean.Config.AIDI4_DefaultPosition).ToString();
//txtAIResult3.Text = KNDAIManager.ConvertAI(ai3Value, boxBean.Config.AIDI3_DefaultPosition).ToString();
txtHeight.Text = boxBean.GetHeight().ToString();
......
......@@ -71,6 +71,9 @@
this.label49 = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.axis_1_Alarm = new UserFromControl.IOStatusControl();
this.axis_3_Alarm = new UserFromControl.IOStatusControl();
this.axis_2_Alarm = new UserFromControl.IOStatusControl();
this.label38 = new System.Windows.Forms.Label();
this.txtMiddleTarget = new System.Windows.Forms.TextBox();
this.txtInoutTarget = new System.Windows.Forms.TextBox();
......@@ -219,6 +222,7 @@
this.btnStoreHome = new System.Windows.Forms.Button();
this.btnSotreReset = new System.Windows.Forms.Button();
this.btnStoreStop = new System.Windows.Forms.Button();
this.btnStoreStart = new System.Windows.Forms.Button();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.btnAxisOff = new System.Windows.Forms.Button();
this.btnAxisOn = new System.Windows.Forms.Button();
......@@ -230,10 +234,6 @@
this.button4 = new System.Windows.Forms.Button();
this.btnClearL = new System.Windows.Forms.Button();
this.btnLogDebug = new System.Windows.Forms.Button();
this.btnStoreStart = new System.Windows.Forms.Button();
this.axis_1_Alarm = new UserFromControl.IOStatusControl();
this.axis_3_Alarm = new UserFromControl.IOStatusControl();
this.axis_2_Alarm = new UserFromControl.IOStatusControl();
this.groupBox5.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -803,7 +803,7 @@
this.richTextBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.richTextBox1.Location = new System.Drawing.Point(7, 9);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(545, 351);
this.richTextBox1.Size = new System.Drawing.Size(545, 337);
this.richTextBox1.TabIndex = 256;
this.richTextBox1.Text = "";
//
......@@ -838,6 +838,36 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "伺服状态";
//
// axis_1_Alarm
//
this.axis_1_Alarm.IOName = "";
this.axis_1_Alarm.IOValue = 0;
this.axis_1_Alarm.isCanClick = false;
this.axis_1_Alarm.Location = new System.Drawing.Point(127, 40);
this.axis_1_Alarm.Name = "axis_1_Alarm";
this.axis_1_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_1_Alarm.TabIndex = 264;
//
// axis_3_Alarm
//
this.axis_3_Alarm.IOName = "";
this.axis_3_Alarm.IOValue = 0;
this.axis_3_Alarm.isCanClick = false;
this.axis_3_Alarm.Location = new System.Drawing.Point(329, 40);
this.axis_3_Alarm.Name = "axis_3_Alarm";
this.axis_3_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_3_Alarm.TabIndex = 266;
//
// axis_2_Alarm
//
this.axis_2_Alarm.IOName = "";
this.axis_2_Alarm.IOValue = 0;
this.axis_2_Alarm.isCanClick = false;
this.axis_2_Alarm.Location = new System.Drawing.Point(224, 40);
this.axis_2_Alarm.Name = "axis_2_Alarm";
this.axis_2_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_2_Alarm.TabIndex = 265;
//
// label38
//
this.label38.AutoSize = true;
......@@ -2524,6 +2554,17 @@
this.btnStoreStop.UseVisualStyleBackColor = true;
this.btnStoreStop.Click += new System.EventHandler(this.停止ToolStripMenuItem_Click);
//
// btnStoreStart
//
this.btnStoreStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreStart.Location = new System.Drawing.Point(7, 4);
this.btnStoreStart.Name = "btnStoreStart";
this.btnStoreStart.Size = new System.Drawing.Size(132, 39);
this.btnStoreStart.TabIndex = 0;
this.btnStoreStart.Text = "启动";
this.btnStoreStart.UseVisualStyleBackColor = true;
this.btnStoreStart.Click += new System.EventHandler(this.启动ToolStripMenuItem_Click);
//
// tabPage5
//
this.tabPage5.Controls.Add(this.btnAxisOff);
......@@ -2651,47 +2692,6 @@
this.btnLogDebug.UseVisualStyleBackColor = true;
this.btnLogDebug.Click += new System.EventHandler(this.开启DEBUGToolStripMenuItem_Click);
//
// btnStoreStart
//
this.btnStoreStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreStart.Location = new System.Drawing.Point(7, 4);
this.btnStoreStart.Name = "btnStoreStart";
this.btnStoreStart.Size = new System.Drawing.Size(132, 39);
this.btnStoreStart.TabIndex = 0;
this.btnStoreStart.Text = "启动";
this.btnStoreStart.UseVisualStyleBackColor = true;
this.btnStoreStart.Click += new System.EventHandler(this.启动ToolStripMenuItem_Click);
//
// axis_1_Alarm
//
this.axis_1_Alarm.IOName = "";
this.axis_1_Alarm.IOValue = 0;
this.axis_1_Alarm.isCanClick = false;
this.axis_1_Alarm.Location = new System.Drawing.Point(127, 40);
this.axis_1_Alarm.Name = "axis_1_Alarm";
this.axis_1_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_1_Alarm.TabIndex = 264;
//
// axis_3_Alarm
//
this.axis_3_Alarm.IOName = "";
this.axis_3_Alarm.IOValue = 0;
this.axis_3_Alarm.isCanClick = false;
this.axis_3_Alarm.Location = new System.Drawing.Point(329, 40);
this.axis_3_Alarm.Name = "axis_3_Alarm";
this.axis_3_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_3_Alarm.TabIndex = 266;
//
// axis_2_Alarm
//
this.axis_2_Alarm.IOName = "";
this.axis_2_Alarm.IOValue = 0;
this.axis_2_Alarm.isCanClick = false;
this.axis_2_Alarm.Location = new System.Drawing.Point(224, 40);
this.axis_2_Alarm.Name = "axis_2_Alarm";
this.axis_2_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_2_Alarm.TabIndex = 265;
//
// FrmStoreBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -2706,7 +2706,6 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.Name = "FrmStoreBox";
this.Opacity = 0D;
this.Text = "AC_SA_料仓";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmTest_FormClosing);
......
......@@ -157,6 +157,7 @@ namespace OnlineStore.ACSingleStore
initValue();
this.ShowInTaskbar = true;
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
notifyIcon1.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
LoadOk = true;
cmbHomeType.SelectedIndex = 1;
......
......@@ -118,6 +118,9 @@ PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2920,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2960,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
PRO,模拟信号4默认高度,AIDI4_DefaultPosition,2500,,,,,,,
,,,,,,,,, ,
PRO,模拟信号1的地址,AIDI1_Addr,1,,,,,,,
PRO,模拟信号2的地址,AIDI2_Addr,2,,,,,,,
PRO,模拟信号1的地址,AIDI1_Addr,7,,,,,,,
PRO,模拟信号2的地址,AIDI2_Addr,8,,,,,,,
PRO,模拟信号3的地址,AIDI3_Addr,5,,,,,,,
PRO,模拟信号4的地址,AIDI4_Addr,6,,,,,,,
......@@ -1539,9 +1539,13 @@ namespace OnlineStore.DeviceLibrary
#region 高度传感器处理
public int GetSize()
{
if (Get13Height() > 0)
{
return 13;
}
return 7;
}
public int GetHeight()
public int Get7Height()
{
int result = 0;
if (KNDIOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
......@@ -1550,6 +1554,54 @@ namespace OnlineStore.DeviceLibrary
}
double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI1_Addr), Config.AIDI1_DefaultPosition);
double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI2_Addr), Config.AIDI2_DefaultPosition);
double Value = Math.Round((ai1Value + ai2Value) / 2, 1);
if (Value > 14)
{
result = 16;
}
else if (Value >= 10)
{
result = 12;
}
else if (Value >= 4)
{
if (ai1Value >= 9 || ai2Value >= 9)
{
result = 12;
}
else
{
result = 8;
}
}
else
{
result = 0;
}
return result;
}
public int GetHeight()
{
int value = Get13Height();
if (value > 0)
{
return value;
}else
{
return Get7Height();
}
}
public int Get13Height()
{
int result = 0;
if (KNDIOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
return result;
}
double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
double Value = Math.Round((ai1Value + ai2Value ) / 2, 1);
if (Value > 14)
{
......
......@@ -504,10 +504,14 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// PRO,模拟信号3默认高度,AIDI3_DefaultPosition,1,,,,,,,
/// </summary>
[ConfigProAttribute("AIDI3_DefaultPosition", true)]
[ConfigProAttribute("AIDI3_DefaultPosition", false )]
public double AIDI3_DefaultPosition { get; set; }
/// <summary>
/// PRO,模拟信号4默认高度,AIDI4_DefaultPosition,1,,,,,,,
/// </summary>
[ConfigProAttribute("AIDI4_DefaultPosition", false )]
public double AIDI4_DefaultPosition { get; set; }
/// <summary>
/// PRO 模拟信号1的地址 AIDI1_Addr 7
/// </summary>
......@@ -518,7 +522,16 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("AIDI2_Addr", true)]
public int AIDI2_Addr { get; set; }
/// <summary>
/// PRO 模拟信号3的地址 AIDI3_Addr 5
/// </summary>
[ConfigProAttribute("AIDI3_Addr", false )]
public int AIDI3_Addr { get; set; }
/// <summary>
/// PRO 模拟信号4的地址 AIDI4_Addr 6
/// </summary>
[ConfigProAttribute("AIDI4_Addr", false )]
public int AIDI4_Addr { get; set; }
//private List<string> TempAddrList = null;
//public static char TempAddrSpilt = '#';
///// <summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!