diff --git a/BPASmartClient.Compiler/BPASmartClient.Compiler.csproj b/BPASmartClient.Compiler/BPASmartClient.Compiler.csproj
index f8198dde..aa52b3a8 100644
--- a/BPASmartClient.Compiler/BPASmartClient.Compiler.csproj
+++ b/BPASmartClient.Compiler/BPASmartClient.Compiler.csproj
@@ -6,10 +6,6 @@
enable
-
-
-
-
DLL\Antlr3.Runtime.dll
diff --git a/BPASmartClient.SCADAControl/IExecutable.cs b/BPASmartClient.Compiler/IExecutable.cs
similarity index 92%
rename from BPASmartClient.SCADAControl/IExecutable.cs
rename to BPASmartClient.Compiler/IExecutable.cs
index d48c9391..836f89f7 100644
--- a/BPASmartClient.SCADAControl/IExecutable.cs
+++ b/BPASmartClient.Compiler/IExecutable.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace BPASmartClient.SCADAControl
+namespace BPASmartClient.Compiler
{
public interface IExecutable
{
diff --git a/BPASmartClient.MessageName/Enum/物料仓/SilosRunEnum.cs b/BPASmartClient.MessageName/Enum/物料仓/SilosRunEnum.cs
new file mode 100644
index 00000000..f8ae2652
--- /dev/null
+++ b/BPASmartClient.MessageName/Enum/物料仓/SilosRunEnum.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.MessageName.Enum.物料仓
+{
+ ///
+ /// 物料仓数据设置-Model
+ ///
+ public class SilosMessageModel
+ {
+ ///
+ /// 物料仓:仓号
+ ///
+ public string id { get; set; }
+ ///
+ /// 物料仓:标题
+ ///
+ public string Title { get; set; }
+ ///
+ /// 物料仓:重量(G) 35.23
+ ///
+ public string Value { get; set; }
+ }
+}
diff --git a/BPASmartClient.MessageName/Enum/运行状态/RunEnum.cs b/BPASmartClient.MessageName/Enum/运行状态/RunEnum.cs
new file mode 100644
index 00000000..54e2402f
--- /dev/null
+++ b/BPASmartClient.MessageName/Enum/运行状态/RunEnum.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.MessageName.Enum.运行状态
+{
+ ///
+ /// 运行状态-枚举
+ ///
+ public enum RunEnum
+ {
+ ///
+ /// 运行(滚动线默认右转)
+ ///
+ Run,
+ ///
+ /// 运行-左转(滚动线独有)
+ ///
+ Run_Left,
+ ///
+ /// 停止
+ ///
+ Stop
+ }
+}
diff --git a/BPASmartClient.MessageName/MessageName.cs b/BPASmartClient.MessageName/MessageName.cs
index 4eb5ea81..75754f00 100644
--- a/BPASmartClient.MessageName/MessageName.cs
+++ b/BPASmartClient.MessageName/MessageName.cs
@@ -66,6 +66,7 @@ namespace BPASmartClient.MessageName
/// 物料仓数据设置
///
SilosSetData,
+
///
/// 滚动线运行状态
///
diff --git a/BPASmartClient.SCADAControl/ArcGauge.cs b/BPASmartClient.SCADAControl/ArcGauge.cs
index 51fe9932..e5ee39a2 100644
--- a/BPASmartClient.SCADAControl/ArcGauge.cs
+++ b/BPASmartClient.SCADAControl/ArcGauge.cs
@@ -1,4 +1,5 @@
-using System;
+using BPASmartClient.Compiler;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
diff --git a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj
index 5328e350..e8a17b2f 100644
--- a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj
+++ b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj
@@ -12,6 +12,7 @@
+
diff --git a/BPASmartClient.SCADAControl/NewConveyorBelt.xaml.cs b/BPASmartClient.SCADAControl/NewConveyorBelt.xaml.cs
index a0278b7d..443a1678 100644
--- a/BPASmartClient.SCADAControl/NewConveyorBelt.xaml.cs
+++ b/BPASmartClient.SCADAControl/NewConveyorBelt.xaml.cs
@@ -1,4 +1,8 @@
-using BPASmartClient.MessageName;
+using BPASmartClient.Compiler;
+using BPASmartClient.MessageCommunication;
+using BPASmartClient.MessageCommunication.MsgControl;
+using BPASmartClient.MessageName;
+using BPASmartClient.MessageName.Enum.运行状态;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -24,10 +28,14 @@ namespace BPASmartClient.SCADAControl
///
public partial class NewConveyorBelt : UserControl, IExecutable
{
+ #region 临时变量
Path Path_mp = null;
Path Path_cb = null;
Storyboard storyboard = new Storyboard();
Storyboard storyboard1 = new Storyboard();
+ #endregion
+
+
public NewConveyorBelt()
{
InitializeComponent();
@@ -43,7 +51,6 @@ namespace BPASmartClient.SCADAControl
}
public string ControlType => "滚动线";
-
private bool isExecuteState;
public bool IsExecuteState
{
@@ -60,11 +67,7 @@ namespace BPASmartClient.SCADAControl
}
}
- public void Register()
- {
-
- }
-
+ #region 内部函数
public void VisualStateManagerData()
{
storyboard.RepeatBehavior = RepeatBehavior.Forever;
@@ -163,35 +166,13 @@ namespace BPASmartClient.SCADAControl
}
}
}
+ #endregion
+ #region 属性
private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
(d as NewConveyorBelt)?.Refursh();
}
-
- private void Refursh()
- {
- if (Direction == 1)
- {
- storyboard.Begin();
- storyboard1.Stop();
- // VisualStateManager.GoToState(this, "Left", false);
- }
- else if (Direction == 2)
- {
- storyboard.Stop();
- storyboard1.Begin();
- //VisualStateManager.GoToState(this, "Right", false);
- }
- else
- {
- storyboard.Stop();
- storyboard1.Stop();
- //VisualStateManager.GoToState(this, "Stop", false);
- }
- }
-
-
public DoubleCollection StrokeDashArray
{
get { return (DoubleCollection)GetValue(StrokeDashArrayProperty); }
@@ -252,7 +233,7 @@ namespace BPASmartClient.SCADAControl
DependencyProperty.Register("Direction", typeof(int), typeof(NewConveyorBelt),
new PropertyMetadata(0, new PropertyChangedCallback(OnPropertyChanged)));
-
+
[Category("主题订阅")]
public string ConveyorBeltLeft
{
@@ -278,22 +259,68 @@ namespace BPASmartClient.SCADAControl
public static readonly DependencyProperty ConveyorBeltStopProperty =
DependencyProperty.Register("ConveyorBeltStop", typeof(string), typeof(NewConveyorBelt), new PropertyMetadata(string.Empty));
- //[Category("事件名称集合")]
- //public ObservableCollection EventList
- //{
- // get { return (ObservableCollection)GetValue(EventListProperty); }
- // set { SetValue(EventListProperty, value); }
- //}
- //public static readonly DependencyProperty EventListProperty =
- // DependencyProperty.Register("EventList", typeof(ObservableCollection), typeof(NewConveyorBelt), new PropertyMetadata(new ObservableCollection()));
+
[Category("消息名称")]
- public MessageNameEnum EventName
+ public MessageNameEnum EventRunName
+ {
+ get { return (MessageNameEnum)GetValue(EventRunNameProperty); }
+ set { SetValue(EventRunNameProperty, value); }
+ }
+ public static readonly DependencyProperty EventRunNameProperty =
+ DependencyProperty.Register("EventRunName", typeof(MessageNameEnum), typeof(NewConveyorBelt), new PropertyMetadata(MessageNameEnum.Null, onEventRunNameChanged));
+ private static void onEventRunNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => (d as NewConveyorBelt)?.RunNameRefresh();
+ #endregion
+
+ #region 属性变更事件
+ public void Register()
+ {
+ Class_InnerMessageBus.GetInstance().ListenMessage(this, EventRunName.ToString(), "EventRunNameHandler");
+ }
+
+ public void EventRunNameHandler(object sender, InnerMessageEventArgs e)
+ {
+ try
+ {
+ if (IsExecuteState = true)
+ {
+ if (e.obj_MessageObj is RunEnum)
+ {
+ RunEnum runEnum = (RunEnum)e.obj_MessageObj;
+
+ Direction = runEnum == RunEnum.Run ? 1 : ((runEnum == RunEnum.Run_Left)?2:0);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+
+ private void Refursh()
+ {
+ if (Direction == 1)
+ {
+ storyboard.Begin();
+ storyboard1.Stop();
+ }
+ else if (Direction == 2)
+ {
+ storyboard.Stop();
+ storyboard1.Begin();
+ }
+ else
+ {
+ storyboard.Stop();
+ storyboard1.Stop();
+ }
+ }
+
+ public void RunNameRefresh()
{
- get { return (MessageNameEnum)GetValue(EventNameProperty); }
- set { SetValue(EventNameProperty, value); }
+
}
- public static readonly DependencyProperty EventNameProperty =
- DependencyProperty.Register("EventName", typeof(MessageNameEnum), typeof(NewConveyorBelt), new PropertyMetadata(MessageNameEnum.Null));
+ #endregion
}
diff --git a/BPASmartClient.SCADAControl/Silos.xaml.cs b/BPASmartClient.SCADAControl/Silos.xaml.cs
index 36ea3e46..4e54023a 100644
--- a/BPASmartClient.SCADAControl/Silos.xaml.cs
+++ b/BPASmartClient.SCADAControl/Silos.xaml.cs
@@ -1,4 +1,9 @@
-using BPASmartClient.MessageName;
+using BPASmartClient.Compiler;
+using BPASmartClient.MessageCommunication;
+using BPASmartClient.MessageCommunication.MsgControl;
+using BPASmartClient.MessageName;
+using BPASmartClient.MessageName.Enum.物料仓;
+using BPASmartClient.MessageName.Enum.运行状态;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -24,26 +29,26 @@ namespace BPASmartClient.SCADAControl
///
public partial class Silos : UserControl, IExecutable
{
+ #region 临时变量
TextBlock textBlockCLKZ = null;
Ellipse ellipseControl = null;
Storyboard storyboard = new Storyboard();
+ #endregion
+
public Silos()
{
InitializeComponent();
this.DataContext = this;
Width = 180;
Height = 270;
- Value = 25.23;
+ Value = "25.23";
Title = "香料";
Text = "1";
this.SizeChanged += Silos_SizeChanged; ;
}
-
-
public string ControlType => "物料仓";
-
private bool isExecuteState;
public bool IsExecuteState
{
@@ -127,16 +132,13 @@ namespace BPASmartClient.SCADAControl
#region 属性
[Category("值设定")]
- public double Value
+ public string Value
{
- get { return (double)GetValue(ValueProperty); }
+ get { return (string)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty =
- DependencyProperty.Register("Value", typeof(double), typeof(Silos), new PropertyMetadata(0d, OnValueChanged));
-
- private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => (d as Silos)?.Refresh();
-
+ DependencyProperty.Register("Value", typeof(string), typeof(Silos), new PropertyMetadata(string.Empty));
[Category("值设定")]
public string Text
{
@@ -156,14 +158,23 @@ namespace BPASmartClient.SCADAControl
DependencyProperty.Register("Title", typeof(string), typeof(Silos), new PropertyMetadata(string.Empty));
[Category("消息名称")]
- public MessageNameEnum EventName
+ public MessageNameEnum EventRunName
{
- get { return (MessageNameEnum)GetValue(EventNameProperty); }
- set { SetValue(EventNameProperty, value); }
+ get { return (MessageNameEnum)GetValue(EventRunNameProperty); }
+ set { SetValue(EventRunNameProperty, value); }
}
- public static readonly DependencyProperty EventNameProperty =
- DependencyProperty.Register("EventName", typeof(MessageNameEnum), typeof(Silos), new PropertyMetadata(MessageNameEnum.Null,onEventValueChanged));
- private static void onEventValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => (d as Silos)?.Refresh();
+ public static readonly DependencyProperty EventRunNameProperty =
+ DependencyProperty.Register("EventRunName", typeof(MessageNameEnum), typeof(Silos), new PropertyMetadata(MessageNameEnum.Null, onEventRunNameChanged));
+ private static void onEventRunNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => (d as Silos)?.RunNameRefresh();
+ [Category("消息名称")]
+ public MessageNameEnum EventDataName
+ {
+ get { return (MessageNameEnum)GetValue(EventDataNameProperty); }
+ set { SetValue(EventDataNameProperty, value); }
+ }
+ public static readonly DependencyProperty EventDataNameProperty =
+ DependencyProperty.Register("EventDataName", typeof(MessageNameEnum), typeof(Silos), new PropertyMetadata(MessageNameEnum.Null, onEventDataNameChanged));
+ private static void onEventDataNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => (d as Silos)?.DataNameRefresh();
[Category("值设定")]
public int Direction
{
@@ -180,6 +191,9 @@ namespace BPASmartClient.SCADAControl
#endregion
#region 函数
+ ///
+ /// 值变化刷新
+ ///
public void Refresh()
{
if (ellipseControl != null)
@@ -204,12 +218,72 @@ namespace BPASmartClient.SCADAControl
}
}
+ }
+ ///
+ /// 运行名称变化事件
+ ///
+ public void RunNameRefresh()
+ {
+
+ }
+ ///
+ /// 数据名称变化事件
+ ///
+ public void DataNameRefresh()
+ {
+
}
#endregion
+ #region 运行事件
public void Register()
{
+ Class_InnerMessageBus.GetInstance().ListenMessage(this, EventRunName.ToString(), "EventRunNameHandler");
+ Class_InnerMessageBus.GetInstance().ListenMessage(this, EventDataName.ToString(), "EventDataNameHandler");
+ }
+
+ public void EventRunNameHandler(object sender, InnerMessageEventArgs e)
+ {
+ try
+ {
+ if (IsExecuteState = true)
+ {
+ if (e.obj_MessageObj is RunEnum)
+ {
+ RunEnum runEnum = (RunEnum)e.obj_MessageObj;
+ Direction = runEnum == RunEnum.Run ? 1 : 2;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+
+ public void EventDataNameHandler(object sender, InnerMessageEventArgs e)
+ {
+ try
+ {
+ if (IsExecuteState = true)
+ {
+ if (e.obj_MessageObj is SilosMessageModel)
+ {
+ SilosMessageModel silosMessageModel = (SilosMessageModel)e.obj_MessageObj;
+ if (silosMessageModel.id == Text)
+ {
+ Title=silosMessageModel.Title;
+ Value= silosMessageModel.Value;
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ }
}
+ #endregion
+
}
}
diff --git a/SCADA.Test/App.xaml b/SCADA.Test/App.xaml
new file mode 100644
index 00000000..1d057a81
--- /dev/null
+++ b/SCADA.Test/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/SCADA.Test/App.xaml.cs b/SCADA.Test/App.xaml.cs
new file mode 100644
index 00000000..0dbc5dbf
--- /dev/null
+++ b/SCADA.Test/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace SCADA.Test
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/SCADA.Test/AssemblyInfo.cs b/SCADA.Test/AssemblyInfo.cs
new file mode 100644
index 00000000..8b5504ec
--- /dev/null
+++ b/SCADA.Test/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/SCADA.Test/Converters/ZoomConverter.cs b/SCADA.Test/Converters/ZoomConverter.cs
new file mode 100644
index 00000000..ab3c2e40
--- /dev/null
+++ b/SCADA.Test/Converters/ZoomConverter.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+
+namespace SCADA.Test.Converters
+{
+ public class ZoomConverter : IValueConverter
+ {
+ public bool IsHeight { get; set; }
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (double.TryParse(value.ToString(), out double zoom))
+ {
+ return IsHeight ? zoom * 1080 : zoom * 1920;
+ }
+ else
+ {
+ return IsHeight ? 1080 : 1920;
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+ }
+}
diff --git a/SCADA.Test/MainWindow.xaml b/SCADA.Test/MainWindow.xaml
new file mode 100644
index 00000000..9ffa5be9
--- /dev/null
+++ b/SCADA.Test/MainWindow.xaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA.Test/MainWindow.xaml.cs b/SCADA.Test/MainWindow.xaml.cs
new file mode 100644
index 00000000..fea14b6b
--- /dev/null
+++ b/SCADA.Test/MainWindow.xaml.cs
@@ -0,0 +1,74 @@
+using Microsoft.Win32;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace SCADA.Test
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ List Children = new List();
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ #region 加载数据
+ ///
+ /// 加载数据
+ ///
+ public void LoadingData(string path)
+ {
+ //加载控件
+ Children.Clear();
+ FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ using (StreamReader sr = new StreamReader(fs, System.Text.Encoding.Unicode))
+ {
+ while (sr.Peek() > -1)
+ {
+ string str = sr.ReadLine();
+ //if (!str.Contains("NewConveyorBelt"))
+ {
+ var ele = XamlReader.Parse(str) as FrameworkElement;
+ Children.Add(ele);
+ }
+
+ }
+ }
+ if (Children.Count > 0)
+ {
+ runCanvas.Run(Children);
+ }
+
+ }
+ #endregion
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ OpenFileDialog ofd = new OpenFileDialog();
+ ofd.Filter = "布局文件|*.lay";
+ if (ofd.ShowDialog() ==true)
+ {
+ LoadingData(ofd.FileName);
+ }
+
+ }
+ }
+}
diff --git a/SCADA.Test/RunCanvas.xaml b/SCADA.Test/RunCanvas.xaml
new file mode 100644
index 00000000..0746c6de
--- /dev/null
+++ b/SCADA.Test/RunCanvas.xaml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA.Test/RunCanvas.xaml.cs b/SCADA.Test/RunCanvas.xaml.cs
new file mode 100644
index 00000000..c5d8e247
--- /dev/null
+++ b/SCADA.Test/RunCanvas.xaml.cs
@@ -0,0 +1,132 @@
+using BPASmartClient.Compiler;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+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 SCADA.Test
+{
+ ///
+ /// RunCanvas.xaml 的交互逻辑
+ ///
+ public partial class RunCanvas : UserControl
+ {
+ public RunCanvas()
+ {
+ InitializeComponent();
+ Unloaded += (s, e) => Destory();
+ }
+
+ ///
+ /// Dispose子集
+ ///
+ public void Destory()
+ {
+ foreach (var item in RootCanvas.Children)
+ {
+ if (item is IDisposable disposable)
+ {
+ disposable.Dispose();
+ }
+ }
+ }
+
+ public void Run(List canvas)
+ {
+ RootCanvas.Children.Clear();
+ foreach (FrameworkElement element in canvas)
+ {
+ if (element.GetType().GetInterface("IExecutable") != null)
+ {
+ element.GetType().GetProperty("IsExecuteState").SetValue(element, true);
+ }
+
+ if (element is IExecutable executable)
+ executable.IsExecuteState = true;
+
+ RootCanvas.Children.Add(element);
+ RegisterJsName(element);
+ }
+ }
+
+ // 注册名称到Js
+ static void RegisterJsName(FrameworkElement element)
+ {
+ Config.GetInstance().SetVariable(element.Name, element);
+ if (element is Panel panel)
+ {
+ foreach (var item in panel.Children)
+ {
+ RegisterJsName(item as FrameworkElement);
+ }
+ }
+ }
+
+ #region 拖动与缩放
+ private void RootCanvas_MouseMove(object sender, MouseEventArgs e)
+ {
+ if (DragEnable.IsChecked == false)
+ {
+ return;
+ }
+
+ if (e.LeftButton == MouseButtonState.Pressed && isPressed)
+ {
+ Point point = e.GetPosition(this);
+ var movex = (point.X - last.X);
+ var movey = (point.Y - last.Y);
+
+ Translate.X += movex;
+ Translate.Y += movey;
+ last = point;
+
+ }
+ }
+
+ bool isPressed = false;
+ Point last;//记录上次鼠标坐标位置
+ private void RootCanvas_MouseLeftButtoDown(object sender, MouseButtonEventArgs e)
+ {
+ last = e.GetPosition(this);
+ isPressed = true;
+ }
+
+ private void RootCanvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ isPressed = false;
+ }
+
+ // 缩放
+ private void RootCanvas_MouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ if (ZoomEnable.IsChecked == false)
+ {
+ return;
+ }
+ var zoomS = (e.Delta / 960d);
+ var zoom = zoomS + Scale.ScaleX;
+ if (zoom > 3 || zoom < 0.8)
+ {
+ return;
+ }
+ Scale.ScaleX = Scale.ScaleY = zoom;
+
+ Point mouse = e.GetPosition(RootCanvas);
+ Point newMouse = new Point(mouse.X * zoomS, mouse.Y * zoomS);
+
+ Translate.X -= newMouse.X;
+ Translate.Y -= newMouse.Y;
+ }
+ #endregion
+ }
+}
diff --git a/SCADA.Test/SCADA.Test.csproj b/SCADA.Test/SCADA.Test.csproj
new file mode 100644
index 00000000..550bd4b5
--- /dev/null
+++ b/SCADA.Test/SCADA.Test.csproj
@@ -0,0 +1,15 @@
+
+
+
+ WinExe
+ net6.0-windows
+ enable
+ true
+
+
+
+
+
+
+
+
diff --git a/SCADA.Test/物料布局.lay b/SCADA.Test/物料布局.lay
new file mode 100644
index 00000000..7899db87
Binary files /dev/null and b/SCADA.Test/物料布局.lay differ
diff --git a/SmartClient.sln b/SmartClient.sln
index ec73391e..71061217 100644
--- a/SmartClient.sln
+++ b/SmartClient.sln
@@ -148,7 +148,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.消息名称管理", "2.
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.组态控件集", "3.组态控件集", "{5300552F-560D-474A-8D96-0A2747D08F64}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Compiler", "BPASmartClient.Compiler\BPASmartClient.Compiler.csproj", "{B6213013-2A0E-41DD-BA9F-775D53C19374}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Compiler", "BPASmartClient.Compiler\BPASmartClient.Compiler.csproj", "{B6213013-2A0E-41DD-BA9F-775D53C19374}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.界面加载实例", "4.界面加载实例", "{309D579E-DDA8-4B01-A0AA-0F381BC37801}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCADA.Test", "SCADA.Test\SCADA.Test.csproj", "{1696D557-C908-4136-A5F2-FF59D69E642C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1384,6 +1388,26 @@ Global
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|x64.Build.0 = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|x86.ActiveCfg = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|x86.Build.0 = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|ARM.Build.0 = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|x64.Build.0 = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Debug|x86.Build.0 = Debug|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|ARM.ActiveCfg = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|ARM.Build.0 = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|ARM64.Build.0 = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|x64.ActiveCfg = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|x64.Build.0 = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|x86.ActiveCfg = Release|Any CPU
+ {1696D557-C908-4136-A5F2-FF59D69E642C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1453,6 +1477,8 @@ Global
{28BE5235-2399-4EBA-B1F0-88E0F32AC869} = {7B0175AD-BB74-4A98-B9A7-1E289032485E}
{5300552F-560D-474A-8D96-0A2747D08F64} = {7B0175AD-BB74-4A98-B9A7-1E289032485E}
{B6213013-2A0E-41DD-BA9F-775D53C19374} = {5300552F-560D-474A-8D96-0A2747D08F64}
+ {309D579E-DDA8-4B01-A0AA-0F381BC37801} = {7B0175AD-BB74-4A98-B9A7-1E289032485E}
+ {1696D557-C908-4136-A5F2-FF59D69E642C} = {309D579E-DDA8-4B01-A0AA-0F381BC37801}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}