From e887fc7a046c4d1af54137e5effd55748dba2d66 Mon Sep 17 00:00:00 2001 From: "SIC1016\\caipeilun" <905168240@qq.com> Date: Wed, 12 Aug 2026 18:24:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=B7=E5=BA=B7?= =?UTF-8?q?=E7=9B=B8=E5=85=B3device?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/SicRT/Config/System.sccfg | 16 ++++++++++++++++ App/SicRT/Equipments/Systems/DeviceManager.cs | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/App/SicRT/Config/System.sccfg b/App/SicRT/Config/System.sccfg index dbebd54..d18ec2d 100644 --- a/App/SicRT/Config/System.sccfg +++ b/App/SicRT/Config/System.sccfg @@ -2196,6 +2196,22 @@ + + + + + + + + + + + + + + + + diff --git a/App/SicRT/Equipments/Systems/DeviceManager.cs b/App/SicRT/Equipments/Systems/DeviceManager.cs index 78c50db..c5c3970 100644 --- a/App/SicRT/Equipments/Systems/DeviceManager.cs +++ b/App/SicRT/Equipments/Systems/DeviceManager.cs @@ -3,6 +3,7 @@ using Aitex.Core.RT.SCCore; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Breakers.NSXCOM; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.UPS; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Temps; +using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.MachineVision.HikVision; namespace SicRT.Instances { @@ -79,6 +80,19 @@ namespace SicRT.Instances QueueDevice(EATONUPS2); } + //强制构造vm类,是否加载放入构造函数中 + var hikvm = new HikVisionMasterSDK("LoadLock", "HikVisionMaster", "HikVisionMaster", + SC.GetConfigItem("HikVisionMaster.EnableDevice").BoolValue); + hikvm.Initialize(); + QueueDevice(hikvm); + + if (SC.GetConfigItem("HikGigeCamera.EnableDevice").BoolValue) + { + var hikc = new HikGigeCamera("LoadLock", "HikGigeCamera", "HikGigeCamera"); + hikc.Initialize(); + QueueDevice(hikc); + } + //if (SC.GetConfigItem("AKunTemp.EnableDevice").BoolValue) //{ // var AkOptics = new AKunTemp("PM1", "AKunTemp"); From 326d2feaa8d4e1fd510069d9f5f40f04cc2b26e5 Mon Sep 17 00:00:00 2001 From: "SIC1016\\caipeilun" <905168240@qq.com> Date: Thu, 13 Aug 2026 16:14:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B2=A1=E7=94=A8?= =?UTF-8?q?=E7=9A=84IoGasBoxTemp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Modules/SicModules/Config/PM/PM1/DeviceModelPM1.xml | 6 +++--- App/Modules/SicModules/Config/PM/PM2/DeviceModelPM2.xml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/App/Modules/SicModules/Config/PM/PM1/DeviceModelPM1.xml b/App/Modules/SicModules/Config/PM/PM1/DeviceModelPM1.xml index 9cecb52..760ee80 100644 --- a/App/Modules/SicModules/Config/PM/PM1/DeviceModelPM1.xml +++ b/App/Modules/SicModules/Config/PM/PM1/DeviceModelPM1.xml @@ -362,15 +362,15 @@ - + - - + diff --git a/App/Modules/SicModules/Config/PM/PM2/DeviceModelPM2.xml b/App/Modules/SicModules/Config/PM/PM2/DeviceModelPM2.xml index bbd8299..fddb525 100644 --- a/App/Modules/SicModules/Config/PM/PM2/DeviceModelPM2.xml +++ b/App/Modules/SicModules/Config/PM/PM2/DeviceModelPM2.xml @@ -211,15 +211,15 @@ - + - - + From 4f3e308d3d15aa6746348aec5667bd60003dcf7a Mon Sep 17 00:00:00 2001 From: "SIC1016\\caipeilun" <905168240@qq.com> Date: Thu, 13 Aug 2026 22:07:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9B=B8=E6=9C=BA?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/SicRT/Config/Menu.xml | 1 + App/SicUI/Controls/CameraControl.xaml | 31 + App/SicUI/Controls/CameraControl.xaml.cs | 160 ++++ .../Models/Maintenances/TM/Device2View.xaml | 841 ++++++++++++++++++ .../Maintenances/TM/Device2View.xaml.cs | 29 + .../Maintenances/TM/Device2ViewModel.cs | 216 +++++ App/SicUI/SicUI.csproj | 87 ++ 7 files changed, 1365 insertions(+) create mode 100644 App/SicUI/Controls/CameraControl.xaml create mode 100644 App/SicUI/Controls/CameraControl.xaml.cs create mode 100644 App/SicUI/Models/Maintenances/TM/Device2View.xaml create mode 100644 App/SicUI/Models/Maintenances/TM/Device2View.xaml.cs create mode 100644 App/SicUI/Models/Maintenances/TM/Device2ViewModel.cs diff --git a/App/SicRT/Config/Menu.xml b/App/SicRT/Config/Menu.xml index a53e586..a145464 100644 --- a/App/SicRT/Config/Menu.xml +++ b/App/SicRT/Config/Menu.xml @@ -11,6 +11,7 @@ + diff --git a/App/SicUI/Controls/CameraControl.xaml b/App/SicUI/Controls/CameraControl.xaml new file mode 100644 index 0000000..b9e17d9 --- /dev/null +++ b/App/SicUI/Controls/CameraControl.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/SicUI/Models/Maintenances/TM/Device2View.xaml.cs b/App/SicUI/Models/Maintenances/TM/Device2View.xaml.cs new file mode 100644 index 0000000..a384180 --- /dev/null +++ b/App/SicUI/Models/Maintenances/TM/Device2View.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using VMControls.Interface; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace SicUI.Client.Models.Platform.TM +{ + /// + /// DeviceView.xaml 的交互逻辑 + /// + public partial class Device2View : UserControl + { + public Device2View() + { + InitializeComponent(); + } + } +} diff --git a/App/SicUI/Models/Maintenances/TM/Device2ViewModel.cs b/App/SicUI/Models/Maintenances/TM/Device2ViewModel.cs new file mode 100644 index 0000000..7c7eac2 --- /dev/null +++ b/App/SicUI/Models/Maintenances/TM/Device2ViewModel.cs @@ -0,0 +1,216 @@ +using SicUI.Models; +using System; +using System.Collections.Generic; +using Aitex.Core.Common.DeviceData; +using System.IO; +using System.Drawing; +using Aitex.Core.Util; +using VM.PlatformSDKCS; + +namespace SicUI.Client.Models.Platform.TM +{ + public class Device2ViewModel : SicUIViewModelBase + { + [Subscription("Load.Rotation.IsServoBusy")] + public bool LdRotationIsBusy { get; set; } + + [Subscription("Load.Rotation.IsServoOn")] + public bool LdRotationIsServoOn { get; set; } + + [Subscription("Load.Rotation.IsMoveDone")] + public bool LdRotationIsServoDone { get; set; } + + [Subscription("Load.Rotation.IsServoError")] + public bool LdRotationIsServoError { get; set; } + + [Subscription("TM.LLTrayPresence.DeviceData")] + public AITSensorData LoadTrayPresence { get; set; } + + [Subscription("TM.LoadTrayHomeSensor.DeviceData")] + public AITSensorData LoadTrayHomeSensor { get; set; } + + [Subscription("TM.LLWaferPlaced.DeviceData")] + public AITSensorData LoadWaferPlaced { get; set; } + + [Subscription("Load.Rotation.CurPos")] + public double LdRotationCurPos { get; set; } + + [Subscription("Load.Rotation.CCD1Degree")] + public double LdCCD1Degree { get; set; } + + [Subscription("Load.Rotation.CCD2Degree")] + public double LdCCD2Degree { get; set; } + + [Subscription("Load.Rotation.CCD3Degree")] + public double LdCCD3Degree { get; set; } + + [Subscription("LoadLock.IsOnline")] + public bool LoadLockIsOnline { get; set; } + + [Subscription("LoadLock.Status")] + public string LLStatus { get; set; } + + public bool LdRotationBtnEnable => !LdRotationIsBusy && !LdRotationIsServoError && !LoadLockIsOnline && LLStatus == "Idle"; + public Device2ViewModel() + { + + } + + protected override void OnActivate() + { + base.OnActivate(); + } + + protected override void OnDeactivate(bool close) + { + base.OnDeactivate(close); + } + + //protected override void InvokeAfterUpdateProperty(Dictionary data) + //{ + // base.InvokeAfterUpdateProperty(data); + // if (data.ContainsKey("LoadLock.HikVisionMaster.OutputImage")) + // { + // var bp = (Bitmap)data["LoadLock.HikVisionMaster.OutputImage"]; + // OutputRanderImage = new(bp); + // } + //} + + private byte[] _oldbyte; + protected override void InvokeBeforeUpdateProperty(Dictionary data) + { + base.InvokeBeforeUpdateProperty(data); + var bp = (byte[])QueryDataClient.Instance.Service.GetData("LoadLock.HikVisionMaster.OutputImage"); + if (bp != null) + { + if (_oldbyte!=null&&!Array.Equals(_oldbyte,bp)) + { + Bitmap b = BytesToBitmap(bp); + OutputRanderImage?.Dispose(); + OutputRanderImage = new ImageBaseData(b); + } + } + _oldbyte = bp; + } + + public Bitmap BytesToBitmap(byte[] bytes) + { + using (MemoryStream ms = new MemoryStream(bytes)) + { + return new Bitmap(ms); // 或使用Image.FromStream:ml-citation{ref="1,18" data="citationList"} + } + } + + public void LdRotationStop() + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.Stop"); + } + + public void LdRotationReset() + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.ServoReset"); + } + + public void LdRotationServoOn() + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.ServoOn"); + } + + public void LdRotationMoveOneCircle() + { + InvokeClient.Instance.Service.DoOperation($"LoadLock.MoveOneCircle"); + } + + public void LdRotationRelativeHome() + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.MoveRelativeHome"); + } + + public void LdRotationRelativeHomeOffset() + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.HomeOffset"); + } + + public void LdRotationMoveCCD1Pos() + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.MoveCCD1Pos"); + } + + public void LdRotationMoveCCD2Pos() + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.MoveCCD2Pos"); + } + + public void LdRotationMoveCCD3Pos() + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.MoveCCD3Pos"); + } + + public void LdRotationJogCW(float angle) + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.JogCW", angle); + } + + public void LdRotationJogCCW(float angle) + { + InvokeClient.Instance.Service.DoOperation($"Load.Rotation.JogCCW", angle); + } + + #region CCD + [Subscription("LoadLock.HikGigeCamera.IsConnected")] + public bool CamConnection { get; set; } + + [Subscription("LoadLock.HikGigeCamera.Message")] + public string CamMessage { get; set; } + + public bool CTS { get; set; } = false; + #endregion + + #region VM + + [Subscription("LoadLock.HikVisionMaster.SampleCircle")] + public double[] SampleCircle { get; set; } + + [Subscription("LoadLock.HikVisionMaster.CurrentCircle")] + public double[] CurrentCircle { get; set; } + + [Subscription("LoadLock.HikVisionMaster.Distance")] + public double Distance { get; set; } + + [Subscription("LoadLock.HikVisionMaster.IsProcessing")] + public string VMIsProcessing { get; set; } + + [Subscription("LoadLock.HikVisionMaster.LoadFile")] + public string VMIsLoad { get; set; } + + [Subscription("LoadLock.HikVisionMaster.ModuleStatus")] + public bool VMRun { get; set; } + + [Subscription("LoadLock.HikVisionMaster.Result")] + public bool VMResult { get; set; } + + public ImageBaseData OutputRanderImage { get; set; } + + public void TestLocalFile(string value, bool isinch6) + { + InvokeClient.Instance.Service.DoOperation($"LoadLock.HikVisionMaster.ExecuteLocalFile", value + (isinch6 ? "FindLine" : "")); + } + + public void TestCCD(string value,bool isinch6) + { + InvokeClient.Instance.Service.DoOperation($"LoadLock.HikVisionMaster.ExecuteGrab", value + (isinch6? "FindLine" : "")); + } + + public void SetSample(string value) + { + InvokeClient.Instance.Service.DoOperation($"LoadLock.HikVisionMaster.SetSample", value); + } + + public void ReloadSolution() + { + InvokeClient.Instance.Service.DoOperation($"LoadLock.HikVisionMaster.ReloadSolution"); + } + #endregion + + } +} diff --git a/App/SicUI/SicUI.csproj b/App/SicUI/SicUI.csproj index d64cdd0..9bbd5a4 100644 --- a/App/SicUI/SicUI.csproj +++ b/App/SicUI/SicUI.csproj @@ -57,9 +57,41 @@ + + False + ..\..\Dependencies\VisionMaster\Apps.Data.dll + + + False + ..\..\Dependencies\VisionMaster\CalculatorModuleCs.dll + ..\..\Dependencies\CommandLine.dll + + False + ..\..\Dependencies\VisionMaster\GlobalVariableModuleCs.dll + + + False + ..\..\Dependencies\VisionMaster\IfModuleCs.dll + + + False + ..\..\Dependencies\VisionMaster\ImageSourceModuleCs.dll + + + False + ..\..\Dependencies\VisionMaster\IMVSCaliperEdgeModuCs.dll + + + False + ..\..\Dependencies\VisionMaster\IMVSCircleFitModuCs.dll + + + False + ..\..\Dependencies\VisionMaster\IMVSLineFindModuCs.dll + ..\..\Dependencies\KXGEM.dll @@ -72,6 +104,10 @@ + + False + ..\..\Dependencies\VisionMaster\SaveImageCs.dll + ..\..\Dependencies\SciCart\SciChart.Charting.dll @@ -104,6 +140,42 @@ 4.0 + + False + ..\..\Dependencies\VisionMaster\VM.Core.dll + + + False + ..\..\Dependencies\VisionMaster\VM.PlatformSDKCS.dll + + + False + ..\..\Dependencies\VisionMaster\VM.Util.dll + + + False + ..\..\Dependencies\VisionMaster\VM.Utility.dll + + + False + ..\..\Dependencies\VisionMaster\VMControls.BaseInterface.dll + + + False + ..\..\Dependencies\VisionMaster\VMControls.Interface.dll + + + False + ..\..\Dependencies\VisionMaster\VMControls.RenderInterface.dll + + + False + ..\..\Dependencies\VisionMaster\VMControls.Winform.Release.dll + + + False + ..\..\Dependencies\VisionMaster\VMControls.WPF.Release.dll + @@ -142,6 +214,9 @@ BodyLid.xaml + + CameraControl.xaml + ChooseDialogBoxView.xaml @@ -213,6 +288,10 @@ RuntimeView.xaml + + Device2View.xaml + + DeviceView.xaml @@ -371,6 +450,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -447,6 +530,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + Designer MSBuild:Compile