Commit efb5e928 张东亮

逻辑基本完成,出入料口待对接

1 个父辈 c21bf5fd
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n" />
</layout> </layout>
</appender> </appender>
<appender name="Jaka" type="log4net.Appender.RollingFileAppender"> <appender name="jaka" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\\Jaka\\jaka.log" /> <param name="File" value="logs\\Jaka\\jaka.log" />
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8" />
<param name="AppendToFile" value="true" /> <param name="AppendToFile" value="true" />
...@@ -114,9 +114,9 @@ ...@@ -114,9 +114,9 @@
<param name="ConversionPattern" value="[%d][%t][%c:%L]%-5p %m%n" /> <param name="ConversionPattern" value="[%d][%t][%c:%L]%-5p %m%n" />
</layout> </layout>
</appender> </appender>
<logger name="Jaka"> <logger name="jaka">
<level value="info" /> <level value="info" />
<appender-ref ref="Jaka" /> <appender-ref ref="jaka" />
</logger> </logger>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender">
<level value="Info" /> <level value="Info" />
......
...@@ -337,7 +337,7 @@ namespace OnlineStore.CarriageClient ...@@ -337,7 +337,7 @@ namespace OnlineStore.CarriageClient
AxisManager.instance.CloseAllPort(); AxisManager.instance.CloseAllPort();
AxisManager.instance.CloseCard(); AxisManager.instance.CloseCard();
RFIDManager.Close(); RFIDManager.Close();
StoreBean.robotEquip.StopRobotService(); //StoreBean.robotEquip.StopRobotService();
if (Camera._cam != null) if (Camera._cam != null)
{ {
Camera._cam.CloseAll(); Camera._cam.CloseAll();
......
...@@ -667,7 +667,7 @@ ...@@ -667,7 +667,7 @@
// //
this.chkManualRobot.AutoSize = true; this.chkManualRobot.AutoSize = true;
this.chkManualRobot.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chkManualRobot.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkManualRobot.Location = new System.Drawing.Point(512, 191); this.chkManualRobot.Location = new System.Drawing.Point(758, 160);
this.chkManualRobot.Name = "chkManualRobot"; this.chkManualRobot.Name = "chkManualRobot";
this.chkManualRobot.Size = new System.Drawing.Size(141, 26); this.chkManualRobot.Size = new System.Drawing.Size(141, 26);
this.chkManualRobot.TabIndex = 3; this.chkManualRobot.TabIndex = 3;
...@@ -678,7 +678,7 @@ ...@@ -678,7 +678,7 @@
// btnColseRobotService // btnColseRobotService
// //
this.btnColseRobotService.BackColor = System.Drawing.Color.Red; this.btnColseRobotService.BackColor = System.Drawing.Color.Red;
this.btnColseRobotService.Location = new System.Drawing.Point(511, 97); this.btnColseRobotService.Location = new System.Drawing.Point(758, 241);
this.btnColseRobotService.Name = "btnColseRobotService"; this.btnColseRobotService.Name = "btnColseRobotService";
this.btnColseRobotService.Size = new System.Drawing.Size(123, 48); this.btnColseRobotService.Size = new System.Drawing.Size(123, 48);
this.btnColseRobotService.TabIndex = 2; this.btnColseRobotService.TabIndex = 2;
...@@ -689,7 +689,7 @@ ...@@ -689,7 +689,7 @@
// btnOpenRobotService // btnOpenRobotService
// //
this.btnOpenRobotService.BackColor = System.Drawing.Color.YellowGreen; this.btnOpenRobotService.BackColor = System.Drawing.Color.YellowGreen;
this.btnOpenRobotService.Location = new System.Drawing.Point(511, 25); this.btnOpenRobotService.Location = new System.Drawing.Point(758, 52);
this.btnOpenRobotService.Name = "btnOpenRobotService"; this.btnOpenRobotService.Name = "btnOpenRobotService";
this.btnOpenRobotService.Size = new System.Drawing.Size(123, 48); this.btnOpenRobotService.Size = new System.Drawing.Size(123, 48);
this.btnOpenRobotService.TabIndex = 1; this.btnOpenRobotService.TabIndex = 1;
...@@ -702,7 +702,7 @@ ...@@ -702,7 +702,7 @@
this.ucRobot1.Location = new System.Drawing.Point(4, 13); this.ucRobot1.Location = new System.Drawing.Point(4, 13);
this.ucRobot1.Margin = new System.Windows.Forms.Padding(4); this.ucRobot1.Margin = new System.Windows.Forms.Padding(4);
this.ucRobot1.Name = "ucRobot1"; this.ucRobot1.Name = "ucRobot1";
this.ucRobot1.Size = new System.Drawing.Size(500, 428); this.ucRobot1.Size = new System.Drawing.Size(550, 428);
this.ucRobot1.TabIndex = 0; this.ucRobot1.TabIndex = 0;
// //
// panBase // panBase
......
...@@ -570,6 +570,18 @@ namespace OnlineStore.CarriageClient ...@@ -570,6 +570,18 @@ namespace OnlineStore.CarriageClient
private void chkManualRobot_CheckedChanged(object sender, EventArgs e) private void chkManualRobot_CheckedChanged(object sender, EventArgs e)
{ {
ManualRobot(chkManualRobot.Checked); ManualRobot(chkManualRobot.Checked);
try
{
if (robotEquip.GetRobotInfo(out JAKABean jAKABean))
{
ucRobot1.Update(jAKABean.RobotData);
}
}
catch(Exception ex)
{
LogUtil.error("chkManualRobot_CheckedChanged",ex);
}
} }
} }
......
...@@ -71,23 +71,39 @@ namespace OnlineStore.Common ...@@ -71,23 +71,39 @@ namespace OnlineStore.Common
{ {
Int32.TryParse(config.AppSettings.Settings[key].Value, out a); Int32.TryParse(config.AppSettings.Settings[key].Value, out a);
} }
} return a; }
return a;
} }
public static string GetValue(string key) public static string GetValue(string key)
{ {
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); if (Monitor.TryEnter(configloc, 500))
if (config.AppSettings.Settings[key] == null)
{ {
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!"); try
return ""; {
} System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
else if (config.AppSettings.Settings[key] == null)
{ {
return config.AppSettings.Settings[key].Value; LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return "";
}
else
{
return config.AppSettings.Settings[key].Value;
}
}
catch (Exception ex)
{
LogUtil.error("获取【" + key + "】的值失败!", ex);
}
finally
{
Monitor.Exit(configloc);
}
} }
return "";
} }
public static decimal GetNumValue(string key) static decimal GetNumValue(string key)
{ {
decimal a = 0; decimal a = 0;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
...@@ -107,54 +123,52 @@ namespace OnlineStore.Common ...@@ -107,54 +123,52 @@ namespace OnlineStore.Common
public static int GetIntValue(string key) public static int GetIntValue(string key)
{ {
int a = 0; int a = 0;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); string val = GetValue(key);
if (config.AppSettings.Settings[key] == null) Int32.TryParse(val, out a);
{ return a;
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a;
}
else
{
{
Int32.TryParse(config.AppSettings.Settings[key].Value, out a);
}
} return a;
} }
public static void SaveValue(string key, int value) public static void SaveValue(string key, int value)
{ {
SaveValue(key, value.ToString()); SaveValue(key, value.ToString());
} }
static object configloc = new object();
public static void SaveValue(string key, string value) public static void SaveValue(string key, string value)
{ {
try if (Monitor.TryEnter(configloc, 500))
{ {
if (key.Equals("")) try
//if (key.Equals("") || value.Equals(""))
{ {
return; if (key.Equals(""))
//if (key.Equals("") || value.Equals(""))
{
return;
}
//增加的内容写在appSettings段下 <add key="RegCode" value="0"/>
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
SetValue(key, value);
}
else
{
UpdateConfig(key, value);
}
} }
//增加的内容写在appSettings段下 <add key="RegCode" value="0"/> catch (Exception ex)
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{ {
SetValue(key, value); LogUtil.error("SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + ",", ex);
} }
else finally
{ {
UpdateConfig(key, value); Monitor.Exit(configloc);
} }
} }
catch (Exception ex) else
{ {
LogUtil.error( "SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + ",",ex); LogUtil.error("SaveValue保存配置失败,未得到锁:AppKey=" + key + ",AppValue=" + value);
} }
} }
public static string GetValue(object debugDeviceId)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// 更新配置文件信息 /// 更新配置文件信息
/// </summary> /// </summary>
...@@ -173,10 +187,10 @@ namespace OnlineStore.Common ...@@ -173,10 +187,10 @@ namespace OnlineStore.Common
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error( "UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + ",",ex); LogUtil.error("UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + ",", ex);
} }
} }
///<summary> ///<summary>
///向.config文件的appKey结写入信息AppValue 保存设置 ///向.config文件的appKey结写入信息AppValue 保存设置
...@@ -207,7 +221,7 @@ namespace OnlineStore.Common ...@@ -207,7 +221,7 @@ namespace OnlineStore.Common
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error( "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + ",",ex); LogUtil.error("SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + ",", ex);
} }
} }
} }
......
...@@ -147,8 +147,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -147,8 +147,8 @@ namespace OnlineStore.DeviceLibrary
if (TrayIsInPosition()) if (TrayIsInPosition())
{ {
MoveInfo.NextMoveStep(StepEnum.Inlet_Reset_04_Finish); MoveInfo.NextMoveStep(StepEnum.Inlet_Reset_04_Finish);
LogInfo($"复位 {MoveInfo.SLog}:检测到料盘,皮带停止"); LogInfo($"复位 {MoveInfo.SLog}:检测到料盘,5秒后皮带停止");
InletRun(false); IOMove(IO_Type.Inlet_Run, IO_VALUE.HIGH,5000);
} }
else if (MoveInfo.IsTimeOut(15)) else if (MoveInfo.IsTimeOut(15))
{ {
...@@ -171,6 +171,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -171,6 +171,7 @@ namespace OnlineStore.DeviceLibrary
AllowFeedIn(false); AllowFeedIn(false);
Inch7JackUp(false); Inch7JackUp(false);
Inch13JackUp(false); Inch13JackUp(false);
InletRun(false);
MoveInfo.EndMove(); MoveInfo.EndMove();
} }
...@@ -354,6 +355,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -354,6 +355,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackDown, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackDown, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackUp, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackUp, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackUpSig, IO_VALUE.HIGH));
} }
} }
else else
...@@ -364,6 +366,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -364,6 +366,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackUp, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackUp, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackDown, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackDown, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_7InchJackDownSig, IO_VALUE.HIGH));
} }
} }
} }
...@@ -381,6 +384,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -381,6 +384,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackDown, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackDown, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackUp, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackUp, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackUpSig, IO_VALUE.HIGH));
} }
} }
else else
...@@ -391,6 +395,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -391,6 +395,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackUp, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackUp, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackDown, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackDown, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Inlet_13InchJackDownSig, IO_VALUE.HIGH));
} }
} }
} }
......
...@@ -333,9 +333,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -333,9 +333,14 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 送料允许 /// 送料允许
/// </summary> /// </summary>
private void AddWaitAllowFeedOut() private void AddWaitAllowFeedOut(bool on)
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_AllowFeedSig, IO_VALUE.HIGH)); if (on)
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_AllowFeedSig, IO_VALUE.HIGH));
else
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_AllowFeedSig, IO_VALUE.LOW));
}
} }
/// <summary> /// <summary>
...@@ -352,6 +357,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -352,6 +357,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackDown, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackDown, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackUp, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackUp, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackUpSig, IO_VALUE.HIGH));
} }
} }
else else
...@@ -362,6 +368,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -362,6 +368,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackUp, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackUp, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackDown, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackDown, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Outlet_JackDownSig, IO_VALUE.HIGH));
} }
} }
} }
......
...@@ -55,22 +55,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -55,22 +55,22 @@ namespace OnlineStore.DeviceLibrary
{ {
NextMoveStep(StepEnum.Outlet_02_CheckTray, "检查是否有料盘"); NextMoveStep(StepEnum.Outlet_02_CheckTray, "检查是否有料盘");
JackUp(false); JackUp(false);
AddWaitTime(2000);
} }
else if (MoveInfo.IsStep(StepEnum.Outlet_02_CheckTray)) else if (MoveInfo.IsStep(StepEnum.Outlet_02_CheckTray))
{ {
if (TrayCheck()) if (TrayCheck())
{ {
NextMoveStep(StepEnum.Outlet_03_CheckAllowFeedOut, "有料盘,准备送走"); NextMoveStep(StepEnum.Outlet_03_CheckAllowFeedOut, "有料盘,准备送走");
AddWaitAllowFeedOut(); AddWaitAllowFeedOut(true);
AddWaitTime(5000); AddWaitTime(2000);
MoveInfo.OneWaitCanEndStep = true; MoveInfo.OneWaitCanEndStep = true;
} }
else//无料盘 else//无料盘
{ {
NextMoveStep(StepEnum.Outlet_05_JackUp, "无料盘,顶升抬起,准备料盘放入"); NextMoveStep(StepEnum.Outlet_05_JackUp, "无料盘,顶升抬起,准备料盘放入");
JackUp(true); JackUp(true);
AddWaitTime(5000); if (BufferDataManager.TrayInOutletInfo != null)
BufferDataManager.TrayInOutletInfo = null;
} }
} }
else if (MoveInfo.IsStep(StepEnum.Outlet_03_CheckAllowFeedOut)) else if (MoveInfo.IsStep(StepEnum.Outlet_03_CheckAllowFeedOut))
...@@ -78,12 +78,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -78,12 +78,12 @@ namespace OnlineStore.DeviceLibrary
NextMoveStep(StepEnum.Outlet_04_WaitTrayLeave, "允许料盘离开,链条运行"); NextMoveStep(StepEnum.Outlet_04_WaitTrayLeave, "允许料盘离开,链条运行");
OutletRun(true); OutletRun(true);
AddWaitTrayCheck1(false); AddWaitTrayCheck1(false);
AddWaitTrayCheck2(true);
AddWaitTrayCheck2(false); AddWaitTrayCheck2(false);
//AddWaitAllowFeedOut(false);
} }
else if (MoveInfo.IsStep(StepEnum.Outlet_04_WaitTrayLeave)) else if (MoveInfo.IsStep(StepEnum.Outlet_04_WaitTrayLeave))
{ {
NextMoveStep(StepEnum.Outlet_05_JackUp, "料盘离开完成,清除出料口缓存,链条停止,顶升抬起"); NextMoveStep(StepEnum.Outlet_05_JackUp, "料盘离开完成,链条停止,顶升抬起");
BufferDataManager.TrayInOutletInfo = null; BufferDataManager.TrayInOutletInfo = null;
OutletRun(false); OutletRun(false);
JackUp(true); JackUp(true);
......
...@@ -61,7 +61,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -61,7 +61,6 @@ namespace OnlineStore.DeviceLibrary
System.Threading.Thread.Sleep(2000); System.Threading.Thread.Sleep(2000);
EnableRobot(true); EnableRobot(true);
System.Threading.Thread.Sleep(2000); System.Threading.Thread.Sleep(2000);
StartProg(true);
}); });
} }
...@@ -71,8 +70,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -71,8 +70,6 @@ namespace OnlineStore.DeviceLibrary
{ {
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
StartProg(false);
System.Threading.Thread.Sleep(2000);
EnableRobot(false); EnableRobot(false);
System.Threading.Thread.Sleep(2000); System.Threading.Thread.Sleep(2000);
PowerOn(false); PowerOn(false);
...@@ -152,6 +149,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -152,6 +149,9 @@ namespace OnlineStore.DeviceLibrary
isNoAirpressure_Check = false; isNoAirpressure_Check = false;
MoveInfo.NextMoveStep(StepEnum.Robot_Reset_01_Wait); MoveInfo.NextMoveStep(StepEnum.Robot_Reset_01_Wait);
LogInfo($"复位 {MoveInfo.SLog} :轴开始复位"); LogInfo($"复位 {MoveInfo.SLog} :轴开始复位");
StartProg(true);
curcmd = "";
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
isInPro = false; isInPro = false;
} }
...@@ -161,19 +161,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -161,19 +161,12 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveResetPro(); MoveResetPro();
} }
//else if(MoveInfo.MoveType.Equals(MoveType.RHome))
//{
// MoveHomePro();
//}
} }
static int axisDiff = 20000; static int axisDiff = 20000;
private bool CheckTongsPos() private bool CheckTongsPos()
{ {
return false; return false;
} }
//Bitmap resetBitMap = null;
bool resetRtnA = false;
bool resetRtnB = false;
private void MoveResetPro() private void MoveResetPro()
{ {
if (MoveInfo.IsInWait) if (MoveInfo.IsInWait)
...@@ -352,14 +345,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -352,14 +345,12 @@ namespace OnlineStore.DeviceLibrary
internal override void StopMove() internal override void StopMove()
{ {
MoveInfo.EndMove(); MoveInfo.EndMove();
MoveAxis.SuddenStop(); MoveAxis.SuddenStop();
CompressAxis.SuddenStop(); CompressAxis.SuddenStop();
StartProg(false);
CloseAllAxis(); CloseAllAxis();
curcmd = "";
} }
public override void StopRun() public override void StopRun()
......
...@@ -111,14 +111,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -111,14 +111,15 @@ namespace OnlineStore.DeviceLibrary
NextMoveStep(StepEnum.InStore_16_ArmBackToP1, "在NG箱放料完成,清除机器人料叉缓存,机械臂回待机点"); NextMoveStep(StepEnum.InStore_16_ArmBackToP1, "在NG箱放料完成,清除机器人料叉缓存,机械臂回待机点");
//在料仓口口放料完成 //在料仓口口放料完成
BufferDataManager.TrayInRobotInfo = null; BufferDataManager.TrayInRobotInfo = null;
// UpdateLocInfo(MoveInfo.MoveParam.PosInfo.barcode, TaskStatus.BOXDOOR); // UpdateLocInfo(MoveInfo.MoveParam.PosInfo.barcode, TaskStatus.BOXDOOR);
InStore_16_ArmBackToP1(); InStore_16_ArmBackToP1();
break; break;
#endregion #endregion
case StepEnum.InStore_16_ArmBackToP1: case StepEnum.InStore_16_ArmBackToP1:
NextMoveStep(StepEnum.InStore_17_Finish, "入库结束"); NextMoveStep(StepEnum.InStore_17_Finish, "入库结束");
UpdateLocInfo(MoveInfo.MoveParam.PosInfo, TaskStatus.BOXDOOR); if (CheckInstoreTrayTarget())
UpdateLocInfo(MoveInfo.MoveParam.PosInfo, TaskStatus.BOXDOOR);
InStore_17_Finish(); InStore_17_Finish();
break; break;
case StepEnum.InStore_17_Finish: case StepEnum.InStore_17_Finish:
...@@ -145,11 +146,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -145,11 +146,11 @@ namespace OnlineStore.DeviceLibrary
} }
private bool InStore_04_CheckInletState() private bool InStore_04_CheckInletState()
{ {
if (MoveInfo.MoveParam.PosInfo!=null) if (MoveInfo.MoveParam.PosInfo != null)
return true; return true;
return false; return false;
} }
private void InStore_05_ArmToTrayLow(int width=7) private void InStore_05_ArmToTrayLow(int width = 7)
{ {
if (width == 7 || width == 13) if (width == 7 || width == 13)
SendCmd(GetCmd_InletLow(width)); SendCmd(GetCmd_InletLow(width));
...@@ -220,12 +221,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -220,12 +221,12 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
/// <param name="posinfo"></param> /// <param name="posinfo"></param>
/// <param name="status"></param> /// <param name="status"></param>
private void UpdateLocInfo(InOutPosInfo posinfo,string status) private void UpdateLocInfo(InOutPosInfo posinfo, string status)
{ {
string result=SServerManager.UpdateTrayLoc(posinfo.barcode, status, posinfo.PosId,posinfo.taskId); string result = SServerManager.UpdateTrayLoc(posinfo.barcode, status, posinfo.PosId, posinfo.taskId);
if(!result.Equals("")) if (!result.Equals(""))
{ {
SServerManager.UpdateTrayLoc(posinfo.barcode, status, posinfo.PosId,posinfo.taskId); SServerManager.UpdateTrayLoc(posinfo.barcode, status, posinfo.PosId, posinfo.taskId);
} }
} }
} }
......
...@@ -49,7 +49,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -49,7 +49,8 @@ namespace OnlineStore.DeviceLibrary
OutStore_07_ArmBackToP1(); OutStore_07_ArmBackToP1();
break; break;
case StepEnum.OutStore_07_ArmBackToP1: case StepEnum.OutStore_07_ArmBackToP1:
NextMoveStep(StepEnum.OutStore_08_MoveAxisToOutlet, "行走机构到出料口"); NextMoveStep(StepEnum.OutStore_08_MoveAxisToOutlet, "机械臂到待机点,上报状态,行走机构到出料口");
UpdateLocInfo(MoveInfo.MoveParam.PosInfo, TaskStatus.INROBOT);
OutStore_08_MoveAxisToOutlet(); OutStore_08_MoveAxisToOutlet();
break; break;
case StepEnum.OutStore_08_MoveAxisToOutlet: case StepEnum.OutStore_08_MoveAxisToOutlet:
...@@ -104,7 +105,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -104,7 +105,6 @@ namespace OnlineStore.DeviceLibrary
{ {
//添加机器人缓存,并上报任务状态 //添加机器人缓存,并上报任务状态
BufferDataManager.TrayInRobotInfo = MoveInfo.MoveParam.PosInfo.ToCopy(); BufferDataManager.TrayInRobotInfo = MoveInfo.MoveParam.PosInfo.ToCopy();
UpdateLocInfo(MoveInfo.MoveParam.PosInfo, TaskStatus.INROBOT);
SendCmd(GetCmd_Standby()); SendCmd(GetCmd_Standby());
} }
......
...@@ -68,6 +68,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -68,6 +68,7 @@ namespace OnlineStore.DeviceLibrary
return sb.ToString(); return sb.ToString();
} }
string cmdResponse = ""; string cmdResponse = "";
bool robotOnline = true;
/// <summary> /// <summary>
/// 机器人移动成功 /// 机器人移动成功
/// </summary> /// </summary>
...@@ -83,6 +84,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -83,6 +84,7 @@ namespace OnlineStore.DeviceLibrary
if (!bean.RobotData.Online) if (!bean.RobotData.Online)
{ {
SetWarnMsg("无法读取机器人状态,因机器人离线"); SetWarnMsg("无法读取机器人状态,因机器人离线");
robotOnline = false;
return false; return false;
} }
else else
...@@ -91,6 +93,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -91,6 +93,17 @@ namespace OnlineStore.DeviceLibrary
} }
try try
{ {
if (robotOnline && bean.RobotData.RecvMsg.Equals("") && (DateTime.Now - sendTime).TotalSeconds > 10)
{
SendCmd(curcmd);
LogUtil.info($"机器人命令10秒内未收到反馈,重发命令:【{curcmd}】");
}
if (!robotOnline && bean.RobotData.RecvMsg.Contains("home") && bean.RobotData.RecvMsg.Contains("done"))
{
SendCmd(curcmd);
LogUtil.info($"重发机器人离线前的命令:【{curcmd}】");
robotOnline = true;
}
if (!cmdResponse.Equals(bean.RobotData.RecvMsg) && !bean.RobotData.RecvMsg.Equals("")) if (!cmdResponse.Equals(bean.RobotData.RecvMsg) && !bean.RobotData.RecvMsg.Equals(""))
{ {
cmdResponse = bean.RobotData.RecvMsg; cmdResponse = bean.RobotData.RecvMsg;
...@@ -137,6 +150,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -137,6 +150,7 @@ namespace OnlineStore.DeviceLibrary
return insafeAtOutlet; return insafeAtOutlet;
} }
public string curcmd = ""; public string curcmd = "";
DateTime sendTime = DateTime.Now;
/// <summary> /// <summary>
/// 发送命令 /// 发送命令
/// </summary> /// </summary>
...@@ -160,6 +174,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -160,6 +174,7 @@ namespace OnlineStore.DeviceLibrary
ClearSpecifiedAlarm("无法发送命令,因机器人离线"); ClearSpecifiedAlarm("无法发送命令,因机器人离线");
} }
JAKAServer.SendCmd(bean.RemoteEndPoint, cmd); JAKAServer.SendCmd(bean.RemoteEndPoint, cmd);
sendTime = DateTime.Now;
LogUtil.info($"Send RobotMove Cmd:【{cmd}】"); LogUtil.info($"Send RobotMove Cmd:【{cmd}】");
} }
/// <summary> /// <summary>
...@@ -263,9 +278,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -263,9 +278,15 @@ namespace OnlineStore.DeviceLibrary
if (GetRobotInfo(out JAKA.JAKABean bean)) if (GetRobotInfo(out JAKA.JAKABean bean))
{ {
if (on) if (on)
bean.PowerOn(); {
if (bean.RobotData.RobotStatus.powered_on == 0)
bean.PowerOn();
}
else else
bean.PowerOff(); {
if (bean.RobotData.RobotStatus.powered_on == 1)
bean.PowerOff();
}
} }
} }
/// <summary> /// <summary>
...@@ -277,9 +298,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -277,9 +298,16 @@ namespace OnlineStore.DeviceLibrary
if (GetRobotInfo(out JAKA.JAKABean bean)) if (GetRobotInfo(out JAKA.JAKABean bean))
{ {
if (enable) if (enable)
bean.EnableRobot(); {
if (bean.RobotData.RobotStatus.enabled == 0)
bean.EnableRobot();
}
else else
bean.DisableRobot(); {
if (bean.RobotData.RobotStatus.enabled == 1)
bean.DisableRobot();
}
} }
} }
...@@ -292,7 +320,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -292,7 +320,10 @@ namespace OnlineStore.DeviceLibrary
if (GetRobotInfo(out JAKA.JAKABean bean)) if (GetRobotInfo(out JAKA.JAKABean bean))
{ {
if (start) if (start)
{
bean.Run(); bean.Run();
}
else else
bean.Abort(); bean.Abort();
} }
......
...@@ -15,7 +15,7 @@ namespace JAKA ...@@ -15,7 +15,7 @@ namespace JAKA
int rtn = jakaAPI.create_handler(ip.ToCharArray(),ref _handle); int rtn = jakaAPI.create_handler(ip.ToCharArray(),ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"CreateHandler OK"); InfoLog($"CreateHandler OK");
//SetErrorHandler(); //SetErrorHandler();
SetErrorCodeFilePath(Application.StartupPath+ @"\jaka_files\JAKA_ERROR_CODE.csv"); SetErrorCodeFilePath(Application.StartupPath+ @"\jaka_files\JAKA_ERROR_CODE.csv");
return true; return true;
...@@ -35,7 +35,7 @@ namespace JAKA ...@@ -35,7 +35,7 @@ namespace JAKA
int rtn = jakaAPI.set_error_handler(ref _handle, user_error_handle); int rtn = jakaAPI.set_error_handler(ref _handle, user_error_handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"SetErrorHandler OK"); InfoLog($"SetErrorHandler OK");
return true; return true;
} }
else else
...@@ -53,7 +53,7 @@ namespace JAKA ...@@ -53,7 +53,7 @@ namespace JAKA
int rtn = jakaAPI.destory_handler(ref _handle); int rtn = jakaAPI.destory_handler(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"DestroyHandler OK"); InfoLog($"DestroyHandler OK");
return true; return true;
} }
else else
...@@ -71,7 +71,7 @@ namespace JAKA ...@@ -71,7 +71,7 @@ namespace JAKA
int rtn = jakaAPI.power_on(ref _handle); int rtn = jakaAPI.power_on(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"PowerOn OK"); InfoLog($"PowerOn OK");
return true; return true;
} }
else else
...@@ -88,7 +88,7 @@ namespace JAKA ...@@ -88,7 +88,7 @@ namespace JAKA
int rtn = jakaAPI.power_off(ref _handle); int rtn = jakaAPI.power_off(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"PowerOff OK"); InfoLog($"PowerOff OK");
return true; return true;
} }
else else
...@@ -105,7 +105,7 @@ namespace JAKA ...@@ -105,7 +105,7 @@ namespace JAKA
int rtn = jakaAPI.shut_down(ref _handle); int rtn = jakaAPI.shut_down(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"ShutDown OK"); InfoLog($"ShutDown OK");
return true; return true;
} }
else else
...@@ -122,7 +122,7 @@ namespace JAKA ...@@ -122,7 +122,7 @@ namespace JAKA
int rtn = jakaAPI.enable_robot(ref _handle); int rtn = jakaAPI.enable_robot(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"EnableRobot OK"); InfoLog($"EnableRobot OK");
return true; return true;
} }
else else
...@@ -139,7 +139,7 @@ namespace JAKA ...@@ -139,7 +139,7 @@ namespace JAKA
int rtn = jakaAPI.disable_robot(ref _handle); int rtn = jakaAPI.disable_robot(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"DisableRobot OK"); InfoLog($"DisableRobot OK");
return true; return true;
} }
else else
...@@ -388,7 +388,7 @@ namespace JAKA ...@@ -388,7 +388,7 @@ namespace JAKA
/// <param name="index">DI 索引(从 0 开始)</param> /// <param name="index">DI 索引(从 0 开始)</param>
/// <param name="value">DI 状态查询结果</param> /// <param name="value">DI 状态查询结果</param>
/// <returns></returns> /// <returns></returns>
bool GetDigitalInput(JKTYPE.IOType iOType, int index,out bool result) public bool GetDigitalInput(JKTYPE.IOType iOType, int index,out bool result)
{ {
result = false; result = false;
int rtn = jakaAPI.get_digital_input(ref _handle, iOType, index,ref result); int rtn = jakaAPI.get_digital_input(ref _handle, iOType, index,ref result);
...@@ -410,7 +410,7 @@ namespace JAKA ...@@ -410,7 +410,7 @@ namespace JAKA
/// <param name="index">DO 索引(从 0 开始)</param> /// <param name="index">DO 索引(从 0 开始)</param>
/// <param name="value">DO 状态查询结果</param> /// <param name="value">DO 状态查询结果</param>
/// <returns></returns> /// <returns></returns>
bool GetDigitalOutput(JKTYPE.IOType iOType, int index, out bool result) public bool GetDigitalOutput(JKTYPE.IOType iOType, int index, out bool result)
{ {
result = false; result = false;
int rtn = jakaAPI.get_digital_output(ref _handle, iOType, index, ref result); int rtn = jakaAPI.get_digital_output(ref _handle, iOType, index, ref result);
...@@ -433,7 +433,7 @@ namespace JAKA ...@@ -433,7 +433,7 @@ namespace JAKA
int rtn = jakaAPI.program_run(ref _handle); int rtn = jakaAPI.program_run(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"Run OK"); InfoLog($"Run OK");
return false; return false;
} }
else else
...@@ -450,7 +450,7 @@ namespace JAKA ...@@ -450,7 +450,7 @@ namespace JAKA
int rtn = jakaAPI.program_pause(ref _handle); int rtn = jakaAPI.program_pause(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"Pause OK"); InfoLog($"Pause OK");
return false; return false;
} }
else else
...@@ -467,7 +467,7 @@ namespace JAKA ...@@ -467,7 +467,7 @@ namespace JAKA
int rtn = jakaAPI.program_resume(ref _handle); int rtn = jakaAPI.program_resume(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"Resume OK"); InfoLog($"Resume OK");
return false; return false;
} }
else else
...@@ -485,7 +485,7 @@ namespace JAKA ...@@ -485,7 +485,7 @@ namespace JAKA
int rtn = jakaAPI.program_abort(ref _handle); int rtn = jakaAPI.program_abort(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"Abort OK"); InfoLog($"Abort OK");
return true; return true;
} }
else else
...@@ -504,7 +504,7 @@ namespace JAKA ...@@ -504,7 +504,7 @@ namespace JAKA
int rtn = jakaAPI.program_load(ref _handle,file.ToCharArray()); int rtn = jakaAPI.program_load(ref _handle,file.ToCharArray());
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"Load OK"); InfoLog($"Load OK");
return true; return true;
} }
else else
...@@ -696,7 +696,7 @@ namespace JAKA ...@@ -696,7 +696,7 @@ namespace JAKA
int rtn = jakaAPI.is_in_pos(ref _handle, ref inPos); int rtn = jakaAPI.is_in_pos(ref _handle, ref inPos);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"IsInPos OK"); InfoLog($"IsInPos OK");
return true; return true;
} }
else else
...@@ -930,7 +930,7 @@ namespace JAKA ...@@ -930,7 +930,7 @@ namespace JAKA
int rtn = jakaAPI.clear_error(ref _handle); int rtn = jakaAPI.clear_error(ref _handle);
if (rtn == RtnCode.ERR_SUCC) if (rtn == RtnCode.ERR_SUCC)
{ {
DebugLog($"ClearError OK"); InfoLog($"ClearError OK");
return true; return true;
} }
else else
......
...@@ -47,6 +47,7 @@ namespace JAKA ...@@ -47,6 +47,7 @@ namespace JAKA
/// </summary> /// </summary>
public int ScanRate = 300; public int ScanRate = 300;
RobotData robotData = new RobotData(); RobotData robotData = new RobotData();
string err = "";
private void UpdateData() private void UpdateData()
{ {
try try
...@@ -61,7 +62,12 @@ namespace JAKA ...@@ -61,7 +62,12 @@ namespace JAKA
{ {
if (GetLastError(ref error)) if (GetLastError(ref error))
{ {
robotData.Errorinfo = $"运行异常:{string.Join("", error.message)}[{error.code}]"; robotData.Errorinfo = $"运行异常:【{error.code}】【{string.Join("", error.message)}】";
if(!err.Equals(robotData.Errorinfo))
{
err = robotData.Errorinfo;
log.Error(err);
}
} }
else else
{ {
...@@ -79,6 +85,7 @@ namespace JAKA ...@@ -79,6 +85,7 @@ namespace JAKA
robotData.Online = RobotData.Online; robotData.Online = RobotData.Online;
robotData.CurCmd = RobotData.CurCmd; robotData.CurCmd = RobotData.CurCmd;
robotData.RecvMsg = RobotData.RecvMsg; robotData.RecvMsg = RobotData.RecvMsg;
log.Info($"Update Robot Data:【{RobotData.CurCmd}】【{RobotData.RecvMsg}】【{RobotData.Errorinfo}】");
UpdateDataEvent?.Invoke(robotData); UpdateDataEvent?.Invoke(robotData);
} }
......
...@@ -21,14 +21,14 @@ namespace JAKA ...@@ -21,14 +21,14 @@ namespace JAKA
} }
private JAKABean jakaBean; private JAKABean jakaBean;
private JAKAServer server; private JAKAServer server;
public void Regidter(JAKABean jakabean,JAKAServer jAKAServer) public void Regidter(JAKABean jakabean, JAKAServer jAKAServer)
{ {
this.jakaBean = jakabean; this.jakaBean = jakabean;
groupBox1.Text = $"[{jakabean.IP}]"; groupBox1.Text = $"[{jakabean.IP}]";
server = jAKAServer; server = jAKAServer;
jakabean.RegisterUpdataEvent(Update); jakabean.RegisterUpdataEvent(Update);
} }
private void Update(RobotData robotData) public void Update(RobotData robotData)
{ {
if (!this.IsHandleCreated) if (!this.IsHandleCreated)
return; return;
...@@ -49,7 +49,7 @@ namespace JAKA ...@@ -49,7 +49,7 @@ namespace JAKA
{ {
lblProgramstate.BackColor = Color.Red; lblProgramstate.BackColor = Color.Red;
} }
else if(robotData.ProgramState.Equals(ProgramState.PROGRAM_PAUSED)) else if (robotData.ProgramState.Equals(ProgramState.PROGRAM_PAUSED))
{ {
lblProgramstate.BackColor = Color.Yellow; lblProgramstate.BackColor = Color.Yellow;
} }
...@@ -58,7 +58,7 @@ namespace JAKA ...@@ -58,7 +58,7 @@ namespace JAKA
lblProgramstate.BackColor = Color.YellowGreen; lblProgramstate.BackColor = Color.YellowGreen;
} }
lblCmd.Text = robotData.CurCmd; lblCmd.Text = robotData.CurCmd;
if(robotData.Online) if (robotData.Online)
{ {
groupBox1.Text = $"[{jakaBean.IP}][在线]"; groupBox1.Text = $"[{jakaBean.IP}][在线]";
} }
...@@ -108,7 +108,8 @@ namespace JAKA ...@@ -108,7 +108,8 @@ namespace JAKA
private void btnSend_Click(object sender, EventArgs e) private void btnSend_Click(object sender, EventArgs e)
{ {
Task.Factory.StartNew(() => { Task.Factory.StartNew(() =>
{
if (groupBox1.Text.Contains("在线")) if (groupBox1.Text.Contains("在线"))
{ {
string cmd = comboBox1.SelectedItem.ToString();//textBox1.Text; string cmd = comboBox1.SelectedItem.ToString();//textBox1.Text;
...@@ -121,12 +122,67 @@ namespace JAKA ...@@ -121,12 +122,67 @@ namespace JAKA
private void btnRun_Click(object sender, EventArgs e) private void btnRun_Click(object sender, EventArgs e)
{ {
Task.Factory.StartNew(() => { Task.Factory.StartNew(() =>
jakaBean.PowerOn(); {
System.Threading.Thread.Sleep(2000); if (jakaBean.PowerOn())
jakaBean.EnableRobot(); jakaBean.EnableRobot();
System.Threading.Thread.Sleep(2000); });
jakaBean.Run(); }
private void timer1_Tick(object sender, EventArgs e)
{
try
{
if (jakaBean.GetDigitalOutput(IOType.IO_CABINET, 0, out bool insafe))
{
lblSafe.BackColor = insafe ? Color.YellowGreen : Color.Red;
}
}
catch
{
}
}
private void UCRobot_Load(object sender, EventArgs e)
{
timer1.Start();
}
private void button1_Click(object sender, EventArgs e)
{
jakaBean.ClearError();
}
private void button2_Click(object sender, EventArgs e)
{
Task.Factory.StartNew(() =>
{
if (groupBox1.Text.Contains("在线"))
{
server.SendCmd(jakaBean.RemoteEndPoint, "home");
}
});
}
private void button3_Click(object sender, EventArgs e)
{
Task.Factory.StartNew(() =>
{
if (groupBox1.Text.Contains("在线"))
{
server.SendCmd(jakaBean.RemoteEndPoint, "standby");
}
});
}
private void button4_Click(object sender, EventArgs e)
{
Task.Factory.StartNew(() =>
{
if (jakaBean.DisableRobot())
jakaBean.PowerOff();
}); });
} }
} }
......
...@@ -117,4 +117,7 @@ ...@@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!