|
|
|
@ -111,14 +111,12 @@ namespace NDSD_Screwdriver
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
serialPort = new SerialPortFactory(memorySetting.Com);
|
|
|
|
|
for (int w = 0; w < 2; w++)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
for (int i = 0; i < 16; i++)
|
|
|
|
|
{
|
|
|
|
|
DOperateInfo.DClose(i);
|
|
|
|
|
Thread.Sleep(300);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
@ -533,7 +531,7 @@ namespace NDSD_Screwdriver
|
|
|
|
|
{
|
|
|
|
|
var read = serialPort?.Read();
|
|
|
|
|
|
|
|
|
|
// var read = "";
|
|
|
|
|
XTrace.WriteLine("读取条码:"+read);
|
|
|
|
|
|
|
|
|
|
if (read.Length == 16)
|
|
|
|
|
{
|
|
|
|
@ -547,34 +545,30 @@ namespace NDSD_Screwdriver
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var monitorEntitiesCount = monitorEntities.Count;
|
|
|
|
|
var last = monitorEntities[FlashIndex].RFIDState;
|
|
|
|
|
|
|
|
|
|
if (FlashIndex < monitorEntitiesCount)
|
|
|
|
|
{
|
|
|
|
|
if (last != 100 && last==1)
|
|
|
|
|
var rfidState = monitorEntities[FlashIndex].RFIDState;
|
|
|
|
|
var last = rfidState;
|
|
|
|
|
string no = monitorEntities[FlashIndex].RFIDValue;
|
|
|
|
|
if (last != 100 && no==read)
|
|
|
|
|
{
|
|
|
|
|
quClient2.Enable();
|
|
|
|
|
dateTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
if (FlashIndex < monitorEntitiesCount)
|
|
|
|
|
{
|
|
|
|
|
XTrace.WriteLine("a");
|
|
|
|
|
//状态修改
|
|
|
|
|
monitorEntities[FlashIndex].RFIDState = 1;
|
|
|
|
|
DOperateInfo.DOpen(monitorEntities[FlashIndex].Yellow);
|
|
|
|
|
|
|
|
|
|
timer.Start();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
XTrace.WriteLine("aa");
|
|
|
|
|
|
|
|
|
|
var total = DateTime.Now - dateTime;
|
|
|
|
|
if (total.TotalSeconds > 2)
|
|
|
|
|
{
|
|
|
|
@ -633,11 +627,10 @@ namespace NDSD_Screwdriver
|
|
|
|
|
if (RFIDState == 2)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
DOperateInfo.DClose(monitorEntities[id].Red);
|
|
|
|
|
Thread.Sleep(300);
|
|
|
|
|
DOperateInfo.DClose(monitorEntities[id].Green);
|
|
|
|
|
Thread.Sleep(300);
|
|
|
|
|
|
|
|
|
|
// DOperateInfo.DClose(monitorEntities[id].Green);
|
|
|
|
|
// Thread.Sleep(300);
|
|
|
|
|
XTrace.WriteLine("亮黄灯延迟");
|
|
|
|
|
DOperateInfo.DTimeOpen(monitorEntities[id].Yellow, 1);
|
|
|
|
|
monitorEntities[id].RowEntitys[2].Color = Brushes.Yellow;
|
|
|
|
|
}
|
|
|
|
@ -668,6 +661,13 @@ namespace NDSD_Screwdriver
|
|
|
|
|
{
|
|
|
|
|
dictionary[monitorEntities[id].RFIDValue] = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XTrace.WriteLine("读取Rfid 亮黄灯");
|
|
|
|
|
//状态修改
|
|
|
|
|
|
|
|
|
|
DOperateInfo.DOpen(monitorEntities[FlashIndex].Yellow);
|
|
|
|
|
timer.Start();
|
|
|
|
|
|
|
|
|
|
monitorEntities[id].RowEntitys[2].Color = Brushes.Yellow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -675,23 +675,19 @@ namespace NDSD_Screwdriver
|
|
|
|
|
RFIDState = monitorEntities[id].RFIDState;
|
|
|
|
|
if (RFIDState == 3)
|
|
|
|
|
{
|
|
|
|
|
timer.Stop();
|
|
|
|
|
|
|
|
|
|
DOperateInfo.DClose(monitorEntities[id].Red);
|
|
|
|
|
quClient2.Close();
|
|
|
|
|
Thread.Sleep(300);
|
|
|
|
|
DOperateInfo.DClose(monitorEntities[id].Yellow);
|
|
|
|
|
Thread.Sleep(300);
|
|
|
|
|
DOperateInfo.DOpen(monitorEntities[id].Green);
|
|
|
|
|
|
|
|
|
|
FormUtils.LogInsert(LogContext, "RFID {0} 发送绿灯", monitorEntities[id].RFIDValue);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XTrace.WriteLine("========================================================================");
|
|
|
|
|
DOperateInfo.DOpen(monitorEntities[id].Green);
|
|
|
|
|
Thread.Sleep(300);
|
|
|
|
|
DOperateInfo.DOpen(monitorEntities[id].Green);
|
|
|
|
|
quClient2.Close();
|
|
|
|
|
monitorEntities[id].RowEntitys[2].Color = Brushes.Green;
|
|
|
|
|
monitorEntities[id].RFIDState=100;
|
|
|
|
|
timer.Stop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FlashIndex += 1;
|
|
|
|
|
timer.Start();
|
|
|
|
|