123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477 |
- using System.Collections.Generic;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- using Aitex.Core.Common;
- using Aitex.Core.UI.MVVM;
- using Aitex.Core.UI.View.Common;
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using Aitex.Sorter.UI.Controls;
- using Aitex.Sorter.UI.Controls.Common;
- using Aitex.Sorter.UI.ViewModel.Maintenance;
- using EfemUI.Controls;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.OperationCenter;
- namespace EfemUI.Views.Maintenance
- {
- /// <summary>
- /// RobotView.xaml 的交互逻辑
- /// </summary>
- public partial class RobotView : UserControl, IBaseView
- {
- private RobotViewModel robotViewModel;
- public RobotView()
- {
- InitializeComponent();
- robotViewModel = new RobotViewModel2();
- //efem.SubscribeKeys(robotViewModel);
- //robotControl.Hands = new Hand[] { Hand.Blade1, Hand.Blade2 };
- //robotControl.SubscribeKeys(robotViewModel);
- DataContext = robotViewModel;
- IsVisibleChanged += Robot_IsVisibleChanged;
- }
- private void Robot_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
- {
- robotViewModel.EnableTimer(IsVisible);
- }
- }
- public class RobotViewModel2 : RobotViewModel
- {
- public bool EnablePageControl
- {
- get { return !IsOnlineMode; }
- }
- [Subscription("System.Robot.ReadCassetNumber")]
- public string ReadCassetNumber { get; set; }
- [Subscription("System.Robot.ReadSlotNumber")]
- public string ReadSlotNumber { get; set; }
- [Subscription("System.Robot.ReadBankNumber")]
- public string ReadBankNumber { get; set; }
- [Subscription("System.Robot.MappingFirstSlotPosition")]
- public string MappingFirstSlotPosition { get; set; }
- [Subscription("System.Robot.MappingGateWidth")]
- public string MappingGateWidth { get; set; }
- [Subscription("System.Robot.MappingMaxDetectWidth")]
- public string MappingMaxDetectWidth { get; set; }
- [Subscription("System.Robot.MappingMinDetectWidth")]
- public string MappingMinDetectWidth { get; set; }
- [Subscription("System.Robot.MappingSlotsNumber")]
- public string MappingSlotsNumber { get; set; }
- [Subscription("System.Robot.MappingSpeed")]
- public string MappingSpeed { get; set; }
- [Subscription("System.Robot.MappingStopPostion")]
- public string MappingStopPostion { get; set; }
- [Subscription("System.Robot.MappingTopSlotPostion")]
- public string MappingTopSlotPostion { get; set; }
- [Subscription("System.Robot.IsMappingSensorON")]
- public string IsMappingSensorON { get; set; }
- [Subscription("System.Robot.MappingWaferResult")]
- public string MappingWaferResult { get; set; }
- [Subscription("System.Robot.MappingWidthResult")]
- public string MappingWidthResult { get; set; }
- [Subscription("System.Robot.ReadParameterMax")]
- public string ReadParameterMax { get; set; }
- [Subscription("System.Robot.ReadParameterMin")]
- public string ReadParameterMin { get; set; }
- [Subscription("System.Robot.ReadParameterValue")]
- public string ReadParameterValue { get; set; }
- [Subscription("System.Robot.CurrentReadRoutine")]
- public string CurrentReadRoutine { get; set; }
- //[Subscription("System.Robot.CurrentReadSpeedData")]
- //public int CurrentReadSpeedData { get; set; }
- [Subscription("System.Robot.RobotSpeed")]
- public int CurrentReadSpeedData { get; set; }
- [Subscription("System.Robot.CurrentReadAData")]
- public int CurrentReadAData { get; set; }
- [Subscription("System.Robot.Axis1Postion")]
- public string RobotPositionX
- {
- get;set;
- }
- [Subscription("System.Robot.Axis2Postion")]
- public string RobotPositionY
- {
- get; set;
- }
- [Subscription("System.Robot.Axis3Postion")]
- public string RobotPositionZ
- {
- get; set;
- }
- [Subscription("System.Robot.Axis4Postion")]
- public string RobotPositionW
- {
- get; set;
- }
- [Subscription("System.Robot.LeftarmAndZaxisStatus")]
- public string LeftarmAndZaxisStatus
- {
- get; set;
- }
- [Subscription("System.Robot.RightarmAndThetaarmStatus")]
- public string RightarmAndThetaarmStatus
- {
- get; set;
- }
- [Subscription("System.Robot.IsLeftArmPressureSensorON")]
- public bool IsLeftArmPressureSensorON
- {
- get; set;
- }
- [Subscription("System.Robot.IsRightArmPressureSensorON")]
- public bool IsRightArmPressureSensorON
- {
- get; set;
- }
- [Subscription("System.Robot.CurrentCompoundCommandStatus")]
- public string CurrentCompoundCommandStatus { get; set; }
- [Subscription("System.Robot.CurrentExtParaValue")]
- public string ExtendedParaValue
- {
- get;set;
- }
- [Subscription("System.Robot.State")]
- public string RobotState
- {
- get; set;
- }
- [Subscription("System.Robot.RobotErrorCode")]
- public string RobotErrorCode
- {
- get; set;
- }
- [Subscription("System.Robot.RobotIsOnline")]
- public string RobotIsOnline
- {
- get; set;
- }
- [Subscription("System.Robot.RobotIsManual")]
- public string RobotIsManual
- {
- get; set;
- }
- [Subscription("System.Robot.RobotIsAuto")]
- public string RobotIsAuto
- {
- get; set;
- }
- [Subscription("System.Robot.RobotStopSignal")]
- public string RobotStopSignal
- {
- get; set;
- }
- [Subscription("System.Robot.RobotEMSignal")]
- public string RobotEMSignal
- {
- get; set;
- }
- [Subscription("System.Robot.RobotZaxisSaftyZone")]
- public string RobotZaxisSaftyZone
- {
- get; set;
- }
- [Subscription("System.Robot.RobotPositioningCompleted")]
- public string RobotPositioningCompleted
- {
- get; set;
- }
- [Subscription("System.Robot.RobotACalCompleted")]
- public string RobotACalCompleted
- {
- get; set;
- }
- [Subscription("System.Robot.RobotExecutionCompleted")]
- public string RobotExecutionCompleted
- {
- get; set;
- }
- [Subscription("System.Robot.ReadPosLeftArmPostion")]
- public string RobotReadXPosition
- {
- get;set;
- }
- [Subscription("System.Robot.ReadPosRightArmPostion")]
- public string RobotReadYPosition
- {
- get; set;
- }
- [Subscription("System.Robot.ReadPosZAxisPostion")]
- public string RobotReadZPosition
- {
- get; set;
- }
- [Subscription("System.Robot.ReadPosThetaAxisPostion")]
- public string RobotReadWPosition
- {
- get; set;
- }
- [Subscription("System.Robot.RobotMdata")]
- public string RobotMdata
- {
- get; set;
- }
- [Subscription("System.Robot.RobotFCode")]
- public string RobotFCode
- {
- get; set;
- }
- [Subscription("System.Robot.RobotSCode")]
- public string RobotSCode
- {
- get; set;
- }
- [Subscription("System.Robot.ExtPara_MapWaferCount")]
- public string ExtPara_MapWaferCount
- {
- get; set;
- }
- [Subscription("System.Robot.ExtPara_WaferThickness")]
- public string ExtPara_WaferThickness
- {
- get; set;
- }
- [Subscription("System.Robot.ExtPara_PositionRange")]
- public string ExtPara_PositionRange
- {
- get; set;
- }
- [Subscription("System.Robot.ExtPara_Pitch")]
- public string ExtPara_Pitch
- {
- get; set;
- }
- [Subscription("System.Robot.ExtPara_Filter")]
- public string ExtPara_Filter
- {
- get; set;
- }
- [Subscription("System.Robot.ExtPara_WaferMinThickness")]
- public string ExtPara_MinThickness
- {
- get; set;
- }
- [Subscription("System.IsOnlineMode")]
- public bool IsOnlineMode
- {
- get;
- set;
- }
- [Subscription(ParamName.ModuleWaferList, DeviceName.Buffer1)]
- public WaferInfo[] Buffer1Wafers
- {
- get;
- set;
- }
- public WaferInfo Buffer1Wafer
- {
- get
- {
- if (Buffer1Wafers != null)
- {
- return Buffer1Wafers[0];
- }
- else
- {
- return null;
- }
- }
- }
- [Subscription(ParamName.IsAutoMode, "System")]
- public bool IsAutoMode { get; set; }
- [Subscription(ParamName.RTStatus, "System")]
- public int RoutManagerState
- {
- get;
- set;
- }
- public bool IsMaintenanceMode
- {
- get => RoutManagerState == (int)RtState.Maintenance;
- }
- public ICommand Command
- {
- get;
- private set;
- }
- public RobotViewModel2() : base(4)
- {
-
- Command = new DelegateCommand<DependencyObject>(DoCommand, x => !IsMaintenanceMode && !IsAutoMode);
-
- RobotMotionType = new List<string>() { "A", "I", "U", "O" };
- RobotTargetStation = new List<string>() { "LP1", "LP2","Buffer1", "Buffer2", "LL1", "LL2" ,"CoolingBuffer1", "CoolingBuffer2" ,"Aligner1", "Aligner2" };
- RobotActionType = new List<string>() { "Pick", "Place", "Swap" };
- RobotArmSelected = new List<string>() { "Lower(Left)", "Upper(Right)"};
- RobotSpeedType = new List<string>() { "H(High speed)","L(Low speed)","S(Domain of Acc/Dec)","G(Acc/Dec speed",
- "X(Magnification frequency)","D(Pulse position of manual slow down)" };
- RobotSelectSlot = new List<string>();
- for (int i = 0; i < 25; i++) RobotSelectSlot.Add((i+1).ToString());
- MappingParameterType = new List<string>() { "M01", "M02", "M03", "M04", "M05", "M06", "M07", "M08", "M09" };
- LoadPortList = new List<string>() { "LP1", "LP2", "LP3", "LP4" };
- JelCompaundCommandType = new List<string> { "MainRoutine", "SubRoutine" };
- JelMoveBaseType = new List<string> { "0(Absolute position)", "1(Relative postion)" };
- JelMoveSpeedType = new List<string> { "(Normal)", "M(Manual slow down)", "L(Low Speed)" };
- }
-
- private void DoCommand(DependencyObject sender)
- {
- var command = CommandHelper.GetCommandItem(sender);
- var lstParameter = new List<object>(command.Parameters);
- if (command.CommandName == "ReadParameter")
- {
- if (lstParameter.Count == 0) return;
- if(lstParameter[0].ToString() == "ExtParameter")
- {
- if (lstParameter.Count < 2) return;
- if (!uint.TryParse(lstParameter[1].ToString(), out _)) return;
- }
-
- }
- if (command.CommandName == "SetParameter")
- {
- if (lstParameter.Count == 0) return;
- if (lstParameter[0].ToString() == "ExtParameter")
- {
- if (lstParameter.Count < 2) return;
- if (!uint.TryParse(lstParameter[1].ToString(), out _)) return;
- }
- }
- if(command.CommandName == "RobotGoTo")
- {
-
- }
- if (command.CommandName == "RobotPlace" || command.CommandName == "RobotPick" || command.CommandName == "RobotExchange")
- {
- if (lstParameter.Count == 0) return;
- if (lstParameter.Count < 3) return;
- lstParameter[1] = int.Parse(lstParameter[1].ToString()) - 1;
- }
- lstParameter.Insert(0, command.Target);
- lstParameter.Insert(1, command.CommandName);
-
- InvokeClient.Instance.Service.DoOperation(OperationName.DeviceOperation, lstParameter.ToArray());
- }
- public List<string> RobotMotionType { get; set; }
- public List<string> RobotTargetStation { get; set; }
- public List<string> RobotActionType { get; set; }
- public List<string> RobotArmSelected { get; set; }
- public List<string> RobotSpeedType { get; set; }
- public List<string> RobotSelectSlot { get; set; }
- public List<string> MappingParameterType { get; set; }
- public List<string> LoadPortList { get; private set; }
- public List<string> JelCompaundCommandType{ get; private set; }
- public List<string> JelMoveBaseType { get; private set; }
- public List<string> JelMoveSpeedType { get; private set; }
- public override Dictionary<ModuleName, int> Target => new Dictionary<ModuleName, int>() {
- { ModuleName.LP1, 25 }
- , { ModuleName.LP2, 25 }
- , { ModuleName.LP3, 25 }
- , { ModuleName.LP4, 25 }
- , { ModuleName.Buffer1, 25 }
- , { ModuleName.Buffer2, 25 }
- , { ModuleName.Buffer3, 25 }
- , { ModuleName.Buffer4, 25 }
- , { ModuleName.LL1, 1 }
- , { ModuleName.LL2, 1 }
- , { ModuleName.LL3, 1 }
- , { ModuleName.LL4, 1 }
- , { ModuleName.LL5, 1 }
- , { ModuleName.LL6, 1 }
- , { ModuleName.LL7, 1 }
- , { ModuleName.LL8, 1 }
- , { ModuleName.Aligner, 1 }
- };
- protected override void InitFoupList()
- {
- base.InitFoupList();
- if (FoupList.Count >= 1) FoupList[0].FoupType = FoupType.OpenCassetteNoReadID;
- if (FoupList.Count >= 2) FoupList[1].FoupType = FoupType.OpenCassetteNoReadID;
- if (FoupList.Count >= 3) FoupList[2].FoupType = FoupType.OpenCassetteNoReadID;
- if (FoupList.Count >= 4) FoupList[3].FoupType = FoupType.OpenCassetteNoReadID;
- }
- }
- }
|