Commit 5cf1f174 LN

1.自动模式增加脚踏/按钮暂停功能。

2.料塔初始化失败时,提示是否进入过板模式。
1 个父辈 a388df00
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
<Compile Include="manager\TSAVBean_Partial.cs" /> <Compile Include="manager\TSAVBean_Partial.cs" />
<Compile Include="manager\TSAVStatus.cs" /> <Compile Include="manager\TSAVStatus.cs" />
<Compile Include="manager\WorkInfo.cs" /> <Compile Include="manager\WorkInfo.cs" />
<Compile Include="manager\WorkModeUtil.cs" />
<Compile Include="mes\DeviceStatus.cs" /> <Compile Include="mes\DeviceStatus.cs" />
<Compile Include="mes\MesUtil.cs" /> <Compile Include="mes\MesUtil.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using TSA_V.Common;
namespace TSA_V.DeviceLibrary
{
/// <summary>
/// 工作模式选择
/// </summary>
public class WorkModeUtil
{
/// <summary>
/// 只能进入过板模式
/// </summary>
public static bool OnlyGuoBan = false;
public static bool WaitSelect = false;
private static bool IsSelected = false;
public static event ModeBoxShow boxShowEvent;
public delegate DialogResult ModeBoxShow(string msg,string okMsg);
public static event CheckModeEnd checkModeEndEvent;
public delegate void CheckModeEnd( );
public static void ModeCheckEnd()
{
WorkModeUtil.checkModeEndEvent?.Invoke();
}
internal static void SelectMode(string Name)
{
if (IsSelected)
{
return;
}
try
{
WaitSelect = true;
//如果超时,且调宽轴已上线,旋转轴上线失败,提示是否进入过板模式
IsSelected = true;
LogUtil.error(Name + " 询问是否进入过板模式");
//DialogResult result = MessageBox.Show("料塔加载失败,是否进入过板模式?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
string msg = ResourceControl.GetString("SelectModeMsg", "料塔加载失败,是否进入过板模式?");
string okMsg = ResourceControl.GetString("SelectModeMsgOK", "您已选择流水线过板模式");
DialogResult result = (DialogResult)(boxShowEvent?.Invoke(msg, okMsg));
LogUtil.error(Name + " 询问是否进入过板模式 ,结果:" + result.ToString());
if (result.Equals(DialogResult.OK))
{
OnlyGuoBan = true;
LogUtil.info(Name + " 选择过板模式,不需要复位料塔");
}
else
{
LogUtil.info(Name + " 继续复位料塔");
}
}
catch(Exception ex)
{
LogUtil.error("询问是否进入过板模式出错:"+ex.ToString());
}finally
{
ModeCheckEnd();
WaitSelect = false;
}
}
}
}
...@@ -32,8 +32,13 @@ namespace TSA_V ...@@ -32,8 +32,13 @@ namespace TSA_V
private void btnPosition_Click(object sender, EventArgs e) private void btnPosition_Click(object sender, EventArgs e)
{ {
string msg = ""; string msg = "";
if (WorkModeUtil.OnlyGuoBan)
{
msg = ResourceControl.GetString("GuobanMode", "操作失败,当前为过板模式");
}
//复位完成才能打开 //复位完成才能打开
if (TSAVBean.IsInSuddenDown) else if (TSAVBean.IsInSuddenDown)
{ {
msg = ResourceControl.GetString(ResourceControl.DeviceInSuddenStop, "设备急停中"); msg = ResourceControl.GetString(ResourceControl.DeviceInSuddenStop, "设备急停中");
} }
...@@ -48,8 +53,10 @@ namespace TSA_V ...@@ -48,8 +53,10 @@ namespace TSA_V
if (!String.IsNullOrEmpty(msg)) if (!String.IsNullOrEmpty(msg))
{ {
MessageBox.Show(msg); MessageBoxMidle.Show(this, msg, ResourceCulture.GetString("提示"), MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
//MessageBox.Show(msg);
//return;
} }
FrmPusicanTest frmCom = new FrmPusicanTest(); FrmPusicanTest frmCom = new FrmPusicanTest();
this.Visible = false; this.Visible = false;
......
...@@ -44,7 +44,7 @@ namespace TSA_V ...@@ -44,7 +44,7 @@ namespace TSA_V
else else
{ {
btnProduct.Visible = false; btnProduct.Visible = false;
btnCom.Visible = false ; btnCom.Visible = false;
} }
lblMsg.Text = ""; lblMsg.Text = "";
//if (FormManager.UserInfo.Limit.Equals(UserLimit.Admin)) //if (FormManager.UserInfo.Limit.Equals(UserLimit.Admin))
...@@ -107,7 +107,7 @@ namespace TSA_V ...@@ -107,7 +107,7 @@ namespace TSA_V
DB.userName = FormManager.UserInfo.Name; DB.userName = FormManager.UserInfo.Name;
string time = GetVersion(true); string time = GetVersion(true);
System.Reflection.AssemblyName assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName(); System.Reflection.AssemblyName assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName();
lblVersion.Text = "V" + assemblyName.Version.ToString() ; lblVersion.Text = "V" + assemblyName.Version.ToString();
lblVersion.Text = "V3.0"; lblVersion.Text = "V3.0";
//lblVersion.Text = "V" + assemblyName.Version.ToString() + "(" + time + ")"; //lblVersion.Text = "V" + assemblyName.Version.ToString() + "(" + time + ")";
LblUserName.Text = FormManager.UserInfo.Name + "/" + FormManager.UserInfo.Limit; LblUserName.Text = FormManager.UserInfo.Name + "/" + FormManager.UserInfo.Limit;
...@@ -116,8 +116,9 @@ namespace TSA_V ...@@ -116,8 +116,9 @@ namespace TSA_V
{ {
LoadBackImage(); LoadBackImage();
}); });
WorkModeUtil.boxShowEvent += WorkModeUtil_boxShowEvent;
WorkModeUtil.checkModeEndEvent += WorkModeUtil_checkModeEndEvent;
this.Enabled = false;
//加载板卡 //加载板卡
BoardManager.LoadBoard(); BoardManager.LoadBoard();
...@@ -137,9 +138,10 @@ namespace TSA_V ...@@ -137,9 +138,10 @@ namespace TSA_V
{ {
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
TSAVBean.DeviceCheck();
IOManager.ConnectionIO(); IOManager.ConnectionIO();
TSAVBean.StartRun(); //TSAVBean.StartRun();
timer.Enabled = true; //timer.Enabled = true;
}); });
} }
LWidthManager.Init(); LWidthManager.Init();
...@@ -156,11 +158,10 @@ namespace TSA_V ...@@ -156,11 +158,10 @@ namespace TSA_V
} }
try try
{ {
AccAOI.camera.CameraManager.LoadCamera(); AccAOI.camera.CameraManager.LoadCamera();
LogUtil.info("加载到相机:" + string.Join(";",AccAOI.camera.CameraManager.hikNameList.ToArray())); LogUtil.info("加载到相机:" + string.Join(";", AccAOI.camera.CameraManager.hikNameList.ToArray()));
this.Focus(); this.Focus();
SetMouseAtCenterScreen(); SetMouseAtCenterScreen();
} }
...@@ -170,6 +171,16 @@ namespace TSA_V ...@@ -170,6 +171,16 @@ namespace TSA_V
} }
} }
private void WorkModeUtil_checkModeEndEvent()
{
Task.Factory.StartNew(delegate
{
TSAVBean.StartRun();
timer.Enabled = true;
});
this.Enabled = true;
}
public void LoadBackImage() public void LoadBackImage()
{ {
if (CurrLanguage.Equals(ResourceCulture.English)) if (CurrLanguage.Equals(ResourceCulture.English))
...@@ -298,7 +309,7 @@ namespace TSA_V ...@@ -298,7 +309,7 @@ namespace TSA_V
timer1.Start(); timer1.Start();
} }
private bool TSAVBean_ShowPointEvent(ProjectorPInfo p ) private bool TSAVBean_ShowPointEvent(ProjectorPInfo p)
{ {
FrmProjectorScreen.instance.ClearPoint(); FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(p); FrmProjectorScreen.instance.ShowPoint(p);
...@@ -343,8 +354,8 @@ namespace TSA_V ...@@ -343,8 +354,8 @@ namespace TSA_V
return; return;
} }
// IOManager.IOMove(IOManager.Camera_Led, IO_VALUE.LOW); // IOManager.IOMove(IOManager.Camera_Led, IO_VALUE.LOW);
btnCloseLed.Visible = false ; btnCloseLed.Visible = false;
btnOpenLed.Visible = true ; btnOpenLed.Visible = true;
} }
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
...@@ -363,7 +374,8 @@ namespace TSA_V ...@@ -363,7 +374,8 @@ namespace TSA_V
FrmProjectorScreen.instance = new FrmProjectorScreen(); FrmProjectorScreen.instance = new FrmProjectorScreen();
LogUtil.info("检测到只有一个显示器,关闭投影界面"); LogUtil.info("检测到只有一个显示器,关闭投影界面");
} }
}catch(Exception ex) }
catch (Exception ex)
{ {
LogUtil.error("投影界面检测处理出错:" + ex.ToString()); LogUtil.error("投影界面检测处理出错:" + ex.ToString());
} }
...@@ -397,7 +409,7 @@ namespace TSA_V ...@@ -397,7 +409,7 @@ namespace TSA_V
AOIManager.LoadAOIFile(null, ""); AOIManager.LoadAOIFile(null, "");
List<string> listb = new List<string>(AOIManager.FileList); List<string> listb = new List<string>(AOIManager.FileList);
listb.Insert(0, createnew); listb.Insert(0, createnew);
FrmSelectPoint frma = new FrmSelectPoint(ResourceCulture.GetString("FrmBoardSelect_Text", "请选择AOI"), listb, listb.Count>1?1:0); FrmSelectPoint frma = new FrmSelectPoint(ResourceCulture.GetString("FrmBoardSelect_Text", "请选择AOI"), listb, listb.Count > 1 ? 1 : 0);
DialogResult result = frma.ShowDialog(); DialogResult result = frma.ShowDialog();
if (result.Equals(DialogResult.OK)) if (result.Equals(DialogResult.OK))
{ {
...@@ -419,6 +431,14 @@ namespace TSA_V ...@@ -419,6 +431,14 @@ namespace TSA_V
private void btnReplenish_Click(object sender, EventArgs e) private void btnReplenish_Click(object sender, EventArgs e)
{ {
if (WorkModeUtil.OnlyGuoBan)
{
string msg = ResourceControl.GetString("GuobanMode", "操作失败,当前为过板模式");
MessageBoxMidle.Show(this, msg, ResourceCulture.GetString("提示"), MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
List<BoardInfo> listb = new List<BoardInfo>(BoardManager.boardList); List<BoardInfo> listb = new List<BoardInfo>(BoardManager.boardList);
var ls = listb.Select((point) => { return point.boardName; }).ToList(); var ls = listb.Select((point) => { return point.boardName; }).ToList();
...@@ -457,5 +477,26 @@ namespace TSA_V ...@@ -457,5 +477,26 @@ namespace TSA_V
} }
} }
} }
private DialogResult WorkModeUtil_boxShowEvent(string msg, string okMsg)
{
return (DialogResult)this.Invoke(new MessageBoxShow(MessageBoxShow_F), new object[] { msg, okMsg });
}
delegate DialogResult MessageBoxShow(string msg, string okMsg);
DialogResult MessageBoxShow_F(string msg, string okMsg)
{
DialogResult result = MessageBoxMidle.Show(this, msg, ResourceCulture.GetString("提示"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
Task.Factory.StartNew(delegate
{
if (result.Equals(DialogResult.OK))
{
MessageBoxMidle.Show(this, okMsg, ResourceCulture.GetString("提示"), MessageBoxButtons.OK, MessageBoxIcon.Information);
}
});
return result;
}
} }
} }
...@@ -2554,4 +2554,19 @@ ...@@ -2554,4 +2554,19 @@
<data name="请输入正确的接口地址" xml:space="preserve"> <data name="请输入正确的接口地址" xml:space="preserve">
<value>Please enter the correct interface address.</value> <value>Please enter the correct interface address.</value>
</data> </data>
<data name="FrmWork_lblPause_Text" xml:space="preserve">
<value>Paused</value>
</data>
<data name="SelectModeMsg" xml:space="preserve">
<value>Tower loading failure, whether to enter the InLine mode</value>
</data>
<data name="SelectModeMsgOK" xml:space="preserve">
<value>InLine mode has been selected</value>
</data>
<data name="加载AOI失败" xml:space="preserve">
<value>Failed to load AOI</value>
</data>
<data name="GuobanMode" xml:space="preserve">
<value>Operation failed, currently in InLine mode</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -2553,4 +2553,19 @@ ...@@ -2553,4 +2553,19 @@
<data name="CreateNew" xml:space="preserve"> <data name="CreateNew" xml:space="preserve">
<value>新建</value> <value>新建</value>
</data> </data>
<data name="FrmWork_lblPause_Text" xml:space="preserve">
<value>已暂停</value>
</data>
<data name="SelectModeMsg" xml:space="preserve">
<value>料塔加载失败,是否进入过板模式</value>
</data>
<data name="SelectModeMsgOK" xml:space="preserve">
<value>您已选择流水线过板模式</value>
</data>
<data name="加载AOI失败" xml:space="preserve">
<value>加载AOI失败</value>
</data>
<data name="GuobanMode" xml:space="preserve">
<value>操作失败,当前为过板模式</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -189,6 +189,7 @@ ...@@ -189,6 +189,7 @@
<Compile Include="FrmBoardPutCom.Designer.cs"> <Compile Include="FrmBoardPutCom.Designer.cs">
<DependentUpon>FrmBoardPutCom.cs</DependentUpon> <DependentUpon>FrmBoardPutCom.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="messageBox\MessageBoxMidle.cs" />
<Compile Include="projector\FrmProjectorScreen.cs"> <Compile Include="projector\FrmProjectorScreen.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
......
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TSA_V
{
/***
* Title:"三维可视化" 项目
* 主题:【视图层】将MessageBox显示控制
* Description:
* 功能:
* 1、将MessageBox.Show显示在窗体中间
* Date:2020
* Version:1.2版本
* Author:Coffee
* Modify Recoder:
*/
public class MessageBoxMidle
{
private static IWin32Window _owner;
private static HookProc _hookProc;
private static IntPtr _hHook;
public static DialogResult Show(string text)
{
Initialize();
return MessageBox.Show(text);
}
public static DialogResult Show(string text, string caption)
{
Initialize();
return MessageBox.Show(text, caption);
}
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
{
Initialize();
return MessageBox.Show(text, caption, buttons);
}
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
{
Initialize();
return MessageBox.Show(text, caption, buttons, icon);
}
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton)
{
Initialize();
return MessageBox.Show(text, caption, buttons, icon, defButton);
}
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, MessageBoxOptions options)
{
Initialize();
return MessageBox.Show(text, caption, buttons, icon, defButton, options);
}
public static DialogResult Show(IWin32Window owner, string text)
{
_owner = owner;
Initialize();
return MessageBox.Show(owner, text);
}
public static DialogResult Show(IWin32Window owner, string text, string caption)
{
_owner = owner;
Initialize();
return MessageBox.Show(owner, text, caption);
}
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons)
{
_owner = owner;
Initialize();
return MessageBox.Show(owner, text, caption, buttons);
}
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
{
_owner = owner;
Initialize();
return MessageBox.Show(owner, text, caption, buttons, icon);
}
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton)
{
_owner = owner;
Initialize();
return MessageBox.Show(owner, text, caption, buttons, icon, defButton);
}
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, MessageBoxOptions options)
{
_owner = owner;
Initialize();
return MessageBox.Show(owner, text, caption, buttons, icon,
defButton, options);
}
public delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam);
public delegate void TimerProc(IntPtr hWnd, uint uMsg, UIntPtr nIDEvent, uint dwTime);
public const int WH_CALLWNDPROCRET = 12;
public enum CbtHookAction : int
{
HCBT_MOVESIZE = 0,
HCBT_MINMAX = 1,
HCBT_QS = 2,
HCBT_CREATEWND = 3,
HCBT_DESTROYWND = 4,
HCBT_ACTIVATE = 5,
HCBT_CLICKSKIPPED = 6,
HCBT_KEYSKIPPED = 7,
HCBT_SYSCOMMAND = 8,
HCBT_SETFOCUS = 9
}
[DllImport("user32.dll")]
private static extern bool GetWindowRect(IntPtr hWnd, ref Rectangle lpRect);
[DllImport("user32.dll")]
private static extern int MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
[DllImport("User32.dll")]
public static extern UIntPtr SetTimer(IntPtr hWnd, UIntPtr nIDEvent, uint uElapse, TimerProc lpTimerFunc);
[DllImport("User32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern IntPtr SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
[DllImport("user32.dll")]
public static extern int UnhookWindowsHookEx(IntPtr idHook);
[DllImport("user32.dll")]
public static extern IntPtr CallNextHookEx(IntPtr idHook, int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern int GetWindowTextLength(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int maxLength);
[DllImport("user32.dll")]
public static extern int EndDialog(IntPtr hDlg, IntPtr nResult);
[StructLayout(LayoutKind.Sequential)]
public struct CWPRETSTRUCT
{
public IntPtr lResult;
public IntPtr lParam;
public IntPtr wParam;
public uint message;
public IntPtr hwnd;
};
static MessageBoxMidle()
{
_hookProc = new HookProc(MessageBoxHookProc);
_hHook = IntPtr.Zero;
}
private static void Initialize()
{
if (_hHook != IntPtr.Zero)
{
throw new NotSupportedException("multiple calls are not supported");
}
if (_owner != null)
{
_hHook = SetWindowsHookEx(WH_CALLWNDPROCRET, _hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId());
}
}
private static IntPtr MessageBoxHookProc(int nCode, IntPtr wParam, IntPtr lParam)
{
if (nCode < 0)
{
return CallNextHookEx(_hHook, nCode, wParam, lParam);
}
CWPRETSTRUCT msg = (CWPRETSTRUCT)Marshal.PtrToStructure(lParam, typeof(CWPRETSTRUCT));
IntPtr hook = _hHook;
if (msg.message == (int)CbtHookAction.HCBT_ACTIVATE)
{
try
{
CenterWindow(msg.hwnd);
}
finally
{
UnhookWindowsHookEx(_hHook);
_hHook = IntPtr.Zero;
}
}
return CallNextHookEx(hook, nCode, wParam, lParam);
}
private static void CenterWindow(IntPtr hChildWnd)
{
Rectangle recChild = new Rectangle(0, 0, 0, 0);
bool success = GetWindowRect(hChildWnd, ref recChild);
int width = recChild.Width - recChild.X;
int height = recChild.Height - recChild.Y;
Rectangle recParent = new Rectangle(0, 0, 0, 0);
success = GetWindowRect(_owner.Handle, ref recParent);
Point ptCenter = new Point(0, 0);
ptCenter.X = recParent.X + ((recParent.Width - recParent.X) / 2);
ptCenter.Y = recParent.Y + ((recParent.Height - recParent.Y) / 2);
Point ptStart = new Point(0, 0);
ptStart.X = (ptCenter.X - (width / 2));
ptStart.Y = (ptCenter.Y - (height / 2));
ptStart.X = (ptStart.X < 0) ? 0 : ptStart.X;
ptStart.Y = (ptStart.Y < 0) ? 0 : ptStart.Y;
int result = MoveWindow(hChildWnd, ptStart.X, ptStart.Y, width, height, false);
}
}//Class_end
}
...@@ -61,6 +61,20 @@ namespace TSA_V ...@@ -61,6 +61,20 @@ namespace TSA_V
{ {
chbWorkSingleStart.Checked = true; chbWorkSingleStart.Checked = true;
} }
modePro();
}
private void modePro()
{
if (WorkModeUtil.OnlyGuoBan)
{
chbOffLine.Checked = false;
chbWorkSingleStart.Checked = false;
chbGuoban.Checked = true;
LogUtil.info("默认进入过板模式,其他模式不可选");
}
} }
int preIndex = -1; int preIndex = -1;
private void cmbBoardList_SelectedIndexChanged(object sender, EventArgs e) private void cmbBoardList_SelectedIndexChanged(object sender, EventArgs e)
...@@ -326,6 +340,13 @@ namespace TSA_V ...@@ -326,6 +340,13 @@ namespace TSA_V
} }
else else
{ {
//如果是过板模式,直接取消
if (WorkModeUtil.OnlyGuoBan)
{
chbGuoban.Checked = true;
return;
}
chbWorkSingleStart.Visible = true; chbWorkSingleStart.Visible = true;
chbOffLine.Visible = true; chbOffLine.Visible = true;
} }
......
...@@ -36,12 +36,14 @@ ...@@ -36,12 +36,14 @@
this.btnCodeTest = new System.Windows.Forms.Button(); this.btnCodeTest = new System.Windows.Forms.Button();
this.btnWorkInfo = new System.Windows.Forms.Button(); this.btnWorkInfo = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.lblPause = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.btnUpdateAutoTime = new System.Windows.Forms.Button(); this.btnUpdateAutoTime = new System.Windows.Forms.Button();
this.txtAuToTime = new System.Windows.Forms.TextBox(); this.txtAuToTime = new System.Windows.Forms.TextBox();
this.radioButton2 = new System.Windows.Forms.RadioButton(); this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton(); this.radioButton1 = new System.Windows.Forms.RadioButton();
this.lblGuoBan = new System.Windows.Forms.Label();
this.btnTest = new System.Windows.Forms.Button(); this.btnTest = new System.Windows.Forms.Button();
this.btnStart = new System.Windows.Forms.Button(); this.btnStart = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
...@@ -160,6 +162,8 @@ ...@@ -160,6 +162,8 @@
// //
// groupBox3 // groupBox3
// //
this.groupBox3.Controls.Add(this.lblGuoBan);
this.groupBox3.Controls.Add(this.lblPause);
this.groupBox3.Controls.Add(this.label8); this.groupBox3.Controls.Add(this.label8);
this.groupBox3.Controls.Add(this.label7); this.groupBox3.Controls.Add(this.label7);
this.groupBox3.Controls.Add(this.btnUpdateAutoTime); this.groupBox3.Controls.Add(this.btnUpdateAutoTime);
...@@ -174,11 +178,22 @@ ...@@ -174,11 +178,22 @@
this.groupBox3.TabStop = false; this.groupBox3.TabStop = false;
this.groupBox3.Text = "工作方式"; this.groupBox3.Text = "工作方式";
// //
// lblPause
//
this.lblPause.AutoSize = true;
this.lblPause.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblPause.Location = new System.Drawing.Point(179, 61);
this.lblPause.Name = "lblPause";
this.lblPause.Size = new System.Drawing.Size(74, 21);
this.lblPause.TabIndex = 284;
this.lblPause.Text = "暂停工作";
this.lblPause.Visible = false;
//
// label8 // label8
// //
this.label8.AutoSize = true; this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label8.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(508, 24); this.label8.Location = new System.Drawing.Point(584, 21);
this.label8.Name = "label8"; this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(23, 20); this.label8.Size = new System.Drawing.Size(23, 20);
this.label8.TabIndex = 283; this.label8.TabIndex = 283;
...@@ -187,7 +202,7 @@ ...@@ -187,7 +202,7 @@
// label7 // label7
// //
this.label7.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label7.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.Location = new System.Drawing.Point(226, 24); this.label7.Location = new System.Drawing.Point(302, 21);
this.label7.Name = "label7"; this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(222, 21); this.label7.Size = new System.Drawing.Size(222, 21);
this.label7.TabIndex = 282; this.label7.TabIndex = 282;
...@@ -198,7 +213,7 @@ ...@@ -198,7 +213,7 @@
// //
this.btnUpdateAutoTime.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnUpdateAutoTime.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdateAutoTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnUpdateAutoTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpdateAutoTime.Location = new System.Drawing.Point(421, 55); this.btnUpdateAutoTime.Location = new System.Drawing.Point(497, 52);
this.btnUpdateAutoTime.Name = "btnUpdateAutoTime"; this.btnUpdateAutoTime.Name = "btnUpdateAutoTime";
this.btnUpdateAutoTime.Size = new System.Drawing.Size(71, 32); this.btnUpdateAutoTime.Size = new System.Drawing.Size(71, 32);
this.btnUpdateAutoTime.TabIndex = 281; this.btnUpdateAutoTime.TabIndex = 281;
...@@ -210,7 +225,7 @@ ...@@ -210,7 +225,7 @@
// txtAuToTime // txtAuToTime
// //
this.txtAuToTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtAuToTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAuToTime.Location = new System.Drawing.Point(453, 20); this.txtAuToTime.Location = new System.Drawing.Point(529, 17);
this.txtAuToTime.MaxLength = 5; this.txtAuToTime.MaxLength = 5;
this.txtAuToTime.Name = "txtAuToTime"; this.txtAuToTime.Name = "txtAuToTime";
this.txtAuToTime.Size = new System.Drawing.Size(47, 29); this.txtAuToTime.Size = new System.Drawing.Size(47, 29);
...@@ -242,6 +257,19 @@ ...@@ -242,6 +257,19 @@
this.radioButton1.UseVisualStyleBackColor = true; this.radioButton1.UseVisualStyleBackColor = true;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged); this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
// //
// lblGuoBan
//
this.lblGuoBan.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblGuoBan.Font = new System.Drawing.Font("微软雅黑", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblGuoBan.Location = new System.Drawing.Point(11, 17);
this.lblGuoBan.Name = "lblGuoBan";
this.lblGuoBan.Size = new System.Drawing.Size(618, 71);
this.lblGuoBan.TabIndex = 285;
this.lblGuoBan.Text = "过板模式";
this.lblGuoBan.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnTest // btnTest
// //
this.btnTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
...@@ -934,5 +962,7 @@ ...@@ -934,5 +962,7 @@
private System.Windows.Forms.Button btnWorkInfo; private System.Windows.Forms.Button btnWorkInfo;
private System.Windows.Forms.Button btnCodeTest; private System.Windows.Forms.Button btnCodeTest;
private System.Windows.Forms.Button btnIo; private System.Windows.Forms.Button btnIo;
private System.Windows.Forms.Label lblPause;
private System.Windows.Forms.Label lblGuoBan;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -37,7 +37,25 @@ namespace TSA_V ...@@ -37,7 +37,25 @@ namespace TSA_V
if (board != null) if (board != null)
{ {
this.Text = "Neo Station:" + board.boardName; string modeStr = "";
lblGuoBan.Visible = false;
if (TSAVBean.OnlyGuoBan)
{
modeStr = "-" + ResourceCulture.GetString("FrmBoardSelect_chbGuoban_Text", "过板模式");
lblGuoBan.Text = ResourceCulture.GetString("FrmBoardSelect_chbGuoban_Text", "过板模式");
lblGuoBan.Visible = true;
}
else if (TSAVBean.OpenOfflineMode)
{
modeStr = "-" + ResourceCulture.GetString("FrmBoardSelect_chbOffLine_Text", "离线工作模式");
}
else if (TSAVBean.WorkSingleStart)
{
modeStr = "-" + ResourceCulture.GetString("FrmBoardSelect_chbWorkSingleStart_Text", "工作区检测开始工作");
}
this.Text = "Neo Station:" + board.boardName + modeStr;
workSmtList = board.GetSmtList(); workSmtList = board.GetSmtList();
preIndex = -1; preIndex = -1;
smtPoint = new SMTPointInfo(); smtPoint = new SMTPointInfo();
...@@ -63,6 +81,8 @@ namespace TSA_V ...@@ -63,6 +81,8 @@ namespace TSA_V
radioButton2.Checked = true; radioButton2.Checked = true;
AutoVisiable(true); AutoVisiable(true);
} }
} }
else else
{ {
...@@ -76,7 +96,7 @@ namespace TSA_V ...@@ -76,7 +96,7 @@ namespace TSA_V
if (CurrProject == null) if (CurrProject == null)
{ {
LogUtil.info("没有读取到AOI,结束,IsNeedAOI=true!"); LogUtil.info("没有读取到AOI,结束,IsNeedAOI=true!");
MessageBox.Show(ResourceCulture.GetString("加载AOI失败.")); MessageBox.Show(ResourceCulture.GetString("加载AOI失败"));
//this.Close(); //this.Close();
} }
} }
...@@ -270,6 +290,12 @@ namespace TSA_V ...@@ -270,6 +290,12 @@ namespace TSA_V
{ {
ShowAOI(); ShowAOI();
} }
lblPause.Visible = TSAVBean.WorkPause;
}
else
{
lblPause.Visible = false;
} }
} }
catch (Exception ex) catch (Exception ex)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!