Commit 1d786b63 刘韬

优化MyCronic报错处理

1 个父辈 dff26e48
正在显示 43 个修改的文件 包含 726 行增加186 行删除
...@@ -277,8 +277,8 @@ namespace OnlineStore ...@@ -277,8 +277,8 @@ namespace OnlineStore
//} //}
//string className = cc.ClassName; //string className = cc.ClassName;
CurrLanguage = CodeResourceControl.GetLanguage(); CurrLanguage = CodeResourceControl.GetLanguage();
//string name = CodeResourceControl.GetString(CodeResourceControl.GetTextIdStr(className), cc.Text); string name = CodeResourceControl.GetString(className, cc.Text);
//if (!name.Equals("")) { cc.Text = name; } if (!name.Equals("")) { cc.Text = name; }
PreControlLanaguage(cc, className); PreControlLanaguage(cc, className);
RefreshLanguageEvent?.Invoke(); RefreshLanguageEvent?.Invoke();
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace> <RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>MyCommon</AssemblyName> <AssemblyName>MyCommon</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -74,12 +74,15 @@ namespace OnlineStore.Common ...@@ -74,12 +74,15 @@ namespace OnlineStore.Common
[MyConfigComment("二维码扫码超时毫秒")] [MyConfigComment("二维码扫码超时毫秒")]
public static MyConfig<int> CameraScan_CodeTimeOut = 3000; public static MyConfig<int> CameraScan_CodeTimeOut = 3000;
[MyConfigComment("管理员密码")]
public static MyConfig<string> User_AdminPassword = "1";
[MyConfigComment("启用管理员密码")]
public static MyConfig<bool> User_Enable = false;
public static MyConfig<string> Runtime_OutStoreReelInfo; public static MyConfig<string> Runtime_OutStoreReelInfo;
public static MyConfig<string> Runtime_Robot_ReelInfo; //public static MyConfig<string> Runtime_Robot_ReelInfo;
public static MyConfig<string> Runtime_Robot_FromPos; //public static MyConfig<string> Runtime_Robot_FromPos;
public static MyConfig<string> Runtime_Robot_ToPos; //public static MyConfig<string> Runtime_Robot_ToPos;
public static MyConfig<string> RuntimeRobot_Arm_MoveStep;
public static MyConfig<string> RuntimeRobot_MoveStep;
} }
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceLibrary</RootNamespace> <RootNamespace>DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName> <AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
...@@ -202,12 +202,6 @@ ...@@ -202,12 +202,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="StoreConfig\fixPositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file \ No newline at end of file
using OnlineStore.Common; using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -46,28 +47,28 @@ namespace DeviceLibrary ...@@ -46,28 +47,28 @@ namespace DeviceLibrary
openretry++; openretry++;
{ {
Msg += string.Format("第{0}次尝试打开轴:{1}", openretry, Config.Explain); Msg += string.Format(crc.GetString("Res0073.1bf30741","第{0}次尝试打开轴:{1}"), openretry, Config.Explain);
if (AxisManager.GetBusyStatus(portName, slvAddr) == 1) if (AxisManager.GetBusyStatus(portName, slvAddr) == 1)
{ {
AxisManager.SuddenStop(portName, slvAddr); AxisManager.SuddenStop(portName, slvAddr);
Msg += string.Format("...伺服忙碌,急停{0}次", openretry); Msg += string.Format(crc.GetString("Res0074.814c87d5","...伺服忙碌,急停{0}次"), openretry);
Thread.Sleep(100); Thread.Sleep(100);
} }
AxisManager.ServoOn(portName, slvAddr); AxisManager.ServoOn(portName, slvAddr);
Thread.Sleep(200); Thread.Sleep(200);
if (AxisManager.IsServeoOn(portName, slvAddr)) if (AxisManager.IsServeoOn(portName, slvAddr))
{ {
Msg += "..." + "使能成功"; Msg += "..." + crc.GetString("Res0075.c054671f","使能成功");
openretry = 0; openretry = 0;
return true; return true;
} }
else else
Msg += "..." + "尝试使能失败"; Msg += "..." + crc.GetString("Res0076.94b55bdf","尝试使能失败");
Thread.Sleep(1000); Thread.Sleep(1000);
if (openretry < 5) if (openretry < 5)
Msg = "伺服连接中" + "..."; Msg = crc.GetString("Res0077.abdd7b6b","伺服连接中") + "...";
} }
return false; return false;
} }
...@@ -162,7 +163,7 @@ namespace DeviceLibrary ...@@ -162,7 +163,7 @@ namespace DeviceLibrary
int isAlarm = AxisManager.GetAlarmStatus(deviceName, axisNo); int isAlarm = AxisManager.GetAlarmStatus(deviceName, axisNo);
if (isAlarm.Equals(1)) if (isAlarm.Equals(1))
{ {
clearMsg = "清理报警" + ","; clearMsg = crc.GetString("Res0078.a6087377","清理报警") + ",";
AxisManager.AlarmClear(deviceName, axisNo); AxisManager.AlarmClear(deviceName, axisNo);
Thread.Sleep(200); Thread.Sleep(200);
AxisManager.ServoOn(deviceName, axisNo); AxisManager.ServoOn(deviceName, axisNo);
...@@ -183,7 +184,7 @@ namespace DeviceLibrary ...@@ -183,7 +184,7 @@ namespace DeviceLibrary
} }
else else
{ {
msg = $"{MoveInfo.Name} {MoveInfo.MoveStep} {axis.DisplayStr}," + "目标位置" + $"{targetPosition}," + "当前位置" + $"{outCount}" + ",误差过大,需要报警"; msg = $"{MoveInfo.Name} {MoveInfo.MoveStep} {axis.DisplayStr}," + crc.GetString("Res0079.84ab6e6f","目标位置") + $"{targetPosition}," + crc.GetString("Res0080.5eac11b4","当前位置") + $"{outCount}" + crc.GetString("Res0081.8d390ec9",",误差过大,需要报警");
MoveInfo.error(msg); MoveInfo.error(msg);
} }
} }
...@@ -204,14 +205,14 @@ namespace DeviceLibrary ...@@ -204,14 +205,14 @@ namespace DeviceLibrary
//判断是否需要重新运动 //判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
MoveInfo.error(MoveInfo.Name + axis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次"); MoveInfo.error(MoveInfo.Name + axis.DisplayStr + crc.GetString("Res0082.8aafcde8","收到原点完成信号,当前位置[") + outCount + crc.GetString("Res0083.b8b7de19","],重新回原点,剩余[") + MoveInfo.CanWhileCount + crc.GetString("Res0084.62bd0209","]次"));
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点"); //LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
AxisManager.HomeMove(axis.DeviceName, axis.GetAxisValue(), axis.HomeHighSpeed, axis.HomeLowSpeed, axis.HomeAddSpeed); AxisManager.HomeMove(axis.DeviceName, axis.GetAxisValue(), axis.HomeHighSpeed, axis.HomeLowSpeed, axis.HomeAddSpeed);
MoveInfo.CanWhileCount--; MoveInfo.CanWhileCount--;
} }
else else
{ {
msg = MoveInfo.Name + " " + MoveInfo.MoveStep + axis.DisplayStr + "," + "收到原点完成信号,当前位置" + "[" + outCount + "]," + "误差过大,需要报警"; msg = MoveInfo.Name + " " + MoveInfo.MoveStep + axis.DisplayStr + "," + crc.GetString("Res0085.89db0f26","收到原点完成信号,当前位置") + "[" + outCount + "]," + crc.GetString("Res0086.53ce14b2","误差过大,需要报警");
MoveInfo.error(msg); MoveInfo.error(msg);
} }
} }
...@@ -415,11 +416,11 @@ namespace DeviceLibrary ...@@ -415,11 +416,11 @@ namespace DeviceLibrary
Thread.Sleep(200); Thread.Sleep(200);
if (AxisManager.GetAlarmStatus(portName, slvAddr) != 0) if (AxisManager.GetAlarmStatus(portName, slvAddr) != 0)
{ {
msg += string.Format("轴(0)存在报警,清除失败", axis.Config.Explain); msg += string.Format(crc.GetString("Res0087.95840864","轴(0)存在报警,清除失败"), axis.Config.Explain);
isok = false; isok = false;
} }
else else
msg += string.Format("轴(0)存在报警,清除成功", axis.Config.Explain); msg += string.Format(crc.GetString("Res0088.b5876296","轴(0)存在报警,清除成功"), axis.Config.Explain);
} }
} }
Thread.Sleep(50); Thread.Sleep(50);
...@@ -427,4 +428,4 @@ namespace DeviceLibrary ...@@ -427,4 +428,4 @@ namespace DeviceLibrary
} }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -27,11 +27,12 @@ namespace DeviceLibrary ...@@ -27,11 +27,12 @@ namespace DeviceLibrary
{ {
ConfigIO configIo = StoreManager.Config.DOList[device][ioType]; ConfigIO configIo = StoreManager.Config.DOList[device][ioType];
instance.WriteSingleDO(configIo.DeviceName, configIo.SlaveID, configIo.GetIOAddr(), ioValue); instance.WriteSingleDO(configIo.DeviceName, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
if (configIo.GetIOAddr() == 9 || configIo.GetIOAddr() == 12) { if (configIo.GetIOAddr() == 0)//(configIo.GetIOAddr() == 9 || configIo.GetIOAddr() == 12)
{
LogUtil.info($"{configIo.GetIOAddr()}=={ioValue},device={device},ioType={ioType}"); LogUtil.info($"{configIo.GetIOAddr()}=={ioValue},device={device},ioType={ioType}");
StackTrace stackTrace = new StackTrace(); StackTrace stackTrace = new StackTrace();
for (int i = 0; i < stackTrace.FrameCount; i++) for (int i = 0; i < stackTrace.FrameCount; i++)
{ {
StackFrame stackFrame = stackTrace.GetFrame(i); StackFrame stackFrame = stackTrace.GetFrame(i);
string fileName = stackFrame.GetFileName(); string fileName = stackFrame.GetFileName();
int lineNumber = stackFrame.GetFileLineNumber(); int lineNumber = stackFrame.GetFileLineNumber();
......
...@@ -11,18 +11,20 @@ using System.Threading.Tasks; ...@@ -11,18 +11,20 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
class RobotHelper public class RobotHelper
{ {
int lastMoveCmd = 0; int lastMoveCmd = 0;
int lastSpeedRate = 0;
public int lastWeight = 0;
URRobotControl robot; URRobotControl robot;
System.Timers.Timer RobotCheck; System.Timers.Timer RobotCheck;
string Robotname; string Robotname;
public RobotHelper(URRobotControl _robot,string robotname) { public RobotHelper(URRobotControl _robot, string robotname) {
robot = _robot; robot = _robot;
Robotname = robotname; Robotname = robotname;
RobotCheck = new System.Timers.Timer(5000); RobotCheck = new System.Timers.Timer(5000);
RobotCheck.Elapsed += RobotCheck_Elapsed; RobotCheck.Elapsed += RobotCheck_Elapsed;
} }
public volatile bool RobotStatus = false; public volatile bool RobotStatus = false;
private void RobotCheck_Elapsed(object sender, System.Timers.ElapsedEventArgs e) private void RobotCheck_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
...@@ -42,6 +44,10 @@ namespace DeviceLibrary ...@@ -42,6 +44,10 @@ namespace DeviceLibrary
if (robot.CurDashboardReponse.Contains("PROTECTIVE_STOP")) if (robot.CurDashboardReponse.Contains("PROTECTIVE_STOP"))
{ {
robot.SendCMD("unlock protective stop", 0); robot.SendCMD("unlock protective stop", 0);
lastWeight = lastWeight + 1;
if (lastWeight > 4)
lastWeight = 1;
robot.log("触发保护性停止,调节负载重量:" + lastWeight);
return; return;
} }
return; return;
...@@ -71,7 +77,7 @@ namespace DeviceLibrary ...@@ -71,7 +77,7 @@ namespace DeviceLibrary
void uploadStatus() { void uploadStatus() {
EquipMsgData equipMsg = new EquipMsgData(); EquipMsgData equipMsg = new EquipMsgData();
equipMsg.msgList = new List<EquipMessage>(); equipMsg.msgList = new List<EquipMessage>();
equipMsg.status = RobotStatus?1:2; equipMsg.status = RobotStatus ? 1 : 2;
if (!RobotStatus) if (!RobotStatus)
{ {
equipMsg.msgList.Add(new EquipMessage() equipMsg.msgList.Add(new EquipMessage()
...@@ -83,13 +89,19 @@ namespace DeviceLibrary ...@@ -83,13 +89,19 @@ namespace DeviceLibrary
equipMsg.equipName = Robotname; equipMsg.equipName = Robotname;
TheLine.UploadStatus(equipMsg); TheLine.UploadStatus(equipMsg);
} }
public void Move(MoveInfo moveInfo, int movecmd) { DateTime LastMoveTime= DateTime.Now;
int retrytime = 0;
public void Move(MoveInfo moveInfo, int movecmd, int weight) {
if (moveInfo != null) if (moveInfo != null)
{ {
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(IsMoveOk), crc.GetString("Res0157","等待") + $"[{robot.Name}]" + crc.GetString("Res0057","移动到位"))); retrytime = 0;
LastMoveTime = DateTime.Now;
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(IsMoveOk), crc.GetString("Res0157", "等待") + $"[{robot.Name}]" + crc.GetString("Res0057", "移动到位")));
} }
lastMoveCmd = movecmd; lastMoveCmd = movecmd;
robot.SendMoveCmd(movecmd, Setting_Init.URRobot_MI1_Speed_Rate); lastSpeedRate = Setting_Init.URRobot_MI1_Speed_Rate;
lastWeight = weight;
robot.SendMoveCmd(movecmd, lastSpeedRate, false, LoadRateParam[weight]);
} }
internal void Start() internal void Start()
...@@ -100,10 +112,18 @@ namespace DeviceLibrary ...@@ -100,10 +112,18 @@ namespace DeviceLibrary
public bool IsMoveOk(WaitResultInfo waitResultInfo) { public bool IsMoveOk(WaitResultInfo waitResultInfo) {
if (robot.CurCmdReponse.Contains($"{lastMoveCmd},done")) if (robot.CurCmdReponse.Contains($"{lastMoveCmd},done"))
return true; return true;
else if (robot.CurCmdReponse.Contains($"done")) else if (robot.CurCmdReponse.Contains($"done") || retrytime>1)
{ {
LogUtil.error($"机器人没有移动到位,重新移动:{lastMoveCmd}"); retrytime = 0;
robot.SendMoveCmd(lastMoveCmd); LogUtil.error($"机器人没有移动到位,重新移动:{lastMoveCmd},{lastWeight}");
robot.SendMoveCmd(lastMoveCmd, lastSpeedRate, false, LoadRateParam[lastWeight]);
return false;
}
else if ((DateTime.Now - LastMoveTime).TotalSeconds>30) {
retrytime++;
LastMoveTime = DateTime.Now;
LogUtil.error($"机器人超过30秒没有反馈,停止程序重试");
robot.StopProgram();
return false; return false;
} }
else else
...@@ -115,5 +135,27 @@ namespace DeviceLibrary ...@@ -115,5 +135,27 @@ namespace DeviceLibrary
{ {
RobotCheck.Enabled = false; RobotCheck.Enabled = false;
} }
/// <summary>
/// lb=kg/0.45359237f
/// in=mm/25.4f
/// key=load kg, value = load lb,x,y,z
/// </summary>
public static Dictionary<int, float[]> LoadRateParam = new Dictionary<int, float[]>() {
{ 0, new float[] { 4.5f, 0, 37 / 100f, 100 / 100f } },
{ 1, new float[] { 5.5f, 0, 37 / 100f, 146 / 100f } },
{ 2, new float[] { 6.5f, 0, 37 / 100f, 174 / 100f } },
{ 3, new float[] { 7.5f, 0, 37 / 100f, 204 / 100f } },
{ 4, new float[] { 8.5f, 0, 37 / 100f, 212 / 100f } },
{ 5, new float[] { 9.5f, 0, 37 / 100f, 224 / 100f } }
};
//public static Dictionary<int, float[]> LoadRateParam = new Dictionary<int, float[]>() {
// { 0, new float[] { 4.5f / 0.45359237f, 0, 37/25.4f, 100 / 25.4f } },
// { 1, new float[] { 5.5f / 0.45359237f, 0, 37 / 25.4f, 146 / 25.4f } },
// { 2, new float[] { 6.5f / 0.45359237f, 0, 37 / 25.4f, 174 / 25.4f } },
// { 3, new float[] { 7.5f / 0.45359237f, 0, 37 / 25.4f, 204 / 25.4f } },
// { 4, new float[] { 8.5f / 0.45359237f, 0, 37 / 25.4f, 212 / 25.4f } },
// { 5, new float[] { 9.5f / 0.45359237f, 0, 37 / 25.4f, 224 / 25.4f } }
//};
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -54,15 +54,19 @@ namespace DeviceLibrary ...@@ -54,15 +54,19 @@ namespace DeviceLibrary
OutMaterialTaskCount = data["pizzaBox"] + data["pcb"] + data["tray"]; OutMaterialTaskCount = data["pizzaBox"] + data["pcb"] + data["tray"];
OutReelTaskCount = data["reel"]; OutReelTaskCount = data["reel"];
} }
TrayManager.Statistics();
var remoteLoad = new RemoteLoad(); var remoteLoad = new RemoteLoad();
remoteLoad.RequestLoadInfo = new RequestLoadInfo(); remoteLoad.RequestLoadInfo = new RequestLoadInfo();
remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString(); remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString();
var r = TrayManager.IsNeedProcessNG(remoteLoad); var r = TrayManager.IsNeedProcessNG(remoteLoad);
TheLine.UploadCustData("IsNeedProcessNG", r ? "true" : "false"); TheLine.UploadCustData("IsNeedProcessNG", r ? "true" : "false");
TheLine.UploadCustData("EmptyCount_MTP1", TrayManager.EmptyCount_MTP1.ToString());
TheLine.UploadCustData("EmptyCount_MTP2", TrayManager.EmptyCount_MTP2.ToString());
//if (!RobotManage.isRunning) //if (!RobotManage.isRunning)
// ProcessMsg(MsgService.MSList); // ProcessMsg(MsgService.MSList);
//if (!string.IsNullOrWhiteSpace(server)) //if (!string.IsNullOrWhiteSpace(server))
// SendLineStatus(); // SendLineStatus();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
位置,优先级,高度,宽度,料仓ID,旋转轴位置P2,升降轴库位入料高点P3,升降轴库位入料低点P4,进出轴库位点取料点P3
fix#7,1,24,7,1,139000,85635,76635,216000
fix#13,2,24,13,1,139000,114988,105988,216000
...@@ -68,7 +68,7 @@ namespace DeviceLibrary ...@@ -68,7 +68,7 @@ namespace DeviceLibrary
{ {
try try
{ {
if (RobotManage.isRunning) if (RobotManage.isRunning && storeStatus >0)
{ {
//ProcessMsg(VMsg.msg); //ProcessMsg(VMsg.msg);
SendLineStatus(); SendLineStatus();
...@@ -183,7 +183,7 @@ namespace DeviceLibrary ...@@ -183,7 +183,7 @@ namespace DeviceLibrary
boxStatus.temperature = Temperature.ToString(); boxStatus.temperature = Temperature.ToString();
//状态 //状态
boxStatus.status = (int)storeStatus; boxStatus.status = (int)storeStatus;
boxStatus.data.Add("capacity", capacity);
string sendmsg = ""; string sendmsg = "";
...@@ -578,6 +578,8 @@ namespace DeviceLibrary ...@@ -578,6 +578,8 @@ namespace DeviceLibrary
return true; return true;
} }
MydataWcfServiceTest.ServiceReference2.TowerAppWSClient towerAppWSClient; MydataWcfServiceTest.ServiceReference2.TowerAppWSClient towerAppWSClient;
internal string capacity;
public bool SendCommand(string command, bool needlog, out string msg, params string[] arg) public bool SendCommand(string command, bool needlog, out string msg, params string[] arg)
{ {
string errmsg; string errmsg;
......
...@@ -28,15 +28,17 @@ namespace DeviceLibrary ...@@ -28,15 +28,17 @@ namespace DeviceLibrary
} }
public string CID; public string CID;
public string TowerName; public string TowerName;
public TowerInfo TowerInfo;
public VStore(TowerInfo towerInfo, VStoreCollection storeCollection) { public VStore(TowerInfo towerInfo, VStoreCollection storeCollection) {
vc = storeCollection; vc = storeCollection;
CID = towerInfo.TowerID; CID = towerInfo.TowerID;
TowerName = towerInfo.TowerName; TowerName = towerInfo.TowerName;
TowerInfo= towerInfo;
VLog = new VLog(CID, CID); VLog = new VLog(CID, CID);
ServerCM = new VServerComm(CID,VLog); ServerCM = new VServerComm(CID,VLog);
ServerCM.OutStoreEvent += ServerCM_OutStoreEvent; ServerCM.OutStoreEvent += ServerCM_OutStoreEvent;
ServerCM.storeStatus = StoreStatus.None; ServerCM.storeStatus = StoreStatus.None;
Msg = new MsgService("RT-"+CID); Msg = new MsgService("RT-" + CID);
OutStoreJobList = new StoreJobList(crc.GetString("Res0050","出库任务")); OutStoreJobList = new StoreJobList(crc.GetString("Res0050","出库任务"));
} }
...@@ -53,6 +55,13 @@ namespace DeviceLibrary ...@@ -53,6 +55,13 @@ namespace DeviceLibrary
DateTime LastStatusTime = DateTime.Now; DateTime LastStatusTime = DateTime.Now;
int LastStatusCode = 0; int LastStatusCode = 0;
internal void VTowerProcess() { internal void VTowerProcess() {
if (!TowerInfo.Enable) {
ServerCM.storeStatus = StoreStatus.None;
CurrentTowerStatusText = "Disable";
RTStoreStatus = RTStoreStatus.Offline;
return;
}
try try
{ {
var ti = ServerCM.GetTowerDetailInformation(CID); var ti = ServerCM.GetTowerDetailInformation(CID);
...@@ -66,7 +75,16 @@ namespace DeviceLibrary ...@@ -66,7 +75,16 @@ namespace DeviceLibrary
CurrentTowerStatusText = $"[TI={ti.StatusCode}-{ti.StatusText}]"; CurrentTowerStatusText = $"[TI={ti.StatusCode}-{ti.StatusText}]";
ServerCM.Temperature = ti.Temperature; ServerCM.Temperature = ti.Temperature;
ServerCM.Humidity = ti.Humidity; ServerCM.Humidity = ti.Humidity;
if (ti.StatusCode == 26) if (ServerCM.Humidity > ServerCM.Max_Humidity || ServerCM.Temperature > ServerCM.Max_Temperature)
{
Msg.add(crc.GetString("Res0098.70dccffd","温湿度超限"), MsgLevel.alarm);
}
//if (ti.StatusCode == 26 && ti.StatusText != "Ready")
//{
// VLog.Info("料仓已空闲");
//}
//else
if (ti.StatusCode == 26 && ti.StatusText == "Ready")
{ {
ServerCM.storeStatus = StoreStatus.StoreOnline; ServerCM.storeStatus = StoreStatus.StoreOnline;
if (RTStoreStatus != RTStoreStatus.LockToInStore && RTStoreStatus != RTStoreStatus.InStoreReady) if (RTStoreStatus != RTStoreStatus.LockToInStore && RTStoreStatus != RTStoreStatus.InStoreReady)
...@@ -83,6 +101,7 @@ namespace DeviceLibrary ...@@ -83,6 +101,7 @@ namespace DeviceLibrary
RTStoreStatus = RTStoreStatus.LockToInStore; RTStoreStatus = RTStoreStatus.LockToInStore;
if (!ServerCM.BeginOutStore(jobInfo.Clone(), VLog)) if (!ServerCM.BeginOutStore(jobInfo.Clone(), VLog))
{ {
Msg.add(crc.GetString("Res0105.f3331370","发送出库指令失败") + ":" + jobInfo.WareNum, MsgLevel.alarm);
RTStoreStatus = RTStoreStatus.Ready; RTStoreStatus = RTStoreStatus.Ready;
} }
CurrentTerminalReelID = jobInfo.WareNum; CurrentTerminalReelID = jobInfo.WareNum;
...@@ -119,7 +138,7 @@ namespace DeviceLibrary ...@@ -119,7 +138,7 @@ namespace DeviceLibrary
{ {
VLog.Error($"未知状态超时,RTStoreStatus={RTStoreStatus}:" + InStoreJobInfo?.ToStr()); VLog.Error($"未知状态超时,RTStoreStatus={RTStoreStatus}:" + InStoreJobInfo?.ToStr());
} }
Msg.add($"TerminalError" + "入库超时", MsgLevel.warning); Msg.add($"TerminalError" + crc.GetString("Res0099.42525c5f", "入库超时"), MsgLevel.warning);
} }
} }
else if (ti.StatusCode == 1031) else if (ti.StatusCode == 1031)
...@@ -162,28 +181,38 @@ namespace DeviceLibrary ...@@ -162,28 +181,38 @@ namespace DeviceLibrary
} }
else if (ti.StatusCode == 1041) else if (ti.StatusCode == 1041)
{ {
if (RTStoreStatus != RTStoreStatus.OutStoreReady) if (InStoreJobInfo == null)
{ {
VLog.Info("出库已完成"); if (RTStoreStatus != RTStoreStatus.OutStoreReady)
InStoreJobInfo = null; {
OutStoreEnd(CurrentTerminalReelID, CID); VLog.Info("出库物料已到舱门口:" + CurrentTerminalReelID);
} InStoreJobInfo = null;
OutStoreEnd(CurrentTerminalReelID, CID);
}
RTStoreStatus = RTStoreStatus.OutStoreReady;
OutStoreJobList.ClearLastPosid();
}
else
{
TerminalError = true;
VLog.Info("异常出库:" + CurrentTerminalReelID);
RTStoreStatus = RTStoreStatus.OutStoreReady; }
OutStoreJobList.ClearLastPosid();
} }
else if (ti.StatusCode == 0 || ti.StatusCode == 18) else if (ti.StatusCode == 0 || ti.StatusCode == 18)
{ {
RTStoreStatus = RTStoreStatus.Offline; RTStoreStatus = RTStoreStatus.Offline;
ServerCM.storeStatus = StoreStatus.None; ServerCM.storeStatus = StoreStatus.None;
} }
else if (ti.StatusCode == 310117 || ti.StatusCode == 310249) else if (ti.StatusCode >= 310000)
{ {
Msg.add($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}", MsgLevel.warning); Msg.add($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}", MsgLevel.warning);
RTStoreStatus = RTStoreStatus.InStoreError; RTStoreStatus = RTStoreStatus.InStoreError;
ServerCM.storeStatus = StoreStatus.InStoreFaild; ServerCM.storeStatus = StoreStatus.InStoreFaild;
InStoreJobInfo = null; //CurrentTowerStatusText = $"{ti.StatusText}-{ti.OnlineStatus}";
//InStoreJobInfo = null;
} }
else if (ti.StatusCode < 10000) else if (ti.StatusCode < 10000)
{ {
...@@ -198,6 +227,7 @@ namespace DeviceLibrary ...@@ -198,6 +227,7 @@ namespace DeviceLibrary
Msg.add($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}", MsgLevel.alarm); Msg.add($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}", MsgLevel.alarm);
ServerCM.storeStatus = StoreStatus.InTrouble; ServerCM.storeStatus = StoreStatus.InTrouble;
RTStoreStatus = RTStoreStatus.Error; RTStoreStatus = RTStoreStatus.Error;
//CurrentTowerStatusText = $"{ti.StatusText}-{ti.OnlineStatus}";
} }
} }
else else
...@@ -216,9 +246,13 @@ namespace DeviceLibrary ...@@ -216,9 +246,13 @@ namespace DeviceLibrary
1042 material unloaded to Terminal from Tower 物料已取走 1042 material unloaded to Terminal from Tower 物料已取走
6015 Reel already loaded. 6015 Reel already loaded.
3068 初始化中 3068 初始化中
310117 Opertion denied
310249 Error Reel Sensor (249) 310249 Error Reel Sensor (249)
310107,No scancode (107)
310234,Error clamping on opening (234)
*/ */
//统计剩余容量 //统计剩余容量
string capacity = "";
for (int i = 0; i < ti.Slots.Count; i++) for (int i = 0; i < ti.Slots.Count; i++)
{ {
var sn = ti.Slots[i].Slotname; var sn = ti.Slots[i].Slotname;
...@@ -240,11 +274,15 @@ namespace DeviceLibrary ...@@ -240,11 +274,15 @@ namespace DeviceLibrary
int.TryParse(sn.Substring(2), out h); int.TryParse(sn.Substring(2), out h);
} }
//boxStatus.data.Add("capacity", "7X8=1000;7X12=345;13X32=100;"); //boxStatus.data.Add("capacity", "7X8=1000;7X12=345;13X32=100;");
SlotsInfo[$"{w}x{h}"] = $"{ti.Slots[i].Slots_used}/{ti.Slots[i].Slots_free}"; capacity += $"{w}X{h}={ti.Slots[i].Slots_free};";
SlotsInfo[$"{w}X{h}"] = $"{ti.Slots[i].Slots_used}/{ti.Slots[i].Slots_free}";
} }
ServerCM.capacity = capacity;
} }
catch (Exception ex) catch (Exception ex)
{ {
ServerCM.storeStatus = StoreStatus.None;
RTStoreStatus = RTStoreStatus.Offline;
VLog.Error("VStore Error:" + ex); VLog.Error("VStore Error:" + ex);
} }
finally finally
...@@ -256,6 +294,10 @@ namespace DeviceLibrary ...@@ -256,6 +294,10 @@ namespace DeviceLibrary
public Dictionary<string, string> SlotsInfo = new Dictionary<string, string>(); public Dictionary<string, string> SlotsInfo = new Dictionary<string, string>();
public string GetStateStr() public string GetStateStr()
{ {
if (!TowerInfo.Enable)
{
return "Disable";
}
if (RTStoreStatus == RTStoreStatus.OutStoreReady) if (RTStoreStatus == RTStoreStatus.OutStoreReady)
return crc.GetString("Res0066","出库中") + (!string.IsNullOrEmpty(CurrentTerminalReelID)?"SN:" + CurrentTerminalReelID:""); return crc.GetString("Res0066","出库中") + (!string.IsNullOrEmpty(CurrentTerminalReelID)?"SN:" + CurrentTerminalReelID:"");
...@@ -270,6 +312,11 @@ namespace DeviceLibrary ...@@ -270,6 +312,11 @@ namespace DeviceLibrary
{ {
return crc.GetString("Res0069","入库出错,物料NG") + " Barcode:" + InStoreJobInfo?.WareNum; return crc.GetString("Res0069","入库出错,物料NG") + " Barcode:" + InStoreJobInfo?.WareNum;
} }
if (RTStoreStatus == RTStoreStatus.Error)
{
return CurrentTowerStatusText;
}
return crc.GetString("Res0070","空闲中"); return crc.GetString("Res0070","空闲中");
} }
...@@ -291,6 +338,11 @@ namespace DeviceLibrary ...@@ -291,6 +338,11 @@ namespace DeviceLibrary
{ {
return ServerCM.SendStoreState("", posid, StoreStatus.InStoreEnd); return ServerCM.SendStoreState("", posid, StoreStatus.InStoreEnd);
} }
internal void log(string v)
{
VLog.Info(v);
}
} }
public enum RTStoreStatus { public enum RTStoreStatus {
Offline, Offline,
......
...@@ -53,6 +53,7 @@ namespace DeviceLibrary ...@@ -53,6 +53,7 @@ namespace DeviceLibrary
var reelid = r.Descendants("Barcode").FirstOrDefault().Value; var reelid = r.Descendants("Barcode").FirstOrDefault().Value;
var towerid = r.Descendants("TowerId").FirstOrDefault().Value; var towerid = r.Descendants("TowerId").FirstOrDefault().Value;
VLog.Info("收到入库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}"); VLog.Info("收到入库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}");
VStoreList[towerid].log("收到入库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}");
if (!VStoreList.ContainsKey(towerid)) if (!VStoreList.ContainsKey(towerid))
{ {
VLog.Error("收到入库信息,但没有找到该料仓id"); VLog.Error("收到入库信息,但没有找到该料仓id");
...@@ -65,6 +66,7 @@ namespace DeviceLibrary ...@@ -65,6 +66,7 @@ namespace DeviceLibrary
reelid = r.Descendants("Barcode").FirstOrDefault().Value; reelid = r.Descendants("Barcode").FirstOrDefault().Value;
towerid = r.Descendants("TowerId").FirstOrDefault().Value; towerid = r.Descendants("TowerId").FirstOrDefault().Value;
VLog.Info("收到出库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}"); VLog.Info("收到出库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}");
VStoreList[towerid].log("收到出库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}");
if (!VStoreList.ContainsKey(towerid)) { if (!VStoreList.ContainsKey(towerid)) {
VLog.Error("收到出库信息,但没有找到该料仓id"); VLog.Error("收到出库信息,但没有找到该料仓id");
} }
......
...@@ -32,7 +32,7 @@ namespace DeviceLibrary ...@@ -32,7 +32,7 @@ namespace DeviceLibrary
{ {
EquipMsgData equipMsg = new EquipMsgData(); EquipMsgData equipMsg = new EquipMsgData();
equipMsg.msgList = new List<EquipMessage>(); equipMsg.msgList = new List<EquipMessage>();
equipMsg.status = 0; equipMsg.status = 1;
Msg.msg.ForEach(ml => Msg.msg.ForEach(ml =>
{ {
equipMsg.msgList.Add(new EquipMessage() equipMsg.msgList.Add(new EquipMessage()
...@@ -42,8 +42,6 @@ namespace DeviceLibrary ...@@ -42,8 +42,6 @@ namespace DeviceLibrary
}); });
if (ml.msgLevel == MsgLevel.alarm) if (ml.msgLevel == MsgLevel.alarm)
equipMsg.status = 2; equipMsg.status = 2;
else
equipMsg.status = 1;
}); });
equipMsg.equipName = GroupName; equipMsg.equipName = GroupName;
TheLine.UploadStatus(equipMsg); TheLine.UploadStatus(equipMsg);
......
...@@ -106,7 +106,7 @@ namespace DeviceLibrary ...@@ -106,7 +106,7 @@ namespace DeviceLibrary
foreach (var ledcolor in ledcfg.Keys) foreach (var ledcolor in ledcfg.Keys)
{ {
if (ledcfg[ledcolor] == LedState.none) if (ledcfg[ledcolor] == LedState.none)
return; continue;
Led.LedColors[ledcolor].LedState = ledcfg[ledcolor]; Led.LedColors[ledcolor].LedState = ledcfg[ledcolor];
} }
} }
...@@ -126,13 +126,13 @@ namespace DeviceLibrary ...@@ -126,13 +126,13 @@ namespace DeviceLibrary
{ {
ProcessLefCfg(MachineLedStateE.Running); ProcessLefCfg(MachineLedStateE.Running);
//出入库 绿闪 黄闪 ////出入库 绿闪 黄闪
if (RobotManage.isRunning) //if (RobotManage.isRunning)
{ //{
//RunningLed.LedState = LedState.blink; // //RunningLed.LedState = LedState.blink;
//StandbyLed.LedState = LedState.blink; // //StandbyLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.InOut); // ProcessLefCfg(MachineLedStateE.InOut);
} //}
//系统暂停,说明书未定义, 绿闪, 红闪 //系统暂停,说明书未定义, 绿闪, 红闪
if (!canRunning || UserPause) if (!canRunning || UserPause)
{ {
......
using log4net; using OnlineStore;
using log4net;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
...@@ -262,36 +263,36 @@ namespace DeviceLibrary ...@@ -262,36 +263,36 @@ namespace DeviceLibrary
{ {
if (IsHomeMove) if (IsHomeMove)
{ {
return "轴" + "【" + AxisInfo.DisplayStr + "】" + "原点返回"; return crc.GetString("Res0089.60c85b4b","轴") + "【" + AxisInfo.DisplayStr + "】" + crc.GetString("AxisMoveControl_groupAxis_panel1_btnAxisReturnHome_Text","原点返回");
} }
else else
{ {
return "轴" + "【" + AxisInfo.DisplayStr + "】" + "绝对运动,目标位置" + "【" + TargetPosition + "】"; return crc.GetString("Res0089.60c85b4b","轴") + "【" + AxisInfo.DisplayStr + "】" + crc.GetString("Res0090.0c33436f","绝对运动,目标位置") + "【" + TargetPosition + "】";
} }
} }
else if (WaitType.Equals(WaitEnum.W002_IOValue)) else if (WaitType.Equals(WaitEnum.W002_IOValue))
{ {
return "等待" + "【" + IoType + "】=【" + IoValue + "】"; return crc.GetString("Res0157","等待") + "【" + IoType + "】=【" + IoValue + "】";
} }
else if (WaitType.Equals(WaitEnum.W003_Time)) else if (WaitType.Equals(WaitEnum.W003_Time))
{ {
return "时间等待" + ":【" + TimeMSeconds + "】" + "毫秒"; return crc.GetString("Res0091.d7647f48","时间等待") + ":【" + TimeMSeconds + "】" + crc.GetString("Res0092.21157cbf","毫秒");
} }
else if (WaitType.Equals(WaitEnum.W006_AxisOrg)) else if (WaitType.Equals(WaitEnum.W006_AxisOrg))
{ {
return "轴" + "【" + AxisInfo.DisplayStr + "】" + "ORG信号" + ":【" + IoValue + "】"; return crc.GetString("Res0089.60c85b4b","轴") + "【" + AxisInfo.DisplayStr + "】" + crc.GetString("Res0093.3802ba42","ORG信号") + ":【" + IoValue + "】";
} }
else if (WaitType.Equals(WaitEnum.W007_ReelHeight)) else if (WaitType.Equals(WaitEnum.W007_ReelHeight))
{ {
return "料盘高度" + "【" + TargetPosition + "】"; return crc.GetString("Res0094.f4a8d691","料盘高度") + "【" + TargetPosition + "】";
} }
else if (WaitType.Equals(WaitEnum.W008_BatchAxis)) else if (WaitType.Equals(WaitEnum.W008_BatchAxis))
{ {
return "批量轴上升到上料点"; return crc.GetString("Res0095.84e7c741","批量轴上升到上料点");
} }
else if (WaitType.Equals(WaitEnum.W009_ScanCode)) else if (WaitType.Equals(WaitEnum.W009_ScanCode))
{ {
return "扫码完成"; return crc.GetString("Res0096.ed4de1c6","扫码完成");
} }
else if (WaitType.Equals(WaitEnum.W013_Action)) else if (WaitType.Equals(WaitEnum.W013_Action))
{ {
...@@ -430,4 +431,4 @@ namespace DeviceLibrary ...@@ -430,4 +431,4 @@ namespace DeviceLibrary
///// </summary> ///// </summary>
//CheckFixture=6, //CheckFixture=6,
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -67,13 +67,13 @@ namespace DeviceLibrary ...@@ -67,13 +67,13 @@ namespace DeviceLibrary
MI2Postion = CSVPositionReader<RobotPosition>.LoadCSVFile(MI2PostionFile); MI2Postion = CSVPositionReader<RobotPosition>.LoadCSVFile(MI2PostionFile);
CIPostion = CSVPositionReader<RobotPosition>.LoadCSVFile(CIPostionFile); CIPostion = CSVPositionReader<RobotPosition>.LoadCSVFile(CIPostionFile);
Robot_MI1 = new URRobotControl(Setting_Init.URRobot_MI1_IP); Robot_MI1 = new URRobotControl(Setting_Init.URRobot_MI1_IP, "Robot-R1");
Robot_MI1.Name = "R1"; Robot_MI1.Name = "R1";
Robot_MI1.SetSpeedRate(Setting_Init.URRobot_MI1_Speed_Rate); Robot_MI1.SetSpeedRate(Setting_Init.URRobot_MI1_Speed_Rate);
Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP); Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP, "Robot-R2");
Robot_MI1.Name = "R2"; Robot_MI2.Name = "R2";
Robot_MI2.SetSpeedRate(Setting_Init.URRobot_MI2_Speed_Rate); Robot_MI2.SetSpeedRate(Setting_Init.URRobot_MI2_Speed_Rate);
Robot_CI = new URRobotControl(Setting_Init.URRobot_CI_IP); Robot_CI = new URRobotControl(Setting_Init.URRobot_CI_IP, "Robot-CI");
Robot_CI.SetSpeedRate(Setting_Init.URRobot_CI_Speed_Rate); Robot_CI.SetSpeedRate(Setting_Init.URRobot_CI_Speed_Rate);
VStoreCollection = new VStoreCollection(); VStoreCollection = new VStoreCollection();
......
...@@ -32,7 +32,7 @@ namespace DeviceLibrary ...@@ -32,7 +32,7 @@ namespace DeviceLibrary
Traylist.Add(rfid, new TrayInfo()); Traylist.Add(rfid, new TrayInfo());
Traylist[rfid].RFID = rfid; Traylist[rfid].RFID = rfid;
} }
moveInfo.log($"处理RFID:{rfid},地址{addr},设备:{(AddrDesc.ContainsKey(addr) ? AddrDesc[addr] : "")},{(Traylist[rfid].HasLoad? Traylist[rfid].TrayParam?.ToStr():"no metrial")}"); moveInfo.log($"处理RFID:{rfid},地址{addr},设备:{(AddrDesc.ContainsKey(addr) ? AddrDesc[addr] : "")},mcheck:{reelcheck},{(Traylist[rfid].HasLoad? Traylist[rfid].TrayParam?.ToStr():"no metrial")}");
Traylist[rfid].LastUpdateTime = DateTime.Now; Traylist[rfid].LastUpdateTime = DateTime.Now;
Traylist[rfid].LastAddr = addr; Traylist[rfid].LastAddr = addr;
...@@ -276,14 +276,16 @@ namespace DeviceLibrary ...@@ -276,14 +276,16 @@ namespace DeviceLibrary
public static bool IsNeedProcessNG(RemoteLoad remoteLoad) public static bool IsNeedProcessNG(RemoteLoad remoteLoad)
{ {
var requestLoadInfo = remoteLoad.RequestLoadInfo; var requestLoadInfo = remoteLoad.RequestLoadInfo;
var xx = TrayManager.Traylist.Values.ToList().Where(t => t.HasLoad && t.LoadType == requestLoadInfo.GetTrayType && (t.LastAddr >= 20 || t.LastAddr <= 3)); var xx = TrayManager.Traylist.Values.ToList().Where(t => t.HasLoad && t.LoadType == requestLoadInfo.GetTrayType && t.DestinationAddr==3 && (t.LastAddr >= 20 || t.LastAddr <= 3));
return xx.Count() > 0; return xx.Count() > 0;
} }
/// <summary> /// <summary>
/// 空托盘数量 /// 空托盘数量
/// </summary> /// </summary>
public static int EmptyCount; public volatile static int EmptyCount;
public volatile static int EmptyCount_MTP1;
public volatile static int EmptyCount_MTP2;
/// <summary> /// <summary>
/// 入库托盘数量 /// 入库托盘数量
/// </summary> /// </summary>
...@@ -301,6 +303,7 @@ namespace DeviceLibrary ...@@ -301,6 +303,7 @@ namespace DeviceLibrary
static DateTime lastrefresh; static DateTime lastrefresh;
public static void Statistics() { public static void Statistics() {
EmptyCount = 0; EmptyCount = 0;
EmptyCount_MTP1 = EmptyCount_MTP2 = 0;
InStoreCount = 0; InStoreCount = 0;
OutStoreCount = 0; OutStoreCount = 0;
OfflineCount = 0; OfflineCount = 0;
...@@ -317,6 +320,10 @@ namespace DeviceLibrary ...@@ -317,6 +320,10 @@ namespace DeviceLibrary
else else
OutStoreCount++; OutStoreCount++;
} else { } else {
if (ti.TrayType == TrayTypeE.MTP1)
EmptyCount_MTP1++;
else if (ti.TrayType == TrayTypeE.MTP2)
EmptyCount_MTP2++;
EmptyCount++; EmptyCount++;
} }
}); });
...@@ -373,15 +380,16 @@ namespace DeviceLibrary ...@@ -373,15 +380,16 @@ namespace DeviceLibrary
{ {
public static Dictionary<TrayTypeE, string> TrayTypeDesc = new Dictionary<TrayTypeE, string>(); public static Dictionary<TrayTypeE, string> TrayTypeDesc = new Dictionary<TrayTypeE, string>();
public static Dictionary<int, string> AddrDesc = new Dictionary<int, string>(); public static Dictionary<int, string> AddrDesc = new Dictionary<int, string>();
static TrayManager() { static TrayManager()
TrayTypeDesc.Add(TrayTypeE.None, crc.GetString("Res0002","空")); {
TrayTypeDesc.Add(TrayTypeE.MTP1, crc.GetString("Res0004", "流水线料盘托盘")); TrayTypeDesc.Add(TrayTypeE.None, crc.GetString("TrayType_" + TrayTypeE.None, crc.GetString("Res0002","空")));
TrayTypeDesc.Add(TrayTypeE.MTP2, crc.GetString("Res0003","流水线治具托盘")); TrayTypeDesc.Add(TrayTypeE.MTP1, crc.GetString("TrayType_" + TrayTypeE.MTP1, crc.GetString("Res0004","流水线料盘托盘")));
TrayTypeDesc.Add(TrayTypeE.S007, crc.GetString("Res0005","料串")); TrayTypeDesc.Add(TrayTypeE.MTP2, crc.GetString("TrayType_" + TrayTypeE.MTP2, crc.GetString("Res0003","流水线治具托盘")));
TrayTypeDesc.Add(TrayTypeE.M03, crc.GetString("Res0006","Tray料格")); TrayTypeDesc.Add(TrayTypeE.S007, crc.GetString("TrayType_" + TrayTypeE.S007, crc.GetString("Res0005","料串")));
TrayTypeDesc.Add(TrayTypeE.M02, crc.GetString("Res0007","PCB料格")); TrayTypeDesc.Add(TrayTypeE.M03, crc.GetString("TrayType_" + TrayTypeE.M03, crc.GetString("Res0006","Tray料格")));
TrayTypeDesc.Add(TrayTypeE.M01, crc.GetString("Res0008","PizzaBOX料格")); TrayTypeDesc.Add(TrayTypeE.M02, crc.GetString("TrayType_" + TrayTypeE.M02, crc.GetString("Res0007","PCB料格")));
TrayTypeDesc.Add(TrayTypeE.M04, crc.GetString("Res0009","ShoeBOX料格")); TrayTypeDesc.Add(TrayTypeE.M01, crc.GetString("TrayType_" + TrayTypeE.M01, crc.GetString("TrayType_M01","PizzaBOX料格")));
TrayTypeDesc.Add(TrayTypeE.M04, crc.GetString("TrayType_" + TrayTypeE.M04, crc.GetString("TrayType_M04","ShoeBOX料格")));
//TrayTypeDesc.Add(TrayTypeE.C01, crc.GetString("Res0010","PCB治具")); //TrayTypeDesc.Add(TrayTypeE.C01, crc.GetString("Res0010","PCB治具"));
//TrayTypeDesc.Add(TrayTypeE.C02, crc.GetString("Res0011","Pizza治具")); //TrayTypeDesc.Add(TrayTypeE.C02, crc.GetString("Res0011","Pizza治具"));
//TrayTypeDesc.Add(TrayTypeE.C03, crc.GetString("Res0012","Tray治具")); //TrayTypeDesc.Add(TrayTypeE.C03, crc.GetString("Res0012","Tray治具"));
......
...@@ -125,16 +125,6 @@ namespace DeviceLibrary ...@@ -125,16 +125,6 @@ namespace DeviceLibrary
case MoveStep.SideMove_01: case MoveStep.SideMove_01:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01); LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01);
bool Forcetry = false; bool Forcetry = false;
//if (LastGoInFail && (LastGoInFailTime - DateTime.Now).TotalSeconds > 10)
//{
// Forcetry = true;
// LSAMoveInfo.log("上次托盘进入失败本次重试");
//}
//if (IOValue(IO_Type.Ls_B_Tray_Check).Equals(IO_VALUE.HIGH))
//{
// break;
//}
//else
if (IOValue(IO_Type.Ls_A_Tray_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Ls_A_Tray_Check).Equals(IO_VALUE.HIGH))
{ {
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_04); LSAMoveInfo.NextMoveStep(MoveStep.SideMove_04);
...@@ -149,9 +139,9 @@ namespace DeviceLibrary ...@@ -149,9 +139,9 @@ namespace DeviceLibrary
//LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); //LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
} }
else else if (LSAMoveInfo.IsTimeOut(120))
{ {
//Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info); Msg.add(crc.GetString("Res0100.9451681e","入口长时间未检测到托盘,请检查."), MsgLevel.alarm);
} }
break; break;
case MoveStep.SideMove_02: case MoveStep.SideMove_02:
......
...@@ -106,9 +106,9 @@ namespace DeviceLibrary ...@@ -106,9 +106,9 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.TransplantMove_01); MoveInfo.NextMoveStep(MoveStep.TransplantMove_01);
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
} }
else else if (MoveInfo.IsTimeOut(120))
{ {
//Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info); Msg.add(crc.GetString("Res0100.9451681e","入口长时间未检测到托盘,请检查."), MsgLevel.alarm);
} }
//if (TrayManager.TestTrayRequest(GroupName)) { //if (TrayManager.TestTrayRequest(GroupName)) {
......
...@@ -113,8 +113,9 @@ namespace DeviceLibrary ...@@ -113,8 +113,9 @@ namespace DeviceLibrary
IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH); IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
} }
else { else if (MoveInfo.IsTimeOut(120))
//Msg.add(crc.GetString("Res0184","空闲中"), MsgLevel.info); {
Msg.add(crc.GetString("Res0100.9451681e","入口长时间未检测到托盘,请检查."), MsgLevel.alarm);
} }
break; break;
case MoveStep.TrayStop_01: case MoveStep.TrayStop_01:
...@@ -148,8 +149,8 @@ namespace DeviceLibrary ...@@ -148,8 +149,8 @@ namespace DeviceLibrary
TrayManager.Process(MoveInfo, CurrrentRFID, DeviceGroup.addr_1, IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.HIGH)?1:0, out TrayInfo trayInfo); TrayManager.Process(MoveInfo, CurrrentRFID, DeviceGroup.addr_1, IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.HIGH)?1:0, out TrayInfo trayInfo);
var stop = TrayManager.TryGetTrayRequest(GroupName, CurrrentRFID, out _); var stop = TrayManager.TryGetTrayRequest(GroupName, CurrrentRFID, out _);
MoveInfo.log($"CurrrentRFID:{CurrrentRFID},HasLoad:{trayInfo.HasLoad},MI_Reel_Check:{IOValue(IO_Type.MI_Reel_Check)},NeedStop:{stop}"); MoveInfo.log($"CurrrentRFID:{CurrrentRFID},HasLoad:{trayInfo.HasLoad},MI_Reel_Check:{IOValue(IO_Type.MI_Reel_Check)},NeedStop:{stop}");
#region 张东亮处理 #region
if (GroupName == "AMH-MI1" && trayInfo.TrayType== TrayTypeE.MTP1)// || GroupName == "AMH-MI2") if ((GroupName == "AMH-MI1" || GroupName == "AMH-MI2") && trayInfo.TrayType== TrayTypeE.MTP1)
{ {
/* /*
* 请求一个空托盘 * 请求一个空托盘
...@@ -345,6 +346,7 @@ namespace DeviceLibrary ...@@ -345,6 +346,7 @@ namespace DeviceLibrary
if (IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW))
{ {
Msg.add(crc.GetString("Res0062","托盘放料后没有检测到物料"), MsgLevel.alarm); Msg.add(crc.GetString("Res0062","托盘放料后没有检测到物料"), MsgLevel.alarm);
MoveInfo.log("托盘放料后没有检测到物料");
return; return;
} }
} }
...@@ -423,7 +425,7 @@ namespace DeviceLibrary ...@@ -423,7 +425,7 @@ namespace DeviceLibrary
Msg.add(crc.GetString("Res0041", "ML5料口门光栅被遮挡"), MsgLevel.warning); Msg.add(crc.GetString("Res0041", "ML5料口门光栅被遮挡"), MsgLevel.warning);
break; break;
} }
var dl = new string[] { "AMH-MI1" };//, "AMH-MI2" }; var dl = new string[] { "AMH-MI1", "AMH-MI2" };
foreach (var d in dl) foreach (var d in dl)
{ {
if (GroupName == d && MI.DeviceList[d].DeviceState != DeviceStateE.Run if (GroupName == d && MI.DeviceList[d].DeviceState != DeviceStateE.Run
...@@ -458,7 +460,11 @@ namespace DeviceLibrary ...@@ -458,7 +460,11 @@ namespace DeviceLibrary
break; break;
} }
} }
/// <summary>
/// MoveInfo.MoveStep == MoveStep.TrayStop_WaitLoadProcess
/// 是返回false
/// </summary>
/// <returns></returns>
public bool IsFree() public bool IsFree()
{ {
if (MoveInfo.MoveStep == MoveStep.TrayStop_WaitLoadProcess) if (MoveInfo.MoveStep == MoveStep.TrayStop_WaitLoadProcess)
......
...@@ -59,9 +59,9 @@ namespace DeviceLibrary ...@@ -59,9 +59,9 @@ namespace DeviceLibrary
// //
// button1 // button1
// //
this.button1.Location = new System.Drawing.Point(207, 160); this.button1.Location = new System.Drawing.Point(187, 194);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(82, 23); this.button1.Size = new System.Drawing.Size(102, 23);
this.button1.TabIndex = 1; this.button1.TabIndex = 1;
this.button1.Text = "添加/修改"; this.button1.Text = "添加/修改";
this.button1.UseVisualStyleBackColor = true; this.button1.UseVisualStyleBackColor = true;
...@@ -143,7 +143,7 @@ namespace DeviceLibrary ...@@ -143,7 +143,7 @@ namespace DeviceLibrary
this.checkBox_useedremove.AutoSize = true; this.checkBox_useedremove.AutoSize = true;
this.checkBox_useedremove.Checked = true; this.checkBox_useedremove.Checked = true;
this.checkBox_useedremove.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox_useedremove.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBox_useedremove.Location = new System.Drawing.Point(51, 164); this.checkBox_useedremove.Location = new System.Drawing.Point(51, 159);
this.checkBox_useedremove.Name = "checkBox_useedremove"; this.checkBox_useedremove.Name = "checkBox_useedremove";
this.checkBox_useedremove.Size = new System.Drawing.Size(72, 16); this.checkBox_useedremove.Size = new System.Drawing.Size(72, 16);
this.checkBox_useedremove.TabIndex = 5; this.checkBox_useedremove.TabIndex = 5;
...@@ -173,7 +173,7 @@ namespace DeviceLibrary ...@@ -173,7 +173,7 @@ namespace DeviceLibrary
this.groupBox_add.Controls.Add(this.button1); this.groupBox_add.Controls.Add(this.button1);
this.groupBox_add.Location = new System.Drawing.Point(37, 230); this.groupBox_add.Location = new System.Drawing.Point(37, 230);
this.groupBox_add.Name = "groupBox_add"; this.groupBox_add.Name = "groupBox_add";
this.groupBox_add.Size = new System.Drawing.Size(341, 216); this.groupBox_add.Size = new System.Drawing.Size(341, 234);
this.groupBox_add.TabIndex = 6; this.groupBox_add.TabIndex = 6;
this.groupBox_add.TabStop = false; this.groupBox_add.TabStop = false;
this.groupBox_add.Text = "添加或修改"; this.groupBox_add.Text = "添加或修改";
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace> <RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName> <AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
...@@ -142,6 +142,7 @@ public class ReelParam ...@@ -142,6 +142,7 @@ public class ReelParam
/// 料盘宽度 /// 料盘宽度
/// </summary> /// </summary>
public int PlateW { get; set; } public int PlateW { get; set; }
public float Weight { get; set; }
/// <summary> /// <summary>
/// 是否是入料NG料 /// 是否是入料NG料
/// </summary> /// </summary>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RemoteSheardObject</RootNamespace> <RootNamespace>RemoteSheardObject</RootNamespace>
<AssemblyName>RemoteSheardObject</AssemblyName> <AssemblyName>RemoteSheardObject</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
......
...@@ -100,13 +100,13 @@ namespace RemoteSheardObject ...@@ -100,13 +100,13 @@ namespace RemoteSheardObject
public static void UploadStatus(EquipMsgData equipMsgData) public static void UploadStatus(EquipMsgData equipMsgData)
{ {
string url = CombineUrl(Config.Get("Device_Server_Address"), "/rest/micron/device/updateStatus"); string url = CombineUrl(Config.Get("Device_Server_Address"), "/rest/micron/device/updateStatus");
var resultStr = HttpHelper.Post<EquipMsgData, ResultData>(url, equipMsgData); var resultStr = HttpHelper.Post<EquipMsgData, ResultData2>(url, equipMsgData);
} }
public static void uploadNgReel(NgMsgData ngMsgData) public static void uploadNgReel(NgMsgData ngMsgData)
{ {
string url = CombineUrl(Config.Get("Device_Server_Address"), "/rest/micron/device/uploadNgReel"); string url = CombineUrl(Config.Get("Device_Server_Address"), "/rest/micron/device/uploadNgReel");
var resultStr = HttpHelper.Post<NgMsgData, ResultData>(url, ngMsgData,5000,true); var resultStr = HttpHelper.Post<NgMsgData, ResultData2>(url, ngMsgData,5000,true);
} }
/// <summary> /// <summary>
/// NG口位置,1=左侧,2=右侧 /// NG口位置,1=左侧,2=右侧
......
...@@ -193,13 +193,111 @@ ...@@ -193,13 +193,111 @@
<level value="ALL"/> <level value="ALL"/>
<appender-ref ref="003048"/> <appender-ref ref="003048"/>
</logger> </logger>
<appender name="003035" type="log4net.Appender.RollingFileAppender">
<file value="logs/RT-003035.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<logger name="003035" additivity="false">
<level value="ALL"/>
<appender-ref ref="003035"/>
</logger>
<appender name="003036" type="log4net.Appender.RollingFileAppender">
<file value="logs/RT-003036.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<logger name="003036" additivity="false">
<level value="ALL"/>
<appender-ref ref="003036"/>
</logger>
<appender name="003041" type="log4net.Appender.RollingFileAppender">
<file value="logs/RT-003041.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<logger name="003041" additivity="false">
<level value="ALL"/>
<appender-ref ref="003041"/>
</logger>
<appender name="003042" type="log4net.Appender.RollingFileAppender">
<file value="logs/RT-003042.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<logger name="003042" additivity="false">
<level value="ALL"/>
<appender-ref ref="003042"/>
</logger>
<appender name="Robot-R1" type="log4net.Appender.RollingFileAppender">
<file value="logs/Robot-R1.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<logger name="Robot-R1" additivity="false">
<level value="ALL"/>
<appender-ref ref="Robot-R1"/>
</logger>
<appender name="Robot-R2" type="log4net.Appender.RollingFileAppender">
<file value="logs/Robot-R2.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<logger name="Robot-R2" additivity="false">
<level value="ALL"/>
<appender-ref ref="Robot-R2"/>
</logger>
<appender name="Robot-CI" type="log4net.Appender.RollingFileAppender">
<file value="logs/Robot-CI.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<logger name="Robot-CI" additivity="false">
<level value="ALL"/>
<appender-ref ref="Robot-CI"/>
</logger>
<!--<root> <!--<root>
<level value="Info" /> <level value="Info" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
</root>--> </root>-->
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
......
...@@ -38,6 +38,8 @@ namespace TheMachine ...@@ -38,6 +38,8 @@ namespace TheMachine
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.启用调试模式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.启用调试模式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.禁用蜂鸣器ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.语言toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.语言toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.简体中文ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.简体中文ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
...@@ -46,10 +48,8 @@ namespace TheMachine ...@@ -46,10 +48,8 @@ namespace TheMachine
this.tabc = new System.Windows.Forms.TabControl(); this.tabc = new System.Windows.Forms.TabControl();
this.tabP1 = new System.Windows.Forms.TabPage(); this.tabP1 = new System.Windows.Forms.TabPage();
this.pnl = new System.Windows.Forms.Panel(); this.pnl = new System.Windows.Forms.Panel();
this.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.禁用蜂鸣器ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.listView1 = new TheMachine.DoubleBufferListView(); this.listView1 = new TheMachine.DoubleBufferListView();
this.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.tabc.SuspendLayout(); this.tabc.SuspendLayout();
this.tabP1.SuspendLayout(); this.tabP1.SuspendLayout();
...@@ -118,14 +118,24 @@ namespace TheMachine ...@@ -118,14 +118,24 @@ namespace TheMachine
this.启用调试模式ToolStripMenuItem.Size = new System.Drawing.Size(204, 32); this.启用调试模式ToolStripMenuItem.Size = new System.Drawing.Size(204, 32);
this.启用调试模式ToolStripMenuItem.Tag = "not"; this.启用调试模式ToolStripMenuItem.Tag = "not";
this.启用调试模式ToolStripMenuItem.Text = "启用配置模式"; this.启用调试模式ToolStripMenuItem.Text = "启用配置模式";
this.启用调试模式ToolStripMenuItem.Visible = false;
this.启用调试模式ToolStripMenuItem.Click += new System.EventHandler(this.启用调试模式ToolStripMenuItem_Click); this.启用调试模式ToolStripMenuItem.Click += new System.EventHandler(this.启用调试模式ToolStripMenuItem_Click);
// //
// toolStripSeparator4 // toolStripSeparator4
// //
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(201, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(201, 6);
this.toolStripSeparator4.Visible = false; //
// 禁用蜂鸣器ToolStripMenuItem
//
this.禁用蜂鸣器ToolStripMenuItem.Name = "禁用蜂鸣器ToolStripMenuItem";
this.禁用蜂鸣器ToolStripMenuItem.Size = new System.Drawing.Size(204, 32);
this.禁用蜂鸣器ToolStripMenuItem.Text = "禁用蜂鸣器";
this.禁用蜂鸣器ToolStripMenuItem.Click += new System.EventHandler(this.禁用蜂鸣器ToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(201, 6);
// //
// 退出ToolStripMenuItem // 退出ToolStripMenuItem
// //
...@@ -198,31 +208,6 @@ namespace TheMachine ...@@ -198,31 +208,6 @@ namespace TheMachine
this.pnl.Size = new System.Drawing.Size(1000, 431); this.pnl.Size = new System.Drawing.Size(1000, 431);
this.pnl.TabIndex = 273; this.pnl.TabIndex = 273;
// //
// btn_PauseBuzzer
//
this.btn_PauseBuzzer.BackColor = System.Drawing.Color.OrangeRed;
this.btn_PauseBuzzer.ForeColor = System.Drawing.Color.White;
this.btn_PauseBuzzer.Location = new System.Drawing.Point(490, 0);
this.btn_PauseBuzzer.Name = "btn_PauseBuzzer";
this.btn_PauseBuzzer.Size = new System.Drawing.Size(301, 29);
this.btn_PauseBuzzer.TabIndex = 6;
this.btn_PauseBuzzer.Text = "本次暂停警报器响声";
this.btn_PauseBuzzer.UseVisualStyleBackColor = false;
this.btn_PauseBuzzer.Visible = false;
this.btn_PauseBuzzer.Click += new System.EventHandler(this.btn_PauseBuzzer_Click);
//
// 禁用蜂鸣器ToolStripMenuItem
//
this.禁用蜂鸣器ToolStripMenuItem.Name = "禁用蜂鸣器ToolStripMenuItem";
this.禁用蜂鸣器ToolStripMenuItem.Size = new System.Drawing.Size(204, 32);
this.禁用蜂鸣器ToolStripMenuItem.Text = "禁用蜂鸣器";
this.禁用蜂鸣器ToolStripMenuItem.Click += new System.EventHandler(this.禁用蜂鸣器ToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(201, 6);
//
// listView1 // listView1
// //
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
...@@ -237,6 +222,19 @@ namespace TheMachine ...@@ -237,6 +222,19 @@ namespace TheMachine
this.listView1.TabIndex = 2; this.listView1.TabIndex = 2;
this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.UseCompatibleStateImageBehavior = false;
// //
// btn_PauseBuzzer
//
this.btn_PauseBuzzer.BackColor = System.Drawing.Color.OrangeRed;
this.btn_PauseBuzzer.ForeColor = System.Drawing.Color.White;
this.btn_PauseBuzzer.Location = new System.Drawing.Point(490, 0);
this.btn_PauseBuzzer.Name = "btn_PauseBuzzer";
this.btn_PauseBuzzer.Size = new System.Drawing.Size(301, 29);
this.btn_PauseBuzzer.TabIndex = 6;
this.btn_PauseBuzzer.Text = "本次暂停警报器响声";
this.btn_PauseBuzzer.UseVisualStyleBackColor = false;
this.btn_PauseBuzzer.Visible = false;
this.btn_PauseBuzzer.Click += new System.EventHandler(this.btn_PauseBuzzer_Click);
//
// Form1 // Form1
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......
...@@ -140,6 +140,24 @@ namespace TheMachine ...@@ -140,6 +140,24 @@ namespace TheMachine
pnl.Enabled = false; pnl.Enabled = false;
禁用蜂鸣器ToolStripMenuItem_Click(this, EventArgs.Empty); 禁用蜂鸣器ToolStripMenuItem_Click(this, EventArgs.Empty);
tabc.Selecting += Tabc_Selecting;
}
bool configpass=false;
private void Tabc_Selecting(object sender, TabControlCancelEventArgs e)
{
if (e.TabPageIndex > 1)
{
if (configpass)
return;
if (!FrmPassCheck.CheckPassword())
e.Cancel = true;
else
{
configpass = true;
启用调试模式ToolStripMenuItem.Enabled = true;
}
}
} }
private void AlarmBuzzer_BuzzerStateChange(object sender, bool e) private void AlarmBuzzer_BuzzerStateChange(object sender, bool e)
...@@ -155,16 +173,16 @@ namespace TheMachine ...@@ -155,16 +173,16 @@ namespace TheMachine
e.Cancel = true; e.Cancel = true;
} }
const int tabpagecount = 5; const int tabpagecount = 5;
void addTablePage() { void addTablePage() {
AddForm("tab_io","MT", ioc);
AddForm("tab_tmc",crc.GetString("Form1_tabc_tab_tmc_Text","托盘"), tmc); AddForm("tab_tmc",crc.GetString("Form1_tabc_tab_tmc_Text","托盘"), tmc);
AddForm("tab_io", "MT", ioc);
AddForm("tab_sidemove", hy.DeviceName, hy); AddForm("tab_sidemove", hy.DeviceName, hy);
AddForm("tab_transmove", yz.DeviceName, yz); AddForm("tab_transmove", yz.DeviceName, yz);
AddForm("tab_traystopML", "ML", ml); AddForm("tab_traystopML", "MT-ML", ml);
AddForm("tab_traystopMI", "MI", mi); AddForm("tab_traystopMI", "MT-MI", mi);
AddForm("tab_traystopCI", "CI", ci); AddForm("tab_traystopCI", "MT-CI", ci);
AddForm("tab_traysetting", crc.GetString("Form1_tabc_tab_setting__SettingControl_tabControl1_tabPage1_Text","治具设置"), sc); AddForm("tab_traysetting", crc.GetString("Form1_tabc_tab_setting__SettingControl_tabControl1_tabPage1_Text","治具设置"), sc);
AddForm("tab_other", crc.GetString("Form1_tabc_tab_other_Text","周边"), mc); AddForm("tab_other", "MI", mc);
crc.LanguageProcess(this); crc.LanguageProcess(this);
} }
...@@ -200,6 +218,11 @@ namespace TheMachine ...@@ -200,6 +218,11 @@ namespace TheMachine
private void 启用调试模式ToolStripMenuItem_Click(object sender, EventArgs e) private void 启用调试模式ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
configpass = false;
tabc.SelectedIndex = 0;
启用调试模式ToolStripMenuItem.Enabled = false;
return;
RobotManage.IsConfigMode = RobotManage.IsConfigMode ? false : true; RobotManage.IsConfigMode = RobotManage.IsConfigMode ? false : true;
(sender as ToolStripMenuItem).Text = !RobotManage.IsConfigMode ? crc.GetString("Res0201","启用配置模式") : crc.GetString("Res0202","停用配置模式"); (sender as ToolStripMenuItem).Text = !RobotManage.IsConfigMode ? crc.GetString("Res0201","启用配置模式") : crc.GetString("Res0202","停用配置模式");
...@@ -279,18 +302,10 @@ namespace TheMachine ...@@ -279,18 +302,10 @@ namespace TheMachine
lm.Add(m); lm.Add(m);
} }
SetMsg(new Dictionary<string, List<Msg>>() { { "root",lm} }); SetMsg(new Dictionary<string, List<Msg>>() { { "root",lm} });
//启用调试模式ToolStripMenuItem.Enabled = true;
//启用调试模式ToolStripMenuItem_Click(启用调试模式ToolStripMenuItem, EventArgs.Empty);
//RobotManage.LoadDebug(); 启用调试模式ToolStripMenuItem.Text = crc.GetString("Res0101.fe92dc50","退出调试模式");
Task.Run(()=> { //启用调试模式ToolStripMenuItem_Click(启用调试模式ToolStripMenuItem, EventArgs.Empty);
Task.Delay(100).Wait();
this.Invoke((EventHandler)delegate
{
});
});
} }
......
...@@ -48,7 +48,7 @@ namespace TheMachine ...@@ -48,7 +48,7 @@ namespace TheMachine
this.configControl1.Config = null; this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(3, 235); this.configControl1.Location = new System.Drawing.Point(3, 235);
this.configControl1.Name = "configControl1"; this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(705, 254); this.configControl1.Size = new System.Drawing.Size(705, 238);
this.configControl1.TabIndex = 1; this.configControl1.TabIndex = 1;
this.configControl1.Tag = "not"; this.configControl1.Tag = "not";
// //
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>TheMachine</RootNamespace> <RootNamespace>TheMachine</RootNamespace>
<AssemblyName>MT</AssemblyName> <AssemblyName>MT</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>false</Deterministic> <Deterministic>false</Deterministic>
...@@ -173,6 +173,12 @@ ...@@ -173,6 +173,12 @@
<Compile Include="UC\DoubleBufferListView.cs"> <Compile Include="UC\DoubleBufferListView.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="UC\FrmPassCheck.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UC\FrmPassCheck.designer.cs">
<DependentUpon>FrmPassCheck.cs</DependentUpon>
</Compile>
<Compile Include="UC\RfidControl.cs"> <Compile Include="UC\RfidControl.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
...@@ -271,6 +277,9 @@ ...@@ -271,6 +277,9 @@
<EmbeddedResource Include="TrayManagerControl.resx"> <EmbeddedResource Include="TrayManagerControl.resx">
<DependentUpon>TrayManagerControl.cs</DependentUpon> <DependentUpon>TrayManagerControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UC\FrmPassCheck.resx">
<DependentUpon>FrmPassCheck.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\RfidControl.resx"> <EmbeddedResource Include="UC\RfidControl.resx">
<DependentUpon>RfidControl.cs</DependentUpon> <DependentUpon>RfidControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -110,13 +110,13 @@ namespace TheMachine ...@@ -110,13 +110,13 @@ namespace TheMachine
//listView1.Items.Clear(); //listView1.Items.Clear();
foreach (var ti in traylist) { foreach (var ti in traylist) {
var timego = (DateTime.Now - ti.LastUpdateTime); var timego = (DateTime.Now - ti.LastUpdateTime);
var lasttime = timego.Seconds + crc.GetString("Res0024","秒前"); var lasttime = timego.Seconds + crc.GetString("Res0102.cae20b9e","秒前");
if (timego.Minutes > 0) if (timego.Minutes > 0)
lasttime = timego.Minutes + crc.GetString("Res0025","分 ") + lasttime; lasttime = timego.Minutes + crc.GetString("Res0103.4c40da19","分 ") + lasttime;
if (timego.Hours > 0) if (timego.Hours > 0)
lasttime = timego.Hours + crc.GetString("Res0026","时 ") + lasttime; lasttime = timego.Hours + crc.GetString("Res0104.481f431e","时 ") + lasttime;
var traydesc = TrayManager.TrayTypeDesc[ti.TrayType]; var traydesc = crc.GetString("TrayType_" + ti.TrayType, TrayManager.TrayTypeDesc[ti.TrayType]);
var loaddesc = TrayManager.TrayTypeDesc[ti.LoadType]; var loaddesc = crc.GetString("TrayType_" + ti.LoadType, TrayManager.TrayTypeDesc[ti.LoadType]);
var lastaddrdesc = TrayManager.AddrDesc[ti.LastAddr]; var lastaddrdesc = TrayManager.AddrDesc[ti.LastAddr];
var toaddrdesc = TrayManager.AddrDesc[ti.DestinationAddr]; var toaddrdesc = TrayManager.AddrDesc[ti.DestinationAddr];
var reelid = ""; var reelid = "";
...@@ -156,7 +156,7 @@ namespace TheMachine ...@@ -156,7 +156,7 @@ namespace TheMachine
foreach (var tivk in TrayManager.TrayRequest.ToArray()) foreach (var tivk in TrayManager.TrayRequest.ToArray())
{ {
var ti = tivk.Value; var ti = tivk.Value;
var traydesc = TrayManager.TrayTypeDesc[ti.GetTrayType]; var traydesc = crc.GetString("TrayType_" + ti.GetTrayType, TrayManager.TrayTypeDesc[ti.GetTrayType]);
var desc = ti.IsEmpty ? crc.GetString("Res0030","空托盘") :""; var desc = ti.IsEmpty ? crc.GetString("Res0030","空托盘") :"";
var items = new string[] { traydesc, desc }; var items = new string[] { traydesc, desc };
...@@ -166,7 +166,7 @@ namespace TheMachine ...@@ -166,7 +166,7 @@ namespace TheMachine
listviewitem.SubItems.AddRange(items); listviewitem.SubItems.AddRange(items);
ListView2.Items.Add(listviewitem); ListView2.Items.Add(listviewitem);
} }
TrayManager.Statistics();
//listView1.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.ColumnContent); //listView1.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.ColumnContent);
label_Statistics.Text = crc.GetString("Res0027","托盘统计")+":" + "\n" label_Statistics.Text = crc.GetString("Res0027","托盘统计")+":" + "\n"
......
...@@ -69,7 +69,7 @@ namespace TheMachine ...@@ -69,7 +69,7 @@ namespace TheMachine
} }
tableLayoutPanel1.SuspendLayout(); tableLayoutPanel1.SuspendLayout();
int maxrow = tableLayoutPanel1.Height / 34; int maxrow = tableLayoutPanel1.Height / 36;
tableLayoutPanel1.Controls.Clear(); tableLayoutPanel1.Controls.Clear();
this.tableLayoutPanel1.RowStyles.Clear(); this.tableLayoutPanel1.RowStyles.Clear();
//this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType., 26)); //this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType., 26));
......
using OnlineStore;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine
{
public partial class FrmPassCheck : Form
{
public FrmPassCheck()
{
InitializeComponent();
crc.LanguageProcess(this);
}
public static bool CheckPassword() {
if (!Setting_Init.User_Enable)
return true;
FrmPassCheck frmPassCheck = new FrmPassCheck();
var result = frmPassCheck.ShowDialog();
return (result == DialogResult.OK);
}
private void btn_cancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
this.Close();
}
private void btn_ok_Click(object sender, EventArgs e)
{
if (textBox1.Text.Trim() == Setting_Init.User_AdminPassword.Val.Trim())
{
DialogResult = DialogResult.OK;
this.Close();
}
else
MessageBox.Show(crc.GetString("Res0057","密码不正确请重新输入!"));
}
}
}
\ No newline at end of file \ No newline at end of file

namespace TheMachine
{
partial class FrmPassCheck
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.btn_ok = new System.Windows.Forms.Button();
this.btn_cancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(114, 88);
this.textBox1.Name = "textBox1";
this.textBox1.PasswordChar = '*';
this.textBox1.Size = new System.Drawing.Size(318, 29);
this.textBox1.TabIndex = 0;
//
// btn_ok
//
this.btn_ok.Location = new System.Drawing.Point(352, 189);
this.btn_ok.Name = "btn_ok";
this.btn_ok.Size = new System.Drawing.Size(129, 49);
this.btn_ok.TabIndex = 1;
this.btn_ok.Text = "确定";
this.btn_ok.UseVisualStyleBackColor = true;
this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
//
// btn_cancel
//
this.btn_cancel.Location = new System.Drawing.Point(40, 189);
this.btn_cancel.Name = "btn_cancel";
this.btn_cancel.Size = new System.Drawing.Size(129, 49);
this.btn_cancel.TabIndex = 1;
this.btn_cancel.Text = "取消";
this.btn_cancel.UseVisualStyleBackColor = true;
this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);
//
// FrmPassCheck
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(548, 275);
this.Controls.Add(this.btn_cancel);
this.Controls.Add(this.btn_ok);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmPassCheck";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "请输入密码";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button btn_ok;
private System.Windows.Forms.Button btn_cancel;
}
}
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -190,7 +190,7 @@ namespace TheMachine ...@@ -190,7 +190,7 @@ namespace TheMachine
var axis = getConfigMoveAxis((int)((Button)sender).Tag); var axis = getConfigMoveAxis((int)((Button)sender).Tag);
var targetpos = int.Parse(cc[1].Text); var targetpos = int.Parse(cc[1].Text);
axis.SendMoveCmd(targetpos, axis.SpeedRate); axis.SendMoveCmd(targetpos, axis.SpeedRate,false, RobotHelper.LoadRateParam[1]);
LogUtil.info("手动点击机器人移动命令:" + axis.RobotIp + " - " + targetpos); LogUtil.info("手动点击机器人移动命令:" + axis.RobotIp + " - " + targetpos);
} }
URRobotControl getConfigMoveAxis(int Axisid) URRobotControl getConfigMoveAxis(int Axisid)
......
using Robot.UR; using DeviceLibrary;
using Robot.UR;
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
...@@ -118,7 +119,7 @@ namespace URRobot ...@@ -118,7 +119,7 @@ namespace URRobot
public void SendMoveCmd(int CmdIdx,int rate=50) public void SendMoveCmd(int CmdIdx,int rate=50)
{ {
robotControl?.SendMoveCmd(CmdIdx, rate, true); robotControl?.SendMoveCmd(CmdIdx, rate, true,RobotHelper.LoadRateParam[1]);
} }
public bool IsSendCmdOk(int cmdIdx) public bool IsSendCmdOk(int cmdIdx)
{ {
......
...@@ -51,8 +51,49 @@ namespace TheMachine.device.Other ...@@ -51,8 +51,49 @@ namespace TheMachine.device.Other
#endregion #endregion
crc.LanguageChangeEvent += Crc_LanguageChangeEvent; ; crc.LanguageChangeEvent += Crc_LanguageChangeEvent; ;
// 假设 TowerInfo 列表已经存在并被填充了
List<TowerInfo> towerList = TowerList.List.Values.ToList();
// 创建一个 checkbox 的列表控件
List<CheckBox> checkBoxList = new List<CheckBox>();
// 遍历 TowerInfo 列表,并生成一个带有 checkbox 的列表
foreach (var tower in towerList)
{
// 创建一个新的 checkbox 控件
CheckBox checkBox = new CheckBox();
checkBox.Text = tower.TowerName;
checkBox.Checked = tower.Enable;
// 添加一个 Tag 属性,用于保存对应的 TowerInfo 对象
checkBox.Tag = tower;
// 将 checkbox 控件添加到列表中
checkBoxList.Add(checkBox);
// 将 checkbox 的 CheckedChanged 事件与一个方法绑定,用于修改对应的 TowerInfo 对象的 enable 属性
checkBox.CheckedChanged += CheckBox_CheckedChanged;
}
// 将 checkbox 列表添加到窗体中的一个容器控件中
foreach (var checkBox in checkBoxList)
{
flowLayoutPanel2.Controls.Add(checkBox);
}
} }
// CheckBox 的 CheckedChanged 事件的处理方法
private void CheckBox_CheckedChanged(object sender, EventArgs e)
{
// 获取当前 checkbox 控件和对应的 TowerInfo 对象
CheckBox checkBox = (CheckBox)sender;
TowerInfo tower = (TowerInfo)checkBox.Tag;
// 更新 TowerInfo 对象的 enable 属性
tower.Enable = checkBox.Checked;
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e) private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{ {
stateView.Columns[1].Text = "Tower ID"; stateView.Columns[1].Text = "Tower ID";
...@@ -91,5 +132,16 @@ namespace TheMachine.device.Other ...@@ -91,5 +132,16 @@ namespace TheMachine.device.Other
MI.DeviceList["AMH-MI1"].Reset(); MI.DeviceList["AMH-MI1"].Reset();
} }
private void button1_Click(object sender, EventArgs e)
{
if (RobotManage.isRunning)
{
MessageBox.Show(crc.GetString("Res0072", "请先停止系统运行"));
return;
}
MI.DeviceList["AMH-MI2"].Reset();
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -41,7 +41,8 @@ namespace TheMachine ...@@ -41,7 +41,8 @@ namespace TheMachine
var axis = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[deviceGroupName].AxisID); var axis = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[deviceGroupName].AxisID);
if (axis != null) if (axis != null)
axisMoveControl1.LoadData(AxisBean.List[deviceGroupName]); axisMoveControl1.LoadData(AxisBean.List[deviceGroupName]);
else
crc.LanguageProcess(axisMoveControl1);
if (TrayStop.DeviceList[deviceGroupName].RFID_1 != null) if (TrayStop.DeviceList[deviceGroupName].RFID_1 != null)
rfidControl1.Init(deviceGroupName, TrayStop.DeviceList[deviceGroupName].RFID_1); rfidControl1.Init(deviceGroupName, TrayStop.DeviceList[deviceGroupName].RFID_1);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!