feat:260414_현장소스
This commit is contained in:
parent
fe085cd0c1
commit
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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -177,16 +159,6 @@ namespace ILSOS_PrismaticScanner
|
||||
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(),
|
||||
@ -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,398 @@ 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 };
|
||||
//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 +614,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 +626,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 +667,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 +707,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 +727,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 +741,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 +778,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 +812,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 +836,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
@ -220,7 +220,7 @@ namespace ILSOS_PrismaticScanner.Views
|
||||
OnUpdateCurrentActivatedRecipe(null);
|
||||
|
||||
var param = new SeqAutoRunPrismaticScanner_InitParam() {
|
||||
VisionRecipeNo = 0
|
||||
//VisionRecipeNo = 0 // 해당 InitParam에는 없는 선언
|
||||
};
|
||||
|
||||
Status.SetStatus(eEqpStatus.Auto);
|
||||
|
||||
@ -222,13 +222,13 @@ 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.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,7 +34,7 @@ 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);
|
||||
@ -104,10 +104,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 +137,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 +155,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;
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -17,6 +17,7 @@ using WeldingCommon.Settings;
|
||||
|
||||
namespace WeldingCommon.Sequences
|
||||
{
|
||||
// 캘리브레이션 작업 시 타는 시퀸스
|
||||
public class SeqScannerCalibration
|
||||
{
|
||||
static readonly Logger Log = new Logger("SeqScannerCalibration");
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -159,7 +159,7 @@ namespace WeldingCommon.Sequences
|
||||
{
|
||||
//Device Init
|
||||
_Scanner = context.GetLaserScanner();
|
||||
_Laser = context.GetLaser();
|
||||
//_Laser = context.GetLaser();
|
||||
}
|
||||
|
||||
private bool CheckDeviceReady(SequenceContext context)
|
||||
@ -479,31 +479,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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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);
|
||||
@ -246,10 +246,10 @@ namespace WeldingCommon.Views
|
||||
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) {
|
||||
MessageUtil.ShowWarningToast(string.Format("이미 시퀀스가 Start 상태입니다.", "Laser On"), Log);
|
||||
@ -290,20 +290,9 @@ namespace WeldingCommon.Views
|
||||
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);
|
||||
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);
|
||||
@ -320,10 +309,10 @@ namespace WeldingCommon.Views
|
||||
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) {
|
||||
MessageUtil.ShowWarningToast(string.Format("이미 시퀀스가 Start 상태입니다.", "Laser On"), Log);
|
||||
@ -365,20 +354,8 @@ namespace WeldingCommon.Views
|
||||
float powerVolt1 = 0, powerVolt2 = 0;
|
||||
|
||||
powerCalParam.Initialize(powerCalParam.PowerCalibrationCenterBeamCSVFile, powerCalParam.PowerCalibrationRingBeamCSVFile);
|
||||
|
||||
if (_LaserConfig.TruFiberType == eTruFiberType.TruFiberS) {
|
||||
powerVolt1 = (float)powerCalParam.CalibrateWattToMeasuredVoltage(LaserPower1Watt) * 10;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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);
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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*"/>
|
||||
|
||||
@ -416,25 +416,25 @@ namespace WeldingCommon.Views
|
||||
private void OnMonitoring(object sender, EventArgs e)
|
||||
{
|
||||
// TODO: Laser Device 에 구현된 내용에 따르면, 일부 Laser Device 는 구현이 되어 있지 않은 상태. 항상 false
|
||||
if (_Laser.GetPilotLaserStatus()) {
|
||||
IsGuidBeam = true;
|
||||
} else {
|
||||
IsGuidBeam = false;
|
||||
}
|
||||
//if (_Laser.GetPilotLaserStatus()) {
|
||||
// IsGuidBeam = true;
|
||||
//} else {
|
||||
// IsGuidBeam = false;
|
||||
//}
|
||||
|
||||
if (_Laser.GetLaserReady()) {
|
||||
IsLaserReady = true;
|
||||
//if (_Laser.GetLaserReady()) {
|
||||
// IsLaserReady = true;
|
||||
|
||||
// TODO: PRIBAT_L1, PRIBAT_L2 는 IO에 LaserOnLamp 를 켜고 끄는게 필요함.
|
||||
// TODO: 우선 주석 처리 해 둠. 레이저 Type 별로 달라서 그런건지 확인하고, 어떻게 공통으로 구현할지를 생각해서 추가해 두자
|
||||
//_iODevice._iOUnit.WriteDoBit(Convert.ToInt32(ePDOAddress.LaserOnLampOn), true);
|
||||
// // TODO: PRIBAT_L1, PRIBAT_L2 는 IO에 LaserOnLamp 를 켜고 끄는게 필요함.
|
||||
// // TODO: 우선 주석 처리 해 둠. 레이저 Type 별로 달라서 그런건지 확인하고, 어떻게 공통으로 구현할지를 생각해서 추가해 두자
|
||||
// //_iODevice._iOUnit.WriteDoBit(Convert.ToInt32(ePDOAddress.LaserOnLampOn), true);
|
||||
|
||||
} else {
|
||||
IsLaserReady = false;
|
||||
// TODO: PRIBAT_L1, PRIBAT_L2 는 IO에 LaserOnLamp 를 켜고 끄는게 필요함.
|
||||
// TODO: 우선 주석 처리 해 둠. 레이저 Type 별로 달라서 그런건지 확인하고, 어떻게 공통으로 구현할지를 생각해서 추가해 두자
|
||||
//_iODevice._iOUnit.WriteDoBit(Convert.ToInt32(ePDOAddress.LaserOnLampOn), true);
|
||||
}
|
||||
//} else {
|
||||
// IsLaserReady = false;
|
||||
// // TODO: PRIBAT_L1, PRIBAT_L2 는 IO에 LaserOnLamp 를 켜고 끄는게 필요함.
|
||||
// // TODO: 우선 주석 처리 해 둠. 레이저 Type 별로 달라서 그런건지 확인하고, 어떻게 공통으로 구현할지를 생각해서 추가해 두자
|
||||
// //_iODevice._iOUnit.WriteDoBit(Convert.ToInt32(ePDOAddress.LaserOnLampOn), true);
|
||||
//}
|
||||
|
||||
// TODO: PRIBAT_L1, PRIBAT_L2 는 Blow 의 상태 check 가 들어 있음. 장비 한정이므로 이를 check 하는 것을 modelItem 이나 setting 으로 빼서 진행되도록 함.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user