Przeglądaj źródła

更新

样式分支
fyf 2 lat temu
rodzic
commit
06a2f0fca7
22 zmienionych plików z 62 dodań i 580 usunięć
  1. +0
    -9
      BPASmartClient.MinimalistUI/App.xaml
  2. +0
    -17
      BPASmartClient.MinimalistUI/App.xaml.cs
  3. +0
    -10
      BPASmartClient.MinimalistUI/AssemblyInfo.cs
  4. +0
    -50
      BPASmartClient.MinimalistUI/BPASmartClient.MinimalistUI.csproj
  5. +0
    -32
      BPASmartClient.MinimalistUI/Converters/ZoomConverter.cs
  6. +0
    -144
      BPASmartClient.MinimalistUI/FControl/HBLControl.xaml
  7. +0
    -37
      BPASmartClient.MinimalistUI/FControl/HBLControl.xaml.cs
  8. +0
    -32
      BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml
  9. +0
    -136
      BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml.cs
  10. BIN
     
  11. BIN
     
  12. BIN
     
  13. BIN
     
  14. BIN
     
  15. BIN
     
  16. +0
    -18
      BPASmartClient.MinimalistUI/MainWindow.xaml
  17. +0
    -65
      BPASmartClient.MinimalistUI/MainWindow.xaml.cs
  18. BIN
     
  19. +2
    -1
      BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj
  20. +30
    -0
      BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs
  21. +27
    -0
      BeDesignerSCADA/Controls/RunCanvas.xaml.cs
  22. +3
    -29
      SmartClient.sln

+ 0
- 9
BPASmartClient.MinimalistUI/App.xaml Wyświetl plik

@@ -1,9 +0,0 @@
<Application x:Class="BPASmartClient.MinimalistUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BPASmartClient.MinimalistUI"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

+ 0
- 17
BPASmartClient.MinimalistUI/App.xaml.cs Wyświetl plik

@@ -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
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App :Application
{
}
}

+ 0
- 10
BPASmartClient.MinimalistUI/AssemblyInfo.cs Wyświetl plik

@@ -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)
)]

+ 0
- 50
BPASmartClient.MinimalistUI/BPASmartClient.MinimalistUI.csproj Wyświetl plik

@@ -1,50 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ApplicationIcon>Images\fyf.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<None Remove="Images\bj.png" />
<None Remove="Images\fyf.ico" />
<None Remove="Images\logo-pic.png" />
<None Remove="Images\logo-Text.png" />
<None Remove="Images\top_h.png" />
<None Remove="Images\椭圆 22 副本 2.png" />
</ItemGroup>

<ItemGroup>
<Content Include="Images\fyf.ico" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmart.Model\BPASmart.Model.csproj" />
<ProjectReference Include="..\BPASmartClient.MessageCommunication\BPASmartClient.MessageCommunication.csproj" />
<ProjectReference Include="..\BPASmartClient.MessageName\BPASmartClient.MessageName.csproj" />
<ProjectReference Include="..\BPASmartClient.SCADAControl\BPASmartClient.SCADAControl.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="BPASmartClient.Compiler">
<HintPath>..\BPASmartClient.SCADAControl\DLL\BPASmartClient.Compiler.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Resource Include="Images\bj.png" />
<Resource Include="Images\fyf.ico" />
<Resource Include="Images\logo-pic.png" />
<Resource Include="Images\logo-Text.png" />
<Resource Include="Images\top_h.png" />
<Resource Include="Images\椭圆 22 副本 2.png" />
</ItemGroup>

</Project>

+ 0
- 32
BPASmartClient.MinimalistUI/Converters/ZoomConverter.cs Wyświetl plik

@@ -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;
}
}
}

+ 0
- 144
BPASmartClient.MinimalistUI/FControl/HBLControl.xaml Wyświetl plik

@@ -1,144 +0,0 @@
<UserControl x:Class="BPASmartClient.MinimalistUI.FControl.HBLControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.MinimalistUI.FControl"
mc:Ignorable="d"
d:DesignHeight="140" d:DesignWidth="140">
<UserControl.Resources>
<ResourceDictionary>
<LinearGradientBrush x:Key="yanjing" EndPoint="0,1">
<GradientStop Color="#CC00EAFF" Offset="0.08"></GradientStop>
<GradientStop Color="Transparent" Offset="0.08"></GradientStop>
<GradientStop Color="Transparent" Offset="0.16"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.16"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.24"></GradientStop>
<GradientStop Color="Transparent" Offset="0.24"></GradientStop>
<GradientStop Color="Transparent" Offset="0.32"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.32"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.40"></GradientStop>
<GradientStop Color="Transparent" Offset="0.40"></GradientStop>
<GradientStop Color="Transparent" Offset="0.48"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.48"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.56"></GradientStop>
<GradientStop Color="Transparent" Offset="0.56"></GradientStop>
<GradientStop Color="Transparent" Offset="0.64"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.64"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.72"></GradientStop>
<GradientStop Color="Transparent" Offset="0.72"></GradientStop>
<GradientStop Color="Transparent" Offset="0.80"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.80"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.88"></GradientStop>
<GradientStop Color="Transparent" Offset="0.88"></GradientStop>
<GradientStop Color="Transparent" Offset="0.96"></GradientStop>
<GradientStop Color="#CC00EAFF" Offset="0.96"></GradientStop>
</LinearGradientBrush>
<Storyboard x:Key="Storyboard1" RepeatBehavior="Forever">
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(LinearGradientBrush.StartPoint)"
Storyboard.TargetName="rectangle">
<EasingPointKeyFrame KeyTime="0:0:0.5" Value="0.855,0.148"/>
<EasingPointKeyFrame KeyTime="0:0:1" Value="0.852,0.855"/>
<EasingPointKeyFrame KeyTime="0:0:1.5" Value="0.148,0.855"/>
<EasingPointKeyFrame KeyTime="0:0:2" Value="0.144,0.149"/>
<EasingPointKeyFrame KeyTime="0:0:2.5" Value="0,0"/>

<EasingPointKeyFrame KeyTime="0:0:3" Value="0.855,0.148"/>
<EasingPointKeyFrame KeyTime="0:0:3.5" Value="0.852,0.855"/>
<EasingPointKeyFrame KeyTime="0:0:4" Value="0.148,0.855"/>
<EasingPointKeyFrame KeyTime="0:0:4.5" Value="0.144,0.149"/>
<EasingPointKeyFrame KeyTime="0:0:5" Value="0,0"/>

</PointAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(LinearGradientBrush.EndPoint)"
Storyboard.TargetName="rectangle">
<EasingPointKeyFrame KeyTime="0:0:0.5" Value="0.145,0.852"/>
<EasingPointKeyFrame KeyTime="0:0:1" Value="0.148,0.145"/>
<EasingPointKeyFrame KeyTime="0:0:1.5" Value="0.852,0.145"/>
<EasingPointKeyFrame KeyTime="0:0:2" Value="0.856,0.851"/>
<EasingPointKeyFrame KeyTime="0:0:2.5" Value="0,1"/>

<EasingPointKeyFrame KeyTime="0:0:3" Value="0.145,0.852"/>
<EasingPointKeyFrame KeyTime="0:0:3.5" Value="0.148,0.145"/>
<EasingPointKeyFrame KeyTime="0:0:4" Value="0.852,0.145"/>
<EasingPointKeyFrame KeyTime="0:0:4.5" Value="0.856,0.851"/>
<EasingPointKeyFrame KeyTime="0:0:5" Value="0,1"/>
</PointAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Stroke).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="00:00:02" Value="Lime"/>
<EasingColorKeyFrame KeyTime="00:00:02.5000000" Value="#FF075AFF"/>

<EasingColorKeyFrame KeyTime="00:00:4.5" Value="Lime"/>
<EasingColorKeyFrame KeyTime="00:00:5" Value="#FF075AFF"/>
</ColorAnimationUsingKeyFrames>

<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ico_map">
<EasingDoubleKeyFrame KeyTime="0:0:2.5" Value="-180"/>
<EasingDoubleKeyFrame KeyTime="0:0:5" Value="-360"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="StoryboardZY" RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="border">
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="12"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="6"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.4" Value="12"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="12"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="border1">
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="12"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="6"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.4" Value="12"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="12"/>

</DoubleAnimationUsingKeyFrames>
</Storyboard>
</ResourceDictionary>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
<BeginStoryboard Storyboard="{StaticResource StoryboardZY}"/>
</EventTrigger>
</UserControl.Triggers>
<Grid Width="100" Height="100" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20">
<Image x:Name="ico_map" Width="85" Height="85" UseLayoutRounding="True" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="HighQuality" Source="/Images/椭圆 22 副本 2.png" RenderTransformOrigin="0.5,0.5" >
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image HorizontalAlignment="Center" Margin="0,90,0,0" UseLayoutRounding="True" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="HighQuality" VerticalAlignment="Top" Width="100" Height="20" Source="/Images/top_h.png" />
<Grid x:Name="grid_xiaoboluo" Width="100" Height="100" MouseEnter="grid_MouseEnter" MouseLeave="grid_MouseLeave">
<Grid>
<Ellipse x:Name="rectangle" Width="70" Height="70" StrokeThickness="4" Fill="#FF022E50">
<Ellipse.Stroke>
<LinearGradientBrush Opacity="1">
<GradientStop Color="Transparent" Offset="0"/>
<GradientStop Color="#FF075AFF" Offset="1"/>
</LinearGradientBrush>
</Ellipse.Stroke>
</Ellipse>
<Image x:Name="ico" UseLayoutRounding="True" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="-20,25,0,0" Width="25" Height="30" Source="/Images/logo-pic.png" />
<Image Width="31.6" UseLayoutRounding="True" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="HighQuality" Height="7.9" Margin="20,0,0,25" Source="/Images/logo-Text.png" />
<TextBlock Margin="0,24,0,0" UseLayoutRounding="True" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" Foreground="#FF00EAFF" FontFamily="黑体" FontWeight="Bold">智能卓越</TextBlock>
</Grid>
<Grid x:Name="grid_celine" Visibility="Collapsed">
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Ellipse Grid.ColumnSpan="2" Width="70" Height="70" Fill="#2571ac" ></Ellipse>
<Grid x:Name="yanjing_move" Grid.ColumnSpan="2" Width="35" Height="35">
<Grid >
<Border x:Name="border1" HorizontalAlignment="Left" Grid.Column="0" Background="{DynamicResource yanjing}" CornerRadius="2" Width="8" Height="12"/>
<Border x:Name="border" HorizontalAlignment="Right" Grid.Column="1" Background="{DynamicResource yanjing}" CornerRadius="2" Width="8" Height="12"/>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>

+ 0
- 37
BPASmartClient.MinimalistUI/FControl/HBLControl.xaml.cs Wyświetl plik

@@ -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
{
/// <summary>
/// HBLControl.xaml 的交互逻辑
/// </summary>
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;
}
}
}

+ 0
- 32
BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml Wyświetl plik

@@ -1,32 +0,0 @@
<UserControl x:Class="BPASmartClient.MinimalistUI.FControl.RunCanvas"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.MinimalistUI.FControl"
xmlns:con="clr-namespace:BPASmartClient.MinimalistUI.Converters"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<con:ZoomConverter x:Key="ZoomX" IsHeight="False"/>
<con:ZoomConverter x:Key="ZoomY" IsHeight="True"/>
</UserControl.Resources>
<Grid ClipToBounds="True">
<Canvas x:Name="RootCanvas" ClipToBounds="True" Background="Transparent" MouseLeftButtonUp="RootCanvas_MouseLeftButtonUp"
MouseMove="RootCanvas_MouseMove" MouseLeftButtonDown="RootCanvas_MouseLeftButtoDown" MouseWheel="RootCanvas_MouseWheel">
<Canvas.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="Scale"/>
<TranslateTransform x:Name="Translate"/>
</TransformGroup>
</Canvas.RenderTransform>
</Canvas>

<Grid VerticalAlignment="Bottom" Background="#4B959595">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="8 0">
<CheckBox x:Name="DragEnable" Content="拖动" Margin="4"/>
<CheckBox x:Name="ZoomEnable" Content="缩放" Margin="4"/>
</StackPanel>
</Grid>
</Grid>
</UserControl>

+ 0
- 136
BPASmartClient.MinimalistUI/FControl/RunCanvas.xaml.cs Wyświetl plik

@@ -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
{
/// <summary>
/// RunCanvas.xaml 的交互逻辑
/// </summary>
public partial class RunCanvas :UserControl
{
public RunCanvas()
{
InitializeComponent();
Unloaded += (s,e) => Destory();
}

/// <summary>
/// Dispose子集
/// </summary>
public void Destory()
{
foreach (var item in RootCanvas.Children)
{
if (item is IDisposable disposable)
{
disposable.Dispose();
}
}
}

public List<EventReceiveMessage> Run(List<FrameworkElement> canvas)
{
List<EventReceiveMessage> messages = new List<EventReceiveMessage>();
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
}
}







+ 0
- 18
BPASmartClient.MinimalistUI/MainWindow.xaml Wyświetl plik

@@ -1,18 +0,0 @@
<Window x:Class="BPASmartClient.MinimalistUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BPASmartClient.MinimalistUI"
xmlns:hc="clr-namespace:BPASmartClient.SCADAControl.Converters;assembly=BPASmartClient.SCADAControl"
xmlns:ctrl="clr-namespace:BPASmartClient.MinimalistUI.FControl"
mc:Ignorable="d"
WindowState="Maximized"
Title="黑菠萝可视化软件" Height="450" Width="800" >
<Grid>
<Grid.Background>
<ImageBrush ImageSource="/Images/bj.png"/>
</Grid.Background>
<ctrl:RunCanvas x:Name="runCanvas"/>
</Grid>
</Window>

+ 0
- 65
BPASmartClient.MinimalistUI/MainWindow.xaml.cs Wyświetl plik

@@ -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
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
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");
}
/// <summary>
/// 加载数据
/// </summary>
public void LoadingData(string path)
{
//加载控件
List<FrameworkElement> Children = new List<FrameworkElement>();
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);
}

}
}
}


+ 2
- 1
BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj Wyświetl plik

@@ -41,12 +41,13 @@
<ItemGroup>
<PackageReference Include="AvalonEdit" Version="6.1.3.50" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
<PackageReference Include="MQTTnet" Version="3.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="StackExchange.Redis" Version="2.6.66" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmart.Model\BPASmart.Model.csproj" />
<ProjectReference Include="..\BPASmartClient.Compiler\BPASmartClient.Compiler.csproj" />
<ProjectReference Include="..\BPASmartClient.DATABUS\BPASmartClient.DATABUS.csproj" />
<ProjectReference Include="..\BPASmartClient.MessageCommunication\BPASmartClient.MessageCommunication.csproj" />
<ProjectReference Include="..\BPASmartClient.MessageName\BPASmartClient.MessageName.csproj" />


+ 30
- 0
BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs Wyświetl plik

@@ -223,6 +223,36 @@ namespace BeDesignerSCADA.Controls
}
}
/// <summary>
/// 运行程序
/// </summary>
public void Run()
{
try
{
cav.ClearSelection();
runCanvas.Run(cav.Generator());
}
catch (Exception ex)
{

}
}
/// <summary>
/// 停止运行程序
/// </summary>
public void Destory()
{
try
{
runCanvas.Destory();
}
catch (Exception ex)
{

throw;
}
}
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>


+ 27
- 0
BeDesignerSCADA/Controls/RunCanvas.xaml.cs Wyświetl plik

@@ -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
{
/// <summary>
/// 运行控件
/// RunCanvas.xaml 的交互逻辑
/// </summary>
public partial class RunCanvas : UserControl
@@ -42,6 +45,30 @@ namespace BeDesignerSCADA.Controls
}
}

/// <summary>
/// 加载数据
/// </summary>
public void LoadingData(string path)
{
//加载控件
List<FrameworkElement> Children = new List<FrameworkElement>();
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<FrameworkElement> canvas)
{
RootCanvas.Children.Clear();


+ 3
- 29
SmartClient.sln Wyświetl plik

@@ -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}


Ładowanie…
Anuluj
Zapisz