优化手动、自动模式,当中控启动时,自动切换为自动模式

develop
lhiven 11 months ago
parent f3e203eab2
commit c53da0f3c5

@ -1796,7 +1796,7 @@ namespace Rs.Framework
/// <summary> /// <summary>
/// 设备是否是自动状态 /// 设备是否是自动状态
/// </summary> /// </summary>
public static bool DeviceIsAuto { get; set; } = true; //public static bool DeviceIsAuto { get; set; } = true;
/// <summary> /// <summary>
/// Empty2取料盘模式(1、真空吸 2、夹爪 3、真空吸和夹爪) /// Empty2取料盘模式(1、真空吸 2、夹爪 3、真空吸和夹爪)

@ -35,7 +35,7 @@ namespace Rs.MotionPlat.Flow
private void task() { private void task() {
while (b_IsRun) while (b_IsRun)
{ {
if(b_IsStop || !GlobalVar.DeviceIsAuto) if(b_IsStop || MachineManage.Instance.RunMode == ERunMode.Manual)
{ {
Thread.Sleep(stopWaitTime); Thread.Sleep(stopWaitTime);
continue; continue;

@ -158,7 +158,7 @@ namespace Rs.MotionPlat.Flow
{ {
while (run) while (run)
{ {
if(stop || !GlobalVar.DeviceIsAuto) if(stop || MachineManage.Instance.RunMode == ERunMode.Manual)
{ {
Thread.Sleep(10); Thread.Sleep(10);
continue; continue;

@ -211,7 +211,7 @@ namespace Rs.MotionPlat.Flow
{ {
while (run) while (run)
{ {
if(stop || !GlobalVar.DeviceIsAuto) if(stop || MachineManage.Instance.RunMode == ERunMode.Manual)
{ {
Thread.Sleep(10); Thread.Sleep(10);
continue; continue;

@ -178,6 +178,14 @@ namespace Rs.MotionPlat
if (btnWholeHome.Visible == false) if (btnWholeHome.Visible == false)
btnWholeHome.Visible = true; btnWholeHome.Visible = true;
} }
if(MachineManage.Instance.RunMode== ERunMode.Automatic && !switchButton1.Checked)
{
switchButton1.Checked = true;
}
else if (MachineManage.Instance.RunMode == ERunMode.Manual && switchButton1.Checked)
{
switchButton1.Checked = false;
}
} }
private void FormMain_Load(object sender, EventArgs e) private void FormMain_Load(object sender, EventArgs e)
@ -269,7 +277,7 @@ namespace Rs.MotionPlat
//StockManager.Instance.Start(); //StockManager.Instance.Start();
LoadStockStatus(); LoadStockStatus();
HOperatorSet.ReadImage(out defaultImage, "default.bmp"); HOperatorSet.ReadImage(out defaultImage, "default.bmp");
switchButton1.Checked = GlobalVar.DeviceIsAuto; switchButton1.Checked = MachineManage.Instance.RunMode == ERunMode.Automatic;
} }
/// <summary> /// <summary>
@ -653,7 +661,15 @@ namespace Rs.MotionPlat
private void switchButton1_Click(object sender, EventArgs e) private void switchButton1_Click(object sender, EventArgs e)
{ {
GlobalVar.DeviceIsAuto = switchButton1.Checked; //GlobalVar.DeviceIsAuto = switchButton1.Checked;
if(switchButton1.Checked)
{
MachineManage.Instance.RunMode = ERunMode.Automatic;
}
else
{
MachineManage.Instance.RunMode = ERunMode.Manual;
}
} }
} }
} }

@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
// //
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
[assembly: AssemblyVersion("3.20.24.31")] [assembly: AssemblyVersion("3.20.24.32")]
//[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]

Loading…
Cancel
Save