잔건 관련 업데이트
1. 중복 보고 - 보고가 완료된 사항을 체크하는 플래그를 통해 방지 2. 최초 셀 데이터 누락 - Cell Tracker에서 마지막 데이터를 누적하고 있음 정지 시점에서 이미 CellTracker는 데이터를 가지고 있어야 함
This commit is contained in:
parent
25d96fcae4
commit
5523b1f79c
@ -26,7 +26,7 @@ namespace AuroraCellTracker
|
|||||||
public class CellTracker : Device
|
public class CellTracker : Device
|
||||||
{
|
{
|
||||||
Logger _Logger = new Logger("CellTracker");
|
Logger _Logger = new Logger("CellTracker");
|
||||||
ICellTracker _CellTracker;
|
public ICellTracker _CellTracker;
|
||||||
public CellTrackerConfig _CellTrackerConfig { get; set; }
|
public CellTrackerConfig _CellTrackerConfig { get; set; }
|
||||||
|
|
||||||
private ICellTracker[] _MultiCellTrackerObj = new ICellTracker[4];
|
private ICellTracker[] _MultiCellTrackerObj = new ICellTracker[4];
|
||||||
|
|||||||
@ -149,6 +149,8 @@ namespace AuroraCellTracker.DaekhonCoporation
|
|||||||
{
|
{
|
||||||
string lotId = "", cellId = "";
|
string lotId = "", cellId = "";
|
||||||
|
|
||||||
|
bool gotNew = false;
|
||||||
|
|
||||||
if (selectedMode == eMode.Queue) {
|
if (selectedMode == eMode.Queue) {
|
||||||
if (null != dllSocketCtrl) {
|
if (null != dllSocketCtrl) {
|
||||||
string str = dllSocketCtrl.DllSocket_GetReceiveMessageInQueue(true, true);
|
string str = dllSocketCtrl.DllSocket_GetReceiveMessageInQueue(true, true);
|
||||||
@ -158,6 +160,7 @@ namespace AuroraCellTracker.DaekhonCoporation
|
|||||||
|
|
||||||
CalcCellInfo(str, out lotId, out cellId);
|
CalcCellInfo(str, out lotId, out cellId);
|
||||||
SetCellInfo(lotId, cellId);
|
SetCellInfo(lotId, cellId);
|
||||||
|
gotNew = true;
|
||||||
} else
|
} else
|
||||||
CellInfoStrings.ReceiveStrInQueue = "Receive Length is 0";
|
CellInfoStrings.ReceiveStrInQueue = "Receive Length is 0";
|
||||||
} else
|
} else
|
||||||
@ -167,26 +170,32 @@ namespace AuroraCellTracker.DaekhonCoporation
|
|||||||
} else if (selectedMode == eMode.Callback) {
|
} else if (selectedMode == eMode.Callback) {
|
||||||
// Callback 방식의 경우, 자체 ConcurrentQueue에서 Deque해서 가져와야 함
|
// Callback 방식의 경우, 자체 ConcurrentQueue에서 Deque해서 가져와야 함
|
||||||
CellInfoStr info;
|
CellInfoStr info;
|
||||||
|
|
||||||
if (CellInfoQueue.TryDequeue(out info)) {
|
if (CellInfoQueue.TryDequeue(out info)) {
|
||||||
SetCellInfo(info.LotID, info.CellID);
|
SetCellInfo(info.LotID, info.CellID);
|
||||||
|
gotNew = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Queue 방식인데 Cell Tracker에서 메세지가 안 왔거나, Callback 방식인데 Cell Tracker API 함수가 Callback 안 된 경우(ex : ECS 오프라인 모드),
|
// Queue 방식인데 Cell Tracker에서 메세지가 안 왔거나,
|
||||||
|
// Callback 방식인데 실제 수신이 없거나(또는 같은 값이 연속으로 들어오는 경우),
|
||||||
// Lot ID/Cell ID를 ES 지정사양에 맞추어 생성
|
// Lot ID/Cell ID를 ES 지정사양에 맞추어 생성
|
||||||
if (OldLotId == CellInfoStrings.LotID && OldCellId == CellInfoStrings.CellID) {
|
if (!gotNew || (OldLotId == CellInfoStrings.LotID && OldCellId == CellInfoStrings.CellID)) {
|
||||||
CalcCellInfo("", out lotId, out cellId);
|
CalcCellInfo("", out lotId, out cellId);
|
||||||
AddCellInfo(lotId, cellId);
|
AddCellInfo(lotId, cellId);
|
||||||
|
|
||||||
CellInfoStr info;
|
CellInfoStr info;
|
||||||
if (CellInfoQueue.TryDequeue(out info))
|
if (CellInfoQueue.TryDequeue(out info)) {
|
||||||
{
|
|
||||||
SetCellInfo(info.LotID, info.CellID);
|
SetCellInfo(info.LotID, info.CellID);
|
||||||
|
} else {
|
||||||
|
// 새로운 값이 안들어와도 일단 보여줌
|
||||||
|
SetCellInfo(lotId, cellId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OldLotId = CellInfoStrings.LotID;
|
OldLotId = CellInfoStrings.LotID;
|
||||||
OldCellId = CellInfoStrings.CellID;
|
OldCellId = CellInfoStrings.CellID;
|
||||||
|
|
||||||
|
_Logger.I($"Received CellInfo >> count({CellInfoQueue.Count})");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendData(string str, bool isSendToUpperSystem = false)
|
public void SendData(string str, bool isSendToUpperSystem = false)
|
||||||
|
|||||||
@ -66,6 +66,7 @@ namespace ILSOS_CCW_H52A.Device
|
|||||||
public bool CheckSendCellinfo { get; set; }
|
public bool CheckSendCellinfo { get; set; }
|
||||||
public bool CheckSendPLCLaserPower { get; set; }
|
public bool CheckSendPLCLaserPower { get; set; }
|
||||||
public bool ReportComplete { get; set; }
|
public bool ReportComplete { get; set; }
|
||||||
|
public void SetReportComplete(bool comp) => ReportComplete = comp;
|
||||||
|
|
||||||
public override string ToString() => string.Format("{0},WriteTime({1}),WeldingCount({2}),StartAngle({3}),JigNo({4}),CanExist({5}),LotId({6}),CellId({7})",
|
public override string ToString() => string.Format("{0},WriteTime({1}),WeldingCount({2}),StartAngle({3}),JigNo({4}),CanExist({5}),LotId({6}),CellId({7})",
|
||||||
ListNo, WriteTime.ToString("HHmmss.fff"), WeldingCount, StartAngle, JigNo, CanExist, LotId, CellId);
|
ListNo, WriteTime.ToString("HHmmss.fff"), WeldingCount, StartAngle, JigNo, CanExist, LotId, CellId);
|
||||||
|
|||||||
@ -106,7 +106,8 @@
|
|||||||
<Compile Include="Recipes\RecipeEventHelper.cs" />
|
<Compile Include="Recipes\RecipeEventHelper.cs" />
|
||||||
<Compile Include="RMS\EDC.cs" />
|
<Compile Include="RMS\EDC.cs" />
|
||||||
<Compile Include="Sequences\Monitoring\AlarmMonitoring.cs" />
|
<Compile Include="Sequences\Monitoring\AlarmMonitoring.cs" />
|
||||||
<Compile Include="Sequences\ProcessManager.cs" />
|
<Compile Include="Sequences\ProcessObjects\ProcessManager.cs" />
|
||||||
|
<Compile Include="Sequences\ProcessObjects\ReceivedCellInfo.cs" />
|
||||||
<Compile Include="Sequences\SeqAutoRunCCWH52A.cs" />
|
<Compile Include="Sequences\SeqAutoRunCCWH52A.cs" />
|
||||||
<Compile Include="Sequences\SeqAutoRunRMOTF.cs" />
|
<Compile Include="Sequences\SeqAutoRunRMOTF.cs" />
|
||||||
<Compile Include="Sequences\SequenceContextEx.cs" />
|
<Compile Include="Sequences\SequenceContextEx.cs" />
|
||||||
|
|||||||
@ -5,6 +5,7 @@ using AuroraLaserScanner;
|
|||||||
using AuroraPLC;
|
using AuroraPLC;
|
||||||
using ILSOS_CCW_H52A.Device;
|
using ILSOS_CCW_H52A.Device;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
@ -12,9 +13,10 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using WeldingCommon;
|
using WeldingCommon;
|
||||||
|
using WeldingCommon.Data;
|
||||||
using static ILSOS_CCW_H52A.Device.PLCControllerCCWH52A;
|
using static ILSOS_CCW_H52A.Device.PLCControllerCCWH52A;
|
||||||
|
|
||||||
namespace ILSOS_CCW_H52A.Sequences
|
namespace ILSOS_CCW_H52A.Sequences.ProcessObjects
|
||||||
{
|
{
|
||||||
public class ProcessManager
|
public class ProcessManager
|
||||||
{
|
{
|
||||||
@ -40,6 +42,7 @@ namespace ILSOS_CCW_H52A.Sequences
|
|||||||
public double DegreePerJig { get => RotaryMaxAngle / RotaryJigCount; }
|
public double DegreePerJig { get => RotaryMaxAngle / RotaryJigCount; }
|
||||||
public double HalfDegreePerJig { get => DegreePerJig / 2; }
|
public double HalfDegreePerJig { get => DegreePerJig / 2; }
|
||||||
|
|
||||||
|
//public ConcurrentQueue<ReceivedCellInfo>
|
||||||
public void Init(IAuroraEnvironment env)
|
public void Init(IAuroraEnvironment env)
|
||||||
{
|
{
|
||||||
_env = env;
|
_env = env;
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ILSOS_CCW_H52A.Sequences.ProcessObjects
|
||||||
|
{
|
||||||
|
public class ReceivedCellInfo
|
||||||
|
{
|
||||||
|
|
||||||
|
public ReceivedCellInfo() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,8 +1,10 @@
|
|||||||
using Aurora;
|
using Aurora;
|
||||||
using Aurora.Api;
|
using Aurora.Api;
|
||||||
using Aurora.Api.Manager;
|
using Aurora.Api.Manager;
|
||||||
|
using Aurora.Util.HislogPlus;
|
||||||
using Aurora.View;
|
using Aurora.View;
|
||||||
using AuroraCellTracker;
|
using AuroraCellTracker;
|
||||||
|
using AuroraCellTracker.DaekhonCoporation;
|
||||||
using AuroraIO;
|
using AuroraIO;
|
||||||
using AuroraLaser;
|
using AuroraLaser;
|
||||||
using AuroraLaserScanner;
|
using AuroraLaserScanner;
|
||||||
@ -458,8 +460,8 @@ namespace ILSOS_CCW_H52A.Sequences
|
|||||||
WaitingScannerList.Reset();
|
WaitingScannerList.Reset();
|
||||||
CompleteScannerList.Reset();
|
CompleteScannerList.Reset();
|
||||||
|
|
||||||
isTheFirstListWrite = false; // 작업 시작 시 처음 2개의 List는 입력하고 시작한다
|
isTheFirstListWrite = true; // 작업 시작 시 처음 2개의 List는 입력하고 시작한다
|
||||||
isTheSecondListWrite = false;
|
isTheSecondListWrite = true;
|
||||||
isTheFirstListExecute = true; // 제일 첫 List는 ExecuteList 필요. 이후는 AutoChange
|
isTheFirstListExecute = true; // 제일 첫 List는 ExecuteList 필요. 이후는 AutoChange
|
||||||
|
|
||||||
_PLC.WriteBit(eBitOutput.PC_AUTO_STATUS, true);
|
_PLC.WriteBit(eBitOutput.PC_AUTO_STATUS, true);
|
||||||
@ -1031,6 +1033,10 @@ namespace ILSOS_CCW_H52A.Sequences
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 중복 보고 방지 플래그 세팅
|
||||||
|
CompleteScannerList.SetReportComplete(true);
|
||||||
|
isWeled = false;
|
||||||
|
|
||||||
return SequenceAction.Ok();
|
return SequenceAction.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,12 +1060,23 @@ namespace ILSOS_CCW_H52A.Sequences
|
|||||||
}
|
}
|
||||||
// END ALL
|
// END ALL
|
||||||
#endregion
|
#endregion
|
||||||
private static string CheckCanWelded(SequenceContext context, string id, ICollection<string> branches, SequenceActionResult param)
|
private string CheckCanWelded(SequenceContext context, string id, ICollection<string> branches, SequenceActionResult param)
|
||||||
{
|
{
|
||||||
if (isWeled)
|
// 중복 보고 방지:
|
||||||
|
// - CanExist=false (skip 대상) 는 보고하지 않음(미사용)
|
||||||
|
// - WeldComplete=false (레이저 ON 감지/완료 처리 전) 는 보고하지 않음(미사용)
|
||||||
|
// - ReportComplete=true (이미 보고 완료) 는 다시 보고하지 않음
|
||||||
|
// .시퀀스가 너무 빨리 내려가서 보고하는 케이스로 예상
|
||||||
|
|
||||||
|
// 보고 누락:
|
||||||
|
// - 첫번째, 두번째는 UploadWeldingList를 해야하기 때문에 일단 넘긴다.
|
||||||
|
if (isWeled
|
||||||
|
//CompleteScannerList.CanExist &&
|
||||||
|
//CompleteScannerList.WeldComplete &&
|
||||||
|
&& !CompleteScannerList.ReportComplete)
|
||||||
return SEQ_SET_PARAMS_REPORT_CELL_RESULT_SEQ;
|
return SEQ_SET_PARAMS_REPORT_CELL_RESULT_SEQ;
|
||||||
else
|
|
||||||
return SEQ_CHECK_CYCLE_STOP;
|
return SEQ_CHECK_CYCLE_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveCellAPD()
|
private void SaveCellAPD()
|
||||||
@ -1194,6 +1211,13 @@ namespace ILSOS_CCW_H52A.Sequences
|
|||||||
{
|
{
|
||||||
Status.EquipmentMode = eEquipmentMode.MANUAL;
|
Status.EquipmentMode = eEquipmentMode.MANUAL;
|
||||||
|
|
||||||
|
if((_CellTracker._CellTracker as CellTrackerDaekhon) != null && _CellTracker._CellTracker is CellTrackerDaekhon tracker){
|
||||||
|
Log.I($"Stoped Seq >> CellTracker Recv Queue count ({tracker.CellInfoQueue.Count})");
|
||||||
|
foreach (var info in tracker.CellInfoQueue.Select((value, index) => (value, index))) {
|
||||||
|
Log.I($"[{info.index}]Queue >> CellId[{info.value.CellID}] / LotId[{info.value.LotID}]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//PLC All BIT OFF
|
//PLC All BIT OFF
|
||||||
for (int i = 0; i < _RotaryJigCount; i++)
|
for (int i = 0; i < _RotaryJigCount; i++)
|
||||||
_PLC.WriteBit(eBitOutput.PC_WELD_COMPLETE_1 + i, false);
|
_PLC.WriteBit(eBitOutput.PC_WELD_COMPLETE_1 + i, false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user