Commit b587e1aa LN

增加离线工作模式

1 个父辈 ea020d2e
...@@ -172,6 +172,7 @@ namespace TSA_V.Common ...@@ -172,6 +172,7 @@ namespace TSA_V.Common
public static string SideCylinderMoveFirst = "SideCylinderMoveFirst"; public static string SideCylinderMoveFirst = "SideCylinderMoveFirst";
public static string WorkSingleStart = "WorkSingleStart"; public static string WorkSingleStart = "WorkSingleStart";
public static string OfflineMode = "OfflineMode";
public static string PointDisplayType = "PointDisplayType"; public static string PointDisplayType = "PointDisplayType";
} }
......
...@@ -26,8 +26,9 @@ namespace TSA_V.DeviceLibrary ...@@ -26,8 +26,9 @@ namespace TSA_V.DeviceLibrary
private static DateTime StartWorkTime = DateTime.Now; private static DateTime StartWorkTime = DateTime.Now;
public static bool OnlyGuoBan = false; public static bool OnlyGuoBan = false;
public static bool WorkSingleStart = false; public static bool WorkSingleStart = false;
public static bool OpenOfflineMode = false;
private static void StartLineCheck() private static void StartLineCheck()
{ {
if (WarnMsg.Contains("超时") || WarnMsg.ToLower().Contains("timeout")) if (WarnMsg.Contains("超时") || WarnMsg.ToLower().Contains("timeout"))
...@@ -64,7 +65,7 @@ namespace TSA_V.DeviceLibrary ...@@ -64,7 +65,7 @@ namespace TSA_V.DeviceLibrary
CylinderReset(true); CylinderReset(true);
} }
} }
} else if (WorkSingleStart) } else if (WorkSingleStart||OpenOfflineMode )
{ {
if ( (IOManager.IOValue(IOManager.LineWorkCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IOManager.LineOutCheck).Equals(IO_VALUE.LOW))) if ( (IOManager.IOValue(IOManager.LineWorkCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IOManager.LineOutCheck).Equals(IO_VALUE.LOW)))
{ {
...@@ -273,6 +274,16 @@ namespace TSA_V.DeviceLibrary ...@@ -273,6 +274,16 @@ namespace TSA_V.DeviceLibrary
} }
else if (LineStep.IsStep(StepEnum.LS12_StopDown)) else if (LineStep.IsStep(StepEnum.LS12_StopDown))
{ {
if (OpenOfflineMode)
{
//等待工作位信号消失,消失后流程结束
LineStep.NextStep(StepEnum.LS31_WaitWorkSingleLeave);
LineLog("流水线转动:离线工作模式,等待工作位信号消失");
IOManager.IOMove(IOManager.Line_FStart, IO_VALUE.LOW);
LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.LineWorkCheck, IO_VALUE.LOW));
}
else
{
LineStep.NextStep(StepEnum.LS13_LineRun); LineStep.NextStep(StepEnum.LS13_LineRun);
LineLog("流水线转动:阻挡气缸下降完成,开始启动流水线"); LineLog("流水线转动:阻挡气缸下降完成,开始启动流水线");
LineStep.TimeOutSeconds = 60; LineStep.TimeOutSeconds = 60;
...@@ -281,6 +292,8 @@ namespace TSA_V.DeviceLibrary ...@@ -281,6 +292,8 @@ namespace TSA_V.DeviceLibrary
LineStep.WaitList.Add(WaitResultInfo.WaitTime(60000)); LineStep.WaitList.Add(WaitResultInfo.WaitTime(60000));
LineStep.OneWaitOk = true; LineStep.OneWaitOk = true;
} }
}
else if (LineStep.IsStep(StepEnum.LS13_LineRun)) else if (LineStep.IsStep(StepEnum.LS13_LineRun))
{ {
//if (LoopTest) //if (LoopTest)
...@@ -352,6 +365,12 @@ namespace TSA_V.DeviceLibrary ...@@ -352,6 +365,12 @@ namespace TSA_V.DeviceLibrary
IOManager.IOMove(IOManager.SMEMA_Up, IO_VALUE.HIGH); IOManager.IOMove(IOManager.SMEMA_Up, IO_VALUE.HIGH);
LineStep.EndMove(); LineStep.EndMove();
} }
else if (LineStep.IsStep(StepEnum.LS31_WaitWorkSingleLeave))
{
TimeSpan span = DateTime.Now - StartWorkTime;
LineLog("流水线转动:工作位信号已消失,离线模式结束,耗时【" + FormUtil.GetSpanStr(span) + "】");
LineStep.EndMove();
}
//else if (LineStep.IsStep(StepEnum.LS21_LineBackMovew)) //else if (LineStep.IsStep(StepEnum.LS21_LineBackMovew))
//{ //{
// TimeSpan span = DateTime.Now - StartWorkTime; // TimeSpan span = DateTime.Now - StartWorkTime;
...@@ -615,6 +634,11 @@ namespace TSA_V.DeviceLibrary ...@@ -615,6 +634,11 @@ namespace TSA_V.DeviceLibrary
LS21_LineBackMovew, LS21_LineBackMovew,
LS22_StartBackLine, LS22_StartBackLine,
/// <summary>
/// 离线工作模式,工作完成阻挡放开,等待工作位信号消失
/// </summary>
LS31_WaitWorkSingleLeave,
} }
} }
...@@ -2444,4 +2444,5 @@ ...@@ -2444,4 +2444,5 @@
<data name = "FrmAddBoard_likDownFile_Text" xml:space = "preserve"> <value>Template download</value> </data> <data name = "FrmAddBoard_likDownFile_Text" xml:space = "preserve"> <value>Template download</value> </data>
<data name = "FrmAddBoard_rdbUpload_Text" xml:space = "preserve"> <value> Uploader program </value> </data> <data name = "FrmAddBoard_rdbUpload_Text" xml:space = "preserve"> <value> Uploader program </value> </data>
<data name = "FrmAddBoard_rdbSelCom_Text" xml:space = "preserve"> <value> Select position </value> </data> <data name = "FrmAddBoard_rdbSelCom_Text" xml:space = "preserve"> <value> Select position </value> </data>
<data name = "FrmBoardSelect_chbOffLine_Text" xml:space = "preserve"> <value> Offline mode </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -2458,5 +2458,5 @@ ...@@ -2458,5 +2458,5 @@
<data name = "FrmAddBoard_likDownFile_Text" xml:space = "preserve"> <value> 下载模板 </value> </data> <data name = "FrmAddBoard_likDownFile_Text" xml:space = "preserve"> <value> 下载模板 </value> </data>
<data name = "FrmAddBoard_rdbUpload_Text" xml:space = "preserve"> <value> 上传程序 </value> </data> <data name = "FrmAddBoard_rdbUpload_Text" xml:space = "preserve"> <value> 上传程序 </value> </data>
<data name = "FrmAddBoard_rdbSelCom_Text" xml:space = "preserve"> <value> 选择元器件库 </value> </data> <data name = "FrmAddBoard_rdbSelCom_Text" xml:space = "preserve"> <value> 选择元器件库 </value> </data>
<data name = "FrmBoardSelect_chbOffLine_Text" xml:space = "preserve"> <value> 离线工作模式 </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.lblWait = new System.Windows.Forms.Label(); this.lblWait = new System.Windows.Forms.Label();
this.chbWorkSingleStart = new System.Windows.Forms.CheckBox(); this.chbWorkSingleStart = new System.Windows.Forms.CheckBox();
this.chbOffLine = new System.Windows.Forms.CheckBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// label1 // label1
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
// //
this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNext.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnNext.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnNext.Location = new System.Drawing.Point(340, 309); this.btnNext.Location = new System.Drawing.Point(340, 346);
this.btnNext.Name = "btnNext"; this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(120, 45); this.btnNext.Size = new System.Drawing.Size(120, 45);
this.btnNext.TabIndex = 273; this.btnNext.TabIndex = 273;
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
// //
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnBack.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBack.Location = new System.Drawing.Point(88, 309); this.btnBack.Location = new System.Drawing.Point(88, 346);
this.btnBack.Name = "btnBack"; this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(120, 45); this.btnBack.Size = new System.Drawing.Size(120, 45);
this.btnBack.TabIndex = 272; this.btnBack.TabIndex = 272;
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
// //
this.lblBoardMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblBoardMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblBoardMsg.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.lblBoardMsg.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.lblBoardMsg.Location = new System.Drawing.Point(12, 237); this.lblBoardMsg.Location = new System.Drawing.Point(12, 274);
this.lblBoardMsg.Name = "lblBoardMsg"; this.lblBoardMsg.Name = "lblBoardMsg";
this.lblBoardMsg.Size = new System.Drawing.Size(510, 69); this.lblBoardMsg.Size = new System.Drawing.Size(510, 69);
this.lblBoardMsg.TabIndex = 5; this.lblBoardMsg.TabIndex = 5;
...@@ -124,7 +125,7 @@ ...@@ -124,7 +125,7 @@
// //
this.btnChangeW.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnChangeW.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnChangeW.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnChangeW.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnChangeW.Location = new System.Drawing.Point(214, 309); this.btnChangeW.Location = new System.Drawing.Point(214, 346);
this.btnChangeW.Name = "btnChangeW"; this.btnChangeW.Name = "btnChangeW";
this.btnChangeW.Size = new System.Drawing.Size(120, 45); this.btnChangeW.Size = new System.Drawing.Size(120, 45);
this.btnChangeW.TabIndex = 277; this.btnChangeW.TabIndex = 277;
...@@ -143,7 +144,7 @@ ...@@ -143,7 +144,7 @@
this.lblWait.Image = ((System.Drawing.Image)(resources.GetObject("lblWait.Image"))); this.lblWait.Image = ((System.Drawing.Image)(resources.GetObject("lblWait.Image")));
this.lblWait.Location = new System.Drawing.Point(101, 32); this.lblWait.Location = new System.Drawing.Point(101, 32);
this.lblWait.Name = "lblWait"; this.lblWait.Name = "lblWait";
this.lblWait.Size = new System.Drawing.Size(331, 202); this.lblWait.Size = new System.Drawing.Size(331, 106);
this.lblWait.TabIndex = 278; this.lblWait.TabIndex = 278;
this.lblWait.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.lblWait.TextAlign = System.Drawing.ContentAlignment.TopCenter;
// //
...@@ -151,18 +152,31 @@ ...@@ -151,18 +152,31 @@
// //
this.chbWorkSingleStart.AutoSize = true; this.chbWorkSingleStart.AutoSize = true;
this.chbWorkSingleStart.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbWorkSingleStart.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbWorkSingleStart.Location = new System.Drawing.Point(151, 210); this.chbWorkSingleStart.Location = new System.Drawing.Point(151, 246);
this.chbWorkSingleStart.Name = "chbWorkSingleStart"; this.chbWorkSingleStart.Name = "chbWorkSingleStart";
this.chbWorkSingleStart.Size = new System.Drawing.Size(182, 24); this.chbWorkSingleStart.Size = new System.Drawing.Size(182, 24);
this.chbWorkSingleStart.TabIndex = 279; this.chbWorkSingleStart.TabIndex = 279;
this.chbWorkSingleStart.Text = "启用工作区检测开始工作"; this.chbWorkSingleStart.Text = "启用工作区检测开始工作";
this.chbWorkSingleStart.UseVisualStyleBackColor = true; this.chbWorkSingleStart.UseVisualStyleBackColor = true;
this.chbWorkSingleStart.CheckedChanged += new System.EventHandler(this.chbWorkSingleStart_CheckedChanged);
//
// chbOffLine
//
this.chbOffLine.AutoSize = true;
this.chbOffLine.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbOffLine.Location = new System.Drawing.Point(151, 204);
this.chbOffLine.Name = "chbOffLine";
this.chbOffLine.Size = new System.Drawing.Size(112, 24);
this.chbOffLine.TabIndex = 280;
this.chbOffLine.Text = "离线工作模式";
this.chbOffLine.UseVisualStyleBackColor = true;
this.chbOffLine.CheckedChanged += new System.EventHandler(this.chbOffLine_CheckedChanged);
// //
// FrmBoardSelect // FrmBoardSelect
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(534, 378); this.ClientSize = new System.Drawing.Size(534, 431);
this.Controls.Add(this.lblWait); this.Controls.Add(this.lblWait);
this.Controls.Add(this.btnChangeW); this.Controls.Add(this.btnChangeW);
this.Controls.Add(this.chbGuoban); this.Controls.Add(this.chbGuoban);
...@@ -173,6 +187,7 @@ ...@@ -173,6 +187,7 @@
this.Controls.Add(this.lblBoardMsg); this.Controls.Add(this.lblBoardMsg);
this.Controls.Add(this.cmbBoardList); this.Controls.Add(this.cmbBoardList);
this.Controls.Add(this.chbWorkSingleStart); this.Controls.Add(this.chbWorkSingleStart);
this.Controls.Add(this.chbOffLine);
this.Name = "FrmBoardSelect"; this.Name = "FrmBoardSelect";
this.Text = "请选择程序"; this.Text = "请选择程序";
this.Load += new System.EventHandler(this.FrmBoardSelect_Load); this.Load += new System.EventHandler(this.FrmBoardSelect_Load);
...@@ -195,5 +210,6 @@ ...@@ -195,5 +210,6 @@
private System.Windows.Forms.Timer timer1; private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label lblWait; private System.Windows.Forms.Label lblWait;
private System.Windows.Forms.CheckBox chbWorkSingleStart; private System.Windows.Forms.CheckBox chbWorkSingleStart;
private System.Windows.Forms.CheckBox chbOffLine;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -49,6 +49,17 @@ namespace TSA_V ...@@ -49,6 +49,17 @@ namespace TSA_V
cmbBoardList.DataSource = list; cmbBoardList.DataSource = list;
cmbBoardList.DisplayMember = "boardShowName"; cmbBoardList.DisplayMember = "boardShowName";
cmbBoardList.ValueMember = "boardId"; cmbBoardList.ValueMember = "boardId";
bool workSingleStart = ConfigAppSettings.GetBoolValue(Setting_Init.WorkSingleStart);
bool offline = ConfigAppSettings.GetBoolValue(Setting_Init.OfflineMode);
if (offline)
{
chbOffLine.Checked = true;
}
else if (workSingleStart)
{
chbWorkSingleStart.Checked = true;
}
} }
int preIndex = -1; int preIndex = -1;
private void cmbBoardList_SelectedIndexChanged(object sender, EventArgs e) private void cmbBoardList_SelectedIndexChanged(object sender, EventArgs e)
...@@ -172,17 +183,31 @@ namespace TSA_V ...@@ -172,17 +183,31 @@ namespace TSA_V
else else
{ {
TSAVBean.OnlyGuoBan = chbGuoban.Checked; TSAVBean.OnlyGuoBan = chbGuoban.Checked;
LogUtil.info("选择程序,是否流水线过板=" + TSAVBean.OnlyGuoBan); TSAVBean.OpenOfflineMode = chbOffLine.Checked;
TSAVBean.WorkSingleStart = chbWorkSingleStart.Checked;
if (TSAVBean.OnlyGuoBan) if (TSAVBean.OnlyGuoBan)
{ {
LogUtil.info("选择程序:流水线过板模式");
TSAVBean.WorkSingleStart = false; TSAVBean.WorkSingleStart = false;
TSAVBean.OpenOfflineMode = false;
} }
else else if (TSAVBean.OpenOfflineMode)
{ {
TSAVBean.WorkSingleStart = chbWorkSingleStart.Checked; LogUtil.info("选择程序:离线工作模式");
LogUtil.info("选择程序,启用工作区信号检测开始工作=" + TSAVBean.OnlyGuoBan); TSAVBean.OnlyGuoBan = false;
ConfigAppSettings.SaveValue(Setting_Init.WorkSingleStart, TSAVBean.WorkSingleStart); TSAVBean.WorkSingleStart = false;
} }
else if(TSAVBean.WorkSingleStart)
{
LogUtil.info("选择程序,启用工作区信号检测开始工作" );
TSAVBean.OnlyGuoBan = false;
TSAVBean.OpenOfflineMode = false;
}
LogUtil.info("更改配置:启用工作区信号检测开始工作=" + TSAVBean.WorkSingleStart + ",离线工作模式=" + TSAVBean.OpenOfflineMode);
ConfigAppSettings.SaveValue(Setting_Init.WorkSingleStart, TSAVBean.WorkSingleStart);
ConfigAppSettings.SaveValue(Setting_Init.OfflineMode, TSAVBean.OpenOfflineMode);
if (WorkType.Equals(1)) if (WorkType.Equals(1))
{ {
if (BoardManager.CurrBoard.GetSmtList().Count <= 0) if (BoardManager.CurrBoard.GetSmtList().Count <= 0)
...@@ -280,11 +305,33 @@ namespace TSA_V ...@@ -280,11 +305,33 @@ namespace TSA_V
{ {
chbWorkSingleStart.Checked = false; chbWorkSingleStart.Checked = false;
chbWorkSingleStart.Visible = false; chbWorkSingleStart.Visible = false;
chbOffLine.Checked = false;
chbOffLine.Visible = false;
} }
else //else
//{
// chbWorkSingleStart.Visible = true;
// chbOffLine.Visible = true;
//}
}
private void chbOffLine_CheckedChanged(object sender, EventArgs e)
{
if (chbOffLine.Checked)
{ {
chbWorkSingleStart.Visible = true; chbGuoban.Checked = false;
chbWorkSingleStart.Checked = false;
} }
} }
private void chbWorkSingleStart_CheckedChanged(object sender, EventArgs e)
{
if (chbWorkSingleStart.Checked)
{
chbGuoban.Checked = false;
chbOffLine.Checked = false;
}
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!