Compare commits
10 Commits
fe085cd0c1
...
027a1e3256
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
027a1e3256 | ||
|
|
7dd4648587 | ||
|
|
3af28cd9ba | ||
|
|
92bce1b2b8 | ||
|
|
d2a023d8c4 | ||
|
|
a7bec5220d | ||
|
|
e98384906b | ||
|
|
1439479989 | ||
|
|
69679864ef | ||
|
|
b2589be67d |
@ -643,7 +643,7 @@ namespace AuroraACS
|
||||
return intValue;
|
||||
}
|
||||
|
||||
Log.E($"ReadVariable {VariableName} Error : " + result);
|
||||
//Log.E($"ReadVariable {VariableName} Error : " + result); // 잠시 주석 26.04.14 - 로그 많이 찍힘 - VariableName 확인 필요
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -773,7 +773,7 @@ namespace AuroraACS
|
||||
}
|
||||
} catch (Exception exc) {
|
||||
if (!IsSimul) {
|
||||
Log.E($"ReadVariable {VariableName} Exception : " + exc.Message);
|
||||
//Log.E($"ReadVariable {VariableName} Exception : " + exc.Message); // 26.04.14 잠시 주석 - 로그가 너무 많이 찍힘 VariableName 확인 필요
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -281,9 +281,9 @@ namespace AuroraIO
|
||||
Log.I(string.Format($"파일({fileName})이 존재하지 않습니다. Device Config의 File 경로를 확인하세요."));
|
||||
|
||||
return 0;
|
||||
//StreamWriter writer = new StreamWriter(fileName, false, System.Text.Encoding.Unicode);
|
||||
//writer.WriteLine("Index,Address,ID,IoType,ActiveLevel,BoardNo,Description,HighNecCond,LowNecCond,HighSensor,LowSensor,WaitInterlockTimeOut,WaitSensorTimeOut,HighSufCond,LowSufCond");
|
||||
//writer.Close();
|
||||
StreamWriter writer = new StreamWriter(fileName, false, System.Text.Encoding.Unicode);
|
||||
writer.WriteLine("Index,Address,ID,IoType,ActiveLevel,BoardNo,Description,HighNecCond,LowNecCond,HighSensor,LowSensor,WaitInterlockTimeOut,WaitSensorTimeOut,HighSufCond,LowSufCond");
|
||||
writer.Close();
|
||||
}
|
||||
|
||||
StreamReader sr = new StreamReader(fileName, System.Text.Encoding.Default);
|
||||
|
||||
@ -395,7 +395,7 @@ namespace AuroraLaser
|
||||
ReadNode[nTargetCommand + 1].dRet = dData * 0.25;
|
||||
} else {
|
||||
//To Do : AlarmLog 수정할 것
|
||||
Logger.E("LASER_POWER Invalid Data received " + strReceiveMsgTotal);
|
||||
Logger.E("LASER_POWER Invalid Data received " + strReceiveMsgTotal); // 04 14
|
||||
|
||||
//UtilUnit.logUnit.SetLog(LogUnit.eLogType.DEBUG, MethodBase.GetCurrentMethod().Name, "LASER_POWER Invalid Data received " + strReceiveMsgTotal);
|
||||
}
|
||||
|
||||
@ -350,6 +350,33 @@ namespace AuroraLaserScanner
|
||||
}
|
||||
_scannerObj.WaitForEncoderX(position);
|
||||
}
|
||||
public void WaitForEncoderY(double position)
|
||||
{
|
||||
if (!IsActivated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_scannerObj.WaitForEncoderY(position);
|
||||
}
|
||||
public void GetListPointer(out eListNo list_no, out uint list_pos)
|
||||
{
|
||||
list_no = eListNo.LIST1;
|
||||
list_pos = 0;
|
||||
if (!IsActivated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_scannerObj.GetListPointer(out list_no, out list_pos);
|
||||
}
|
||||
public void SetFlyY(double encoderResolution)
|
||||
{
|
||||
if (!IsActivated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_scannerObj.SetFlyY(encoderResolution);
|
||||
}
|
||||
|
||||
|
||||
public void WaitForEncoderRotateX(double angle)
|
||||
{
|
||||
|
||||
@ -69,13 +69,18 @@ namespace AuroraLaserScanner
|
||||
public double MarkingOntheFlyOffsetY { get; set; }
|
||||
public double MarkingOntheFlyParkingPositionX { get; set; }
|
||||
public double MarkingOntheFlyParkingPositionY { get; set; }
|
||||
public double MarkingStartX_1 { get; set; }
|
||||
public double MarkingStartX_2 { get; set; }
|
||||
public double XDiff_Page1and2 { get; set; }
|
||||
public double XDiff_Page3and4 { get; set; }
|
||||
|
||||
public eWaitEncoderMode MarkingStartWaitMode { get; set; }
|
||||
public eOntheFlyCoordinate OnTheFlyCoordinate { get; set; }
|
||||
public double FlySpeedInterlock { get; set; }
|
||||
public double RotaryEncoderOffset { get; set; }
|
||||
public double MOTFStageSpeed { get; set; }
|
||||
|
||||
#region 26.04.08 NDY MOTF Limit(추적 오차 한계) 변수 추가 --- RTC5에 있는 보드num 과 x,y,z에 대한 limit bit수를 입력하면 해당 오차 벗어나면 알려주는 메소드가 존재합니다. 현재는 stop을 직접하니깐 변수 추가하고 메소드 추가추가해서 사용하는 방식으로 확인 부탁드립니다.
|
||||
#region 26.04.08 NDY MOTF Limit(추적 오차 한계) 변수 추가 --- RTC5에 있는 보드num 과 x,y,z에 대한 limit bit수를 입력하면 해당 오차 벗어나면 알려주는 메소드가 존재합니다. 현재는 stop을 직접하니깐 변수 추가하고 메소드 추가추가해서 사용하는 방식으로 확인 부탁드립니다.
|
||||
[DisplayName("Tracking Error Limit X (mm)")]
|
||||
public double FlyLimitXmm { get; set; } = 28.0; // 60 FOV 기준 약 90% 지점 - bit로 자동 변환되는지를 확인 해야함.
|
||||
|
||||
|
||||
@ -315,6 +315,7 @@ namespace AuroraLaserScanner
|
||||
public abstract void SetConfigList(uint mem1, uint mem2);
|
||||
public abstract uint GetListSpace();
|
||||
#endregion
|
||||
public abstract void GetListPointer(out eListNo list_no, out uint list_pos);
|
||||
public void WaitForListTaskCompleted(int timeOut, SequenceContext context = null) //단위는 초
|
||||
{
|
||||
TimeSpan spanTime;
|
||||
|
||||
@ -1109,5 +1109,12 @@ namespace AuroraLaserScanner
|
||||
{
|
||||
return RTC5Wrap.get_last_error();
|
||||
}
|
||||
public override void GetListPointer(out eListNo list_no, out uint list_pos)
|
||||
{
|
||||
uint listNo = 0;
|
||||
RTC5Wrap.get_list_pointer(out listNo, out list_pos);
|
||||
list_no = (eListNo)listNo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1121,6 +1121,12 @@ namespace AuroraLaserScanner
|
||||
{
|
||||
return RTC6Wrap.get_last_error();
|
||||
}
|
||||
public override void GetListPointer(out eListNo list_no, out uint list_pos)
|
||||
{
|
||||
uint listNo = 0;
|
||||
RTC6Wrap.get_list_pointer(out listNo, out list_pos);
|
||||
list_no = (eListNo)listNo;
|
||||
}
|
||||
|
||||
#region 26.04.08 NDY - 오차 추적 메소드 OVERRIDE 추가 RTC6 (자식클래스 -실제 RTC6Wrap전달 지점)
|
||||
//public override void SetFlyLimit(uint portNo,int xMin, int xMax , int yMin,int yMax )
|
||||
@ -1133,7 +1139,7 @@ namespace AuroraLaserScanner
|
||||
//{
|
||||
// RTC6Wrap.n_set_fly_limits_z(portNo, zMin, zMax);
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -569,5 +569,10 @@ namespace AuroraLaserScanner
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void GetListPointer(out eListNo list_no, out uint list_pos)
|
||||
{
|
||||
list_no = eListNo.LIST1;
|
||||
list_pos = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ namespace MilUI {
|
||||
public void DrawGuideLines() {
|
||||
var calFovRecipe = VisionRecipeManager.GetCalFovRecipe(_FovInfo);
|
||||
var centerPos = new ImagePoint(_ImageSize.Width / 2, _ImageSize.Height / 2);
|
||||
var color = MIL.M_RGB888(255, 165, 0); // Orange
|
||||
var color = MIL.M_COLOR_RED; // Orange
|
||||
|
||||
_gridGuideLine.DrawGuideLines(_ImageSize, centerPos, 1, color, calFovRecipe.ErrRotationX);
|
||||
//_gridGuideLine.DrawRefLine(_ImageSize, calFovRecipe.ErrRotationX);
|
||||
|
||||
@ -97,11 +97,11 @@ namespace MilUI {
|
||||
|
||||
if (gridMode == eGridMode.Narrow) {
|
||||
DrawGuideLines(imageSize, centerPos, 11, MIL.M_COLOR_LIGHT_GRAY, errRotation);
|
||||
DrawGuideLines(imageSize, centerPos, 1, COLOR_ORANGE, errRotation);
|
||||
DrawGuideLines(imageSize, centerPos, 1, MIL.M_COLOR_RED, errRotation);
|
||||
}
|
||||
else {
|
||||
DrawGuideLines(imageSize, centerPos, 5, MIL.M_COLOR_LIGHT_GRAY, errRotation);
|
||||
DrawGuideLines(imageSize, centerPos, 1, COLOR_ORANGE, errRotation);
|
||||
DrawGuideLines(imageSize, centerPos, 1, MIL.M_COLOR_RED, errRotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,8 @@ namespace MilUI {
|
||||
_milGraphics = new MilGraphics(_displayId, _graphicListId);
|
||||
_tempMilGraphics = new MilGraphics(_displayId, _graphicListId);
|
||||
_colors = new List<MIL_INT>() {
|
||||
MIL.M_COLOR_YELLOW,
|
||||
//MIL.M_COLOR_YELLOW,
|
||||
MIL.M_COLOR_GREEN,
|
||||
MIL.M_COLOR_MAGENTA
|
||||
};
|
||||
}
|
||||
|
||||
BIN
Doc/ToNDH/로그_한글_깨짐_문제해결_260415.docx
Normal file
BIN
Doc/ToNDH/로그_한글_깨짐_문제해결_260415.docx
Normal file
Binary file not shown.
0
Doc/ToNDH/번들프로그램세팅법_260414.pptx
Normal file
0
Doc/ToNDH/번들프로그램세팅법_260414.pptx
Normal file
@ -7,7 +7,8 @@ using System.Threading.Tasks;
|
||||
namespace ILSOS_PrismaticGun.Device.ACS
|
||||
{
|
||||
public partial class PrismaticGunACS
|
||||
{ const string AlarmReset = "iAlarmreset";
|
||||
{
|
||||
const string AlarmReset = "iAlarmreset";
|
||||
const string HeavyAlarm = "iAlarm";
|
||||
const string LightAlarm = "iLightAlarm";
|
||||
const string AlarmCodes = "iPCAlarmNo"; // 10개
|
||||
|
||||
@ -106,10 +106,10 @@ namespace ILSOS_PrismaticGun.Device.ACS
|
||||
_calibration = env.SettingEntry[CommonSettingIds.LaserPowerCalParam] as LaserPowerCalParam;
|
||||
_teachingSetting = env.SettingEntry[SettingIds.TeachingPos] as TeachingPositionSetting;
|
||||
|
||||
MotorX1 = env.DeviceManager[MotorIds.AxisX1] as ACSMotor;
|
||||
//MotorX1 = env.DeviceManager[MotorIds.AxisX1] as ACSMotor;
|
||||
MotorX2 = env.DeviceManager[MotorIds.AxisX2] as ACSMotor;
|
||||
MotorY1 = env.DeviceManager[MotorIds.AxisY1] as ACSMotor;
|
||||
MotorY2 = env.DeviceManager[MotorIds.AxisY2] as ACSMotor;
|
||||
//MotorY1 = env.DeviceManager[MotorIds.AxisY1] as ACSMotor;
|
||||
//MotorY2 = env.DeviceManager[MotorIds.AxisY2] as ACSMotor;
|
||||
MotorZ = env.DeviceManager[MotorIds.AxisZ] as ACSMotor;
|
||||
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ namespace ILSOS_PrismaticScanner.Alarm
|
||||
// High Alarm 은 Sequence 정지
|
||||
if (alarm.Level == AlarmLevel.H) {
|
||||
StopSequence(SequenceIds.SeqAutoRun);
|
||||
StopSequence(SequenceIds.SeqAutoRunACS); // 26.04.15 추가
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,8 +17,8 @@ namespace ILSOS_PrismaticScanner
|
||||
internal class MotorIds
|
||||
{
|
||||
public const string AxisX2 = "AxisX2";
|
||||
public const string AxisY1 = "AxisY1";
|
||||
public const string AxisY2 = "AxisY2";
|
||||
//public const string AxisY1 = "AxisY1";
|
||||
//public const string AxisY2 = "AxisY2";
|
||||
public const string AxisZ = "AxisZ";
|
||||
|
||||
// TODO: 이정인 선임 ACS 변수 맵 수신 후 실제 번호 검증
|
||||
@ -41,9 +41,6 @@ namespace ILSOS_PrismaticScanner
|
||||
public const string SeqAlarmMonitor = "SeqAlarmMonitor";
|
||||
public const string SeqStatusMonitor = "SeqStatusMonitor";
|
||||
|
||||
// 26.04.09 NDY - ACS MOTF AutoRun - > SeqAutoRun은 CommonSequenceIds에 존재함.
|
||||
public const string SeqAutoRunACS = "SeqAutoRunACS";
|
||||
|
||||
}
|
||||
|
||||
public class StreamMessageNames
|
||||
|
||||
@ -98,17 +98,17 @@ namespace ILSOS_PrismaticScanner
|
||||
await ActivateDevices();
|
||||
}
|
||||
|
||||
AuroraEx.RegisterRmsHandler<RMSHandlerForScanner>();
|
||||
AuroraEnv.RecipeManager.RmsHandler().RegistryDeviceHandler(AuroraEnv);
|
||||
AuroraEnv.RecipeManager.RmsHandler().Start();
|
||||
//AuroraEx.RegisterRmsHandler<RMSHandlerForScanner>();
|
||||
//AuroraEnv.RecipeManager.RmsHandler().RegistryDeviceHandler(AuroraEnv);
|
||||
//AuroraEnv.RecipeManager.RmsHandler().Start();
|
||||
|
||||
// [Singleton Instance] Recipe Change History
|
||||
AuroraEnv.RecipeManager.RchHandler().RegistryDeviceHandler(AuroraEnv);
|
||||
//AuroraEnv.RecipeManager.RchHandler().RegistryDeviceHandler(AuroraEnv);
|
||||
|
||||
//AlarmMonitroing Seq Start
|
||||
AuroraEnv.SequenceEntry[SequenceIds.SeqAlarmMonitor].Start();
|
||||
AuroraEnv.SequenceEntry[SequenceIds.SeqStatusMonitor].Start();
|
||||
AuroraEnv.SequenceEntry[CommonSequenceIds.PLCMonitor].Start();
|
||||
//AuroraEnv.SequenceEntry[SequenceIds.SeqAlarmMonitor].Start();
|
||||
//AuroraEnv.SequenceEntry[SequenceIds.SeqStatusMonitor].Start();
|
||||
//AuroraEnv.SequenceEntry[CommonSequenceIds.PLCMonitor].Start();
|
||||
|
||||
|
||||
base.OnStartUp();
|
||||
@ -116,9 +116,9 @@ namespace ILSOS_PrismaticScanner
|
||||
public override void OnShutDown()
|
||||
{
|
||||
// 모니터링 시퀀스 먼저 종료
|
||||
AuroraEnv.SequenceEntry[SequenceIds.SeqAlarmMonitor].Stop();
|
||||
AuroraEnv.SequenceEntry[SequenceIds.SeqStatusMonitor].Stop();
|
||||
AuroraEnv.SequenceEntry[CommonSequenceIds.PLCMonitor].Stop();
|
||||
//AuroraEnv.SequenceEntry[SequenceIds.SeqAlarmMonitor].Stop();
|
||||
//AuroraEnv.SequenceEntry[SequenceIds.SeqStatusMonitor].Stop();
|
||||
//AuroraEnv.SequenceEntry[CommonSequenceIds.PLCMonitor].Stop();
|
||||
Thread.Sleep(200);
|
||||
|
||||
base.OnShutDown();
|
||||
@ -145,24 +145,6 @@ namespace ILSOS_PrismaticScanner
|
||||
|
||||
var isSimul = ApplicationExt.IsSimulation;
|
||||
|
||||
//registry.Register(CommonDeviceIds.OCT, () => new OCT(CommonDeviceIds.OCT, isSimul), new OCTConfig(),
|
||||
// device => new UCOCTDevice() { DataContext = new UCOCTDeviceViewModel(AuroraEnv, CommonDeviceIds.OCT) });
|
||||
//registry.Register(CommonDeviceIds.LBAD, () => new LBAD(CommonDeviceIds.LBAD, isSimul), new LBADConfig());
|
||||
//registry.Register(CommonDeviceIds.CellTracker, () => new CellTracker(CommonDeviceIds.CellTracker, eCellTrackerType.Daekhon, isSimul), new CellTrackerConfig(),
|
||||
// device => new UCCellTrackerDevice() { DataContext = new UCCellTrackerDeviceViewModel(AuroraEnv, CommonDeviceIds.CellTracker) });
|
||||
|
||||
|
||||
//IODevice는 AjinIO가 아니라 IOUnit으로 받아오는것으로 수정해야 함
|
||||
registry.Register(CommonDeviceIds.IODevice, () => new PAIX_PrismaticScanner(AuroraEnv, CommonDeviceIds.IODevice, isSimul), new IOUnitConfig());
|
||||
registry.Register(CommonDeviceIds.Laser, () => new Laser(CommonDeviceIds.Laser, isSimul), new LaserConfig(),
|
||||
device => new UCLaserDevice() { DataContext = new UCLaserDeviceViewModel(AuroraEnv, CommonDeviceIds.Laser) });
|
||||
|
||||
var _plc = new PLCControllerPrismaticScanner(CommonDeviceIds.PLCDevice, ePLCNetType.MXComponent, ApplicationExt.IsSimulation, PLCMMapFileType.CSV, AuroraEnv);
|
||||
registry.Register(CommonDeviceIds.PLCDevice,
|
||||
() => _plc, PLCMxComponentConfig.GetDefaultConfig(),
|
||||
device => new UCPLCDevice() { DataContext = new UCPLCDeviceViewModel(AuroraEnv, _plc) });
|
||||
|
||||
|
||||
|
||||
AlarmManager.Init(AuroraEnv);
|
||||
|
||||
@ -171,22 +153,12 @@ namespace ILSOS_PrismaticScanner
|
||||
var ACS = new ScannerACS(isSimul);
|
||||
registry.Register(DeviceIds.ACS, () => ACS, new ACSDeviceConfig());
|
||||
|
||||
// TODO: 축 번호는 이정인 선임 변수 맵 수신 후 검증
|
||||
// TODO: 스테이지 X는 2 스테이지 Z는 4 확인완료 Y 사용 안함
|
||||
var motorX2 = new ACSMotor(MotorIds.AxisX2, ACS, 2, (int)MotorIds.eMotorIdx.AxisX2);
|
||||
registry.Register(MotorIds.AxisX2, () => motorX2,
|
||||
new ACSMotorConfig(MotorIds.AxisX2),
|
||||
motor => new UCACSMotor(AuroraEnv.DeviceManager, motor.DeviceId));
|
||||
|
||||
//var motorY1 = new ACSMotor(MotorIds.AxisY1, ACS, 3, (int)MotorIds.eMotorIdx.AxisY1);
|
||||
//registry.Register(MotorIds.AxisY1, () => motorY1,
|
||||
// new ACSMotorConfig(MotorIds.AxisY1),
|
||||
// motor => new UCACSMotor(AuroraEnv.DeviceManager, motor.DeviceId));
|
||||
|
||||
//var motorY2 = new ACSMotor(MotorIds.AxisY2, ACS, 4, (int)MotorIds.eMotorIdx.AxisY2);
|
||||
//registry.Register(MotorIds.AxisY2, () => motorY2,
|
||||
// new ACSMotorConfig(MotorIds.AxisY2),
|
||||
// motor => new UCACSMotor(AuroraEnv.DeviceManager, motor.DeviceId));
|
||||
|
||||
var motorZ = new ACSMotor(MotorIds.AxisZ, ACS, 4, (int)MotorIds.eMotorIdx.AxisZ);
|
||||
registry.Register(MotorIds.AxisZ, () => motorZ,
|
||||
new ACSMotorConfig(MotorIds.AxisZ),
|
||||
@ -197,8 +169,8 @@ namespace ILSOS_PrismaticScanner
|
||||
{
|
||||
if (device.DeviceId == DeviceIds.ACS ||
|
||||
device.DeviceId == MotorIds.AxisX2 ||
|
||||
device.DeviceId == MotorIds.AxisY1 ||
|
||||
device.DeviceId == MotorIds.AxisY2 ||
|
||||
//device.DeviceId == MotorIds.AxisY1 ||
|
||||
//device.DeviceId == MotorIds.AxisY2 ||
|
||||
device.DeviceId == MotorIds.AxisZ)
|
||||
{
|
||||
device.DevGroup = "ACS";
|
||||
@ -206,47 +178,12 @@ namespace ILSOS_PrismaticScanner
|
||||
}
|
||||
// ──────────────────────────────────────────────────────────────────
|
||||
|
||||
// ── 26.04.06 NDY 추가: 인터락 ─────────────────────────────────────
|
||||
// TODO: PLCControllerPrismaticScanner에 IsDoorOpen, IsEMO 있는지 확인 필요 - 없는 것 확인 완료
|
||||
//PLC_DOOR_INTERLOCK = 6, // ← 도어 인터락
|
||||
//PLC_EMO_STATUS = 7, // ← EMO
|
||||
AddMotionInterlockCheck(_plc);
|
||||
// ──────────────────────────────────────────────────────────────────
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
// 인터락
|
||||
private void AddMotionInterlockCheck(PLCControllerPrismaticScanner plc)
|
||||
{
|
||||
var motorIds = new[] {
|
||||
MotorIds.AxisX2,
|
||||
MotorIds.AxisY1,
|
||||
MotorIds.AxisY2,
|
||||
MotorIds.AxisZ
|
||||
};
|
||||
|
||||
foreach (var motorId in motorIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
var motor = AuroraEnv.DeviceManager[motorId] as ACSMotor;
|
||||
if (motor == null) continue;
|
||||
|
||||
//motor.AddInterlockCheck(("MotorInPos",
|
||||
// () => !motor.ReadInposition()));
|
||||
//motor.AddInterlockCheck(("IsDoorOpen",
|
||||
// () => plc.ReadBit(PLCControllerPrismaticScanner.eBitInput.PLC_DOOR_INTERLOCK).data));
|
||||
//motor.AddInterlockCheck(("IsEMO",
|
||||
// () => plc.ReadBit(PLCControllerPrismaticScanner.eBitInput.PLC_EMO_STATUS).data));
|
||||
|
||||
//*** 인터락은 이정인 선임께 ACSMotor에 AddInterlockCheck가 있는지 확인 후 진행
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.W($"AddMotionInterlockCheck [{motorId}] 실패: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void RegisterRecipes(RecipeRegister register)
|
||||
{
|
||||
register(CommonRecipeIds.ScannerObjectTeaching, new ScannerObjectTeachingRecipe(),
|
||||
@ -291,7 +228,7 @@ namespace ILSOS_PrismaticScanner
|
||||
// ACS MOTF 전용 시퀀스를 별도 Builder로 등록
|
||||
var seqAutoRunPrismaticScannerACS = new SeqAutoRunPrismaticScannerACS();
|
||||
_SeqAutoRunPrismaticScannerACS_Builder = seqAutoRunPrismaticScannerACS.Builder();
|
||||
register(SequenceIds.SeqAutoRunACS, _SeqAutoRunPrismaticScannerACS_Builder);
|
||||
register(CommonSequenceIds.SeqAutoRunACS, _SeqAutoRunPrismaticScannerACS_Builder);
|
||||
#endregion
|
||||
}
|
||||
|
||||
@ -332,10 +269,10 @@ namespace ILSOS_PrismaticScanner
|
||||
base.RegisterViews(manager);
|
||||
|
||||
// Auto Run
|
||||
// 26.04.06 NDY: Manual 서브로 이동
|
||||
//var MainAutoRun = new MainMenu(CommonViewIds.AutoRun, MenuIcon.GetMenuIcon(eMenuIcon.HOME), PermissionLevel.NONE, false);
|
||||
//MainAutoRun.AddSubMenu(CommonViewIds.AutoRun, new UCMainAutoRun(new UCMainAutoRunViewModel(AuroraEnv, SequenceIds.SeqAutoRun)));
|
||||
//manager.RegisterMainMenu(MainAutoRun);
|
||||
// 26.04.06 NDY: Manual 서브로 이동 - 26.04.14 주석이였으나 - 주석 해제
|
||||
var MainAutoRun = new MainMenu(CommonViewIds.AutoRun, MenuIcon.GetMenuIcon(eMenuIcon.HOME), PermissionLevel.NONE, false);
|
||||
MainAutoRun.AddSubMenu(CommonViewIds.AutoRun, new UCMainAutoRun(new UCMainAutoRunViewModel(AuroraEnv, SequenceIds.SeqAutoRun)));
|
||||
manager.RegisterMainMenu(MainAutoRun);
|
||||
|
||||
// Recipe
|
||||
MainMenu recipe = new MainMenu(CommonViewIds.Recipe, MenuIcon.GetMenuIcon(eMenuIcon.RECIPE), PermissionLevel.NONE, true);
|
||||
|
||||
@ -35,7 +35,7 @@ using VisionCommon;
|
||||
using WeldingCommon;
|
||||
using WeldingCommon.Alarm;
|
||||
using WeldingCommon.Data;
|
||||
using WeldingCommon.Devices.ACS; // 26.04.06
|
||||
using WeldingCommon.Devices.ACS; // 26.04.06
|
||||
using WeldingCommon.Sequences;
|
||||
using WeldingCommon.Settings;
|
||||
using WeldingCommon.Utils;
|
||||
@ -51,25 +51,29 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
{
|
||||
static readonly Logger Log = new Logger("SeqComponentTeachingRun");
|
||||
|
||||
const string SEQ_ENTER = "SEQ_ENTER"; // inputParam 으로 받자.
|
||||
const string SEQ_CHECK_INIT_CONDITION = "Check Init Condition"; // Check Init Condition
|
||||
const string SEQ_ENTER = "[SeqComponentTeachingRun] SEQ_ENTER"; // inputParam 으로 받자.
|
||||
const string SEQ_CHECK_INIT_CONDITION = "[SeqComponentTeachingRun] Check Init Condition"; // Check Init Condition
|
||||
|
||||
const string SEQ_SET_PARAMS_UPLOAD_WELDING_LIST_SEQ = "Set Sequence Param (UploadWeldingList Seq)";
|
||||
const string SEQ_DO_ID_UPLOAD_WELDING_LIST_SEQ = "Process (UploadWeldingList Seq)";
|
||||
const string SEQ_GET_RESULT_UPLOAD_WELDING_LIST_SEQ = "Get Sequence Result (UploadWeldingList Seq)";
|
||||
const string SEQ_SET_PARAMS_UPLOAD_WELDING_LIST_SEQ = "[SeqComponentTeachingRun] Set Sequence Param (UploadWeldingList Seq)";
|
||||
const string SEQ_DO_ID_UPLOAD_WELDING_LIST_SEQ = "[SeqComponentTeachingRun] Process (UploadWeldingList Seq)";
|
||||
const string SEQ_GET_RESULT_UPLOAD_WELDING_LIST_SEQ = "[SeqComponentTeachingRun] Get Sequence Result (UploadWeldingList Seq)";
|
||||
const string SEQ_SET_BLOW_ON = "[SeqComponentTeachingRun] Set Blow On";
|
||||
const string SEQ_SET_BLOW_OFF = "[SeqComponentTeachingRun] Set Blow Off";
|
||||
|
||||
const string SEQ_COMPLETE = "SEQ_COMPLETE"; // 완료
|
||||
const string SEQ_SAVE_RESULT_DATA = "[SeqComponentTeachingRun] Save Result Data";
|
||||
|
||||
const string SEQ_START_WELDING = "Start All Welding";
|
||||
const string SEQ_DO_COMPONENT_WELDING = "Do Component Welding";
|
||||
const string SEQ_ACS_MOTION_SET = "Set ACS Motion Parameter";
|
||||
const string SEQ_ACS_MOTION_START = "ACS Motion Start";
|
||||
const string SEQ_CHECK_MOTION_END = "Check ACS Motion Complete";
|
||||
const string SEQ_COMPLETE = "[SeqComponentTeachingRun] SEQ_COMPLETE"; // 완료
|
||||
|
||||
const string SEQ_UPDATE_COMPONENT_WELDING_PARAMETERS = "[SeqComponentTeachingRun] Update Component Welding Parameters";
|
||||
const string SEQ_START_WELDING = "[SeqComponentTeachingRun] Start All Welding";
|
||||
const string SEQ_DO_COMPONENT_WELDING = "[SeqComponentTeachingRun] Do Component Welding";
|
||||
const string SEQ_CHECK_END_LIST = "[SeqComponentTeachingRun] Check End List";
|
||||
const string SEQ_END_WELDING = "[SeqComponentTeachingRun] End All Welding";
|
||||
|
||||
#region 260408 NDY 노드 추가
|
||||
// Builder()에 노드 추가
|
||||
const string SEQ_STANDBY_MOTION = "Move Stage To Origin";
|
||||
const string SEQ_STANDBY_SCANNER = "Encoder Reset";
|
||||
//const string SEQ_MOVE_STAGE_ORIGIN = "[SeqComponentTeachingRun] Move Stage To Origin";
|
||||
//const string SEQ_ENCODER_RESET = "[SeqComponentTeachingRun] Encoder Reset";
|
||||
#endregion
|
||||
|
||||
const int timeoutSeconds = 10;
|
||||
@ -82,6 +86,7 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
private SeqTeachingRun_InitParam _InitParam;
|
||||
|
||||
private static Scanner _Scanner;
|
||||
private static PAIX_PrismaticScanner _IO;
|
||||
|
||||
// 필드 선언 추가 (다른 필드들 옆에)
|
||||
// 변경 전
|
||||
@ -90,7 +95,13 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
|
||||
// 변경 후
|
||||
private IScannerACS _ACS; // 26.04.06 NDY - MOTF용 ACS Stage X 제어
|
||||
private static ACSMotor _AxisX, _AxisZ; // 26.04.08 NDY - MOTF용 Stage X 축
|
||||
private static ACSMotor _AxisX; // 26.04.08 NDY - MOTF용 Stage X 축
|
||||
|
||||
private Laser _Laser;
|
||||
private ILaser _LaserDevice;
|
||||
private LaserTruFiber _LaserTruFiber;
|
||||
private LaserPowerCalParam _LaserPowerCalParam;
|
||||
private PLCControllerPrismaticScanner _plc;
|
||||
|
||||
private SystemParameter _SystemParameter;
|
||||
private ScannerCanvasUserCtrl _ScannerCanvasUserCtrl; //스캐너 동작관련 객체 선언
|
||||
@ -101,48 +112,69 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
|
||||
|
||||
private List<IDrawObject> _SelectedObjectList;
|
||||
private Queue<List<IDrawObject>> _DivideObjectsQueue;
|
||||
private List<IDrawObject> _TargetObjects;
|
||||
private static DateTime _SequenceCompleteTime; // 시퀸스 시간
|
||||
private static TimeSpan _MeasurementSpanTime; //측정 시간
|
||||
private static TimeSpan _ScannerSaveLogTime;
|
||||
private static DateTime _partialWeldingStartTime;
|
||||
private static List<IDrawObject> _FlattenRecipes;
|
||||
private static int _CountWeldingObject; // 트럼프 레시피에서 부분 용접 할 Ojbect의 개수
|
||||
private static int _CurrentobjectIndex;
|
||||
private static int _BeforeObjectIndex;
|
||||
private static int _BeforeProgramNo; // 이전 트럼프 레이저 용접 번호
|
||||
private static int _BeforeParameterNo; //
|
||||
|
||||
private static int _CenterBeamPower;
|
||||
private static int _RingBeamPower;
|
||||
private static bool _LaserPowerControlByRatio = false;
|
||||
private static int _CenterRingRatio; // Center Ring의 파워 비율
|
||||
private static double _LaserPowerRatio; // Laser에서 출력 파워 비율
|
||||
public SequenceBuilder Builder()
|
||||
{
|
||||
var sb = new SequenceBuilder(1000, true);
|
||||
////var sb = new SequenceBuilder(1000, false); // With log
|
||||
|
||||
sb.AddAction(SEQ_ENTER, Sequence_Enter);
|
||||
sb.AddAction(SEQ_CHECK_INIT_CONDITION, CheckInitCondition); //분기
|
||||
#region 26.04.08 추가된 노드 NDY
|
||||
// 26.04.08 필드 좌표 0,0으로 스테이지 이동 시퀸스 + EncoderReset 호출
|
||||
sb.AddAction(SEQ_STANDBY_MOTION, SetStandbyMotion);
|
||||
sb.AddAction(SEQ_STANDBY_SCANNER, SetStandbyScanner);
|
||||
sb.AddAction(SEQ_SET_BLOW_ON, SetBlowOn);
|
||||
#region 26.04.08 추가된 노드 NDY
|
||||
// 26.04.08 필드 좌표 0,0으로 스테이지 이동 시퀸스 + EncoderReset 호출
|
||||
//sb.AddAction(SEQ_MOVE_STAGE_ORIGIN, MoveStageToOrigin);
|
||||
//sb.AddAction(SEQ_ENCODER_RESET, EncoderReset);
|
||||
#endregion
|
||||
|
||||
sb.AddAction(SEQ_START_WELDING, StartWelding);
|
||||
sb.AddDecision(SEQ_CHECK_END_LIST, CheckEndList);
|
||||
sb.AddAction(SEQ_UPDATE_COMPONENT_WELDING_PARAMETERS, UpdateComponentWeldingParameters);
|
||||
sb.AddAction(SEQ_SET_PARAMS_UPLOAD_WELDING_LIST_SEQ, SetUploadWeldingList_SeqParams);
|
||||
sb.AddSubsequence(SEQ_DO_ID_UPLOAD_WELDING_LIST_SEQ, CommonSequenceManager.GetSeqBuilder_SeqUploadWeldingList());
|
||||
sb.AddAction(SEQ_GET_RESULT_UPLOAD_WELDING_LIST_SEQ, GetUploadWeldingList_SeqResult);
|
||||
sb.AddAction(SEQ_DO_COMPONENT_WELDING, DoComponentWelding);
|
||||
sb.AddAction(SEQ_ACS_MOTION_SET, SetMotion);
|
||||
sb.AddAction(SEQ_ACS_MOTION_START, StartMotion);
|
||||
sb.AddAction(SEQ_CHECK_MOTION_END, EndWelding);
|
||||
sb.AddAction(SEQ_END_WELDING, EndWelding);
|
||||
sb.AddAction(SEQ_SET_BLOW_OFF, SetBlowOff);
|
||||
sb.AddAction(SEQ_SAVE_RESULT_DATA, SaveResultData); // 해당 공정의 정보를 기록 함.
|
||||
sb.AddAction(SEQ_COMPLETE, Complete);
|
||||
|
||||
|
||||
sb.Flows(sb.Init
|
||||
> sb[SEQ_ENTER]
|
||||
> sb[SEQ_CHECK_INIT_CONDITION]
|
||||
> sb[SEQ_STANDBY_MOTION]
|
||||
> sb[SEQ_STANDBY_SCANNER]
|
||||
> sb[SEQ_SET_PARAMS_UPLOAD_WELDING_LIST_SEQ]
|
||||
> sb[SEQ_DO_ID_UPLOAD_WELDING_LIST_SEQ]
|
||||
> sb[SEQ_GET_RESULT_UPLOAD_WELDING_LIST_SEQ]
|
||||
> sb[SEQ_DO_COMPONENT_WELDING]
|
||||
> sb[SEQ_ACS_MOTION_SET]
|
||||
> sb[SEQ_ACS_MOTION_START]
|
||||
> sb[SEQ_CHECK_MOTION_END]
|
||||
> sb[SEQ_COMPLETE]
|
||||
> sb.Final);
|
||||
// 기존 흐름에서 SET_BLOW_ON → START_WELDING 사이에 끼워넣기
|
||||
#region 기존 흐름 26.04.08
|
||||
sb.Flows(sb.Init > sb[SEQ_ENTER] > sb[SEQ_CHECK_INIT_CONDITION] > sb[SEQ_SET_BLOW_ON]
|
||||
> sb[SEQ_START_WELDING] > sb[SEQ_CHECK_END_LIST]);
|
||||
#endregion
|
||||
#region 2개 노드 추가한 흐름 26.04.08
|
||||
//sb.Flows(sb.Init > sb[SEQ_ENTER] > sb[SEQ_CHECK_INIT_CONDITION] > sb[SEQ_SET_BLOW_ON]
|
||||
// > sb[SEQ_MOVE_STAGE_ORIGIN] // ← 추가
|
||||
// > sb[SEQ_ENCODER_RESET] // ← 추가
|
||||
// > sb[SEQ_START_WELDING] > sb[SEQ_CHECK_END_LIST]);
|
||||
#endregion
|
||||
|
||||
// 아래 두 흐름은 기존 그대로 유지
|
||||
sb.Flows(sb[SEQ_CHECK_END_LIST] > sb[SEQ_UPDATE_COMPONENT_WELDING_PARAMETERS]
|
||||
> sb[SEQ_SET_PARAMS_UPLOAD_WELDING_LIST_SEQ] > sb[SEQ_DO_ID_UPLOAD_WELDING_LIST_SEQ] > sb[SEQ_GET_RESULT_UPLOAD_WELDING_LIST_SEQ]
|
||||
> sb[SEQ_DO_COMPONENT_WELDING] > sb[SEQ_CHECK_END_LIST]);
|
||||
sb.Flows(sb[SEQ_CHECK_END_LIST] > sb[SEQ_END_WELDING] > sb[SEQ_SET_BLOW_OFF]
|
||||
> sb[SEQ_SAVE_RESULT_DATA] > sb[SEQ_COMPLETE] > sb.Final);
|
||||
|
||||
sb.OnStopped(OnStopped);
|
||||
sb.OnForceError(OnForceError);
|
||||
@ -152,123 +184,23 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
|
||||
private SequenceActionResult Sequence_Enter(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
Log.I("===== SeqTeachingRun Sequence_Enter 진입 ====="); // 임시 추가
|
||||
Log.I("SeqTeachingRun Start");
|
||||
|
||||
_InitParam = param.Param as SeqTeachingRun_InitParam;
|
||||
_SystemParameter = context.Settings[CommonSettingIds.SystemParameter] as SystemParameter;
|
||||
_SequenceSetting = context.Settings[CommonSettingIds.Sequence] as SequenceSetting;
|
||||
|
||||
_Scanner = context.Devices[DeviceIds.Scanner] as Scanner;
|
||||
if (_Scanner == null) { MessageUtil.ShowErrorToast("Scanner not Ready", Log); return null; }
|
||||
|
||||
_ACS = context.Devices[DeviceIds.ACS] as ScannerACS;
|
||||
if (_ACS == null) { MessageUtil.ShowErrorToast("ACS not Ready", Log); return null; }
|
||||
|
||||
_AxisX = context.Devices[CommonDeviceIds.AxisX2] as ACSMotor;
|
||||
if (_AxisX == null) { MessageUtil.ShowErrorToast("AxisX not Ready", Log); return null; }
|
||||
|
||||
_AxisZ = context.Devices[CommonDeviceIds.AxisZ] as ACSMotor;
|
||||
if (_AxisZ == null) { MessageUtil.ShowErrorToast("AxisZ not Ready", Log); return null; }
|
||||
|
||||
//Check Device
|
||||
if (!CheckDeviceReady(context)) {
|
||||
AlarmManager.Alarm(AlarmCode.ALARM_SEQUENCE_TeachingRun_DeviceNotReady);
|
||||
Log.E("The devices are not active.");
|
||||
return null;
|
||||
}
|
||||
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
private bool CheckDeviceReady(SequenceContext context)
|
||||
{
|
||||
List<string> deviceListToCheck = new List<string>() { DeviceIds.ACS, CommonDeviceIds.Scanner, CommonDeviceIds.AxisX2, CommonDeviceIds.AxisZ };
|
||||
//List<string> deviceListToCheck = new List<string>() { CommonDeviceIds.Scanner, CommonDeviceIds.IODevice,DeviceIds.ACS }; 변수 맵 수신 후 ACS 주석 해제 위에 주석 처리
|
||||
bool isAllDeviceActivated = true;
|
||||
foreach (string item in deviceListToCheck) {
|
||||
if (!context.Devices[item].IsActivated) {
|
||||
isAllDeviceActivated = isAllDeviceActivated && false;
|
||||
}
|
||||
}
|
||||
|
||||
return isAllDeviceActivated;
|
||||
}
|
||||
|
||||
private SequenceActionResult CheckInitCondition(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
bool boolian = AlarmManager.HasAlarmLevelHigh();
|
||||
if (boolian) {
|
||||
Log.E($"Clear Heavy Alarms For Welding!");
|
||||
MessageUtil.ShowWarningToast(string.Format("Clear Heavy Alarms For Welding!"));
|
||||
return null;
|
||||
}
|
||||
|
||||
_ScannerSaveLogTime = TimeSpan.Zero;
|
||||
|
||||
var startTime = DateTime.Now;
|
||||
context.PutValue(ContextKey.KEY_SEQUENCE_START_TIME, startTime);
|
||||
|
||||
Log.D("ComponentTeachingRun Sequence CheckInitCondition");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
#region 26.04.08 NDY
|
||||
private SequenceActionResult SetStandbyMotion(SequenceContext context, string id, SequenceActionResult param)
|
||||
private SequenceActionResult EncoderReset(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
if (_AxisX == null) {
|
||||
Log.W("[MoveStageToOrigin] AxisX2 null - 스킵");
|
||||
if (_ACS == null)
|
||||
{
|
||||
Log.W("[EncoderReset] ACS null - 스킵");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
Log.I("[MoveStageToOrigin] Stage X → 0 이동 시작");
|
||||
|
||||
// (스캐너의 0,0 && 용접 대상의 시작 위치) >> X축을 이동
|
||||
_AxisX.SetTargetPos(0, TargetPosType.ABS);
|
||||
_AxisX.SetMoveVelocityImm(AuroraACS.Speed.M);
|
||||
_AxisX.AccelerationImm(AuroraACS.Speed.M);
|
||||
_AxisX.DecelerationImm(AuroraACS.Speed.M);
|
||||
_AxisX.JerkImm(AuroraACS.Speed.M);
|
||||
_AxisX.Move();
|
||||
|
||||
// Laser FocusPosition Move
|
||||
_AxisZ.SetTargetPos(0, TargetPosType.ABS);
|
||||
_AxisZ.SetMoveVelocityImm(AuroraACS.Speed.M);
|
||||
_AxisZ.AccelerationImm(AuroraACS.Speed.M);
|
||||
_AxisZ.DecelerationImm(AuroraACS.Speed.M);
|
||||
_AxisZ.JerkImm(AuroraACS.Speed.M);
|
||||
_AxisZ.Move();
|
||||
|
||||
var res = context.RetryUntilSuccess(
|
||||
() => _AxisX.IsReachedTargetPosition(0) && _AxisZ.IsReachedTargetPosition(0),
|
||||
30 * 1000, 20, true);
|
||||
|
||||
if (res == E2.TIMEOUT) { Log.E("[MoveStageToOrigin] TIMEOUT"); return null; }
|
||||
else if (res == E2.CANCELLED) { Log.E("[MoveStageToOrigin] CANCELLED"); return null; }
|
||||
|
||||
Log.I("[MoveStageToOrigin] Stage X = 0 도달 완료");
|
||||
return SequenceAction.Ok();
|
||||
|
||||
}
|
||||
private SequenceActionResult SetStandbyScanner(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
// Scanner Default Setting
|
||||
var mainPage = CommonHelper.GetMainPage();
|
||||
_ScannerCanvasUserCtrl = mainPage.ScannerCanvasCtrlTeaching;
|
||||
_WeldingScannerListNo = eListNo.LIST1;
|
||||
_SelectedObjectList = FindObjects();
|
||||
//Vision Correction File 선택
|
||||
_Scanner.SelectCorrectionTable(2);
|
||||
|
||||
if (!_Scanner.Config.UseMarkingOnTheFly) {
|
||||
if (!_Scanner.Config.UseMarkingOnTheFly)
|
||||
{
|
||||
Log.W("[EncoderReset] MOTF 비활성화 - 스킵");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
Log.I("[EncoderReset] 시작");
|
||||
|
||||
// SeqUploadWeldingList.MarkingOnTheFlyOn 패턴
|
||||
_Scanner.SetFlyX(_Scanner.Config.MarkingOnTheFlyEncoderResolutionX);
|
||||
Log.I($"[EncoderReset] SetFlyX: {_Scanner.Config.MarkingOnTheFlyEncoderResolutionX}");
|
||||
@ -282,36 +214,399 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
Log.I("[EncoderReset] 완료 - Stage(0) = Scanner(0) 동기화");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
//SeqTeachingPosMoveStageA패턴 참고 - 기존 GUN 프로젝트 시퀸스
|
||||
//SeqTeachingPosMoveStageA패턴 참고 - 기존 GUN 프로젝트 시퀸스
|
||||
private SequenceActionResult MoveStageToOrigin(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
if (_AxisX == null)
|
||||
{
|
||||
Log.W("[MoveStageToOrigin] AxisX2 null - 스킵");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
Log.I("[MoveStageToOrigin] Stage X → 0 이동 시작");
|
||||
|
||||
// SeqTeachingPosMoveStageA.MoveXYStage 패턴
|
||||
_AxisX.SetTargetPos(0, TargetPosType.ABS);
|
||||
_AxisX.SetMoveVelocityImm(AuroraACS.Speed.M);
|
||||
_AxisX.AccelerationImm(AuroraACS.Speed.M);
|
||||
_AxisX.DecelerationImm(AuroraACS.Speed.M);
|
||||
_AxisX.JerkImm(AuroraACS.Speed.M);
|
||||
_AxisX.Move();
|
||||
|
||||
var res = context.RetryUntilSuccess(
|
||||
() => _AxisX.IsReachedTargetPosition(0),
|
||||
30 * 1000, 20, true);
|
||||
|
||||
if (res == E2.TIMEOUT) { Log.E("[MoveStageToOrigin] TIMEOUT"); return null; }
|
||||
if (res == E2.CANCELLED) { Log.E("[MoveStageToOrigin] CANCELLED"); return null; }
|
||||
|
||||
Log.I("[MoveStageToOrigin] Stage X = 0 도달 완료");
|
||||
return SequenceAction.Ok();
|
||||
|
||||
}
|
||||
#endregion
|
||||
private SequenceActionResult Sequence_Enter(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
Log.I("===== SeqTeachingRun Sequence_Enter 진입 ====="); // 임시 추가
|
||||
Log.I("SeqTeachingRun Start");
|
||||
|
||||
_InitParam = param.Param as SeqTeachingRun_InitParam;
|
||||
_SystemParameter = context.GetSetting<SystemParameter>(CommonSettingIds.SystemParameter);
|
||||
|
||||
//_Laser = context.GetLaser();
|
||||
//_Laser.GetLaserDevice(ref _LaserDevice);
|
||||
//_LaserTruFiber = _LaserDevice as LaserTruFiber;
|
||||
|
||||
//if (_plc == null)
|
||||
// _plc = context.Devices[DeviceIds.PLCDevice] as PLCControllerPrismaticScanner;
|
||||
|
||||
// Laser 시퀀스 Running. 안 넣어줘도 됨.
|
||||
//_LaserTruFiber.SetIsSeqRunning(true);
|
||||
|
||||
_LaserPowerCalParam = context.GetSetting<LaserPowerCalParam>(CommonSettingIds.LaserPowerCalParam);//우선 AuroraRecipe로 상속받아서 함수 사용하도록 함
|
||||
//laserPowerCalParam 초기화(CSV 파일 불러오기)
|
||||
_LaserPowerCalParam.Initialize(_LaserPowerCalParam.PowerCalibrationCenterBeamCSVFile, _LaserPowerCalParam.PowerCalibrationRingBeamCSVFile);
|
||||
|
||||
_SequenceSetting = context.Settings[CommonSettingIds.Sequence] as SequenceSetting;
|
||||
InitDev(context);
|
||||
if (!CheckDeviceReady(context))
|
||||
{ //Check Device
|
||||
AlarmManager.Alarm(AlarmCode.ALARM_SEQUENCE_TeachingRun_DeviceNotReady);
|
||||
Log.E("The devices are not active.");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (InitSequenceVariable(context) == false)
|
||||
{
|
||||
AlarmManager.Alarm(AlarmCode.ALARM_SEQUENCE_TeachingRun_InitVariableError);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
private void InitDev(SequenceContext context)
|
||||
{
|
||||
//Device Init
|
||||
_Scanner = context.GetLaserScanner();
|
||||
//_IO = context.Devices[CommonDeviceIds.IODevice] as PAIX_PrismaticScanner;
|
||||
|
||||
// 26.04.06 NDY 추가: ACS 디바이스 취득 (null-safe)
|
||||
// 변수 맵 수신 후 MOTFStart() 호출에 사용
|
||||
// 변경 전
|
||||
//try { _ACS = context.Devices[DeviceIds.ACS] as ScannerACS; }
|
||||
// 변경 후
|
||||
try { _ACS = context.Devices[DeviceIds.ACS] as IScannerACS; }
|
||||
catch { _ACS = null; Log.W("ACS 디바이스 취득 실패 (null 처리)"); }
|
||||
|
||||
//26.04.08 NDY 추가 _AxisX 가져오기
|
||||
try { _AxisX = context.Devices[CommonDeviceIds.AxisX2] as ACSMotor; }
|
||||
catch { _AxisX = null; Log.W("AxisX2 취득 실패"); }
|
||||
}
|
||||
private bool CheckDeviceReady(SequenceContext context)
|
||||
{
|
||||
//List<string> deviceListToCheck = new List<string>() { CommonDeviceIds.Scanner, CommonDeviceIds.IODevice }; // 26.04.15 주석처리 아래 로 테스트
|
||||
List<string> deviceListToCheck = new List<string>() { CommonDeviceIds.Scanner };
|
||||
//List<string> deviceListToCheck = new List<string>() { CommonDeviceIds.Scanner, CommonDeviceIds.IODevice,DeviceIds.ACS }; 변수 맵 수신 후 ACS 주석 해제 위에 주석 처리
|
||||
bool isAllDeviceActivated = true;
|
||||
foreach (string item in deviceListToCheck)
|
||||
{
|
||||
if (!context.Devices[item].IsActivated)
|
||||
{
|
||||
isAllDeviceActivated = isAllDeviceActivated && false;
|
||||
}
|
||||
}
|
||||
|
||||
return isAllDeviceActivated;
|
||||
}
|
||||
private bool InitSequenceVariable(SequenceContext context)
|
||||
{
|
||||
var mainPage = CommonHelper.GetMainPage();
|
||||
_ScannerCanvasUserCtrl = mainPage.ScannerCanvasCtrlTeaching;
|
||||
|
||||
_WeldingScannerListNo = eListNo.LIST1;
|
||||
|
||||
_SelectedObjectList = FindObjects();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<IDrawObject> FindObjects()
|
||||
{
|
||||
if (_InitParam.IsUseExternalObjects) {
|
||||
if (_InitParam.IsUseExternalObjects)
|
||||
{
|
||||
return _InitParam.ExternalObjects;
|
||||
} else if (_InitParam.IsObjectSelectAll) {
|
||||
}
|
||||
else if (_InitParam.IsObjectSelectAll)
|
||||
{
|
||||
return _ScannerCanvasUserCtrl.Model.ActiveLayer.Objects;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return _ScannerCanvasUserCtrl.Canvas.Model.SelectedObjects;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private SequenceActionResult CheckInitCondition(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
if (!CheckCondition())
|
||||
{
|
||||
AlarmManager.Alarm(AlarmCode.ALARM_SEQUENCE_TeachingRun_CheckInitCondition);
|
||||
Log.E("Condition is not in state to start sequence.");
|
||||
context.PutValue(ContextKey.KEY_SEQUENCE_RESULT, false);
|
||||
return null;
|
||||
}
|
||||
|
||||
_CurrentobjectIndex = 0;
|
||||
_BeforeObjectIndex = 0;
|
||||
_CountWeldingObject = 0;
|
||||
_BeforeParameterNo = -1;
|
||||
_BeforeProgramNo = -1;
|
||||
_ScannerSaveLogTime = TimeSpan.Zero;
|
||||
|
||||
_FlattenRecipes = new List<IDrawObject>(); // 레시피 초기화
|
||||
UnpackRecipes(_SelectedObjectList);
|
||||
var startTime = DateTime.Now;
|
||||
context.PutValue(ContextKey.KEY_SEQUENCE_START_TIME, startTime);
|
||||
|
||||
Log.D("ComponentTeachingRun Sequence CheckInitCondition");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
private bool CheckCondition()
|
||||
{
|
||||
if (CheckCondition_Interlock())
|
||||
{
|
||||
if (InitializeDeviceStatus())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool CheckCondition_Interlock()
|
||||
{
|
||||
//// PLC, Data, IO 등 Interlock checking
|
||||
bool boolian = AlarmManager.HasAlarmLevelHigh();
|
||||
if (boolian)
|
||||
{
|
||||
Log.E($"Clear Heavy Alarms For Welding!");
|
||||
MessageUtil.ShowWarningToast(string.Format("Clear Heavy Alarms For Welding!"));
|
||||
return false;
|
||||
}
|
||||
boolian = AlarmManager.IsPlcDoorOpen();
|
||||
if (boolian)
|
||||
{
|
||||
Log.E($"PLC Door Opened!! Can't Weld Now.");
|
||||
MessageUtil.ShowWarningToast(string.Format("Close Door ! Clear PLC DoorInterlock!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
boolian = AlarmManager.IsPlcEmoAlarm();
|
||||
if (boolian)
|
||||
{
|
||||
Log.E($"PLC EMO Pushed!! Can't Weld Now.");
|
||||
MessageUtil.ShowWarningToast(string.Format("Clear PLC EMO Status!"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool InitializeDeviceStatus()
|
||||
{
|
||||
//Vision Correction File 선택
|
||||
_Scanner.SelectCorrectionTable(2);
|
||||
return true;
|
||||
}
|
||||
|
||||
private SequenceActionResult SetBlowOn(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
if (_InitParam.UseBlow == false)
|
||||
{
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
int intervalTime = _InitParam.IntervalTimeBlowOn;
|
||||
//_IO._iOUnit.WriteDoBit(Convert.ToInt32(ePDOAddress.SeamWeldingN2BlowSol), true);
|
||||
Thread.Sleep(intervalTime);
|
||||
|
||||
Log.D(string.Format($"[ComponentTeachingRun] Blow ON Complete"));
|
||||
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private void SaveScannerRecordFileForamt()
|
||||
{
|
||||
if (_Scanner.Config.UseRecordSignal)
|
||||
{
|
||||
DateTime startTime = DateTime.Now;
|
||||
_Scanner.SaveStackRecord("Normal");
|
||||
_ScannerSaveLogTime += DateTime.Now.Subtract(startTime);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
private SequenceActionResult StartWelding(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
Log.D(string.Format($"[ComponentTeachingRun] Start Component Welding"));
|
||||
_SequenceCompleteTime = DateTime.Now;
|
||||
// Laser 판넬 On
|
||||
//_IO.WriteDoBit(PAIX_PrismaticScanner.ePrismaticDOAddress.CCCAPLaserOnLampOn, true);
|
||||
|
||||
_DivideObjectsQueue = SplitBySerialize(_FlattenRecipes);
|
||||
Log.I($"Divided DrawObjects List Count[{_DivideObjectsQueue.Count}]");
|
||||
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
// 펼쳐진 객체(_FlattenRecipes)를 여러개의 스캔 파라미터에 따라 여러개로 나눈다
|
||||
public static Queue<List<IDrawObject>> SplitBySerialize(List<IDrawObject> source)
|
||||
{
|
||||
var result = new Queue<List<IDrawObject>>();
|
||||
if (source == null || source.Count == 0)
|
||||
return result;
|
||||
|
||||
List<IDrawObject> current = null;
|
||||
int? currentId = null;
|
||||
|
||||
foreach (var item in source)
|
||||
{
|
||||
if (current == null || currentId.Value != item.ScannerParamID)
|
||||
{
|
||||
current = new List<IDrawObject>();
|
||||
result.Enqueue(current);
|
||||
currentId = item.ScannerParamID;
|
||||
}
|
||||
|
||||
current.Add(item);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private string CheckEndList(SequenceContext context, string id, ICollection<string> branches, SequenceActionResult param)
|
||||
{
|
||||
if (_DivideObjectsQueue.Count == 0)
|
||||
return SEQ_END_WELDING;
|
||||
|
||||
// 파일 저장 변수 초기화
|
||||
if (_Scanner.Config.UseRecordSignal)
|
||||
{
|
||||
DateTime startTime = DateTime.Now;
|
||||
_Scanner.InitializeRecord();
|
||||
_ScannerSaveLogTime += DateTime.Now.Subtract(startTime);
|
||||
}
|
||||
|
||||
return SEQ_UPDATE_COMPONENT_WELDING_PARAMETERS;
|
||||
|
||||
}
|
||||
|
||||
private SequenceActionResult UpdateComponentWeldingParameters(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
_partialWeldingStartTime = DateTime.Now;
|
||||
//var currentDivideObject = _DivideObjectsQueue.Peek();
|
||||
//int paramIndex = currentDivideObject[0].ScannerParamID - 1;
|
||||
//Log.I($"Remain Divided DrawObjects Count[{currentDivideObject.Count}] / ParameterNo[{paramIndex + 1}]");
|
||||
|
||||
//int SlotNo = _plc.ReadWord(eWordInput.PLC_CURRENT_SLOT_NO).data;
|
||||
//if (SlotNo <= 0)
|
||||
// SlotNo = 1;
|
||||
//// 결과 Data 를 업데이트 함.
|
||||
//var power = Status.GetProcessingWeldingData().UploadProcessDatas.Where(data => data.DataName == $"Power_{SlotNo}_{_SequenceSetting.LastPageNo}").FirstOrDefault();
|
||||
|
||||
//#region 26.04.08 NDY 캘리브레이션 노드 추가 테스트를 위해서 잠시 예외처리 코드 추가
|
||||
//if (power != null)
|
||||
// power.Value = ScannerCanvasUserCtrl.ScannerParams[paramIndex].LaserPower1
|
||||
// + ScannerCanvasUserCtrl.ScannerParams[paramIndex].LaserPower2;
|
||||
//#endregion
|
||||
//// 26.04.08 NDY 주석처리 - power null 예외 방지 (위 null 체크로 대체)
|
||||
////power.Value = ScannerCanvasUserCtrl.ScannerParams[paramIndex].LaserPower1 + ScannerCanvasUserCtrl.ScannerParams[paramIndex].LaserPower2;
|
||||
|
||||
|
||||
//var velocity = Status.GetProcessingWeldingData().UploadProcessDatas.Where(data => data.DataName == $"Velocity_{SlotNo}_{_SequenceSetting.LastPageNo}").FirstOrDefault();
|
||||
//#region 26.04.08 NDY velocity null에 대한 예외 처리
|
||||
//if (velocity != null)
|
||||
// velocity.Value = ScannerCanvasUserCtrl.ScannerParams[paramIndex].MarkSpeed;
|
||||
//#endregion
|
||||
//// 26.04.08 NDY 주석처리 - velocity null 예외 방지 (위 null 체크로 대체)
|
||||
////velocity.Value = ScannerCanvasUserCtrl.ScannerParams[paramIndex].MarkSpeed;
|
||||
|
||||
|
||||
//// 26.04.08 NDY - FDC 데이터 상신 -기존 코드 주석처리
|
||||
////_plc.UploadReportDatas(Status.GetProcessingWeldingData().UploadProcessDatas);
|
||||
//// 26.04.08 NDY - FDC 상신도 데이터 있을 때만 - 테스트 목적 예외 처리 추가
|
||||
//if (Status.GetProcessingWeldingData().UploadProcessDatas.Count > 0)
|
||||
// _plc.UploadReportDatas(Status.GetProcessingWeldingData().UploadProcessDatas);
|
||||
|
||||
//_CenterBeamPower = (int)ScannerCanvasUserCtrl.ScannerParams[paramIndex].LaserPower1;
|
||||
//_RingBeamPower = (int)ScannerCanvasUserCtrl.ScannerParams[paramIndex].LaserPower2;
|
||||
//_CenterRingRatio = 0;
|
||||
|
||||
//if (_CenterBeamPower == 0 && _RingBeamPower == 0)
|
||||
// _CenterRingRatio = 100;
|
||||
//else
|
||||
// _CenterRingRatio = (int)Math.Round((double)(100 * _CenterBeamPower) / (double)(_CenterBeamPower + _RingBeamPower), 0); // Discrete 한 값이라서 Ring은 오차 발생
|
||||
|
||||
////if (_Laser.Config.TruFiberType == eTruFiberType.TruFiberP)
|
||||
////{
|
||||
// _CenterBeamPower = _LaserPowerCalParam.CalibrateWattToWatt(_CenterBeamPower, (uint)LaserPowerCalParam.beamMode.Center);
|
||||
// _RingBeamPower = _LaserPowerCalParam.CalibrateWattToWatt(_RingBeamPower, (uint)LaserPowerCalParam.beamMode.Ring);
|
||||
////}
|
||||
//// Ready 상태 변경 확인(Complete 상태에서 Laser Ready로 변환되기까지 시간이 걸림)
|
||||
//// 여기서는 왜 IW03과 Center를 비교하는 것인지.... 아직 값을 써주지 않았으므로 레이저 출사 가능 여부만 확인하면 되지 않을까.
|
||||
//var res = context.RetryUntilSuccess(_Laser.GetLaserReady, timeoutSeconds * 1000, 1);
|
||||
|
||||
//if (res == E2.TIMEOUT)
|
||||
//{
|
||||
// Log.E(string.Format($"[Page Change Req] Laser Program Ready Timeout When LaserReady"));
|
||||
// return null;
|
||||
//}
|
||||
//Log.D(string.Format($"[Page Change Req] Laser Program Ready OK"));
|
||||
|
||||
//// Laser Program Parameters 설정(Laser Ready 상태는 용접 직전에 확인)
|
||||
//List<(int, int, bool)> datas = new List<(int, int, bool)>();
|
||||
//datas.Add((csWriteNodeNo.IW03, _CenterBeamPower, true));
|
||||
//datas.Add((csWriteNodeNo.IW04, _RingBeamPower, true));
|
||||
//datas.Add((csWriteNodeNo.IW05, _CenterRingRatio, true));
|
||||
|
||||
//// 업데이트 될 경우, 프로그램 전환을 위한 프로그램 종료 시퀸스 진행됨.
|
||||
//if (_LaserTruFiber.UpdatesDatasIfChanged(datas))
|
||||
//{
|
||||
|
||||
// // 프로그램이 종료 될 때까지 대기.
|
||||
// res = context.RetryUntilSuccess(_LaserTruFiber.GetProgramCompleted, timeoutSeconds * 1000, 10);
|
||||
|
||||
// if (res == E2.TIMEOUT)
|
||||
// {
|
||||
// Log.E(string.Format($"[Page Change Req] Laser Program Completed Timeout When Parameter Changes"));
|
||||
// return null;
|
||||
// }
|
||||
// Log.D(string.Format($"[Page Change Req] Laser Program Completed OK When Data Updated"));
|
||||
//}
|
||||
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
private SequenceActionResult SetUploadWeldingList_SeqParams(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
Status.SetWorkingPosition(eWorkingPosition.UPLOADING_WELD_LIST);
|
||||
|
||||
// TeachingRun에는 용접 시퀀스만 정의해서 Auto Run에서도 사용하므로 Offset 넣어줘야 함
|
||||
SeqUploadWeldingList_InitParam seqParams = new SeqUploadWeldingList_InitParam() {
|
||||
SeqUploadWeldingList_InitParam seqParams = new SeqUploadWeldingList_InitParam()
|
||||
{
|
||||
NeedSetLaserTiming = _InitParam.NeedSetLaserTiming,
|
||||
IncludeListStartEnd = true,
|
||||
CellMeasureCenterOffsetX = _SystemParameter.CellPosMeasureCenterOffsetX + _InitParam.CellCenterOffsetX,
|
||||
CellMeasureCenterOffsetY = _SystemParameter.CellPosMeasureCenterOffsetY + _InitParam.CellCenterOffsetY,
|
||||
SelectedDrawObjectList = _SelectedObjectList,
|
||||
SelectedDrawObjectList = _DivideObjectsQueue.Peek(),
|
||||
WeldingScannerListNo = _WeldingScannerListNo,
|
||||
};
|
||||
|
||||
var _PageNo = _SequenceSetting.LastPageNo;
|
||||
|
||||
Log.W($"page {_PageNo}({Status.GetProcessingWeldingData().CellId}) : Cell Offset Value Check ; X : {_SystemParameter.CellPosMeasureCenterOffsetX} + {_InitParam.CellCenterOffsetX} ; Y : {_SystemParameter.CellPosMeasureCenterOffsetY} + {_InitParam.CellCenterOffsetY}");
|
||||
|
||||
Log.D(string.Format($"[ComponentTeachingRun] Set UploadWelindList Seq Param"));
|
||||
|
||||
return SequenceAction.Ok(seqParams);
|
||||
}
|
||||
|
||||
@ -320,7 +615,8 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
Log.D(string.Format($"[ComponentTeachingRun] Get UploadWelindList Seq Param"));
|
||||
|
||||
var resultOutParam = param.Param as SeqUploadWeldingList_OutParam;
|
||||
if (resultOutParam.Success == false) {
|
||||
if (resultOutParam.Success == false)
|
||||
{
|
||||
Log.E(string.Format($"[ComponentTeachingRun] Failed UploadWeldingList Sequence"));
|
||||
return null;
|
||||
}
|
||||
@ -331,7 +627,33 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
|
||||
private SequenceActionResult DoComponentWelding(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
Log.I("ExecuteList Start");
|
||||
_DivideObjectsQueue.Dequeue();
|
||||
Log.I("UploadWeldingList Complete");
|
||||
Log.D(string.Format($"[ComponentTeachingRun] Component Welding Start idx :({_BeforeObjectIndex} ~ {_BeforeObjectIndex + _CountWeldingObject - 1})"));
|
||||
|
||||
#region PSTART_DYN 사용시 참고
|
||||
//// PSTART_DYN에서는 레이저가 활성화되었는지 확인하여야 함. 하지만, PSTART_STATICALLY에서는 굳이 확인할 필요 없음. (이전에 확인해줄 것이므로)
|
||||
// var res = context.RetryUntilSuccess(_LaserTruFiber.GetProgramActive, timeoutSeconds * 1000, 1);
|
||||
//if (res == E2.TIMEOUT)
|
||||
//{
|
||||
// Log.E(string.Format($"[ComponentTeachingRun] Laser Program Active Timeout"));
|
||||
// return null;
|
||||
//}
|
||||
#endregion
|
||||
|
||||
//Log.D(string.Format($"[ComponentTeachingRun] Check LaserReadyResponse"));
|
||||
//// 만일 프로그램이 정상적으로 종료 및 변경 원할 경우, 레이저 스레드에서 Ready 상태로 만들어주고 있을 것임.
|
||||
//// Ready 상태 변경 확인
|
||||
//var res = context.RetryUntilSuccess(LaserReadyResponse, timeoutSeconds * 1000, 10);
|
||||
//if (res == E2.TIMEOUT)
|
||||
//{
|
||||
// Log.E(string.Format($"[ComponentTeachingRun] Laser Program Ready Timeout When LaserReadyResponse"));
|
||||
// return null;
|
||||
//}
|
||||
//Log.D(string.Format($"[ComponentTeachingRun] Laser Program Ready OK When ReadyResponse"));
|
||||
|
||||
//Status.SetWorkingPosition(eWorkingPosition.EXECUTING_WELD);
|
||||
|
||||
Log.I($"Welding List Space : {_Scanner.GetListSpace()}");
|
||||
DateTime weldingTime = DateTime.Now;
|
||||
_Scanner.ExecuteList(_WeldingScannerListNo);
|
||||
@ -346,14 +668,32 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
|
||||
|
||||
|
||||
_Scanner.WaitForListTaskCompleted(_SystemParameter.WeldLinesTaskTimeOut);
|
||||
|
||||
// ── 26.04.06 NDY 추가: ACS 완료 대기 ─────────────────
|
||||
// TODO: 변수 맵 수신 후 활성화
|
||||
// while (!_ACS.CheckMOTFComp()) { Thread.Sleep(10); }
|
||||
// ────────────────────────────────────────────────────
|
||||
|
||||
_MeasurementSpanTime = DateTime.Now.Subtract(weldingTime);
|
||||
Log.D(string.Format($"[ComponentTeachingRun] Component Welding Complete Time : {_MeasurementSpanTime.TotalMilliseconds}"));
|
||||
|
||||
if (_Scanner.Config.UseRecordSignal) {
|
||||
#region PSTART_DYN 사용시 참고
|
||||
//// 굳이 확인할 필요가 없을 듯 함.PSTAT_STATICALLY 활용시.
|
||||
//res = context.RetryUntilSuccess(_LaserTruFiber.GetProgramCompleted, timeoutSeconds * 1000, 1);
|
||||
|
||||
//if (res == E2.TIMEOUT)
|
||||
//{
|
||||
// Log.E(string.Format($"[ComponentTeachingRun] Laser Program Complete Timeout"));
|
||||
// return null;
|
||||
//}
|
||||
#endregion
|
||||
|
||||
Log.D(string.Format($"[ComponentTeachingRun] Laser Program Complete OK"));
|
||||
|
||||
|
||||
if (_Scanner.Config.UseRecordSignal)
|
||||
{
|
||||
DateTime startTime = DateTime.Now;
|
||||
_Scanner.StackRecord();
|
||||
_ScannerSaveLogTime += DateTime.Now.Subtract(startTime);
|
||||
@ -368,35 +708,17 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
|
||||
_ScannerCanvasUserCtrl.TimeLabelUpdate(_MeasurementSpanTime.TotalMilliseconds, PartialTactTime.TotalMilliseconds);
|
||||
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private SequenceActionResult SetMotion(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
// 메뉴얼 화면에서 셋팅이 필요해보임
|
||||
_ACS.SetMOTFParams(0, 0, 0, 0, 0);
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private SequenceActionResult StartMotion(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
_ACS.MOTFStart();
|
||||
// 모션 동작시키고 바로 확인하면 그냥 빠져나올 것 같음
|
||||
var res = context.Wait(1000, 100);
|
||||
if (res == E2.TIMEOUT) ;
|
||||
else if (res == E2.CANCELLED) { Log.E("[MOTF] Motion CANCELLED"); return null; }
|
||||
|
||||
res = context.RetryUntilSuccess(() => _ACS.CheckMOTFComp(), 1000 * 20, 100, true);
|
||||
if (res == E2.TIMEOUT) { Log.E("[MOTF] Motion TIMEOUT"); return null; }
|
||||
else if (res == E2.CANCELLED) { Log.E("[MOTF] Motion CANCELLED"); return null; }
|
||||
//// 용접 끝난 후, 초기화 시킴
|
||||
//var UploadDatas = Status.GetProcessingWeldingData().UploadProcessDatas;
|
||||
//foreach (var data in UploadDatas)
|
||||
// data.Clear();
|
||||
//_plc.UploadReportDatas(UploadDatas);
|
||||
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private SequenceActionResult EndWelding(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
_Scanner.WaitForListTaskCompleted(_SystemParameter.WeldLinesTaskTimeOut);
|
||||
Log.I("ExecuteList Complete");
|
||||
|
||||
_MeasurementSpanTime = DateTime.Now.Subtract(_SequenceCompleteTime);
|
||||
Log.D(string.Format($"[TactTime] Complete All Component Weld : {_MeasurementSpanTime.TotalMilliseconds}"));
|
||||
|
||||
@ -406,6 +728,9 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, 0, eFunctionType.COMMAND);
|
||||
_Scanner.JumpAbs(0, 0, eFunctionType.COMMAND);
|
||||
|
||||
// Laser 판넬 Off
|
||||
//_IO.WriteDoBit(PAIX_PrismaticScanner.ePrismaticDOAddress.CCCAPLaserOnLampOn, false);
|
||||
|
||||
var mesurementTime = DateTime.Now;
|
||||
|
||||
//용접 완료 후 CorrectionFile Vision으로 원복
|
||||
@ -417,12 +742,36 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private SequenceActionResult SetBlowOff(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
if (_InitParam.UseBlow == false)
|
||||
{
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
int intervalTime = _InitParam.IntervalTimeBlowOff;
|
||||
Thread.Sleep(intervalTime);
|
||||
|
||||
//_IO._iOUnit.WriteDoBit(Convert.ToInt32(ePDOAddress.SeamWeldingN2BlowSol), false);
|
||||
|
||||
Log.D(string.Format($"[ComponentTeachingRun] Blow OFF Complete"));
|
||||
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private SequenceActionResult SaveResultData(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
context.PutValue(ContextKey.KEY_SEQUENCE_RESULT, true);
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private SequenceActionResult Complete(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
context.TryGetValue(ContextKey.KEY_SEQUENCE_RESULT, out bool seqResult);
|
||||
SeqTeachingRun_OutParam result = new SeqTeachingRun_OutParam() { Success = seqResult };
|
||||
|
||||
if (seqResult == false) {
|
||||
if (seqResult == false)
|
||||
{
|
||||
AlarmManager.Alarm(AlarmCode.ALARM_SEQUENCE_TeachingRun_ResultFailed);
|
||||
}
|
||||
|
||||
@ -430,15 +779,28 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
return SequenceAction.Ok(result);
|
||||
}
|
||||
|
||||
private void SaveScannerRecordFileForamt()
|
||||
private static void UnpackRecipes(List<IDrawObject> recipes)
|
||||
{
|
||||
if (_Scanner.Config.UseRecordSignal) {
|
||||
DateTime startTime = DateTime.Now;
|
||||
_Scanner.SaveStackRecord("Normal");
|
||||
_ScannerSaveLogTime += DateTime.Now.Subtract(startTime);
|
||||
// Recipe를 재귀적으로 탐색해서 List로 재구성하는 함수
|
||||
if (recipes == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < recipes.Count; i++)
|
||||
{
|
||||
if (recipes[i] is Group)
|
||||
{
|
||||
Group subGroup = recipes[i] as Group;
|
||||
List<IDrawObject> subrecipes = subGroup.SubObjects as List<IDrawObject>;
|
||||
UnpackRecipes(subrecipes);
|
||||
}
|
||||
else
|
||||
{
|
||||
_FlattenRecipes.Add(recipes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnForceError(SequenceContext context, string arg2)
|
||||
{
|
||||
// Scanner Log 저장
|
||||
@ -451,6 +813,9 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, 0, eFunctionType.COMMAND);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, 0, eFunctionType.COMMAND);
|
||||
|
||||
// TruFiber레이저 Ready로 변경
|
||||
ForceLaserReady();
|
||||
|
||||
//Scanner 원점 복귀
|
||||
// 복귀 시 Scanner Busy 상태일 수 있으므로 진행중인 작업이 끝날 때까지 대기
|
||||
Thread.Sleep(10);
|
||||
@ -472,15 +837,41 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, 0, eFunctionType.COMMAND);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, 0, eFunctionType.COMMAND);
|
||||
|
||||
// TruFiber레이저 Ready로 변경
|
||||
ForceLaserReady();
|
||||
|
||||
//Scanner 원점 복귀
|
||||
// 복귀 시 Scanner Busy 상태일 수 있으므로 진행중인 작업이 끝날 때까지 대기
|
||||
Thread.Sleep(10);
|
||||
_Scanner.JumpAbs(0, 0, eFunctionType.COMMAND);
|
||||
Thread.Sleep(10);
|
||||
|
||||
// Laser 판넬 Off
|
||||
//_IO.WriteDoBit(PAIX_PrismaticScanner.ePrismaticDOAddress.CCCAPLaserOnLampOn, false);
|
||||
|
||||
Log.I("SequenceAction Ok : OnStopped");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ForceLaserReady()
|
||||
{
|
||||
// 트럼프 레이저에서 PStartDyn, Prog_Stop을 감시하여 강제로 Ready 상태로 만드는 함수
|
||||
if (_Laser.IsSimul)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//// PSTART_STATICAL 에서는 필요 없어보임.
|
||||
//_LaserTruFiber.SetProgEnd();
|
||||
|
||||
// Laser 판넬 Off
|
||||
//_IO.WriteDoBit(PAIX_PrismaticScanner.ePrismaticDOAddress.CCCAPLaserOnLampOn, false);
|
||||
|
||||
Log.I("SequenceAction Ok : Set Laser Ready");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO: UseStream 으로 TeachingRun 을 할 필요가 있을까?? 확인 필요
|
||||
|
||||
@ -106,7 +106,8 @@ namespace WeldingCommon.Sequences
|
||||
if (_SequenceSetting.ScannerActivated)
|
||||
_Scanner = context.GetLaserScanner();
|
||||
|
||||
if (_SequenceSetting.LaserActivated) {
|
||||
if (_SequenceSetting.LaserActivated)
|
||||
{
|
||||
_Laser = context.GetLaser();
|
||||
_LaserTruFiber = _Laser.getCore() as LaserTruFiber;
|
||||
}
|
||||
@ -282,16 +283,24 @@ namespace WeldingCommon.Sequences
|
||||
}
|
||||
} else {
|
||||
_LaserTruFiber = _Laser.getCore() as LaserTruFiber;
|
||||
// Laser OPCUA로 연결한 경우
|
||||
if (_LaserTruFiber.GetEStopOpen()) {
|
||||
//// Laser OPCUA로 연결한 경우
|
||||
|
||||
//#region 26.04.14 삭제 할 것
|
||||
if (_LaserTruFiber == null) return SequenceAction.Ok();; // 강제 OK
|
||||
//#endregion
|
||||
if (_LaserTruFiber.GetEStopOpen())
|
||||
{
|
||||
AlarmManager.Alarm(AlarmCode_PrismaticScanner.ALARM_DEVICE_IO_LASER_EMO);
|
||||
}
|
||||
if (_LaserTruFiber.GetFaultLaser()) {
|
||||
string alarmCode = $"{Convert.ToString(_LaserTruFiber.GetLastMessageCompID(),16).ToUpper().PadLeft(2,'0')}{Convert.ToString(_LaserTruFiber.GetLastMessageCompNum(),16).ToUpper().PadLeft(2,'0')} {Convert.ToString(_LaserTruFiber.GetLastMessageMsgCode(),16).ToUpper().PadLeft(2,'0')}";
|
||||
if (_LaserTruFiber.GetFaultLaser())
|
||||
{
|
||||
string alarmCode = $"{Convert.ToString(_LaserTruFiber.GetLastMessageCompID(), 16).ToUpper().PadLeft(2, '0')}{Convert.ToString(_LaserTruFiber.GetLastMessageCompNum(), 16).ToUpper().PadLeft(2, '0')} {Convert.ToString(_LaserTruFiber.GetLastMessageMsgCode(), 16).ToUpper().PadLeft(2, '0')}";
|
||||
string alarmDescription = $" {_LaserTruFiber.GetLastMessageShortText()}";
|
||||
AlarmManager.ChangeAlarmDescription(AlarmCode_PrismaticScanner.ALARM_DEVICE_LASER_ERROR_MSG, alarmCode + alarmDescription);
|
||||
|
||||
} else if (_LaserTruFiber.GetMonitoring()) {
|
||||
}
|
||||
else if (_LaserTruFiber.GetMonitoring())
|
||||
{
|
||||
string alarmCode = $"{Convert.ToString(_LaserTruFiber.GetLastMessageCompID(), 16).ToUpper().PadLeft(2, '0')}{Convert.ToString(_LaserTruFiber.GetLastMessageCompNum(), 16).ToUpper().PadLeft(2, '0')} {Convert.ToString(_LaserTruFiber.GetLastMessageMsgCode(), 16).ToUpper().PadLeft(2, '0')}";
|
||||
string alarmDescription = $" {_LaserTruFiber.GetLastMessageShortText()}";
|
||||
AlarmManager.ChangeAlarmDescription(AlarmCode_PrismaticScanner.ALARM_DEVICE_LASER_WARNING_MSG, alarmCode + alarmDescription);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -95,6 +95,7 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
//register(CommonSequenceIds.DeviceMonitor, DeviceMonitoring.Builder());
|
||||
base.Register(aurora, register);
|
||||
|
||||
//SeqMarkGrid 시퀸스 등록
|
||||
if (_SeqMarkGrid == null)
|
||||
{
|
||||
_SeqMarkGrid = new SeqMarkGrid();
|
||||
@ -169,7 +170,7 @@ namespace ILSOS_PrismaticScanner.Sequences
|
||||
|
||||
#region 26.04.09 NDY - ACS MOTF AutoRun Sequence 등록
|
||||
// 기존 SeqAutoRun(SeqAutoRunPrismaticScanner)은 건드리지 않고
|
||||
// ACS MOTF 전용 시퀀스를 별도 ID(SeqAutoRunACS)로 등록
|
||||
// ACS MOTF 전용 시퀀스를 별도 ID(SeqAutoRunACS)로 등록 - 이미 존재한다고 뜸
|
||||
if (_SeqAutoRunPrismaticScannerACS == null)
|
||||
{
|
||||
_SeqAutoRunPrismaticScannerACS = new SeqAutoRunPrismaticScannerACS();
|
||||
|
||||
@ -219,8 +219,16 @@ namespace ILSOS_PrismaticScanner.Views
|
||||
// 자동으로 Activated Recipe로 변경
|
||||
OnUpdateCurrentActivatedRecipe(null);
|
||||
|
||||
var param = new SeqAutoRunPrismaticScanner_InitParam() {
|
||||
VisionRecipeNo = 0
|
||||
//var param = new SeqAutoRunPrismaticScanner_InitParam() {
|
||||
// //VisionRecipeNo = 0 // 해당 InitParam에는 없는 선언
|
||||
//};
|
||||
|
||||
var param = new SeqTeachingRun_InitParam()
|
||||
{
|
||||
IsObjectSelectAll = true,
|
||||
CellCenterOffsetX = 0,
|
||||
CellCenterOffsetY = 0,
|
||||
|
||||
};
|
||||
|
||||
Status.SetStatus(eEqpStatus.Auto);
|
||||
@ -277,18 +285,21 @@ namespace ILSOS_PrismaticScanner.Views
|
||||
public override void OnAutoRunStopRequest()
|
||||
{
|
||||
base.OnAutoRunStopRequest();
|
||||
//// Prewelding은 자동 운전 정지 와도 무시
|
||||
//StopSequenceAutoRun();
|
||||
}
|
||||
|
||||
private void OnStopSequenceAutoRun(object obj = null)
|
||||
{
|
||||
if (_SeqAutoRun.RunState == SequenceRunState.Idle) {
|
||||
return;
|
||||
}
|
||||
//if (_SeqAutoRun.RunState == SequenceRunState.Idle) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
_SeqAutoRun.Stop();
|
||||
|
||||
#region 260417 확인 - 확인완료
|
||||
// 26.04.17 NDY - Stop 시 장비 상태 복귀
|
||||
Status.SetStatus(eEqpStatus.Manual);
|
||||
#endregion
|
||||
|
||||
//Recipe를 기존에 선택된 Recipe로 Rollback 해 줌
|
||||
RecipeHelper.RollbackRecipe();
|
||||
//AutoRun 정지 시 CorrectionFile을 Vision으로 변경
|
||||
|
||||
@ -569,7 +569,8 @@ namespace CoreUnit.Common
|
||||
// 다른 프로세스도 파일 읽고 쓸 수 있도록.
|
||||
FileStream FileStream = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
|
||||
|
||||
StreamWriter sw = new StreamWriter(FileStream, System.Text.Encoding.Unicode);
|
||||
StreamWriter sw = new StreamWriter(FileStream, System.Text.Encoding.Unicode); // 26.04.15 기존 코드 주석처리함
|
||||
//StreamWriter sw = new StreamWriter(FileStream, System.Text.Encoding.UTF8); // 26.04.15 변경 코드 UTF8로 변경 log 깨짐 현상
|
||||
|
||||
if (isFile) {
|
||||
sw.WriteLine(strItem);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -98,33 +98,33 @@ namespace CoreUnit.Scanner.UserControl.Canvas.Dialog
|
||||
cbParamExt.Items.Add(i);
|
||||
}
|
||||
|
||||
if (editMode) {
|
||||
gbLaser.Enabled = true;
|
||||
gbRamping.Enabled = true;
|
||||
gbScanner.Enabled = true;
|
||||
gbWobbel.Enabled = true;
|
||||
//if (editMode) {
|
||||
// gbLaser.Enabled = true;
|
||||
// gbRamping.Enabled = true;
|
||||
// gbScanner.Enabled = true;
|
||||
// gbWobbel.Enabled = true;
|
||||
|
||||
btnCopyParam.Enabled = true;
|
||||
btnImport.Enabled = true;
|
||||
btnImportAll.Enabled = true;
|
||||
btnExport.Enabled = true;
|
||||
btnExportAll.Enabled = true;
|
||||
btnOk.Enabled = true;
|
||||
btnCancel.Enabled = true;
|
||||
} else {
|
||||
gbLaser.Enabled = false;
|
||||
gbRamping.Enabled = false;
|
||||
gbScanner.Enabled = false;
|
||||
gbWobbel.Enabled = false;
|
||||
// btnCopyParam.Enabled = true;
|
||||
// btnImport.Enabled = true;
|
||||
// btnImportAll.Enabled = true;
|
||||
// btnExport.Enabled = true;
|
||||
// btnExportAll.Enabled = true;
|
||||
// btnOk.Enabled = true;
|
||||
// btnCancel.Enabled = true;
|
||||
//} else {
|
||||
// gbLaser.Enabled = false;
|
||||
// gbRamping.Enabled = false;
|
||||
// gbScanner.Enabled = false;
|
||||
// gbWobbel.Enabled = false;
|
||||
|
||||
btnCopyParam.Enabled = false;
|
||||
btnImport.Enabled = false;
|
||||
btnImportAll.Enabled = false;
|
||||
btnExport.Enabled = false;
|
||||
btnExportAll.Enabled = false;
|
||||
btnOk.Enabled = false;
|
||||
btnCancel.Enabled = true;
|
||||
}
|
||||
// btnCopyParam.Enabled = false;
|
||||
// btnImport.Enabled = false;
|
||||
// btnImportAll.Enabled = false;
|
||||
// btnExport.Enabled = false;
|
||||
// btnExportAll.Enabled = false;
|
||||
// btnOk.Enabled = false;
|
||||
// btnCancel.Enabled = true;
|
||||
//}
|
||||
|
||||
//Welding Paramter 색 지정
|
||||
//rbParam1.ForeColor = Color.FromName(((WeldingParameterIDEditor.eWeldingColor)1).ToString());
|
||||
|
||||
@ -116,6 +116,10 @@ namespace CoreUnit.Scanner
|
||||
|
||||
double m_markingOntheFlyParkingPositionX;
|
||||
double m_markingOntheFlyParkingPositionY;
|
||||
double m_markingStartX_1;
|
||||
double m_markingStartX_2;
|
||||
double m_XDiff_Page1and2;
|
||||
double m_XDiff_Page3and4;
|
||||
|
||||
double m_flySpeedInterlock;
|
||||
double m_rotaryEncoderOffset;
|
||||
@ -522,6 +526,45 @@ namespace CoreUnit.Scanner
|
||||
get { return m_markingOntheFlyParkingPositionY; }
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[ReadOnly(false)]
|
||||
[Category("Marking On The Fly(MOTF)")]
|
||||
[DisplayName("Marking Start X 1 (mm)")]
|
||||
[Description("Marking Start X 1 (mm)")]
|
||||
public double MarkingStartX_1 {
|
||||
set { m_markingStartX_1 = value; }
|
||||
get { return m_markingStartX_1; }
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[ReadOnly(false)]
|
||||
[Category("Marking On The Fly(MOTF)")]
|
||||
[DisplayName("Marking Start X 2 (mm)")]
|
||||
[Description("Marking Start X 2 (mm)")]
|
||||
public double MarkingStartX_2 {
|
||||
set { m_markingStartX_2 = value; }
|
||||
get { return m_markingStartX_2; }
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[ReadOnly(false)]
|
||||
[Category("Marking On The Fly(MOTF)")]
|
||||
[DisplayName("X Diff Page 1 & 2 (mm)")]
|
||||
[Description("X Diff Page 1 & 2 (mm)")]
|
||||
public double XDiff_Page1and2 {
|
||||
set { m_XDiff_Page1and2 = value; }
|
||||
get { return m_XDiff_Page1and2; }
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[ReadOnly(false)]
|
||||
[Category("Marking On The Fly(MOTF)")]
|
||||
[DisplayName("X Diff Page 3 & 4 (mm)")]
|
||||
[Description("X Diff Page 3 & 4 (mm)")]
|
||||
public double XDiff_Page3and4 {
|
||||
set { m_XDiff_Page3and4 = value; }
|
||||
get { return m_XDiff_Page3and4; }
|
||||
}
|
||||
[Browsable(true)]
|
||||
[ReadOnly(false)]
|
||||
[Category("Marking On The Fly(MOTF)")]
|
||||
|
||||
@ -158,6 +158,9 @@ namespace WeldingCommon.Alarm
|
||||
StopSequence(CommonSequenceIds.SeqScoutNormal);
|
||||
StopSequence(CommonSequenceIds.SeqUploadWeldingList);
|
||||
StopSequence(CommonSequenceIds.SeqTeachingRun);
|
||||
|
||||
//26.04.15 추가
|
||||
StopSequence(CommonSequenceIds.SeqAutoRunACS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -46,11 +46,16 @@ namespace WeldingCommon
|
||||
builder
|
||||
.AddLanguage("en-US", "ko-KR")
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.Scanner)
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.Laser)
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.IODevice)
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.PLCDevice)
|
||||
//.AddDeviceActiveStatus(CommonDeviceIds.Laser)
|
||||
//.AddDeviceActiveStatus(CommonDeviceIds.IODevice)
|
||||
//.AddDeviceActiveStatus(CommonDeviceIds.PLCDevice)
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.Light)
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.SmcChiller);
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.ACS)
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.AxisX2)
|
||||
.AddDeviceActiveStatus(CommonDeviceIds.AxisZ);
|
||||
|
||||
//.AddDeviceActiveStatus(CommonDeviceIds.Light)
|
||||
//.AddDeviceActiveStatus(CommonDeviceIds.SmcChiller);
|
||||
}
|
||||
|
||||
public bool CanShutDown()
|
||||
@ -222,13 +227,14 @@ namespace WeldingCommon
|
||||
|
||||
|
||||
registry.Register(CommonDeviceIds.Scanner, () => new Scanner(CommonDeviceIds.Scanner, isSimul), new ScannerConfig());
|
||||
registry.Register(CommonDeviceIds.SmcChiller, () => new SmcChiller(CommonDeviceIds.SmcChiller, 0, isSimul), new SmcChiller.Config(),
|
||||
device => new UCSMCChillerDevice() { DataContext = new UCSMCChillerDeviceViewModel(AuroraEnv, CommonDeviceIds.SmcChiller) });
|
||||
registry.Register(CommonDeviceIds.Laser, () => new Laser(CommonDeviceIds.Laser, isSimul), new LaserConfig());
|
||||
//registry.Register(CommonDeviceIds.SmcChiller, () => new SmcChiller(CommonDeviceIds.SmcChiller, 0, isSimul), new SmcChiller.Config(),
|
||||
// device => new UCSMCChillerDevice() { DataContext = new UCSMCChillerDeviceViewModel(AuroraEnv, CommonDeviceIds.SmcChiller) });
|
||||
|
||||
VisionFactory.RegisterDevices(registry);
|
||||
|
||||
registry.Register(CommonDeviceIds.Light, () => new LightDevice(CommonDeviceIds.Light, eLight.ERI, isSimul), new LightConfig(),
|
||||
device => new UCLight() { DataContext = new UCLightViewModel(AuroraEnv, CommonDeviceIds.Light, _SequenceSetting.LightValue) });
|
||||
//registry.Register(CommonDeviceIds.Light, () => new LightDevice(CommonDeviceIds.Light, eLight.ERI, isSimul), new LightConfig(),
|
||||
// device => new UCLight() { DataContext = new UCLightViewModel(AuroraEnv, CommonDeviceIds.Light, _SequenceSetting.LightValue) });
|
||||
|
||||
// TODO: SystemParameterManager.Initialize 할 위치 찾자. 여기는 조금....
|
||||
SystemParameterManager.Initialize(AuroraEnv);
|
||||
|
||||
@ -3,8 +3,12 @@
|
||||
// 26.04.06 NDY
|
||||
using AuroraACS;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace WeldingCommon.Devices.ACS
|
||||
{
|
||||
|
||||
// ── 레이저 출력 타입 ──────────────────────────────────────
|
||||
// Gun의 MainRecipe.eOutType과 동일
|
||||
// partial class 밖에 정의 → IScannerACS 인터페이스에서도 참조 가능
|
||||
@ -14,6 +18,114 @@ namespace WeldingCommon.Devices.ACS
|
||||
Interval, // hz
|
||||
}
|
||||
|
||||
#region 26.04.14
|
||||
//public partial class ScannerACS
|
||||
//{
|
||||
// const string AlarmReset = "iAlarmreset";
|
||||
// const string HeavyAlarm = "iAlarm";
|
||||
// const string LightAlarm = "iLightAlarm";
|
||||
// const string AlarmCodes = "iPCAlarmNo"; // 10개
|
||||
// const string BStageRemarkUse = "iPCset_BLINE_WeldingRemarkUse";
|
||||
|
||||
// const string IsLaserOn = "LCI_DEVICE.LaserEnabled";
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// //////////////////////////////////////////////////////
|
||||
// /// </summary>
|
||||
// ///
|
||||
// const string rOneShotTime = "rPCset_ALINE_SHOT_TIME";
|
||||
// const string rOneShotCoreVoltage = "rPCset_ALINE_SHOT_CORE_VOLTAGE";
|
||||
// const string rOneShotRingVoltage = "rPCset_ALINE_SHOT_RING_VOLTAGE";
|
||||
// const string iOneShotComplete = "iPCget_ALINE_SHOT_COMP";
|
||||
|
||||
|
||||
// const string rLineWeldingCoreVoltage = "rPCset_ALINE_LINE_CORE_VOLTAGE";
|
||||
// const string rLineWeldingRingVoltage = "rPCset_ALINE_LINE_RING_VOLTAGE";
|
||||
// const string rLineWeldingVel = "rPCset_ALINE_LINE_VEL";
|
||||
// const string rLineWeldingAcc = "rPCset_ALINE_LINE_ACC";
|
||||
// const string rLineWeldingLaserOnX = "rPCset_ALINE_LINE_LASERON_X";
|
||||
// const string rLineWeldingLaserOnY = "rPCset_ALINE_LINE_LASERON_Y";
|
||||
// const string rLineWeldingLaserOffX = "rPCset_ALINE_LINE_LASEROFF_X";
|
||||
// const string rLineWeldingLaserOffY = "rPCset_ALINE_LINE_LASEROFF_Y";
|
||||
// const string iLineWeldingComplete = "iPCget_ALINE_LINE_COMP";
|
||||
|
||||
// const string rWeldingPosition1PosX = "rPCset_ALINE_WeldingPosition1_X";
|
||||
// const string rWeldingPosition1PosY = "rPCset_ALINE_WeldingPosition1_Y";
|
||||
// const string rWeldingPosition2PosX = "rPCset_ALINE_WeldingPosition2_X";
|
||||
// const string rWeldingPosition2PosY = "rPCset_ALINE_WeldingPosition2_Y";
|
||||
// const string rWeldingPosition3PosX = "rPCset_ALINE_WeldingPosition3_X";
|
||||
// const string rWeldingPosition3PosY = "rPCset_ALINE_WeldingPosition3_Y";
|
||||
// const string rWeldingPosition4PosX = "rPCset_ALINE_WeldingPosition4_X";
|
||||
// const string rWeldingPosition4PosY = "rPCset_ALINE_WeldingPosition4_Y";
|
||||
// const string rWeldingPosition5PosX = "rPCset_ALINE_WeldingPosition5_X";
|
||||
// const string rWeldingPosition5PosY = "rPCset_ALINE_WeldingPosition5_Y";
|
||||
// const string rWeldingPosition6PosX = "rPCset_ALINE_WeldingPosition6_X";
|
||||
// const string rWeldingPosition6PosY = "rPCset_ALINE_WeldingPosition6_Y";
|
||||
// const string rWeldingPosition7PosX = "rPCset_ALINE_WeldingPosition7_X";
|
||||
// const string rWeldingPosition7PosY = "rPCset_ALINE_WeldingPosition7_Y";
|
||||
// const string rWeldingPosition8PosX = "rPCset_ALINE_WeldingPosition8_X";
|
||||
// const string rWeldingPosition8PosY = "rPCset_ALINE_WeldingPosition8_Y";
|
||||
|
||||
// const string rWeldingEdgePointRad1 = "rPCset_ALINE_EdgePointRad1";
|
||||
// const string rWeldingEdgePointRad2 = "rPCset_ALINE_EdgePointRad2";
|
||||
// const string rWeldingEdgePointRad3 = "rPCset_ALINE_EdgePointRad3";
|
||||
// const string rWeldingEdgePointRad4 = "rPCset_ALINE_EdgePointRad4";
|
||||
|
||||
// const string rWeldingCorePowerMax = "rPCset_ALINE_WEL_COREPOWER_MAX";
|
||||
// const string rWeldingCorePowerMin = "rPCset_ALINE_WEL_COREPOWER_MIN";
|
||||
// const string rWeldingRingPowerMax = "rPCset_ALINE_WEL_RINGPOWER_MAX";
|
||||
// const string rWeldingRingPowerMin = "rPCset_ALINE_WEL_RINGPOWER_MIN";
|
||||
|
||||
// const string rWeldingAcc = "rPCset_ALINE_WEL_ACC";
|
||||
// const string rWeldingSVel = "rPCset_ALINE_WEL_SVEL";
|
||||
// const string rWeldingCVel = "rPCset_ALINE_WEL_CVEL";
|
||||
// const string iWeldingComplete = "iPCget_ALINE_WEL_COMP";
|
||||
|
||||
// const string rWeldingStartPosX = "rPCset_ALINE_WEL_ST_POS_X";
|
||||
// const string rWeldingStartPosY = "rPCset_ALINE_WEL_ST_POS_Y";
|
||||
// const string rWeldingEndPosX = "rPCset_ALINE_WEL_EN_POS_X";
|
||||
// const string rWeldingEndPosY = "rPCset_ALINE_WEL_EN_POS_Y";
|
||||
|
||||
// const string rLaserONPosX = "rPCset_ALINE_LASER_ONPOS_X";
|
||||
// const string rLaserONOffset = "rPCset_ALINE_LASER_ON_OFFSET";
|
||||
// const string rLaserOFFPosX = "rPCset_ALINE_LASER_OFFPOS_X";
|
||||
// const string rLaserOFFOffset = "rPCset_ALINE_LASER_OFF_OFFSET";
|
||||
|
||||
// const string rRampingONOverlapDist = "rPCset_ALINE_RAMP_ON_OVERLAP_DIS";
|
||||
// const string rRampingONStartPower = "rPCset_ALINE_RAMP_ON_STARTPOWER";
|
||||
|
||||
// const string rRampingOFFStartPosX = "rPCset_ALINE_RAMP_OFF_STPOS_X";
|
||||
// const string rRampingOFFOverlapDist = "rPCset_ALINE_RAMP_OFF_OVERLAP_DIS";
|
||||
// const string rRampingOFFEndPower = "rPCset_ALINE_RAMP_OFF_ENDPOWER";
|
||||
|
||||
// const string iALaserShotMode = "iPCset_ALASER_SHOT_MODE";
|
||||
// const string iAStageLCType = "iPCset_ALINE_LCTYPE";
|
||||
|
||||
// const string iAllAxisHomeComplete = "iPCget_ALLAXIS_HOMECOMP";
|
||||
|
||||
// const string iXAxisNumber = "iPCget_LCI_ASMASK_X";
|
||||
// const string iYAxisNumber = "iPCget_LCI_ASMASK_Y";
|
||||
// const string iLaserUse = "iPCset_LASER_USE";
|
||||
|
||||
|
||||
// private enum eBuffer
|
||||
// {
|
||||
// All_Axis_Home,
|
||||
// AxisX1_Home,
|
||||
// AxisX2_Home,
|
||||
// AxisY1_Home,
|
||||
// AxisY2_Home,
|
||||
// AxisZ_Home,
|
||||
|
||||
// Welding_Line = 11,
|
||||
// Welding_AllRound,
|
||||
// Welding_OneShot
|
||||
// }
|
||||
|
||||
//}
|
||||
#endregion
|
||||
#region 26.04.14
|
||||
public partial class ScannerACS
|
||||
{
|
||||
// ── 알람 ──────────────────────────────────────────
|
||||
@ -131,4 +243,6 @@ namespace WeldingCommon.Devices.ACS
|
||||
MOTF_Start = 17, // 26.04.09 NDY xlsx Buffer Info 기준 확정
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@ -34,13 +34,14 @@ namespace WeldingCommon.Devices.ACS
|
||||
// 홈
|
||||
bool AllAxisHomeStart();
|
||||
bool AllAxisHomeStop();
|
||||
bool CheckAllAxisHome();
|
||||
bool CheckAllAxisHome();
|
||||
|
||||
// MOTF (Scanner 전용 - Gun에 없음)
|
||||
bool SetMOTFParams(double posX, double negX, double velocity, double acc, int interval);
|
||||
bool MOTFStart();
|
||||
bool MOTFStop();
|
||||
bool CheckMOTFComp();
|
||||
bool ResetMOTFComp(); // ← 여기에 추가 BUFFER 17에서 완료에 대한 플래그 리셋 0 으로 하는 것 260417
|
||||
|
||||
// OneShot
|
||||
bool SetOneShot(int msecShotTime, double secPhzShotPulse1, double secPhzShotPulse2);
|
||||
@ -104,10 +105,10 @@ namespace WeldingCommon.Devices.ACS
|
||||
|
||||
private ACSDeviceSetting _setting;
|
||||
|
||||
// Scanner는 Stage X (X2) 1축만 사용
|
||||
// Scanner는 Stage X (X2) 1축만 사용 | Z 축까지 사용 스캐너 높이
|
||||
// Gun은 X1, X2, Y1, Y2, Z 5축 사용
|
||||
private ACSMotor MotorStageX; // AxisX2 = Scanner Stage X
|
||||
|
||||
private ACSMotor MotorStageZ; // 26.04.14 = AxisZ
|
||||
public MotionVariable _motorVariable;
|
||||
|
||||
public bool HasHeavyAlarm { get; private set; }
|
||||
@ -137,6 +138,9 @@ namespace WeldingCommon.Devices.ACS
|
||||
try { MotorStageX = env.DeviceManager[CommonDeviceIds.AxisX2] as ACSMotor; }
|
||||
catch { MotorStageX = null; }
|
||||
|
||||
try { MotorStageZ = env.DeviceManager[CommonDeviceIds.AxisZ] as ACSMotor; }
|
||||
catch { MotorStageZ = null; }
|
||||
|
||||
SetMonitoringService(UpdateACSParam, 50);
|
||||
StartMonitoringService();
|
||||
|
||||
@ -152,9 +156,16 @@ namespace WeldingCommon.Devices.ACS
|
||||
_motorVariable.X2InPosition = MotorStageX.IsInpos();
|
||||
_motorVariable.X2AxisVelocity = MotorStageX.GetFeedbackVelocity();
|
||||
_motorVariable.X2AxisAcceleration = MotorStageX.GetAcceleration();
|
||||
_motorVariable.IsHome = MotorStageX.GetServoStatus() == 1;
|
||||
_motorVariable.IsHome |= MotorStageX.GetServoStatus() == 1;
|
||||
}
|
||||
if (MotorStageZ != null)
|
||||
{
|
||||
_motorVariable.ZAxisPosition = MotorStageZ.GetActualPos();
|
||||
_motorVariable.ZInPosition = MotorStageZ.IsInpos();
|
||||
_motorVariable.ZAxisVelocity = MotorStageZ.GetFeedbackVelocity();
|
||||
_motorVariable.ZAxisAcceleration = MotorStageZ.GetAcceleration();
|
||||
_motorVariable.IsHome |= MotorStageZ.GetServoStatus() == 1;
|
||||
}
|
||||
|
||||
// 알람 상태 갱신
|
||||
HasHeavyAlarm = ReadVariableInt(HeavyAlarm) == 1;
|
||||
HasLightAlarm = ReadVariableInt(LightAlarm) == 1;
|
||||
@ -230,10 +241,29 @@ namespace WeldingCommon.Devices.ACS
|
||||
|
||||
bool IScannerACS.CheckMOTFComp()
|
||||
{
|
||||
|
||||
#region 260418 확인 - 확인 완료
|
||||
// 26.04.17 NDY - 시퀀스 완료 후 장비 상태 복귀
|
||||
Status.SetStatus(eEqpStatus.Manual);
|
||||
#endregion
|
||||
|
||||
if (IsSimul) return true;
|
||||
return ReadVariableInt(iMOTFComplete) > 0;
|
||||
}
|
||||
|
||||
// 260417여기 추가
|
||||
bool IScannerACS.ResetMOTFComp()
|
||||
{
|
||||
if (IsSimul) return true;
|
||||
if (WriteVariableInt(iMOTFComplete, 0))
|
||||
{
|
||||
Log.I("ResetMOTFComp >> Complete (iPCset_MOF_WEL_COMP = 0)");
|
||||
return true;
|
||||
}
|
||||
Log.E("ResetMOTFComp >> Fail");
|
||||
return false;
|
||||
}
|
||||
|
||||
// ── OneShot ──────────────────────────────────────────────────────────
|
||||
bool IScannerACS.SetOneShot(int msecShotTime, double secPhzShotPulse1, double secPhzShotPulse2)
|
||||
{
|
||||
|
||||
@ -145,10 +145,10 @@ namespace WeldingCommon
|
||||
|
||||
public const string ACS = "ACS"; // 26.04.06 추가
|
||||
|
||||
public const string AxisX1 = "AxisX1";
|
||||
//public const string AxisX1 = "AxisX1";
|
||||
public const string AxisX2 = "AxisX2"; // 26.04.06 추가
|
||||
public const string AxisY1 = "AxisY1";
|
||||
public const string AxisY2 = "AxisY2";
|
||||
//public const string AxisY1 = "AxisY1";
|
||||
//public const string AxisY2 = "AxisY2";
|
||||
|
||||
// Ajin Motor
|
||||
public const string AxisZ = "AxisZ";
|
||||
@ -219,6 +219,8 @@ namespace WeldingCommon
|
||||
public const string MotorInit = "MotorInit";
|
||||
public const string OneShot = "OneShot";
|
||||
#endregion
|
||||
// 26.04.09 NDY - ACS MOTF AutoRun - > SeqAutoRun은 CommonSequenceIds에 존재함.
|
||||
public const string SeqAutoRunACS = "SeqAutoRunACS";
|
||||
}
|
||||
|
||||
public class EquipEvent
|
||||
@ -266,10 +268,10 @@ namespace WeldingCommon
|
||||
// 26 .04.13
|
||||
public class CommonMotorIds
|
||||
{
|
||||
public const string AxisX1 = "AxisX1";
|
||||
//public const string AxisX1 = "AxisX1";
|
||||
public const string AxisX2 = "AxisX2";
|
||||
public const string AxisY1 = "AxisY1";
|
||||
public const string AxisY2 = "AxisY2";
|
||||
//public const string AxisY1 = "AxisY1";
|
||||
//public const string AxisY2 = "AxisY2";
|
||||
|
||||
// Ajin Motor
|
||||
public const string AxisZ = "AxisZ";
|
||||
|
||||
@ -17,6 +17,7 @@ using WeldingCommon.Settings;
|
||||
|
||||
namespace WeldingCommon.Sequences
|
||||
{
|
||||
// 캘리브레이션 작업 시 타는 시퀸스
|
||||
public class SeqScannerCalibration
|
||||
{
|
||||
static readonly Logger Log = new Logger("SeqScannerCalibration");
|
||||
|
||||
@ -51,7 +51,7 @@ namespace WeldingCommon.Sequences.Monitoring
|
||||
private static Laser _laser;
|
||||
private static LaserTruFiber _laserCore;
|
||||
private static ScannerACS _acs; // 26.04.13
|
||||
private static ACSMotor _axisX, _axisY1, _axisY2, _axisZ;
|
||||
private static ACSMotor _axisX, _axisZ; //, _axisY1, _axisY2,
|
||||
|
||||
public const int NODE_SLEEP = 100; // msec
|
||||
|
||||
@ -80,6 +80,7 @@ namespace WeldingCommon.Sequences.Monitoring
|
||||
|
||||
}
|
||||
|
||||
//StartNode 알람
|
||||
private static SequenceActionResult StartNode(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
_SequenceSetting = context.Settings[CommonSettingIds.Sequence] as SequenceSetting;
|
||||
@ -95,11 +96,11 @@ namespace WeldingCommon.Sequences.Monitoring
|
||||
if (_axisX is null)
|
||||
_axisX = context.Devices[CommonMotorIds.AxisX2] as ACSMotor;
|
||||
|
||||
if (_axisY1 is null)
|
||||
_axisY1 = context.Devices[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
//if (_axisY1 is null)
|
||||
// _axisY1 = context.Devices[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
|
||||
if (_axisY2 is null)
|
||||
_axisY2 = context.Devices[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
//if (_axisY2 is null)
|
||||
// _axisY2 = context.Devices[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
|
||||
if (_axisZ is null)
|
||||
_axisZ = context.Devices[CommonMotorIds.AxisZ] as ACSMotor;
|
||||
|
||||
@ -64,7 +64,7 @@ namespace WeldingCommon.Sequences
|
||||
sb.AddAction(SEQ_ENTER, Sequence_Enter);
|
||||
sb.AddAction(SEQ_CHECK_INIT_CONDITION, CheckInitCondition);
|
||||
sb.AddAction(SEQ_ACS_ALARM_RESET, ACSAlarmReset);
|
||||
sb.AddAction(SEQ_INIT_ACS_AXIS, ACSAxisInit);
|
||||
//sb.AddAction(SEQ_INIT_ACS_AXIS, ACSAxisInit);
|
||||
sb.AddAction(SEQ_INIT_COMPLETE, InitComplete);
|
||||
|
||||
sb.OnStopped(OnStopped);
|
||||
@ -116,26 +116,26 @@ namespace WeldingCommon.Sequences
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private static SequenceActionResult ACSAxisInit(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
Log.V($"ACS Init Start");
|
||||
_motion.AllAxisHomeStart();
|
||||
Thread.Sleep(1000);
|
||||
//private static SequenceActionResult ACSAxisInit(SequenceContext context, string id, SequenceActionResult param)
|
||||
//{
|
||||
// Log.V($"ACS Init Start");
|
||||
// _motion.AllAxisHomeStart();
|
||||
// Thread.Sleep(1000);
|
||||
|
||||
var res = context.RetryUntilSuccess(() => _motion.CheckAllAxisHome(), SEQ_TIMEOUT, MOTION_INTERVAL);
|
||||
if (res == E2.TIMEOUT) {
|
||||
context.PutValue<int>("AlarmCode", AlarmCode_PrismaticGun.ACS_AXIS_INITIALIZE_FAIL); // 26.04.13 잠시 주석
|
||||
context.PutValue<string>("AlarmMessage", "ACS Axis Home Timeout");
|
||||
return null;
|
||||
} else if (res == E2.CANCELLED) {
|
||||
context.PutValue<int>("AlarmCode", 0);
|
||||
context.PutValue<string>("AlarmMessage", "ACS Axis Home Cancel");
|
||||
return null;
|
||||
}
|
||||
// var res = context.RetryUntilSuccess(() => _motion.CheckAllAxisHome(), SEQ_TIMEOUT, MOTION_INTERVAL);
|
||||
// if (res == E2.TIMEOUT) {
|
||||
// context.PutValue<int>("AlarmCode", AlarmCode_PrismaticGun.ACS_AXIS_INITIALIZE_FAIL); // 26.04.13 잠시 주석
|
||||
// context.PutValue<string>("AlarmMessage", "ACS Axis Home Timeout");
|
||||
// return null;
|
||||
// } else if (res == E2.CANCELLED) {
|
||||
// context.PutValue<int>("AlarmCode", 0);
|
||||
// context.PutValue<string>("AlarmMessage", "ACS Axis Home Cancel");
|
||||
// return null;
|
||||
// }
|
||||
|
||||
Log.V($"ACS Init End");
|
||||
return SequenceAction.Ok(eTeachingPosition.SafetyPosition);
|
||||
}
|
||||
// Log.V($"ACS Init End");
|
||||
// return SequenceAction.Ok(eTeachingPosition.SafetyPosition);
|
||||
//}
|
||||
|
||||
private static SequenceActionResult InitComplete(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
|
||||
@ -137,15 +137,15 @@ namespace WeldingCommon.Sequences
|
||||
_laserCal = context.Settings[CommonSettingIds.LaserPowerCalParam] as LaserPowerCalParam;
|
||||
|
||||
_AxisX = context.Devices[CommonMotorIds.AxisX2] as ACSMotor;
|
||||
_AxisZ = context.Devices[CommonMotorIds.AxisZ] as ACSMotor;
|
||||
if (_data[LineInLinesIndex].YAxisType == (int)eYAxisType.Y1) {
|
||||
_AxisY = context.Devices[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
_acsMotion.SetWeldingAxes((int)CommonMotorIds.eMotorIdx.AxisX2, (int)CommonMotorIds.eMotorIdx.AxisY1);
|
||||
}
|
||||
else {
|
||||
_AxisY = context.Devices[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
_acsMotion.SetWeldingAxes((int)CommonMotorIds.eMotorIdx.AxisX2, (int)CommonMotorIds.eMotorIdx.AxisY2);
|
||||
}
|
||||
//_AxisZ = context.Devices[CommonMotorIds.AxisZ] as ACSMotor;
|
||||
//if (_data[LineInLinesIndex].YAxisType == (int)eYAxisType.Y1) {
|
||||
// _AxisY = context.Devices[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
// _acsMotion.SetWeldingAxes((int)CommonMotorIds.eMotorIdx.AxisX2, (int)CommonMotorIds.eMotorIdx.AxisY1);
|
||||
//}
|
||||
//else {
|
||||
// _AxisY = context.Devices[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
// _acsMotion.SetWeldingAxes((int)CommonMotorIds.eMotorIdx.AxisX2, (int)CommonMotorIds.eMotorIdx.AxisY2);
|
||||
//}
|
||||
|
||||
|
||||
if (Status.EquipmentStatus == eEqpStatus.Manual)
|
||||
|
||||
@ -80,10 +80,10 @@ namespace WeldingCommon.Sequences.SubSequence.StageA
|
||||
_acs = context.Devices[CommonDeviceIds.ACS] as ScannerACS; //260413
|
||||
if (_AxisX is null)
|
||||
_AxisX = _FirstMoveAxis = context.Devices[CommonDeviceIds.AxisX2] as ACSMotor;
|
||||
if (_AxisY1 is null)
|
||||
_AxisY1 = _SecondMoveAxis = context.Devices[CommonDeviceIds.AxisY1] as ACSMotor;
|
||||
if (_AxisY2 is null)
|
||||
_AxisY2 = _SecondMoveAxis = context.Devices[CommonDeviceIds.AxisY2] as ACSMotor;
|
||||
//if (_AxisY1 is null)
|
||||
// _AxisY1 = _SecondMoveAxis = context.Devices[CommonDeviceIds.AxisY1] as ACSMotor;
|
||||
//if (_AxisY2 is null)
|
||||
// _AxisY2 = _SecondMoveAxis = context.Devices[CommonDeviceIds.AxisY2] as ACSMotor;
|
||||
if (_AxisZ is null)
|
||||
_AxisZ = context.Devices[CommonDeviceIds.AxisZ] as ACSMotor;
|
||||
|
||||
|
||||
@ -124,8 +124,8 @@ namespace WeldingCommon.Sequences.SubSequence.StageA
|
||||
|
||||
_AxisX = context.Devices[CommonMotorIds.AxisX2] as ACSMotor;
|
||||
_AxisZ = context.Devices[CommonMotorIds.AxisZ] as ACSMotor;
|
||||
_MotorY1 = context.Devices[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
_MotorY2 = context.Devices[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
//_MotorY1 = context.Devices[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
//_MotorY2 = context.Devices[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
|
||||
if (_mainRecipe.YAxisUseType == MainRecipe.YAxisType.Y1) {
|
||||
_AxisY = _MotorY1;
|
||||
|
||||
@ -106,7 +106,7 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
_InitParam = param.Param as SeqScoutNormal_InitParam;
|
||||
_SystemParameter = context.GetSetting<SystemParameter>(CommonSettingIds.SystemParameter);
|
||||
|
||||
|
||||
InitDev(context);
|
||||
if (!CheckDeviceReady(context)) { //Check Device
|
||||
AlarmManager.Alarm(AlarmCode.ALARM_SEQUENCE_ScoutNormal_DeviceNotReady);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using Aurora.Api;
|
||||
using Aurora.Api.Devices;
|
||||
using Aurora.Util.HislogPlus;
|
||||
using AuroraLaser;
|
||||
using AuroraLaserScanner;
|
||||
using CoreUnit.Control.UserControl.Canvas;
|
||||
@ -8,6 +9,7 @@ using DB;
|
||||
using Hermes;
|
||||
using Matrox.MatroxImagingLibrary;
|
||||
using Newtonsoft.Json;
|
||||
using OpenCvSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
@ -72,7 +74,7 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
private static int _CenterRingRatio; // Center Ring의 파워 비율
|
||||
private static float _LaserPowerRatio; // Laser에서 출력 파워 비율
|
||||
|
||||
private bool isFirst = true;
|
||||
private static SeqUploadWeldingList_OutParam result;
|
||||
const int ROTATION_DEGREE = 15; // 15도 설정, 하나의 지그가 30도 이므로, 15도부터 돌도록 설정됨.
|
||||
|
||||
@ -87,7 +89,7 @@ namespace WeldingCommon.Sequences
|
||||
sb.AddAction(SEQ_ENTER, Sequence_Enter);
|
||||
sb.AddDecision(SEQ_CHECK_INIT_CONDITION, CheckInitCondition); //분기
|
||||
|
||||
sb.AddAction(SEQ_MARKING_ON_THE_FLY_ON, MarkingOnTheFlyOn);
|
||||
sb.AddAction(SEQ_MARKING_ON_THE_FLY_ON, MarkingOnTheFlyOn);
|
||||
sb.AddAction(SEQ_RECORD_SIGNAL_ON, RecordSignalOn);
|
||||
sb.AddAction(SEQ_LOAD_DRAW_OBJECT_SCANNER_PARAM, LoadDrawObjectScannerParam);
|
||||
sb.AddAction(SEQ_MARKING_ON_THE_FLY_OFF, MarkingOnTheFlyOff);
|
||||
@ -116,7 +118,7 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
private SequenceActionResult Sequence_Enter(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
Log.I("SeqUploadWeldingList Start");
|
||||
Log.I("[Sequence_Enter] SeqUploadWeldingList Start");
|
||||
|
||||
_InitParam = param.Param as SeqUploadWeldingList_InitParam;
|
||||
_LaserPowerCalParam = context.GetSetting<LaserPowerCalParam>(CommonSettingIds.LaserPowerCalParam);//우선 AuroraRecipe로 상속받아서 함수 사용하도록 함
|
||||
@ -128,7 +130,7 @@ namespace WeldingCommon.Sequences
|
||||
InitDev(context);
|
||||
if (!CheckDeviceReady(context)) { //Check Device
|
||||
AlarmManager.Alarm(AlarmCode.ALARM_SEQUENCE_UploadWeldingList_DeviceNotReady);
|
||||
Log.E("The devices are not active.");
|
||||
Log.E("[Sequence_Enter] The devices are not active.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -139,7 +141,7 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
// ian0513, 이게 여기 있어야 할까??, 무엇을 측정 하기 위한건지 명확히 알고 실제 공정이면 다른 밑의 Node 로 변경
|
||||
_UploadstartTime = DateTime.Now;
|
||||
|
||||
isFirst = true;
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
@ -149,8 +151,15 @@ namespace WeldingCommon.Sequences
|
||||
_LaserPowerCalParam.Initialize(_LaserPowerCalParam.PowerCalibrationCenterBeamCSVFile, _LaserPowerCalParam.PowerCalibrationRingBeamCSVFile);
|
||||
|
||||
_FlyOffsetX = 0;
|
||||
_FlyOffsetY = 0;
|
||||
|
||||
_FlyOffsetY = 0;
|
||||
if (_Scanner.Config.UseMarkingOnTheFly) {
|
||||
if (_InitParam.PageNum == 1 || _InitParam.PageNum == 2)
|
||||
_FlyOffsetY += _Scanner.Config.XDiff_Page1and2;
|
||||
|
||||
else
|
||||
_FlyOffsetY += _Scanner.Config.XDiff_Page3and4;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -159,7 +168,7 @@ namespace WeldingCommon.Sequences
|
||||
{
|
||||
//Device Init
|
||||
_Scanner = context.GetLaserScanner();
|
||||
_Laser = context.GetLaser();
|
||||
//_Laser = context.GetLaser();
|
||||
}
|
||||
|
||||
private bool CheckDeviceReady(SequenceContext context)
|
||||
@ -213,7 +222,7 @@ namespace WeldingCommon.Sequences
|
||||
{
|
||||
if (!CheckCondition()) {
|
||||
AlarmManager.Alarm(AlarmCode.ALARM_SEQUENCE_UploadWeldingList_CheckInitCondition);
|
||||
Log.E("Condition is not in state to start sequence.");
|
||||
Log.E("[CheckInitCondition] Condition is not in state to start sequence.");
|
||||
context.PutValue(ContextKey.KEY_SEQUENCE_RESULT, false);
|
||||
return SEQ_COMPLETE;
|
||||
}
|
||||
@ -221,46 +230,54 @@ namespace WeldingCommon.Sequences
|
||||
var startTime = DateTime.Now;
|
||||
context.PutValue(ContextKey.KEY_SEQUENCE_START_TIME, startTime);
|
||||
|
||||
Log.D("UploadWeldingList Sequence CheckInitCondition");
|
||||
Log.D("[CheckInitCondition] UploadWeldingList Sequence CheckInitCondition");
|
||||
return SEQ_MARKING_ON_THE_FLY_ON;
|
||||
}
|
||||
|
||||
// MOTF 지원 중
|
||||
// MOTF 지원 중
|
||||
private SequenceActionResult MarkingOnTheFlyOn(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
if (_Scanner.Config.UseMarkingOnTheFly) {
|
||||
if (_Scanner.Config.OnTheFlyCoordinate == eOntheFlyCoordinate.XY) {
|
||||
// 1. Linear Track OTF 활성화 및 엔코더 초기화
|
||||
_Scanner.SetFlyX(_Scanner.Config.MarkingOnTheFlyEncoderResolutionX);
|
||||
#region 260416 복원 -지운 내용 복원함.
|
||||
//if (_Scanner.Config.UseMarkingOnTheFly)
|
||||
//{
|
||||
// if (_Scanner.Config.OnTheFlyCoordinate == eOntheFlyCoordinate.XY)
|
||||
// {
|
||||
// // 1. Linear Track OTF 활성화 및 엔코더 초기화
|
||||
// _Scanner.SetFlyX(_Scanner.Config.MarkingOnTheFlyEncoderResolutionX);
|
||||
|
||||
// 2. 엔코더 특정 위치갈 때까지 대기
|
||||
_Scanner.WaitForEncoderX(_Scanner.Config.MarkingStartEncoderPositionX);
|
||||
// // 2. 엔코더 특정 위치갈 때까지 대기
|
||||
// _Scanner.WaitForEncoderX(_Scanner.Config.MarkingStartEncoderPositionX);
|
||||
|
||||
_FlyOffsetX = _Scanner.Config.MarkingOntheFlyOffsetX;
|
||||
_FlyOffsetY = _Scanner.Config.MarkingOntheFlyOffsetY;
|
||||
// _FlyOffsetX = _Scanner.Config.MarkingOntheFlyOffsetX;
|
||||
// _FlyOffsetY = _Scanner.Config.MarkingOntheFlyOffsetY;
|
||||
|
||||
} else if (_Scanner.Config.OnTheFlyCoordinate == eOntheFlyCoordinate.Rotate) {
|
||||
Log.I(string.Format("MOTF 사용, Rotate 보상"));
|
||||
// 1. 엔코더 값이 들어오면 바로 X(Rotary) Encoder 리셋
|
||||
_Scanner.SetFlyRotate(_Scanner.Config.MarkingOnTheFlyEncoderResolutionRotate);
|
||||
// }
|
||||
// else if (_Scanner.Config.OnTheFlyCoordinate == eOntheFlyCoordinate.Rotate)
|
||||
// {
|
||||
// Log.I(string.Format("MOTF 사용, Rotate 보상"));
|
||||
// // 1. 엔코더 값이 들어오면 바로 X(Rotary) Encoder 리셋
|
||||
// _Scanner.SetFlyRotate(_Scanner.Config.MarkingOnTheFlyEncoderResolutionRotate);
|
||||
|
||||
// 2. 일괄 회전.(OTW 세팅시, Encoder가 0부터 시작하므로)
|
||||
foreach (IDrawObject obj in _InitParam.SelectedDrawObjectList) {
|
||||
obj.Rotate(ROTATION_DEGREE, new UnitPoint(_Scanner.Config.MarkingOnTheFlyRotateCenterX, _Scanner.Config.MarkingOnTheFlyRotateCenterY)); // +15도 회전
|
||||
}
|
||||
// // 2. 일괄 회전.(OTW 세팅시, Encoder가 0부터 시작하므로)
|
||||
// foreach (IDrawObject obj in _InitParam.SelectedDrawObjectList)
|
||||
// {
|
||||
// obj.Rotate(ROTATION_DEGREE, new UnitPoint(_Scanner.Config.MarkingOnTheFlyRotateCenterX, _Scanner.Config.MarkingOnTheFlyRotateCenterY)); // +15도 회전
|
||||
// }
|
||||
|
||||
// 3. 원하는 용접 시작 각도 올 때까지 기다리기.
|
||||
double weldingAngle = _Scanner.Config.MarkingRangeMinRotate + ROTATION_DEGREE;
|
||||
_Scanner.WaitForEncoderRotateX(weldingAngle); // -5도부터 용접시작하고 싶으면 10도 넣으면 됨
|
||||
// // 3. 원하는 용접 시작 각도 올 때까지 기다리기.
|
||||
// double weldingAngle = _Scanner.Config.MarkingRangeMinRotate + ROTATION_DEGREE;
|
||||
// _Scanner.WaitForEncoderRotateX(weldingAngle); // -5도부터 용접시작하고 싶으면 10도 넣으면 됨
|
||||
|
||||
// _FlyOffsetX, _FlyOffsetY 값 설정 불필요, 0-0 이면 됨.
|
||||
}
|
||||
// // _FlyOffsetX, _FlyOffsetY 값 설정 불필요, 0-0 이면 됨.
|
||||
// }
|
||||
|
||||
// 엔코더 기록(용접 시작)
|
||||
_Scanner.StoreEncoder(0);
|
||||
_Scanner.SaveAndRestartTimer(); // 이전 용접의 T/T을 가져가고 싶으면 여기서 Reset 하기 전에 GetTime으로 읽어가야 함
|
||||
}
|
||||
// // 엔코더 기록(용접 시작)
|
||||
// _Scanner.StoreEncoder(0);
|
||||
// _Scanner.SaveAndRestartTimer(); // 이전 용접의 T/T을 가져가고 싶으면 여기서 Reset 하기 전에 GetTime으로 읽어가야 함
|
||||
//}
|
||||
#endregion
|
||||
|
||||
Log.I($"[MarkingOnTheFlyOn] Comp");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
@ -271,6 +288,8 @@ namespace WeldingCommon.Sequences
|
||||
_Scanner.SetTrigger(_Scanner.Config.RecordPeriod,
|
||||
_Scanner.Config.RecordSignalType1, _Scanner.Config.RecordSignalType2,
|
||||
_Scanner.Config.RecordSignalType3, _Scanner.Config.RecordSignalType4);
|
||||
|
||||
Log.I($"[RecordSignalOn] Scanner SetTrigger 1 {_Scanner.Config.RecordSignalType1.ToString()} ,2 {_Scanner.Config.RecordSignalType2.ToString()}, 3 {_Scanner.Config.RecordSignalType3.ToString()} ,4 {_Scanner.Config.RecordSignalType4.ToString()}");
|
||||
}
|
||||
|
||||
return SequenceAction.Ok();
|
||||
@ -280,24 +299,28 @@ namespace WeldingCommon.Sequences
|
||||
{
|
||||
//객체에 대한 파라미터 Load 전 lastX,Y를 현재 스캐너 위치로 받아옴
|
||||
_Scanner.GetXYPos(out _LastX, out _LastY);
|
||||
Log.I($"[LoadDrawObjectScannerParam] 현재 스캐너 위치 Last X ({_LastX}) Last Y ({_LastY})");
|
||||
|
||||
_ExternalCommandOffset.X = (float)_InitParam.CellMeasureCenterOffsetX;
|
||||
_ExternalCommandOffset.Y = (float)_InitParam.CellMeasureCenterOffsetY;
|
||||
|
||||
Log.I($"[LoadDrawObjectScannerParam] _ExternalCommandOffset X ({_ExternalCommandOffset.X}) Y ({_ExternalCommandOffset.Y})");
|
||||
// 첫번째 Object의 파라미터만 넣어주자?
|
||||
var scanParam = getScannerParameter(_InitParam.SelectedDrawObjectList.First());
|
||||
if (scanParam != null) {
|
||||
result.SettingPower = scanParam.LaserPower1 + scanParam.LaserPower2;
|
||||
result.SettingVelocity = scanParam.MarkSpeed;
|
||||
}
|
||||
|
||||
//ScannerParam param = ScannerCanvasUserCtrl.ScannerParams[obj.ScannerParamNo];
|
||||
int drawObjectCount = FuncLoadDrawObjectScannerParam(_InitParam.SelectedDrawObjectList);
|
||||
|
||||
Log.I($"[LoadDrawObjectScannerParam] SeqUploadWeldingList_OutParam : SettingPower ({result.SettingPower}) SettingVelocity ({result.SettingVelocity}) " +
|
||||
$"drawObjectCount : ({drawObjectCount})");
|
||||
//var weldingData = Status.GetProcessingWeldingData();
|
||||
//weldingData.UploadDatas[eUploadData.LaserWeldingRecipeNo].Value = context.Recipes.ActivatedRecipe().Id;
|
||||
//weldingData.UploadDatas[eUploadData.PreWeldingPointCount].Value = drawObjectCount;
|
||||
|
||||
//if (_PageNo == 1) {
|
||||
//if (_PageNo == 1)
|
||||
//{
|
||||
// weldingData.UploadDatas[eUploadData.CommonLaserDrawSpeed].Value = _ScannerParam.MarkSpeed;
|
||||
// weldingData.UploadDatas[eUploadData.CommonLaserJumpSpeed].Value = _ScannerParam.JumpSpeed;
|
||||
// weldingData.UploadDatas[eUploadData.CommonLaserMainPowerCore].Value = _ScannerParam.LaserPower1;
|
||||
@ -306,8 +329,10 @@ namespace WeldingCommon.Sequences
|
||||
// weldingData.UploadDatas[eUploadData.CommonLaserRampingLength_Starting].Value = _ScannerParam.RampingStartDist;
|
||||
// weldingData.UploadDatas[eUploadData.CommonLaserRampingPower_OverPath].Value = _ScannerParam.RampingEndPower;
|
||||
// weldingData.UploadDatas[eUploadData.CommonLaserRampingLength_OverPath].Value = _ScannerParam.RampingEndDist;
|
||||
//} else {
|
||||
// weldingData.UploadDatas[eUploadData.CathodeLaserDrawSpeed].Value = _ScannerParam.MarkSpeed;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// weldingData.UploadDatas[eUploadData.CathodeLaserDrawSpeed].Value = _ScannerParam.MarkSpeed;
|
||||
// weldingData.UploadDatas[eUploadData.CathodeLaserJumpSpeed].Value = _ScannerParam.JumpSpeed;
|
||||
// weldingData.UploadDatas[eUploadData.CathodeLaserMainPowerCore].Value = _ScannerParam.LaserPower1;
|
||||
// weldingData.UploadDatas[eUploadData.CathodeLaserMainPowerRing].Value = _ScannerParam.LaserPower2;
|
||||
@ -342,7 +367,7 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
//
|
||||
private int FuncLoadDrawObjectScannerParamSelected(IDrawObject obj)
|
||||
{
|
||||
if (!obj.Enabled)
|
||||
@ -363,6 +388,20 @@ namespace WeldingCommon.Sequences
|
||||
}
|
||||
|
||||
if (obj is Line) {
|
||||
if (isFirst && (_InitParam.PageNum == 3)) { // 이전 Point 정보가 있고 첫번째 Line인 경우 긴 Line 만들어 Upload
|
||||
Line LongLine = new Line();
|
||||
LongLine.PF1 = new PointF((float)_InitParam.LastX, (float)_InitParam.LastY - (float)(_Scanner.Config.XDiff_Page3and4 - _Scanner.Config.XDiff_Page1and2));
|
||||
LongLine.PF2 = obj.PF1;
|
||||
LoadLineScannerParam(LongLine);
|
||||
isFirst = false;
|
||||
}
|
||||
if (isFirst && (_InitParam.PageNum == 1)) { // 이전 Point 정보가 있고 첫번째 Line인 경우 긴 Line 만들어 Upload
|
||||
Line LongLine = new Line();
|
||||
LongLine.PF1 = new PointF((float)_InitParam.LastX, (float)_InitParam.LastY + (float)(_Scanner.Config.XDiff_Page3and4 - _Scanner.Config.XDiff_Page1and2));
|
||||
LongLine.PF2 = obj.PF1;
|
||||
LoadLineScannerParam(LongLine);
|
||||
isFirst = false;
|
||||
}
|
||||
LoadLineScannerParam((Line)obj);
|
||||
count++;
|
||||
} else if (obj is Dot) {
|
||||
@ -479,31 +518,31 @@ namespace WeldingCommon.Sequences
|
||||
else
|
||||
_CenterRingRatio = (int)Math.Round((double)(100 * param.LaserPower1) / (double)(param.LaserPower1 + param.LaserPower2), 0); // Discrete 한 값이라서 Ring은 오차 발생
|
||||
|
||||
if (_Laser.Config.TruFiberType == eTruFiberType.TruFiberS) { // TruFiberS Type은 비율 제어
|
||||
if (_CenterRingRatio == 0) { // Center가 0인경우
|
||||
//percentLaser1 = (float)_LaserPowerCalParam.CalibrateWattToPercent((double)param.LaserPower2, (uint)eAnalogPortOut.DA1);
|
||||
percentLaser1 = (float)(_LaserPowerCalParam.CalibrateWattToMeasuredVoltage((double)param.LaserPower2, (uint)LaserPowerCalParam.beamMode.Center));
|
||||
percentLaser1 = percentLaser1 * 10; // 스캐너에 입렵하기 위한 연산 ( 1V : 10 ~~ 10V : 100 )
|
||||
} else {
|
||||
//percentLaser1 = (float)_LaserPowerCalParam.CalibrateWattToPercent((double)param.LaserPower1 / (double)_CenterRingRatio * 100.0, (uint)eAnalogPortOut.DA1);
|
||||
percentLaser1 = (float)(_LaserPowerCalParam.CalibrateWattToMeasuredVoltage((double)param.LaserPower1 / (double)_CenterRingRatio * 100.0, (uint)LaserPowerCalParam.beamMode.Center));
|
||||
percentLaser1 = percentLaser1 * 10; // 스캐너에 입렵하기 위한 연산 ( 1V : 10 ~~ 10V : 100 )
|
||||
}
|
||||
percentLaser2 = 0;
|
||||
Log.D(string.Format("TruFiber S Models:: Original Power1 : {0}; Original Power2 : {1}; Calibrated Percent1 :{2:0.000}; Calibrated Percent2 :{3:0.000}; CenterRingRatio :{4:0.000}", param.LaserPower1, param.LaserPower2,percentLaser1,percentLaser2,_CenterRingRatio));
|
||||
} else if (_Laser.Config.TruFiberType == eTruFiberType.TruFiberP) { // Power제어
|
||||
percentLaser1 = 100;
|
||||
percentLaser2 = 0;
|
||||
Log.D(string.Format("TruFiber P Models:: Original Power1 : {0}; Original Power2 : {1}; Calibrated Percent1 :{2:0.000}; Calibrated Percent2 :{3:0.000}; CenterRingRatio :{4:0.000}", param.LaserPower1, param.LaserPower2, percentLaser1, percentLaser2, _CenterRingRatio));
|
||||
} else if (_Laser.Config.TruFiberType == eTruFiberType.CalPercentToMeasuredVoltage) {
|
||||
percentLaser1 = (float)_LaserPowerCalParam.CalibrateWattToMeasuredVoltage(param.LaserPower1, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
percentLaser2 = (float)_LaserPowerCalParam.CalibrateWattToMeasuredVoltage(param.LaserPower2, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
Log.D(string.Format("CalPercentToMeasuredVoltage Models:: Original Power1 : {0}; Original Power2 : {1}; Calibrated Percent1 :{2:0.000}; Calibrated Percent2 :{3:0.000}; CenterRingRatio :{4:0.000}", param.LaserPower1, param.LaserPower2, percentLaser1, percentLaser2, _CenterRingRatio));
|
||||
} else {
|
||||
//if (_Laser.Config.TruFiberType == eTruFiberType.TruFiberS) { // TruFiberS Type은 비율 제어
|
||||
// if (_CenterRingRatio == 0) { // Center가 0인경우
|
||||
// //percentLaser1 = (float)_LaserPowerCalParam.CalibrateWattToPercent((double)param.LaserPower2, (uint)eAnalogPortOut.DA1);
|
||||
// percentLaser1 = (float)(_LaserPowerCalParam.CalibrateWattToMeasuredVoltage((double)param.LaserPower2, (uint)LaserPowerCalParam.beamMode.Center));
|
||||
// percentLaser1 = percentLaser1 * 10; // 스캐너에 입렵하기 위한 연산 ( 1V : 10 ~~ 10V : 100 )
|
||||
// } else {
|
||||
// //percentLaser1 = (float)_LaserPowerCalParam.CalibrateWattToPercent((double)param.LaserPower1 / (double)_CenterRingRatio * 100.0, (uint)eAnalogPortOut.DA1);
|
||||
// percentLaser1 = (float)(_LaserPowerCalParam.CalibrateWattToMeasuredVoltage((double)param.LaserPower1 / (double)_CenterRingRatio * 100.0, (uint)LaserPowerCalParam.beamMode.Center));
|
||||
// percentLaser1 = percentLaser1 * 10; // 스캐너에 입렵하기 위한 연산 ( 1V : 10 ~~ 10V : 100 )
|
||||
// }
|
||||
// percentLaser2 = 0;
|
||||
// Log.D(string.Format("TruFiber S Models:: Original Power1 : {0}; Original Power2 : {1}; Calibrated Percent1 :{2:0.000}; Calibrated Percent2 :{3:0.000}; CenterRingRatio :{4:0.000}", param.LaserPower1, param.LaserPower2,percentLaser1,percentLaser2,_CenterRingRatio));
|
||||
//} else if (_Laser.Config.TruFiberType == eTruFiberType.TruFiberP) { // Power제어
|
||||
// percentLaser1 = 100;
|
||||
// percentLaser2 = 0;
|
||||
// Log.D(string.Format("TruFiber P Models:: Original Power1 : {0}; Original Power2 : {1}; Calibrated Percent1 :{2:0.000}; Calibrated Percent2 :{3:0.000}; CenterRingRatio :{4:0.000}", param.LaserPower1, param.LaserPower2, percentLaser1, percentLaser2, _CenterRingRatio));
|
||||
//} else if (_Laser.Config.TruFiberType == eTruFiberType.CalPercentToMeasuredVoltage) {
|
||||
// percentLaser1 = (float)_LaserPowerCalParam.CalibrateWattToMeasuredVoltage(param.LaserPower1, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
// percentLaser2 = (float)_LaserPowerCalParam.CalibrateWattToMeasuredVoltage(param.LaserPower2, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
// Log.D(string.Format("CalPercentToMeasuredVoltage Models:: Original Power1 : {0}; Original Power2 : {1}; Calibrated Percent1 :{2:0.000}; Calibrated Percent2 :{3:0.000}; CenterRingRatio :{4:0.000}", param.LaserPower1, param.LaserPower2, percentLaser1, percentLaser2, _CenterRingRatio));
|
||||
//} else {
|
||||
percentLaser1 = (float)_LaserPowerCalParam.CalibrateWattToPercent(param.LaserPower1, (uint)eAnalogPortOut.DA1);
|
||||
percentLaser2 = (float)_LaserPowerCalParam.CalibrateWattToPercent(param.LaserPower2, (uint)eAnalogPortOut.DA2);
|
||||
Log.D(string.Format("Normal Models:: Original Power1 : {0}; Original Power2 : {1}; Calibrated Percent1 :{2:0.000}; Calibrated Percent2 :{3:0.000}; CenterRingRatio :{4:0.000}", param.LaserPower1, param.LaserPower2, percentLaser1, percentLaser2, _CenterRingRatio));
|
||||
}
|
||||
//}
|
||||
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, percentLaser1, eFunctionType.LIST);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, percentLaser2, eFunctionType.LIST);
|
||||
@ -696,7 +735,8 @@ namespace WeldingCommon.Sequences
|
||||
}
|
||||
// END- 시작위치 점프 관련 설정
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// Wobble, PowerProfile, Ramping을 사용하지 않는 일반적인 경우 이쪽으로 들어옴
|
||||
|
||||
// START- Jump(Line Shot)
|
||||
@ -743,9 +783,10 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
_Scanner.MarkAbs(obj.PF2.X + xOffset, obj.PF2.Y + yOffset);
|
||||
|
||||
Log.I(string.Format($"[RCC Subpath Line Weld] Mark(Ramping) ({obj.PF2.X},{obj.PF2.Y})"));
|
||||
Log.I(string.Format($"[RCC Subpath Line Weld] Mark(Ramping) ({obj.PF2.X + xOffset},{obj.PF2.Y + yOffset})"));
|
||||
|
||||
} else if ((param.RampingStartDist > 0 || param.RampingEndDist > 0) && (param.RampingEndDist + param.RampingStartDist <= obj.Distance)) {
|
||||
}
|
||||
else if ((param.RampingStartDist > 0 || param.RampingEndDist > 0) && (param.RampingEndDist + param.RampingStartDist <= obj.Distance)) {
|
||||
// RCC 가 아닌 경우
|
||||
_Scanner.SetVectorControl((uint)eAutoControlParameter.AnalogOut1, 0);
|
||||
_Scanner.SetScannerDelay(param.JumpDelay, param.MarkDelay, 0);
|
||||
@ -792,7 +833,8 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
Log.I(string.Format($"[Line Weld] Mark(Ramping) ({obj.PF2.X},{obj.PF2.Y})"));
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// Ramping 이 없는 경우
|
||||
_Scanner.SetVectorControl((uint)eAutoControlParameter.AnalogOut1, 0);
|
||||
|
||||
@ -809,7 +851,7 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
//_scanner._scannerObj.SetVectorControl((uint)eAutoControlParameter.NoUse, 0);
|
||||
|
||||
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+ xOffset},{obj.PF2.Y+ yOffset})"));
|
||||
}
|
||||
// END- Mark
|
||||
|
||||
@ -1497,25 +1539,31 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
private SequenceActionResult MarkingOnTheFlyOff(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
if (_Scanner.Config.UseMarkingOnTheFly) {
|
||||
if (_Scanner.Config.OnTheFlyCoordinate == eOntheFlyCoordinate.XY) {
|
||||
// Linear OTW의 경우, 각 Draw Tool에서 좌표 오프셋을 해 주고 있음
|
||||
#region 260416 주석 처리한 내용 복원함 . - 레시피 가공 자체가 안 됨
|
||||
//if (_Scanner.Config.UseMarkingOnTheFly)
|
||||
//{
|
||||
// if (_Scanner.Config.OnTheFlyCoordinate == eOntheFlyCoordinate.XY)
|
||||
// {
|
||||
// // Linear OTW의 경우, 각 Draw Tool에서 좌표 오프셋을 해 주고 있음
|
||||
|
||||
} else if (_Scanner.Config.OnTheFlyCoordinate == eOntheFlyCoordinate.Rotate) {
|
||||
// 여기서 원래 레시피로 돌려주기
|
||||
foreach (IDrawObject obj in _InitParam.SelectedDrawObjectList) {
|
||||
obj.Rotate(ROTATION_DEGREE * -1, new UnitPoint(_Scanner.Config.MarkingOnTheFlyRotateCenterX, _Scanner.Config.MarkingOnTheFlyRotateCenterY)); // -15도 회전
|
||||
}
|
||||
}
|
||||
// }
|
||||
// else if (_Scanner.Config.OnTheFlyCoordinate == eOntheFlyCoordinate.Rotate)
|
||||
// {
|
||||
// // 여기서 원래 레시피로 돌려주기
|
||||
// foreach (IDrawObject obj in _InitParam.SelectedDrawObjectList)
|
||||
// {
|
||||
// obj.Rotate(ROTATION_DEGREE * -1, new UnitPoint(_Scanner.Config.MarkingOnTheFlyRotateCenterX, _Scanner.Config.MarkingOnTheFlyRotateCenterY)); // -15도 회전
|
||||
// }
|
||||
// }
|
||||
|
||||
// 추후, Parking Position 을 용접 시작 위치로 자동으로 계산되어 들어가게 개선 필요
|
||||
_Scanner.Fly_Return(_Scanner.Config.MarkingOntheFlyParkingPositionX, _Scanner.Config.MarkingOntheFlyParkingPositionY);
|
||||
|
||||
// 엔코더 기록(용접 완료)
|
||||
_Scanner.StoreEncoder(1);
|
||||
_Scanner.SaveAndRestartTimer();
|
||||
}
|
||||
// // 추후, Parking Position 을 용접 시작 위치로 자동으로 계산되어 들어가게 개선 필요
|
||||
// _Scanner.Fly_Return(_Scanner.Config.MarkingOntheFlyParkingPositionX, _Scanner.Config.MarkingOntheFlyParkingPositionY);
|
||||
|
||||
// // 엔코더 기록(용접 완료)
|
||||
// _Scanner.StoreEncoder(1);
|
||||
// _Scanner.SaveAndRestartTimer();
|
||||
//}
|
||||
#endregion
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
@ -1526,6 +1574,8 @@ namespace WeldingCommon.Sequences
|
||||
_Scanner.SetTrigger(0,
|
||||
_Scanner.Config.RecordSignalType1, _Scanner.Config.RecordSignalType2,
|
||||
_Scanner.Config.RecordSignalType3, _Scanner.Config.RecordSignalType4);
|
||||
|
||||
Log.I($"[RecordSignalOff] 기록 종료 ");
|
||||
}
|
||||
|
||||
return SequenceAction.Ok();
|
||||
@ -1533,8 +1583,10 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
private SequenceActionResult SaveResultData(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
|
||||
// 결과 Data 를 업데이트 함.
|
||||
context.PutValue(ContextKey.KEY_SEQUENCE_RESULT, true);
|
||||
Log.I($"[SaveResultData] KEY_SEQUENCE_RESULT : true ");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
@ -1542,14 +1594,14 @@ namespace WeldingCommon.Sequences
|
||||
{
|
||||
// 완료 비트 write 하는 Node 추가 필요. format 유지, SeqScoutNormal 없음
|
||||
|
||||
Log.D("UploadWeldingList Sequence WriteCompletionPLCBit");
|
||||
Log.D("[WriteCompletionPLCBit] UploadWeldingList Sequence WriteCompletionPLCBit");
|
||||
return SequenceAction.Ok();
|
||||
}
|
||||
|
||||
private SequenceActionResult Complete(SequenceContext context, string id, SequenceActionResult param)
|
||||
{
|
||||
RestoreDeviceStatus();
|
||||
Log.I("UploadWeldingList Complete");
|
||||
Log.I("[Complete] UploadWeldingList Complete");
|
||||
|
||||
_UploadSpanTime = DateTime.Now.Subtract(_UploadstartTime);
|
||||
Log.D(string.Format($"[SeqUploadWeldingList] UploadWeldingList Complete Time : {_UploadSpanTime.TotalMilliseconds}"));
|
||||
@ -1600,6 +1652,10 @@ namespace WeldingCommon.Sequences
|
||||
|
||||
public List<IDrawObject> SelectedDrawObjectList { get; set; }
|
||||
public eListNo WeldingScannerListNo { get; set; }
|
||||
|
||||
public double PageNum { get; set; }
|
||||
public double LastX { get; set; }
|
||||
public double LastY { get; set; }
|
||||
}
|
||||
|
||||
public class SeqUploadWeldingList_OutParam : OutParam
|
||||
|
||||
@ -576,7 +576,8 @@ namespace WeldingCommon.Utils
|
||||
// 다른 프로세스도 파일 읽고 쓸 수 있도록.
|
||||
FileStream FileStream = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
|
||||
|
||||
StreamWriter sw = new StreamWriter(FileStream, System.Text.Encoding.Unicode);
|
||||
StreamWriter sw = new StreamWriter(FileStream, System.Text.Encoding.Unicode); // 26.04.15 기존 코드 주석처리함
|
||||
//StreamWriter sw = new StreamWriter(FileStream, System.Text.Encoding.UTF8); // 26.04.15 변경 코드 UTF8로 변경 log 깨짐 현상
|
||||
|
||||
if (isFile) {
|
||||
sw.WriteLine(strItem);
|
||||
|
||||
@ -89,8 +89,8 @@
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<UniformGrid Grid.Column="0" Rows="3">
|
||||
<usercontrols:UCKeyValue KeyText="Row" Value="{Binding GridRowCount}" DecimalPlaces="0" Unit="count" KeyHorizontalAlignment="Right" KeyTextWidth="0.9*" />
|
||||
<usercontrols:UCKeyValue KeyText="Column" Value="{Binding GridColumnCount}" DecimalPlaces="0" Unit="count" KeyHorizontalAlignment="Right" KeyTextWidth="0.9*" />
|
||||
<usercontrols:UCKeyValue KeyText="Row" Value="{Binding GridRowCount}" DecimalPlaces="0" Unit="count" KeyHorizontalAlignment="Right" KeyTextWidth="0.9*" ToolTip="+패턴 찾기 위해서 홀수입력" />
|
||||
<usercontrols:UCKeyValue KeyText="Column" Value="{Binding GridColumnCount}" DecimalPlaces="0" Unit="count" KeyHorizontalAlignment="Right" KeyTextWidth="0.9*" ToolTip="+패턴 찾기 위해서 홀수입력"/>
|
||||
<usercontrols:UCKeyValue KeyText="Unit Length" Value="{Binding UnitLength}" DecimalPlaces="0" Unit="mm" KeyHorizontalAlignment="Right" KeyTextWidth="0.9*" />
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Column="1" Rows="3">
|
||||
|
||||
@ -29,7 +29,8 @@ using WeldingCommon.Settings;
|
||||
using WeldingCommon.Utils;
|
||||
using WeldingCommon.Process;
|
||||
using static CoreUnit.Control.UserControl.Canvas.WeldingParameterIDEditor;
|
||||
using System.Diagnostics; //Process.Start
|
||||
using System.Diagnostics;
|
||||
using Aurora.Util.HislogPlus; //Process.Start
|
||||
|
||||
namespace WeldingCommon.Views
|
||||
{
|
||||
@ -135,7 +136,7 @@ namespace WeldingCommon.Views
|
||||
|
||||
_Scanner = _Aurora.DeviceManager[CommonDeviceIds.Scanner] as Scanner;
|
||||
_Laser = _Aurora.DeviceManager[CommonDeviceIds.Laser] as Laser;
|
||||
_LaserConfig = _Aurora.DeviceManager.GetDeviceConfig(_Laser.DeviceId) as LaserConfig;
|
||||
//_LaserConfig = _Aurora.DeviceManager.GetDeviceConfig(_Laser.DeviceId) as LaserConfig;
|
||||
_ScannerConfig = _Aurora.DeviceManager.GetDeviceConfig(_Scanner.DeviceId) as ScannerConfig;
|
||||
|
||||
//_SeqMarkGrid = _Aurora.SequenceEntry[CommonSequenceIds.SeqMarkGrid] as ISequence;
|
||||
@ -210,11 +211,18 @@ namespace WeldingCommon.Views
|
||||
CurrentY = yPos;
|
||||
}
|
||||
|
||||
if (_Laser.GetLaserReady()) {
|
||||
LaserStatus = true;
|
||||
} else {
|
||||
LaserStatus = false;
|
||||
if (_Laser != null)
|
||||
{
|
||||
if (_Laser.GetLaserReady())
|
||||
{
|
||||
LaserStatus = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LaserStatus = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnUpdateCorrectionTable(EventMessage obj)
|
||||
@ -480,7 +488,7 @@ namespace WeldingCommon.Views
|
||||
_SeqScannerCalibration.Start(param, OnCompleteScannerCalibration);
|
||||
|
||||
}
|
||||
|
||||
//_SeqScannerCalibration 이 시퀸스가 시작된다. IsSequenceRunning_ScannerCalibration param의 값이 result가 성공해야 성공
|
||||
private void OnCompleteScannerCalibration(SequenceActionResult res)
|
||||
{
|
||||
if (res != null) {
|
||||
|
||||
@ -112,12 +112,12 @@ namespace WeldingCommon.Views.ACS
|
||||
ACS = _env.DeviceManager[CommonDeviceIds.ACS] as ScannerACS;
|
||||
|
||||
MotorX = _env.DeviceManager[CommonMotorIds.AxisX2] as ACSMotor;
|
||||
MotorY1 = _env.DeviceManager[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
MotorY2 = _env.DeviceManager[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
//MotorY1 = _env.DeviceManager[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
//MotorY2 = _env.DeviceManager[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
MotorZ = _env.DeviceManager[CommonMotorIds.AxisZ] as ACSMotor;
|
||||
|
||||
XAxis = MotorX;
|
||||
YAxis = MotorY1;
|
||||
//YAxis = MotorY1;
|
||||
ZAxis = MotorZ;
|
||||
|
||||
CurrentPosUpdateTimer = CreateTimer(
|
||||
|
||||
@ -57,7 +57,11 @@
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<local:UCScannerMotion Grid.Row="0" Margin="5 0 0 0" DataContext="{Binding ScannerMotionViewModel}"></local:UCScannerMotion>
|
||||
<local:UCScannerLaserControl Grid.Row="1" Margin="5 5 0 0" DataContext="{Binding ScannerLaserControlViewModel}"></local:UCScannerLaserControl>
|
||||
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
||||
<local:UCScannerLaserControl Margin="5 5 0 0" DataContext="{Binding ScannerLaserControlViewModel}"></local:UCScannerLaserControl>
|
||||
</ScrollViewer>
|
||||
<!--local:UCScannerLaserControl Grid.Row="1" Margin="5 5 0 0" DataContext="{Binding ScannerLaserControlViewModel}"></local:UCScannerLaserControl>-->
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ namespace WeldingCommon.Views
|
||||
{
|
||||
private readonly Logger Log = new Logger("UCManualScannerOperationViewModel");
|
||||
|
||||
public ICommand CMD_ShowSelectFieldWindow { get; }
|
||||
public ICommand CMD_ShowSelectFieldWindow { get; } // 메뉴얼의 SelectField 팝업 버튼
|
||||
|
||||
private readonly IAuroraEnvironment _Aurora;
|
||||
|
||||
|
||||
@ -28,13 +28,13 @@
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Grid.Row="0" Header="Manual Laser Power Control" Margin="0 3 3 0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.5*"></ColumnDefinition>
|
||||
@ -44,7 +44,7 @@
|
||||
<Grid Margin="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Grid.Row="0" Rows="4">
|
||||
<usercontrols:UCKeyValue KeyText="Power #1" Value="{Binding LaserPower1Percent}" DecimalPlaces="0" Unit="%" KeyHorizontalAlignment="Right" KeyTextWidth="0.5*" />
|
||||
@ -63,14 +63,14 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Header="Timer Set" Style="{StaticResource StGroupBox4th}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" BorderBrush="Gray" BorderThickness="0.5">
|
||||
<mah:ToggleSwitch Grid.Row="0" HorizontalAlignment="Center" FontSize="12" FontWeight="Bold"
|
||||
@ -122,7 +122,7 @@
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.5*"></ColumnDefinition>
|
||||
@ -132,7 +132,7 @@
|
||||
<Grid Margin="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Grid.Row="0" Rows="4">
|
||||
<usercontrols:UCKeyValue KeyText="Power #1" Value="{Binding LaserPower1Watt}" DecimalPlaces="0" Unit="W" KeyHorizontalAlignment="Right" KeyTextWidth="0.5*" />
|
||||
@ -151,14 +151,14 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Header="Timer Set" Style="{StaticResource StGroupBox4th}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" BorderBrush="Gray" BorderThickness="0.5">
|
||||
<mah:ToggleSwitch Grid.Row="0" HorizontalAlignment="Center" FontSize="12" FontWeight="Bold"
|
||||
@ -207,19 +207,19 @@
|
||||
|
||||
|
||||
|
||||
<GroupBox Grid.Row="2" Header="Marking On The Fly" Margin="0 3 3 0" Visibility="{Binding IsUseMarkingOnTheFly, Converter={StaticResource convTrueVisible}}">
|
||||
<GroupBox Grid.Row="2" Header="Marking On The Fly" Margin="0 3 3 0" IsEnabled="{Binding IsUseMarkingOnTheFly}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Header="Encoder Value" Grid.Row="0" Margin="0 5 0 0" Style="{StaticResource StGroupBox4th}">
|
||||
<Grid Margin="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
@ -240,7 +240,7 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Grid.Column="0" MinHeight="30">
|
||||
<TextBlock Margin="10 0" FontSize="12" Foreground="#FFBBBBBB" FontWeight="Bold" Text="X Dir FieldOut" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
||||
@ -267,7 +267,7 @@
|
||||
<Grid Margin="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
|
||||
@ -40,7 +40,7 @@ namespace WeldingCommon.Views
|
||||
private readonly IAuroraEnvironment _Aurora;
|
||||
|
||||
private readonly LaserConfig _LaserConfig;
|
||||
private readonly Scanner _Scanner;
|
||||
private readonly Scanner _Scanner; // 스캐너
|
||||
private readonly Laser _Laser;
|
||||
private readonly ScannerConfig _ScannerConfig;
|
||||
|
||||
@ -111,9 +111,9 @@ namespace WeldingCommon.Views
|
||||
_Aurora = aurora;
|
||||
|
||||
_Scanner = _Aurora.DeviceManager[scannerId] as Scanner;
|
||||
_Laser = _Aurora.DeviceManager[CommonDeviceIds.Laser] as Laser;
|
||||
//_Laser = _Aurora.DeviceManager[CommonDeviceIds.Laser] as Laser;
|
||||
|
||||
_LaserConfig = _Aurora.DeviceManager.GetDeviceConfig(_Laser.DeviceId) as AuroraLaser.LaserConfig;
|
||||
//_LaserConfig = _Aurora.DeviceManager.GetDeviceConfig(_Laser.DeviceId) as AuroraLaser.LaserConfig;
|
||||
_ScannerConfig = _Aurora.DeviceManager.GetDeviceConfig(scannerId) as ScannerConfig;
|
||||
|
||||
_SeqTeachingRun = _Aurora.SequenceEntry[CommonSequenceIds.SeqComponentTeachingRun];
|
||||
@ -122,9 +122,9 @@ namespace WeldingCommon.Views
|
||||
InitVariable();
|
||||
|
||||
CMD_VisibleChanged = new DelegateCommand(VisibleChanged);
|
||||
CMD_LaserShotOnPercent = new DelegateCommand(PerformCmdLaserShotOnPercent);
|
||||
CMD_LaserShotOnWatt = new DelegateCommand(PerformCmdLaserShotOnWatt);
|
||||
CMD_LaserShotOff = new DelegateCommand(PerformCmdLaserShotOff);
|
||||
CMD_LaserShotOnPercent = new DelegateCommand(PerformCmdLaserShotOnPercent); //레이저 온 퍼센트 적용
|
||||
CMD_LaserShotOnWatt = new DelegateCommand(PerformCmdLaserShotOnWatt); // 레이저 온 와트 적용
|
||||
CMD_LaserShotOff = new DelegateCommand(PerformCmdLaserShotOff); //레이저 끄기
|
||||
|
||||
CMD_ActivateOnTheFly = new DelegateCommand(PerformCmdActivateOnTheFly);
|
||||
CMD_DeactivateOnTheFly = new DelegateCommand(PerformCmdDeactivateOnTheFly);
|
||||
@ -156,17 +156,24 @@ namespace WeldingCommon.Views
|
||||
private void VisibleChanged(object obj)
|
||||
{
|
||||
bool visible = (bool)obj;
|
||||
if (visible) {
|
||||
if (visible)
|
||||
{
|
||||
//Init_XYLimitPos();
|
||||
|
||||
// 26.04.16 NDY - 탭 활성화 시마다 ScannerConfig에서 최신값 반영
|
||||
IsUseMarkingOnTheFly = _ScannerConfig?.UseMarkingOnTheFly ?? false;
|
||||
_MonitorTimer.Start();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
_MonitorTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMonitoring(object sender, EventArgs e)
|
||||
{
|
||||
if (_Scanner.IsActivated == false) {
|
||||
if (_Scanner.IsActivated == false)
|
||||
{
|
||||
Log.D(string.Format("[OnMonitoring] Check Scanner device Connect. ScannerLaserControl view OnMonitoring Stop"));
|
||||
MessageUtil.ShowWarningToast(string.Format("Check Scanner device Connect."));
|
||||
|
||||
@ -174,9 +181,12 @@ namespace WeldingCommon.Views
|
||||
}
|
||||
|
||||
double encoderX, encoderY;
|
||||
if (_ScannerConfig.OnTheFlyCoordinate == eOntheFlyCoordinate.XY) {
|
||||
if (_ScannerConfig.OnTheFlyCoordinate == eOntheFlyCoordinate.XY)
|
||||
{
|
||||
_Scanner.GetEncoder(out encoderX, out encoderY, false);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
_Scanner.GetEncoder(out encoderX, out encoderY, true);
|
||||
}
|
||||
|
||||
@ -200,16 +210,22 @@ namespace WeldingCommon.Views
|
||||
markingInfo = _Scanner.GetMarkingInfo();
|
||||
|
||||
// x 범위 초과
|
||||
if ((markingInfo & 0x0001) == 0x0001 || (markingInfo & 0x0002) == 0x0002) {
|
||||
if ((markingInfo & 0x0001) == 0x0001 || (markingInfo & 0x0002) == 0x0002)
|
||||
{
|
||||
IsFieldOutX = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
IsFieldOutX = false;
|
||||
}
|
||||
|
||||
// y 범위 초과
|
||||
if ((markingInfo & 0x0004) == 0x0004 || (markingInfo & 0x0008) == 0x0008) {
|
||||
if ((markingInfo & 0x0004) == 0x0004 || (markingInfo & 0x0008) == 0x0008)
|
||||
{
|
||||
IsFieldOutY = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
IsFieldOutY = false;
|
||||
}
|
||||
|
||||
@ -219,19 +235,26 @@ namespace WeldingCommon.Views
|
||||
|
||||
uint IsList1Busy = readStatus & 16;
|
||||
uint IsList2Busy = readStatus & 32;
|
||||
if (IsList1Busy == 16) {
|
||||
if (IsList1Busy == 16)
|
||||
{
|
||||
busyStatus = "List1";
|
||||
if (_BeforeBusyList != 1) {
|
||||
if (_BeforeBusyList != 1)
|
||||
{
|
||||
_ListIterationCount++;
|
||||
}
|
||||
_BeforeBusyList = 1;
|
||||
} else if (IsList2Busy == 32) {
|
||||
}
|
||||
else if (IsList2Busy == 32)
|
||||
{
|
||||
busyStatus = "List2";
|
||||
if (_BeforeBusyList != 2) {
|
||||
if (_BeforeBusyList != 2)
|
||||
{
|
||||
_ListIterationCount++;
|
||||
}
|
||||
_BeforeBusyList = 2;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
busyStatus = "N/A";
|
||||
}
|
||||
|
||||
@ -241,22 +264,26 @@ namespace WeldingCommon.Views
|
||||
|
||||
private void PerformCmdLaserShotOnPercent(object obj)
|
||||
{
|
||||
if (IsUseLaserAutoOffChecked) {
|
||||
if (_Scanner.GetBusyStatus()) {
|
||||
if (IsUseLaserAutoOffChecked)
|
||||
{
|
||||
if (_Scanner.GetBusyStatus())
|
||||
{
|
||||
MessageUtil.ShowWarningToast(string.Format("Laser, Scanner is busy."));
|
||||
return;
|
||||
}
|
||||
if (!_Laser.GetLaserReady()) {
|
||||
MessageUtil.ShowWarningToast(string.Format("Laser, Check Laser Ready status."));
|
||||
return;
|
||||
}
|
||||
//if (!_Laser.GetLaserReady()) {
|
||||
// MessageUtil.ShowWarningToast(string.Format("Laser, Check Laser Ready status."));
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (_SeqTeachingRun.RunState == SequenceRunState.Running) {
|
||||
if (_SeqTeachingRun.RunState == SequenceRunState.Running)
|
||||
{
|
||||
MessageUtil.ShowWarningToast(string.Format("이미 시퀀스가 Start 상태입니다.", "Laser On"), Log);
|
||||
return;
|
||||
}
|
||||
var currentModelInfo = EquipmentSpecificModelUtil.GetCurrentRecipeEquipmentSpecificModel();
|
||||
if (currentModelInfo.equipmentSpecificModel == null) {
|
||||
if (currentModelInfo.equipmentSpecificModel == null)
|
||||
{
|
||||
MessageUtil.ShowWarningToast(string.Format("선택된 model 이 없습니다.", "Laser On"));
|
||||
return;
|
||||
}
|
||||
@ -264,81 +291,8 @@ namespace WeldingCommon.Views
|
||||
var intervalTimeBlowOn = 0;
|
||||
var intervalTimeBlowOff = 0;
|
||||
|
||||
if (currentModelInfo.equipmentSpecificModel.UseBlow) {
|
||||
intervalTimeBlowOn = currentModelInfo.equipmentSpecificModel.IntervalTimeBlowOn;
|
||||
intervalTimeBlowOff = currentModelInfo.equipmentSpecificModel.IntervalTimeBlowOff;
|
||||
}
|
||||
|
||||
// Object를 만들어
|
||||
var param = new SeqTeachingRun_InitParam() {
|
||||
IsUseExternalObjects = true,
|
||||
ExternalObjects = CreateDotForLaserOn(),
|
||||
|
||||
//UseStream = _EquipmentInfo.UseStream,
|
||||
UseStream = currentModelInfo.equipmentSpecificModel.UseStream,
|
||||
|
||||
UseBlow = currentModelInfo.equipmentSpecificModel.UseBlow,
|
||||
IntervalTimeBlowOn = intervalTimeBlowOn,
|
||||
IntervalTimeBlowOff = intervalTimeBlowOff,
|
||||
|
||||
NeedSetLaserTiming = true,
|
||||
};
|
||||
|
||||
_SeqTeachingRun.Start(param, OnCompleteMarkGrid);
|
||||
} else {
|
||||
LaserPowerCalParam powerCalParam = Status.AuroraEnv.SettingEntry[CommonSettingIds.LaserPowerCalParam] as LaserPowerCalParam;
|
||||
float powerVolt1 = 0, powerVolt2 = 0;
|
||||
|
||||
powerCalParam.Initialize(powerCalParam.PowerCalibrationCenterBeamCSVFile, powerCalParam.PowerCalibrationRingBeamCSVFile);
|
||||
|
||||
if (_LaserConfig.TruFiberType == eTruFiberType.TruFiberS) {
|
||||
powerVolt1 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower1Percent) * 10;
|
||||
} else if(_LaserConfig.TruFiberType == eTruFiberType.TruFiberP){
|
||||
powerVolt1 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower1Percent, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
powerVolt2 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower2Percent, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
} else if (_Laser.Config.TruFiberType == eTruFiberType.CalPercentToMeasuredVoltage) {
|
||||
powerVolt1 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower1Percent, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
powerVolt2 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower2Percent, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
} else {
|
||||
powerVolt1 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower1Percent, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
powerVolt2 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower2Percent, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
}
|
||||
Thread.Sleep(50);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, powerVolt1, eFunctionType.COMMAND);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, powerVolt2, eFunctionType.COMMAND);
|
||||
_Scanner.SetLaserPulseCtrl(LaserPeriod * 1000, LaserPulseWidth);
|
||||
//_Scanner.SetLaserTiming(LaserPeriod * 1000, LaserPulseWidth, LaserPulseWidth);
|
||||
//_Scanner.SetStandby(LaserPeriod * 1000, LaserPulseWidth);
|
||||
_Scanner.LaserSignalOn();
|
||||
}
|
||||
}
|
||||
private void PerformCmdLaserShotOnWatt(object obj)
|
||||
{
|
||||
|
||||
if (IsUseLaserAutoOffChecked) {
|
||||
if (_Scanner.GetBusyStatus()) {
|
||||
MessageUtil.ShowWarningToast(string.Format("Laser, Scanner is busy."));
|
||||
return;
|
||||
}
|
||||
if (!_Laser.GetLaserReady()) {
|
||||
MessageUtil.ShowWarningToast(string.Format("Laser, Check Laser Ready status."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (_SeqTeachingRun.RunState == SequenceRunState.Running) {
|
||||
MessageUtil.ShowWarningToast(string.Format("이미 시퀀스가 Start 상태입니다.", "Laser On"), Log);
|
||||
return;
|
||||
}
|
||||
var currentModelInfo = EquipmentSpecificModelUtil.GetCurrentRecipeEquipmentSpecificModel();
|
||||
if (currentModelInfo.equipmentSpecificModel == null) {
|
||||
MessageUtil.ShowWarningToast(string.Format("선택된 model 이 없습니다.", "Laser On"));
|
||||
return;
|
||||
}
|
||||
|
||||
var intervalTimeBlowOn = 0;
|
||||
var intervalTimeBlowOff = 0;
|
||||
|
||||
if (currentModelInfo.equipmentSpecificModel.UseBlow) {
|
||||
if (currentModelInfo.equipmentSpecificModel.UseBlow)
|
||||
{
|
||||
intervalTimeBlowOn = currentModelInfo.equipmentSpecificModel.IntervalTimeBlowOn;
|
||||
intervalTimeBlowOff = currentModelInfo.equipmentSpecificModel.IntervalTimeBlowOff;
|
||||
}
|
||||
@ -360,25 +314,86 @@ namespace WeldingCommon.Views
|
||||
};
|
||||
|
||||
_SeqTeachingRun.Start(param, OnCompleteMarkGrid);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
LaserPowerCalParam powerCalParam = Status.AuroraEnv.SettingEntry[CommonSettingIds.LaserPowerCalParam] as LaserPowerCalParam;
|
||||
float powerVolt1 = 0, powerVolt2 = 0;
|
||||
|
||||
powerCalParam.Initialize(powerCalParam.PowerCalibrationCenterBeamCSVFile, powerCalParam.PowerCalibrationRingBeamCSVFile);
|
||||
powerVolt1 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower1Percent, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
powerVolt2 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower2Percent, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
Thread.Sleep(50);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, powerVolt1, eFunctionType.COMMAND);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, powerVolt2, eFunctionType.COMMAND);
|
||||
_Scanner.SetLaserPulseCtrl(LaserPeriod * 1000, LaserPulseWidth);
|
||||
//_Scanner.SetLaserTiming(LaserPeriod * 1000, LaserPulseWidth, LaserPulseWidth);
|
||||
//_Scanner.SetStandby(LaserPeriod * 1000, LaserPulseWidth);
|
||||
_Scanner.LaserSignalOn();
|
||||
}
|
||||
}
|
||||
private void PerformCmdLaserShotOnWatt(object obj)
|
||||
{
|
||||
|
||||
if (_LaserConfig.TruFiberType == eTruFiberType.TruFiberS) {
|
||||
powerVolt1 = (float)powerCalParam.CalibrateWattToMeasuredVoltage(LaserPower1Watt) * 10;
|
||||
if (IsUseLaserAutoOffChecked)
|
||||
{
|
||||
if (_Scanner.GetBusyStatus())
|
||||
{
|
||||
MessageUtil.ShowWarningToast(string.Format("Laser, Scanner is busy."));
|
||||
return;
|
||||
}
|
||||
else if (_LaserConfig.TruFiberType == eTruFiberType.TruFiberP) {
|
||||
powerVolt1 = (float)powerCalParam.CalibrateWattToMeasuredVoltage(LaserPower1Watt, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
powerVolt2 = (float)powerCalParam.CalibrateWattToMeasuredVoltage(LaserPower2Watt, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
} else if (_Laser.Config.TruFiberType == eTruFiberType.CalPercentToMeasuredVoltage) {
|
||||
powerVolt1 = (float)powerCalParam.CalibrateWattToMeasuredVoltage(LaserPower1Watt, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
powerVolt2 = (float)powerCalParam.CalibrateWattToMeasuredVoltage(LaserPower2Watt, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
} else {
|
||||
powerVolt1 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower1Percent, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
powerVolt2 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower2Percent, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
//if (!_Laser.GetLaserReady()) {
|
||||
// MessageUtil.ShowWarningToast(string.Format("Laser, Check Laser Ready status."));
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (_SeqTeachingRun.RunState == SequenceRunState.Running)
|
||||
{
|
||||
MessageUtil.ShowWarningToast(string.Format("이미 시퀀스가 Start 상태입니다.", "Laser On"), Log);
|
||||
return;
|
||||
}
|
||||
var currentModelInfo = EquipmentSpecificModelUtil.GetCurrentRecipeEquipmentSpecificModel();
|
||||
if (currentModelInfo.equipmentSpecificModel == null)
|
||||
{
|
||||
MessageUtil.ShowWarningToast(string.Format("선택된 model 이 없습니다.", "Laser On"));
|
||||
return;
|
||||
}
|
||||
|
||||
var intervalTimeBlowOn = 0;
|
||||
var intervalTimeBlowOff = 0;
|
||||
|
||||
if (currentModelInfo.equipmentSpecificModel.UseBlow)
|
||||
{
|
||||
intervalTimeBlowOn = currentModelInfo.equipmentSpecificModel.IntervalTimeBlowOn;
|
||||
intervalTimeBlowOff = currentModelInfo.equipmentSpecificModel.IntervalTimeBlowOff;
|
||||
}
|
||||
|
||||
// Object를 만들어
|
||||
var param = new SeqTeachingRun_InitParam()
|
||||
{
|
||||
IsUseExternalObjects = true,
|
||||
ExternalObjects = CreateDotForLaserOn(),
|
||||
|
||||
//UseStream = _EquipmentInfo.UseStream,
|
||||
UseStream = currentModelInfo.equipmentSpecificModel.UseStream,
|
||||
|
||||
UseBlow = currentModelInfo.equipmentSpecificModel.UseBlow,
|
||||
IntervalTimeBlowOn = intervalTimeBlowOn,
|
||||
IntervalTimeBlowOff = intervalTimeBlowOff,
|
||||
|
||||
NeedSetLaserTiming = true,
|
||||
};
|
||||
|
||||
_SeqTeachingRun.Start(param, OnCompleteMarkGrid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LaserPowerCalParam powerCalParam = Status.AuroraEnv.SettingEntry[CommonSettingIds.LaserPowerCalParam] as LaserPowerCalParam;
|
||||
float powerVolt1 = 0, powerVolt2 = 0;
|
||||
|
||||
powerCalParam.Initialize(powerCalParam.PowerCalibrationCenterBeamCSVFile, powerCalParam.PowerCalibrationRingBeamCSVFile);
|
||||
powerVolt1 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower1Percent, (uint)LaserPowerCalParam.beamMode.Center) * 10;
|
||||
powerVolt2 = (float)powerCalParam.CalibratePercentToMeasuredVoltage(LaserPower2Percent, (uint)LaserPowerCalParam.beamMode.Ring) * 10;
|
||||
Thread.Sleep(50);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, powerVolt1, eFunctionType.COMMAND);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, powerVolt2, eFunctionType.COMMAND);
|
||||
@ -390,8 +405,10 @@ namespace WeldingCommon.Views
|
||||
}
|
||||
private void OnCompleteMarkGrid(SequenceActionResult res)
|
||||
{
|
||||
if (res != null) {
|
||||
if (res.Param is SeqTeachingRun_OutParam result && result.Success == true) {
|
||||
if (res != null)
|
||||
{
|
||||
if (res.Param is SeqTeachingRun_OutParam result && result.Success == true)
|
||||
{
|
||||
MessageUtil.ShowSuccessToast(string.Format("Success SeqMarkGrid"));
|
||||
return;
|
||||
}
|
||||
@ -402,9 +419,12 @@ namespace WeldingCommon.Views
|
||||
|
||||
private void PerformCmdLaserShotOff(object obj)
|
||||
{
|
||||
if (IsUseLaserAutoOffChecked) {
|
||||
if (IsUseLaserAutoOffChecked)
|
||||
{
|
||||
_Scanner.StopExecution();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
_Scanner.LaserSignalOff();
|
||||
}
|
||||
|
||||
@ -413,7 +433,8 @@ namespace WeldingCommon.Views
|
||||
|
||||
private void PerformCmdResetEncoderValue(object obj)
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
_Scanner.InitFly2D();
|
||||
|
||||
// CBW OTW 테스트를 위해 아래는 일단 주석처리
|
||||
@ -421,7 +442,9 @@ namespace WeldingCommon.Views
|
||||
|
||||
// list 반복 숫자 초기화
|
||||
_ListIterationCount = 0;
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.ShowErrorToast(string.Format($"{ex.Message}"));
|
||||
}
|
||||
}
|
||||
@ -456,10 +479,13 @@ namespace WeldingCommon.Views
|
||||
|
||||
private void PerformCmdSimulateEncoder(object obj)
|
||||
{
|
||||
if (_ToggleSimulateEncoder) {
|
||||
if (_ToggleSimulateEncoder)
|
||||
{
|
||||
_Scanner.SimulateEncoder(0);
|
||||
_ToggleSimulateEncoder = false;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
_ToggleSimulateEncoder = true;
|
||||
_Scanner.SimulateEncoder(1);
|
||||
}
|
||||
@ -467,10 +493,13 @@ namespace WeldingCommon.Views
|
||||
|
||||
private void PerformCmdSimulateEncoderXY(object obj)
|
||||
{
|
||||
if (_ToggleSimulateEncoder) {
|
||||
if (_ToggleSimulateEncoder)
|
||||
{
|
||||
_Scanner.SimulateEncoder(0);
|
||||
_ToggleSimulateEncoder = false;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
_ToggleSimulateEncoder = true;
|
||||
_Scanner.SimulateEncoder(3);
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
xmlns:usercontrols="clr-namespace:AuroraUIComponent.UserControls;assembly=AuroraUIComponent"
|
||||
d:DataContext="{d:DesignInstance Type=local:UCScannerMotionViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="400" d:DesignWidth="600" x:Name="uc">
|
||||
d:DesignHeight="500" d:DesignWidth="600" x:Name="uc">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<view:BoolConverter x:Key="convWorkConverter" FalseValue="Not Work" TrueValue="Work"/>
|
||||
@ -164,29 +164,54 @@
|
||||
</GroupBox>
|
||||
|
||||
<!-- 26.04.06 NDY Stage X Motion 섹션 추가 -->
|
||||
<GroupBox Grid.Row="2" Header="Stage X Motion (ACS)" Margin="0 3 3 0"
|
||||
<GroupBox Grid.Row="2" Header="Stage X Y Motion (ACS)" Margin="0 3 3 0"
|
||||
IsEnabled="{Binding IsStageXActivated}">
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<GroupBox Grid.Column="0" Header="Stage X[mm]"
|
||||
<UniformGrid Rows="2">
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<GroupBox Grid.Column="0" Header="Stage X[mm]"
|
||||
Style="{StaticResource StGBMonitor}" Margin="0 0 5 0" MinWidth="120">
|
||||
<TextBlock FontSize="18" FontWeight="Bold"
|
||||
<TextBlock FontSize="18" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Text="{Binding StageXPos, StringFormat={}{0:0.000}}"/>
|
||||
</GroupBox>
|
||||
<Button Grid.Column="1" FontWeight="Bold" Margin="3"
|
||||
</GroupBox>
|
||||
<Button Grid.Column="1" FontWeight="Bold" Margin="3"
|
||||
Command="{Binding CMD_JogMove}" CommandParameter="Stage_X_Left" ToolTip="StageX 위치값 증가">◀ +</Button>
|
||||
<Button Grid.Column="2" FontWeight="Bold" Margin="3"
|
||||
<Button Grid.Column="2" FontWeight="Bold" Margin="3"
|
||||
Command="{Binding CMD_JogMove}" CommandParameter="Stage_X_Right" ToolTip="StageX 위치값 감소">- ▶</Button>
|
||||
<TextBlock Grid.Column="3" FontSize="10" Foreground="Gray"
|
||||
<TextBlock Grid.Column="3" FontSize="10" Foreground="Gray"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Text="* 이미지 방향 반전 적용"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<GroupBox Grid.Column="0" Header="Stage Z[mm]"
|
||||
Style="{StaticResource StGBMonitor}" Margin="0 0 5 0" MinWidth="120">
|
||||
<TextBlock FontSize="18" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Text="{Binding StageZPos, StringFormat={}{0:0.000}}"/>
|
||||
</GroupBox>
|
||||
<Button Grid.Column="1" FontWeight="Bold" Margin="3"
|
||||
Command="{Binding CMD_JogMove}" CommandParameter="Stage_Z_Left" ToolTip="StageZ 위치값 증가">◀ +</Button>
|
||||
<Button Grid.Column="2" FontWeight="Bold" Margin="3"
|
||||
Command="{Binding CMD_JogMove}" CommandParameter="Stage_Z_Right" ToolTip="StageZ 위치값 감소">- ▶</Button>
|
||||
<TextBlock Grid.Column="3" FontSize="10" Foreground="Gray"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Text="* 이미지 방향 반전 적용"/>
|
||||
</Grid>
|
||||
</UniformGrid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
@ -6,6 +6,7 @@ using Aurora.View;
|
||||
using AuroraACS; // 26.04.06 NDY 추가
|
||||
using AuroraLaser;
|
||||
using AuroraLaserScanner;
|
||||
using AuroraMotionBoard.Ajin;
|
||||
using HarfBuzzSharp;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using System;
|
||||
@ -83,12 +84,18 @@ namespace WeldingCommon.Views
|
||||
|
||||
// 26.04.06 NDY Stage X 관련 필드 추가 ==================
|
||||
private ACSMotor _MotorX;
|
||||
private ACSMotor _MotorZ;
|
||||
|
||||
private double _StageXPos;
|
||||
public double StageXPos { get => _StageXPos; set => SetProperty(ref _StageXPos, value); }
|
||||
|
||||
private double _StageZPos;
|
||||
public double StageZPos { get => _StageZPos; set => SetProperty(ref _StageZPos, value); }
|
||||
|
||||
private bool _IsStageXActivated;
|
||||
public bool IsStageXActivated { get => _IsStageXActivated; set => SetProperty(ref _IsStageXActivated, value); }
|
||||
private bool _IsStageZActivated;
|
||||
public bool IsStageZActivated { get => _IsStageZActivated; set => SetProperty(ref _IsStageZActivated, value); }
|
||||
// ========================================================
|
||||
|
||||
// PAM, RUW 처럼 2개 이상의 scanner 를 사용하는 경우가 있어, scannerId 를 받는 형태로 생성
|
||||
@ -103,6 +110,8 @@ namespace WeldingCommon.Views
|
||||
// 26.04.06 NDY Stage X 모터 연결 추가 ===============
|
||||
try { _MotorX = _Aurora.DeviceManager["AxisX2"] as ACSMotor; }
|
||||
catch { _MotorX = null; }
|
||||
try { _MotorZ = _Aurora.DeviceManager["AxisZ"] as ACSMotor; }
|
||||
catch { _MotorZ = null; }
|
||||
// ====================================================
|
||||
|
||||
InitVariable();
|
||||
@ -174,6 +183,16 @@ namespace WeldingCommon.Views
|
||||
{
|
||||
IsStageXActivated = false;
|
||||
}
|
||||
|
||||
if (_MotorZ != null && _MotorZ.IsActivated)
|
||||
{
|
||||
StageZPos = _MotorZ.GetActualPos();
|
||||
IsStageZActivated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsStageZActivated = false;
|
||||
}
|
||||
// ====================================================
|
||||
}
|
||||
|
||||
@ -213,6 +232,8 @@ namespace WeldingCommon.Views
|
||||
// 26.04.06 NDY Stage X 버튼 추가 =================
|
||||
case "Stage_X_Left": MoveStageX(eJogDirection.MINUS); break;
|
||||
case "Stage_X_Right": MoveStageX(eJogDirection.PLUS); break;
|
||||
case "Stage_Z_Left": MoveStageZ(eJogDirection.MINUS); break;
|
||||
case "Stage_Z_Right": MoveStageZ(eJogDirection.PLUS); break;
|
||||
// =================================================
|
||||
}
|
||||
}
|
||||
@ -227,8 +248,21 @@ namespace WeldingCommon.Views
|
||||
Log.I($"Stage X Move : {step}mm");
|
||||
|
||||
_MotorX.SetTargetPos(step, TargetPosType.REL);
|
||||
_MotorX.SetVelocityImm(_MotorX.GetJogSpeed(AuroraACS.Speed.L) * _VelocityRate);
|
||||
_MotorX.Move();
|
||||
}
|
||||
private void MoveStageZ(eJogDirection direction)
|
||||
{
|
||||
if (_MotorZ == null || !_MotorZ.IsActivated) return;
|
||||
|
||||
// 이미지 기준 방향 반전 적용
|
||||
double step = direction == eJogDirection.PLUS ? -StepValue : +StepValue;
|
||||
Log.I($"Stage Z Move : {step}mm");
|
||||
|
||||
_MotorZ.SetTargetPos(step, TargetPosType.REL);
|
||||
_MotorZ.SetVelocityImm(_MotorZ.GetJogSpeed(AuroraACS.Speed.L) * _VelocityRate);
|
||||
_MotorZ.Move();
|
||||
}
|
||||
// =========================================================
|
||||
|
||||
private void MoveJogXYPos(eAxisType axisType, eJogDirection direction)
|
||||
@ -265,6 +299,11 @@ namespace WeldingCommon.Views
|
||||
|
||||
private void MoveJogHome()
|
||||
{
|
||||
_Scanner.GetBusyStatus();
|
||||
double xPos, yPos;
|
||||
_Scanner.GetXYPos(out xPos, out yPos);
|
||||
Log.W($"xPos[{xPos}] / yPos[{yPos}]");
|
||||
|
||||
double finalVelocity = _ScannerConfig.JumpSpeed * _VelocityRate;
|
||||
_Scanner.SetJumpSpeedCtrl(finalVelocity);
|
||||
_Scanner.JumpAbs(0, 0);
|
||||
|
||||
@ -80,7 +80,7 @@ namespace WeldingCommon.Views
|
||||
|
||||
private IScannerACS _motion; // 변경
|
||||
private ScannerACS _acs; // 변경
|
||||
private ACSMotor _AxisX;
|
||||
private ACSMotor _AxisX; // AxisX,Y는 갈보모터 기준이고
|
||||
private ACSMotor _AxisY;
|
||||
private ACSMotor _MotorY1, _MotorY2;
|
||||
public MainRecipe Recipe { get => _Recipe; private set => SetProperty(ref _Recipe, value); }
|
||||
@ -118,8 +118,8 @@ namespace WeldingCommon.Views
|
||||
|
||||
Recipe = recipeItem as MainRecipe;
|
||||
|
||||
_MotorY1 = _devices[CommonMotorIds.AxisY1] as ACSMotor; //변경
|
||||
_MotorY2 = _devices[CommonMotorIds.AxisY2] as ACSMotor; //변경
|
||||
//_MotorY1 = _devices[CommonMotorIds.AxisY1] as ACSMotor; //변경
|
||||
//_MotorY2 = _devices[CommonMotorIds.AxisY2] as ACSMotor; //변경
|
||||
|
||||
_AxisX = _env.DeviceManager[CommonMotorIds.AxisX2] as ACSMotor; // 변경
|
||||
//if (Recipe.YAxisUseType == MainRecipe.YAxisType.Y1) {
|
||||
@ -313,8 +313,8 @@ namespace WeldingCommon.Views
|
||||
_MotorY2.Move();
|
||||
Log.V($"Move Y2 Position : {teachingSetting.SettingPositions[(int)eTeachingPosition.StageWeldingStartPos].AxisY2}");
|
||||
|
||||
_AxisY = _env.DeviceManager[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
_acs.WriteVariableInt("iPCget_LCI_ASMASK_Y", (int)CommonMotorIds.eMotorIdx.AxisY1);
|
||||
//_AxisY = _env.DeviceManager[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
//_acs.WriteVariableInt("iPCget_LCI_ASMASK_Y", (int)CommonMotorIds.eMotorIdx.AxisY1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -323,8 +323,8 @@ namespace WeldingCommon.Views
|
||||
_MotorY1.Move();
|
||||
Log.V($"Move Y1 Position : {teachingSetting.SettingPositions[(int)eTeachingPosition.StageWeldingStartPos].AxisY1}");
|
||||
|
||||
_AxisY = _env.DeviceManager[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
_acs.WriteVariableInt("iPCget_LCI_ASMASK_Y", (int)CommonMotorIds.eMotorIdx.AxisY2);
|
||||
//_AxisY = _env.DeviceManager[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
//_acs.WriteVariableInt("iPCget_LCI_ASMASK_Y", (int)CommonMotorIds.eMotorIdx.AxisY2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -341,8 +341,8 @@ namespace WeldingCommon.Views
|
||||
_MotorY2.Move();
|
||||
Log.V($"Move Y2 Position : {teachingSetting.SettingPositions[(int)eTeachingPosition.StageWeldingStartPos].AxisY2}");
|
||||
|
||||
_AxisY = _env.DeviceManager[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
_acs.WriteVariableInt("iPCget_LCI_ASMASK_Y", (int)CommonMotorIds.eMotorIdx.AxisY1);
|
||||
//_AxisY = _env.DeviceManager[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
//_acs.WriteVariableInt("iPCget_LCI_ASMASK_Y", (int)CommonMotorIds.eMotorIdx.AxisY1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -351,8 +351,8 @@ namespace WeldingCommon.Views
|
||||
_MotorY1.Move();
|
||||
Log.V($"Move Y1 Position : {teachingSetting.SettingPositions[(int)eTeachingPosition.StageWeldingStartPos].AxisY1}");
|
||||
|
||||
_AxisY = _env.DeviceManager[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
_acs.WriteVariableInt("iPCget_LCI_ASMASK_Y", (int)CommonMotorIds.eMotorIdx.AxisY2);
|
||||
//_AxisY = _env.DeviceManager[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
//_acs.WriteVariableInt("iPCget_LCI_ASMASK_Y", (int)CommonMotorIds.eMotorIdx.AxisY2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -126,37 +126,40 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="Object Select" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 3 0 0" Style="{StaticResource StGroupBox4th}">
|
||||
<GroupBox Header="Object Select" Grid.Row="1" Grid.Column="0" Margin="0 3 0 0" Style="{StaticResource StGroupBox4th}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<mah:ToggleSwitch Grid.Row="0" HorizontalAlignment="Center" FontSize="12" FontWeight="Bold"
|
||||
<mah:ToggleSwitch Grid.Row="0" HorizontalAlignment="Center" FontSize="10" FontWeight="Bold"
|
||||
IsOn="{Binding IsObjectSelectAll}"
|
||||
OffContent="Selected Object"
|
||||
OnContent="All Object"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</GroupBox>
|
||||
<GroupBox Header="가공 Select" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 3 0 0" Style="{StaticResource StGroupBox4th}">
|
||||
<GroupBox Header="가공 Select" Grid.Row="1" Grid.Column="1" Margin="0 3 0 0" Style="{StaticResource StGroupBox4th}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- MOTF 대면적 가공 토글 -->
|
||||
<mah:ToggleSwitch Grid.Row="0" HorizontalAlignment="Center" FontSize="10" FontWeight="Bold"
|
||||
IsOn="{Binding IsUseLargeMOTF}"
|
||||
OffContent="일반 가공"
|
||||
OnContent="MOTF 대면적 가공"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 3 0 0" Style="{StaticResource StGroupBox4th}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- MOTF 대면적 가공 토글 -->
|
||||
<mah:ToggleSwitch Grid.Row="0" HorizontalAlignment="Center" FontSize="12" FontWeight="Bold"
|
||||
IsOn="{Binding IsUseLargeMOTF}"
|
||||
OffContent="일반 가공"
|
||||
OnContent="MOTF 대면적 가공"/>
|
||||
|
||||
<!-- 페이지 N개 설정 -->
|
||||
<Grid Grid.Row="1" Margin="0 4 0 0" IsEnabled="{Binding IsUseLargeMOTF}">
|
||||
<Grid Grid.Row="0" Margin="0 4 0 0" IsEnabled="{Binding IsUseLargeMOTF}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="50"/>
|
||||
@ -164,11 +167,11 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Margin="5 0" FontSize="11" Foreground="#FFBBBBBB"
|
||||
FontWeight="Bold" Text="페이지 N개"
|
||||
VerticalAlignment="Center"/>
|
||||
FontWeight="Bold" Text="페이지 N개"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Column="1" Margin="2" FontSize="11"
|
||||
Text="{Binding LargeMOTFPageCount, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
|
||||
Text="{Binding LargeMOTFPageCount, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
|
||||
<TextBlock Grid.Column="2" Margin="3 0" FontSize="11" Foreground="#FFBBBBBB"
|
||||
Text="page" VerticalAlignment="Center"/>
|
||||
<Button Grid.Column="3" Margin="2" FontSize="11" FontWeight="Bold"
|
||||
@ -178,7 +181,7 @@
|
||||
</Grid>
|
||||
|
||||
<!-- Start Set / End Set -->
|
||||
<Grid Grid.Row="2" Height="40" Margin="0 4 0 0" IsEnabled="{Binding IsUseLargeMOTF}">
|
||||
<Grid Grid.Row="1" Height="40" Margin="0 4 0 0" IsEnabled="{Binding IsUseLargeMOTF}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@ -196,7 +199,7 @@
|
||||
</Grid>
|
||||
|
||||
<!-- Offset X / Y -->
|
||||
<Grid Grid.Row="3" Margin="0 4 0 0" IsEnabled="{Binding IsUseLargeMOTF}">
|
||||
<Grid Grid.Row="2" Margin="0 4 0 0" IsEnabled="{Binding IsUseLargeMOTF}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
|
||||
@ -125,10 +125,11 @@ namespace WeldingCommon.Views
|
||||
//private readonly EquipmentInfo _EquipmentInfo;
|
||||
|
||||
private readonly Scanner _Scanner;
|
||||
#region To Do : 26.04.15 해당 _Laser와 _IODevice 와 _LaserConfig 전부 걷어내고 _Scanner로 동작하도록 수정해야한다.
|
||||
private readonly Laser _Laser;
|
||||
private readonly IODevice _IODevice;
|
||||
private readonly LaserConfig _LaserConfig;
|
||||
|
||||
#endregion
|
||||
private ISequence _SeqScoutNormal;
|
||||
private bool _IsSequenceRunning_ScoutNormal;
|
||||
public bool IsSequenceRunning_ScoutNormal { get => _IsSequenceRunning_ScoutNormal; set => SetProperty(ref _IsSequenceRunning_ScoutNormal, value); }
|
||||
@ -416,20 +417,26 @@ namespace WeldingCommon.Views
|
||||
private void OnMonitoring(object sender, EventArgs e)
|
||||
{
|
||||
// TODO: Laser Device 에 구현된 내용에 따르면, 일부 Laser Device 는 구현이 되어 있지 않은 상태. 항상 false
|
||||
if (_Laser.GetPilotLaserStatus()) {
|
||||
if (_Laser.GetPilotLaserStatus())
|
||||
{
|
||||
IsGuidBeam = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
IsGuidBeam = false;
|
||||
}
|
||||
|
||||
if (_Laser.GetLaserReady()) {
|
||||
if (_Laser.GetLaserReady())
|
||||
{
|
||||
IsLaserReady = true;
|
||||
|
||||
// TODO: PRIBAT_L1, PRIBAT_L2 는 IO에 LaserOnLamp 를 켜고 끄는게 필요함.
|
||||
// TODO: 우선 주석 처리 해 둠. 레이저 Type 별로 달라서 그런건지 확인하고, 어떻게 공통으로 구현할지를 생각해서 추가해 두자
|
||||
//_iODevice._iOUnit.WriteDoBit(Convert.ToInt32(ePDOAddress.LaserOnLampOn), true);
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
IsLaserReady = false;
|
||||
// TODO: PRIBAT_L1, PRIBAT_L2 는 IO에 LaserOnLamp 를 켜고 끄는게 필요함.
|
||||
// TODO: 우선 주석 처리 해 둠. 레이저 Type 별로 달라서 그런건지 확인하고, 어떻게 공통으로 구현할지를 생각해서 추가해 두자
|
||||
@ -439,7 +446,15 @@ namespace WeldingCommon.Views
|
||||
// TODO: PRIBAT_L1, PRIBAT_L2 는 Blow 의 상태 check 가 들어 있음. 장비 한정이므로 이를 check 하는 것을 modelItem 이나 setting 으로 빼서 진행되도록 함.
|
||||
|
||||
#region
|
||||
// 26.04.09 NDY [Stage X Jog] OnMonitoring 내부 - X축 위치 갱신
|
||||
// 26.04.15 NDY Scanner ACS 변수로 IsLaserReady 모니터링
|
||||
// 26.04.15 NDY Gun → Scanner 변경: RTC5 ReadStatus 비트7로 레이저 상태 모니터링
|
||||
//if (_Scanner != null && _Scanner.IsActivated)
|
||||
//{
|
||||
// uint status = _Scanner.ReadStatus();
|
||||
// IsLaserReady = (status & (1 << 7)) != 0;
|
||||
//}
|
||||
|
||||
// 26.04.09 NDY [Stage X Jog] X축 위치 갱신
|
||||
if (_MotorX != null && _MotorX.IsActivated)
|
||||
{
|
||||
StageXPos = _MotorX.GetActualPos();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user