Permission or AutoRunChange 관련 RecipeLoad 수정

This commit is contained in:
최이근 2026-03-16 23:06:00 +09:00
parent f52f72812a
commit 4626c07d86

View File

@ -91,34 +91,34 @@ namespace ILSOS_CCW_H52A
var seq = AuroraEnv.SequenceEntry[SequenceIds.SeqAutoRunCCWH52A] as ISequence; var seq = AuroraEnv.SequenceEntry[SequenceIds.SeqAutoRunCCWH52A] as ISequence;
seq.RunStateChanged += AutoRunSeq_RunStateChanged; seq.RunStateChanged += AutoRunSeq_RunStateChanged;
} }
private void ApplyRecipeByState(bool bON)
{
Application.Current.Dispatcher.Invoke(() => {
if (bON == false)
WeldingRecipeManager.OnActiveReloaded();
else
WeldingRecipeManager.ReloadWeldingRecipe(WeldingRecipeManager.SelectedRecipe.name);
});
}
private void AutoRunSeq_RunStateChanged(object sender, (string sequenceId, SequenceRunState state) e) private void AutoRunSeq_RunStateChanged(object sender, (string sequenceId, SequenceRunState state) e)
{ {
//AutoRun 상황에서 Recipe Save Lock //AutoRun 상황에서 Recipe Save Lock
AuroraEnv.RecipeManager.SaveLock(CommonRecipeIds.ScannerObjectTeaching, e.state != SequenceRunState.Idle); AuroraEnv.RecipeManager.SaveLock(CommonRecipeIds.ScannerObjectTeaching, e.state != SequenceRunState.Idle);
//AutoRun 상황에서 Reicpe 화면 수정할 수 없도록 함 bool AutoRunState = e.state == SequenceRunState.Running;
Application.Current.Dispatcher.Invoke(() => { ApplyRecipeByState(AutoRunState);
// Running으로 변경되면 Active된 레시피로 변경하도록 함 _UCRecipe.IsEnabled = e.state != SequenceRunState.Running;
if (e.state == SequenceRunState.Running) {
WeldingRecipeManager.OnActiveReloaded();
}
_UCRecipe.IsEnabled = e.state != SequenceRunState.Running;
});
} }
private void OnPermissionChanged(EventMessage message) private void OnPermissionChanged(EventMessage message)
{ {
bool LoginState = ApplicationExt.PermissionLevel <= (ushort)PermissionLevel.LEVEL3; bool permissionOn = ApplicationExt.PermissionLevel <= (ushort)PermissionLevel.LEVEL3;
if (LoginState == false) { AuroraEnv.RecipeManager.SaveLock(CommonRecipeIds.ScannerObjectTeaching, !permissionOn);
// Login 권한이 없어지면 Active된 레시피로 변경하도록 함
Application.Current.Dispatcher.Invoke(() => { // Login 권한이 없어지면 Active된 레시피로 변경하도록 함
WeldingRecipeManager.OnActiveReloaded(); ApplyRecipeByState(permissionOn);
});
}
//LogOut 상황에서 Recipe Save Lock //LogOut 상황에서 Recipe Save Lock
AuroraEnv.RecipeManager.SaveLock(CommonRecipeIds.ScannerObjectTeaching, !LoginState);
//LogOut 상황에서 Reicpe 화면 수정할 수 없도록 함 //LogOut 상황에서 Reicpe 화면 수정할 수 없도록 함
Application.Current.Dispatcher.Invoke(() => { _UCRecipe.IsEnabled = LoginState; }); Application.Current.Dispatcher.Invoke(() => { _UCRecipe.IsEnabled = permissionOn; });
} }
// For Selection LaserDevice // For Selection LaserDevice