Commit b5cb8691 LN

温湿度修改,压紧轴P2位置配置

1 个父辈 5b3be174
......@@ -50,19 +50,17 @@
this.btnSotreReset = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnSaveCom = new System.Windows.Forms.Button();
this.txtComMax = new System.Windows.Forms.TextBox();
this.label47 = new System.Windows.Forms.Label();
this.txtComMin = new System.Windows.Forms.TextBox();
this.label48 = new System.Windows.Forms.Label();
this.btnCMove = new System.Windows.Forms.Button();
this.cmbPlateH = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.axisMoveControl1 = new OnlineStore.ACPackingStore.AxisMoveControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupHistory = new System.Windows.Forms.GroupBox();
this.txtHistoryTemp = new System.Windows.Forms.TextBox();
this.btnSelHistory = new System.Windows.Forms.Button();
this.label24 = new System.Windows.Forms.Label();
this.txtHistoryTime = new System.Windows.Forms.TextBox();
this.txtHistoryCount = new System.Windows.Forms.TextBox();
this.label30 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.txtHistoryHum = new System.Windows.Forms.TextBox();
this.txtCurrCount = new System.Windows.Forms.TextBox();
this.label26 = new System.Windows.Forms.Label();
this.label22 = new System.Windows.Forms.Label();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.btnSelTemp = new System.Windows.Forms.Button();
this.txtHum = new System.Windows.Forms.TextBox();
......@@ -117,13 +115,12 @@
this.btnUpDownP6 = new System.Windows.Forms.Button();
this.btnUpDownP3 = new System.Windows.Forms.Button();
this.btnUpDownP4 = new System.Windows.Forms.Button();
this.axisMoveControl1 = new OnlineStore.ACPackingStore.AxisMoveControl();
this.groupShelf.SuspendLayout();
this.panel1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupHistory.SuspendLayout();
this.groupBox7.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupInout.SuspendLayout();
......@@ -136,6 +133,8 @@
//
// groupShelf
//
this.groupShelf.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupShelf.Controls.Add(this.btnSaveShelf);
this.groupShelf.Controls.Add(this.label13);
this.groupShelf.Controls.Add(this.txtInoutP101);
......@@ -150,7 +149,7 @@
this.groupShelf.Enabled = false;
this.groupShelf.Location = new System.Drawing.Point(517, 201);
this.groupShelf.Name = "groupShelf";
this.groupShelf.Size = new System.Drawing.Size(236, 562);
this.groupShelf.Size = new System.Drawing.Size(236, 574);
this.groupShelf.TabIndex = 274;
this.groupShelf.TabStop = false;
this.groupShelf.Text = "料架位置";
......@@ -461,173 +460,173 @@
this.tabControl1.Location = new System.Drawing.Point(759, 71);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(595, 692);
this.tabControl1.Size = new System.Drawing.Size(595, 704);
this.tabControl1.TabIndex = 272;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Controls.Add(this.axisMoveControl1);
this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(587, 659);
this.tabPage1.Size = new System.Drawing.Size(587, 671);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服调试 ";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnSaveCom);
this.groupBox1.Controls.Add(this.txtComMax);
this.groupBox1.Controls.Add(this.label47);
this.groupBox1.Controls.Add(this.txtComMin);
this.groupBox1.Controls.Add(this.label48);
this.groupBox1.Controls.Add(this.btnCMove);
this.groupBox1.Controls.Add(this.cmbPlateH);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Enabled = false;
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(17, 529);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(544, 131);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "压紧轴位置配置";
//
// btnSaveCom
//
this.btnSaveCom.BackColor = System.Drawing.SystemColors.Control;
this.btnSaveCom.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSaveCom.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveCom.Location = new System.Drawing.Point(379, 77);
this.btnSaveCom.Name = "btnSaveCom";
this.btnSaveCom.Size = new System.Drawing.Size(105, 38);
this.btnSaveCom.TabIndex = 256;
this.btnSaveCom.Text = "保存位置";
this.btnSaveCom.UseVisualStyleBackColor = false;
this.btnSaveCom.Click += new System.EventHandler(this.btnSaveCom_Click);
//
// txtComMax
//
this.txtComMax.AcceptsReturn = true;
this.txtComMax.BackColor = System.Drawing.SystemColors.Window;
this.txtComMax.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtComMax.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtComMax.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtComMax.Location = new System.Drawing.Point(413, 35);
this.txtComMax.MaxLength = 12;
this.txtComMax.Name = "txtComMax";
this.txtComMax.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtComMax.Size = new System.Drawing.Size(82, 23);
this.txtComMax.TabIndex = 255;
this.txtComMax.Text = "1000";
//
// label47
//
this.label47.AutoSize = true;
this.label47.Cursor = System.Windows.Forms.Cursors.Default;
this.label47.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label47.ForeColor = System.Drawing.SystemColors.ControlText;
this.label47.Location = new System.Drawing.Point(392, 38);
this.label47.Name = "label47";
this.label47.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.label47.Size = new System.Drawing.Size(13, 17);
this.label47.TabIndex = 254;
this.label47.Text = "-";
this.label47.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtComMin
//
this.txtComMin.BackColor = System.Drawing.SystemColors.Window;
this.txtComMin.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtComMin.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtComMin.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtComMin.Location = new System.Drawing.Point(302, 35);
this.txtComMin.MaxLength = 12;
this.txtComMin.Name = "txtComMin";
this.txtComMin.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtComMin.Size = new System.Drawing.Size(82, 23);
this.txtComMin.TabIndex = 253;
this.txtComMin.Text = "1000";
//
// label48
//
this.label48.AutoSize = true;
this.label48.Cursor = System.Windows.Forms.Cursors.Default;
this.label48.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label48.ForeColor = System.Drawing.SystemColors.ControlText;
this.label48.Location = new System.Drawing.Point(211, 38);
this.label48.Name = "label48";
this.label48.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.label48.Size = new System.Drawing.Size(83, 17);
this.label48.TabIndex = 252;
this.label48.Text = "压紧位置范围:";
this.label48.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnCMove
//
this.btnCMove.AutoSize = true;
this.btnCMove.BackColor = System.Drawing.SystemColors.Control;
this.btnCMove.Cursor = System.Windows.Forms.Cursors.Default;
this.btnCMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCMove.ForeColor = System.Drawing.Color.Purple;
this.btnCMove.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnCMove.Location = new System.Drawing.Point(95, 82);
this.btnCMove.Name = "btnCMove";
this.btnCMove.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnCMove.Size = new System.Drawing.Size(174, 33);
this.btnCMove.TabIndex = 215;
this.btnCMove.Text = "移动至压紧点P2:";
this.btnCMove.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnCMove.UseVisualStyleBackColor = false;
this.btnCMove.Click += new System.EventHandler(this.btnCMove_Click);
//
// cmbPlateH
//
this.cmbPlateH.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPlateH.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cmbPlateH.FormattingEnabled = true;
this.cmbPlateH.Location = new System.Drawing.Point(95, 32);
this.cmbPlateH.Name = "cmbPlateH";
this.cmbPlateH.Size = new System.Drawing.Size(95, 28);
this.cmbPlateH.TabIndex = 176;
this.cmbPlateH.SelectedIndexChanged += new System.EventHandler(this.cmbPlateH_SelectedIndexChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Cursor = System.Windows.Forms.Cursors.Default;
this.label1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(30, 38);
this.label1.Name = "label1";
this.label1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.label1.Size = new System.Drawing.Size(59, 17);
this.label1.TabIndex = 175;
this.label1.Text = "选择盘高:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// axisMoveControl1
//
this.axisMoveControl1.Enabled = false;
this.axisMoveControl1.Location = new System.Drawing.Point(7, 7);
this.axisMoveControl1.Name = "axisMoveControl1";
this.axisMoveControl1.Size = new System.Drawing.Size(574, 529);
this.axisMoveControl1.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.groupHistory);
this.tabPage2.Controls.Add(this.groupBox7);
this.tabPage2.Location = new System.Drawing.Point(4, 29);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(587, 659);
this.tabPage2.Size = new System.Drawing.Size(587, 671);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 温湿度 ";
this.tabPage2.UseVisualStyleBackColor = true;
//
// groupHistory
//
this.groupHistory.Controls.Add(this.txtHistoryTemp);
this.groupHistory.Controls.Add(this.btnSelHistory);
this.groupHistory.Controls.Add(this.label24);
this.groupHistory.Controls.Add(this.txtHistoryTime);
this.groupHistory.Controls.Add(this.txtHistoryCount);
this.groupHistory.Controls.Add(this.label30);
this.groupHistory.Controls.Add(this.label23);
this.groupHistory.Controls.Add(this.txtHistoryHum);
this.groupHistory.Controls.Add(this.txtCurrCount);
this.groupHistory.Controls.Add(this.label26);
this.groupHistory.Controls.Add(this.label22);
this.groupHistory.Location = new System.Drawing.Point(13, 182);
this.groupHistory.Name = "groupHistory";
this.groupHistory.Size = new System.Drawing.Size(532, 177);
this.groupHistory.TabIndex = 260;
this.groupHistory.TabStop = false;
this.groupHistory.Text = "历史记录";
this.groupHistory.Visible = false;
//
// txtHistoryTemp
//
this.txtHistoryTemp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtHistoryTemp.Location = new System.Drawing.Point(103, 25);
this.txtHistoryTemp.MaxLength = 10;
this.txtHistoryTemp.Name = "txtHistoryTemp";
this.txtHistoryTemp.Size = new System.Drawing.Size(87, 26);
this.txtHistoryTemp.TabIndex = 254;
this.txtHistoryTemp.Text = "0";
//
// btnSelHistory
//
this.btnSelHistory.Location = new System.Drawing.Point(369, 106);
this.btnSelHistory.Name = "btnSelHistory";
this.btnSelHistory.Size = new System.Drawing.Size(137, 33);
this.btnSelHistory.TabIndex = 259;
this.btnSelHistory.Text = "查询记录信息";
this.btnSelHistory.UseVisualStyleBackColor = true;
this.btnSelHistory.Click += new System.EventHandler(this.btnSelHistory_Click);
//
// label24
//
this.label24.AutoSize = true;
this.label24.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label24.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label24.Location = new System.Drawing.Point(226, 32);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(71, 17);
this.label24.TabIndex = 249;
this.label24.Text = "记录总条数:";
this.label24.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtHistoryTime
//
this.txtHistoryTime.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtHistoryTime.Location = new System.Drawing.Point(103, 109);
this.txtHistoryTime.MaxLength = 10;
this.txtHistoryTime.Name = "txtHistoryTime";
this.txtHistoryTime.Size = new System.Drawing.Size(224, 26);
this.txtHistoryTime.TabIndex = 258;
this.txtHistoryTime.Text = "0";
//
// txtHistoryCount
//
this.txtHistoryCount.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtHistoryCount.Location = new System.Drawing.Point(324, 23);
this.txtHistoryCount.MaxLength = 10;
this.txtHistoryCount.Name = "txtHistoryCount";
this.txtHistoryCount.Size = new System.Drawing.Size(87, 26);
this.txtHistoryCount.TabIndex = 250;
this.txtHistoryCount.Text = "0";
//
// label30
//
this.label30.AutoSize = true;
this.label30.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label30.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label30.Location = new System.Drawing.Point(29, 114);
this.label30.Name = "label30";
this.label30.Size = new System.Drawing.Size(59, 17);
this.label30.TabIndex = 257;
this.label30.Text = "记录时间:";
this.label30.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label23
//
this.label23.AutoSize = true;
this.label23.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label23.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label23.Location = new System.Drawing.Point(226, 68);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(83, 17);
this.label23.TabIndex = 251;
this.label23.Text = "当前指针位置:";
this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtHistoryHum
//
this.txtHistoryHum.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtHistoryHum.Location = new System.Drawing.Point(103, 65);
this.txtHistoryHum.MaxLength = 10;
this.txtHistoryHum.Name = "txtHistoryHum";
this.txtHistoryHum.Size = new System.Drawing.Size(87, 26);
this.txtHistoryHum.TabIndex = 256;
this.txtHistoryHum.Text = "0";
//
// txtCurrCount
//
this.txtCurrCount.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtCurrCount.Location = new System.Drawing.Point(324, 64);
this.txtCurrCount.MaxLength = 10;
this.txtCurrCount.Name = "txtCurrCount";
this.txtCurrCount.Size = new System.Drawing.Size(87, 26);
this.txtCurrCount.TabIndex = 252;
this.txtCurrCount.Text = "0";
//
// label26
//
this.label26.AutoSize = true;
this.label26.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label26.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label26.Location = new System.Drawing.Point(17, 72);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(71, 17);
this.label26.TabIndex = 255;
this.label26.Text = "记录湿度值:";
this.label26.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label22
//
this.label22.AutoSize = true;
this.label22.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label22.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label22.Location = new System.Drawing.Point(17, 32);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(71, 17);
this.label22.TabIndex = 253;
this.label22.Text = "记录温度值:";
this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// groupBox7
//
this.groupBox7.Controls.Add(this.btnSelTemp);
......@@ -804,6 +803,8 @@
//
// groupInout
//
this.groupInout.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupInout.Controls.Add(this.lblTemp);
this.groupInout.Controls.Add(this.lblMsg);
this.groupInout.Controls.Add(this.btnSavePosition);
......@@ -845,7 +846,7 @@
this.groupInout.Enabled = false;
this.groupInout.Location = new System.Drawing.Point(7, 201);
this.groupInout.Name = "groupInout";
this.groupInout.Size = new System.Drawing.Size(503, 562);
this.groupInout.Size = new System.Drawing.Size(503, 574);
this.groupInout.TabIndex = 100;
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
......@@ -1433,19 +1434,11 @@
this.btnUpDownP4.UseVisualStyleBackColor = false;
this.btnUpDownP4.Click += new System.EventHandler(this.btnUpDownP4_Click);
//
// axisMoveControl1
//
this.axisMoveControl1.Enabled = false;
this.axisMoveControl1.Location = new System.Drawing.Point(7, 7);
this.axisMoveControl1.Name = "axisMoveControl1";
this.axisMoveControl1.Size = new System.Drawing.Size(574, 529);
this.axisMoveControl1.TabIndex = 0;
//
// FrmBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1364, 775);
this.ClientSize = new System.Drawing.Size(1364, 787);
this.Controls.Add(this.groupShelf);
this.Controls.Add(this.panel1);
this.Controls.Add(this.tabControl1);
......@@ -1463,9 +1456,9 @@
this.panel1.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.groupHistory.ResumeLayout(false);
this.groupHistory.PerformLayout();
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.groupBox3.ResumeLayout(false);
......@@ -1542,18 +1535,6 @@
private System.Windows.Forms.Button btnAxisOff;
private System.Windows.Forms.Button btnAxisOn;
private System.Windows.Forms.Button btnStoreStart;
private System.Windows.Forms.TextBox txtHistoryTemp;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.TextBox txtCurrCount;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.TextBox txtHistoryCount;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.TextBox txtHistoryTime;
private System.Windows.Forms.Label label30;
private System.Windows.Forms.TextBox txtHistoryHum;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.Button btnSelHistory;
private System.Windows.Forms.GroupBox groupHistory;
private System.Windows.Forms.CheckBox chbDebug;
private System.Windows.Forms.Label lblMoveEquipInfo;
private System.Windows.Forms.Panel panel1;
......@@ -1572,6 +1553,15 @@
private System.Windows.Forms.Button btnSaveShelf;
private System.Windows.Forms.Button btnUpdown;
private AxisMoveControl axisMoveControl1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox cmbPlateH;
public System.Windows.Forms.Label label1;
public System.Windows.Forms.Button btnCMove;
private System.Windows.Forms.Button btnSaveCom;
public System.Windows.Forms.TextBox txtComMax;
public System.Windows.Forms.Label label47;
public System.Windows.Forms.TextBox txtComMin;
public System.Windows.Forms.Label label48;
}
}
......@@ -36,6 +36,13 @@ namespace OnlineStore.ACPackingStore
private void FrmTest_Load(object sender, EventArgs e)
{
btnCMove.Tag = 0;
cmbPlateH.Items.Clear();
for (int i = 8; i <= 48; i = i + 4)
{
cmbPlateH.Items.Add(i.ToString());
}
cmbPlateH.SelectedIndex = 0;
LoadStore();
}
public void LoadStore()
......@@ -88,7 +95,7 @@ namespace OnlineStore.ACPackingStore
txtUpDownP4.Text = ktkPosition.UpdownAxis_IL_P4.ToString();
txtUpDownP5.Text = ktkPosition.UpdownAxis_OH_P5.ToString();
txtUpDownP6.Text = ktkPosition.UpdownAxis_OL_P6.ToString();
txtComP2.Text = ktkPosition.ComAxis_P2.ToString();
txtComP2.Text = BoxBean.Config.GetComP2(ktkPosition.BagHigh).TargetComP2().ToString();
txtComP3.Text = ktkPosition.ComAxis_P3.ToString();
txtInOutP3.Text = ktkPosition.InoutAxis_P3.ToString();
......@@ -103,15 +110,7 @@ namespace OnlineStore.ACPackingStore
chbDebug.Checked = BoxBean.IsDebug;
this.ShowInTaskbar = true;
txtTempPort.Text = BoxBean.Config.Humiture_Port;
if (HumitureController.HumitureControllerType.Equals(1))
{
groupHistory.Visible = true;
}
else
{
groupHistory.Visible = false;
}
txtTempPort.Text = BoxBean.Config.Humiture_Port;
LoadOk = true;
}
#endregion
......@@ -149,7 +148,7 @@ namespace OnlineStore.ACPackingStore
chbDebug.Checked = BoxBean.IsDebug;
LoadOk = true;
}
lblTemp.Text = BoxBean.currTempStr;
lblTemp.Text = BoxBean.humBean.currTempStr;
// lblMoveEquipInfo.Text = "移栽状态:"+(LineConnect.CanStartOut() ? "可出库":"不可出库" )+" "+LineConnect.LastUpdateTime.ToLongTimeString() ;
//忙碌状态不读取状态
//if (!BoxBean.storeRunStatus.Equals(StoreRunStatus.Busy))
......@@ -227,9 +226,9 @@ namespace OnlineStore.ACPackingStore
{
lblWarnMsg.Text = lblWarnMsg.Text + " 无门禁信号,请检查";
}
if (BoxBean.TempOrHumidityIsAlarm)
if (BoxBean.humBean.TempOrHumidityIsAlarm)
{
lblWarnMsg.Text = lblWarnMsg.Text + " 温湿度报警[" + BoxBean.TempAlarmTime.ToLongTimeString() + "]";
lblWarnMsg.Text = lblWarnMsg.Text + " 温湿度报警[" + BoxBean.humBean.TempAlarmTime.ToLongTimeString() + "]";
}
if (lblWarnMsg.Text.Equals(""))
{
......@@ -351,7 +350,7 @@ namespace OnlineStore.ACPackingStore
txtUpDownP4.Text = ktkPosition.UpdownAxis_IL_P4.ToString();
txtUpDownP5.Text = ktkPosition.UpdownAxis_OH_P5.ToString();
txtUpDownP6.Text = ktkPosition.UpdownAxis_OL_P6.ToString();
txtComP2.Text = ktkPosition.ComAxis_P2.ToString();
txtComP2.Text = BoxBean.Config.GetComP2(ktkPosition.BagHigh).TargetComP2().ToString();
txtComP3.Text = ktkPosition.ComAxis_P3.ToString();
txtInOutP3.Text = ktkPosition.InoutAxis_P3.ToString();
txtInOutP2.Text = ktkPosition.InOutAxis_P2.ToString();
......@@ -720,46 +719,26 @@ namespace OnlineStore.ACPackingStore
private void btnTempInit_Click(object sender, EventArgs e)
{
string port = txtTempPort.Text.ToString();
if (HumitureController.IsRun)
{
HumitureController.Release();
}
string port = txtTempPort.Text.ToString();
HumitureController.Init(port);
}
private void btnTempClose_Click(object sender, EventArgs e)
{
HumitureController.Release();
HumitureController.CloseAllPort();
}
private void btnSelTemp_Click(object sender, EventArgs e)
{
ASTemperateParam param = HumitureController.QueryData();
HumitureParam param = BoxBean.humBean.QueryData();
txtTemp.Text = param.Temperate.ToString();
txtHum.Text = param.Humidity.ToString();
}
private void btnSelHistory_Click(object sender, EventArgs e)
{
int count = HumitureController.QueryHistoryCount();
txtHistoryCount.Text = count.ToString();
int cuCount = HumitureController.QueryCurrCount();
txtCurrCount.Text = cuCount.ToString();
List<object> data = HumitureController.QueryHistory();
if (data.Count >= 3)
{
txtHistoryTemp.Text = data[0].ToString();
txtHistoryHum.Text = data[1].ToString();
txtHistoryTime.Text = data[2].ToString();
}
}
internal void DebugStatus(bool isDebug)
{
axisMoveControl1.Enabled = isDebug;
groupBox1.Enabled = isDebug;
axisMoveControl1.Enabled = isDebug;
groupInout.Enabled = isDebug;
groupShelf.Enabled = isDebug;
}
......@@ -871,6 +850,57 @@ namespace OnlineStore.ACPackingStore
frm.ShowDialog();
}
private void btnSaveCom_Click(object sender, EventArgs e)
{
if (cmbPlateH.SelectedIndex >= 0)
{
int height = Convert.ToInt32(cmbPlateH.Text);
int minValue = FormUtil.GetIntValue(txtComMin);
int maxValue = FormUtil.GetIntValue(txtComMax);
ComP2Info p2Info = new ComP2Info(height, minValue, maxValue);
BoxBean.Config.UpdateComP2(height, p2Info);
if (StoreManager.UpdateBoxConfig(BoxBean.Config))
{
LogUtil.info(BoxBean.Name + "更新ComP2 " + BoxBean.Config.CompAxis_P2_List);
}
else
{
MessageBox.Show("保存失败");
}
}
}
private void cmbPlateH_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbPlateH.SelectedIndex >= 0)
{
int height = Convert.ToInt32(cmbPlateH.Text);
ComP2Info p2Info = BoxBean.Config.GetComP2(height);
if (p2Info==(null))
{
txtComMin.Text = 0.ToString();
txtComMax.Text = 0.ToString();
btnCMove.Text = height + "mm盘压紧点P2:" + 0;
btnCMove.Tag = 0;
}
else
{
txtComMin.Text = p2Info.MinComP.ToString();
txtComMax.Text = p2Info.MaxComP.ToString();
btnCMove.Text = height + "mm盘压紧点P2:" + p2Info.TargetComP2();
btnCMove.Tag = p2Info.TargetComP2();
}
}
}
private void btnCMove_Click(object sender, EventArgs e)
{
int value = Convert.ToInt32(btnCMove.Tag);
if (value > 0)
{
AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P2_Speed);
}
}
}
}
......@@ -127,6 +127,7 @@ namespace OnlineStore.ACPackingStore
IOManager.instance.CloseAllDO();
IOManager.instance.CloseAllConnection();
HumitureController.CloseAllPort();
//AIManager.CloseConnect();
ACServerManager.CloseAllPort();
//this.Close();
......
......@@ -135,9 +135,9 @@
this.groupAxis.Controls.Add(this.comboBox1);
this.groupAxis.Controls.Add(this.label49);
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(9, 6);
this.groupAxis.Location = new System.Drawing.Point(5, 5);
this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(535, 320);
this.groupAxis.Size = new System.Drawing.Size(539, 320);
this.groupAxis.TabIndex = 217;
this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动";
......@@ -590,9 +590,9 @@
this.groupBox1.Controls.Add(this.label43);
this.groupBox1.Controls.Add(this.label42);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(9, 332);
this.groupBox1.Location = new System.Drawing.Point(5, 331);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(535, 182);
this.groupBox1.Size = new System.Drawing.Size(539, 182);
this.groupBox1.TabIndex = 218;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "伺服状态";
......@@ -819,7 +819,7 @@
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupAxis);
this.Name = "AxisMoveControl";
this.Size = new System.Drawing.Size(564, 529);
this.Size = new System.Drawing.Size(552, 525);
this.groupAxis.ResumeLayout(false);
this.groupAxis.PerformLayout();
this.groupBox1.ResumeLayout(false);
......
......@@ -15,93 +15,110 @@ namespace OnlineStore.Common
public class HumitureController
{
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static bool IsRun = false;
public static string serialPort = "";
private static int bautRate = 4800;//波特率
private static Parity parity = Parity.None;//校验位
private static int dataBits = 8;//数据位
private static StopBits stopBits = StopBits.One; //停止位
private static AcSerialBean sb = null;
private static string LogName = "";
public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType);
private static Dictionary<string, AcSerialBean> serialBeanMap = new Dictionary<string, AcSerialBean>();
public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType);
public static bool Init(string port)
{
if (IsRun && port.Equals(serialPort))
if (serialBeanMap.ContainsKey(port))
{
return true;
}
else if (IsRun)
{
Release();
}
LogName = "温湿度传感器[" + port + "]";
if (sb == null)
LogName = "温湿度传感器[" + port + "]";
AcSerialBean sb = null;
if (HumitureControllerType.Equals(1))
{
serialPort = port;
if (HumitureControllerType.Equals(1))
{
bautRate = 9600;//波特率
}
sb = new AcSerialBean(serialPort, bautRate, parity, dataBits, stopBits);
bautRate = 9600;//波特率
}
sb = new AcSerialBean(port, bautRate, parity, dataBits, stopBits);
try
{
if (sb.openPort())
{
IsRun = true;
return true;
}
else
{
LogUtil.error(LOGGER, LogName + "串口打开失败!");
IsRun = false;
LogUtil.error(LOGGER, LogName + "串口" + port + "打开失败!");
return false;
}
}
catch (Exception ex)
{
IsRun = false;
LogUtil.error("串口" + port + "打开失败:" + ex.ToString());
}
return true;
}
/// <summary>
/// 释放资源
/// </summary>
public static void Release()
public static void CloseAllPort()
{
if (sb != null)
List<string> kes = new List<string>(serialBeanMap.Keys);
foreach (string key in kes)
{
sb.closePort();
ClosePort(key);
}
IsRun = false;
}
public static ASTemperateParam LastData = new ASTemperateParam(0, 0);
public static ASTemperateParam QueryData()
private static void ClosePort(string portName)
{
ASTemperateParam param = new ASTemperateParam(0, 0);
List<double> data = queryData();
if (data.Count.Equals(2))
AcSerialBean bean = GetSerialBean(portName);
if (bean == null)
{
LogUtil.info("串口【" + portName + "】未打开,不需要关闭");
return;
}
//清理缓存
bean.clearInBuffer();
bean.clearOutBuffer();
bean.closePort();
if (serialBeanMap.ContainsKey(portName))
{
param = new ASTemperateParam(data[1], data[0]);
serialBeanMap.Remove(portName);
}
LastData = param;
LogUtil.info("温湿度控制器 关闭串口【" + portName + "】 ");
}
private static AcSerialBean GetSerialBean(string portName)
{
if (serialBeanMap.ContainsKey(portName))
{
return serialBeanMap[portName];
}
return null;
}
// public static ASTemperateParam LastData = new ASTemperateParam(0, 0);
public static HumitureParam QueryData(string port)
{
HumitureParam param = new HumitureParam(0, 0);
List<double> data = queryData(port );
if (data.Count.Equals(2))
{
param = new HumitureParam(data[1], data[0]);
}
return param;
}
/// <summary>
/// 返回温度和湿度
/// </summary>
/// <returns></returns>
private static List<double> queryData()
private static List<double> queryData(string port)
{
// 温度计算:
//当温度低于 0 ℃ 时温度数据以补码的形式上传。
//温度:FF9B H(十六进制)= -101 => 温度 = -10.1℃
//湿度计算:
//湿度:292 H(十六进制) = 658 => 湿度 = 65.8 % RH
if (IsRun.Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null)
{
return new List<double>();
}
......@@ -131,12 +148,13 @@ namespace OnlineStore.Common
}
public static int QueryHistoryCount()
public static int QueryHistoryCount(string port)
{
if (IsRun.Equals(false) || HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null|| HumitureControllerType.Equals(2).Equals(false))
{
return -1;
}
}
byte[] sendData = new byte[8];
sendData[0] = 0x01;
sendData[1] = 0x04;
......@@ -165,9 +183,10 @@ namespace OnlineStore.Common
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
return getReviceIntData(reviceData);
}
public static int QueryCurrCount()
public static int QueryCurrCount(string port)
{
if (IsRun.Equals(false) || HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null || HumitureControllerType.Equals(2).Equals(false))
{
return -1;
}
......@@ -188,10 +207,11 @@ namespace OnlineStore.Common
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
return getReviceIntData(reviceData);
}
public static List<object> QueryHistory()
public static List<object> QueryHistory(string port)
{
List<object> list = new List<object>();
if (IsRun.Equals(false)||HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null || HumitureControllerType.Equals(2).Equals(false))
{
return list;
}
......
......@@ -20,28 +20,28 @@ namespace OnlineStore.Common
/// <summary>
/// 最后一次接受到的温度信息,key=温湿度传感器IP地址
/// </summary>
public static Dictionary<string, ASTemperateParam> TemperateParamMap = new Dictionary<string, ASTemperateParam>();
public static Dictionary<string, HumitureParam> TemperateParamMap = new Dictionary<string, HumitureParam>();
/// <summary>
/// 根据IP 地址获得最后一次取到的温湿度
/// </summary>
public static ASTemperateParam GetTemperateParam(string ipAddr)
public static HumitureParam GetTemperateParam(string ipAddr)
{
ASTemperateParam temperate = null;
HumitureParam temperate = null;
TemperateParamMap.TryGetValue(ipAddr, out temperate);
return temperate;
}
/// <summary>
/// 显示用的温湿度信息(改为计算平均温湿度)
/// </summary>
public static ASTemperateParam GetTemperateParam(List<string> ipAddrList)
public static HumitureParam GetTemperateParam(List<string> ipAddrList)
{
ASTemperateParam temperate = null;
HumitureParam temperate = null;
int allCount = 0;
double wenDu = 0;
double shiDu = 0;
foreach (string addr in ipAddrList)
{
ASTemperateParam param = GetTemperateParam(addr);
HumitureParam param = GetTemperateParam(addr);
if (param != null && param.IsValid())
{
allCount++;
......@@ -53,7 +53,7 @@ namespace OnlineStore.Common
{
double avgWendu = Math.Round(wenDu / allCount, 1);
double avgShidu = Math.Round(shiDu / allCount, 1);
temperate = new ASTemperateParam(avgWendu, avgShidu);
temperate = new HumitureParam(avgWendu, avgShidu);
}
return temperate;
}
......@@ -62,7 +62,7 @@ namespace OnlineStore.Common
double maxValue = 0;
foreach (string addr in ipAddrList)
{
ASTemperateParam param = GetTemperateParam(addr);
HumitureParam param = GetTemperateParam(addr);
if (param != null && param.IsValid())
{
if (param.Humidity > maxValue)
......@@ -141,7 +141,7 @@ namespace OnlineStore.Common
else
{
double newShiDu = GetRandomSD();
ASTemperateParam ast = new ASTemperateParam(add, deviceId, pwd, wendu, newShiDu, DateTime.Now);
HumitureParam ast = new HumitureParam(add, deviceId, pwd, wendu, newShiDu, DateTime.Now);
if (TemperateParamMap.ContainsKey(add))
{
TemperateParamMap.Remove(add);
......@@ -165,7 +165,7 @@ namespace OnlineStore.Common
{
double newShiDu = GetRandomSD();
double newWenDu = GetRandomWD();
ASTemperateParam ast = new ASTemperateParam(IP, "", "", newWenDu, newShiDu, DateTime.Now);
HumitureParam ast = new HumitureParam(IP, "", "", newWenDu, newShiDu, DateTime.Now);
if (TemperateParamMap.ContainsKey(IP))
{
TemperateParamMap.Remove(IP);
......@@ -213,9 +213,9 @@ namespace OnlineStore.Common
/// <summary>
/// 奥松温湿度上传参数
/// </summary>
public class ASTemperateParam
public class HumitureParam
{
public ASTemperateParam(string clientipe, string add, string pwd, double wendu, double shidu, DateTime updateTime)
public HumitureParam(string clientipe, string add, string pwd, double wendu, double shidu, DateTime updateTime)
{
this.IpAddress = clientipe;
this.DeviceAddress = add;
......@@ -225,7 +225,7 @@ namespace OnlineStore.Common
this.UpdateTime = updateTime;
}
//获取平均值时使用此 参数,只做显示用
public ASTemperateParam(double wendu, double shidu)
public HumitureParam(double wendu, double shidu)
{
this.IpAddress = "";
this.DeviceAddress = "";
......

using OnlineStore.Common;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
......@@ -35,6 +35,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public Queue<string> EmprtShelfList = new Queue<string>();
public HumitureBean humBean = null;
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
private System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
public AC_BOX_Bean(AC_BOX_Config config)
......@@ -59,6 +60,9 @@ namespace OnlineStore.DeviceLibrary
Name = ("料仓BOX_" + config.DeviceID + " ").ToUpper();
this.DeviceID = config.DeviceID;
this.Config = config;
//温湿度
humBean = new HumitureBean(config.Humiture_Port,Name);
humBean.Init();
moveAxisList = new List<ConfigMoveAxis>();
MoveAxisConfig();
List<ACBoxPosition> positionList = CSVPositionReader<ACBoxPosition>.getPositionList();
......@@ -222,6 +226,7 @@ namespace OnlineStore.DeviceLibrary
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = StoreAlarmType.None;
......@@ -889,136 +894,7 @@ namespace OnlineStore.DeviceLibrary
}
#region 温湿度处理
/// <summary>
/// 湿度标准,超过后需要报警
/// </summary>
private float Max_Humidity = 0;
/// <summary>
/// 温度标准,超过后需要报警
/// </summary>
private float Max_Temperature = 0;
private bool IsInBlowing = false;
private DateTime LastBeginBlowTime = DateTime.Now;
private DateTime LastEndBlowTime = new DateTime(1997, 1, 1);
private DateTime preLogTime = DateTime.Now;
public bool TempOrHumidityIsAlarm = false;
public DateTime TempAlarmTime = DateTime.Now;
private float StartBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StartBlowValue);
private float StopBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StopBlowValue);
public string currTempStr = "";
private void HumidityProcess()
{
try
{
if ((DateTime.Now - preLogTime).TotalSeconds > 10)
{
preLogTime = DateTime.Now;
//用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
ASTemperateParam param = HumitureController.LastData;
double humidity = 0;
double temp = 0;
if (param != null)
{
humidity = param.Humidity;
temp = param.Temperate;
currTempStr = Name + ("当前湿度:" + humidity.ToString() + ",当前温度:" + temp);
}
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue;
float stopBlowHumidity = Max_Humidity - StopBlowValue;
//判断是否需要吹气
if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
{
//判断是否距离上次结束指定的时间
TimeSpan span = DateTime.Now - LastEndBlowTime;
if (span.TotalMinutes > this.Config.BlowAir_Interval)
{
LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",开始吹气湿度:" + startBlowHumidity + ",当前不在吹气中,且间隔超过" + Config.BlowAir_Interval + "分钟,开始吹气!");
IsInBlowing = true;
//Thread.Sleep(100);
IOMove(IO_Type.StartOrStopBlow, IO_VALUE.HIGH);
LastBeginBlowTime = DateTime.Now;
LastEndBlowTime = DateTime.Now;
}
}
if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
{
LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",停止吹气湿度:" + stopBlowHumidity + ",停止吹气!");
IsInBlowing = false;
IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
LastEndBlowTime = DateTime.Now;
}
if (IsInBlowing)
{
//判断是否需要结束吹气
TimeSpan span = DateTime.Now - LastBeginBlowTime;
if (span.TotalMinutes > this.Config.BlowAir_Time)
{
LogUtil.info(Name + "已经吹气" + span.TotalMinutes + "分钟,超过配置的吹气时间" + Config.BlowAir_Time + "分钟,停止吹气!");
IsInBlowing = false;
//Thread.Sleep(100);
IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
LastEndBlowTime = DateTime.Now;
}
}
bool needAlarm = false;
//如果开始吹气并且当前达到报警值
if (IsInBlowing && humidity > Max_Humidity)
{
needAlarm = true;
}
else if (temp > Max_Temperature && Max_Temperature > 0)
{
LogUtil.info(Name + "当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
needAlarm = true;
//Thread.Sleep(100);
IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
else if (temp < Max_Temperature)
{
if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
{
LogUtil.info(Name + "不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
TempOrHumidityIsAlarm = false;
//Thread.Sleep(100);
IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
}
else
{
TempOrHumidityIsAlarm = false;
}
if (needAlarm)
{
HTAlarm();
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
}
}
private void HTAlarm()
{
if (TempOrHumidityIsAlarm)
{
return;
}
TempAlarmTime = DateTime.Now;
TempOrHumidityIsAlarm = true;
}
#endregion
#region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作
private string CodeMsg = "";
......@@ -1044,8 +920,8 @@ namespace OnlineStore.DeviceLibrary
}
}
HumitureController.QueryData();
HumidityProcess();
//HumitureController.QueryData();
humBean.HumidityProcess(this);
}
catch (Exception ex)
{
......@@ -1121,7 +997,7 @@ namespace OnlineStore.DeviceLibrary
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.Temperate_Serveraddress);
ASTemperateParam param = HumitureController.LastData;
HumitureParam param = humBean.LastData;
if (param != null)
{
boxStatus.humidity = param.Humidity.ToString();
......@@ -1142,7 +1018,7 @@ namespace OnlineStore.DeviceLibrary
//构建发送给服务器的对象
Operation lineOperation = getLineBoxStatus();
//如果还没湿度范围,先获取
if (Max_Humidity <= 0 || (Max_Temperature <= 0))
if (humBean.NeedGetTem())
{
lineOperation.op = 5;
LogInfo("没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op);
......@@ -1166,7 +1042,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (resultOperation.op.Equals(5))
{
ProcessHumidityCMD(resultOperation);
humBean. ProcessHumidityCMD(resultOperation);
}
else
{
......@@ -1178,27 +1054,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
}
}
private void ProcessHumidityCMD(Operation resultOperation)
{
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.maxHumidity) && data.ContainsKey(ParamDefine.maxTemperature))
{
string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info("收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try
{
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info("保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
}
catch (Exception ex)
{
LogUtil.error("转换温湿度失败:" + ex.ToString());
}
}
}
private void ReviceOutStoreProcess(Operation resultOperation)
{
......
......@@ -164,10 +164,11 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_15_StartCompress))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_16_ComAxisDownMove);
InOutStoreLog("料架取料:检测到料叉压紧确认信号,再次向下压紧指定的值");
int currPosition = ACServerManager.GetActualtPosition(Config.Comp_Axis);
ComTargetPosition = currPosition;
int targetP = currPosition + Config.CompAxis_Down_Position;
LastHeight = Config.GetComP2PlateH(targetP);
InOutStoreLog("料架取料:检测到料叉压紧确认信号,向下押金【"+ComTargetPosition+"】目标【"+ targetP + "】,记录料盘高度【"+LastHeight+"】");
ACAxisMove(Config.Comp_Axis, targetP, Config.CompAxis_P1_Speed);
}
......@@ -498,7 +499,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (resultOperation.op.Equals(5))
{
ProcessHumidityCMD(resultOperation);
humBean.ProcessHumidityCMD(resultOperation);
}
else
{
......
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class HumitureBean
{
private string PortName = "";
private string Name = "";
public HumitureParam LastData = new HumitureParam(0, 0);
internal HumitureBean(string port,string deviceName)
{
this.Name = deviceName;
this.PortName = port;
}
public bool Init()
{
return HumitureController.Init(PortName);
}
public HumitureParam QueryData()
{
HumitureParam param = HumitureController.QueryData(PortName);
return param;
}
internal void ProcessHumidityCMD(Operation resultOperation)
{
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.maxHumidity) && data.ContainsKey(ParamDefine.maxTemperature))
{
string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info( Name+"收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try
{
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info(Name+"保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
}
catch (Exception ex)
{
LogUtil.error(Name+"转换温湿度失败:" + ex.ToString());
}
}
}
#region 温湿度处理
/// <summary>
/// 湿度标准,超过后需要报警
/// </summary>
private float Max_Humidity = 0;
/// <summary>
/// 温度标准,超过后需要报警
/// </summary>
private float Max_Temperature = 0;
private bool IsInBlowing = false;
private DateTime LastBeginBlowTime = DateTime.Now;
private DateTime LastEndBlowTime = new DateTime(1997, 1, 1);
private DateTime preLogTime = DateTime.Now;
public bool TempOrHumidityIsAlarm = false;
public DateTime TempAlarmTime = DateTime.Now;
private float StartBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StartBlowValue);
private float StopBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StopBlowValue);
public string currTempStr = "";
internal void HumidityProcess(AC_BOX_Bean box)
{
try
{
if ((DateTime.Now - preLogTime).TotalSeconds > 10)
{
preLogTime = DateTime.Now;
//用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
HumitureParam param = QueryData();
double humidity = 0;
double temp = 0;
if (param != null)
{
humidity = param.Humidity;
temp = param.Temperate;
currTempStr = Name + ("当前湿度:" + humidity.ToString() + ",当前温度:" + temp);
}
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue;
float stopBlowHumidity = Max_Humidity - StopBlowValue;
//判断是否需要吹气
if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
{
//判断是否距离上次结束指定的时间
TimeSpan span = DateTime.Now - LastEndBlowTime;
if (span.TotalMinutes > box.Config.BlowAir_Interval)
{
LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",开始吹气湿度:" + startBlowHumidity + ",当前不在吹气中,且间隔超过" + box.Config.BlowAir_Interval + "分钟,开始吹气!");
IsInBlowing = true;
//Thread.Sleep(100);
box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.HIGH);
LastBeginBlowTime = DateTime.Now;
LastEndBlowTime = DateTime.Now;
}
}
if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
{
LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",停止吹气湿度:" + stopBlowHumidity + ",停止吹气!");
IsInBlowing = false;
box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
LastEndBlowTime = DateTime.Now;
}
if (IsInBlowing)
{
//判断是否需要结束吹气
TimeSpan span = DateTime.Now - LastBeginBlowTime;
if (span.TotalMinutes > box.Config.BlowAir_Time)
{
LogUtil.info(Name + "已经吹气" + span.TotalMinutes + "分钟,超过配置的吹气时间" + box.Config.BlowAir_Time + "分钟,停止吹气!");
IsInBlowing = false;
//Thread.Sleep(100);
box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
LastEndBlowTime = DateTime.Now;
}
}
bool needAlarm = false;
//如果开始吹气并且当前达到报警值
if (IsInBlowing && humidity > Max_Humidity)
{
needAlarm = true;
}
else if (temp > Max_Temperature && Max_Temperature > 0)
{
LogUtil.info(Name + "当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
needAlarm = true;
//Thread.Sleep(100);
box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
else if (temp < Max_Temperature)
{
if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
{
LogUtil.info(Name + "不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
TempOrHumidityIsAlarm = false;
//Thread.Sleep(100);
box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
}
else
{
TempOrHumidityIsAlarm = false;
}
if (needAlarm)
{
HTAlarm();
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
}
}
private void HTAlarm()
{
if (TempOrHumidityIsAlarm)
{
return;
}
TempAlarmTime = DateTime.Now;
TempOrHumidityIsAlarm = true;
}
internal bool NeedGetTem()
{
if (Max_Humidity <= 0 || (Max_Temperature <= 0))
{
return true;
}
return false;
}
#endregion
}
}
......@@ -131,13 +131,18 @@ namespace OnlineStore.DeviceLibrary
/// 修改了料仓配置,更新缓存,更新配置文件(只能更新PRO的配置)
/// </summary>
/// <param name="kTK_LA_Store_Config"></param>
public static void UpdateBoxConfig(AC_BOX_Config storeConfig)
public static bool UpdateBoxConfig(AC_BOX_Config storeConfig)
{
try
{
//位置配置到文件中
string appPath = Application.StartupPath;
string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.BOX_ConfigPath);
if (!Directory.Exists(configFile))
{
configFile = configFile.Replace(".csv", "_" + storeConfig.DeviceID + ".csv");
}
bool result = CSVConfigReader.SaveBoxPosition(configFile, storeConfig);
if (!result)
......@@ -148,11 +153,12 @@ namespace OnlineStore.DeviceLibrary
Store.BoxConfigMap[storeConfig.DeviceID] = storeConfig;
Store.BoxMap[storeConfig.DeviceID].Config = storeConfig;
Store.BoxMap[storeConfig.DeviceID].MoveAxisConfig();
return true;
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
}
}return false;
}
public static bool LoadInoutParam(InOutParam param, AC_BOX_Bean box)
{
......@@ -192,7 +198,7 @@ namespace OnlineStore.DeviceLibrary
p.UpDown_P2 = box.Config.UpDownAxis_P2;
// p.UpDown_P7 = box.Config.UpDownAxis_DoorOBPosition_P7;
p.ComPress_P2 = position.ComAxis_P2;
p.ComPress_P2 = box.Config.GetComP2(position.BagHigh).TargetComP2();
p.ComPress_P3 = position.ComAxis_P3;
p.InOut_P3 = position.InoutAxis_P3;
p.Middle_P2 = position.MiddleAxis_P2;
......
......@@ -65,6 +65,7 @@
<Compile Include="ACPackingStore\AC_BOX_Bean.cs" />
<Compile Include="ACPackingStore\AC_BOX_Bean_Partial.cs" />
<Compile Include="ACPackingStore\AC_BOX_Bean_Shelf.cs" />
<Compile Include="ACPackingStore\HumitureBean.cs" />
<Compile Include="ACPackingStore\PackingStoreBean.cs" />
<Compile Include="ACPackingStore\PackingStoreBean_Partial.cs" />
<Compile Include="ACPackingStore\StoreManager.cs" />
......
......@@ -44,14 +44,15 @@ AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,,
AXIS,(轴四)压紧轴,Comp_Axis,4,COM1,0,,,,,
PRO,升降轴 NG料口放料点 P1,UpDownAxis_P1,403000,,,,,,,
PRO,升降轴 NG料口放料缓冲点 P2,UpDownAxis_P2,415000,,,,,,,
,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点/NG料口位置,MiddleAxis_P1,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompAxis_P1_Position,10000,,,,,,,
PRO,压紧轴(轴4)P3压紧前点,CompAxis_P3_Position,10000,,,,,,,
PRO,压紧轴(轴4)P4目标压紧点,CompAxis_P4_Position,10000,,,,,,,
PRO,压紧轴(轴4)压紧确认信号收到之后下降的位置,CompAxis_Down_Position,2000,,,,,,,
PRO,压紧轴(轴4)P2压紧点范围对应值(8=1000;2000#),CompAxis_P2_List,8=1000;2000#12=2001;3000#16=3001;4000#20=4001;5000#22=5001;6000#24=6001;7000# ,,,,,,,
,,,,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,,
......
......@@ -52,6 +52,7 @@ PRO,压紧轴(轴4)P1待机原位点,CompAxis_P1_Position,10000,,,,,,,
PRO,压紧轴(轴4)P3压紧前点,CompAxis_P3_Position,10000,,,,,,,
PRO,压紧轴(轴4)P4目标压紧点,CompAxis_P4_Position,10000,,,,,,,
PRO,压紧轴(轴4)压紧确认信号收到之后下降的位置,CompAxis_Down_Position,2000,,,,,,,
PRO,压紧轴(轴4)P2压紧点范围对应值(8=1000;2000#),CompAxis_P2_List,8=1000;2000#12=2001;3000#16=3001;4000#20=4001;5000#22=5001;6000#24=6001;7000# ,,,,,,,
,,,,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,,
......
......@@ -109,7 +109,7 @@ namespace OnlineStore.DeviceLibrary
return true;
}
public static void ColsePort(string portName)
public static void ClosePort(string portName)
{
AcSerialBean bean = GetSerialBean(portName);
if (bean == null)
......@@ -134,7 +134,7 @@ namespace OnlineStore.DeviceLibrary
List<string> kes = new List<string>(serialBeanMap.Keys);
foreach (string key in kes)
{
ColsePort(key);
ClosePort(key);
}
}
......
......@@ -226,6 +226,10 @@ namespace OnlineStore.LoadCSVLibrary
{
newLine = newLine + s + ",";
}
if (newLine.EndsWith(","))
{
newLine = newLine.Substring(0, newLine.Length - 1);
}
newLines[index] = newLine;
}
}
......
......@@ -497,6 +497,100 @@ namespace OnlineStore.LoadCSVLibrary
public int IsInDebug { get; set; }
private List<string> CameraList = null;
/// <summary>
/// PRO 压紧轴(轴4)P2压紧点范围对应值 CompAxis_P2_List 8 = 1000; 2000#12=2001;3000#16=3001;4000#20=4001;5000#22=5001;6000#24=6001;7000#
/// </summary>
[ConfigProAttribute("CompAxis_P2_List")]
public string CompAxis_P2_List { get; set; }
private List< ComP2Info> ComP2List = null;
public ComP2Info GetComP2(int plateh)
{
analysisComP2();
List<ComP2Info> list = (from m in ComP2List where m.PlateH.Equals(plateh) select m).ToList<ComP2Info>();
if (list.Count > 0)
{
return list[0];
}
return ComP2List.Count > 0 ? ComP2List[0] : null;
}
public int GetComP2PlateH(int currP)
{
analysisComP2();
List<ComP2Info> list = (from com in ComP2List where com.MinComP <= currP && com.MaxComP >= currP select com).ToList<ComP2Info>();
if (list.Count > 0)
{
return list[0].PlateH;
}
LOGGER.Error("GetComP2PlateH [" + currP + "] 未找到对应的盘高");
return 8;
}
public void UpdateComP2(int height, ComP2Info p2Info)
{
analysisComP2();
bool isUpdate = false;
foreach (ComP2Info p in ComP2List)
{
if (p.PlateH.Equals(height))
{
p.MinComP = p2Info.MinComP;
p.MaxComP = p2Info.MaxComP;
isUpdate = true;
}
}
if (!isUpdate)
{
ComP2List.Add(p2Info);
}
string tt = "";
foreach(ComP2Info p in ComP2List)
{
tt += ComP2InfoToStr(p);
}
CompAxis_P2_List = tt;
}
private string ComP2InfoToStr(ComP2Info p2)
{
return p2.PlateH + "=" + p2.MinComP + ";" + p2.MaxComP + "#";
}
private void analysisComP2()
{
if (ComP2List == null)
{
try
{
// 8 = 1000; 2000#12=2001;3000#16=3001;4000#20=4001;5000#22=5001;6000#24=6001;7000#
ComP2List = new List<ComP2Info>();
string[] arrayList = CompAxis_P2_List.Split('#');
foreach (string str in arrayList)
{
if (str.Equals(""))
{
continue;
}
string[] com2A = str.Split('=');
if (com2A.Length.Equals(2))
{
int plateH = Convert.ToInt32(com2A[0]);
string[] pArray = com2A[1].Split(';');
if (pArray.Length.Equals(2))
{
int minP = Convert.ToInt32(pArray[0]);
int maxP = Convert.ToInt32(pArray[1]);
ComP2List.Add(new ComP2Info(plateH, minP, maxP));
}
}
}
}
catch (Exception ex)
{
LOGGER.Error("解析CompAxis_P2_List【" + CompAxis_P2_List + "】出错:" + ex.ToString());
}
}
}
public List<string> GetCameraList()
{
if (CameraList == null)
......@@ -515,28 +609,7 @@ namespace OnlineStore.LoadCSVLibrary
return CameraList;
}
protected override void initMustHavePro()
{
//MustHaveDIList = new List<string>();
//MustHaveDOList = new List<string>();
//MustHaveDIList.Add(IO_Type.SuddenStop_BTN);
//MustHaveDIList.Add(IO_Type.Reset_BTN);
//MustHaveDIList.Add(IO_Type.DoorLimit);
//MustHaveDIList.Add(IO_Type.Airpressure_Check);
//MustHaveDIList.Add(IO_Type.TrayCheck_Door);
//MustHaveDIList.Add(IO_Type.TrayCheck_Fixture);
//MustHaveDIList.Add(IO_Type.Door_Up);
//MustHaveDIList.Add(IO_Type.Door_Down);
//MustHaveDOList.Add(IO_Type.AutoRun_HddLed);
//MustHaveDOList.Add(IO_Type.Alarm_HddLed);
//MustHaveDOList.Add(IO_Type.RunSign_HddLed);
//MustHaveDOList.Add(IO_Type.StartOrStopBlow);
//MustHaveDOList.Add(IO_Type.Run_Signal);
//MustHaveDOList.Add(IO_Type.Door_Up);
//MustHaveDOList.Add(IO_Type.Door_Down);
//MustHaveDOList.Add(IO_Type.Axis_Brake);
{
}
public static void ConfigAxis(AC_BOX_Config Config)
{
......@@ -595,6 +668,31 @@ namespace OnlineStore.LoadCSVLibrary
Config.Comp_Axis.CanErrorCountMin = 10;
Config.Comp_Axis.PositionMin = 0;
Config.Comp_Axis.PositionMax = 0;
}
}
}
public class ComP2Info
{
public ComP2Info()
{
}
public ComP2Info(int plateh, int minp, int maxp)
{
this.PlateH = plateh;
this.MinComP = minp;
this.MaxComP = maxp;
}
public int PlateH = 0;
public int MinComP = 0;
public int MaxComP = 0;
public int TargetComP2()
{
return (MinComP + MaxComP) / 2;
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!