| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- namespace ParameterModule.Pops.ViewModels;
- internal partial class ParaEditAlarmConditionViewModel : ObservableObject, IPopAware
- {
- public ParaEditAlarmConditionViewModel()
- {
- for (int i = 1; i <= 10; i++)
- {
- AlarmConditionTableInfo table = new()
- {
- Index = i,
- Name = $"Tabel {i}",
- };
- Tables.Add(table);
- }
- this.Alarms.Add(new("SUB"));
- this.Alarms.Add(new("U"));
- this.Alarms.Add(new("CU"));
- this.Alarms.Add(new("C"));
- this.Alarms.Add(new("CL"));
- this.Alarms.Add(new("L"));
- this.Alarms.Add(new("SL"));
- this.BoalAlarm.Add(new("Boat Load"));
- this.BoalAlarm.Add(new("Boat Unload"));
- }
- public ImageSource? ImageSource { get; set; }
- public string? Title { get; set; } = "Alarm Conditon";
- public Action? RequestClose { get; set; }
- [ObservableProperty]
- private ObservableCollection<AlarmConditionTableInfo> _Tables = [];
- [ObservableProperty]
- private ObservableCollection<AlarmPair> _Alarms = [];
- [ObservableProperty]
- private ObservableCollection<BoatLoadInhibitDetail> _BoalAlarm = [];
- public bool CanClose()
- {
- return true;
- }
- public void OnClose()
- {
- }
- public void OnPop(object? state)
- {
- this.Title = "Alarm Conditon";
- }
- [RelayCommand]
- private void Switch(AlarmConditionType type)
- {
- this.Alarms.Clear();
- switch (type)
- {
- case AlarmConditionType.Temp:
- this.Alarms.Add(new("SUB"));
- this.Alarms.Add(new("U"));
- this.Alarms.Add(new("CU"));
- this.Alarms.Add(new("C"));
- this.Alarms.Add(new("CL"));
- this.Alarms.Add(new("L"));
- this.Alarms.Add(new("SL"));
- break;
- case AlarmConditionType.MFC:
- for (int i = 1; i <= 10; i++)
- this.Alarms.Add(new($"MFC {i}"));
- break;
- case AlarmConditionType.Press:
- this.Alarms.Add(new("Press 1"));
- this.Alarms.Add(new("Press 2"));
- this.Alarms.Add(new("APC Angle"));
- break;
- case AlarmConditionType.Aux:
- for (int i = 1; i <= 16; i++)
- this.Alarms.Add(new($"U2-CH{i}"));
- break;
- case AlarmConditionType.HWILK:
- break;
- case AlarmConditionType.HardSoft:
- break;
- case AlarmConditionType.ContDown:
- break;
- case AlarmConditionType.Sensor:
- break;
- case AlarmConditionType.Other:
- break;
- default:
- break;
- }
- }
- [RelayCommand]
- private void Close()
- {
- this.RequestClose?.Invoke();
- }
- }
|