Commit 821c9a8e 刘韬

优化报警提示添加信号编号

1 个父辈 8c7b3fe3
......@@ -76,9 +76,14 @@ public class HIKCamera
return true;
}
int errortimes = 0;
bool camerathreadrun = true;
public void stopCamera() {
camerathreadrun = false;
}
void startCamera()
{
while (true)
camerathreadrun = true;
while (camerathreadrun)
{
try
{
......@@ -92,6 +97,7 @@ public class HIKCamera
{
errortimes++;
LogUtil.error(Name + $"相机获取图像出错,{errortimes}");
Thread.Sleep(5000);
}
else if (errortimes == 5)
{
......
......@@ -15,6 +15,7 @@ namespace DeviceLibrary
string axisbreak;
AxisBean axisBean;
int speed;
int StrokeLength = 270000;
public LiftMonitor(string _up, string _down,string _break, AxisBean _axisBean,int _speed) {
up = _up;
down = _down;
......@@ -37,17 +38,17 @@ namespace DeviceLibrary
public void LiftUp(MoveInfo moveInfo) {
if (moveInfo == null)
moveInfo = new MoveInfo("界面");
moveInfo = new MoveInfo("界面",false);
if (IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH)) {
moveInfo.log($"{axisBean.AxisName},已在位置,无需上升");
return;
}
IOManager.IOMove(axisbreak,IO_VALUE.HIGH);
axisBean.SpeedMove(speed);
axisBean.RelMove(StrokeLength, (double)speed);
DateTime d = DateTime.Now;
moveInfo.log($"{axisBean.AxisName},LiftUp");
if(moveInfo!=null)
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitUp), "等待顶升机构上升"));
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitUp), $"等待顶升[{axisBean.Config.Explain}]机构上升"));
Task.Run(()=> {
while (!IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH)) {
Task.Delay(30);
......@@ -67,25 +68,25 @@ namespace DeviceLibrary
}
if (!axisBean.IsBusy) {
axisBean.SpeedMove(speed);
axisBean.RelMove(StrokeLength, (double)speed);
}
return false;
}
public void LiftDown(MoveInfo moveInfo)
{
if (moveInfo == null)
moveInfo = new MoveInfo("界面");
moveInfo = new MoveInfo("界面", false);
if (IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH))
{
moveInfo.log($"{axisBean.AxisName},已在位置,无需下降");
return;
}
IOManager.IOMove(axisbreak, IO_VALUE.HIGH);
axisBean.SpeedMove(-speed);
axisBean.RelMove(-StrokeLength, (double)speed);
DateTime d = DateTime.Now;
moveInfo.log($"{axisBean.AxisName},LiftDown");
if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitDown), "等待顶升机构下降"));
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitDown), $"等待顶升[{axisBean.Config.Explain}]机构下降"));
Task.Run(() => {
while (!IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH))
......@@ -108,7 +109,7 @@ namespace DeviceLibrary
if (!axisBean.IsBusy)
{
axisBean.SpeedMove(-speed);
axisBean.RelMove(-StrokeLength, (double)speed);
}
return false;
}
......
......@@ -105,7 +105,51 @@ public class OKLEController
}
}
}
public static double SetZero(string port)
{
double weight = 0d;
AcSerialBean sb = GetSerialBean(port);
if (sb == null)
{
return weight;
}
if (!Monitor.TryEnter(sb))
return ValueBuffer[port];
try
{
LogName = "[OKLE_" + port + "]";
//12..1.2读取力值(毛重)指令,指令格式:01 03 00 50 00 02 C4 1A
//01 03 00 00 00 02 C4 0B
byte[] sendData = new byte[8];
sendData[0] = 0x01;
sendData[1] = 0x06;
sendData[2] = 0x00;
sendData[3] = 0x07;
sendData[4] = 0xA5;
sendData[5] = 0x0D;
//sendData[6] = 0xC4;
//sendData[7] = 0x0B;
sendData = buildCheckData(sendData, sendData.Length - 2);
string str = AcSerialBean.byteToHexStr(sendData, " ");
byte[] reviceData = new byte[15];
bool isOk = false;
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
LogUtil.debug(LogName + "发送数据:" + str + ",收到数据 :" + AcSerialBean.byteToHexStr(reviceData, " "));
ValueBuffer[port] = getReviceData(reviceData);
return ValueBuffer[port];
}
catch (Exception e)
{
LogUtil.debug(LogName + e.ToString());
return ValueBuffer[port];
}
finally
{
Monitor.Exit(sb);
}
}
public static double queryData(string port)
{
......@@ -138,7 +182,7 @@ public class OKLEController
byte[] reviceData = new byte[15];
bool isOk = false;
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
LogUtil.debug(LogName + "发送数据:" + str + ",收到数据 :" + AcSerialBean.byteToHexStr(reviceData, " "));
//LogUtil.debug(LogName + "发送数据:" + str + ",收到数据 :" + AcSerialBean.byteToHexStr(reviceData, " "));
ValueBuffer[port] = getReviceData(reviceData);
return ValueBuffer[port];
}
......
......@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DeviceLibrary
......@@ -17,6 +18,36 @@ namespace DeviceLibrary
string StoreName;
string WarnMsg = "";
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
public ServerCommunication() {
serverConnectTimer.Interval = 1000;
serverConnectTimer.AutoReset = true;
serverConnectTimer.Enabled = false;
serverConnectTimer.Elapsed += ServerConnectTimer_Elapsed; ;
}
private void ServerConnectTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (!Monitor.TryEnter(serverConnectTimer))
return;
try
{
SendLineStatus();
}
catch
{
}
finally {
Monitor.Exit(serverConnectTimer);
}
}
public void StartConnectServer() {
serverConnectTimer.Enabled = true;
}public void StopConnectServer() {
serverConnectTimer.Enabled = false;
}
public void ProcessMsg(List<Msg> msg) {
WarnMsg = string.Join(",", msg.Select(x => x.msgtxt));
}
......@@ -196,7 +227,7 @@ namespace DeviceLibrary
Operation resultOperation = HttpHelper.Post(GetPostApi(), lineOperation, false);
ResultProcess(resultOperation);
TimeSpan span = DateTime.Now - time;
if (span.TotalMilliseconds > 200)
if (span.TotalMilliseconds > 700)
{
LogUtil.info(StoreName + "TimerProcess[" + span.TotalMilliseconds + "]");
}
......
......@@ -249,6 +249,28 @@ namespace DeviceLibrary
AxisManager.AbsMove(Config.DeviceName, Config.GetAxisValue(), targetPos, (int)targetSpeed, (int)targetSpeed * 4, (int)targetSpeed * 4);// , Config.AddSpeed, Config.DelSpeed);
}
/// <summary>
/// 绝对运动至点,不等待结果
/// </summary>
public void RelMove(int targetPos, double targetSpeed)
{
if (targetPos.Equals(-1))
{
return;
}
LastPosition = -1;
//if (targetSpeed <= 0)//targetSpeed > Config.TargetSpeed ||
//{
// targetSpeed = Config.TargetSpeed;
//}
//小于1,表示是目标速度的百分比
if (targetSpeed <= 1)
{
targetSpeed = Config.TargetSpeed * targetSpeed;
}
AxisManager.RelMove(Config.DeviceName, Config.GetAxisValue(), targetPos, (int)targetSpeed, (int)targetSpeed * 4, (int)targetSpeed * 4);// , Config.AddSpeed, Config.DelSpeed);
}
public bool IsBusy {
get => AxisManager.GetBusyStatus(Config.DeviceName, Config.GetAxisValue()) == 1;
}
......
......@@ -24,6 +24,7 @@ namespace DeviceLibrary
public event Action<string, StoreMoveType, bool> InOutEndProcessEvent;
public bool IsComplateOrFree { get => MoveInfo.MoveStep == MoveStep.Wait; }
public bool IsTakedBox { get => MoveInfo.MoveStep >= MoveStep.StoreTS10; }
public bool IsPutOnOut {get=> To.posid== BoxStorePosition.outdoor && MoveInfo.MoveStep < MoveStep.StoreTS10 && MoveInfo.MoveStep >= MoveStep.StoreTS16; }
public BoxTransport(Robot_Config _Config, MainMachine _mainMachine)
{
Config = _Config;
......@@ -89,13 +90,13 @@ namespace DeviceLibrary
if (IOManager.IOValue(IO_Type.SideA_ForkMaterial_Check).Equals(IO_VALUE.HIGH) ||
IOManager.IOValue(IO_Type.SideB_ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{
Msg.add("伸缩叉2侧检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("伸缩2侧叉检测到有物料无法继续,请检查");
Msg.add("伸缩叉2侧X10/X11检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("伸缩叉2侧X10,X11检测到有物料无法继续,请检查");
}
else if (IOManager.IOValue(IO_Type.ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{
Msg.add("出库时伸缩叉检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("出库时伸缩叉检测到有物料无法继续,请检查");
Msg.add("出库时伸缩叉X09检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("出库时伸缩叉X09检测到有物料无法继续,请检查");
}
else
{
......@@ -118,15 +119,15 @@ namespace DeviceLibrary
}
break;
case MoveStep.StoreTS04:
MoveInfo.NextMoveStep(MoveStep.StoreTS05);
MoveInfo.NextMoveStep(MoveStep.StoreTS06);
YAxis.AbsMove(MoveInfo, From.Yaxis_PL, Config.Yaxis_P1_speed);
MoveInfo.log($"{storeMoveType}:上下轴到达取料低点");
break;
case MoveStep.StoreTS05:
MoveInfo.NextMoveStep(MoveStep.StoreTS06);
XAxis.AbsMove(MoveInfo, From.Xaxis_P2, Config.Xaxis_P2_speed);
MoveInfo.log($"{storeMoveType}:行走机构到达取料点");
break;
case MoveStep.StoreTS05:
MoveInfo.NextMoveStep(MoveStep.StoreTS06);
break;
case MoveStep.StoreTS06:
MoveInfo.NextMoveStep(MoveStep.StoreTS07);
ZAxis.AbsMove(MoveInfo, From.Zaxis_P2, Config.Zaxis_P2_speed);
......@@ -136,7 +137,7 @@ namespace DeviceLibrary
GetCamera(From.Zaxis_P2).CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.In));
MoveInfo.NextMoveStep(MoveStep.StoreTS08);
YAxis.AbsMove(MoveInfo, From.Yaxis_PH, Config.Yaxis_P4_speed);
MoveInfo.log($"{storeMoveType}:上下轴到达取料点");
MoveInfo.log($"{storeMoveType}:上下轴到达取料点");
break;
case MoveStep.StoreTS08:
MoveInfo.NextMoveStep(MoveStep.StoreTS09);
......@@ -148,13 +149,13 @@ namespace DeviceLibrary
if (IOManager.IOValue(IO_Type.SideA_ForkMaterial_Check).Equals(IO_VALUE.HIGH) ||
IOManager.IOValue(IO_Type.SideB_ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{
Msg.add("伸缩叉2侧检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("伸缩叉2侧检测到有物料无法继续,请检查");
Msg.add("伸缩叉2侧X10/X11检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("伸缩叉2侧X10/X11检测到有物料无法继续,请检查");
}
else if (IOManager.IOValue(IO_Type.ForkMaterial_Check).Equals(IO_VALUE.LOW))
{
Msg.add("出库时伸缩叉没有取到物料,请检查", MsgLevel.alarm);
RobotManage.UserPause("出库时伸缩叉没有取到物料,请检查");
Msg.add("出库时伸缩叉X09检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("出库时伸缩叉X09检测到有物料无法继续,请检查");
}
else
{
......@@ -169,15 +170,15 @@ namespace DeviceLibrary
}
break;
case MoveStep.StoreTS10:
MoveInfo.NextMoveStep(MoveStep.StoreTS11);
MoveInfo.NextMoveStep(MoveStep.StoreTS12);
XAxis.AbsMove(MoveInfo, To.Xaxis_P2, Config.Xaxis_P2_speed);
MoveInfo.log($"{storeMoveType}:行走机构到达目的地");
break;
case MoveStep.StoreTS11:
MoveInfo.NextMoveStep(MoveStep.StoreTS12);
YAxis.AbsMove(MoveInfo, To.Yaxis_PH, Config.Yaxis_P1_speed);
MoveInfo.log($"{storeMoveType}:上下轴到达目的地高点");
break;
case MoveStep.StoreTS11:
MoveInfo.NextMoveStep(MoveStep.StoreTS12);
break;
case MoveStep.StoreTS12:
MoveInfo.NextMoveStep(MoveStep.StoreTS13);
ZAxis.AbsMove(MoveInfo, To.Zaxis_P2, Config.Zaxis_P2_speed);
......@@ -199,13 +200,13 @@ namespace DeviceLibrary
if (IOManager.IOValue(IO_Type.SideA_ForkMaterial_Check).Equals(IO_VALUE.HIGH) ||
IOManager.IOValue(IO_Type.SideB_ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{
Msg.add("伸缩叉2侧检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("伸缩叉检测到有物料无法继续,请检查");
Msg.add("伸缩叉2侧X10/X11检测到有物料无法继续,请检查", MsgLevel.alarm);
RobotManage.UserPause("伸缩叉2侧X10/X11检测到有物料无法继续,请检查");
}
else if (IOManager.IOValue(IO_Type.ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{
Msg.add("入库后伸缩叉上任然检测到物料,请检查", MsgLevel.alarm);
RobotManage.UserPause("入库后伸缩叉上任然检测到物料,请检查");
Msg.add("入库后伸缩叉X09上任然检测到物料,请检查", MsgLevel.alarm);
RobotManage.UserPause("入库后伸缩叉X09上任然检测到物料,请检查");
}
else
{
......@@ -215,9 +216,9 @@ namespace DeviceLibrary
break;
case MoveStep.StoreTS16:
MoveInfo.NextMoveStep(MoveStep.StoreTS17);
//YAxis.AbsMove(MoveInfo, Config.Yaxis_P1, Config.Yaxis_P1_speed);
//XAxis.AbsMove(MoveInfo, Config.Xaxis_P1, Config.Xaxis_P1_speed);
//MoveInfo.log($"{storeMoveType}:上下轴,行走机构返回待机点P1");
YAxis.AbsMove(MoveInfo, Config.Yaxis_P1, Config.Yaxis_P1_speed);
XAxis.AbsMove(MoveInfo, Config.Xaxis_P1, Config.Xaxis_P1_speed);
MoveInfo.log($"{storeMoveType}:上下轴,行走机构返回待机点P1");
ErrMsgTxt = "";
break;
case MoveStep.StoreTS17:
......
......@@ -126,6 +126,8 @@ namespace DeviceLibrary
Yaxis_PL = aCStorePosition.UpDownAxis_ILPosition_P4;
posid = aCStorePosition.PositionNum;
}
public const string indoor = "入料口";
public const string outdoor = "出料口";
public BoxStorePosition(Robot_Config Config, StoreSide storeSide)
{
......@@ -135,14 +137,14 @@ namespace DeviceLibrary
Zaxis_P2 = Config.Zaxis_P2;
Yaxis_PH = Config.Yaxis_P4;
Yaxis_PL = Config.Yaxis_P2;
posid = "入料口";
posid = indoor;
}
else {
Xaxis_P2 = Config.Xaxis_P3;
Zaxis_P2 = Config.Zaxis_P3;
Yaxis_PH = Config.Yaxis_P5;
Yaxis_PL = Config.Yaxis_P3;
posid = "出料口";
posid = outdoor;
}
}
......
......@@ -168,7 +168,7 @@ namespace DeviceLibrary
case MoveStep.In07:
if (IOValue(IO_Type.InOverHead_Check).Equals(IO_VALUE.HIGH)) {
LineIn.LineStop("work");
InMoveInfo.log($"检测到物料超高,停止滚筒");
InMoveInfo.log($"X18检测到物料超高,停止滚筒");
InMoveInfo.NextMoveStep(MoveStep.InOverHead);
ServerCM.cancelPutInTask("", InMoveInfo.MoveParam.WareCode);
return;
......@@ -183,7 +183,7 @@ namespace DeviceLibrary
}
else if (InMoveInfo.IsTimeOut(10))
{
Msg.add("周转箱进入超时", MsgLevel.warning);
Msg.add("周转箱进入等待X26信号超时", MsgLevel.warning);
InMoveInfo.log($"周转箱进入超时");
}
break;
......@@ -212,7 +212,7 @@ namespace DeviceLibrary
InMoveInfo.log("周转箱已取走,顶升下降");
break;
case MoveStep.InOverHead:
Msg.add("物料超高,请取出周转箱", MsgLevel.warning);
Msg.add("X18检测到物料超高,请取出周转箱", MsgLevel.warning);
if (IOMonitor.IODebound(IO_Type.InStopMaterial_Check, Config, IO_VALUE.LOW)) {
CylinderMove(InMoveInfo, IO_Type.InStop_Down, IO_Type.InStop_Up, IO_VALUE.HIGH);
InMoveInfo.NextMoveStep(MoveStep.Wait);
......
......@@ -33,7 +33,7 @@ namespace DeviceLibrary
{
OutMoveInfo.NextMoveStep(MoveStep.WaitErr);
}
else if (IOValue(IO_Type.OutEntryMaterialTop_Check).Equals(IO_VALUE.HIGH))
else if (IOValue(IO_Type.OutEntryMaterialTop_Check).Equals(IO_VALUE.HIGH) && RobotManage.mainMachine.boxTransport.IsPutOnOut)
{
Msg.add("检测到出料口有周转箱", MsgLevel.warning);
OutMoveInfo.log($"检测到出料口有周转箱,送出");
......@@ -49,7 +49,7 @@ namespace DeviceLibrary
case MoveStep.OutBoxPutOn:
if (IOValue(IO_Type.OutEntryMaterialTop_Check).Equals(IO_VALUE.LOW))
{
Msg.add("出口没有检测到周转箱", MsgLevel.warning);
Msg.add("出口X39没有检测到周转箱", MsgLevel.warning);
}
else
{
......@@ -74,7 +74,7 @@ namespace DeviceLibrary
break;
case MoveStep.Out02:
OutMoveInfo.NextMoveStep(MoveStep.Out03);
LineOut.LineRun("work", 3);
LineOut.LineRun("work", 6);
OutMoveInfo.log($"料箱抵达出口");
OutMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
......
......@@ -227,24 +227,35 @@ namespace DeviceLibrary
if (m.Find((aa) => aa.msgLevel == MsgLevel.alarm) == null)
{
AlarmBuzzer.OFF();
if (ServerCM.storeStatus != StoreStatus.InStoreExecute && ServerCM.storeStatus != StoreStatus.OutStoreExecute)
ServerCM.storeStatus = StoreStatus.StoreOnline;
}
else {
AlarmBuzzer.ON();
ServerCM.storeStatus = StoreStatus.Warning;
}
//ProcessMoveinfoEvent?.Invoke(MoveInfo.List);
if (!UserPause)
Msg.clear();
else
ServerCM.storeStatus = StoreStatus.Debugging;
}
}
LogUtil.info("主线程已退出.");
}
public void Start() {
ServerCM.StartConnectServer();
Run();
}
public void Stop() {
mstart = false;
ServerCM.StopConnectServer();
Thread.Sleep(300);
Alarm(AlarmType.None);
StopMove(true);
IOMove(IO_Type.InMoto_Run, IO_VALUE.LOW);
IOMove(IO_Type.OutMoto_Run, IO_VALUE.LOW);
}
public void BeginHomeReset(bool firstRun=false) {
if (!firstRun)
......@@ -271,14 +282,14 @@ namespace DeviceLibrary
case MoveStep.H01_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
ResetMoveInfo.log("开始回原,进出轴回原");
ServerCM.storeStatus = StoreStatus.ResetMove;
ZAxis.HomeMove(ResetMoveInfo, forceHome);
break;
case MoveStep.H02_HomeReset:
if (IOValue(IO_Type.SideA_ForkMaterial_Check).Equals(IO_VALUE.HIGH) ||
IOValue(IO_Type.SideB_ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{
Msg.add("料叉上有没有放正的物料", MsgLevel.warning);
Msg.add("伸缩叉2侧X10/X11检测到有物料无法继续", MsgLevel.warning);
RobotManage.UserPause("回源时料叉上有物料");
return;
}
......@@ -310,18 +321,16 @@ namespace DeviceLibrary
CylinderMove(InMoveInfo, IO_Type.OutExitStop_Down, IO_Type.OutExitStop_Up, IO_VALUE.HIGH);
break;
case MoveStep.H06_HomeReset:
if (IOValue(IO_Type.ForkMaterial_Check).Equals(IO_VALUE.HIGH) ||
IOValue(IO_Type.SideA_ForkMaterial_Check).Equals(IO_VALUE.HIGH) ||
IOValue(IO_Type.SideB_ForkMaterial_Check).Equals(IO_VALUE.HIGH))
if (IOValue(IO_Type.ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{
ResetMoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
ResetMoveInfo.log("进出轴上有周转箱");
ResetMoveInfo.log("进出轴X09上有周转箱");
}
else if (IOValue(IO_Type.SideA_ForkMaterial_Check).Equals(IO_VALUE.HIGH) ||
IOValue(IO_Type.SideB_ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{
Msg.add("料叉上有没有放正的物料", MsgLevel.warning);
Msg.add("伸缩叉2侧X10/X11检测到有物料无法继续", MsgLevel.warning);
RobotManage.UserPause("回源时料叉上有物料");
return;
}
......@@ -346,10 +355,12 @@ namespace DeviceLibrary
}
break;
case MoveStep.HEND_HomeReset:
OKLEController.SetZero(Config.WeightSensorPort);
forceHome = false;
ResetMoveInfo.log("回原完成");
ResetMoveInfo.EndMove();
runStatus = RunStatus.Running;
ServerCM.storeStatus = StoreStatus.StoreOnline;
break;
}
}
......
......@@ -12,14 +12,14 @@ namespace DeviceLibrary
{
public static List<MoveInfo> List = new List<MoveInfo>();
public int TimeOutSeconds = 60;
public MoveInfo(string name)
public MoveInfo(string name, bool addtolist=true)
{
MoveParam = new BoxParam();
this.moveStep = MoveStep.Wait;
IsInWait = false;
this.Name = name;
List.Add(this);
if(addtolist)
List.Add(this);
}
public string Name { get; set; }
......
......@@ -101,8 +101,9 @@ namespace DeviceLibrary
if (!IsConfigMode)
return;
}
mainThread = new Thread(new ThreadStart(mainMachine.Run));
mainThread = new Thread(new ThreadStart(mainMachine.Start));
mainThread.Start();
isRunning = true;
GC.KeepAlive(mainThread);
Task.Run(()=> {
......@@ -129,6 +130,8 @@ namespace DeviceLibrary
{
LogUtil.info("开始关闭系统.");
IOManager.CloseAllConnection();
CameraA.stopCamera();
CameraB.stopCamera();
}
public static void UserPause(bool userpause)
{
......
......@@ -22,7 +22,7 @@ namespace TheMachine
{
InitializeComponent();
this.FormClosing += Form1_FormClosing;
this.Text = Config.Get(Setting_Init.App_Title);
this.Text = Config.Get(Setting_Init.App_Title) +" "+ Config.Get("CID");
t1.Interval = 1000;
t1.Tick += T1_Tick;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!