Auto Run 진행 전, Recipe View Enable/Disable 관련 수정
This commit is contained in:
parent
0252fbe89d
commit
f52f72812a
@ -39,6 +39,9 @@ using WeldingCommon.Utils;
|
|||||||
using WeldingCommon.Views;
|
using WeldingCommon.Views;
|
||||||
using WeldingCommon.Vision.Factory;
|
using WeldingCommon.Vision.Factory;
|
||||||
using static WeldingCommon.Vision.Factory.VisionFactory;
|
using static WeldingCommon.Vision.Factory.VisionFactory;
|
||||||
|
using System.Reactive.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace ILSOS_CCW_H52A
|
namespace ILSOS_CCW_H52A
|
||||||
{
|
{
|
||||||
@ -79,6 +82,43 @@ namespace ILSOS_CCW_H52A
|
|||||||
AuroraEnv.SequenceEntry[SequenceIds.AlarmMonitoring].Start();
|
AuroraEnv.SequenceEntry[SequenceIds.AlarmMonitoring].Start();
|
||||||
|
|
||||||
AuroraEnv.GetProcessManager().Init(AuroraEnv);
|
AuroraEnv.GetProcessManager().Init(AuroraEnv);
|
||||||
|
|
||||||
|
// 최초에 permission에 대한 값을 적용해줌
|
||||||
|
OnPermissionChanged(null);
|
||||||
|
AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_PERMISSION_CHANGED)
|
||||||
|
.Subscribe(OnPermissionChanged);
|
||||||
|
|
||||||
|
var seq = AuroraEnv.SequenceEntry[SequenceIds.SeqAutoRunCCWH52A] as ISequence;
|
||||||
|
seq.RunStateChanged += AutoRunSeq_RunStateChanged;
|
||||||
|
}
|
||||||
|
private void AutoRunSeq_RunStateChanged(object sender, (string sequenceId, SequenceRunState state) e)
|
||||||
|
{
|
||||||
|
//AutoRun 상황에서 Recipe Save Lock
|
||||||
|
AuroraEnv.RecipeManager.SaveLock(CommonRecipeIds.ScannerObjectTeaching, e.state != SequenceRunState.Idle);
|
||||||
|
//AutoRun 상황에서 Reicpe 화면 수정할 수 없도록 함
|
||||||
|
Application.Current.Dispatcher.Invoke(() => {
|
||||||
|
// Running으로 변경되면 Active된 레시피로 변경하도록 함
|
||||||
|
if (e.state == SequenceRunState.Running) {
|
||||||
|
WeldingRecipeManager.OnActiveReloaded();
|
||||||
|
}
|
||||||
|
|
||||||
|
_UCRecipe.IsEnabled = e.state != SequenceRunState.Running;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private void OnPermissionChanged(EventMessage message)
|
||||||
|
{
|
||||||
|
bool LoginState = ApplicationExt.PermissionLevel <= (ushort)PermissionLevel.LEVEL3;
|
||||||
|
if (LoginState == false) {
|
||||||
|
// Login 권한이 없어지면 Active된 레시피로 변경하도록 함
|
||||||
|
Application.Current.Dispatcher.Invoke(() => {
|
||||||
|
WeldingRecipeManager.OnActiveReloaded();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//LogOut 상황에서 Recipe Save Lock
|
||||||
|
AuroraEnv.RecipeManager.SaveLock(CommonRecipeIds.ScannerObjectTeaching, !LoginState);
|
||||||
|
//LogOut 상황에서 Reicpe 화면 수정할 수 없도록 함
|
||||||
|
Application.Current.Dispatcher.Invoke(() => { _UCRecipe.IsEnabled = LoginState; });
|
||||||
}
|
}
|
||||||
|
|
||||||
// For Selection LaserDevice
|
// For Selection LaserDevice
|
||||||
|
|||||||
@ -78,7 +78,6 @@ namespace ILSOS_CCW_H52A.Views
|
|||||||
_Plc = _Aurora.DeviceManager[CommonDeviceIds.PLCDevice] as PLCControllerCCWH52A;
|
_Plc = _Aurora.DeviceManager[CommonDeviceIds.PLCDevice] as PLCControllerCCWH52A;
|
||||||
|
|
||||||
_SeqAutoRun = _Aurora.SequenceEntry[SequenceIds.SeqAutoRunCCWH52A];
|
_SeqAutoRun = _Aurora.SequenceEntry[SequenceIds.SeqAutoRunCCWH52A];
|
||||||
_SeqAutoRun.RunStateChanged += AutoRunSeq_RunStateChanged;
|
|
||||||
|
|
||||||
InitVariable();
|
InitVariable();
|
||||||
|
|
||||||
@ -253,24 +252,5 @@ namespace ILSOS_CCW_H52A.Views
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AutoRunSeq_RunStateChanged(object sender, (string sequenceId, SequenceRunState state) e)
|
|
||||||
{
|
|
||||||
//AutoRun 상황에서 Recipe Save Lock
|
|
||||||
_RecipeManager.SaveLock(
|
|
||||||
CommonRecipeIds.ScannerObjectTeaching,
|
|
||||||
e.state != SequenceRunState.Idle);
|
|
||||||
//AutoRun 상황에서 Reicpe 화면 수정할 수 없도록 함
|
|
||||||
if (e.state == SequenceRunState.Running) {
|
|
||||||
Application.Current.Dispatcher.InvokeAsync(() => {
|
|
||||||
_UCRecipe.IsEnabled = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Application.Current.Dispatcher.InvokeAsync(() => {
|
|
||||||
_UCRecipe.IsEnabled = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,16 +86,16 @@ namespace CoreUnit.Scanner.UserControl.Canvas.Dialog
|
|||||||
btnOk.Enabled = false;
|
btnOk.Enabled = false;
|
||||||
btnCancel.Enabled = true;
|
btnCancel.Enabled = true;
|
||||||
}
|
}
|
||||||
if(_MachineName == eMachineName.H52A_CCW || _MachineName == eMachineName.H52A_ACW || _MachineName == eMachineName.CIT) {
|
//if(_MachineName == eMachineName.H52A_CCW || _MachineName == eMachineName.H52A_ACW || _MachineName == eMachineName.CIT) {
|
||||||
label58.Text = "(0~4000)";
|
label58.Text = _MachineName == eMachineName.H52A_CCW ? "(0~1500)" : "(0~4000)";
|
||||||
label31.Text = "(0~4000)";
|
label31.Text = _MachineName == eMachineName.H52A_CCW ? "(0~2500)" : "(0~4000)";
|
||||||
label32.Text = "(0~10000)";
|
label32.Text = "(0~10000)";
|
||||||
label17.Text = "(1~8000)";
|
label17.Text = "(1~8000)";
|
||||||
|
|
||||||
label22.Enabled = false;
|
label22.Enabled = _MachineName == eMachineName.H52A_CCW;
|
||||||
tbLaserPower2.Enabled = false;
|
tbLaserPower2.Enabled = _MachineName == eMachineName.H52A_CCW;
|
||||||
label29.Enabled = false;
|
label29.Enabled = _MachineName == eMachineName.H52A_CCW;
|
||||||
label31.Enabled = false;
|
label31.Enabled = _MachineName == eMachineName.H52A_CCW;
|
||||||
|
|
||||||
// Ramping Start, End 구분 후 사용한다. Power 2번은 여전히 막아둠
|
// Ramping Start, End 구분 후 사용한다. Power 2번은 여전히 막아둠
|
||||||
//label68.Enabled = false;
|
//label68.Enabled = false;
|
||||||
@ -182,7 +182,7 @@ namespace CoreUnit.Scanner.UserControl.Canvas.Dialog
|
|||||||
nudRampingEndPower2.Visible = false;
|
nudRampingEndPower2.Visible = false;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
//}
|
||||||
|
|
||||||
//Welding Paramter 색 지정
|
//Welding Paramter 색 지정
|
||||||
//rbParam1.ForeColor = Color.FromName(((WeldingParameterIDEditor.eWeldingColor)1).ToString());
|
//rbParam1.ForeColor = Color.FromName(((WeldingParameterIDEditor.eWeldingColor)1).ToString());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user