Push Changes from Techcrafters Repo
This commit is contained in:
@@ -6,6 +6,8 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Common;
|
||||
using InfineonHMI.Common;
|
||||
using TcEventLoggerAdsProxyLib;
|
||||
|
||||
namespace InfineonHMI;
|
||||
@@ -17,12 +19,63 @@ public sealed partial class MachineOverviewPageVM : ObservableObject, IRecipient
|
||||
|
||||
[ObservableProperty] private Page currentDetailPage;
|
||||
|
||||
|
||||
[ObservableProperty] private PackMLControlVM machinePackMLControlVM;
|
||||
|
||||
public bool CanUserChangePageAlignment
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
|
||||
public bool CanUserChangePageEtching1
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangePageEtching2
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangePageHighVoltage
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangePageHotCoolplate
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangePageKukaRobot
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangePageMediaCabinet
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangePageNIOStation
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangePageProductionOverview
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangePageReceipe
|
||||
{
|
||||
get { return currentUser.UserLevel == 100; }
|
||||
}
|
||||
public bool CanUserChangePageTrayFeeder
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
public bool CanUserChangeMachineState
|
||||
{
|
||||
get { return currentUser.UserLevel > 50; }
|
||||
}
|
||||
|
||||
|
||||
private readonly IAdsManager _adsManager;
|
||||
private readonly IConfiguration _config;
|
||||
|
||||
|
||||
private User currentUser;
|
||||
// Last active event
|
||||
[ObservableProperty] private string currentActiveEvent = "";
|
||||
|
||||
@@ -60,6 +113,10 @@ public sealed partial class MachineOverviewPageVM : ObservableObject, IRecipient
|
||||
public MachineOverviewPageVM()
|
||||
{
|
||||
// default ctor
|
||||
MachinePackMLControlVM = new();
|
||||
MachinePackMLControlVM.STitle = "Betriebszustand\n Gesamtanlage";
|
||||
|
||||
currentUser = Users.getCurrentUser();
|
||||
}
|
||||
public MachineOverviewPageVM(IAdsManager adsManager, IConfiguration config,MainWindowVM mainVm, ProductionOverviewPageVM prodVm, TcEventLogger eventLogger)
|
||||
{
|
||||
@@ -70,6 +127,10 @@ public sealed partial class MachineOverviewPageVM : ObservableObject, IRecipient
|
||||
// Create dummy string
|
||||
DummyStringVM = new StringControlButtonVM();
|
||||
|
||||
currentUser = Users.getCurrentUser();
|
||||
MachinePackMLControlVM = new(_adsManager, "GVL_SCADA.stMachine.stMachineCmds");
|
||||
|
||||
MachinePackMLControlVM.STitle = "Betriebszustand\n Gesamtanlage";
|
||||
// Create empty page
|
||||
_emptyPage = new();
|
||||
|
||||
@@ -79,6 +140,22 @@ public sealed partial class MachineOverviewPageVM : ObservableObject, IRecipient
|
||||
|
||||
WeakReferenceMessenger.Default.Register<NavigateMessage>(this);
|
||||
|
||||
//CanUserChangePageAlignment = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageEtching1 = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageEtching2 = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageHighVoltage = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageHotCoolplate = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageKukaRobot = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageMediaCabinet = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageNIOStation = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageProductionOverview = currentUser.UserLevel > 50;
|
||||
//CanUserChangePageReceipe = currentUser.UserLevel == 100;
|
||||
//CanUserChangePageTrayFeeder = currentUser.UserLevel > 50;
|
||||
//CanUserChangeMachineState = currentUser.UserLevel > 50;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -202,56 +279,56 @@ public sealed partial class MachineOverviewPageVM : ObservableObject, IRecipient
|
||||
{
|
||||
case nameof(TrayFeederPage):
|
||||
if (_trayFeederPageVm == null)
|
||||
_trayFeederPageVm = new(_adsManager, "GVL_CONFIG.stMachine");
|
||||
_trayFeederPageVm = new(_adsManager, "GVL_SCADA.stMachine.TrayFeeder"); //In and Out ist set directly in ViewModel
|
||||
|
||||
TrayFeederPage trayFeederPage = new() { DataContext = _trayFeederPageVm };
|
||||
TrayFeederPage trayFeederPage = new() { DataContext = _trayFeederPageVm };
|
||||
CurrentDetailPage = trayFeederPage;
|
||||
break;
|
||||
|
||||
case nameof(AlignmentStationPage):
|
||||
// Create seetings page view model only once
|
||||
if (_alignmentStationPageVM == null)
|
||||
_alignmentStationPageVM = new(_adsManager, "GVL_CONFIG.stMachine.stAligner");
|
||||
|
||||
AlignmentStationPage settingsPage = new() { DataContext = _alignmentStationPageVM };
|
||||
_alignmentStationPageVM = new(_adsManager, "GVL_SCADA.stMachine.stAligner");
|
||||
|
||||
AlignmentStationPage settingsPage = new() { DataContext = _alignmentStationPageVM };
|
||||
CurrentDetailPage = settingsPage;
|
||||
break;
|
||||
|
||||
case nameof(EtchingStation1Page):
|
||||
if (_etchingStation1PageVm == null)
|
||||
_etchingStation1PageVm = new(_adsManager, "GVL_CONFIG.stMachine.stEtcher1");
|
||||
_etchingStation1PageVm = new(_adsManager, "GVL_SCADA.stMachine.stEtcher1");
|
||||
|
||||
EtchingStation1Page etchingStation1Page = new() { DataContext = _etchingStation1PageVm };
|
||||
EtchingStation1Page etchingStation1Page = new() { DataContext = _etchingStation1PageVm };
|
||||
CurrentDetailPage = etchingStation1Page;
|
||||
break;
|
||||
|
||||
case nameof(EtchingStation2Page):
|
||||
if (_etchingStation2PageVm == null)
|
||||
_etchingStation2PageVm = new(_adsManager, "GVL_CONFIG.stMachine.stEtcher2");
|
||||
_etchingStation2PageVm = new(_adsManager, "GVL_SCADA.stMachine.stEtcher2");
|
||||
|
||||
EtchingStation2Page etchingStation2Page = new() { DataContext = _etchingStation2PageVm };
|
||||
EtchingStation2Page etchingStation2Page = new() { DataContext = _etchingStation2PageVm };
|
||||
CurrentDetailPage = etchingStation2Page;
|
||||
break;
|
||||
|
||||
case nameof(HighVoltageStationPage):
|
||||
if (_highVoltageStationPageVm == null)
|
||||
_highVoltageStationPageVm = new(_adsManager, "GVL_CONFIG.stMachine");
|
||||
_highVoltageStationPageVm = new(_adsManager, "GVL_SCADA.stMachine.stHVTester"); // Hot/Cold is Set directly in VM
|
||||
|
||||
HighVoltageStationPage highVoltageStationPage = new() { DataContext = _highVoltageStationPageVm };
|
||||
HighVoltageStationPage highVoltageStationPage = new() { DataContext = _highVoltageStationPageVm };
|
||||
CurrentDetailPage = highVoltageStationPage;
|
||||
break;
|
||||
|
||||
case nameof(HotCoolPlatePage):
|
||||
if (_hotCoolplatePageVM == null)
|
||||
_hotCoolplatePageVM = new(_adsManager, "GVL_Config.stMachine");
|
||||
_hotCoolplatePageVM = new(_adsManager, "GVL_SCADA.stMachine"); //".stHotplate /.stCoolplate is set directly in VM
|
||||
|
||||
HotCoolPlatePage hotCoolPlatePage = new() {DataContext = _hotCoolplatePageVM };
|
||||
HotCoolPlatePage hotCoolPlatePage = new() {DataContext = _hotCoolplatePageVM };
|
||||
CurrentDetailPage = hotCoolPlatePage;
|
||||
break;
|
||||
|
||||
case nameof(NIOStationPage):
|
||||
if (_nioStationPageVm == null)
|
||||
_nioStationPageVm = new(_adsManager, "GVL_Config.stMachine.stNOK");
|
||||
_nioStationPageVm = new(_adsManager, "GVL_SCADA.stMachine.stNOK");
|
||||
|
||||
NIOStationPage nIOStationPage = new() { DataContext = _nioStationPageVm };
|
||||
CurrentDetailPage = nIOStationPage;
|
||||
@@ -260,17 +337,17 @@ public sealed partial class MachineOverviewPageVM : ObservableObject, IRecipient
|
||||
case nameof(KukaRobotPage):
|
||||
// Create page view model only once
|
||||
if (_kukaRobotPageVM == null)
|
||||
_kukaRobotPageVM = new(_adsManager, "GVL_CONFIG.stMachine.stKukaRobot");
|
||||
_kukaRobotPageVM = new(_adsManager); // Variablenames are set directly in Viewmodel
|
||||
|
||||
KukaRobotPage kukaRobotPage = new() { DataContext = _kukaRobotPageVM };
|
||||
KukaRobotPage kukaRobotPage = new() { DataContext = _kukaRobotPageVM };
|
||||
CurrentDetailPage = kukaRobotPage;
|
||||
break;
|
||||
|
||||
case nameof(MediaCabinetPage):
|
||||
if (_mediaCabinetPageVM == null)
|
||||
_mediaCabinetPageVM = new(_adsManager, "GVL_Config.stMachine");
|
||||
_mediaCabinetPageVM = new(_adsManager, "GVL_SCADA.stMachine.stMediaCabinet"); //TODO not Implemented on PLC yet
|
||||
|
||||
MediaCabinetPage mediaCabinetPage = new() { DataContext= _mediaCabinetPageVM };
|
||||
MediaCabinetPage mediaCabinetPage = new() { DataContext= _mediaCabinetPageVM };
|
||||
CurrentDetailPage = mediaCabinetPage;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user