568 lines
21 KiB
C#
568 lines
21 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using HMIToolkit;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Heisig.HMI.AdsManager;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using TwinCAT.TypeSystem;
|
|
using System.Collections.ObjectModel;
|
|
using System.Security.Policy;
|
|
using UniperHMI.Model;
|
|
using System.Printing;
|
|
|
|
namespace UniperHMI
|
|
{
|
|
public sealed partial class KukaRobotPageVM : ObservableValidator, IDisposable
|
|
{
|
|
|
|
private readonly string? _variableName = "_adsVariable_";
|
|
|
|
private const string sStartRobotJob = "_adsVariable_kukaStartRobotJob";
|
|
private const string sAbortRobotJob = "_adsVariable_kukaAbortRobotJob";
|
|
private const string sResetState = "_adsVariable_kukaResetState";
|
|
private const string sClearState = "_adsVariable_kukaClearState";
|
|
private const string sAcknPLCJob = "_adsVariable_kukaAcknPLCJob";
|
|
private const string sCoolplateIndex = "_adsVariable_kukaCoolplateIndex";
|
|
private const string sHotplateIndex = "_adsVariable_kukaHotPlateIndex";
|
|
private const string sPieceThickness = "_adsVariable_kukaPieceThickness";
|
|
private const string sJobGrippSide = "_adsVariable_kukaJobGrippSide";
|
|
private const string sJobGrippType = "_adsVariable_kukaJobGrippType";
|
|
private const string sChuckMagazinPlace = "_adsVariable_kukaChuckMagazinPlace";
|
|
private const string sSelectedRobotJob = "_adsVariable_kukaRobotJob";
|
|
private const string sActiveRobotJob = "_adsVariable_kukaActiveRobotJob";
|
|
private const string sFinishedRobotJob = "_adsVariable_kukaFinishedRobotJob";
|
|
private const string sSelectedPLCJob = "_adsVariable_kukaPLCJob";
|
|
private const string sOffsetPick_X = "_adsVariable_kukaOffsetPick_X";
|
|
private const string sOffsetPick_Y = "_adsVariable_kukaOffsetPick_Y";
|
|
private const string sOffsetPlace_X = "_adsVariable_kukaOffsetPlace_X";
|
|
private const string sOffsetPlace_Y = "_adsVariable_kukaOffsetPlace_Y";
|
|
private const string sOffsetNIOPick_X = "_adsVariable_kukaOffsetNIOPick_X";
|
|
private const string sOffsetNIOPick_Y = "_adsVariable_kukaOffsetNIOPick_Y";
|
|
private const string sOffsetNIOPlace_X = "_adsVariable_kukaOffsetNIOPlace_X";
|
|
private const string sOffsetNIOPlace_Y = "_adsVariable_kukaOffsetNIOPlace_Y";
|
|
|
|
|
|
private BMSControlModeEntry currentControlMode;
|
|
public BMSControlModeEntry CurrentControlMode
|
|
{
|
|
get { return currentControlMode; }
|
|
set
|
|
{
|
|
currentControlMode = value;
|
|
ccmChanged();
|
|
}
|
|
}
|
|
private E_BMS_CONTROL_MODE bmsControlMode;
|
|
|
|
[ObservableProperty]
|
|
private bool canChangeRobotJob;
|
|
|
|
[ObservableProperty]
|
|
private RobotJobentry robotJobActiveValue;
|
|
|
|
[ObservableProperty]
|
|
private RobotJobentry robotJobFinishedValue;
|
|
|
|
[ObservableProperty]
|
|
private bool canStartRobotJob;
|
|
|
|
[ObservableProperty]
|
|
private HMIControlButtonVM? startButton;
|
|
|
|
[ObservableProperty]
|
|
private bool canAbortRobotJob;
|
|
|
|
[ObservableProperty]
|
|
private HMIControlButtonVM? abortButton;
|
|
|
|
|
|
private int jobGrippSide;
|
|
public int JobGrippSide
|
|
{
|
|
get { return jobGrippSide; }
|
|
set
|
|
{
|
|
jobGrippSide = value;
|
|
_adsManager?.WriteValue(sJobGrippSide, value);
|
|
}
|
|
}
|
|
|
|
[ObservableProperty]
|
|
private bool canChangeJobGrippSide;
|
|
|
|
|
|
private int jobGrippType;
|
|
public int JobGrippType
|
|
{
|
|
get { return jobGrippType; }
|
|
set
|
|
{
|
|
jobGrippType = value;
|
|
_adsManager?.WriteValue(sJobGrippType, value);
|
|
|
|
}
|
|
}
|
|
|
|
[ObservableProperty]
|
|
private bool canChangeJobGrippType;
|
|
|
|
|
|
private int chuckMagazinPlace;
|
|
public int ChuckMagazinPlace
|
|
{
|
|
get { return chuckMagazinPlace; }
|
|
set
|
|
{
|
|
chuckMagazinPlace = value;
|
|
_adsManager?.WriteValue(sChuckMagazinPlace, value);
|
|
}
|
|
}
|
|
|
|
[ObservableProperty]
|
|
private bool canChangeChuckMagazinPlace;
|
|
|
|
|
|
private double pieceThickness;
|
|
public double PieceThickness
|
|
{
|
|
get { return pieceThickness; }
|
|
set
|
|
{
|
|
pieceThickness = value;
|
|
_adsManager?.WriteValue(sPieceThickness, value);
|
|
}
|
|
}
|
|
|
|
[ObservableProperty]
|
|
private bool canChangePieceThickness;
|
|
|
|
|
|
private double offsetPick_X;
|
|
public double OffsetPick_X
|
|
{
|
|
get { return offsetPick_X; }
|
|
set
|
|
{
|
|
offsetPick_X = value;
|
|
_adsManager?.WriteValue(sOffsetPick_X, value);
|
|
}
|
|
}
|
|
|
|
|
|
private double offsetPick_Y;
|
|
public double OffsetPick_Y
|
|
{
|
|
get { return offsetPick_Y; }
|
|
set
|
|
{
|
|
offsetPick_Y = value;
|
|
_adsManager?.WriteValue(sOffsetPick_Y, value);
|
|
}
|
|
}
|
|
[ObservableProperty]
|
|
private bool canChangeOffsetPick;
|
|
|
|
|
|
private double offsetPlace_X;
|
|
public double OffsetPlace_X
|
|
{
|
|
get { return offsetPlace_X; }
|
|
set
|
|
{
|
|
offsetPlace_X = value;
|
|
_adsManager?.WriteValue(sOffsetPlace_X, value);
|
|
}
|
|
}
|
|
|
|
private double offsetPlace_Y;
|
|
public double OffsetPlace_Y
|
|
{
|
|
get { return offsetPlace_Y; }
|
|
set
|
|
{
|
|
offsetPlace_Y = value;
|
|
_adsManager?.WriteValue(sOffsetPlace_Y, value);
|
|
}
|
|
}
|
|
|
|
|
|
[ObservableProperty]
|
|
private bool canChangeOffsetPlace;
|
|
|
|
|
|
private double offsetNIOPick_X;
|
|
public double OffsetNIOPick_X
|
|
{
|
|
get { return offsetNIOPick_X; }
|
|
set
|
|
{
|
|
offsetNIOPick_X = value;
|
|
_adsManager?.WriteValue(sOffsetNIOPick_X, value);
|
|
}
|
|
}
|
|
|
|
private double offsetNIOPick_Y;
|
|
public double OffsetNIOPick_Y
|
|
{
|
|
get { return offsetNIOPick_Y; }
|
|
set
|
|
{
|
|
offsetNIOPick_Y = value;
|
|
_adsManager?.WriteValue(sOffsetNIOPick_Y, value);
|
|
}
|
|
}
|
|
[ObservableProperty]
|
|
private bool canChangeOffsetNIOPick;
|
|
|
|
|
|
private double offsetNIOPlace_X;
|
|
public double OffsetNIOPlace_X
|
|
{
|
|
get { return offsetNIOPlace_X; }
|
|
set
|
|
{
|
|
offsetNIOPlace_X = value;
|
|
_adsManager?.WriteValue(sOffsetNIOPlace_X, value);
|
|
}
|
|
}
|
|
|
|
private double offsetNIOPlace_Y;
|
|
public double OffsetNIOPlace_Y
|
|
{
|
|
get { return offsetNIOPlace_Y; }
|
|
set
|
|
{
|
|
offsetNIOPlace_Y = value;
|
|
_adsManager?.WriteValue(sOffsetNIOPlace_Y, value);
|
|
}
|
|
}
|
|
[ObservableProperty]
|
|
private bool canChangeOffsetNIOPlace;
|
|
|
|
|
|
private int hotplateIndex;
|
|
public int HotplateIndex
|
|
{
|
|
get { return hotplateIndex; }
|
|
set
|
|
{
|
|
hotplateIndex = value;
|
|
_adsManager?.WriteValue(sHotplateIndex, value);
|
|
}
|
|
|
|
|
|
}
|
|
[ObservableProperty]
|
|
private bool canChangeHotPlateIndex;
|
|
|
|
|
|
private int coolplateIndex;
|
|
public int CoolplateIndex
|
|
{
|
|
get { return coolplateIndex; }
|
|
set
|
|
{
|
|
coolplateIndex = value;
|
|
_adsManager?.WriteValue(sCoolplateIndex, value);
|
|
}
|
|
}
|
|
|
|
|
|
[ObservableProperty]
|
|
private bool canChangeCoolPlateIndex;
|
|
|
|
[ObservableProperty]
|
|
private RobotJobenum robotJob;
|
|
|
|
[ObservableProperty]
|
|
private ObservableCollection<RobotJobentry> robotJobs =
|
|
[
|
|
new RobotJobentry(RobotJobenum.NONE, " ------- "),
|
|
new RobotJobentry(RobotJobenum.PICK_TRAYFEEDER, "10 - Hole Teil von Trayfeeder 'Eingabe' "),
|
|
new RobotJobentry(RobotJobenum.PLACE_TRAYFEEDER, "11 - Lege Teil in Trayfeeder 'Ausgabe' "),
|
|
new RobotJobentry(RobotJobenum.PUT_ALIGNMENT, "15 - Lege Teil auf Ausrichtstation"),
|
|
new RobotJobentry(RobotJobenum.PICK_ALIGNMENT, "16 - Hole Teil von Ausrichtstation"),
|
|
new RobotJobentry(RobotJobenum.PUT_ETCHER_1, "20 - Lege Teil in Ätzer 1"),
|
|
new RobotJobentry(RobotJobenum.PUT_ETCHER_2, "21 - Lege Teil in Ätzer 2"),
|
|
new RobotJobentry(RobotJobenum.PICK_ETCHER_1, "22 - Hole Teil aus Ätzer 1"),
|
|
new RobotJobentry(RobotJobenum.PICK_ETCHER_2, "23 - Hole Teil aus Ätzer 2"),
|
|
new RobotJobentry(RobotJobenum.SWITCH_ETCHER_1, "24 - Tausche Teile in Ätzer 1"),
|
|
new RobotJobentry(RobotJobenum.SWITCH_ETCHER_2, "25 - Tausche Teile in Ätzer 2"),
|
|
new RobotJobentry(RobotJobenum.PUT_HVTEST_HOT, "30 - Lege Teil in HV-Teststation Warm"),
|
|
new RobotJobentry(RobotJobenum.PUT_HVTEST_COLD, "31 - Lege Teil in HV-Teststation Kalt"),
|
|
new RobotJobentry(RobotJobenum.PICK_HVTEST_HOT, "32 - Hole Teil aus HV-Teststation Warm"),
|
|
new RobotJobentry(RobotJobenum.PICK_HVTEST_COLD, "33 - Hole Teil aus HV-Teststation Kalt"),
|
|
new RobotJobentry(RobotJobenum.PUT_HOTPLATE, "40 - Lege Teil auf Heizplatte"),
|
|
new RobotJobentry(RobotJobenum.PICK_HOTPLATE, "41 - Hole Teil von Heizplatte"),
|
|
new RobotJobentry(RobotJobenum.PUT_COOLPLATE, "42 - Lege Teil auf Kühlplatte"),
|
|
new RobotJobentry(RobotJobenum.PICK_COOLPLATE, "43 - Hole Teil von Kühlplatte"),
|
|
new RobotJobentry(RobotJobenum.PICK_GRIPPER, "50 - Hole anderen Greifertyp"),
|
|
new RobotJobentry(RobotJobenum.PICK_CHUCK_ETCHER_1, "60 - Hole Drehteller aus Ätzer 1"),
|
|
new RobotJobentry(RobotJobenum.PICK_CHUCK_ETCHER_2, "61 - Hole Drehteller aus Ätzer 2"),
|
|
new RobotJobentry(RobotJobenum.PUT_CHUCK_ETCHER_1, "62 - Lege Drehteller in Ätzer 1"),
|
|
new RobotJobentry(RobotJobenum.PUT_CHUCK_ETCHER_2, "63 - Lege Drehteller in Ätzer 2"),
|
|
new RobotJobentry(RobotJobenum.PUT_CHUCK_MAGAZIN, "64 - Lege Drehteller in Magazin"),
|
|
new RobotJobentry(RobotJobenum.PICK_CHUCK_MAGAZIN, "65 - Hole Drehteller von Magazin"),
|
|
new RobotJobentry(RobotJobenum.PUT_NIO_STATION, "70 - Lege Teil auf NIO-TRAY"),
|
|
new RobotJobentry(RobotJobenum.PICK_NIO_STATION, "71 - Hole Teil von NIO-TRAY"),
|
|
new RobotJobentry(RobotJobenum.WARMUP, "80 - Aufwärmprogramm")
|
|
];
|
|
|
|
[ObservableProperty]
|
|
private ObservableCollection<PLCJobentry> pLCJobs =
|
|
[
|
|
new PLCJobentry(PLCJobenum.NONE, " ------- "),
|
|
new PLCJobentry(PLCJobenum.SCAN_QR_CODE, "10 - QR Code Scannen"),
|
|
new PLCJobentry(PLCJobenum.VACUUM_ON_ALIGNER, "15 - Vakuum Ausrichtstation einschalten"),
|
|
new PLCJobentry(PLCJobenum.VACUUM_OFF_ALIGNER, "16 - Vakuum Ausrichtstation ausschalten"),
|
|
new PLCJobentry(PLCJobenum.VACUUM_ON_ETCHER_1, "20 - Vakuum Ätzer 1 einschalten"),
|
|
new PLCJobentry(PLCJobenum.VACUUM_ON_ETCHER_2, "21 - Vakuum Ätzer 2 einschalten"),
|
|
new PLCJobentry(PLCJobenum.VACUUM_OFF_ETCHER_1, "22 - Vakuum Ätzer 1 ausschalten"),
|
|
new PLCJobentry(PLCJobenum.VACUUM_OFF_ETCHER_2, "23 - Vakuum Ätzer 2 ausschalten"),
|
|
new PLCJobentry(PLCJobenum.CHUCK_OPEN_ETCHER_1, "60 - Drehteller Ätzer 1 entriegeln"),
|
|
new PLCJobentry(PLCJobenum.CHUCK_OPEN_ETCHER_2, "61 - Drehteller Ätzer 2 entriegeln"),
|
|
new PLCJobentry(PLCJobenum.CHUCK_CLOSE_ETCHER_1, "62 - Drehteller Ätzer 1 verriegeln"),
|
|
new PLCJobentry(PLCJobenum.CHUCK_CLOSE_ETCHER_2, "63 - Drehteller Ätzer 2 verriegeln"),
|
|
];
|
|
|
|
private RobotJobentry selectedRobotJob;
|
|
public RobotJobentry SelectedRobotJob
|
|
{
|
|
get { return selectedRobotJob; }
|
|
set
|
|
{
|
|
selectedRobotJob = value;
|
|
CanChangeChuckMagazinPlace = (value == RobotJobs.First(i => i.eJob == RobotJobenum.PICK_CHUCK_MAGAZIN))
|
|
|| (value == RobotJobs.First(i => i.eJob == RobotJobenum.PUT_CHUCK_MAGAZIN));
|
|
CanChangeJobGrippType = value == RobotJobs.First(i => i.eJob == RobotJobenum.PICK_GRIPPER);
|
|
|
|
_adsManager?.WriteValue(sSelectedRobotJob, SelectedRobotJob.eJob);
|
|
}
|
|
}
|
|
|
|
[ObservableProperty]
|
|
private PLCJobentry selectedPLCJob;
|
|
|
|
|
|
private readonly IAdsManager? _adsManager;
|
|
|
|
public KukaRobotPageVM()
|
|
{
|
|
StartButton = new HMIControlButtonVM();
|
|
AbortButton = new HMIControlButtonVM();
|
|
selectedRobotJob = RobotJobs.First(i => i.eJob == RobotJobenum.WARMUP);
|
|
robotJobActiveValue = RobotJobs.First(i => i.eJob == RobotJobenum.PUT_HVTEST_COLD);
|
|
robotJobFinishedValue = RobotJobs.First(i => i.eJob == RobotJobenum.PICK_HOTPLATE);
|
|
|
|
canChangeRobotJob = true;
|
|
selectedPLCJob = PLCJobs.First(i => i.eJob == PLCJobenum.NONE);
|
|
currentControlMode = new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual");
|
|
|
|
}
|
|
|
|
public KukaRobotPageVM(IAdsManager adsManager, string variableName)
|
|
{
|
|
_adsManager = adsManager;
|
|
_variableName = variableName;
|
|
|
|
StartButton = new HMIControlButtonVM(_adsManager, sStartRobotJob);
|
|
AbortButton = new HMIControlButtonVM(_adsManager, sAbortRobotJob);
|
|
currentControlMode = new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual");
|
|
CurrentControlMode = new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual");
|
|
|
|
_adsManager.Register(sJobGrippSide, OnJobGrippSideValueChanged);
|
|
_adsManager.Register(sJobGrippType, OnJobGrippTypeValueChanged);
|
|
_adsManager.Register(sChuckMagazinPlace, OnChuckMagazinPlaceValueChanged);
|
|
_adsManager.Register(sPieceThickness, OnPieceThicknessValueChanged);
|
|
_adsManager.Register(sSelectedPLCJob, OnSelectedPLCJobValueChanged);
|
|
_adsManager.Register(sSelectedRobotJob, OnSelectedRobotJobValueChanged);
|
|
_adsManager.Register(sActiveRobotJob, OnActiveRobotJobValueChanged);
|
|
_adsManager.Register(sFinishedRobotJob, OnFinishedRobotJobValueChanged);
|
|
_adsManager.Register(sOffsetPick_X, OnOffsetPickYValueChanged);
|
|
_adsManager.Register(sOffsetPick_Y, OnOffsetPickXValueChanged);
|
|
_adsManager.Register(sCoolplateIndex, OnCoolPlateIndexValueChanged);
|
|
_adsManager.Register(sHotplateIndex, OnHotPlateIndexValueChanged);
|
|
_adsManager.Register(sOffsetNIOPlace_Y, OnOffsetNIOPlaceYValueChanged);
|
|
_adsManager.Register(sOffsetNIOPlace_X, OnOffsetNIOPlaceXValueChanged);
|
|
_adsManager.Register(sOffsetNIOPick_Y, OnOffsetNIOPickYValueChanged);
|
|
_adsManager.Register(sOffsetNIOPick_X, OnOffsetNIOPickXValueChanged);
|
|
_adsManager.Register(sOffsetPlace_Y, OnOffsetPlaceYValueChanged);
|
|
_adsManager.Register(sOffsetPlace_X, OnOffsetNIOPlaceXValueChanged);
|
|
|
|
canChangeRobotJob = true;
|
|
canChangeJobGrippType = false;
|
|
|
|
canChangeChuckMagazinPlace = false;
|
|
canChangeJobGrippType = false;
|
|
|
|
_adsManager.Register("GVL_SCADA.eCurrentControlMode", CurrentControlModeChanged);
|
|
|
|
}
|
|
|
|
private void OnJobGrippSideValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
jobGrippSide = (int)e.Value;
|
|
}
|
|
private void OnJobGrippTypeValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
jobGrippType = (int)e.Value;
|
|
}
|
|
private void OnChuckMagazinPlaceValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
chuckMagazinPlace = (int)e.Value;
|
|
}
|
|
private void OnPieceThicknessValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
pieceThickness = (int)e.Value;
|
|
}
|
|
private void OnSelectedPLCJobValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
selectedPLCJob = PLCJobs.First(i => (int)i.eJob == (int)e.Value);
|
|
}
|
|
private void OnSelectedRobotJobValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
selectedRobotJob = RobotJobs.First(i => (int)i.eJob == (int)e.Value);
|
|
}
|
|
private void OnActiveRobotJobValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
robotJobActiveValue = RobotJobs.First(i => (int)i.eJob == (int)e.Value);
|
|
}
|
|
private void OnFinishedRobotJobValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
robotJobFinishedValue = RobotJobs.First(i => (int)i.eJob == (int)e.Value);
|
|
}
|
|
private void OnHotPlateIndexValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
hotplateIndex = (int)e.Value;
|
|
}
|
|
private void OnCoolPlateIndexValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
coolplateIndex = (int)e.Value;
|
|
}
|
|
private void OnOffsetPickXValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
offsetPick_X = (double)e.Value;
|
|
}
|
|
private void OnOffsetPickYValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
offsetPick_Y = (double)e.Value;
|
|
}
|
|
private void OnOffsetPlaceXValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
offsetPlace_X = (double)e.Value;
|
|
}
|
|
private void OnOffsetPlaceYValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
offsetPlace_X = (double)e.Value;
|
|
}
|
|
private void OnOffsetNIOPickXValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
offsetNIOPick_X = (double)e.Value;
|
|
}
|
|
private void OnOffsetNIOPickYValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
offsetNIOPick_Y = (double)e.Value;
|
|
}
|
|
private void OnOffsetNIOPlaceXValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
offsetNIOPlace_X = (double)e.Value;
|
|
}
|
|
private void OnOffsetNIOPlaceYValueChanged(object sender, ValueChangedEventArgs e)
|
|
{
|
|
OffsetNIOPlace_Y = (double)e.Value;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
StartButton?.Dispose();
|
|
StartButton = null;
|
|
AbortButton?.Dispose();
|
|
AbortButton = null;
|
|
|
|
_adsManager?.Deregister(sJobGrippSide, OnJobGrippSideValueChanged);
|
|
_adsManager?.Deregister(sJobGrippType, OnJobGrippTypeValueChanged);
|
|
_adsManager?.Deregister(sChuckMagazinPlace, OnChuckMagazinPlaceValueChanged);
|
|
_adsManager?.Deregister(sPieceThickness, OnPieceThicknessValueChanged);
|
|
_adsManager?.Deregister(sSelectedPLCJob, OnSelectedPLCJobValueChanged);
|
|
_adsManager?.Deregister(sSelectedRobotJob, OnSelectedRobotJobValueChanged);
|
|
_adsManager?.Deregister(sActiveRobotJob, OnActiveRobotJobValueChanged);
|
|
_adsManager?.Deregister(sFinishedRobotJob, OnFinishedRobotJobValueChanged);
|
|
_adsManager?.Deregister(sOffsetPick_X, OnOffsetPickYValueChanged);
|
|
_adsManager?.Deregister(sOffsetPick_Y, OnOffsetPickXValueChanged);
|
|
_adsManager?.Deregister(sCoolplateIndex, OnCoolPlateIndexValueChanged);
|
|
_adsManager?.Deregister(sHotplateIndex, OnHotPlateIndexValueChanged);
|
|
_adsManager?.Deregister(sOffsetNIOPlace_Y, OnOffsetNIOPlaceYValueChanged);
|
|
_adsManager?.Deregister(sOffsetNIOPlace_X, OnOffsetNIOPlaceXValueChanged);
|
|
_adsManager?.Deregister(sOffsetNIOPick_Y, OnOffsetNIOPickYValueChanged);
|
|
_adsManager?.Deregister(sOffsetNIOPick_X, OnOffsetNIOPickXValueChanged);
|
|
_adsManager?.Deregister(sOffsetPlace_Y, OnOffsetPlaceYValueChanged);
|
|
_adsManager?.Deregister(sOffsetPlace_X, OnOffsetNIOPlaceXValueChanged);
|
|
|
|
_adsManager?.Deregister("GVL_SCADA.eCurrentControlMode", CurrentControlModeChanged);
|
|
|
|
}
|
|
|
|
private void CurrentControlModeChanged(object? sender, ValueChangedEventArgs e)
|
|
{
|
|
bmsControlMode = (E_BMS_CONTROL_MODE)e.Value;
|
|
currentControlMode.eMode = bmsControlMode;
|
|
currentControlMode.Name = "Test";
|
|
ccmChanged();
|
|
|
|
}
|
|
|
|
private void ccmChanged()
|
|
{
|
|
if (currentControlMode.eMode == E_BMS_CONTROL_MODE.MANUAL)
|
|
{
|
|
CanChangeCoolPlateIndex = true;
|
|
CanChangeHotPlateIndex = true;
|
|
CanChangeOffsetNIOPick = true;
|
|
CanChangeOffsetNIOPlace = true;
|
|
CanChangeOffsetPick = true;
|
|
CanChangeOffsetPlace = true;
|
|
CanChangePieceThickness = true;
|
|
CanChangeRobotJob = true;
|
|
CanChangeJobGrippSide = true;
|
|
|
|
}
|
|
else
|
|
{
|
|
CanChangeCoolPlateIndex = false;
|
|
CanChangeHotPlateIndex = false;
|
|
CanChangeOffsetNIOPick = false;
|
|
CanChangeOffsetNIOPlace = false;
|
|
CanChangeOffsetPick = false;
|
|
CanChangeOffsetPlace = false;
|
|
CanChangePieceThickness = false;
|
|
CanChangeRobotJob = false;
|
|
CanChangeJobGrippSide = false;
|
|
}
|
|
}
|
|
|
|
[RelayCommand]
|
|
private void ClearState()
|
|
{
|
|
_adsManager?.WriteValue(sClearState, true);
|
|
}
|
|
|
|
[RelayCommand]
|
|
private void ResetState()
|
|
{
|
|
_adsManager?.WriteValue(sResetState, true);
|
|
}
|
|
|
|
[RelayCommand]
|
|
private void StartRobotJob()
|
|
{
|
|
_adsManager?.WriteValue(sStartRobotJob, true);
|
|
}
|
|
|
|
|
|
[RelayCommand]
|
|
private void AbortRobotJob()
|
|
{
|
|
_adsManager?.WriteValue(sAbortRobotJob, true);
|
|
}
|
|
}
|
|
}
|