Quellcode durchsuchen

更新组态控件

样式分支
fyf vor 2 Jahren
Ursprung
Commit
d9b2268ae1
7 geänderte Dateien mit 77 neuen und 15 gelöschten Zeilen
  1. +22
    -0
      BPASmartClient.Compiler/BPASmartClient.Compiler.csproj
  2. +22
    -9
      BPASmartClient.Compiler/Config.cs
  3. +0
    -0
      BPASmartClient.Compiler/DLL/Antlr3.Runtime.dll
  4. +0
    -0
      BPASmartClient.Compiler/DLL/Unvell.ReoScript.dll
  5. +4
    -0
      BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj
  6. +3
    -3
      BPASmartClient.SCADAControl/SwitchButton.cs
  7. +26
    -3
      SmartClient.sln

+ 22
- 0
BPASmartClient.Compiler/BPASmartClient.Compiler.csproj Datei anzeigen

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

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Folder Include="Hepler\" />
</ItemGroup>

<ItemGroup>
<Reference Include="Antlr3.Runtime">
<HintPath>DLL\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="Unvell.ReoScript">
<HintPath>DLL\Unvell.ReoScript.dll</HintPath>
</Reference>
</ItemGroup>

</Project>

BPASmartClient.SCADAControl/Hepler/Config.cs → BPASmartClient.Compiler/Config.cs Datei anzeigen

@@ -6,13 +6,26 @@ using System.Threading.Tasks;
using System.Windows;
using Unvell.ReoScript;

namespace BPASmartClient.SCADAControl.Hepler
namespace BPASmartClient.Compiler
{
public class Config
{
private static ScriptRunningMachine srm { get; } = new ScriptRunningMachine();
#region 单例模式
public static Config Instance = null;

static Config()
public static Config GetInstance()
{
if (Instance == null)
{
Instance = new Config();
}
return Instance;
}
#endregion

public static ScriptRunningMachine srm { get; } = new ScriptRunningMachine();

public Config()
{
srm.WorkMode |=
// Enable DirectAccess
@@ -29,7 +42,7 @@ namespace BPASmartClient.SCADAControl.Hepler
/// 运行脚本
/// </summary>
/// <param name="script"></param>
public static void RunJsScipt(string script)
public void RunJsScipt(string script)
{
try
{
@@ -37,14 +50,14 @@ namespace BPASmartClient.SCADAControl.Hepler
}
catch (Exception e)
{
MessageBox.Show(e.Message, "脚本错误");
//MessageBox.Show(e.Message, "脚本错误");
}
}

/// <summary>
/// 注册对象到js
/// </summary>
public static void SetVariable(string name, object obj)
public void SetVariable(string name, object obj)
{
srm.SetGlobalVariable(name, obj);
}
@@ -62,15 +75,15 @@ namespace BPASmartClient.SCADAControl.Hepler
sb.Append(item.ToString());
}

MessageBox.Show($"{sb}", "提示");
//MessageBox.Show($"{sb}", "提示");
return null;
});

srm["SetICDValue"] = new NativeFunctionObject("SetICDValue", (ctx, owner, args) =>
{
MessageBox.Show($"发送ICD数据", "提示");
//MessageBox.Show($"发送ICD数据", "提示");
return null;
});
}
}
}
}

BPASmartClient.SCADAControl/DLL/Antlr3.Runtime.dll → BPASmartClient.Compiler/DLL/Antlr3.Runtime.dll Datei anzeigen


BPASmartClient.SCADAControl/DLL/Unvell.ReoScript.dll → BPASmartClient.Compiler/DLL/Unvell.ReoScript.dll Datei anzeigen


+ 4
- 0
BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj Datei anzeigen

@@ -10,6 +10,10 @@
<None Remove="Images\光柱.png" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.Compiler\BPASmartClient.Compiler.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="Antlr3.Runtime">
<HintPath>DLL\Antlr3.Runtime.dll</HintPath>


+ 3
- 3
BPASmartClient.SCADAControl/SwitchButton.cs Datei anzeigen

@@ -1,4 +1,4 @@
using BPASmartClient.SCADAControl.Hepler;
using BPASmartClient.Compiler;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -131,12 +131,12 @@ namespace BPASmartClient.SCADAControl
}
private void TheCheckBox_Unchecked(object sender, RoutedEventArgs e)
{
Config.RunJsScipt(UnCheckedExec);
Config.GetInstance().RunJsScipt(UnCheckedExec);
}

private void TheCheckBox_Checked(object sender, RoutedEventArgs e)
{
Config.RunJsScipt(CheckedExec);
Config.GetInstance().RunJsScipt(CheckedExec);
}
public string ControlType => "控件";



+ 26
- 3
SmartClient.sln Datei anzeigen

@@ -136,11 +136,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFDemo", "WPFDemo\WPFDemo.
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0.SCADA", "0.SCADA", "{7B0175AD-BB74-4A98-B9A7-1E289032485E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MessageName", "BPASmartClient.MessageName\BPASmartClient.MessageName.csproj", "{0D769B3B-0332-4DB9-A657-B739EDB28567}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MessageName", "BPASmartClient.MessageName\BPASmartClient.MessageName.csproj", "{0D769B3B-0332-4DB9-A657-B739EDB28567}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.DATABUS", "BPASmartClient.DATABUS\BPASmartClient.DATABUS.csproj", "{7C1AF86E-867C-427E-90DB-6473D88F51EB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DATABUS", "BPASmartClient.DATABUS\BPASmartClient.DATABUS.csproj", "{7C1AF86E-867C-427E-90DB-6473D88F51EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.SCADAControl", "BPASmartClient.SCADAControl\BPASmartClient.SCADAControl.csproj", "{6A3FC66D-0B89-45E8-B39B-9D81538002D1}"
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}"
EndProject
@@ -148,6 +148,8 @@ 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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1362,6 +1364,26 @@ Global
{6A3FC66D-0B89-45E8-B39B-9D81538002D1}.Release|x64.Build.0 = Release|Any CPU
{6A3FC66D-0B89-45E8-B39B-9D81538002D1}.Release|x86.ActiveCfg = Release|Any CPU
{6A3FC66D-0B89-45E8-B39B-9D81538002D1}.Release|x86.Build.0 = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|ARM.ActiveCfg = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|ARM.Build.0 = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|ARM64.Build.0 = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|x64.ActiveCfg = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|x64.Build.0 = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|x86.ActiveCfg = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Debug|x86.Build.0 = Debug|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|Any CPU.Build.0 = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|ARM.ActiveCfg = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|ARM.Build.0 = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|ARM64.ActiveCfg = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|ARM64.Build.0 = Release|Any CPU
{B6213013-2A0E-41DD-BA9F-775D53C19374}.Release|x64.ActiveCfg = Release|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1430,6 +1452,7 @@ Global
{7BED8969-7EA7-409C-8BBC-D2777ECDA2F1} = {7B0175AD-BB74-4A98-B9A7-1E289032485E}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


Laden…
Abbrechen
Speichern