diff --git a/BPASmartClient.MinimalistUI/App.xaml b/BPASmartClient.MinimalistUI/App.xaml deleted file mode 100644 index 1faae9da..00000000 --- a/BPASmartClient.MinimalistUI/App.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/BPASmartClient.MinimalistUI/App.xaml.cs b/BPASmartClient.MinimalistUI/App.xaml.cs deleted file mode 100644 index 42652296..00000000 --- a/BPASmartClient.MinimalistUI/App.xaml.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace BPASmartClient.MinimalistUI -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App :Application - { - } -} diff --git a/BPASmartClient.MinimalistUI/AssemblyInfo.cs b/BPASmartClient.MinimalistUI/AssemblyInfo.cs deleted file mode 100644 index 8b5504ec..00000000 --- a/BPASmartClient.MinimalistUI/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -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/BPASmartClient.MinimalistUI/BPASmartClient.MinimalistUI.csproj b/BPASmartClient.MinimalistUI/BPASmartClient.MinimalistUI.csproj deleted file mode 100644 index 449b3683..00000000 --- a/BPASmartClient.MinimalistUI/BPASmartClient.MinimalistUI.csproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - WinExe - net6.0-windows - enable - true - Images\fyf.ico - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ..\BPASmartClient.SCADAControl\DLL\BPASmartClient.Compiler.dll - - - - - - - - - - - - - diff --git a/BPASmartClient.MinimalistUI/Converters/ZoomConverter.cs b/BPASmartClient.MinimalistUI/Converters/ZoomConverter.cs deleted file mode 100644 index 51879b44..00000000 --- a/BPASmartClient.MinimalistUI/Converters/ZoomConverter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; - - -namespace BPASmartClient.MinimalistUI.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/BPASmartClient.MinimalistUI/FControl/HBLControl.xaml b/BPASmartClient.MinimalistUI/FControl/HBLControl.xaml deleted file mode 100644 index 468d9b02..00000000 --- a/BPASmartClient.MinimalistUI/FControl/HBLControl.xaml +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智能卓越 - - - - - - - - - - - - - - - - - diff --git a/BPASmartClient.MinimalistUI/FControl/HBLControl.xaml.cs b/BPASmartClient.MinimalistUI/FControl/HBLControl.xaml.cs deleted file mode 100644 index 4669211d..00000000 --- a/BPASmartClient.MinimalistUI/FControl/HBLControl.xaml.cs +++ /dev/null @@ -1,37 +0,0 @@ -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 BPASmartClient.MinimalistUI.FControl -{ - /// - /// HBLControl.xaml 的交互逻辑 - /// - public partial class HBLControl :UserControl - { - public HBLControl() - { - InitializeComponent(); - } - private void grid_MouseEnter(object sender,MouseEventArgs e) - { - grid_celine.Visibility = Visibility.Visible; - } - - private void grid_MouseLeave(object sender,MouseEventArgs e) - { - grid_celine.Visibility = Visibility.Collapsed; - } - } -} diff --git a/BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml b/BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml deleted file mode 100644 index c783fa11..00000000 --- a/BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml.cs b/BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml.cs deleted file mode 100644 index 6049c3ab..00000000 --- a/BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml.cs +++ /dev/null @@ -1,136 +0,0 @@ - -using BPASmartClient.Compiler; -using BPASmartClient.MessageName.接收消息Model; -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 BPASmartClient.MinimalistUI.FControl -{ - /// - /// 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 List Run(List canvas) - { - List messages = new List(); - RootCanvas.Children.Clear(); - foreach (FrameworkElement element in canvas) - { - if (element is IExecutable executable) - { - executable.IsExecuteState = true; - //if (executable.EventNameList != null && executable.EventNameList.Count > 0) - //{ - // messages.AddRange(executable.EventNameList); - //} - } - RootCanvas.Children.Add(element); - RegisterJsName(element); - } - return messages; - } - - // 注册名称到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/BPASmartClient.MinimalistUI/Images/bj.png b/BPASmartClient.MinimalistUI/Images/bj.png deleted file mode 100644 index f6b621e0..00000000 Binary files a/BPASmartClient.MinimalistUI/Images/bj.png and /dev/null differ diff --git a/BPASmartClient.MinimalistUI/Images/fyf.ico b/BPASmartClient.MinimalistUI/Images/fyf.ico deleted file mode 100644 index 346bbc6c..00000000 Binary files a/BPASmartClient.MinimalistUI/Images/fyf.ico and /dev/null differ diff --git a/BPASmartClient.MinimalistUI/Images/logo-Text.png b/BPASmartClient.MinimalistUI/Images/logo-Text.png deleted file mode 100644 index e0e17a7c..00000000 Binary files a/BPASmartClient.MinimalistUI/Images/logo-Text.png and /dev/null differ diff --git a/BPASmartClient.MinimalistUI/Images/logo-pic.png b/BPASmartClient.MinimalistUI/Images/logo-pic.png deleted file mode 100644 index 3cc53241..00000000 Binary files a/BPASmartClient.MinimalistUI/Images/logo-pic.png and /dev/null differ diff --git a/BPASmartClient.MinimalistUI/Images/top_h.png b/BPASmartClient.MinimalistUI/Images/top_h.png deleted file mode 100644 index d23acad5..00000000 Binary files a/BPASmartClient.MinimalistUI/Images/top_h.png and /dev/null differ diff --git a/BPASmartClient.MinimalistUI/Images/椭圆 22 副本 2.png b/BPASmartClient.MinimalistUI/Images/椭圆 22 副本 2.png deleted file mode 100644 index 7c9bbca6..00000000 Binary files a/BPASmartClient.MinimalistUI/Images/椭圆 22 副本 2.png and /dev/null differ diff --git a/BPASmartClient.MinimalistUI/MainWindow.xaml b/BPASmartClient.MinimalistUI/MainWindow.xaml deleted file mode 100644 index 99662bea..00000000 --- a/BPASmartClient.MinimalistUI/MainWindow.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - diff --git a/BPASmartClient.MinimalistUI/MainWindow.xaml.cs b/BPASmartClient.MinimalistUI/MainWindow.xaml.cs deleted file mode 100644 index 52675f89..00000000 --- a/BPASmartClient.MinimalistUI/MainWindow.xaml.cs +++ /dev/null @@ -1,65 +0,0 @@ -using BPASmartClient.Compiler; -using BPASmartClient.MessageCommunication; -using BPASmartClient.MessageCommunication.MsgControl; -using BPASmartClient.MessageName; -using BPASmartClient.MessageName.EnumHelp; -using BPASmartClient.MessageName.发送消息Model; -using BPASmartClient.MessageName.接收消息Model; -using BPASmartClient.MessageName.接收消息Model.物料仓; -using Microsoft.Win32; -using Newtonsoft.Json; -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 BPASmartClient.MinimalistUI -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow :Window - { - public MainWindow() - { - InitializeComponent(); - Directory.CreateDirectory(System.IO. Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"LayoutFile")); - LoadingData(System.AppDomain.CurrentDomain.BaseDirectory + "LayoutFile\\物料仓管理.lay"); - } - /// - /// 加载数据 - /// - public void LoadingData(string path) - { - //加载控件 - List Children = new List(); - 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(); - var ele = XamlReader.Parse(str) as FrameworkElement; - Children.Add(ele); - } - } - if (Children.Count > 0) - { - runCanvas.Run(Children); - } - - } - } -} diff --git a/BPASmartClient.MinimalistUI/物料仓管理.lay b/BPASmartClient.MinimalistUI/物料仓管理.lay deleted file mode 100644 index e0c8bf8f..00000000 Binary files a/BPASmartClient.MinimalistUI/物料仓管理.lay and /dev/null differ diff --git a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj index 3854ac4a..cb2e73f8 100644 --- a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj +++ b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj @@ -41,12 +41,13 @@ + + - diff --git a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs index be3aac10..b9a03a4e 100644 --- a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs +++ b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs @@ -223,6 +223,36 @@ namespace BeDesignerSCADA.Controls } } /// + /// 运行程序 + /// + public void Run() + { + try + { + cav.ClearSelection(); + runCanvas.Run(cav.Generator()); + } + catch (Exception ex) + { + + } + } + /// + /// 停止运行程序 + /// + public void Destory() + { + try + { + runCanvas.Destory(); + } + catch (Exception ex) + { + + throw; + } + } + /// /// 保存 /// /// diff --git a/BeDesignerSCADA/Controls/RunCanvas.xaml.cs b/BeDesignerSCADA/Controls/RunCanvas.xaml.cs index 8df988d2..e5a4ae28 100644 --- a/BeDesignerSCADA/Controls/RunCanvas.xaml.cs +++ b/BeDesignerSCADA/Controls/RunCanvas.xaml.cs @@ -2,6 +2,7 @@ using BPASmartClient.SCADAControl; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,6 +11,7 @@ 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; @@ -18,6 +20,7 @@ using System.Windows.Shapes; namespace BeDesignerSCADA.Controls { /// + /// 运行控件 /// RunCanvas.xaml 的交互逻辑 /// public partial class RunCanvas : UserControl @@ -42,6 +45,30 @@ namespace BeDesignerSCADA.Controls } } + /// + /// 加载数据 + /// + public void LoadingData(string path) + { + //加载控件 + List Children = new List(); + 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(); + var ele = XamlReader.Parse(str) as FrameworkElement; + Children.Add(ele); + } + } + if (Children.Count > 0) + { + Run(Children); + } + + } + public void Run(List canvas) { RootCanvas.Children.Clear(); diff --git a/SmartClient.sln b/SmartClient.sln index 302d4cf9..ebb03b22 100644 --- a/SmartClient.sln +++ b/SmartClient.sln @@ -142,11 +142,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DATABUS", "B EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.SCADAControl", "BPASmartClient.SCADAControl\BPASmartClient.SCADAControl.csproj", "{6A3FC66D-0B89-45E8-B39B-9D81538002D1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1.数据中心", "1.数据中心", "{7BED8969-7EA7-409C-8BBC-D2777ECDA2F1}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1.可视化内存数据", "1.可视化内存数据", "{7BED8969-7EA7-409C-8BBC-D2777ECDA2F1}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.消息名称管理", "2.消息名称管理", "{28BE5235-2399-4EBA-B1F0-88E0F32AC869}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.组态控件集", "3.组态控件集", "{5300552F-560D-474A-8D96-0A2747D08F64}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.可视化控件集", "3.可视化控件集", "{5300552F-560D-474A-8D96-0A2747D08F64}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmart.VariableManager", "BPASmart.VariableManager\BPASmart.VariableManager.csproj", "{2C17B9A9-B27B-4F07-AFB0-0F56A975D501}" EndProject @@ -162,11 +162,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Communication", "Communicat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerTestDemo", "ComputerTestDemo\ComputerTestDemo.csproj", "{8940F1E2-693D-407E-AD03-722718860609}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.加载UI程序", "4.加载UI程序", "{1DA0F827-5F3D-4B87-9B51-6C0BF5365A3F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MinimalistUI", "BPASmartClient.MinimalistUI\BPASmartClient.MinimalistUI.csproj", "{AE49009F-B7D9-482E-AD1F-4514435272E1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "5.配置工具", "5.配置工具", "{06F0B369-0483-46DD-82D2-70431FB505C1}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.可视化配置工具", "4.可视化配置工具", "{06F0B369-0483-46DD-82D2-70431FB505C1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeDesignerSCADA", "BeDesignerSCADA\BeDesignerSCADA.csproj", "{DF8B4C38-39DE-4220-AB60-885CAE6D1E47}" EndProject @@ -1510,26 +1506,6 @@ Global {8940F1E2-693D-407E-AD03-722718860609}.Release|x64.Build.0 = Release|Any CPU {8940F1E2-693D-407E-AD03-722718860609}.Release|x86.ActiveCfg = Release|Any CPU {8940F1E2-693D-407E-AD03-722718860609}.Release|x86.Build.0 = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|ARM.ActiveCfg = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|ARM.Build.0 = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|ARM64.Build.0 = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|x64.ActiveCfg = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|x64.Build.0 = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|x86.ActiveCfg = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Debug|x86.Build.0 = Debug|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|Any CPU.Build.0 = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|ARM.ActiveCfg = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|ARM.Build.0 = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|ARM64.ActiveCfg = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|ARM64.Build.0 = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|x64.ActiveCfg = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|x64.Build.0 = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|x86.ActiveCfg = Release|Any CPU - {AE49009F-B7D9-482E-AD1F-4514435272E1}.Release|x86.Build.0 = Release|Any CPU {DF8B4C38-39DE-4220-AB60-885CAE6D1E47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DF8B4C38-39DE-4220-AB60-885CAE6D1E47}.Debug|Any CPU.Build.0 = Debug|Any CPU {DF8B4C38-39DE-4220-AB60-885CAE6D1E47}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -1684,8 +1660,6 @@ Global {F67FBFAC-6C80-466D-A596-1B9B10E885FC} = {CDC1E762-5E1D-4AE1-9DF2-B85761539086} {1062F7C7-0117-413C-A45E-8F9B525FC036} = {CDC1E762-5E1D-4AE1-9DF2-B85761539086} {8940F1E2-693D-407E-AD03-722718860609} = {CDC1E762-5E1D-4AE1-9DF2-B85761539086} - {1DA0F827-5F3D-4B87-9B51-6C0BF5365A3F} = {7B0175AD-BB74-4A98-B9A7-1E289032485E} - {AE49009F-B7D9-482E-AD1F-4514435272E1} = {1DA0F827-5F3D-4B87-9B51-6C0BF5365A3F} {06F0B369-0483-46DD-82D2-70431FB505C1} = {7B0175AD-BB74-4A98-B9A7-1E289032485E} {DF8B4C38-39DE-4220-AB60-885CAE6D1E47} = {06F0B369-0483-46DD-82D2-70431FB505C1} {28EBFC11-184A-4B88-A7B3-84F3FD768520} = {CDC1E762-5E1D-4AE1-9DF2-B85761539086}