Compare commits
No commits in common. "main" and "reFac" have entirely different histories.
@ -26,7 +26,7 @@ namespace AuroraCellTracker
|
|||||||
public class CellTracker : Device
|
public class CellTracker : Device
|
||||||
{
|
{
|
||||||
Logger _Logger = new Logger("CellTracker");
|
Logger _Logger = new Logger("CellTracker");
|
||||||
public ICellTracker _CellTracker;
|
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,8 +149,6 @@ 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);
|
||||||
@ -160,7 +158,6 @@ 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
|
||||||
@ -169,33 +166,27 @@ namespace AuroraCellTracker.DaekhonCoporation
|
|||||||
_Logger.D(string.Format($"{CellInfoStrings.ReceiveStrInQueue}"));
|
_Logger.D(string.Format($"{CellInfoStrings.ReceiveStrInQueue}"));
|
||||||
} 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에서 메세지가 안 왔거나,
|
// Queue 방식인데 Cell Tracker에서 메세지가 안 왔거나, Callback 방식인데 Cell Tracker API 함수가 Callback 안 된 경우(ex : ECS 오프라인 모드),
|
||||||
// Callback 방식인데 실제 수신이 없거나(또는 같은 값이 연속으로 들어오는 경우),
|
|
||||||
// Lot ID/Cell ID를 ES 지정사양에 맞추어 생성
|
// Lot ID/Cell ID를 ES 지정사양에 맞추어 생성
|
||||||
if (!gotNew || (OldLotId == CellInfoStrings.LotID && OldCellId == CellInfoStrings.CellID)) {
|
if (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)
|
||||||
|
|||||||
@ -33,38 +33,6 @@ namespace ILSOS_CCW_H52A.Device
|
|||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
public int WriteWordToBit((eWordOutput addrOffset, int bitNo) address, bool on)
|
|
||||||
{
|
|
||||||
var value = base.ReadWord((int)address.addrOffset, ePLCDevice.W, false);
|
|
||||||
short current = value.data;
|
|
||||||
|
|
||||||
if (on) {
|
|
||||||
current |= (short)(1 << address.bitNo);
|
|
||||||
} else {
|
|
||||||
current &= (short)~(1 << address.bitNo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return base.WriteWord((int)address.addrOffset, current, ePLCDevice.W);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ReadWordToBit((eWordInput addrOffset, int bitNo) address)
|
|
||||||
{
|
|
||||||
short current = ReadWord(address.addrOffset).data;
|
|
||||||
return (current & (1 << address.bitNo)) != 0;
|
|
||||||
}
|
|
||||||
public IEnumerable<bool> ReadWordToBits(eWordInput address, bool isLowerFirst = true)
|
|
||||||
{
|
|
||||||
var ret = new List<bool>();
|
|
||||||
int word = ReadWord(address).data;
|
|
||||||
if (isLowerFirst) {
|
|
||||||
for (int idx = 0; idx < 15; idx++)
|
|
||||||
ret.Add((word & (1 << idx)) != 0);
|
|
||||||
} else {
|
|
||||||
for (int idx = 15; idx > 0; idx--)
|
|
||||||
ret.Add((word & (1 << idx)) != 0);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void MappingPLCAddr()
|
public override void MappingPLCAddr()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,7 +66,6 @@ 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);
|
||||||
|
|||||||
@ -141,7 +141,6 @@ namespace ILSOS_CCW_H52A
|
|||||||
|
|
||||||
public override void RegisterDevices(IDeviceRegistry registry)
|
public override void RegisterDevices(IDeviceRegistry registry)
|
||||||
{
|
{
|
||||||
registry.Register(CommonDeviceIds.Scanner, () => new ScannerCCWH52A(CommonDeviceIds.Scanner), new ScannerConfig());
|
|
||||||
base.RegisterDevices(registry);
|
base.RegisterDevices(registry);
|
||||||
|
|
||||||
var isSimul = ApplicationExt.IsSimulation;
|
var isSimul = ApplicationExt.IsSimulation;
|
||||||
@ -155,6 +154,8 @@ namespace ILSOS_CCW_H52A
|
|||||||
() => _plc, PLCMelsecNetConfig.GetDefaultConfig(),
|
() => _plc, PLCMelsecNetConfig.GetDefaultConfig(),
|
||||||
device => new UCPLCDevice() { DataContext = new UCPLCDeviceViewModel(AuroraEnv, _plc) });
|
device => new UCPLCDevice() { DataContext = new UCPLCDeviceViewModel(AuroraEnv, _plc) });
|
||||||
|
|
||||||
|
registry.Register(CommonDeviceIds.Scanner, () => new ScannerCCWH52A(CommonDeviceIds.Scanner), new ScannerConfig());
|
||||||
|
|
||||||
var ioController = new IOController_CCW_H52A(AuroraEnv, CommonDeviceIds.IODevice);
|
var ioController = new IOController_CCW_H52A(AuroraEnv, CommonDeviceIds.IODevice);
|
||||||
registry.Register(CommonDeviceIds.IODevice, () => ioController, new IOUnitConfig());
|
registry.Register(CommonDeviceIds.IODevice, () => ioController, new IOUnitConfig());
|
||||||
|
|
||||||
|
|||||||
@ -106,10 +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\ProcessObjects\ProcessManager.cs" />
|
<Compile Include="Sequences\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\SequenceContextEx.cs" />
|
<Compile Include="Sequences\SequenceContextEx.cs" />
|
||||||
<Compile Include="Views\Main\UCMainAutoRun.xaml.cs">
|
<Compile Include="Views\Main\UCMainAutoRun.xaml.cs">
|
||||||
<DependentUpon>UCMainAutoRun.xaml</DependentUpon>
|
<DependentUpon>UCMainAutoRun.xaml</DependentUpon>
|
||||||
|
|||||||
@ -5,34 +5,16 @@ 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.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
|
||||||
using WeldingCommon;
|
|
||||||
using WeldingCommon.Data;
|
|
||||||
using static ILSOS_CCW_H52A.Device.PLCControllerCCWH52A;
|
using static ILSOS_CCW_H52A.Device.PLCControllerCCWH52A;
|
||||||
|
|
||||||
namespace ILSOS_CCW_H52A.Sequences.ProcessObjects
|
namespace ILSOS_CCW_H52A.Sequences
|
||||||
{
|
{
|
||||||
public class ProcessManager
|
public class ProcessManager
|
||||||
{
|
{
|
||||||
private static ProcessManager _Instance;
|
|
||||||
public static ProcessManager Instance {
|
|
||||||
get {
|
|
||||||
if (_Instance is null) {
|
|
||||||
_Instance = new ProcessManager();
|
|
||||||
}
|
|
||||||
return _Instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private IAuroraEnvironment _env;
|
|
||||||
private PLCControllerCCWH52A _plc;
|
|
||||||
private ScannerCCWH52A _scanner;
|
|
||||||
|
|
||||||
private bool usedAnalyzerLog = false;
|
private bool usedAnalyzerLog = false;
|
||||||
private readonly Logger _log = new Logger("ProcessManager");
|
private readonly Logger _log = new Logger("ProcessManager");
|
||||||
|
|
||||||
@ -42,21 +24,26 @@ namespace ILSOS_CCW_H52A.Sequences.ProcessObjects
|
|||||||
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)
|
private readonly IAuroraEnvironment _env;
|
||||||
|
private readonly PLCControllerCCWH52A _plc;
|
||||||
|
private readonly Scanner _scanner;
|
||||||
|
|
||||||
|
public ProcessManager()
|
||||||
{
|
{
|
||||||
_env = env;
|
|
||||||
_plc = _env.DeviceManager[DeviceIds.PLCDevice] as PLCControllerCCWH52A;
|
_plc = _env.DeviceManager[DeviceIds.PLCDevice] as PLCControllerCCWH52A;
|
||||||
_scanner = _env.DeviceManager[DeviceIds.Scanner] as ScannerCCWH52A;
|
_scanner = _env.DeviceManager[DeviceIds.Scanner] as Scanner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<bool> CheckRotaryState()
|
public IEnumerable<bool> CheckRotaryState()
|
||||||
{
|
{
|
||||||
List<bool> rotaryStates = new List<bool>();
|
List<bool> rotaryStates = new List<bool>();
|
||||||
for (int i = 0; i < RotaryJigCount; i++) {
|
for (int i = 0; i < RotaryJigCount; i++) {
|
||||||
var rotaryProcessState = _plc.ReadBit(eBitInput.PLC_USE_WELD_JIG_1 + i).data;
|
var rotaryProcessState = _plc.ReadBit(eBitInput.PLC_USE_WELD_JIG_1 + i).data;
|
||||||
rotaryStates.Add(rotaryProcessState);
|
rotaryStates.Add(rotaryProcessState);
|
||||||
//if (rotaryProcessState == false)
|
|
||||||
// _plc.ToggleBit(eBitInput.PLC_USE_WELD_JIG_1 + i, eBitOutput.PC_WELD_COMPLETE_1 + i);
|
if (rotaryProcessState == false)
|
||||||
|
_plc.ToggleBit(eBitInput.PLC_USE_WELD_JIG_1 + i, eBitOutput.PC_WELD_COMPLETE_1 + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usedAnalyzerLog) {
|
if (usedAnalyzerLog) {
|
||||||
@ -70,6 +57,8 @@ namespace ILSOS_CCW_H52A.Sequences.ProcessObjects
|
|||||||
|
|
||||||
public bool GetRotaryCanExist(int jigNo)
|
public bool GetRotaryCanExist(int jigNo)
|
||||||
{
|
{
|
||||||
|
//var RotaryStates = CheckRotaryState();
|
||||||
|
|
||||||
if (jigNo == 0)
|
if (jigNo == 0)
|
||||||
jigNo = 1;
|
jigNo = 1;
|
||||||
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
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,10 +1,8 @@
|
|||||||
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;
|
||||||
@ -460,8 +458,8 @@ namespace ILSOS_CCW_H52A.Sequences
|
|||||||
WaitingScannerList.Reset();
|
WaitingScannerList.Reset();
|
||||||
CompleteScannerList.Reset();
|
CompleteScannerList.Reset();
|
||||||
|
|
||||||
isTheFirstListWrite = true; // 작업 시작 시 처음 2개의 List는 입력하고 시작한다
|
isTheFirstListWrite = false; // 작업 시작 시 처음 2개의 List는 입력하고 시작한다
|
||||||
isTheSecondListWrite = true;
|
isTheSecondListWrite = false;
|
||||||
isTheFirstListExecute = true; // 제일 첫 List는 ExecuteList 필요. 이후는 AutoChange
|
isTheFirstListExecute = true; // 제일 첫 List는 ExecuteList 필요. 이후는 AutoChange
|
||||||
|
|
||||||
_PLC.WriteBit(eBitOutput.PC_AUTO_STATUS, true);
|
_PLC.WriteBit(eBitOutput.PC_AUTO_STATUS, true);
|
||||||
@ -1033,10 +1031,6 @@ namespace ILSOS_CCW_H52A.Sequences
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 중복 보고 방지 플래그 세팅
|
|
||||||
CompleteScannerList.SetReportComplete(true);
|
|
||||||
isWeled = false;
|
|
||||||
|
|
||||||
return SequenceAction.Ok();
|
return SequenceAction.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1060,23 +1054,12 @@ namespace ILSOS_CCW_H52A.Sequences
|
|||||||
}
|
}
|
||||||
// END ALL
|
// END ALL
|
||||||
#endregion
|
#endregion
|
||||||
private string CheckCanWelded(SequenceContext context, string id, ICollection<string> branches, SequenceActionResult param)
|
private static 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()
|
||||||
@ -1211,13 +1194,6 @@ 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);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -28,7 +28,6 @@ namespace WeldingCommon.Data
|
|||||||
table.Columns.Add("Time", typeof(string));
|
table.Columns.Add("Time", typeof(string));
|
||||||
table.Columns.Add(nameof(ActualProcessUnit.LotID), typeof(string));
|
table.Columns.Add(nameof(ActualProcessUnit.LotID), typeof(string));
|
||||||
table.Columns.Add(nameof(ActualProcessUnit.CellID), typeof(string));
|
table.Columns.Add(nameof(ActualProcessUnit.CellID), typeof(string));
|
||||||
table.Columns.Add(nameof(ActualProcessUnit.HeadNo), typeof(string));
|
|
||||||
table.Columns.Add(nameof(ActualProcessUnit.WeldType), typeof(string));
|
table.Columns.Add(nameof(ActualProcessUnit.WeldType), typeof(string));
|
||||||
table.Columns.Add(nameof(ActualProcessUnit.EncoderCheck), typeof(bool));
|
table.Columns.Add(nameof(ActualProcessUnit.EncoderCheck), typeof(bool));
|
||||||
table.Columns.Add(nameof(ActualProcessUnit.StartPointX), typeof(double));
|
table.Columns.Add(nameof(ActualProcessUnit.StartPointX), typeof(double));
|
||||||
@ -62,10 +61,10 @@ namespace WeldingCommon.Data
|
|||||||
protected override void InsertItem(int index, ActualProcessUnit item)
|
protected override void InsertItem(int index, ActualProcessUnit item)
|
||||||
{
|
{
|
||||||
base.InsertItem(index, item);
|
base.InsertItem(index, item);
|
||||||
table.Rows.Add(item.Date.ToString("yyyy-MM-dd"), item.Date.ToString("HH:mm:ss.fff"), item.LotID, item.CellID, item.HeadNo, item.WeldType, item.EncoderCheck,
|
table.Rows.Add(item.Date.ToString("yyyy-MM-dd"), item.Date.ToString("HH:mm:ss.fff"), item.LotID, item.CellID, item.WeldType, item.EncoderCheck,
|
||||||
item.StartPointX, item.StartPointY, item.EndPointX, item.EndPointY,
|
item.StartPointX, item.StartPointY, item.EndPointX, item.EndPointY,
|
||||||
item.WeldCondition, item.LaserOnDelay, item.LaserOffDelay, item.JumpDelay, item.MarkDelay,
|
item.WeldCondition, item.LaserOnDelay, item.LaserOffDelay, item.JumpDelay, item.MarkDelay,
|
||||||
item.PolygonDelay, item.Power, item.JumpSpeed, item.MarkSpeed, item.JumpX,
|
item.PolygonDelay, item.Power, item.JumpSpeed, item.MarkSpeed, item.JumpX,
|
||||||
item.JumpY);
|
item.JumpY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,10 +81,10 @@ namespace WeldingCommon.Data
|
|||||||
private DateTime _Date;
|
private DateTime _Date;
|
||||||
public string LotID { get => _LodID; set => SetProperty(ref _LodID, value); }
|
public string LotID { get => _LodID; set => SetProperty(ref _LodID, value); }
|
||||||
private string _LodID;
|
private string _LodID;
|
||||||
|
|
||||||
public string CellID { get => _CellID; set => SetProperty(ref _CellID, value); }
|
public string CellID { get => _CellID; set => SetProperty(ref _CellID, value); }
|
||||||
private string _CellID;
|
private string _CellID;
|
||||||
public string HeadNo { get => _HeadNo; set => SetProperty(ref _HeadNo, value); }
|
|
||||||
private string _HeadNo;
|
|
||||||
public string WeldType { get => _WeldType; set => SetProperty(ref _WeldType, value); }
|
public string WeldType { get => _WeldType; set => SetProperty(ref _WeldType, value); }
|
||||||
private string _WeldType;
|
private string _WeldType;
|
||||||
public bool EncoderCheck { get => _EncoderCheck; set => SetProperty(ref _EncoderCheck, value); }
|
public bool EncoderCheck { get => _EncoderCheck; set => SetProperty(ref _EncoderCheck, value); }
|
||||||
|
|||||||
@ -345,22 +345,27 @@ namespace WeldingCommon.Sequences
|
|||||||
_FindPatternCount = 0;
|
_FindPatternCount = 0;
|
||||||
return SEQ_DECISION_CHECK_OFFSET;
|
return SEQ_DECISION_CHECK_OFFSET;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
if (_InitParam.Is1StepCalibration)
|
||||||
if (_InitParam.Is1StepCalibration) {
|
{
|
||||||
_Is1stepCount++;
|
_Is1stepCount++;
|
||||||
Log.I(string.Format($"Is1stepCount : {_Is1stepCount} "));
|
Log.I(string.Format($"Is1stepCount : {_Is1stepCount} "));
|
||||||
return SEQ_FIND_PATTERN;
|
return SEQ_FIND_PATTERN;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (_NotFoundCount > 5) {
|
{
|
||||||
Log.I(string.Format($"Pattern Not Found. NotFoundCount OverFlow. Next Sequnece : SetVisionPositionFailed."));
|
if(_NotFoundCount > 5)
|
||||||
|
{
|
||||||
|
Log.I(string.Format($"Pattern Not Found. NotFoundCount OverFlow. Next Sequnece : SetVisionPositionFailed."));
|
||||||
return SEQ_SET_VISION_POSITION_FAILED;
|
return SEQ_SET_VISION_POSITION_FAILED;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
_NotFoundCount++;
|
{
|
||||||
Log.I(string.Format($"NotFoundCount : {_NotFoundCount} "));
|
_NotFoundCount++;
|
||||||
return SEQ_FIND_PATTERN;
|
Log.I(string.Format($"NotFoundCount : {_NotFoundCount} "));
|
||||||
|
return SEQ_FIND_PATTERN;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,15 +412,12 @@ namespace WeldingCommon.Sequences
|
|||||||
{
|
{
|
||||||
Log.I(string.Format($"Find Pattern Result Offset:[{_PatternOffsetX},{_PatternOffsetY}] Score:[{_Score}]"));
|
Log.I(string.Format($"Find Pattern Result Offset:[{_PatternOffsetX},{_PatternOffsetY}] Score:[{_Score}]"));
|
||||||
|
|
||||||
// Pattern Find OK
|
|
||||||
if (Math.Max(Math.Abs(_PatternOffsetX), Math.Abs(_PatternOffsetY)) < _InitParam.CheckOffset) {
|
if (Math.Max(Math.Abs(_PatternOffsetX), Math.Abs(_PatternOffsetY)) < _InitParam.CheckOffset) {
|
||||||
Log.FuncI(string.Format($"Check Offset Result True Criteria:[{_InitParam.CheckOffset}] Max Offset:[{Math.Max(Math.Abs(_PatternOffsetX), Math.Abs(_PatternOffsetY))}"));
|
Log.I(string.Format($"Check Offset Result True Criteria:[{_InitParam.CheckOffset}] Max Offset:[{Math.Max(Math.Abs(_PatternOffsetX), Math.Abs(_PatternOffsetY))}"));
|
||||||
return SEQ_SET_VISION_POSITION;
|
return SEQ_SET_VISION_POSITION;
|
||||||
}
|
} else if (_FindPatternCount < 10) {
|
||||||
// Pattern Find nOK >> 설정 범위 넘어감
|
|
||||||
else if (_FindPatternCount < 10) {
|
|
||||||
_CheckOffsetCount++;
|
_CheckOffsetCount++;
|
||||||
Log.FuncI(string.Format($"Find Pattern Count[{_FindPatternCount}]"));
|
Log.I(string.Format($"Check Offset Result True Criteria:[{_InitParam.CheckOffset}] Max Offset:[{Math.Max(Math.Abs(_PatternOffsetX), Math.Abs(_PatternOffsetY))}"));
|
||||||
return SEQ_FIND_PATTERN;
|
return SEQ_FIND_PATTERN;
|
||||||
} else {
|
} else {
|
||||||
Log.E(String.Format("ERROR_CHECK_OFFSET_COUNT_OVER"));
|
Log.E(String.Format("ERROR_CHECK_OFFSET_COUNT_OVER"));
|
||||||
|
|||||||
@ -701,7 +701,7 @@ namespace WeldingCommon.Sequences {
|
|||||||
Log.I(string.Format($"[Line Weld] Mark(Ramping) ({obj.PF2.X},{obj.PF2.Y})"));
|
Log.I(string.Format($"[Line Weld] Mark(Ramping) ({obj.PF2.X},{obj.PF2.Y})"));
|
||||||
} else {
|
} else {
|
||||||
// Ramping 이 없는 경우
|
// Ramping 이 없는 경우
|
||||||
|
|
||||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, percentLaser1, eFunctionType.LIST);
|
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, percentLaser1, eFunctionType.LIST);
|
||||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, percentLaser2, eFunctionType.LIST);
|
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, percentLaser2, eFunctionType.LIST);
|
||||||
_Scanner.MarkAbs(obj.PF2.X + xOffset, obj.PF2.Y + yOffset);
|
_Scanner.MarkAbs(obj.PF2.X + xOffset, obj.PF2.Y + yOffset);
|
||||||
@ -726,7 +726,6 @@ namespace WeldingCommon.Sequences {
|
|||||||
laserLog.EndPointY = obj.PF2.Y;
|
laserLog.EndPointY = obj.PF2.Y;
|
||||||
laserLog.LotID = Status.GetProcessingWeldingData().WorkLotId;
|
laserLog.LotID = Status.GetProcessingWeldingData().WorkLotId;
|
||||||
laserLog.CellID = Status.GetProcessingWeldingData().WorkCellId;
|
laserLog.CellID = Status.GetProcessingWeldingData().WorkCellId;
|
||||||
laserLog.HeadNo = Status.GetProcessingWeldingData().WeldingJigNo;
|
|
||||||
Status.GetProcessingWeldingData().APD.Add(laserLog);
|
Status.GetProcessingWeldingData().APD.Add(laserLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1608,7 +1607,7 @@ namespace WeldingCommon.Sequences {
|
|||||||
// 2.2.3.1. Constant Range 파워 설정
|
// 2.2.3.1. Constant Range 파워 설정
|
||||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, percentLaser1, eFunctionType.LIST);
|
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, percentLaser1, eFunctionType.LIST);
|
||||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, percentLaser2, eFunctionType.LIST);
|
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, percentLaser2, eFunctionType.LIST);
|
||||||
|
|
||||||
// 2.2.3.2. Constant Range 구간 위치 변경
|
// 2.2.3.2. Constant Range 구간 위치 변경
|
||||||
for (int iter = risingEdgeCount+firstEdgeCount; iter < totalCount - fallingEdgeCount; iter++) {
|
for (int iter = risingEdgeCount+firstEdgeCount; iter < totalCount - fallingEdgeCount; iter++) {
|
||||||
_Scanner.ArcAbs(obj.CenterPointF.X + xOffset, obj.CenterPointF.Y + yOffset, theta);
|
_Scanner.ArcAbs(obj.CenterPointF.X + xOffset, obj.CenterPointF.Y + yOffset, theta);
|
||||||
@ -1687,7 +1686,7 @@ namespace WeldingCommon.Sequences {
|
|||||||
SetScannerProcessCondition(param, out percentLaser1, out percentLaser2);
|
SetScannerProcessCondition(param, out percentLaser1, out percentLaser2);
|
||||||
|
|
||||||
Log.I(string.Format($"[Arc3P Weld] Weld Condition(No:{param.No + 1}) Setting(LaserOnDelay:{param.LaserOnDelay},LaserOffDelay:{param.LaserOffDelay},JumpDelay:{param.JumpDelay},MarkDelay:{param.MarkDelay},PolygonDelay:{param.PolygonDelay},Power:{param.LaserPower1},JumpSpeed:{param.JumpSpeed},MarkSpeed:{param.MarkSpeed})"));
|
Log.I(string.Format($"[Arc3P Weld] Weld Condition(No:{param.No + 1}) Setting(LaserOnDelay:{param.LaserOnDelay},LaserOffDelay:{param.LaserOffDelay},JumpDelay:{param.JumpDelay},MarkDelay:{param.MarkDelay},PolygonDelay:{param.PolygonDelay},Power:{param.LaserPower1},JumpSpeed:{param.JumpSpeed},MarkSpeed:{param.MarkSpeed})"));
|
||||||
|
|
||||||
//CSV Laser Log 추가
|
//CSV Laser Log 추가
|
||||||
laserLog.Date = DateTime.Now;
|
laserLog.Date = DateTime.Now;
|
||||||
laserLog.WeldType = "Arc3";
|
laserLog.WeldType = "Arc3";
|
||||||
|
|||||||
@ -52,14 +52,12 @@ namespace WeldingCommon.Settings
|
|||||||
var forRecipes = VisionRecipeManager.GetFovRecipes(forInfos);
|
var forRecipes = VisionRecipeManager.GetFovRecipes(forInfos);
|
||||||
if (forRecipes == null)
|
if (forRecipes == null)
|
||||||
return;
|
return;
|
||||||
|
foreach (var forRecipe in forRecipes) {
|
||||||
#warning 여기서 이거 왜 새로 저장하는건지 확인 필요함
|
// PixelSize
|
||||||
//foreach (var forRecipe in forRecipes) {
|
forRecipe.CalFovRecipe.PixelSize.X = SysParam.CameraPixelSize;
|
||||||
// // PixelSize
|
forRecipe.CalFovRecipe.PixelSize.Y = SysParam.CameraPixelSize;
|
||||||
// forRecipe.CalFovRecipe.PixelSize.X = SysParam.CameraPixelSize;
|
}
|
||||||
// forRecipe.CalFovRecipe.PixelSize.Y = SysParam.CameraPixelSize;
|
RecipeFileManager.SaveVisionRecipe();
|
||||||
//}
|
|
||||||
//RecipeFileManager.SaveVisionRecipe();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,45 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace WeldingCommon.Utils
|
|
||||||
{
|
|
||||||
public class ChangeChecker
|
|
||||||
{
|
|
||||||
private static Dictionary<string, bool> mapping = new Dictionary<string, bool>();
|
|
||||||
public static bool IsChangedBool(string Resource, bool value, bool defaultVal = false)
|
|
||||||
{
|
|
||||||
if (mapping.ContainsKey(Resource) == false) {
|
|
||||||
mapping[Resource] = defaultVal;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mapping[Resource] == value) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
mapping[Resource] = value;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public static bool IsChangedBoolMonitoring(string Resource, bool value, bool MonitoringValue, bool defaultVal = false)
|
|
||||||
{
|
|
||||||
if (mapping.ContainsKey(Resource) == false) {
|
|
||||||
mapping[Resource] = defaultVal;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mapping[Resource] == value) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
mapping[Resource] = value;
|
|
||||||
|
|
||||||
if(mapping[Resource] == MonitoringValue)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -61,15 +61,6 @@
|
|||||||
<DataGridTextColumn Header="Master Y" Binding="{Binding MasterY}"/>
|
<DataGridTextColumn Header="Master Y" Binding="{Binding MasterY}"/>
|
||||||
<DataGridTextColumn Header="Vision X" Binding="{Binding VisionX}"/>
|
<DataGridTextColumn Header="Vision X" Binding="{Binding VisionX}"/>
|
||||||
<DataGridTextColumn Header="Vision Y" Binding="{Binding VisionY}"/>
|
<DataGridTextColumn Header="Vision Y" Binding="{Binding VisionY}"/>
|
||||||
<DataGridTemplateColumn Header="Get Center Count">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Button Content="Click"
|
|
||||||
Command="{Binding DataContext.CMD_GetCenterCnt, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|||||||
@ -44,7 +44,6 @@ namespace WeldingCommon.Views
|
|||||||
public ICommand CMD_StopScannerCalibration { get; }
|
public ICommand CMD_StopScannerCalibration { get; }
|
||||||
public ICommand CMD_FindPattern { get; }
|
public ICommand CMD_FindPattern { get; }
|
||||||
public ICommand CMD_CalculateDistance { get; }
|
public ICommand CMD_CalculateDistance { get; }
|
||||||
public ICommand CMD_GetCenterCnt { get; }
|
|
||||||
|
|
||||||
//public ICommand CMD_ChangedCaltype { get; }
|
//public ICommand CMD_ChangedCaltype { get; }
|
||||||
//public ICommand CMD_SeqStop { get; }
|
//public ICommand CMD_SeqStop { get; }
|
||||||
@ -183,7 +182,6 @@ namespace WeldingCommon.Views
|
|||||||
CMD_StopScannerCalibration = new DelegateCommand(PerformCmdStopScannerCalibration);
|
CMD_StopScannerCalibration = new DelegateCommand(PerformCmdStopScannerCalibration);
|
||||||
CMD_FindPattern = new DelegateCommand(PerformCmdFindPattern);
|
CMD_FindPattern = new DelegateCommand(PerformCmdFindPattern);
|
||||||
CMD_CalculateDistance = new DelegateCommand(PerformCmdCalculateDistance);
|
CMD_CalculateDistance = new DelegateCommand(PerformCmdCalculateDistance);
|
||||||
CMD_GetCenterCnt = new DelegateCommand(PerformCmdGetCenterCount);
|
|
||||||
|
|
||||||
_MonitorTimer = new DispatcherTimer();
|
_MonitorTimer = new DispatcherTimer();
|
||||||
_MonitorTimer.Tick += OnMonitoring;
|
_MonitorTimer.Tick += OnMonitoring;
|
||||||
@ -193,7 +191,6 @@ namespace WeldingCommon.Views
|
|||||||
_Aurora.EventObservable.AsObservable(CommonSequenceIds.SeqScannerCalibration)
|
_Aurora.EventObservable.AsObservable(CommonSequenceIds.SeqScannerCalibration)
|
||||||
.ObserveOnDispatcher().Subscribe(x => OnUpdateCorrectionTable(x));
|
.ObserveOnDispatcher().Subscribe(x => OnUpdateCorrectionTable(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitVariable()
|
private void InitVariable()
|
||||||
{
|
{
|
||||||
GridRowCount = 13;
|
GridRowCount = 13;
|
||||||
@ -621,19 +618,6 @@ namespace WeldingCommon.Views
|
|||||||
Log.W($"{e.Message}");
|
Log.W($"{e.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PerformCmdGetCenterCount(object obj)
|
|
||||||
{
|
|
||||||
_Scanner.GetXYPos(out double currentX, out double currentY);
|
|
||||||
|
|
||||||
// Vision Scanner Calibration인 경우
|
|
||||||
int visionBitX = (int)(currentX * _Scanner.Config.ScaleXYFactor);
|
|
||||||
int visionBitY = (int)(currentY * _Scanner.Config.ScaleXYFactor);
|
|
||||||
|
|
||||||
VisionCorrectionList[SelectedRowIndex].VisionX = visionBitX;
|
|
||||||
VisionCorrectionList[SelectedRowIndex].VisionY = visionBitY;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public class CorrectionUnit : NotifyPropertyChangedBase
|
public class CorrectionUnit : NotifyPropertyChangedBase
|
||||||
{
|
{
|
||||||
@ -663,4 +647,5 @@ namespace WeldingCommon.Views
|
|||||||
private double _Distance;
|
private double _Distance;
|
||||||
public double Distance { get => _Distance; set => SetProperty(ref _Distance, value); }
|
public double Distance { get => _Distance; set => SetProperty(ref _Distance, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -248,7 +248,6 @@
|
|||||||
<Compile Include="Settings\SystemParameter.cs" />
|
<Compile Include="Settings\SystemParameter.cs" />
|
||||||
<Compile Include="Settings\SystemParameterManager.cs" />
|
<Compile Include="Settings\SystemParameterManager.cs" />
|
||||||
<Compile Include="Status.cs" />
|
<Compile Include="Status.cs" />
|
||||||
<Compile Include="Utils\ChangeChecker.cs" />
|
|
||||||
<Compile Include="Utils\CSV_Manager.cs" />
|
<Compile Include="Utils\CSV_Manager.cs" />
|
||||||
<Compile Include="Utils\ExcelManagementUnit.cs" />
|
<Compile Include="Utils\ExcelManagementUnit.cs" />
|
||||||
<Compile Include="Utils\ImageUtil.cs" />
|
<Compile Include="Utils\ImageUtil.cs" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user