Commit 1d786b63 刘韬

优化MyCronic报错处理

1 个父辈 dff26e48
正在显示 43 个修改的文件 包含 726 行增加186 行删除
......@@ -277,8 +277,8 @@ namespace OnlineStore
//}
//string className = cc.ClassName;
CurrLanguage = CodeResourceControl.GetLanguage();
//string name = CodeResourceControl.GetString(CodeResourceControl.GetTextIdStr(className), cc.Text);
//if (!name.Equals("")) { cc.Text = name; }
string name = CodeResourceControl.GetString(className, cc.Text);
if (!name.Equals("")) { cc.Text = name; }
PreControlLanaguage(cc, className);
RefreshLanguageEvent?.Invoke();
......
......@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>MyCommon</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
......
......@@ -74,12 +74,15 @@ namespace OnlineStore.Common
[MyConfigComment("二维码扫码超时毫秒")]
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_Robot_ReelInfo;
public static MyConfig<string> Runtime_Robot_FromPos;
public static MyConfig<string> Runtime_Robot_ToPos;
public static MyConfig<string> RuntimeRobot_Arm_MoveStep;
public static MyConfig<string> RuntimeRobot_MoveStep;
//public static MyConfig<string> Runtime_Robot_ReelInfo;
//public static MyConfig<string> Runtime_Robot_FromPos;
//public static MyConfig<string> Runtime_Robot_ToPos;
}
}
......@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
......@@ -202,12 +202,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="StoreConfig\fixPositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using OnlineStore.Common;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
......@@ -46,28 +47,28 @@ namespace DeviceLibrary
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)
{
AxisManager.SuddenStop(portName, slvAddr);
Msg += string.Format("...伺服忙碌,急停{0}次", openretry);
Msg += string.Format(crc.GetString("Res0074.814c87d5","...伺服忙碌,急停{0}次"), openretry);
Thread.Sleep(100);
}
AxisManager.ServoOn(portName, slvAddr);
Thread.Sleep(200);
if (AxisManager.IsServeoOn(portName, slvAddr))
{
Msg += "..." + "使能成功";
Msg += "..." + crc.GetString("Res0075.c054671f","使能成功");
openretry = 0;
return true;
}
else
Msg += "..." + "尝试使能失败";
Msg += "..." + crc.GetString("Res0076.94b55bdf","尝试使能失败");
Thread.Sleep(1000);
if (openretry < 5)
Msg = "伺服连接中" + "...";
Msg = crc.GetString("Res0077.abdd7b6b","伺服连接中") + "...";
}
return false;
}
......@@ -162,7 +163,7 @@ namespace DeviceLibrary
int isAlarm = AxisManager.GetAlarmStatus(deviceName, axisNo);
if (isAlarm.Equals(1))
{
clearMsg = "清理报警" + ",";
clearMsg = crc.GetString("Res0078.a6087377","清理报警") + ",";
AxisManager.AlarmClear(deviceName, axisNo);
Thread.Sleep(200);
AxisManager.ServoOn(deviceName, axisNo);
......@@ -183,7 +184,7 @@ namespace DeviceLibrary
}
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);
}
}
......@@ -204,14 +205,14 @@ namespace DeviceLibrary
//判断是否需要重新运动
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 + "重新回原点");
AxisManager.HomeMove(axis.DeviceName, axis.GetAxisValue(), axis.HomeHighSpeed, axis.HomeLowSpeed, axis.HomeAddSpeed);
MoveInfo.CanWhileCount--;
}
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);
}
}
......@@ -415,11 +416,11 @@ namespace DeviceLibrary
Thread.Sleep(200);
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;
}
else
msg += string.Format("轴(0)存在报警,清除成功", axis.Config.Explain);
msg += string.Format(crc.GetString("Res0088.b5876296","轴(0)存在报警,清除成功"), axis.Config.Explain);
}
}
Thread.Sleep(50);
......@@ -427,4 +428,4 @@ namespace DeviceLibrary
}
}
}
}
\ No newline at end of file
......@@ -27,11 +27,12 @@ namespace DeviceLibrary
{
ConfigIO configIo = StoreManager.Config.DOList[device][ioType];
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}");
StackTrace stackTrace = new StackTrace();
for (int i = 0; i < stackTrace.FrameCount; i++)
{
{
StackFrame stackFrame = stackTrace.GetFrame(i);
string fileName = stackFrame.GetFileName();
int lineNumber = stackFrame.GetFileLineNumber();
......
......@@ -11,18 +11,20 @@ using System.Threading.Tasks;
namespace DeviceLibrary
{
class RobotHelper
public class RobotHelper
{
int lastMoveCmd = 0;
int lastSpeedRate = 0;
public int lastWeight = 0;
URRobotControl robot;
System.Timers.Timer RobotCheck;
string Robotname;
public RobotHelper(URRobotControl _robot,string robotname) {
public RobotHelper(URRobotControl _robot, string robotname) {
robot = _robot;
Robotname = robotname;
RobotCheck = new System.Timers.Timer(5000);
RobotCheck.Elapsed += RobotCheck_Elapsed;
}
public volatile bool RobotStatus = false;
private void RobotCheck_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
......@@ -42,6 +44,10 @@ namespace DeviceLibrary
if (robot.CurDashboardReponse.Contains("PROTECTIVE_STOP"))
{
robot.SendCMD("unlock protective stop", 0);
lastWeight = lastWeight + 1;
if (lastWeight > 4)
lastWeight = 1;
robot.log("触发保护性停止,调节负载重量:" + lastWeight);
return;
}
return;
......@@ -71,7 +77,7 @@ namespace DeviceLibrary
void uploadStatus() {
EquipMsgData equipMsg = new EquipMsgData();
equipMsg.msgList = new List<EquipMessage>();
equipMsg.status = RobotStatus?1:2;
equipMsg.status = RobotStatus ? 1 : 2;
if (!RobotStatus)
{
equipMsg.msgList.Add(new EquipMessage()
......@@ -83,13 +89,19 @@ namespace DeviceLibrary
equipMsg.equipName = Robotname;
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)
{
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;
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()
......@@ -100,10 +112,18 @@ namespace DeviceLibrary
public bool IsMoveOk(WaitResultInfo waitResultInfo) {
if (robot.CurCmdReponse.Contains($"{lastMoveCmd},done"))
return true;
else if (robot.CurCmdReponse.Contains($"done"))
else if (robot.CurCmdReponse.Contains($"done") || retrytime>1)
{
LogUtil.error($"机器人没有移动到位,重新移动:{lastMoveCmd}");
robot.SendMoveCmd(lastMoveCmd);
retrytime = 0;
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;
}
else
......@@ -115,5 +135,27 @@ namespace DeviceLibrary
{
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
......@@ -54,15 +54,19 @@ namespace DeviceLibrary
OutMaterialTaskCount = data["pizzaBox"] + data["pcb"] + data["tray"];
OutReelTaskCount = data["reel"];
}
TrayManager.Statistics();
var remoteLoad = new RemoteLoad();
remoteLoad.RequestLoadInfo = new RequestLoadInfo();
remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString();
var r = TrayManager.IsNeedProcessNG(remoteLoad);
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)
// ProcessMsg(MsgService.MSList);
//if (!string.IsNullOrWhiteSpace(server))
// SendLineStatus();
}
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
{
try
{
if (RobotManage.isRunning)
if (RobotManage.isRunning && storeStatus >0)
{
//ProcessMsg(VMsg.msg);
SendLineStatus();
......@@ -183,7 +183,7 @@ namespace DeviceLibrary
boxStatus.temperature = Temperature.ToString();
//状态
boxStatus.status = (int)storeStatus;
boxStatus.data.Add("capacity", capacity);
string sendmsg = "";
......@@ -578,6 +578,8 @@ namespace DeviceLibrary
return true;
}
MydataWcfServiceTest.ServiceReference2.TowerAppWSClient towerAppWSClient;
internal string capacity;
public bool SendCommand(string command, bool needlog, out string msg, params string[] arg)
{
string errmsg;
......
......@@ -28,15 +28,17 @@ namespace DeviceLibrary
}
public string CID;
public string TowerName;
public TowerInfo TowerInfo;
public VStore(TowerInfo towerInfo, VStoreCollection storeCollection) {
vc = storeCollection;
CID = towerInfo.TowerID;
TowerName = towerInfo.TowerName;
TowerInfo= towerInfo;
VLog = new VLog(CID, CID);
ServerCM = new VServerComm(CID,VLog);
ServerCM.OutStoreEvent += ServerCM_OutStoreEvent;
ServerCM.storeStatus = StoreStatus.None;
Msg = new MsgService("RT-"+CID);
Msg = new MsgService("RT-" + CID);
OutStoreJobList = new StoreJobList(crc.GetString("Res0050","出库任务"));
}
......@@ -53,6 +55,13 @@ namespace DeviceLibrary
DateTime LastStatusTime = DateTime.Now;
int LastStatusCode = 0;
internal void VTowerProcess() {
if (!TowerInfo.Enable) {
ServerCM.storeStatus = StoreStatus.None;
CurrentTowerStatusText = "Disable";
RTStoreStatus = RTStoreStatus.Offline;
return;
}
try
{
var ti = ServerCM.GetTowerDetailInformation(CID);
......@@ -66,7 +75,16 @@ namespace DeviceLibrary
CurrentTowerStatusText = $"[TI={ti.StatusCode}-{ti.StatusText}]";
ServerCM.Temperature = ti.Temperature;
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;
if (RTStoreStatus != RTStoreStatus.LockToInStore && RTStoreStatus != RTStoreStatus.InStoreReady)
......@@ -83,6 +101,7 @@ namespace DeviceLibrary
RTStoreStatus = RTStoreStatus.LockToInStore;
if (!ServerCM.BeginOutStore(jobInfo.Clone(), VLog))
{
Msg.add(crc.GetString("Res0105.f3331370","发送出库指令失败") + ":" + jobInfo.WareNum, MsgLevel.alarm);
RTStoreStatus = RTStoreStatus.Ready;
}
CurrentTerminalReelID = jobInfo.WareNum;
......@@ -119,7 +138,7 @@ namespace DeviceLibrary
{
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)
......@@ -162,28 +181,38 @@ namespace DeviceLibrary
}
else if (ti.StatusCode == 1041)
{
if (RTStoreStatus != RTStoreStatus.OutStoreReady)
if (InStoreJobInfo == null)
{
VLog.Info("出库已完成");
InStoreJobInfo = null;
OutStoreEnd(CurrentTerminalReelID, CID);
}
if (RTStoreStatus != RTStoreStatus.OutStoreReady)
{
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)
{
RTStoreStatus = RTStoreStatus.Offline;
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);
RTStoreStatus = RTStoreStatus.InStoreError;
ServerCM.storeStatus = StoreStatus.InStoreFaild;
InStoreJobInfo = null;
//CurrentTowerStatusText = $"{ti.StatusText}-{ti.OnlineStatus}";
//InStoreJobInfo = null;
}
else if (ti.StatusCode < 10000)
{
......@@ -198,6 +227,7 @@ namespace DeviceLibrary
Msg.add($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}", MsgLevel.alarm);
ServerCM.storeStatus = StoreStatus.InTrouble;
RTStoreStatus = RTStoreStatus.Error;
//CurrentTowerStatusText = $"{ti.StatusText}-{ti.OnlineStatus}";
}
}
else
......@@ -216,9 +246,13 @@ namespace DeviceLibrary
1042 material unloaded to Terminal from Tower 物料已取走
6015 Reel already loaded.
3068 初始化中
310117 Opertion denied
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++)
{
var sn = ti.Slots[i].Slotname;
......@@ -240,11 +274,15 @@ namespace DeviceLibrary
int.TryParse(sn.Substring(2), out h);
}
//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)
{
ServerCM.storeStatus = StoreStatus.None;
RTStoreStatus = RTStoreStatus.Offline;
VLog.Error("VStore Error:" + ex);
}
finally
......@@ -256,6 +294,10 @@ namespace DeviceLibrary
public Dictionary<string, string> SlotsInfo = new Dictionary<string, string>();
public string GetStateStr()
{
if (!TowerInfo.Enable)
{
return "Disable";
}
if (RTStoreStatus == RTStoreStatus.OutStoreReady)
return crc.GetString("Res0066","出库中") + (!string.IsNullOrEmpty(CurrentTerminalReelID)?"SN:" + CurrentTerminalReelID:"");
......@@ -270,6 +312,11 @@ namespace DeviceLibrary
{
return crc.GetString("Res0069","入库出错,物料NG") + " Barcode:" + InStoreJobInfo?.WareNum;
}
if (RTStoreStatus == RTStoreStatus.Error)
{
return CurrentTowerStatusText;
}
return crc.GetString("Res0070","空闲中");
}
......@@ -291,6 +338,11 @@ namespace DeviceLibrary
{
return ServerCM.SendStoreState("", posid, StoreStatus.InStoreEnd);
}
internal void log(string v)
{
VLog.Info(v);
}
}
public enum RTStoreStatus {
Offline,
......
......@@ -53,6 +53,7 @@ namespace DeviceLibrary
var reelid = r.Descendants("Barcode").FirstOrDefault().Value;
var towerid = r.Descendants("TowerId").FirstOrDefault().Value;
VLog.Info("收到入库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}");
VStoreList[towerid].log("收到入库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}");
if (!VStoreList.ContainsKey(towerid))
{
VLog.Error("收到入库信息,但没有找到该料仓id");
......@@ -65,6 +66,7 @@ namespace DeviceLibrary
reelid = r.Descendants("Barcode").FirstOrDefault().Value;
towerid = r.Descendants("TowerId").FirstOrDefault().Value;
VLog.Info("收到出库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}");
VStoreList[towerid].log("收到出库完成通知:" + $"ReelID:{reelid},TowerID:{towerid}");
if (!VStoreList.ContainsKey(towerid)) {
VLog.Error("收到出库信息,但没有找到该料仓id");
}
......
......@@ -32,7 +32,7 @@ namespace DeviceLibrary
{
EquipMsgData equipMsg = new EquipMsgData();
equipMsg.msgList = new List<EquipMessage>();
equipMsg.status = 0;
equipMsg.status = 1;
Msg.msg.ForEach(ml =>
{
equipMsg.msgList.Add(new EquipMessage()
......@@ -42,8 +42,6 @@ namespace DeviceLibrary
});
if (ml.msgLevel == MsgLevel.alarm)
equipMsg.status = 2;
else
equipMsg.status = 1;
});
equipMsg.equipName = GroupName;
TheLine.UploadStatus(equipMsg);
......
......@@ -106,7 +106,7 @@ namespace DeviceLibrary
foreach (var ledcolor in ledcfg.Keys)
{
if (ledcfg[ledcolor] == LedState.none)
return;
continue;
Led.LedColors[ledcolor].LedState = ledcfg[ledcolor];
}
}
......@@ -126,13 +126,13 @@ namespace DeviceLibrary
{
ProcessLefCfg(MachineLedStateE.Running);
//出入库 绿闪 黄闪
if (RobotManage.isRunning)
{
//RunningLed.LedState = LedState.blink;
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.InOut);
}
////出入库 绿闪 黄闪
//if (RobotManage.isRunning)
//{
// //RunningLed.LedState = LedState.blink;
// //StandbyLed.LedState = LedState.blink;
// ProcessLefCfg(MachineLedStateE.InOut);
//}
//系统暂停,说明书未定义, 绿闪, 红闪
if (!canRunning || UserPause)
{
......
using log4net;
using OnlineStore;
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
......@@ -262,36 +263,36 @@ namespace DeviceLibrary
{
if (IsHomeMove)
{
return "轴" + "【" + AxisInfo.DisplayStr + "】" + "原点返回";
return crc.GetString("Res0089.60c85b4b","轴") + "【" + AxisInfo.DisplayStr + "】" + crc.GetString("AxisMoveControl_groupAxis_panel1_btnAxisReturnHome_Text","原点返回");
}
else
{
return "轴" + "【" + AxisInfo.DisplayStr + "】" + "绝对运动,目标位置" + "【" + TargetPosition + "】";
return crc.GetString("Res0089.60c85b4b","轴") + "【" + AxisInfo.DisplayStr + "】" + crc.GetString("Res0090.0c33436f","绝对运动,目标位置") + "【" + TargetPosition + "】";
}
}
else if (WaitType.Equals(WaitEnum.W002_IOValue))
{
return "等待" + "【" + IoType + "】=【" + IoValue + "】";
return crc.GetString("Res0157","等待") + "【" + IoType + "】=【" + IoValue + "】";
}
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))
{
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))
{
return "料盘高度" + "【" + TargetPosition + "】";
return crc.GetString("Res0094.f4a8d691","料盘高度") + "【" + TargetPosition + "】";
}
else if (WaitType.Equals(WaitEnum.W008_BatchAxis))
{
return "批量轴上升到上料点";
return crc.GetString("Res0095.84e7c741","批量轴上升到上料点");
}
else if (WaitType.Equals(WaitEnum.W009_ScanCode))
{
return "扫码完成";
return crc.GetString("Res0096.ed4de1c6","扫码完成");
}
else if (WaitType.Equals(WaitEnum.W013_Action))
{
......@@ -430,4 +431,4 @@ namespace DeviceLibrary
///// </summary>
//CheckFixture=6,
}
}
}
\ No newline at end of file
......@@ -67,13 +67,13 @@ namespace DeviceLibrary
MI2Postion = CSVPositionReader<RobotPosition>.LoadCSVFile(MI2PostionFile);
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.SetSpeedRate(Setting_Init.URRobot_MI1_Speed_Rate);
Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP);
Robot_MI1.Name = "R2";
Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP, "Robot-R2");
Robot_MI2.Name = "R2";
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);
VStoreCollection = new VStoreCollection();
......
......@@ -32,7 +32,7 @@ namespace DeviceLibrary
Traylist.Add(rfid, new TrayInfo());
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].LastAddr = addr;
......@@ -276,14 +276,16 @@ namespace DeviceLibrary
public static bool IsNeedProcessNG(RemoteLoad remoteLoad)
{
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;
}
/// <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>
......@@ -301,6 +303,7 @@ namespace DeviceLibrary
static DateTime lastrefresh;
public static void Statistics() {
EmptyCount = 0;
EmptyCount_MTP1 = EmptyCount_MTP2 = 0;
InStoreCount = 0;
OutStoreCount = 0;
OfflineCount = 0;
......@@ -317,6 +320,10 @@ namespace DeviceLibrary
else
OutStoreCount++;
} else {
if (ti.TrayType == TrayTypeE.MTP1)
EmptyCount_MTP1++;
else if (ti.TrayType == TrayTypeE.MTP2)
EmptyCount_MTP2++;
EmptyCount++;
}
});
......@@ -373,15 +380,16 @@ namespace DeviceLibrary
{
public static Dictionary<TrayTypeE, string> TrayTypeDesc = new Dictionary<TrayTypeE, string>();
public static Dictionary<int, string> AddrDesc = new Dictionary<int, string>();
static TrayManager() {
TrayTypeDesc.Add(TrayTypeE.None, crc.GetString("Res0002","空"));
TrayTypeDesc.Add(TrayTypeE.MTP1, crc.GetString("Res0004", "流水线料盘托盘"));
TrayTypeDesc.Add(TrayTypeE.MTP2, crc.GetString("Res0003","流水线治具托盘"));
TrayTypeDesc.Add(TrayTypeE.S007, crc.GetString("Res0005","料串"));
TrayTypeDesc.Add(TrayTypeE.M03, crc.GetString("Res0006","Tray料格"));
TrayTypeDesc.Add(TrayTypeE.M02, crc.GetString("Res0007","PCB料格"));
TrayTypeDesc.Add(TrayTypeE.M01, crc.GetString("Res0008","PizzaBOX料格"));
TrayTypeDesc.Add(TrayTypeE.M04, crc.GetString("Res0009","ShoeBOX料格"));
static TrayManager()
{
TrayTypeDesc.Add(TrayTypeE.None, crc.GetString("TrayType_" + TrayTypeE.None, crc.GetString("Res0002","空")));
TrayTypeDesc.Add(TrayTypeE.MTP1, crc.GetString("TrayType_" + TrayTypeE.MTP1, crc.GetString("Res0004","流水线料盘托盘")));
TrayTypeDesc.Add(TrayTypeE.MTP2, crc.GetString("TrayType_" + TrayTypeE.MTP2, crc.GetString("Res0003","流水线治具托盘")));
TrayTypeDesc.Add(TrayTypeE.S007, crc.GetString("TrayType_" + TrayTypeE.S007, crc.GetString("Res0005","料串")));
TrayTypeDesc.Add(TrayTypeE.M03, crc.GetString("TrayType_" + TrayTypeE.M03, crc.GetString("Res0006","Tray料格")));
TrayTypeDesc.Add(TrayTypeE.M02, crc.GetString("TrayType_" + TrayTypeE.M02, crc.GetString("Res0007","PCB料格")));
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.C02, crc.GetString("Res0011","Pizza治具"));
//TrayTypeDesc.Add(TrayTypeE.C03, crc.GetString("Res0012","Tray治具"));
......
......@@ -125,16 +125,6 @@ namespace DeviceLibrary
case MoveStep.SideMove_01:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01);
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))
{
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_04);
......@@ -149,9 +139,9 @@ namespace DeviceLibrary
//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;
case MoveStep.SideMove_02:
......
......@@ -106,9 +106,9 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.TransplantMove_01);
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)) {
......
......@@ -113,8 +113,9 @@ namespace DeviceLibrary
IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
}
else {
//Msg.add(crc.GetString("Res0184","空闲中"), MsgLevel.info);
else if (MoveInfo.IsTimeOut(120))
{
Msg.add(crc.GetString("Res0100.9451681e","入口长时间未检测到托盘,请检查."), MsgLevel.alarm);
}
break;
case MoveStep.TrayStop_01:
......@@ -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);
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}");
#region 张东亮处理
if (GroupName == "AMH-MI1" && trayInfo.TrayType== TrayTypeE.MTP1)// || GroupName == "AMH-MI2")
#region
if ((GroupName == "AMH-MI1" || GroupName == "AMH-MI2") && trayInfo.TrayType== TrayTypeE.MTP1)
{
/*
* 请求一个空托盘
......@@ -345,6 +346,7 @@ namespace DeviceLibrary
if (IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW))
{
Msg.add(crc.GetString("Res0062","托盘放料后没有检测到物料"), MsgLevel.alarm);
MoveInfo.log("托盘放料后没有检测到物料");
return;
}
}
......@@ -423,7 +425,7 @@ namespace DeviceLibrary
Msg.add(crc.GetString("Res0041", "ML5料口门光栅被遮挡"), MsgLevel.warning);
break;
}
var dl = new string[] { "AMH-MI1" };//, "AMH-MI2" };
var dl = new string[] { "AMH-MI1", "AMH-MI2" };
foreach (var d in dl)
{
if (GroupName == d && MI.DeviceList[d].DeviceState != DeviceStateE.Run
......@@ -458,7 +460,11 @@ namespace DeviceLibrary
break;
}
}
/// <summary>
/// MoveInfo.MoveStep == MoveStep.TrayStop_WaitLoadProcess
/// 是返回false
/// </summary>
/// <returns></returns>
public bool IsFree()
{
if (MoveInfo.MoveStep == MoveStep.TrayStop_WaitLoadProcess)
......
......@@ -59,9 +59,9 @@ namespace DeviceLibrary
//
// 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.Size = new System.Drawing.Size(82, 23);
this.button1.Size = new System.Drawing.Size(102, 23);
this.button1.TabIndex = 1;
this.button1.Text = "添加/修改";
this.button1.UseVisualStyleBackColor = true;
......@@ -143,7 +143,7 @@ namespace DeviceLibrary
this.checkBox_useedremove.AutoSize = true;
this.checkBox_useedremove.Checked = true;
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.Size = new System.Drawing.Size(72, 16);
this.checkBox_useedremove.TabIndex = 5;
......@@ -173,7 +173,7 @@ namespace DeviceLibrary
this.groupBox_add.Controls.Add(this.button1);
this.groupBox_add.Location = new System.Drawing.Point(37, 230);
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.TabStop = false;
this.groupBox_add.Text = "添加或修改";
......
......@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<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
/// 料盘宽度
/// </summary>
public int PlateW { get; set; }
public float Weight { get; set; }
/// <summary>
/// 是否是入料NG料
/// </summary>
......
......@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RemoteSheardObject</RootNamespace>
<AssemblyName>RemoteSheardObject</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
......
......@@ -100,13 +100,13 @@ namespace RemoteSheardObject
public static void UploadStatus(EquipMsgData equipMsgData)
{
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)
{
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>
/// NG口位置,1=左侧,2=右侧
......
......@@ -193,13 +193,111 @@
<level value="ALL"/>
<appender-ref ref="003048"/>
</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>
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</root>-->
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
......
......@@ -38,6 +38,8 @@ namespace TheMachine
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.启用调试模式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
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();
......@@ -46,10 +48,8 @@ namespace TheMachine
this.tabc = new System.Windows.Forms.TabControl();
this.tabP1 = new System.Windows.Forms.TabPage();
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.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
this.tabc.SuspendLayout();
this.tabP1.SuspendLayout();
......@@ -118,14 +118,24 @@ namespace TheMachine
this.启用调试模式ToolStripMenuItem.Size = new System.Drawing.Size(204, 32);
this.启用调试模式ToolStripMenuItem.Tag = "not";
this.启用调试模式ToolStripMenuItem.Text = "启用配置模式";
this.启用调试模式ToolStripMenuItem.Visible = false;
this.启用调试模式ToolStripMenuItem.Click += new System.EventHandler(this.启用调试模式ToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
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
//
......@@ -198,31 +208,6 @@ namespace TheMachine
this.pnl.Size = new System.Drawing.Size(1000, 431);
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
//
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
......@@ -237,6 +222,19 @@ namespace TheMachine
this.listView1.TabIndex = 2;
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
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......
......@@ -140,6 +140,24 @@ namespace TheMachine
pnl.Enabled = false;
禁用蜂鸣器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)
......@@ -155,16 +173,16 @@ namespace TheMachine
e.Cancel = true;
}
const int tabpagecount = 5;
void addTablePage() {
AddForm("tab_io","MT", ioc);
void addTablePage() {
AddForm("tab_tmc",crc.GetString("Form1_tabc_tab_tmc_Text","托盘"), tmc);
AddForm("tab_io", "MT", ioc);
AddForm("tab_sidemove", hy.DeviceName, hy);
AddForm("tab_transmove", yz.DeviceName, yz);
AddForm("tab_traystopML", "ML", ml);
AddForm("tab_traystopMI", "MI", mi);
AddForm("tab_traystopCI", "CI", ci);
AddForm("tab_traystopML", "MT-ML", ml);
AddForm("tab_traystopMI", "MT-MI", mi);
AddForm("tab_traystopCI", "MT-CI", ci);
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);
}
......@@ -200,6 +218,11 @@ namespace TheMachine
private void 启用调试模式ToolStripMenuItem_Click(object sender, EventArgs e)
{
configpass = false;
tabc.SelectedIndex = 0;
启用调试模式ToolStripMenuItem.Enabled = false;
return;
RobotManage.IsConfigMode = RobotManage.IsConfigMode ? false : true;
(sender as ToolStripMenuItem).Text = !RobotManage.IsConfigMode ? crc.GetString("Res0201","启用配置模式") : crc.GetString("Res0202","停用配置模式");
......@@ -279,18 +302,10 @@ namespace TheMachine
lm.Add(m);
}
SetMsg(new Dictionary<string, List<Msg>>() { { "root",lm} });
//启用调试模式ToolStripMenuItem.Enabled = true;
//启用调试模式ToolStripMenuItem_Click(启用调试模式ToolStripMenuItem, EventArgs.Empty);
//RobotManage.LoadDebug();
Task.Run(()=> {
Task.Delay(100).Wait();
this.Invoke((EventHandler)delegate
{
});
});
启用调试模式ToolStripMenuItem.Text = crc.GetString("Res0101.fe92dc50","退出调试模式");
//启用调试模式ToolStripMenuItem_Click(启用调试模式ToolStripMenuItem, EventArgs.Empty);
}
......
......@@ -48,7 +48,7 @@ namespace TheMachine
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(3, 235);
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.Tag = "not";
//
......
......@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>TheMachine</RootNamespace>
<AssemblyName>MT</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>false</Deterministic>
......@@ -173,6 +173,12 @@
<Compile Include="UC\DoubleBufferListView.cs">
<SubType>Component</SubType>
</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">
<SubType>UserControl</SubType>
</Compile>
......@@ -271,6 +277,9 @@
<EmbeddedResource Include="TrayManagerControl.resx">
<DependentUpon>TrayManagerControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\FrmPassCheck.resx">
<DependentUpon>FrmPassCheck.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\RfidControl.resx">
<DependentUpon>RfidControl.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -110,13 +110,13 @@ namespace TheMachine
//listView1.Items.Clear();
foreach (var ti in traylist) {
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)
lasttime = timego.Minutes + crc.GetString("Res0025","分 ") + lasttime;
lasttime = timego.Minutes + crc.GetString("Res0103.4c40da19","分 ") + lasttime;
if (timego.Hours > 0)
lasttime = timego.Hours + crc.GetString("Res0026","时 ") + lasttime;
var traydesc = TrayManager.TrayTypeDesc[ti.TrayType];
var loaddesc = TrayManager.TrayTypeDesc[ti.LoadType];
lasttime = timego.Hours + crc.GetString("Res0104.481f431e","时 ") + lasttime;
var traydesc = crc.GetString("TrayType_" + ti.TrayType, TrayManager.TrayTypeDesc[ti.TrayType]);
var loaddesc = crc.GetString("TrayType_" + ti.LoadType, TrayManager.TrayTypeDesc[ti.LoadType]);
var lastaddrdesc = TrayManager.AddrDesc[ti.LastAddr];
var toaddrdesc = TrayManager.AddrDesc[ti.DestinationAddr];
var reelid = "";
......@@ -156,7 +156,7 @@ namespace TheMachine
foreach (var tivk in TrayManager.TrayRequest.ToArray())
{
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 items = new string[] { traydesc, desc };
......@@ -166,7 +166,7 @@ namespace TheMachine
listviewitem.SubItems.AddRange(items);
ListView2.Items.Add(listviewitem);
}
TrayManager.Statistics();
//listView1.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.ColumnContent);
label_Statistics.Text = crc.GetString("Res0027","托盘统计")+":" + "\n"
......
......@@ -69,7 +69,7 @@ namespace TheMachine
}
tableLayoutPanel1.SuspendLayout();
int maxrow = tableLayoutPanel1.Height / 34;
int maxrow = tableLayoutPanel1.Height / 36;
tableLayoutPanel1.Controls.Clear();
this.tableLayoutPanel1.RowStyles.Clear();
//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

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
<?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
......@@ -190,7 +190,7 @@ namespace TheMachine
var axis = getConfigMoveAxis((int)((Button)sender).Tag);
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);
}
URRobotControl getConfigMoveAxis(int Axisid)
......
using Robot.UR;
using DeviceLibrary;
using Robot.UR;
using System;
using System.Drawing;
using System.Windows.Forms;
......@@ -118,7 +119,7 @@ namespace URRobot
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)
{
......
......@@ -51,8 +51,49 @@ namespace TheMachine.device.Other
#endregion
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)
{
stateView.Columns[1].Text = "Tower ID";
......@@ -91,5 +132,16 @@ namespace TheMachine.device.Other
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
......@@ -41,7 +41,8 @@ namespace TheMachine
var axis = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[deviceGroupName].AxisID);
if (axis != null)
axisMoveControl1.LoadData(AxisBean.List[deviceGroupName]);
else
crc.LanguageProcess(axisMoveControl1);
if (TrayStop.DeviceList[deviceGroupName].RFID_1 != null)
rfidControl1.Init(deviceGroupName, TrayStop.DeviceList[deviceGroupName].RFID_1);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!