746 lines
26 KiB
C#
746 lines
26 KiB
C#
using System.Collections.ObjectModel;
|
|
using System.Printing;
|
|
using System.Runtime.InteropServices.JavaScript;
|
|
using System.Windows.Automation;
|
|
using System.Windows.Input;
|
|
using Common;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using Heisig.HMI.AdsManager;
|
|
using InfineonHMI.Model;
|
|
using Microsoft.Win32;
|
|
using InfineonHMI.Common;
|
|
using TwinCAT.PlcOpen;
|
|
|
|
namespace InfineonHMI;
|
|
|
|
public sealed partial class ReceipePageVM : ObservableValidator, IDisposable
|
|
{
|
|
|
|
#region Properties
|
|
private AdsManager _adsManager;
|
|
|
|
private int maxFlowNodes = 10;
|
|
private int maxTrayPositions = 20;
|
|
private int maxEtcherRobotPositions = 20;
|
|
|
|
[ObservableProperty] private ObservableCollection<TrayPosition> trayPositions;
|
|
[ObservableProperty] private ParamControlIntVm cameraProgramsVm = new ();
|
|
[ObservableProperty] private ParamControlIntVm chucksVm = new ();
|
|
[ObservableProperty] private ParamControlIntVm gripperVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm permissibleBeamParamDeviationsVm = new ();
|
|
|
|
[ObservableProperty] private ParamControlFloatVm diameterVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm thicknessVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm timeIntervallBeamCheckVm = new ();
|
|
|
|
[ObservableProperty] private ParamControlFloatVm restingTimeHotplateVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm targetTemperatureHotplateVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm restingTimeCoolplateVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm targetTemperatureCoolplateVm = new ();
|
|
|
|
[ObservableProperty] private ParamControlFloatVm hvtestVoltageVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm hvmaxTestCurrentVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm hvrampTimeVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm hvtestFrequencyVm = new ();
|
|
[ObservableProperty] private ParamControlIntVm hvpolarityVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm hvtestPressureN2Vm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm hvn2PrePurgeTimeVm = new ();
|
|
[ObservableProperty] private ParamControlIntVm hvnumRetriesVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm hvtestTemperatureVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm hvTestOkVoltageVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm hvTestOkCurrentVm = new ();
|
|
|
|
[ObservableProperty] private ParamControlIntVm numberRobotPositionsVm = new ();
|
|
[ObservableProperty] private ParamControlFloatVm chuckRpmVm = new ();
|
|
[ObservableProperty] private ObservableCollection<EtcherRobotStepData> etcherRobotSteps;
|
|
[ObservableProperty] private ParamControlFloatVm radialPosLowerWaterJetVm = new ();
|
|
|
|
[ObservableProperty] private ParamControlIntVm flowNodeCountVm = new ();
|
|
|
|
|
|
#endregion Properties
|
|
|
|
#region FlowReceipe
|
|
|
|
[ObservableProperty]
|
|
private ObservableCollection<StationEntry> flowStationsVm =
|
|
[
|
|
new StationEntry(Stationenum.EINGABE, "Eingabetray"),
|
|
new StationEntry(Stationenum.QRCODE, "QR Code Scan"),
|
|
new StationEntry(Stationenum.AUSRICHTEN, "Ausrichten"),
|
|
new StationEntry(Stationenum.AETZEN, "Ätzstation 1/2"),
|
|
new StationEntry(Stationenum.HEIZPLATTE, "Heizplatte"),
|
|
new StationEntry(Stationenum.KUEHLPLATTE, "Kühlplatte"),
|
|
new StationEntry(Stationenum.HOCHVOLTHEISS, "Hochvolt Heiss"),
|
|
new StationEntry(Stationenum.HOCHVOLTKALT, "Hochvolt Kalt"),
|
|
new StationEntry(Stationenum.AUSGABE, "Ausgabetray"),
|
|
new StationEntry(Stationenum.NIOSTATION, "NIO Station")
|
|
|
|
];
|
|
|
|
[ObservableProperty] private ObservableCollection<FlowReceipeEntry> flowReceipeEntries;
|
|
|
|
[RelayCommand]
|
|
public void AddFlowReceipeEntry()
|
|
{
|
|
var nodeid = FlowReceipeEntries.Count;
|
|
FlowReceipeEntries.Add(new FlowReceipeEntry
|
|
{
|
|
NodeId = nodeid,
|
|
MaxRetries = 0,
|
|
NextNodeFail = -1,
|
|
NextNodeSuccess = -1,
|
|
NextNodeRetry = -1,
|
|
Priority = 100,
|
|
Station = FlowStationsVm[0]
|
|
});
|
|
if (FlowReceipeEntries.Count >= maxFlowNodes)
|
|
{
|
|
CanAddFlowReceipeEntry = false;
|
|
}
|
|
|
|
if (FlowReceipeEntries.Count > 0)
|
|
{
|
|
CanRemoveFlowReceipeEntry = true;
|
|
}
|
|
}
|
|
|
|
private void addFlowReceipeEntry(FlowReceipeEntry fre)
|
|
{
|
|
var nodeid = FlowReceipeEntries.Count;
|
|
FlowReceipeEntries.Add(new FlowReceipeEntry
|
|
{
|
|
NodeId = nodeid,
|
|
MaxRetries = fre.MaxRetries,
|
|
NextNodeFail = fre.NextNodeFail,
|
|
NextNodeSuccess = fre.NextNodeSuccess,
|
|
NextNodeRetry = fre.NextNodeRetry,
|
|
Priority = fre.Priority,
|
|
Station = new StationEntry(fre.Station.eStation, fre.Station.sName)
|
|
});
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void RemoveFlowReceipeEntry()
|
|
{
|
|
FlowReceipeEntries.Remove(SelectedFlowReceipeEntry);
|
|
var receipes = new ObservableCollection<FlowReceipeEntry>(FlowReceipeEntries);
|
|
|
|
FlowReceipeEntries.Clear();
|
|
|
|
foreach (var receipe in receipes)
|
|
addFlowReceipeEntry(receipe);
|
|
|
|
|
|
if (FlowReceipeEntries.Count < maxFlowNodes)
|
|
{
|
|
CanAddFlowReceipeEntry = true;
|
|
}
|
|
|
|
if (FlowReceipeEntries.Count > 0)
|
|
{
|
|
CanRemoveFlowReceipeEntry = true;
|
|
}
|
|
else
|
|
{
|
|
CanRemoveFlowReceipeEntry = false;
|
|
}
|
|
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void FlowReceipeEntryUp()
|
|
{
|
|
var selectedIndex = FlowReceipeEntries.IndexOf(SelectedFlowReceipeEntry);
|
|
if (selectedIndex == 0)
|
|
return;
|
|
FlowReceipeEntries.Move(selectedIndex, selectedIndex - 1);
|
|
|
|
var receipes = new ObservableCollection<FlowReceipeEntry>(FlowReceipeEntries);
|
|
FlowReceipeEntries.Clear();
|
|
|
|
foreach (var receipe in receipes)
|
|
addFlowReceipeEntry(receipe);
|
|
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void FlowReceipeEntryDown()
|
|
{
|
|
var selectedIndex = FlowReceipeEntries.IndexOf(SelectedFlowReceipeEntry);
|
|
if (selectedIndex >= FlowReceipeEntries.Count)
|
|
return;
|
|
FlowReceipeEntries.Move(selectedIndex, selectedIndex + 1);
|
|
|
|
var receipes = new ObservableCollection<FlowReceipeEntry>(FlowReceipeEntries);
|
|
FlowReceipeEntries.Clear();
|
|
|
|
foreach (var receipe in receipes)
|
|
addFlowReceipeEntry(receipe);
|
|
|
|
}
|
|
|
|
[ObservableProperty] private bool canAddFlowReceipeEntry;
|
|
[ObservableProperty] private bool canRemoveFlowReceipeEntry;
|
|
|
|
[ObservableProperty] private FlowReceipeEntry selectedFlowReceipeEntry;
|
|
|
|
#endregion Flowreceipe
|
|
|
|
#region Traypositions
|
|
[ObservableProperty] private TrayPosition selectedTrayPosition;
|
|
|
|
|
|
[ObservableProperty] private bool canAddTrayPosition;
|
|
[ObservableProperty] private bool canRemoveTrayPosition;
|
|
|
|
[RelayCommand]
|
|
public void AddTrayPosition()
|
|
{
|
|
var posId = TrayPositions.Count;
|
|
TrayPositions.Add(new TrayPosition
|
|
{
|
|
PosId = posId,
|
|
PosX = 0.0f,
|
|
PosY = 0.0f,
|
|
|
|
});
|
|
if (TrayPositions.Count >= maxTrayPositions)
|
|
{
|
|
CanAddTrayPosition = false;
|
|
}
|
|
|
|
if (TrayPositions.Count > 0)
|
|
{
|
|
CanRemoveTrayPosition = true;
|
|
}
|
|
}
|
|
|
|
private void addTrayPosition(TrayPosition trayPos)
|
|
{
|
|
var posId = TrayPositions.Count;
|
|
TrayPositions.Add(new TrayPosition
|
|
{
|
|
PosId = posId,
|
|
PosX = trayPos.PosX,
|
|
PosY = trayPos.PosY
|
|
});
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void RemoveTrayPosition()
|
|
{
|
|
TrayPositions.Remove(SelectedTrayPosition);
|
|
var positions = new ObservableCollection<TrayPosition>(TrayPositions);
|
|
|
|
TrayPositions.Clear();
|
|
|
|
foreach (var position in positions)
|
|
addTrayPosition(position);
|
|
|
|
|
|
if (TrayPositions.Count < maxTrayPositions)
|
|
{
|
|
CanAddTrayPosition = true;
|
|
}
|
|
|
|
if (TrayPositions.Count > 0)
|
|
{
|
|
CanRemoveTrayPosition = true;
|
|
}
|
|
else
|
|
{
|
|
CanRemoveTrayPosition = false;
|
|
}
|
|
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void TrayPositionUp()
|
|
{
|
|
var selectedIndex = TrayPositions.IndexOf(SelectedTrayPosition);
|
|
if (selectedIndex == 0)
|
|
return;
|
|
TrayPositions.Move(selectedIndex, selectedIndex - 1);
|
|
|
|
var positions = new ObservableCollection<TrayPosition>(TrayPositions);
|
|
TrayPositions.Clear();
|
|
|
|
foreach (var pos in positions)
|
|
addTrayPosition(pos);
|
|
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void TrayPositionDown()
|
|
{
|
|
var selectedIndex = TrayPositions.IndexOf(SelectedTrayPosition);
|
|
if (selectedIndex >= TrayPositions.Count)
|
|
return;
|
|
TrayPositions.Move(selectedIndex, selectedIndex + 1);
|
|
|
|
var positions = new ObservableCollection<TrayPosition>(TrayPositions);
|
|
TrayPositions.Clear();
|
|
|
|
foreach (var pos in positions)
|
|
addTrayPosition(pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion Traypositions
|
|
|
|
#region EtcherRobotPositions
|
|
|
|
[ObservableProperty] private EtcherRobotStepData selectedEtchRobotStep;
|
|
|
|
|
|
[ObservableProperty] private bool canAddEtchRobotStep;
|
|
[ObservableProperty] private bool canRemoveEtchRobotStep;
|
|
|
|
[RelayCommand]
|
|
public void AddEtchRobotStep()
|
|
{
|
|
EtcherRobotSteps.Add(new EtcherRobotStepData()
|
|
{
|
|
PosX = 0.0f,
|
|
PosY = 0.0f,
|
|
PosZ = 0.0f,
|
|
MoveSpeed = 0.0f,
|
|
AngleAlpha = 0.0f,
|
|
WaterFromAbove = false,
|
|
WaterFromBelow = false,
|
|
Medium = 0,
|
|
Delay = 0.0f
|
|
});
|
|
if (EtcherRobotSteps.Count >= maxEtcherRobotPositions)
|
|
{
|
|
CanAddEtchRobotStep = false;
|
|
}
|
|
|
|
if (EtcherRobotSteps.Count > 0)
|
|
{
|
|
CanRemoveEtchRobotStep = true;
|
|
}
|
|
}
|
|
|
|
private void addEtchRobotStep(EtcherRobotStepData etchStep)
|
|
{
|
|
var posId = EtcherRobotSteps.Count;
|
|
EtcherRobotSteps.Add(new EtcherRobotStepData()
|
|
{
|
|
PosX = etchStep.PosX,
|
|
PosY = etchStep.PosY,
|
|
PosZ = etchStep.PosZ,
|
|
MoveSpeed = etchStep.MoveSpeed,
|
|
AngleAlpha = etchStep.AngleAlpha,
|
|
WaterFromAbove = etchStep.WaterFromAbove,
|
|
WaterFromBelow = etchStep.WaterFromBelow,
|
|
Medium = etchStep.Medium,
|
|
Delay = etchStep.Delay
|
|
});
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void RemoveEtchRobotStep()
|
|
{
|
|
EtcherRobotSteps.Remove(SelectedEtchRobotStep);
|
|
var steps = new ObservableCollection<EtcherRobotStepData>(EtcherRobotSteps);
|
|
|
|
EtcherRobotSteps.Clear();
|
|
|
|
foreach (var step in steps)
|
|
addEtchRobotStep(step);
|
|
|
|
|
|
if (EtcherRobotSteps.Count < maxEtcherRobotPositions)
|
|
{
|
|
CanAddEtchRobotStep = true;
|
|
}
|
|
|
|
if (EtcherRobotSteps.Count > 0)
|
|
{
|
|
CanRemoveEtchRobotStep = true;
|
|
}
|
|
else
|
|
{
|
|
CanRemoveEtchRobotStep = false;
|
|
}
|
|
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void EtchRobotStepUp()
|
|
{
|
|
var selectedIndex = EtcherRobotSteps.IndexOf(SelectedEtchRobotStep);
|
|
if (selectedIndex == 0)
|
|
return;
|
|
EtcherRobotSteps.Move(selectedIndex, selectedIndex - 1);
|
|
|
|
var steps = new ObservableCollection<EtcherRobotStepData>(EtcherRobotSteps);
|
|
EtcherRobotSteps.Clear();
|
|
|
|
foreach (var step in steps)
|
|
addEtchRobotStep(step);
|
|
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void EtchRobotStepDown()
|
|
{
|
|
var selectedIndex = EtcherRobotSteps.IndexOf(SelectedEtchRobotStep);
|
|
if (selectedIndex >= EtcherRobotSteps.Count)
|
|
return;
|
|
EtcherRobotSteps.Move(selectedIndex, selectedIndex + 1);
|
|
|
|
var steps = new ObservableCollection<EtcherRobotStepData>(EtcherRobotSteps);
|
|
EtcherRobotSteps.Clear();
|
|
|
|
foreach (var step in steps)
|
|
addEtchRobotStep(step);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Commands
|
|
|
|
[RelayCommand]
|
|
public void WriteToPlc()
|
|
{
|
|
SendDataToPLC();
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void ReadReceipeFile()
|
|
{
|
|
var dlg = new OpenFileDialog();
|
|
if (dlg.ShowDialog() != true)
|
|
return ;
|
|
|
|
var dto = new ReceipeDto();
|
|
dto.Read(dlg.FileName);
|
|
GetDto(dto);
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void WriteReceipeFile()
|
|
{
|
|
var dlg = new SaveFileDialog();
|
|
if (dlg.ShowDialog() != true)
|
|
return;
|
|
|
|
var dto = SetDto();
|
|
dto.Write(dlg.FileName);
|
|
}
|
|
|
|
|
|
#endregion Commands
|
|
|
|
|
|
#region ctor
|
|
|
|
public ReceipePageVM()
|
|
{
|
|
|
|
|
|
maxFlowNodes = 10;
|
|
maxEtcherRobotPositions = 10;
|
|
maxTrayPositions = 10;
|
|
|
|
TrayPositions = new ();
|
|
EtcherRobotSteps = new ();
|
|
FlowReceipeEntries = new ();
|
|
|
|
CameraProgramsVm.SName = "Kameraprogramme: ";
|
|
ChucksVm.SName = "Drehteller: ";
|
|
GripperVm.SName = "Greifertyp: ";
|
|
PermissibleBeamParamDeviationsVm.SName = "Max. Strahlabweichung: ";
|
|
DiameterVm.SName = "Teiledurchmesser: ";
|
|
ThicknessVm.SName = "Teiledicke: ";
|
|
TimeIntervallBeamCheckVm.SName = "Intervall Strahlvermessung: ";
|
|
RestingTimeHotplateVm.SName = "Verweilzeit Heizplatte: ";
|
|
TargetTemperatureHotplateVm.SName = "Zieltemperatur Heizplatte: ";
|
|
RestingTimeCoolplateVm.SName = "Verweilzeit Kühlplatte: ";
|
|
TargetTemperatureCoolplateVm.SName = "Zieltemperatur Kühlplatte";
|
|
|
|
RadialPosLowerWaterJetVm.SName = "Radial Position Unterwasserstrahl: ";
|
|
ChuckRpmVm.SName = "Drehzahl: ";
|
|
HvmaxTestCurrentVm.SName = "HV: Max. Teststrom: ";
|
|
Hvn2PrePurgeTimeVm.SName = "HV: Vorreinigungszeit: ";
|
|
HvnumRetriesVm.SName = "HV: Anzahl Wiederholversuche: ";
|
|
HvpolarityVm.SName = "HV: Polarität (1=Pos, 2=Neg): ";
|
|
HvrampTimeVm.SName = "HV: Rampenzeit: ";
|
|
HvtestFrequencyVm.SName = "HV: Testfrequenz: ";
|
|
HvTestOkCurrentVm.SName = "HV: Teststrom Teil OK";
|
|
HvTestOkVoltageVm.SName = "HV: Testspannung Teil OK";
|
|
HvtestTemperatureVm.SName = "HV: Testtemperatur: ";
|
|
HvtestVoltageVm.SName = "HV: Testspannung: ";
|
|
HvtestPressureN2Vm.SName = "HV: DruckN2: ";
|
|
|
|
FlowReceipeEntries = new();
|
|
|
|
FlowReceipeEntries.Add(new FlowReceipeEntry
|
|
{
|
|
Priority = 100,
|
|
Station = FlowStationsVm[0],
|
|
MaxRetries = 0,
|
|
NextNodeSuccess = 1,
|
|
NextNodeRetry = -1,
|
|
NextNodeFail = -1
|
|
});
|
|
|
|
|
|
CanAddTrayPosition = true;
|
|
CanRemoveTrayPosition = false;
|
|
CanAddFlowReceipeEntry = true;
|
|
CanRemoveFlowReceipeEntry = false;
|
|
CanAddEtchRobotStep = true;
|
|
CanRemoveEtchRobotStep = false;
|
|
|
|
}
|
|
|
|
public ReceipePageVM(AdsManager adsManager)
|
|
{
|
|
_adsManager = adsManager;
|
|
|
|
var val = _adsManager.ReadValue("GVL_Scheduler.MAX_RECIPE_NODES");
|
|
maxFlowNodes = (val == null) ? 10 : (int)val; ;
|
|
val = _adsManager.ReadValue("GVL_ETCHER.MAX_ROBOT_POS");
|
|
maxEtcherRobotPositions = (val == null) ? 10 : (int)val;
|
|
val = _adsManager.ReadValue("GVL_ETCHER.MAX_ROBOT_POS");
|
|
maxTrayPositions = (val == null) ? 10 : (int)val;
|
|
|
|
|
|
|
|
TrayPositions = new ();
|
|
EtcherRobotSteps = new ();
|
|
FlowReceipeEntries = new ();
|
|
|
|
CameraProgramsVm.SName = "Kameraprogramme: ";
|
|
ChucksVm.SName = "Drehteller: ";
|
|
GripperVm.SName = "Greifertyp: ";
|
|
PermissibleBeamParamDeviationsVm.SName = "Max. Strahlabweichung: ";
|
|
DiameterVm.SName = "Teiledurchmesser: ";
|
|
ThicknessVm.SName = "Teiledicke: ";
|
|
TimeIntervallBeamCheckVm.SName = "Intervall Strahlvermessung: ";
|
|
RestingTimeHotplateVm.SName = "Verweilzeit Heizplatte: ";
|
|
TargetTemperatureHotplateVm.SName = "Zieltemperatur Heizplatte: ";
|
|
RestingTimeCoolplateVm.SName = "Verweilzeit Kühlplatte: ";
|
|
TargetTemperatureCoolplateVm.SName = "Zieltemperatur Kühlplatte";
|
|
|
|
RadialPosLowerWaterJetVm.SName = "Radial Position Unterwasserstrahl: ";
|
|
ChuckRpmVm.SName = "Drehzahl: ";
|
|
HvmaxTestCurrentVm.SName = "HV: Max. Teststrom: ";
|
|
Hvn2PrePurgeTimeVm.SName = "HV: Vorreinigungszeit: ";
|
|
HvnumRetriesVm.SName = "HV: Anzahl Wiederholversuche: ";
|
|
HvpolarityVm.SName = "HV: Polarität (1=Pos, 2=Neg): ";
|
|
HvrampTimeVm.SName = "HV: Rampenzeit: ";
|
|
HvtestFrequencyVm.SName = "HV: Testfrequenz: ";
|
|
HvTestOkCurrentVm.SName = "HV: Teststrom Teil OK";
|
|
HvTestOkVoltageVm.SName = "HV: Testspannung Teil OK";
|
|
HvtestTemperatureVm.SName = "HV: Testtemperatur: ";
|
|
HvtestVoltageVm.SName = "HV: Testspannung: ";
|
|
HvtestPressureN2Vm.SName = "HV: DruckN2: ";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion ctor
|
|
|
|
|
|
|
|
private ReceipeDto SetDto()
|
|
{
|
|
var receipe = new ReceipeDto();
|
|
|
|
receipe.ReceipeObject.MachineParameters.TrayPositions = new List<TrayPosition>(TrayPositions);
|
|
receipe.ReceipeObject.MachineParameters.CameraPrograms = CameraProgramsVm.Value;
|
|
receipe.ReceipeObject.MachineParameters.Chucks = ChucksVm.Value;
|
|
receipe.ReceipeObject.MachineParameters.Gripper = GripperVm.Value;
|
|
receipe.ReceipeObject.MachineParameters.PermissibleBeamParameterDeviations = PermissibleBeamParamDeviationsVm.Value;
|
|
|
|
receipe.ReceipeObject.ProductParameters.Diameter = DiameterVm.Value;
|
|
receipe.ReceipeObject.ProductParameters.Thickness = ThicknessVm.Value;
|
|
receipe.ReceipeObject.ProductParameters.TimeIntervallBeamCheck = TimeIntervallBeamCheckVm.Value;
|
|
|
|
receipe.ReceipeObject.ReceipeHotplate.RestingTime = RestingTimeHotplateVm.Value;
|
|
receipe.ReceipeObject.ReceipeHotplate.TargetTemperature = TargetTemperatureHotplateVm.Value;
|
|
|
|
receipe.ReceipeObject.ReceipeCoolplate.RestingTime = RestingTimeCoolplateVm.Value;
|
|
receipe.ReceipeObject.ReceipeCoolplate.TargetTemperature = TargetTemperatureCoolplateVm.Value;
|
|
|
|
receipe.ReceipeObject.ReceipeEtcher.NumberRobotPos = (ushort)NumberRobotPositionsVm.Value;
|
|
receipe.ReceipeObject.ReceipeEtcher.RadialPosLowerWaterJet = RadialPosLowerWaterJetVm.Value;
|
|
receipe.ReceipeObject.ReceipeEtcher.Rpm = ChuckRpmVm.Value;
|
|
receipe.ReceipeObject.ReceipeEtcher.RobotStepData = new List<EtcherRobotStepData>(EtcherRobotSteps);
|
|
|
|
receipe.ReceipeObject.ReceipeHvTester.MaximumTestCurrent = HvmaxTestCurrentVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.N2PrePurgetime = Hvn2PrePurgeTimeVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.NumRetries = (ushort)HvnumRetriesVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.Polarity = (ushort)HvpolarityVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.RampTime = HvrampTimeVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.TestFrequency = HvtestFrequencyVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.TestOkCurrent = HvTestOkCurrentVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.TestOkVoltage = HvTestOkVoltageVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.TestTemperature = HvtestTemperatureVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.TestVoltage = HvtestVoltageVm.Value;
|
|
receipe.ReceipeObject.ReceipeHvTester.TestpressureN2 = HvtestPressureN2Vm.Value;
|
|
|
|
receipe.ReceipeObject.Flowreceipe.Nodes = new List<FlowReceipeNode>();
|
|
foreach (var entry in FlowReceipeEntries)
|
|
{
|
|
var node = new FlowReceipeNode();
|
|
node.StationType = (ushort)entry.Station.eStation;
|
|
node.Priority = entry.Priority;
|
|
node.NextNodeSuccess = entry.NextNodeSuccess;
|
|
node.NextNodeRetry = entry.NextNodeRetry;
|
|
node.NextNodeFail = entry.NextNodeFail;
|
|
node.MaxRetries = entry.MaxRetries;
|
|
|
|
receipe.ReceipeObject.Flowreceipe.Nodes.Add(node);
|
|
}
|
|
|
|
receipe.ReceipeObject.Flowreceipe.NodeCount = receipe.ReceipeObject.Flowreceipe.Nodes.Count;
|
|
|
|
|
|
return receipe;
|
|
}
|
|
|
|
private void GetDto(ReceipeDto receipe)
|
|
{
|
|
TrayPositions = new (receipe.ReceipeObject.MachineParameters.TrayPositions);
|
|
CameraProgramsVm.Value = receipe.ReceipeObject.MachineParameters.CameraPrograms;
|
|
ChucksVm.Value = receipe.ReceipeObject.MachineParameters.Chucks;
|
|
GripperVm.Value = receipe.ReceipeObject.MachineParameters.Gripper;
|
|
PermissibleBeamParamDeviationsVm.Value = receipe.ReceipeObject.MachineParameters.PermissibleBeamParameterDeviations;
|
|
|
|
DiameterVm.Value = receipe.ReceipeObject.ProductParameters.Diameter;
|
|
ThicknessVm.Value = receipe.ReceipeObject.ProductParameters.Thickness;
|
|
TimeIntervallBeamCheckVm.Value = receipe.ReceipeObject.ProductParameters.TimeIntervallBeamCheck;
|
|
|
|
RestingTimeHotplateVm.Value = receipe.ReceipeObject.ReceipeHotplate.RestingTime;
|
|
TargetTemperatureHotplateVm.Value = receipe.ReceipeObject.ReceipeHotplate.TargetTemperature;
|
|
|
|
RestingTimeCoolplateVm.Value = receipe.ReceipeObject.ReceipeCoolplate.RestingTime;
|
|
TargetTemperatureCoolplateVm.Value = receipe.ReceipeObject.ReceipeCoolplate.TargetTemperature;
|
|
|
|
NumberRobotPositionsVm.Value = receipe.ReceipeObject.ReceipeEtcher.NumberRobotPos;
|
|
RadialPosLowerWaterJetVm.Value = receipe.ReceipeObject.ReceipeEtcher.RadialPosLowerWaterJet;
|
|
ChuckRpmVm.Value = receipe.ReceipeObject.ReceipeEtcher.Rpm;
|
|
EtcherRobotSteps = new (receipe.ReceipeObject.ReceipeEtcher.RobotStepData);
|
|
|
|
HvmaxTestCurrentVm.Value = receipe.ReceipeObject.ReceipeHvTester.MaximumTestCurrent;
|
|
Hvn2PrePurgeTimeVm.Value = receipe.ReceipeObject.ReceipeHvTester.N2PrePurgetime;
|
|
HvnumRetriesVm.Value = receipe.ReceipeObject.ReceipeHvTester.NumRetries;
|
|
HvpolarityVm.Value = receipe.ReceipeObject.ReceipeHvTester.Polarity;
|
|
HvrampTimeVm.Value = receipe.ReceipeObject.ReceipeHvTester.RampTime;
|
|
HvtestFrequencyVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestFrequency;
|
|
HvTestOkCurrentVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestOkCurrent;
|
|
HvTestOkVoltageVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestOkVoltage;
|
|
HvtestTemperatureVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestTemperature;
|
|
HvtestVoltageVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestVoltage;
|
|
HvtestPressureN2Vm.Value = receipe.ReceipeObject.ReceipeHvTester.TestpressureN2;
|
|
|
|
FlowReceipeEntries.Clear();
|
|
foreach (var node in receipe.ReceipeObject.Flowreceipe.Nodes)
|
|
{
|
|
var station = FlowStationsVm.First(i => (uint)i.eStation == (uint)node.StationType);
|
|
|
|
AddFlowReceipeEntry();
|
|
FlowReceipeEntries.Last().MaxRetries = node.MaxRetries;
|
|
FlowReceipeEntries.Last().NextNodeRetry = node.NextNodeRetry;
|
|
FlowReceipeEntries.Last().NextNodeFail = node.NextNodeFail;
|
|
FlowReceipeEntries.Last().NextNodeSuccess = node.NextNodeSuccess;
|
|
FlowReceipeEntries.Last().Priority = node.Priority;
|
|
FlowReceipeEntries.Last().Station = station;
|
|
}
|
|
|
|
FlowNodeCountVm.Value = receipe.ReceipeObject.Flowreceipe.NodeCount;
|
|
}
|
|
|
|
private void SendDataToPLC()
|
|
{
|
|
var val = _adsManager.ReadValue("GVL_Scheduler.MAX_RECIPE_NODES");
|
|
maxFlowNodes = (val == null) ? 10 : (int)val; ;
|
|
val = _adsManager.ReadValue("GVL_ETCHER.MAX_ROBOT_POS");
|
|
maxEtcherRobotPositions = (val == null) ? 10:(int)val;
|
|
val = _adsManager.ReadValue("GVL_ETCHER.MAX_ROBOT_POS");
|
|
maxTrayPositions = (val == null) ? 20 : (int)val;
|
|
|
|
for (var i = 0; i < maxTrayPositions && i < TrayPositions.Count; i++)
|
|
{
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stTray.arPosX[" + i + "]", TrayPositions[i].PosX);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stTray.arPosY[" + i + "]", TrayPositions[i].PosY);
|
|
}
|
|
|
|
var trayPosCountToPlc = TrayPositions.Count < maxTrayPositions ? TrayPositions.Count : maxTrayPositions;
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stTray.iPosCnt", trayPosCountToPlc);
|
|
|
|
for (var i = 0; i < maxEtcherRobotPositions && i < EtcherRobotSteps.Count; i++)
|
|
{
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rPosX", EtcherRobotSteps[i].PosX);
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rPosY", EtcherRobotSteps[i].PosY);
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rPosZ", EtcherRobotSteps[i].PosZ);
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rAngleAlpha", EtcherRobotSteps[i].AngleAlpha);
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rMoveSpeed", EtcherRobotSteps[i].MoveSpeed);
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rDelay", EtcherRobotSteps[i].Delay);
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].uiMedium", EtcherRobotSteps[i].Medium);
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].xWaterFromBelow", EtcherRobotSteps[i].WaterFromBelow);
|
|
_adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].xWaterFromAbove", EtcherRobotSteps[i].WaterFromAbove);
|
|
}
|
|
|
|
|
|
for (var i = 0; (i < maxFlowNodes && i < FlowReceipeEntries.Count); i++)
|
|
{
|
|
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].Priority);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].Station.eStation);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].MaxRetries);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].NextNodeSuccess);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].NextNodeRetry);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].NextNodeFail);
|
|
|
|
}
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.uiNodeCnt", FlowNodeCountVm.Value);
|
|
|
|
|
|
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine", CameraProgramsVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine", ChucksVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine", GripperVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine", PermissibleBeamParamDeviationsVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine", DiameterVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine", ThicknessVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine", TimeIntervallBeamCheckVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHotplate.rRestingTime", RestingTimeHotplateVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHotplate.rTemp", TargetTemperatureHotplateVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeCoolplate.rRestingTime", RestingTimeCoolplateVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeCoolplate.rTemp", TargetTemperatureCoolplateVm.Value);
|
|
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stRecipeEtcher.uiNumRobotPos", NumberRobotPositionsVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stRecipeEtcher.rRadialPosLowerWaterJet", RadialPosLowerWaterJetVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stRecipeEtcher.rChuckRPM", ChuckRpmVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestVoltage", HvtestVoltageVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rMaxTestCurrent", HvmaxTestCurrentVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rRampTime", HvrampTimeVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestFrequency", HvtestFrequencyVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.uiPolarity", HvpolarityVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestPresN2", HvtestPressureN2Vm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rN2PrePurgeTime", Hvn2PrePurgeTimeVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.uiNumRetries", HvnumRetriesVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestTemp", HvtestTemperatureVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestOkVoltage", HvTestOkVoltageVm.Value);
|
|
_adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestOkCurrent", HvTestOkCurrentVm.Value);
|
|
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
|
|
}
|
|
} |