├── .gitattributes ├── .gitignore ├── Imgs ├── NodeSettings.png ├── NodeView.png ├── OpcUaServer.png ├── RedisServer.png ├── SampleServer.png └── SimplifyView.png ├── LICENSE ├── README.md ├── SharpNodeSettings.NodeView ├── App.config ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── SharpNodeSettings.NodeView.csproj ├── SharpNodeSettings.OpcUaServer ├── App.config ├── App.ico ├── Namespaces.cs ├── Opc.Ua.CertificateGenerator.exe ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ReferenceNodeManager.cs ├── ReferenceServer.cs ├── ReferenceServerConfiguration.cs ├── ReferenceServerUtils.cs ├── SharpNodeSettings.OpcUaServer.csproj ├── SharpNodeSettingsServer.Config.xml └── packages.config ├── SharpNodeSettings.RedisServer ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── SharpNodeSettings.RedisServer.csproj └── packages.config ├── SharpNodeSettings.SampleServer ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── SharpNodeSettings.SampleServer.csproj ├── SharpNodeSettings.Tools ├── App.config ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── SharpNodeSettings.Tools.csproj └── packages.config ├── SharpNodeSettings.sln ├── SharpNodeSettings ├── Controls │ └── TreeViewEx.cs ├── Core │ └── SharpNodeServer.cs ├── Device │ ├── DeviceCore.cs │ ├── DeviceMelsecMc.cs │ ├── DeviceModbusTcp.cs │ ├── DeviceModbusTcpAlien.cs │ ├── DeviceOmron.cs │ └── DeviceSiemens.cs ├── Forms │ ├── FormAlienNode.cs │ ├── FormAlienNode.designer.cs │ ├── FormAlienNode.resx │ ├── FormEmpty.cs │ ├── FormEmpty.designer.cs │ ├── FormEmpty.resx │ ├── FormMelsec3E.cs │ ├── FormMelsec3E.designer.cs │ ├── FormMelsec3E.resx │ ├── FormModbusServer.cs │ ├── FormModbusServer.designer.cs │ ├── FormModbusServer.resx │ ├── FormModbusTcp.cs │ ├── FormModbusTcp.designer.cs │ ├── FormModbusTcp.resx │ ├── FormModbusTcpAlien.cs │ ├── FormModbusTcpAlien.designer.cs │ ├── FormModbusTcpAlien.resx │ ├── FormNodeClass.cs │ ├── FormNodeClass.designer.cs │ ├── FormNodeClass.resx │ ├── FormOmron.cs │ ├── FormOmron.designer.cs │ ├── FormOmron.resx │ ├── FormRegularItemNode.cs │ ├── FormRegularItemNode.designer.cs │ ├── FormRegularItemNode.resx │ ├── FormRegularNode.cs │ ├── FormRegularNode.designer.cs │ ├── FormRegularNode.resx │ ├── FormRequest.cs │ ├── FormRequest.designer.cs │ ├── FormRequest.resx │ ├── FormSiemens.cs │ ├── FormSiemens.designer.cs │ └── FormSiemens.resx ├── Imgs │ ├── ASCube_16xLG.png │ ├── ClassIcon.png │ ├── Class_489.png │ ├── Enum_582.png │ ├── Event_594.png │ ├── Event_594_exp.png │ ├── ExtensionManager_vsix.png │ ├── FieldsHeader_12x.png │ ├── FlagRed_16x.png │ ├── FlagSpace_16x.png │ ├── GenericVSEditor_9905.png │ ├── HotSpot_10548.png │ ├── HotSpot_10548_color.png │ ├── Method_636.png │ ├── Module_648.png │ ├── Monitor_Screen_16xLG.png │ ├── Operator_660.png │ ├── PencilAngled_16xLG.png │ ├── PencilAngled_16xLG_color.png │ ├── Property_501.png │ ├── VirtualMachine_16xLG.png │ ├── WindowsAzure_16xLG.png │ ├── WindowsAzure_16xLG_Cyan.png │ ├── abstr1.png │ ├── action_Cancel_16xLG.png │ ├── action_add_16xLG.png │ ├── arrow_open_16xLG.png │ ├── envelope_16xLG.png │ ├── flag_16xLG.png │ ├── interface_16xLG.png │ ├── library_16xLG.png │ ├── save_16xLG.png │ ├── server_Local_16xLG.png │ ├── star_16xLG.png │ ├── usbcontroller.png │ └── xbox1Color_16x.png ├── Node │ ├── Device │ │ ├── DeviceNode.cs │ │ ├── NodeEmpty.cs │ │ ├── NodeMelsecMc.cs │ │ ├── NodeModbusTcpAline.cs │ │ ├── NodeModbusTcpClient.cs │ │ ├── NodeOmron.cs │ │ ├── NodeSiemens.cs │ │ └── NodeSimplifyNet.cs │ ├── NodeBase │ │ ├── IXmlConvert.cs │ │ ├── NodeClass.cs │ │ ├── NodeClassInfo.cs │ │ └── NodeClassRenderItem.cs │ ├── Regular │ │ ├── RegularItemNode.cs │ │ ├── RegularNode.cs │ │ └── RegularNodeTypeItem.cs │ ├── Request │ │ └── DeviceRequest.cs │ └── Server │ │ ├── AlienServerNode.cs │ │ ├── NodeModbusServer.cs │ │ └── ServerNode.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── SharpNodeSettings.csproj ├── Util.cs ├── View │ ├── FormNodeSetting.cs │ ├── FormNodeSetting.designer.cs │ ├── FormNodeSetting.resx │ ├── FormNodeView.Designer.cs │ ├── FormNodeView.cs │ ├── FormNodeView.resx │ ├── FormSelectDevice.Designer.cs │ ├── FormSelectDevice.cs │ └── FormSelectDevice.resx └── packages.config ├── XmlFile ├── HslCommunication.dll ├── Newtonsoft.Json.dll ├── SharpNodeSettings.Tools.exe ├── SharpNodeSettings.dll └── settings.xml └── dll ├── BouncyCastle.Crypto.dll ├── Microsoft.AspNetCore.Hosting.Abstractions.dll ├── Microsoft.AspNetCore.Hosting.Server.Abstractions.dll ├── Microsoft.AspNetCore.Hosting.dll ├── Microsoft.AspNetCore.Http.Abstractions.dll ├── Microsoft.AspNetCore.Http.Features.dll ├── Microsoft.AspNetCore.Http.dll ├── Microsoft.AspNetCore.Server.Kestrel.Https.dll ├── Microsoft.AspNetCore.Server.Kestrel.dll ├── Microsoft.AspNetCore.WebUtilities.dll ├── Microsoft.Extensions.Configuration.Abstractions.dll ├── Microsoft.Extensions.Configuration.EnvironmentVariables.dll ├── Microsoft.Extensions.Configuration.dll ├── Microsoft.Extensions.DependencyInjection.Abstractions.dll ├── Microsoft.Extensions.DependencyInjection.dll ├── Microsoft.Extensions.FileProviders.Abstractions.dll ├── Microsoft.Extensions.FileProviders.Physical.dll ├── Microsoft.Extensions.FileSystemGlobbing.dll ├── Microsoft.Extensions.Logging.Abstractions.dll ├── Microsoft.Extensions.Logging.dll ├── Microsoft.Extensions.ObjectPool.dll ├── Microsoft.Extensions.Options.dll ├── Microsoft.Extensions.PlatformAbstractions.dll ├── Microsoft.Extensions.Primitives.dll ├── Microsoft.Net.Http.Headers.dll ├── Newtonsoft.Json.dll ├── Opc.Ua.CertificateGenerator.exe ├── Opc.Ua.Configuration.dll ├── Opc.Ua.Core.dll ├── Opc.Ua.Server.dll ├── Opc.Ua.ServerControls.dll ├── System.Buffers.dll ├── System.Collections.Immutable.dll ├── System.Diagnostics.DiagnosticSource.dll ├── System.Net.Http.dll ├── System.Numerics.Vectors.dll ├── System.Reflection.Metadata.dll ├── System.Runtime.CompilerServices.Unsafe.dll ├── System.Runtime.InteropServices.RuntimeInformation.dll ├── System.Text.Encodings.Web.dll └── System.Threading.Tasks.Extensions.dll /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /Imgs/NodeSettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/Imgs/NodeSettings.png -------------------------------------------------------------------------------- /Imgs/NodeView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/Imgs/NodeView.png -------------------------------------------------------------------------------- /Imgs/OpcUaServer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/Imgs/OpcUaServer.png -------------------------------------------------------------------------------- /Imgs/RedisServer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/Imgs/RedisServer.png -------------------------------------------------------------------------------- /Imgs/SampleServer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/Imgs/SampleServer.png -------------------------------------------------------------------------------- /Imgs/SimplifyView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/Imgs/SimplifyView.png -------------------------------------------------------------------------------- /SharpNodeSettings.NodeView/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SharpNodeSettings.NodeView/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace SharpNodeSettings.NodeView 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main( ) 16 | { 17 | Application.EnableVisualStyles( ); 18 | Application.SetCompatibleTextRenderingDefault( false ); 19 | Application.Run( new SharpNodeSettings.View.FormNodeView( "127.0.0.1",12345 ) ); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SharpNodeSettings.NodeView/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle( "SharpNodeSettings.NodeView" )] 9 | [assembly: AssemblyDescription( "" )] 10 | [assembly: AssemblyConfiguration( "" )] 11 | [assembly: AssemblyCompany( "" )] 12 | [assembly: AssemblyProduct( "SharpNodeSettings.NodeView" )] 13 | [assembly: AssemblyCopyright( "Copyright © 2018" )] 14 | [assembly: AssemblyTrademark( "" )] 15 | [assembly: AssemblyCulture( "" )] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible( false )] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid( "545139f0-8040-4de2-99c2-55e82f952b16" )] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion( "1.0.0.0" )] 36 | [assembly: AssemblyFileVersion( "1.0.0.0" )] 37 | -------------------------------------------------------------------------------- /SharpNodeSettings.NodeView/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SharpNodeSettings.NodeView.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0" )] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute( )] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute( )] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( "Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode" )] 33 | internal Resources( ) 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager( "SharpNodeSettings.NodeView.Properties.Resources", typeof( Resources ).Assembly ); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /SharpNodeSettings.NodeView/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SharpNodeSettings.NodeView.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute( )] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0" )] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized( new Settings( ) ))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SharpNodeSettings.NodeView/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SharpNodeSettings.NodeView/SharpNodeSettings.NodeView.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {545139F0-8040-4DE2-99C2-55E82F952B16} 8 | WinExe 9 | SharpNodeSettings.NodeView 10 | SharpNodeSettings.NodeView 11 | v4.5.1 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\SharpNodeSettings\bin\Debug\SharpNodeSettings.dll 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | ResXFileCodeGenerator 55 | Resources.Designer.cs 56 | Designer 57 | 58 | 59 | True 60 | Resources.resx 61 | 62 | 63 | SettingsSingleFileGenerator 64 | Settings.Designer.cs 65 | 66 | 67 | True 68 | Settings.settings 69 | True 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/App.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings.OpcUaServer/App.ico -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/Namespaces.cs: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Copyright (c) 2005-2016 The OPC Foundation, Inc. All rights reserved. 3 | * 4 | * OPC Foundation MIT License 1.00 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | * 26 | * The complete license agreement can be found here: 27 | * http://opcfoundation.org/License/MIT/1.00/ 28 | * ======================================================================*/ 29 | 30 | using System; 31 | using System.Collections.Generic; 32 | using System.Text; 33 | 34 | namespace SharpNodeSettings.OpcUaServer 35 | { 36 | /// 37 | /// Defines constants for namespaces used by the application. 38 | /// 39 | public static partial class Namespaces 40 | { 41 | /// 42 | /// The namespace for the nodes provided by the server. 43 | /// 44 | public const string ReferenceApplications = "http://opcfoundation.org/Quickstarts/ReferenceApplications"; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/Opc.Ua.CertificateGenerator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings.OpcUaServer/Opc.Ua.CertificateGenerator.exe -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using Opc.Ua; 7 | using Opc.Ua.Configuration; 8 | using Opc.Ua.Server.Controls; 9 | 10 | namespace SharpNodeSettings.OpcUaServer 11 | { 12 | static class Program 13 | { 14 | /// 15 | /// 应用程序的主入口点。 16 | /// 17 | [STAThread] 18 | static void Main( ) 19 | { 20 | // Initialize the user interface. 21 | Application.EnableVisualStyles( ); 22 | Application.SetCompatibleTextRenderingDefault( false ); 23 | 24 | ApplicationInstance.MessageDlg = new ApplicationMessageDlg( ); 25 | ApplicationInstance application = new ApplicationInstance( ); 26 | application.ApplicationType = ApplicationType.Server; 27 | application.ConfigSectionName = "SharpNodeSettingsServer"; 28 | 29 | try 30 | { 31 | 32 | // load the application configuration. 33 | application.LoadApplicationConfiguration( false ).Wait( ); 34 | 35 | // check the application certificate. 36 | bool certOk = application.CheckApplicationInstanceCertificate( false, 0 ).Result; 37 | if (!certOk) 38 | { 39 | throw new Exception( "Application instance certificate invalid!" ); 40 | } 41 | 42 | // start the server. 43 | application.Start( new SharpNodeSettingsServer( ) ).Wait( ); 44 | 45 | // run the application interactively. 46 | ServerForm serverForm = new ServerForm( application ); 47 | serverForm.StartPosition = FormStartPosition.CenterScreen; 48 | Application.Run( serverForm ); 49 | } 50 | catch (Exception e) 51 | { 52 | ExceptionDlg.Show( application.ApplicationName, e ); 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle( "SharpNodeSettings.OpcUaServer" )] 9 | [assembly: AssemblyDescription( "" )] 10 | [assembly: AssemblyConfiguration( "" )] 11 | [assembly: AssemblyCompany( "" )] 12 | [assembly: AssemblyProduct( "SharpNodeSettings.OpcUaServer" )] 13 | [assembly: AssemblyCopyright( "Copyright © 2018" )] 14 | [assembly: AssemblyTrademark( "" )] 15 | [assembly: AssemblyCulture( "" )] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible( false )] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid( "aaaf93b6-ae66-486e-a46f-160f1b9dcad0" )] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion( "1.0.0.0" )] 36 | [assembly: AssemblyFileVersion( "1.0.0.0" )] 37 | -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SharpNodeSettings.OpcUaServer.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0" )] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute( )] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute( )] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( "Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode" )] 33 | internal Resources( ) 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager( "SharpNodeSettings.OpcUaServer.Properties.Resources", typeof( Resources ).Assembly ); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SharpNodeSettings.OpcUaServer.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute( )] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0" )] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized( new Settings( ) ))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SharpNodeSettings.OpcUaServer/ReferenceServerConfiguration.cs: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Copyright (c) 2005-2016 The OPC Foundation, Inc. All rights reserved. 3 | * 4 | * OPC Foundation MIT License 1.00 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | * 26 | * The complete license agreement can be found here: 27 | * http://opcfoundation.org/License/MIT/1.00/ 28 | * ======================================================================*/ 29 | 30 | using System; 31 | using System.ServiceModel; 32 | using System.Runtime.Serialization; 33 | using System.Collections.Generic; 34 | using Opc.Ua.Server; 35 | 36 | namespace SharpNodeSettings.OpcUaServer 37 | { 38 | /// 39 | /// Stores the configuration the data access node manager. 40 | /// 41 | [DataContract(Namespace=Namespaces.ReferenceApplications)] 42 | public class ReferenceServerConfiguration 43 | { 44 | #region Constructors 45 | /// 46 | /// The default constructor. 47 | /// 48 | public ReferenceServerConfiguration() 49 | { 50 | Initialize(); 51 | } 52 | 53 | /// 54 | /// Initializes the object during deserialization. 55 | /// 56 | [OnDeserializing()] 57 | private void Initialize(StreamingContext context) 58 | { 59 | Initialize(); 60 | } 61 | 62 | /// 63 | /// Sets private members to default values. 64 | /// 65 | private void Initialize() 66 | { 67 | } 68 | #endregion 69 | 70 | #region Public Properties 71 | #endregion 72 | 73 | #region Private Members 74 | #endregion 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /SharpNodeSettings.RedisServer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SharpNodeSettings.RedisServer/Program.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Core; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using HslCommunication.LogNet; 8 | using HslCommunication.Enthernet.Redis; 9 | using HslCommunication; 10 | 11 | /***************************************************************************************************************** 12 | * 13 | * 说明:本示例的作用是根据配置文件信息,生成设备数据,所有的设备数据将会被写入到Redis中 14 | * 15 | * 前提:您需要在您的电脑上安装Redis,Redis服务器的下载地址为:https://github.com/MicrosoftArchive/redis/releases 16 | * 如果没有可使用的redis服务器,请换个项目运行,运行 SampleServer 项目或是OPC UA项目 17 | * 18 | *****************************************************************************************************************/ 19 | 20 | 21 | 22 | 23 | namespace SharpNodeSettings.RedisServer 24 | { 25 | class Program 26 | { 27 | static void Main( string[] args ) 28 | { 29 | // 创建Redis 30 | RedisClient redis = new RedisClient( "127.0.0.1", 6379, "" ); 31 | redis.SetPersistentConnection( ); // 设置长连接 32 | 33 | // 创建日志 34 | ILogNet logNet = new LogNetSingle( "log.txt" ); 35 | logNet.BeforeSaveToFile += LogNet_BeforeSaveToFile; 36 | 37 | SharpNodeServer sharpNodeServer = new SharpNodeServer( ); 38 | sharpNodeServer.LogNet = logNet; 39 | sharpNodeServer.WriteCustomerData = ( Device.DeviceCore deviceCore, string name ) => 40 | { 41 | OperateResult write = redis.WriteKey( string.Join( ":", deviceCore.DeviceNodes ) + ":" + name, deviceCore.GetStringValueByName( name ) ); 42 | if (!write.IsSuccess) 43 | { 44 | Console.WriteLine( "Redis Write Failed" ); 45 | } 46 | }; 47 | // 加载配置文件之前设置redis写入方法 48 | sharpNodeServer.LoadByXmlFile( "settings.xml" ); 49 | sharpNodeServer.ServerStart( 12345 ); 50 | 51 | Console.ReadLine( ); 52 | } 53 | 54 | private static void LogNet_BeforeSaveToFile( object sender, HslEventArgs e ) 55 | { 56 | Console.WriteLine( e.HslMessage.ToString( ) ); 57 | } 58 | 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /SharpNodeSettings.RedisServer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle( "SharpNodeSettings.RedisServer" )] 9 | [assembly: AssemblyDescription( "" )] 10 | [assembly: AssemblyConfiguration( "" )] 11 | [assembly: AssemblyCompany( "" )] 12 | [assembly: AssemblyProduct( "SharpNodeSettings.RedisServer" )] 13 | [assembly: AssemblyCopyright( "Copyright © 2018" )] 14 | [assembly: AssemblyTrademark( "" )] 15 | [assembly: AssemblyCulture( "" )] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible( false )] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid( "7295d5a1-d38a-4ba2-83b9-6d39b5e0b8cd" )] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion( "1.0.0.0" )] 36 | [assembly: AssemblyFileVersion( "1.0.0.0" )] 37 | -------------------------------------------------------------------------------- /SharpNodeSettings.RedisServer/SharpNodeSettings.RedisServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {7295D5A1-D38A-4BA2-83B9-6D39B5E0B8CD} 8 | Exe 9 | SharpNodeSettings.RedisServer 10 | SharpNodeSettings.RedisServer 11 | v4.5.1 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\packages\HslCommunication.6.0.0\lib\net451\HslCommunication.dll 37 | 38 | 39 | ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll 40 | 41 | 42 | ..\SharpNodeSettings\bin\Debug\SharpNodeSettings.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | settings.xml 65 | Always 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /SharpNodeSettings.RedisServer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SharpNodeSettings.SampleServer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SharpNodeSettings.SampleServer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using HslCommunication.LogNet; 8 | using SharpNodeSettings.Core; 9 | 10 | 11 | namespace SharpNodeSettings.SampleServer 12 | { 13 | class Program 14 | { 15 | static void Main( string[] args ) 16 | { 17 | // 创建日志 18 | ILogNet logNet = new LogNetSingle( "log.txt" ); 19 | logNet.BeforeSaveToFile += LogNet_BeforeSaveToFile; 20 | 21 | SharpNodeServer sharpNodeServer = new SharpNodeServer( ); 22 | sharpNodeServer.LogNet = logNet; 23 | sharpNodeServer.LoadByXmlFile( "settings.xml" ); 24 | sharpNodeServer.ServerStart( 12345 ); 25 | 26 | 27 | Console.ReadLine( ); 28 | } 29 | 30 | private static void LogNet_BeforeSaveToFile( object sender, HslEventArgs e ) 31 | { 32 | Console.WriteLine( e.HslMessage.ToString( ) ); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SharpNodeSettings.SampleServer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle( "SharpNodeSettings.SampleServer" )] 9 | [assembly: AssemblyDescription( "" )] 10 | [assembly: AssemblyConfiguration( "" )] 11 | [assembly: AssemblyCompany( "" )] 12 | [assembly: AssemblyProduct( "SharpNodeSettings.SampleServer" )] 13 | [assembly: AssemblyCopyright( "Copyright © 2018" )] 14 | [assembly: AssemblyTrademark( "" )] 15 | [assembly: AssemblyCulture( "" )] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible( false )] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid( "1bc2c814-e8a4-4a7a-885f-fa39aa2ba4d9" )] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion( "1.0.0.0" )] 36 | [assembly: AssemblyFileVersion( "1.0.0.0" )] 37 | -------------------------------------------------------------------------------- /SharpNodeSettings.SampleServer/SharpNodeSettings.SampleServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1BC2C814-E8A4-4A7A-885F-FA39AA2BA4D9} 8 | Exe 9 | SharpNodeSettings.SampleServer 10 | SharpNodeSettings.SampleServer 11 | v4.5.1 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | False 37 | ..\SharpNodeSettings\bin\Debug\HslCommunication.dll 38 | 39 | 40 | ..\SharpNodeSettings\bin\Debug\SharpNodeSettings.dll 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | settings.xml 61 | Always 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/Program.cs: -------------------------------------------------------------------------------- 1 | #define File 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | using System.Xml.Linq; 8 | 9 | 10 | namespace SharpNodeSettings.Tools 11 | { 12 | static class Program 13 | { 14 | /// 15 | /// 应用程序的主入口点。 16 | /// 17 | [STAThread] 18 | static void Main( ) 19 | { 20 | Application.EnableVisualStyles( ); 21 | Application.SetCompatibleTextRenderingDefault( false ); 22 | 23 | #if File 24 | // 从文件启动 25 | Application.Run( new SharpNodeSettings.View.FormNodeSetting( "settings.xml" ) ); 26 | 27 | #else 28 | // 下面的代码 29 | using(SharpNodeSettings.View.FormNodeSetting form = new SharpNodeSettings.View.FormNodeSetting( XElement.Load( "settings.xml" ) )) 30 | { 31 | if (form.ShowDialog( ) == DialogResult.OK) 32 | { 33 | // 配置好的数据信息,在这种方式下可以实现远程配置的操作。 34 | XElement xElement = form.XmlSettings; 35 | MessageBox.Show( "success" ); 36 | } 37 | else 38 | { 39 | MessageBox.Show( "failed" ); 40 | } 41 | } 42 | Application.Exit( ); 43 | #endif 44 | //SharpNodeSettings.View.FormSelectDevice selectDevice = new View.FormSelectDevice( ); 45 | //if (selectDevice.ShowDialog( ) == DialogResult.OK) 46 | //{ 47 | // XElement xmlDevice = selectDevice.DeviceXml; 48 | // // 设备的配置对象可用于存储,网络传输等等操作 49 | 50 | 51 | // // 如果想要通过xml信息创建设备 52 | // SharpNodeSettings.Device.DeviceCore deviceCore = SharpNodeSettings.Util.CreateFromXElement( xmlDevice ); 53 | // // 演示读取数据,此处有个问题在于如果是相同种类的PLC,应用还是很方便的,如果是不同种类的,地址模型就比较麻烦。 54 | // HslCommunication.OperateResult read = deviceCore.ReadWriteDevice.ReadInt16( "D100" ); 55 | //} 56 | 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle( "SharpNodeSettings.Tools" )] 9 | [assembly: AssemblyDescription( "" )] 10 | [assembly: AssemblyConfiguration( "" )] 11 | [assembly: AssemblyCompany( "" )] 12 | [assembly: AssemblyProduct( "SharpNodeSettings.Tools" )] 13 | [assembly: AssemblyCopyright( "Copyright © 2018" )] 14 | [assembly: AssemblyTrademark( "" )] 15 | [assembly: AssemblyCulture( "" )] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible( false )] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid( "6e8a5429-f219-4dc2-b950-f20f49c99b78" )] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion( "1.0.0.0" )] 36 | [assembly: AssemblyFileVersion( "1.0.0.0" )] 37 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SharpNodeSettings.Tools.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0" )] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute( )] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute( )] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( "Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode" )] 33 | internal Resources( ) 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager( "SharpNodeSettings.Tools.Properties.Resources", typeof( Resources ).Assembly ); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SharpNodeSettings.Tools.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute( )] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0" )] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized( new Settings( ) ))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/SharpNodeSettings.Tools.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {6E8A5429-F219-4DC2-B950-F20F49C99B78} 8 | WinExe 9 | SharpNodeSettings.Tools 10 | SharpNodeSettings.Tools 11 | v4.5.1 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\packages\HslCommunication.6.0.0\lib\net451\HslCommunication.dll 37 | 38 | 39 | ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll 40 | 41 | 42 | ..\SharpNodeSettings\bin\Debug\SharpNodeSettings.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | ResXFileCodeGenerator 61 | Resources.Designer.cs 62 | Designer 63 | 64 | 65 | True 66 | Resources.resx 67 | 68 | 69 | 70 | SettingsSingleFileGenerator 71 | Settings.Designer.cs 72 | 73 | 74 | True 75 | Settings.settings 76 | True 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | settings.xml 85 | Always 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /SharpNodeSettings.Tools/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SharpNodeSettings.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2042 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNodeSettings", "SharpNodeSettings\SharpNodeSettings.csproj", "{3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNodeSettings.Tools", "SharpNodeSettings.Tools\SharpNodeSettings.Tools.csproj", "{6E8A5429-F219-4DC2-B950-F20F49C99B78}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} = {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} 11 | EndProjectSection 12 | EndProject 13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNodeSettings.SampleServer", "SharpNodeSettings.SampleServer\SharpNodeSettings.SampleServer.csproj", "{1BC2C814-E8A4-4A7A-885F-FA39AA2BA4D9}" 14 | ProjectSection(ProjectDependencies) = postProject 15 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} = {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} 16 | EndProjectSection 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNodeSettings.NodeView", "SharpNodeSettings.NodeView\SharpNodeSettings.NodeView.csproj", "{545139F0-8040-4DE2-99C2-55E82F952B16}" 19 | ProjectSection(ProjectDependencies) = postProject 20 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} = {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} 21 | EndProjectSection 22 | EndProject 23 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNodeSettings.RedisServer", "SharpNodeSettings.RedisServer\SharpNodeSettings.RedisServer.csproj", "{7295D5A1-D38A-4BA2-83B9-6D39B5E0B8CD}" 24 | ProjectSection(ProjectDependencies) = postProject 25 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} = {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} 26 | EndProjectSection 27 | EndProject 28 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNodeSettings.OpcUaServer", "SharpNodeSettings.OpcUaServer\SharpNodeSettings.OpcUaServer.csproj", "{AAAF93B6-AE66-486E-A46F-160F1B9DCAD0}" 29 | ProjectSection(ProjectDependencies) = postProject 30 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} = {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D} 31 | EndProjectSection 32 | EndProject 33 | Global 34 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 35 | Debug|Any CPU = Debug|Any CPU 36 | Release|Any CPU = Release|Any CPU 37 | EndGlobalSection 38 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 39 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 40 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D}.Debug|Any CPU.Build.0 = Debug|Any CPU 41 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 | {3CB75AE4-7129-4B65-9DC2-8E8C0264DB0D}.Release|Any CPU.Build.0 = Release|Any CPU 43 | {6E8A5429-F219-4DC2-B950-F20F49C99B78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 44 | {6E8A5429-F219-4DC2-B950-F20F49C99B78}.Debug|Any CPU.Build.0 = Debug|Any CPU 45 | {6E8A5429-F219-4DC2-B950-F20F49C99B78}.Release|Any CPU.ActiveCfg = Release|Any CPU 46 | {6E8A5429-F219-4DC2-B950-F20F49C99B78}.Release|Any CPU.Build.0 = Release|Any CPU 47 | {1BC2C814-E8A4-4A7A-885F-FA39AA2BA4D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 48 | {1BC2C814-E8A4-4A7A-885F-FA39AA2BA4D9}.Debug|Any CPU.Build.0 = Debug|Any CPU 49 | {1BC2C814-E8A4-4A7A-885F-FA39AA2BA4D9}.Release|Any CPU.ActiveCfg = Release|Any CPU 50 | {1BC2C814-E8A4-4A7A-885F-FA39AA2BA4D9}.Release|Any CPU.Build.0 = Release|Any CPU 51 | {545139F0-8040-4DE2-99C2-55E82F952B16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 52 | {545139F0-8040-4DE2-99C2-55E82F952B16}.Debug|Any CPU.Build.0 = Debug|Any CPU 53 | {545139F0-8040-4DE2-99C2-55E82F952B16}.Release|Any CPU.ActiveCfg = Release|Any CPU 54 | {545139F0-8040-4DE2-99C2-55E82F952B16}.Release|Any CPU.Build.0 = Release|Any CPU 55 | {7295D5A1-D38A-4BA2-83B9-6D39B5E0B8CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 56 | {7295D5A1-D38A-4BA2-83B9-6D39B5E0B8CD}.Debug|Any CPU.Build.0 = Debug|Any CPU 57 | {7295D5A1-D38A-4BA2-83B9-6D39B5E0B8CD}.Release|Any CPU.ActiveCfg = Release|Any CPU 58 | {7295D5A1-D38A-4BA2-83B9-6D39B5E0B8CD}.Release|Any CPU.Build.0 = Release|Any CPU 59 | {AAAF93B6-AE66-486E-A46F-160F1B9DCAD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 60 | {AAAF93B6-AE66-486E-A46F-160F1B9DCAD0}.Debug|Any CPU.Build.0 = Debug|Any CPU 61 | {AAAF93B6-AE66-486E-A46F-160F1B9DCAD0}.Release|Any CPU.ActiveCfg = Release|Any CPU 62 | {AAAF93B6-AE66-486E-A46F-160F1B9DCAD0}.Release|Any CPU.Build.0 = Release|Any CPU 63 | EndGlobalSection 64 | GlobalSection(SolutionProperties) = preSolution 65 | HideSolutionNode = FALSE 66 | EndGlobalSection 67 | GlobalSection(ExtensibilityGlobals) = postSolution 68 | SolutionGuid = {FF6EAB4C-2689-4C63-A6A3-01D8003D08C2} 69 | EndGlobalSection 70 | EndGlobal 71 | -------------------------------------------------------------------------------- /SharpNodeSettings/Controls/TreeViewEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | 8 | namespace SharpNodeSettings.Controls 9 | { 10 | public class TreeViewEx : TreeView 11 | { 12 | public TreeViewEx() 13 | { 14 | 15 | } 16 | 17 | protected override void WndProc( ref Message m ) 18 | { 19 | if (m.Msg == 0x0014) // 禁掉清除背景消息 20 | return; 21 | base.WndProc( ref m ); 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SharpNodeSettings/Device/DeviceMelsecMc.cs: -------------------------------------------------------------------------------- 1 | using HslCommunication.Profinet.Melsec; 2 | using SharpNodeSettings.Node.Device; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Xml.Linq; 9 | 10 | namespace SharpNodeSettings.Device 11 | { 12 | /// 13 | /// 三菱的设备信息,包含了核心的连接对象 14 | /// 15 | public class DeviceMelsecMc : DeviceCore 16 | { 17 | /// 18 | /// 实例化一个三菱的设备对象,从配置信息创建 19 | /// 20 | /// 配置信息 21 | public DeviceMelsecMc(XElement element ) 22 | { 23 | NodeMelsecMc nodeMelsec = new NodeMelsecMc( ); 24 | nodeMelsec.LoadByXmlElement( element ); 25 | LoadRequest( element ); 26 | 27 | if (nodeMelsec.IsBinary) 28 | { 29 | protocol = 1; 30 | melsecMcNet = new MelsecMcNet( nodeMelsec.IpAddress, nodeMelsec.Port ); 31 | melsecMcNet.NetworkNumber = nodeMelsec.NetworkNumber; 32 | melsecMcNet.NetworkStationNumber = nodeMelsec.NetworkStationNumber; 33 | melsecMcNet.ConnectTimeOut = nodeMelsec.ConnectTimeOut; 34 | 35 | ByteTransform = melsecMcNet.ByteTransform; 36 | ReadWriteDevice = melsecMcNet; 37 | UniqueId = melsecMcNet.ConnectionId; 38 | } 39 | else 40 | { 41 | melsecMcAscii = new MelsecMcAsciiNet( nodeMelsec.IpAddress, nodeMelsec.Port ); 42 | melsecMcAscii.NetworkNumber = nodeMelsec.NetworkNumber; 43 | melsecMcAscii.NetworkStationNumber = nodeMelsec.NetworkStationNumber; 44 | melsecMcAscii.ConnectTimeOut = nodeMelsec.ConnectTimeOut; 45 | 46 | ByteTransform = melsecMcAscii.ByteTransform; 47 | ReadWriteDevice = melsecMcAscii; 48 | UniqueId = melsecMcAscii.ConnectionId; 49 | 50 | } 51 | 52 | TypeName = "三菱设备"; 53 | } 54 | 55 | 56 | 57 | 58 | 59 | #region Protect Override 60 | 61 | /// 62 | /// 在启动之前进行的操作信息 63 | /// 64 | protected override void BeforStart( ) 65 | { 66 | if (protocol == 0) 67 | { 68 | melsecMcAscii.SetPersistentConnection( ); 69 | } 70 | else if (protocol == 1) 71 | { 72 | melsecMcNet.SetPersistentConnection( ); 73 | } 74 | } 75 | 76 | /// 77 | /// 在关闭的时候需要进行的操作 78 | /// 79 | protected override void AfterClose( ) 80 | { 81 | if (protocol == 0) 82 | { 83 | melsecMcAscii.ConnectClose( ); 84 | } 85 | else if (protocol == 1) 86 | { 87 | melsecMcNet.ConnectClose( ); 88 | } 89 | } 90 | 91 | #endregion 92 | 93 | #region Private 94 | 95 | 96 | private MelsecMcAsciiNet melsecMcAscii; // ASCII格式的交互对象 97 | private MelsecMcNet melsecMcNet; // 二进制格式的交互对象 98 | private int protocol = 0; // 当前选择的协议,0 是ascii 1是二进制 99 | 100 | #endregion 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /SharpNodeSettings/Device/DeviceModbusTcp.cs: -------------------------------------------------------------------------------- 1 | using HslCommunication.ModBus; 2 | using SharpNodeSettings.Node.Device; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Xml.Linq; 9 | 10 | namespace SharpNodeSettings.Device 11 | { 12 | /// 13 | /// Modbus-Tcp的设备信息,包含了核心的连接对象 14 | /// 15 | public class DeviceModbusTcp : DeviceCore 16 | { 17 | #region Constructor 18 | 19 | /// 20 | /// 实例化一个Modbus-Tcp的设备对象,从配置信息创建 21 | /// 22 | /// 配置信息 23 | public DeviceModbusTcp( XElement element ) 24 | { 25 | NodeModbusTcpClient nodeModbus = new NodeModbusTcpClient( ); 26 | nodeModbus.LoadByXmlElement( element ); 27 | LoadRequest( element ); 28 | 29 | modbusTcp = new ModbusTcpNet( nodeModbus.IpAddress, nodeModbus.Port, nodeModbus.Station ); 30 | modbusTcp.AddressStartWithZero = nodeModbus.IsAddressStartWithZero; 31 | modbusTcp.ConnectTimeOut = nodeModbus.ConnectTimeOut; 32 | modbusTcp.DataFormat = (HslCommunication.Core.DataFormat)nodeModbus.DataFormat; 33 | modbusTcp.IsStringReverse = nodeModbus.IsStringReverse; 34 | 35 | ByteTransform = modbusTcp.ByteTransform; 36 | UniqueId = modbusTcp.ConnectionId; 37 | ReadWriteDevice = modbusTcp; 38 | 39 | TypeName = "Modbus-Tcp设备"; 40 | } 41 | 42 | 43 | #endregion 44 | 45 | #region Protect Override 46 | 47 | /// 48 | /// 在启动之前进行的操作信息 49 | /// 50 | protected override void BeforStart( ) 51 | { 52 | modbusTcp.SetPersistentConnection( ); 53 | } 54 | 55 | 56 | /// 57 | /// 在关闭的时候需要进行的操作 58 | /// 59 | protected override void AfterClose( ) 60 | { 61 | modbusTcp.ConnectClose( ); 62 | } 63 | 64 | #endregion 65 | 66 | #region Private 67 | 68 | private ModbusTcpNet modbusTcp; // 核心交互对象 69 | 70 | #endregion 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /SharpNodeSettings/Device/DeviceModbusTcpAlien.cs: -------------------------------------------------------------------------------- 1 | using HslCommunication.Core.Net; 2 | using HslCommunication.ModBus; 3 | using SharpNodeSettings.Node.Device; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Xml.Linq; 10 | 11 | namespace SharpNodeSettings.Device 12 | { 13 | /// 14 | /// 异形的Modbus-tcp的设备信息,包含了核心的连接对象 15 | /// 16 | public class DeviceModbusTcpAlien : DeviceCore 17 | { 18 | #region Constructor 19 | 20 | /// 21 | /// 实例化一个异形的Modbus-tcp的设备对象,从配置信息创建 22 | /// 23 | /// 配置信息 24 | public DeviceModbusTcpAlien( XElement element ) 25 | { 26 | NodeModbusTcpAline modbusTcpAline = new NodeModbusTcpAline( ); 27 | modbusTcpAline.LoadByXmlElement( element ); 28 | 29 | LoadRequest( element ); 30 | 31 | modbusTcp = new ModbusTcpNet( string.Empty, 502, modbusTcpAline.Station ); 32 | modbusTcp.AddressStartWithZero = modbusTcpAline.IsAddressStartWithZero; 33 | modbusTcp.ConnectionId = modbusTcpAline.DTU; 34 | modbusTcp.DataFormat = (HslCommunication.Core.DataFormat)modbusTcpAline.DataFormat; 35 | modbusTcp.IsStringReverse = modbusTcpAline.IsStringReverse; 36 | 37 | 38 | ByteTransform = modbusTcp.ByteTransform; 39 | ReadWriteDevice = modbusTcp; 40 | UniqueId = modbusTcp.ConnectionId; 41 | 42 | TypeName = "Modbus-Tcp异形设备"; 43 | } 44 | 45 | 46 | #endregion 47 | 48 | 49 | #region Public Override 50 | 51 | /// 52 | /// 设置为异形客户端对象 53 | /// 54 | /// 异形对象 55 | public override void SetAlineSession( AlienSession alienSession ) 56 | { 57 | modbusTcp.ConnectServer( alienSession ); 58 | } 59 | 60 | 61 | #endregion 62 | 63 | #region Protect Override 64 | 65 | /// 66 | /// 在启动之前进行的操作信息 67 | /// 68 | protected override void BeforStart( ) 69 | { 70 | modbusTcp.ConnectServer( null ); 71 | } 72 | 73 | /// 74 | /// 在关闭的时候需要进行的操作 75 | /// 76 | protected override void AfterClose( ) 77 | { 78 | modbusTcp.ConnectClose( ); 79 | } 80 | 81 | #endregion 82 | 83 | #region Private 84 | 85 | private ModbusTcpNet modbusTcp; // 核心交互对象 86 | 87 | #endregion 88 | 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /SharpNodeSettings/Device/DeviceOmron.cs: -------------------------------------------------------------------------------- 1 | using HslCommunication.Profinet.Omron; 2 | using SharpNodeSettings.Node.Device; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Xml.Linq; 9 | 10 | namespace SharpNodeSettings.Device 11 | { 12 | /// 13 | /// 欧姆龙的设备信息,包含了核心的连接对象 14 | /// 15 | public class DeviceOmron : DeviceCore 16 | { 17 | 18 | #region Constructor 19 | 20 | /// 21 | /// 实例化一个欧姆龙的设备对象,从配置信息创建 22 | /// 23 | /// 配置信息 24 | public DeviceOmron( XElement element ) 25 | { 26 | NodeOmron nodeOmron = new NodeOmron( ); 27 | nodeOmron.LoadByXmlElement( element ); 28 | LoadRequest( element ); 29 | 30 | omronFinsNet = new OmronFinsNet( nodeOmron.IpAddress, nodeOmron.Port ); 31 | omronFinsNet.DA1 = nodeOmron.DA1; 32 | omronFinsNet.DA2 = nodeOmron.DA2; 33 | omronFinsNet.SA1 = nodeOmron.SA1; 34 | omronFinsNet.ConnectTimeOut = nodeOmron.ConnectTimeOut; 35 | 36 | ByteTransform = omronFinsNet.ByteTransform; 37 | ReadWriteDevice = omronFinsNet; 38 | UniqueId = omronFinsNet.ConnectionId; 39 | 40 | TypeName = "欧姆龙设备"; 41 | } 42 | 43 | 44 | #endregion 45 | 46 | #region Protect Override 47 | 48 | /// 49 | /// 在启动之前进行的操作信息 50 | /// 51 | protected override void BeforStart( ) 52 | { 53 | omronFinsNet.SetPersistentConnection( ); 54 | } 55 | 56 | 57 | /// 58 | /// 在关闭的时候需要进行的操作 59 | /// 60 | protected override void AfterClose( ) 61 | { 62 | omronFinsNet.ConnectClose( ); 63 | } 64 | 65 | #endregion 66 | 67 | #region Private 68 | 69 | 70 | private OmronFinsNet omronFinsNet; // 核心交互对象 71 | 72 | 73 | #endregion 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /SharpNodeSettings/Device/DeviceSiemens.cs: -------------------------------------------------------------------------------- 1 | using HslCommunication.Profinet.Siemens; 2 | using SharpNodeSettings.Node.Device; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Xml.Linq; 9 | 10 | namespace SharpNodeSettings.Device 11 | { 12 | /// 13 | /// 西门子的设备信息,包含了核心的连接对象 14 | /// 15 | public class DeviceSiemens : DeviceCore 16 | { 17 | #region Constructor 18 | 19 | /// 20 | /// 实例化一个西门子的设备对象,从配置信息创建 21 | /// 22 | /// 配置信息 23 | public DeviceSiemens( XElement element ) 24 | { 25 | NodeSiemens nodeSiemens = new NodeSiemens( ); 26 | nodeSiemens.LoadByXmlElement( element ); 27 | LoadRequest( element ); 28 | 29 | if (nodeSiemens.PlcType == NodeSiemens.PLCFW) 30 | { 31 | isS7Net = false; 32 | siemensFetchWrite = new SiemensFetchWriteNet( nodeSiemens.IpAddress, nodeSiemens.Port ); 33 | siemensFetchWrite.ConnectTimeOut = nodeSiemens.ConnectTimeOut; 34 | ReadWriteDevice = siemensFetchWrite; 35 | ByteTransform = siemensFetchWrite.ByteTransform; 36 | UniqueId = siemensFetchWrite.ConnectionId; 37 | } 38 | else 39 | { 40 | isS7Net = true; 41 | if (nodeSiemens.PlcType == NodeSiemens.PLC300) 42 | { 43 | siemensS7Net = new SiemensS7Net( SiemensPLCS.S300 ); 44 | } 45 | else if (nodeSiemens.PlcType == NodeSiemens.PLC1200) 46 | { 47 | siemensS7Net = new SiemensS7Net( SiemensPLCS.S1200 ); 48 | } 49 | else if (nodeSiemens.PlcType == NodeSiemens.PLC1500) 50 | { 51 | siemensS7Net = new SiemensS7Net( SiemensPLCS.S1500 ); 52 | } 53 | else if (nodeSiemens.PlcType == NodeSiemens.PLC200Smart) 54 | { 55 | siemensS7Net = new SiemensS7Net( SiemensPLCS.S200Smart ); 56 | } 57 | else 58 | { 59 | siemensS7Net = new SiemensS7Net( SiemensPLCS.S1200 ); 60 | } 61 | 62 | siemensS7Net.IpAddress = nodeSiemens.IpAddress; 63 | siemensS7Net.ConnectTimeOut = nodeSiemens.ConnectTimeOut; 64 | ByteTransform = siemensS7Net.ByteTransform; 65 | ReadWriteDevice = siemensS7Net; 66 | UniqueId = siemensS7Net.ConnectionId; 67 | } 68 | 69 | 70 | TypeName = "西门子设备"; 71 | } 72 | 73 | 74 | #endregion 75 | 76 | 77 | #region Protect Override 78 | 79 | /// 80 | /// 在启动之前进行的操作信息 81 | /// 82 | protected override void BeforStart( ) 83 | { 84 | if (isS7Net) 85 | { 86 | siemensS7Net.ConnectServer( ); 87 | } 88 | else 89 | { 90 | siemensFetchWrite.ConnectServer( ); 91 | } 92 | } 93 | 94 | /// 95 | /// 在关闭的时候需要进行的操作 96 | /// 97 | protected override void AfterClose( ) 98 | { 99 | if (isS7Net) 100 | { 101 | siemensS7Net.ConnectClose( ); 102 | } 103 | else 104 | { 105 | siemensFetchWrite.ConnectClose( ); 106 | } 107 | } 108 | 109 | #endregion 110 | 111 | #region Private 112 | 113 | 114 | private SiemensS7Net siemensS7Net; // S7协议交互对象 115 | private SiemensFetchWriteNet siemensFetchWrite; // FW协议交互对象 116 | private bool isS7Net = true; // 是否是S7协议 117 | 118 | #endregion 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormAlienNode.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.Server; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SharpNodeSettings.Forms 13 | { 14 | public partial class FormAlienNode : Form 15 | { 16 | public FormAlienNode( AlienServerNode alienNode = null ) 17 | { 18 | InitializeComponent( ); 19 | AlienNode = alienNode ?? new AlienServerNode( ); 20 | Icon = Util.GetWinformICon( ); 21 | } 22 | 23 | private void FormAlienNode_Load( object sender, EventArgs e ) 24 | { 25 | if (AlienNode != null) 26 | { 27 | textBox1.Text = AlienNode.Name; 28 | textBox2.Text = AlienNode.Description; 29 | textBox3.Text = AlienNode.Password; 30 | textBox4.Text = AlienNode.Port.ToString( ); 31 | } 32 | } 33 | 34 | 35 | 36 | 37 | /// 38 | /// 异形服务器的节点 39 | /// 40 | public AlienServerNode AlienNode { get; set; } 41 | 42 | private void userButton1_Click( object sender, EventArgs e ) 43 | { 44 | if (textBox3.Text.Length > 6) 45 | { 46 | MessageBox.Show( "密码最大长度为6" ); 47 | return; 48 | } 49 | 50 | if (!int.TryParse( textBox4.Text, out int port )) 51 | { 52 | MessageBox.Show( "端口号输入失败!" ); 53 | return; 54 | } 55 | 56 | 57 | AlienNode = new AlienServerNode( ) 58 | { 59 | Name = textBox1.Text, 60 | Description = textBox2.Text, 61 | Password = textBox3.Text, 62 | Port = port 63 | }; 64 | 65 | DialogResult = DialogResult.OK; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormEmpty.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.Device; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SharpNodeSettings.Forms 13 | { 14 | public partial class FormEmpty : Form 15 | { 16 | public FormEmpty( NodeEmpty nodeEmpty = null) 17 | { 18 | InitializeComponent( ); 19 | NodeEmpty = nodeEmpty ?? new NodeEmpty( ); 20 | Icon = Util.GetWinformICon( ); 21 | } 22 | 23 | private void FormEmpty_Load( object sender, EventArgs e ) 24 | { 25 | if(NodeEmpty != null) 26 | { 27 | textBox1.Text = NodeEmpty.Name; 28 | textBox2.Text = NodeEmpty.Description; 29 | } 30 | } 31 | 32 | 33 | public NodeEmpty NodeEmpty { get; set; } 34 | 35 | 36 | private void userButton1_Click( object sender, EventArgs e ) 37 | { 38 | NodeEmpty = new NodeEmpty( ) 39 | { 40 | Name = textBox1.Text, 41 | Description = textBox2.Text, 42 | }; 43 | DialogResult = DialogResult.OK; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormEmpty.designer.cs: -------------------------------------------------------------------------------- 1 | namespace SharpNodeSettings.Forms 2 | { 3 | partial class FormEmpty 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose( bool disposing ) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose( ); 19 | } 20 | base.Dispose( disposing ); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent( ) 30 | { 31 | this.userButton1 = new HslCommunication.Controls.UserButton(); 32 | this.textBox2 = new System.Windows.Forms.TextBox(); 33 | this.label2 = new System.Windows.Forms.Label(); 34 | this.textBox1 = new System.Windows.Forms.TextBox(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | this.SuspendLayout(); 37 | // 38 | // userButton1 39 | // 40 | this.userButton1.BackColor = System.Drawing.Color.Transparent; 41 | this.userButton1.CustomerInformation = ""; 42 | this.userButton1.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); 43 | this.userButton1.Font = new System.Drawing.Font("微软雅黑", 9F); 44 | this.userButton1.Location = new System.Drawing.Point(174, 187); 45 | this.userButton1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 46 | this.userButton1.Name = "userButton1"; 47 | this.userButton1.Size = new System.Drawing.Size(95, 28); 48 | this.userButton1.TabIndex = 28; 49 | this.userButton1.UIText = "确认"; 50 | this.userButton1.Click += new System.EventHandler(this.userButton1_Click); 51 | // 52 | // textBox2 53 | // 54 | this.textBox2.Location = new System.Drawing.Point(102, 70); 55 | this.textBox2.Name = "textBox2"; 56 | this.textBox2.Size = new System.Drawing.Size(317, 23); 57 | this.textBox2.TabIndex = 27; 58 | // 59 | // label2 60 | // 61 | this.label2.AutoSize = true; 62 | this.label2.Location = new System.Drawing.Point(25, 73); 63 | this.label2.Name = "label2"; 64 | this.label2.Size = new System.Drawing.Size(68, 17); 65 | this.label2.TabIndex = 26; 66 | this.label2.Text = "节点备注:"; 67 | // 68 | // textBox1 69 | // 70 | this.textBox1.Location = new System.Drawing.Point(102, 38); 71 | this.textBox1.Name = "textBox1"; 72 | this.textBox1.Size = new System.Drawing.Size(317, 23); 73 | this.textBox1.TabIndex = 25; 74 | // 75 | // label1 76 | // 77 | this.label1.AutoSize = true; 78 | this.label1.Location = new System.Drawing.Point(25, 41); 79 | this.label1.Name = "label1"; 80 | this.label1.Size = new System.Drawing.Size(68, 17); 81 | this.label1.TabIndex = 24; 82 | this.label1.Text = "节点名称:"; 83 | // 84 | // FormEmpty 85 | // 86 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); 87 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 88 | this.BackColor = System.Drawing.Color.Lavender; 89 | this.ClientSize = new System.Drawing.Size(453, 249); 90 | this.Controls.Add(this.userButton1); 91 | this.Controls.Add(this.textBox2); 92 | this.Controls.Add(this.label2); 93 | this.Controls.Add(this.textBox1); 94 | this.Controls.Add(this.label1); 95 | this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 96 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 97 | this.Name = "FormEmpty"; 98 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 99 | this.Text = "空设备"; 100 | this.Load += new System.EventHandler(this.FormEmpty_Load); 101 | this.ResumeLayout(false); 102 | this.PerformLayout(); 103 | 104 | } 105 | 106 | #endregion 107 | 108 | private HslCommunication.Controls.UserButton userButton1; 109 | private System.Windows.Forms.TextBox textBox2; 110 | private System.Windows.Forms.Label label2; 111 | private System.Windows.Forms.TextBox textBox1; 112 | private System.Windows.Forms.Label label1; 113 | } 114 | } -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormMelsec3E.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using System.Net; 11 | using SharpNodeSettings.Node.Device; 12 | 13 | namespace SharpNodeSettings.Forms 14 | { 15 | public partial class FormMelsec3E : Form 16 | { 17 | public FormMelsec3E( NodeMelsecMc melsecMc = null ) 18 | { 19 | InitializeComponent( ); 20 | Icon = Util.GetWinformICon( ); 21 | 22 | MelsecMc = melsecMc ?? new NodeMelsecMc( ); 23 | } 24 | 25 | private void FormMelsecBinary_Load( object sender, EventArgs e ) 26 | { 27 | 28 | if (MelsecMc != null) 29 | { 30 | textBox1.Text = MelsecMc.Name; 31 | textBox2.Text = MelsecMc.Description; 32 | textBox3.Text = MelsecMc.IpAddress; 33 | textBox4.Text = MelsecMc.Port.ToString( ); 34 | textBox5.Text = MelsecMc.NetworkNumber.ToString( ); 35 | textBox7.Text = MelsecMc.NetworkStationNumber.ToString( ); 36 | textBox6.Text = MelsecMc.ConnectTimeOut.ToString( ); 37 | checkBox1.Checked = MelsecMc.IsBinary; 38 | } 39 | 40 | } 41 | 42 | 43 | 44 | 45 | public NodeMelsecMc MelsecMc { get; set; } 46 | 47 | private void userButton1_Click( object sender, EventArgs e ) 48 | { 49 | if(!IPAddress.TryParse(textBox3.Text,out IPAddress address)) 50 | { 51 | MessageBox.Show( "Ip地址填写异常!" ); 52 | return; 53 | } 54 | 55 | if(!int.TryParse(textBox4.Text,out int port)) 56 | { 57 | MessageBox.Show( "端口号填写异常!" ); 58 | return; 59 | } 60 | 61 | if(!byte.TryParse(textBox5.Text,out byte netWorkNumber)) 62 | { 63 | MessageBox.Show( "网络号填写异常!" ); 64 | return; 65 | } 66 | 67 | if(!byte.TryParse( textBox7.Text, out byte netWorkStationNumber )) 68 | { 69 | MessageBox.Show( "网络站号填写异常!" ); 70 | return; 71 | } 72 | 73 | if(!int.TryParse(textBox6.Text,out int timeOut)) 74 | { 75 | MessageBox.Show( "超时时间填写异常!" ); 76 | return; 77 | } 78 | 79 | MelsecMc = new NodeMelsecMc( ) 80 | { 81 | Name = textBox1.Text, 82 | Description = textBox2.Text, 83 | IpAddress = address.ToString( ), 84 | Port = port, 85 | NetworkNumber = netWorkNumber, 86 | NetworkStationNumber = netWorkStationNumber, 87 | ConnectTimeOut = timeOut, 88 | IsBinary = checkBox1.Checked 89 | }; 90 | 91 | DialogResult = DialogResult.OK; 92 | 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormModbusServer.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.Server; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SharpNodeSettings.Forms 13 | { 14 | public partial class FormModbusServer : Form 15 | { 16 | public FormModbusServer( NodeModbusServer modbusServer = null ) 17 | { 18 | InitializeComponent( ); 19 | Icon = Util.GetWinformICon( ); 20 | ModbusServer = modbusServer ?? new NodeModbusServer( ); 21 | } 22 | 23 | private void FormModbusServer_Load( object sender, EventArgs e ) 24 | { 25 | if(ModbusServer!=null) 26 | { 27 | textBox1.Text = ModbusServer.Name; 28 | textBox2.Text = ModbusServer.Description; 29 | textBox4.Text = ModbusServer.Port.ToString( ); 30 | } 31 | } 32 | 33 | 34 | public NodeModbusServer ModbusServer { get; set; } 35 | 36 | private void userButton1_Click( object sender, EventArgs e ) 37 | { 38 | if (string.IsNullOrEmpty(textBox1.Text)) 39 | { 40 | MessageBox.Show( "节点名称不能为空" ); 41 | return; 42 | } 43 | 44 | if (!int.TryParse( textBox4.Text, out int port )) 45 | { 46 | MessageBox.Show( "端口号输入失败!" ); 47 | return; 48 | } 49 | 50 | ModbusServer = new NodeModbusServer( ) 51 | { 52 | Name = textBox1.Text, 53 | Description = textBox2.Text, 54 | Port = port 55 | }; 56 | 57 | DialogResult = DialogResult.OK; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormModbusTcp.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.Device; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SharpNodeSettings.Forms 13 | { 14 | public partial class FormModbusTcp : Form 15 | { 16 | 17 | public FormModbusTcp( NodeModbusTcpClient modbusTcpNode = null) 18 | { 19 | InitializeComponent( ); 20 | ModbusTcpNode = modbusTcpNode ?? new NodeModbusTcpClient(); 21 | Icon = Util.GetWinformICon( ); 22 | } 23 | 24 | private void FormModbusTcp_Load( object sender, EventArgs e ) 25 | { 26 | comboBox1.DataSource = HslCommunication.BasicFramework.SoftBasic.GetEnumValues( ); 27 | if (ModbusTcpNode != null) 28 | { 29 | textBox1.Text = ModbusTcpNode.Name; 30 | textBox2.Text = ModbusTcpNode.Description; 31 | textBox3.Text = ModbusTcpNode.IpAddress; 32 | textBox4.Text = ModbusTcpNode.Port.ToString( ); 33 | textBox5.Text = ModbusTcpNode.Station.ToString( ); 34 | checkBox1.Checked = !ModbusTcpNode.IsAddressStartWithZero; 35 | //checkBox2.Checked = ModbusTcpNode.IsWordReverse; 36 | comboBox1.SelectedIndex = ModbusTcpNode.DataFormat; 37 | checkBox3.Checked = ModbusTcpNode.IsStringReverse; 38 | textBox6.Text = ModbusTcpNode.ConnectTimeOut.ToString( ); 39 | } 40 | } 41 | 42 | private void userButton1_Click( object sender, EventArgs e ) 43 | { 44 | if (string.IsNullOrEmpty( textBox1.Text )) 45 | { 46 | MessageBox.Show( "节点名称不能为空" ); 47 | return; 48 | } 49 | 50 | try 51 | { 52 | ModbusTcpNode = new NodeModbusTcpClient( ) 53 | { 54 | Name = textBox1.Text, 55 | Description = textBox2.Text, 56 | IpAddress = textBox3.Text, 57 | Port = int.Parse( textBox4.Text ), 58 | Station = byte.Parse( textBox5.Text ), 59 | IsAddressStartWithZero = !checkBox1.Checked, 60 | //IsWordReverse = checkBox2.Checked, 61 | DataFormat = comboBox1.SelectedIndex, 62 | IsStringReverse = checkBox3.Checked, 63 | ConnectTimeOut = int.Parse( textBox6.Text ), 64 | }; 65 | } 66 | catch(Exception ex) 67 | { 68 | MessageBox.Show( "数据填入异常:" + ex.Message ); 69 | return; 70 | } 71 | DialogResult = DialogResult.OK; 72 | } 73 | 74 | 75 | 76 | 77 | 78 | public NodeModbusTcpClient ModbusTcpNode { get; set; } 79 | 80 | 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormModbusTcpAlien.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.Device; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SharpNodeSettings.Forms 13 | { 14 | public partial class FormModbusTcpAlien : Form 15 | { 16 | public FormModbusTcpAlien( NodeModbusTcpAline modbusTcpAline = null) 17 | { 18 | InitializeComponent( ); 19 | 20 | ModbusTcpAline = modbusTcpAline ?? new NodeModbusTcpAline(); 21 | Icon = Util.GetWinformICon( ); 22 | } 23 | 24 | private void FormModbusTcpAlien_Load( object sender, EventArgs e ) 25 | { 26 | comboBox1.DataSource = HslCommunication.BasicFramework.SoftBasic.GetEnumValues( ); 27 | 28 | if (ModbusTcpAline != null) 29 | { 30 | textBox1.Text = ModbusTcpAline.Name; 31 | textBox2.Text = ModbusTcpAline.Description; 32 | textBox3.Text = ModbusTcpAline.DTU; 33 | textBox5.Text = ModbusTcpAline.Station.ToString( ); 34 | checkBox1.Checked = !ModbusTcpAline.IsAddressStartWithZero; 35 | //checkBox2.Checked = ModbusTcpAline.IsWordReverse; 36 | comboBox1.SelectedIndex = ModbusTcpAline.DataFormat; 37 | checkBox3.Checked = ModbusTcpAline.IsStringReverse; 38 | } 39 | } 40 | 41 | 42 | 43 | 44 | 45 | public NodeModbusTcpAline ModbusTcpAline { get; set; } 46 | 47 | private void userButton1_Click( object sender, EventArgs e ) 48 | { 49 | if(!byte.TryParse(textBox5.Text,out byte station)) 50 | { 51 | MessageBox.Show( "站号的输入失败!" ); 52 | return; 53 | } 54 | 55 | ModbusTcpAline = new NodeModbusTcpAline( ) 56 | { 57 | Name = textBox1.Text, 58 | Description = textBox2.Text, 59 | DTU = textBox3.Text, 60 | Station = station, 61 | IsAddressStartWithZero = !checkBox1.Checked, 62 | //IsWordReverse = checkBox2.Checked, 63 | DataFormat = comboBox1.SelectedIndex, 64 | IsStringReverse = checkBox3.Checked 65 | }; 66 | 67 | DialogResult = DialogResult.OK; 68 | 69 | } 70 | 71 | 72 | 73 | 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormNodeClass.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SharpNodeSettings.Forms 13 | { 14 | public partial class FormNodeClass : Form 15 | { 16 | 17 | public FormNodeClass( NodeClass nodeClass = null) 18 | { 19 | InitializeComponent( ); 20 | Icon = Util.GetWinformICon( ); 21 | SelectedNodeClass = nodeClass ?? new NodeClass( ); ; 22 | } 23 | 24 | private void FormNodeClass_Load( object sender, EventArgs e ) 25 | { 26 | if(SelectedNodeClass != null) 27 | { 28 | textBox1.Text = SelectedNodeClass.Name; 29 | textBox2.Text = SelectedNodeClass.Description; 30 | } 31 | } 32 | 33 | private void userButton1_Click( object sender, EventArgs e ) 34 | { 35 | if(string.IsNullOrEmpty(textBox1.Text)) 36 | { 37 | MessageBox.Show( "节点名称不能为空" ); 38 | return; 39 | } 40 | 41 | SelectedNodeClass = new NodeClass( ) 42 | { 43 | Name = textBox1.Text, 44 | Description = textBox2.Text, 45 | }; 46 | DialogResult = DialogResult.OK; 47 | } 48 | 49 | 50 | public NodeClass SelectedNodeClass { get; set; } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormNodeClass.designer.cs: -------------------------------------------------------------------------------- 1 | namespace SharpNodeSettings.Forms 2 | { 3 | partial class FormNodeClass 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose( bool disposing ) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose( ); 19 | } 20 | base.Dispose( disposing ); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent( ) 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.textBox1 = new System.Windows.Forms.TextBox(); 33 | this.textBox2 = new System.Windows.Forms.TextBox(); 34 | this.label2 = new System.Windows.Forms.Label(); 35 | this.userButton1 = new HslCommunication.Controls.UserButton(); 36 | this.SuspendLayout(); 37 | // 38 | // label1 39 | // 40 | this.label1.AutoSize = true; 41 | this.label1.Location = new System.Drawing.Point(37, 29); 42 | this.label1.Name = "label1"; 43 | this.label1.Size = new System.Drawing.Size(68, 17); 44 | this.label1.TabIndex = 0; 45 | this.label1.Text = "分类名称:"; 46 | // 47 | // textBox1 48 | // 49 | this.textBox1.Location = new System.Drawing.Point(114, 26); 50 | this.textBox1.Name = "textBox1"; 51 | this.textBox1.Size = new System.Drawing.Size(229, 23); 52 | this.textBox1.TabIndex = 1; 53 | // 54 | // textBox2 55 | // 56 | this.textBox2.Location = new System.Drawing.Point(114, 70); 57 | this.textBox2.Multiline = true; 58 | this.textBox2.Name = "textBox2"; 59 | this.textBox2.Size = new System.Drawing.Size(229, 81); 60 | this.textBox2.TabIndex = 3; 61 | // 62 | // label2 63 | // 64 | this.label2.AutoSize = true; 65 | this.label2.Location = new System.Drawing.Point(37, 73); 66 | this.label2.Name = "label2"; 67 | this.label2.Size = new System.Drawing.Size(68, 17); 68 | this.label2.TabIndex = 2; 69 | this.label2.Text = "解释说明:"; 70 | // 71 | // userButton1 72 | // 73 | this.userButton1.BackColor = System.Drawing.Color.Transparent; 74 | this.userButton1.CustomerInformation = ""; 75 | this.userButton1.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); 76 | this.userButton1.Font = new System.Drawing.Font("微软雅黑", 9F); 77 | this.userButton1.Location = new System.Drawing.Point(139, 173); 78 | this.userButton1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 79 | this.userButton1.Name = "userButton1"; 80 | this.userButton1.Size = new System.Drawing.Size(95, 28); 81 | this.userButton1.TabIndex = 4; 82 | this.userButton1.UIText = "确认"; 83 | this.userButton1.Click += new System.EventHandler(this.userButton1_Click); 84 | // 85 | // FormNodeClass 86 | // 87 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); 88 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 89 | this.BackColor = System.Drawing.Color.Lavender; 90 | this.ClientSize = new System.Drawing.Size(370, 214); 91 | this.Controls.Add(this.userButton1); 92 | this.Controls.Add(this.textBox2); 93 | this.Controls.Add(this.label2); 94 | this.Controls.Add(this.textBox1); 95 | this.Controls.Add(this.label1); 96 | this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 97 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 98 | this.MaximizeBox = false; 99 | this.MinimizeBox = false; 100 | this.Name = "FormNodeClass"; 101 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 102 | this.Text = "分类信息"; 103 | this.Load += new System.EventHandler(this.FormNodeClass_Load); 104 | this.ResumeLayout(false); 105 | this.PerformLayout(); 106 | 107 | } 108 | 109 | #endregion 110 | 111 | private System.Windows.Forms.Label label1; 112 | private System.Windows.Forms.TextBox textBox1; 113 | private System.Windows.Forms.TextBox textBox2; 114 | private System.Windows.Forms.Label label2; 115 | private HslCommunication.Controls.UserButton userButton1; 116 | } 117 | } -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormOmron.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using System.Net; 11 | using SharpNodeSettings.Node.Device; 12 | 13 | namespace SharpNodeSettings.Forms 14 | { 15 | public partial class FormOmron : Form 16 | { 17 | public FormOmron( NodeOmron nodeOmron = null ) 18 | { 19 | InitializeComponent( ); 20 | Icon = Util.GetWinformICon( ); 21 | NodeOmron = nodeOmron ?? new NodeOmron( ); 22 | } 23 | 24 | private void FormOmron_Load( object sender, EventArgs e ) 25 | { 26 | if (NodeOmron != null) 27 | { 28 | textBox1.Text = NodeOmron.Name; 29 | textBox2.Text = NodeOmron.Description; 30 | textBox3.Text = NodeOmron.IpAddress; 31 | textBox4.Text = NodeOmron.Port.ToString( ); 32 | textBox5.Text = NodeOmron.DA2.ToString( ); 33 | textBox7.Text = NodeOmron.DA1.ToString( ); 34 | textBox8.Text = NodeOmron.SA1.ToString( ); 35 | textBox6.Text = NodeOmron.ConnectTimeOut.ToString( ); 36 | } 37 | } 38 | 39 | public NodeOmron NodeOmron { get; set; } 40 | 41 | private void userButton1_Click( object sender, EventArgs e ) 42 | { 43 | if(string.IsNullOrEmpty(textBox1.Text)) 44 | { 45 | MessageBox.Show( "名称不能为空!" ); 46 | return; 47 | } 48 | 49 | if(!IPAddress.TryParse(textBox3.Text,out IPAddress address)) 50 | { 51 | MessageBox.Show( "Ip地址输入失败!" ); 52 | return; 53 | } 54 | 55 | if(!int.TryParse(textBox4.Text,out int port)) 56 | { 57 | MessageBox.Show( "Port端口号输入失败!" ); 58 | return; 59 | } 60 | 61 | if(!byte.TryParse(textBox5.Text,out byte da2)) 62 | { 63 | MessageBox.Show( "PLC的单元号输入失败!" ); 64 | return; 65 | } 66 | 67 | if(!byte.TryParse(textBox7.Text,out byte da1)) 68 | { 69 | MessageBox.Show( "PLC的节点地址输入失败!" ); 70 | return; 71 | } 72 | 73 | if(!byte.TryParse(textBox8.Text,out byte sa1)) 74 | { 75 | MessageBox.Show( "上位机的节点地址输入失败!" ); 76 | return; 77 | } 78 | 79 | if(!int.TryParse(textBox6.Text,out int connect)) 80 | { 81 | MessageBox.Show( "超时时间输入失败!" ); 82 | return; 83 | } 84 | 85 | NodeOmron = new NodeOmron( ) 86 | { 87 | Name = textBox1.Text, 88 | Description = textBox2.Text, 89 | IpAddress = address.ToString( ), 90 | Port = port, 91 | DA1 = da1, 92 | DA2 = da2, 93 | SA1 = sa1, 94 | ConnectTimeOut = connect, 95 | }; 96 | 97 | DialogResult = DialogResult.OK; 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormRegularItemNode.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.Regular; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SharpNodeSettings.Forms 13 | { 14 | public partial class FormRegularItemNode : Form 15 | { 16 | public FormRegularItemNode( RegularItemNode regularNode = null ) 17 | { 18 | InitializeComponent( ); 19 | 20 | RegularNode = regularNode; 21 | Icon = Util.GetWinformICon( ); 22 | } 23 | 24 | private void FormRegularNode_Load( object sender, EventArgs e ) 25 | { 26 | comboBox1.DataSource = new RegularNodeTypeItem[] 27 | { 28 | RegularNodeTypeItem.Bool, 29 | RegularNodeTypeItem.Byte, 30 | RegularNodeTypeItem.Int16, 31 | RegularNodeTypeItem.UInt16, 32 | RegularNodeTypeItem.Int32, 33 | RegularNodeTypeItem.UInt32, 34 | RegularNodeTypeItem.Int64, 35 | RegularNodeTypeItem.UInt64, 36 | RegularNodeTypeItem.Float, 37 | RegularNodeTypeItem.Double, 38 | RegularNodeTypeItem.StringAscii, 39 | RegularNodeTypeItem.StringUnicode, 40 | RegularNodeTypeItem.StringUtf8, 41 | }; 42 | 43 | if (RegularNode != null) 44 | { 45 | textBox1.Text = RegularNode.Name; 46 | textBox2.Text = RegularNode.Description; 47 | textBox3.Text = RegularNode.Index.ToString( ); 48 | comboBox1.SelectedItem = RegularNodeTypeItem.GetDataPraseItemByCode(RegularNode.RegularCode); 49 | textBox5.Text = RegularNode.TypeLength.ToString( ); 50 | } 51 | else 52 | { 53 | comboBox1.SelectedItem = RegularNodeTypeItem.GetDataPraseItemByCode( RegularNodeTypeItem.Int16.Code ); 54 | } 55 | 56 | } 57 | 58 | 59 | 60 | public RegularItemNode RegularNode { get; set; } // 结果信息 61 | 62 | private void userButton1_Click( object sender, EventArgs e ) 63 | { 64 | // 检查数据输入 65 | if (string.IsNullOrEmpty( textBox1.Text )) 66 | { 67 | MessageBox.Show( "名称不能为空!" ); 68 | textBox1.Focus( ); 69 | return; 70 | } 71 | 72 | if (!int.TryParse( textBox3.Text, out int index )) 73 | { 74 | MessageBox.Show( "索引号输入的格式有误,请重新输入。" ); 75 | textBox3.Focus( ); 76 | return; 77 | } 78 | 79 | if (index < 0) 80 | { 81 | MessageBox.Show( "索引号不能小于0,请重新输入。" ); 82 | textBox3.Focus( ); 83 | return; 84 | } 85 | 86 | if(!int.TryParse(textBox5.Text,out int typeLength)) 87 | { 88 | MessageBox.Show( "数据长度输入错误。" ); 89 | textBox5.Focus( ); 90 | return; 91 | } 92 | 93 | RegularNode = new RegularItemNode( ) 94 | { 95 | Name = textBox1.Text, 96 | Description = textBox2.Text, 97 | Index = index, 98 | RegularCode = ((RegularNodeTypeItem)comboBox1.SelectedItem).Code, 99 | TypeLength = typeLength, 100 | }; 101 | 102 | 103 | DialogResult = DialogResult.OK; 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormRegularNode.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.Regular; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SharpNodeSettings.Forms 13 | { 14 | public partial class FormRegularNode : Form 15 | { 16 | public FormRegularNode( RegularNode regularNode = null ) 17 | { 18 | InitializeComponent( ); 19 | 20 | RegularNode = regularNode; 21 | Icon = Util.GetWinformICon( ); 22 | } 23 | 24 | private void FormRegularNode_Load( object sender, EventArgs e ) 25 | { 26 | 27 | 28 | if (RegularNode != null) 29 | { 30 | textBox1.Text = RegularNode.Name; 31 | textBox2.Text = RegularNode.Description; 32 | } 33 | 34 | } 35 | 36 | 37 | 38 | public RegularNode RegularNode { get; set; } // 结果信息 39 | 40 | private void userButton1_Click( object sender, EventArgs e ) 41 | { 42 | // 检查数据输入 43 | if (string.IsNullOrEmpty( textBox1.Text )) 44 | { 45 | MessageBox.Show( "名称不能为空!" ); 46 | textBox1.Focus( ); 47 | return; 48 | } 49 | 50 | 51 | RegularNode = new RegularNode( ) 52 | { 53 | Name = textBox1.Text, 54 | Description = textBox2.Text, 55 | }; 56 | 57 | 58 | DialogResult = DialogResult.OK; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormRegularNode.designer.cs: -------------------------------------------------------------------------------- 1 | namespace SharpNodeSettings.Forms 2 | { 3 | partial class FormRegularNode 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose( bool disposing ) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose( ); 19 | } 20 | base.Dispose( disposing ); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent( ) 30 | { 31 | this.textBox2 = new System.Windows.Forms.TextBox(); 32 | this.label2 = new System.Windows.Forms.Label(); 33 | this.textBox1 = new System.Windows.Forms.TextBox(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.userButton1 = new HslCommunication.Controls.UserButton(); 36 | this.SuspendLayout(); 37 | // 38 | // textBox2 39 | // 40 | this.textBox2.Location = new System.Drawing.Point(108, 92); 41 | this.textBox2.Name = "textBox2"; 42 | this.textBox2.Size = new System.Drawing.Size(317, 23); 43 | this.textBox2.TabIndex = 13; 44 | // 45 | // label2 46 | // 47 | this.label2.AutoSize = true; 48 | this.label2.Location = new System.Drawing.Point(31, 95); 49 | this.label2.Name = "label2"; 50 | this.label2.Size = new System.Drawing.Size(68, 17); 51 | this.label2.TabIndex = 12; 52 | this.label2.Text = "节点备注:"; 53 | // 54 | // textBox1 55 | // 56 | this.textBox1.Location = new System.Drawing.Point(108, 59); 57 | this.textBox1.Name = "textBox1"; 58 | this.textBox1.Size = new System.Drawing.Size(317, 23); 59 | this.textBox1.TabIndex = 11; 60 | // 61 | // label1 62 | // 63 | this.label1.AutoSize = true; 64 | this.label1.Location = new System.Drawing.Point(31, 62); 65 | this.label1.Name = "label1"; 66 | this.label1.Size = new System.Drawing.Size(68, 17); 67 | this.label1.TabIndex = 10; 68 | this.label1.Text = "节点名称:"; 69 | // 70 | // userButton1 71 | // 72 | this.userButton1.BackColor = System.Drawing.Color.Transparent; 73 | this.userButton1.CustomerInformation = ""; 74 | this.userButton1.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); 75 | this.userButton1.Font = new System.Drawing.Font("微软雅黑", 9F); 76 | this.userButton1.Location = new System.Drawing.Point(192, 162); 77 | this.userButton1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 78 | this.userButton1.Name = "userButton1"; 79 | this.userButton1.Size = new System.Drawing.Size(95, 28); 80 | this.userButton1.TabIndex = 21; 81 | this.userButton1.UIText = "确认"; 82 | this.userButton1.Click += new System.EventHandler(this.userButton1_Click); 83 | // 84 | // FormRegularNode 85 | // 86 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); 87 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 88 | this.BackColor = System.Drawing.Color.Lavender; 89 | this.ClientSize = new System.Drawing.Size(471, 237); 90 | this.Controls.Add(this.userButton1); 91 | this.Controls.Add(this.textBox2); 92 | this.Controls.Add(this.label2); 93 | this.Controls.Add(this.textBox1); 94 | this.Controls.Add(this.label1); 95 | this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 96 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 97 | this.Name = "FormRegularNode"; 98 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 99 | this.Text = "编辑Regular节点"; 100 | this.Load += new System.EventHandler(this.FormRegularNode_Load); 101 | this.ResumeLayout(false); 102 | this.PerformLayout(); 103 | 104 | } 105 | 106 | #endregion 107 | private System.Windows.Forms.TextBox textBox2; 108 | private System.Windows.Forms.Label label2; 109 | private System.Windows.Forms.TextBox textBox1; 110 | private System.Windows.Forms.Label label1; 111 | private HslCommunication.Controls.UserButton userButton1; 112 | } 113 | } -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormRequest.cs: -------------------------------------------------------------------------------- 1 |  2 | using SharpNodeSettings.Node.Request; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Data; 7 | using System.Drawing; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | 13 | namespace SharpNodeSettings.Forms 14 | { 15 | public partial class FormRequest : Form 16 | { 17 | public FormRequest( DeviceRequest deviceRequest , string[] regularsArray) 18 | { 19 | InitializeComponent( ); 20 | DeviceRequest = deviceRequest ?? new DeviceRequest( ); 21 | Icon = Util.GetWinformICon( ); 22 | RegularsArray = regularsArray; 23 | } 24 | 25 | private void FormRequest_Load( object sender, EventArgs e ) 26 | { 27 | comboBox1.DataSource = RegularsArray; 28 | 29 | textBox1.Text = DeviceRequest.Name; 30 | textBox2.Text = DeviceRequest.Description; 31 | textBox3.Text = DeviceRequest.Address; 32 | textBox4.Text = DeviceRequest.Length.ToString( ); 33 | textBox6.Text = DeviceRequest.CaptureInterval.ToString( ); 34 | comboBox1.SelectedItem = DeviceRequest.PraseRegularCode; 35 | 36 | 37 | } 38 | 39 | private string[] RegularsArray { get; set; } 40 | 41 | /// 42 | /// 单次的设备请求信息 43 | /// 44 | public DeviceRequest DeviceRequest { get; set; } 45 | 46 | 47 | private void userButton1_Click( object sender, EventArgs e ) 48 | { 49 | string praseRegularCode = ""; 50 | if (comboBox1.SelectedItem != null) 51 | { 52 | praseRegularCode = comboBox1.SelectedItem.ToString( ); 53 | } 54 | 55 | 56 | try 57 | { 58 | DeviceRequest = new DeviceRequest( ) 59 | { 60 | Name = textBox1.Text, 61 | Description = textBox2.Text, 62 | Address = textBox3.Text, 63 | Length = ushort.Parse( textBox4.Text ), 64 | CaptureInterval = int.Parse( textBox6.Text ), 65 | PraseRegularCode = praseRegularCode, 66 | }; 67 | } 68 | catch(Exception ex) 69 | { 70 | MessageBox.Show( "数据填入失败!" + ex.Message ); 71 | return; 72 | } 73 | 74 | DialogResult = DialogResult.OK; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /SharpNodeSettings/Forms/FormSiemens.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using System.Net; 11 | using SharpNodeSettings.Node.Device; 12 | 13 | namespace SharpNodeSettings.Forms 14 | { 15 | public partial class FormSiemens : Form 16 | { 17 | public FormSiemens( NodeSiemens nodeSiemens = null ) 18 | { 19 | InitializeComponent( ); 20 | Icon = Util.GetWinformICon( ); 21 | NodeSiemens = nodeSiemens ?? new NodeSiemens( ); 22 | } 23 | 24 | private void FormSiemens_Load( object sender, EventArgs e ) 25 | { 26 | comboBox1.DataSource = new string[] 27 | { 28 | NodeSiemens.PLC1200, 29 | NodeSiemens.PLC1500, 30 | NodeSiemens.PLC200Smart, 31 | NodeSiemens.PLC300, 32 | NodeSiemens.PLCFW 33 | }; 34 | 35 | 36 | if (NodeSiemens != null) 37 | { 38 | textBox1.Text = NodeSiemens.Name; 39 | textBox2.Text = NodeSiemens.Description; 40 | textBox3.Text = NodeSiemens.IpAddress; 41 | textBox4.Text = NodeSiemens.Port.ToString( ); 42 | textBox6.Text = NodeSiemens.ConnectTimeOut.ToString( ); 43 | comboBox1.SelectedItem = NodeSiemens.PlcType; 44 | } 45 | } 46 | 47 | 48 | public NodeSiemens NodeSiemens { get; set; } 49 | 50 | private void userButton1_Click( object sender, EventArgs e ) 51 | { 52 | if (!IPAddress.TryParse( textBox3.Text, out IPAddress address )) 53 | { 54 | MessageBox.Show( "IP地址输入失败!" ); 55 | return; 56 | } 57 | 58 | if(!int.TryParse(textBox4.Text,out int port)) 59 | { 60 | MessageBox.Show( "端口号输入失败!" ); 61 | return; 62 | } 63 | 64 | if(!int.TryParse(textBox6.Text,out int connect)) 65 | { 66 | MessageBox.Show( "超时时间输入失败!" ); 67 | return; 68 | } 69 | 70 | NodeSiemens = new NodeSiemens( ) 71 | { 72 | Name = textBox1.Text, 73 | Description = textBox2.Text, 74 | IpAddress = address.ToString( ), 75 | Port = port, 76 | ConnectTimeOut = connect, 77 | PlcType = comboBox1.SelectedItem.ToString( ), 78 | }; 79 | 80 | DialogResult = DialogResult.OK; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/ASCube_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/ASCube_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/ClassIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/ClassIcon.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Class_489.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Class_489.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Enum_582.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Enum_582.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Event_594.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Event_594.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Event_594_exp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Event_594_exp.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/ExtensionManager_vsix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/ExtensionManager_vsix.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/FieldsHeader_12x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/FieldsHeader_12x.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/FlagRed_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/FlagRed_16x.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/FlagSpace_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/FlagSpace_16x.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/GenericVSEditor_9905.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/GenericVSEditor_9905.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/HotSpot_10548.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/HotSpot_10548.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/HotSpot_10548_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/HotSpot_10548_color.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Method_636.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Method_636.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Module_648.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Module_648.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Monitor_Screen_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Monitor_Screen_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Operator_660.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Operator_660.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/PencilAngled_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/PencilAngled_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/PencilAngled_16xLG_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/PencilAngled_16xLG_color.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/Property_501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/Property_501.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/VirtualMachine_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/VirtualMachine_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/WindowsAzure_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/WindowsAzure_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/WindowsAzure_16xLG_Cyan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/WindowsAzure_16xLG_Cyan.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/abstr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/abstr1.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/action_Cancel_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/action_Cancel_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/action_add_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/action_add_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/arrow_open_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/arrow_open_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/envelope_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/envelope_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/flag_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/flag_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/interface_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/interface_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/library_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/library_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/save_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/save_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/server_Local_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/server_Local_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/star_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/star_16xLG.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/usbcontroller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/usbcontroller.png -------------------------------------------------------------------------------- /SharpNodeSettings/Imgs/xbox1Color_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/SharpNodeSettings/Imgs/xbox1Color_16x.png -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Device/DeviceNode.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node; 2 | using SharpNodeSettings.Node.NodeBase; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Xml.Linq; 8 | 9 | namespace SharpNodeSettings.Node.Device 10 | { 11 | /// 12 | /// 设备对象类,指明一个设备的所有信息 13 | /// 14 | public class DeviceNode : NodeClass 15 | { 16 | #region Constructor 17 | 18 | /// 19 | /// 实例化一个构造对象 20 | /// 21 | public DeviceNode( ) 22 | { 23 | NodeType = NodeClassInfo.DeviceNode; 24 | NodeHead = "DeviceNode"; 25 | CreateTime = DateTime.Now; 26 | ConnectTimeOut = 2000; 27 | InstallationDate = DateTime.Now; 28 | } 29 | 30 | #endregion 31 | 32 | #region Public Properties 33 | 34 | /// 35 | /// 设备的类别 36 | /// 37 | public int DeviceType { get; set; } 38 | 39 | /// 40 | /// 安装的时间 41 | /// 42 | public DateTime InstallationDate { get; set; } 43 | 44 | /// 45 | /// 连接超时的时间,单位毫秒 46 | /// 47 | public int ConnectTimeOut { get; set; } 48 | 49 | /// 50 | /// 服务器的创建日期 51 | /// 52 | public DateTime CreateTime { get; set; } 53 | 54 | #endregion 55 | 56 | #region Override Method 57 | 58 | 59 | /// 60 | /// 获取用于在数据表信息中显示的键值数据对信息 61 | /// 62 | /// 键值数据对列表 63 | public override List GetNodeClassRenders( ) 64 | { 65 | var list = base.GetNodeClassRenders( ); 66 | list.Add( NodeClassRenderItem.CreateConnectTimeOut( ConnectTimeOut ) ); 67 | list.Add( NodeClassRenderItem.CreateTime( CreateTime ) ); 68 | list.Add( NodeClassRenderItem.CreateInstallationDate( InstallationDate ) ); 69 | return list; 70 | } 71 | 72 | /// 73 | /// 对象解析为Xml元素,方便的存储 74 | /// 75 | /// 包含节点信息的Xml元素 76 | public override XElement ToXmlElement( ) 77 | { 78 | XElement element = base.ToXmlElement( ); 79 | element.SetAttributeValue( "DeviceType", DeviceType ); 80 | element.SetAttributeValue( "ConnectTimeOut", ConnectTimeOut ); 81 | element.SetAttributeValue( "CreateTime", CreateTime.ToString( ) ); 82 | element.SetAttributeValue( "InstallationDate", InstallationDate.ToString() ); 83 | return element; 84 | } 85 | 86 | 87 | /// 88 | /// 对象从xml元素解析,初始化指定的数据 89 | /// 90 | /// 包含节点信息的Xml元素 91 | public override void LoadByXmlElement( XElement element ) 92 | { 93 | base.LoadByXmlElement( element ); 94 | DeviceType = int.Parse( element.Attribute( "DeviceType" ).Value ); 95 | ConnectTimeOut = int.Parse( element.Attribute( "ConnectTimeOut" ).Value ); 96 | CreateTime = DateTime.Parse( element.Attribute( "CreateTime" ).Value ); 97 | InstallationDate = DateTime.Parse( element.Attribute( "InstallationDate" ).Value ); 98 | } 99 | 100 | #endregion 101 | 102 | #region Const Define 103 | 104 | /// 105 | /// 空设备的节点 106 | /// 107 | public const int DeviceNone = 0; 108 | 109 | /// 110 | /// 三菱的Qna兼容3E帧协议的客户端 111 | /// 112 | public const int MelsecMcQna3E = 1; 113 | 114 | /// 115 | /// 常规的Modbus-Tcp客户端 116 | /// 117 | public const int ModbusTcpClient = 10; 118 | 119 | /// 120 | /// 异形的Modbus-Tcp客户端 121 | /// 122 | public const int ModbusTcpAlien = 20; 123 | 124 | /// 125 | /// 西门子的PLC设备 126 | /// 127 | public const int Siemens = 30; 128 | 129 | /// 130 | /// 欧姆龙的PLC设备 131 | /// 132 | public const int Omron = 40; 133 | 134 | /// 135 | /// 其他电脑的SimplifyNet服务器 136 | /// 137 | public const int SimplifyNet = 50; 138 | 139 | 140 | 141 | #endregion 142 | 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Device/NodeEmpty.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNodeSettings.Node.Device 8 | { 9 | /// 10 | /// 空设备,没有连接,不负责数据采集,只负责节点显示 11 | /// 12 | public class NodeEmpty : DeviceNode, IXmlConvert 13 | { 14 | 15 | #region Constructor 16 | 17 | /// 18 | /// 实例化一个空的设备对象 19 | /// 20 | public NodeEmpty( ) 21 | { 22 | Name = "空设备"; 23 | Description = "此设备安装在角落,编号0001"; 24 | DeviceType = DeviceNode.DeviceNone; 25 | } 26 | 27 | #endregion 28 | 29 | #region Object Override 30 | 31 | /// 32 | /// 返回表示当前对象的字符串 33 | /// 34 | /// 字符串信息 35 | public override string ToString( ) 36 | { 37 | return "[空设备] " + Name; 38 | } 39 | 40 | #endregion 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Device/NodeMelsecMc.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | 8 | namespace SharpNodeSettings.Node.Device 9 | { 10 | /// 11 | /// 实例化一个三菱MC协议的节点对象的设备 12 | /// 13 | public class NodeMelsecMc : DeviceNode, IXmlConvert 14 | { 15 | #region Constructor 16 | 17 | /// 18 | /// 使用默认的参数实例化一个设备信息 19 | /// 20 | public NodeMelsecMc( ) 21 | { 22 | Name = "三菱设备"; 23 | Description = "此设备安装在角度,编号0001"; 24 | DeviceType = DeviceNode.MelsecMcQna3E; 25 | 26 | IpAddress = "192.168.0.3"; 27 | Port = 6000; 28 | 29 | IsBinary = true; 30 | } 31 | 32 | 33 | #endregion 34 | 35 | #region Public Properties 36 | 37 | 38 | /// 39 | /// 设备的Ip地址 40 | /// 41 | public string IpAddress { get; set; } 42 | 43 | 44 | /// 45 | /// 设备的端口号 46 | /// 47 | public int Port { get; set; } 48 | 49 | 50 | /// 51 | /// 网络号 52 | /// 53 | public byte NetworkNumber { get; set; } = 0x00; 54 | 55 | /// 56 | /// 网络站号 57 | /// 58 | public byte NetworkStationNumber { get; set; } = 0x00; 59 | 60 | /// 61 | /// 是否是二进制通讯 62 | /// 63 | public bool IsBinary { get; set; } 64 | 65 | 66 | #endregion 67 | 68 | #region Xml Interface 69 | 70 | 71 | /// 72 | /// 对象从xml元素解析,初始化指定的数据 73 | /// 74 | /// 包含节点信息的Xml元素 75 | public override void LoadByXmlElement( XElement element ) 76 | { 77 | base.LoadByXmlElement( element ); 78 | IpAddress = element.Attribute( "IpAddress" ).Value; 79 | Port = int.Parse( element.Attribute( "Port" ).Value ); 80 | NetworkNumber = byte.Parse( element.Attribute( "NetworkNumber" ).Value ); 81 | NetworkStationNumber = byte.Parse( element.Attribute( "NetworkStationNumber" ).Value ); 82 | IsBinary = bool.Parse( element.Attribute( "IsBinary" ).Value ); 83 | } 84 | 85 | /// 86 | /// 对象解析为Xml元素,方便的存储 87 | /// 88 | /// 包含节点信息的Xml元素 89 | public override XElement ToXmlElement( ) 90 | { 91 | XElement element = base.ToXmlElement( ); 92 | element.SetAttributeValue( "IpAddress", IpAddress ); 93 | element.SetAttributeValue( "Port", Port ); 94 | element.SetAttributeValue( "NetworkNumber", NetworkNumber ); 95 | element.SetAttributeValue( "NetworkStationNumber", NetworkStationNumber ); 96 | element.SetAttributeValue( "IsBinary", IsBinary.ToString( ) ); 97 | return element; 98 | } 99 | 100 | #endregion 101 | 102 | #region Overide Method 103 | 104 | /// 105 | /// 获取用于在数据表信息中显示的键值数据对信息 106 | /// 107 | /// 键值数据对列表 108 | public override List GetNodeClassRenders( ) 109 | { 110 | var list = base.GetNodeClassRenders( ); 111 | list.Add( NodeClassRenderItem.CreateIpAddress( IpAddress ) ); 112 | list.Add( NodeClassRenderItem.CreateIpPort( Port ) ); 113 | list.Add( new NodeClassRenderItem( "网络号", NetworkNumber.ToString( ) ) ); 114 | list.Add( new NodeClassRenderItem( "网络站号", NetworkStationNumber.ToString( ) ) ); 115 | list.Add( new NodeClassRenderItem( "是否二进制", IsBinary.ToString( ) ) ); 116 | 117 | return list; 118 | } 119 | 120 | 121 | #endregion 122 | 123 | #region Object Override 124 | 125 | /// 126 | /// 返回表示当前对象的字符串 127 | /// 128 | /// 字符串信息 129 | public override string ToString( ) 130 | { 131 | return "[三菱设备] " + Name; 132 | } 133 | 134 | #endregion 135 | } 136 | 137 | } 138 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Device/NodeModbusTcpAline.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | 8 | namespace SharpNodeSettings.Node.Device 9 | { 10 | /// 11 | /// 异形ModbusTcp的客户端节点,只能挂在Alien节点下,下面只能挂载异形modbus客户端 12 | /// 13 | public class NodeModbusTcpAline : DeviceNode, IXmlConvert 14 | { 15 | #region Constructor 16 | 17 | /// 18 | /// 实例化一个异性的设备对象 19 | /// 20 | public NodeModbusTcpAline( ) 21 | { 22 | DTU = "12345678901"; 23 | DeviceType = DeviceNode.ModbusTcpAlien; 24 | 25 | Name = "异形设备"; 26 | Description = "这是一个异形设备"; 27 | Station = 0x01; 28 | 29 | } 30 | 31 | 32 | #endregion 33 | 34 | #region Public Properties 35 | 36 | /// 37 | /// 设备的唯一号码 38 | /// 39 | public string DTU { get; set; } 40 | 41 | /// 42 | /// 设备的站号 43 | /// 44 | public byte Station { get; set; } 45 | 46 | 47 | /// 48 | /// 起始地址是否从0开始 49 | /// 50 | public bool IsAddressStartWithZero { get; set; } = true; 51 | 52 | /// 53 | /// 字节分析时的数据格式 54 | /// 55 | public int DataFormat { get; set; } = (int)HslCommunication.Core.DataFormat.ABCD; 56 | 57 | /// 58 | /// 字符串分析是否颠倒 59 | /// 60 | public bool IsStringReverse { get; set; } = false; 61 | 62 | #endregion 63 | 64 | #region Override Method 65 | 66 | /// 67 | /// 获取用于在数据表信息中显示的键值数据对信息 68 | /// 69 | /// 键值数据对列表 70 | public override List GetNodeClassRenders( ) 71 | { 72 | var list = base.GetNodeClassRenders( ); 73 | list.Add( NodeClassRenderItem.CreateUniqueId( DTU ) ); 74 | list.Add( NodeClassRenderItem.CreateStation( Station ) ); 75 | list.Add( NodeClassRenderItem.CreateIsAddressStartWithZero( IsAddressStartWithZero ) ); 76 | list.Add( NodeClassRenderItem.CreateDataFormat( DataFormat ) ); 77 | list.Add( NodeClassRenderItem.CreateIsStringReverse( IsStringReverse ) ); 78 | return list; 79 | } 80 | 81 | /// 82 | /// 对象解析为Xml元素,方便的存储 83 | /// 84 | /// 包含节点信息的Xml元素 85 | public override XElement ToXmlElement( ) 86 | { 87 | XElement element = base.ToXmlElement( ); 88 | element.SetAttributeValue( "DTU", DTU ); 89 | element.SetAttributeValue( "Station", Station ); 90 | element.SetAttributeValue( "IsAddressStartWithZero", IsAddressStartWithZero ); 91 | element.SetAttributeValue( "DataFormat", DataFormat ); 92 | element.SetAttributeValue( "IsStringReverse", IsStringReverse ); 93 | return element; 94 | } 95 | 96 | 97 | /// 98 | /// 对象从xml元素解析,初始化指定的数据 99 | /// 100 | /// 包含节点信息的Xml元素 101 | public override void LoadByXmlElement( XElement element ) 102 | { 103 | base.LoadByXmlElement( element ); 104 | DTU = element.Attribute( "DTU" ).Value; 105 | Station = byte.Parse( element.Attribute( "Station" ).Value ); 106 | IsAddressStartWithZero = bool.Parse( element.Attribute( "IsAddressStartWithZero" ).Value ); 107 | DataFormat = int.Parse( element.Attribute( "DataFormat" ).Value ); 108 | IsStringReverse = bool.Parse( element.Attribute( "IsStringReverse" ).Value ); 109 | } 110 | 111 | #endregion 112 | 113 | #region Object Override 114 | 115 | /// 116 | /// 返回表示当前对象的字符串 117 | /// 118 | /// 字符串信息 119 | public override string ToString( ) 120 | { 121 | return "[异形设备] " + Name; 122 | } 123 | 124 | #endregion 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Device/NodeModbusTcpClient.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | using HslCommunication.Core; 8 | 9 | namespace SharpNodeSettings.Node.Device 10 | { 11 | /// 12 | /// 常规的Modbus-Tcp的客户端 13 | /// 14 | public class NodeModbusTcpClient : DeviceNode, IXmlConvert 15 | { 16 | #region Constructor 17 | 18 | /// 19 | /// 实例化一个默认参数的对象 20 | /// 21 | public NodeModbusTcpClient( ) 22 | { 23 | CreateTime = DateTime.Now; 24 | DeviceType = DeviceNode.ModbusTcpClient; 25 | 26 | Name = "ModbusTcp客户端"; 27 | Description = "这是描述"; 28 | IpAddress = "127.0.0.1"; 29 | Port = 502; 30 | Station = 1; 31 | } 32 | 33 | 34 | #endregion 35 | 36 | #region Public Properties 37 | 38 | /// 39 | /// 设备的Ip地址 40 | /// 41 | public string IpAddress { get; set; } 42 | 43 | 44 | /// 45 | /// 设备的端口号 46 | /// 47 | public int Port { get; set; } 48 | 49 | 50 | /// 51 | /// 客户端的站号 52 | /// 53 | public byte Station { get; set; } 54 | 55 | 56 | /// 57 | /// 起始地址是否从0开始 58 | /// 59 | public bool IsAddressStartWithZero { get; set; } = true; 60 | 61 | /// 62 | /// 字节分析是否颠倒 63 | /// 64 | public int DataFormat { get; set; } = (int)HslCommunication.Core.DataFormat.DCBA; 65 | 66 | /// 67 | /// 字符串分析是否颠倒 68 | /// 69 | public bool IsStringReverse { get; set; } = false; 70 | 71 | #endregion 72 | 73 | #region Xml Interface 74 | 75 | /// 76 | /// 对象从xml元素解析,初始化指定的数据 77 | /// 78 | /// 包含节点信息的Xml元素 79 | public override void LoadByXmlElement( XElement element ) 80 | { 81 | base.LoadByXmlElement( element ); 82 | IpAddress = element.Attribute( "IpAddress" ).Value; 83 | Port = int.Parse( element.Attribute( "Port" ).Value ); 84 | Station = byte.Parse( element.Attribute( "Station" ).Value ); 85 | IsAddressStartWithZero = bool.Parse( element.Attribute( "IsAddressStartWithZero" ).Value ); 86 | DataFormat = int.Parse( element.Attribute( "DataFormat" ).Value ); 87 | IsStringReverse = bool.Parse( element.Attribute( "IsStringReverse" ).Value ); 88 | } 89 | 90 | /// 91 | /// 对象解析为Xml元素,方便的存储 92 | /// 93 | /// 包含节点信息的Xml元素 94 | public override XElement ToXmlElement( ) 95 | { 96 | XElement element = base.ToXmlElement( ); 97 | element.SetAttributeValue( "IpAddress", IpAddress ); 98 | element.SetAttributeValue( "Port", Port ); 99 | element.SetAttributeValue( "Station", Station ); 100 | element.SetAttributeValue( "IsAddressStartWithZero", IsAddressStartWithZero ); 101 | element.SetAttributeValue( "DataFormat", DataFormat ); 102 | element.SetAttributeValue( "IsStringReverse", IsStringReverse ); 103 | return element; 104 | } 105 | 106 | #endregion 107 | 108 | #region Overide Method 109 | 110 | /// 111 | /// 获取用于在数据表信息中显示的键值数据对信息 112 | /// 113 | /// 键值数据对列表 114 | public override List GetNodeClassRenders( ) 115 | { 116 | var list = base.GetNodeClassRenders( ); 117 | list.Add( NodeClassRenderItem.CreateIpAddress( IpAddress ) ); 118 | list.Add( NodeClassRenderItem.CreateIpPort( Port ) ); 119 | list.Add( NodeClassRenderItem.CreateStation( Station ) ); 120 | list.Add( NodeClassRenderItem.CreateIsAddressStartWithZero( IsAddressStartWithZero ) ); 121 | list.Add( NodeClassRenderItem.CreateDataFormat( DataFormat ) ); 122 | list.Add( NodeClassRenderItem.CreateIsStringReverse( IsStringReverse ) ); 123 | return list; 124 | } 125 | 126 | 127 | #endregion 128 | 129 | #region Object Override 130 | 131 | /// 132 | /// 返回表示当前对象的字符串 133 | /// 134 | /// 字符串信息 135 | public override string ToString( ) 136 | { 137 | return "[Modbus设备] " + Name; 138 | } 139 | 140 | #endregion 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Device/NodeOmron.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | 8 | namespace SharpNodeSettings.Node.Device 9 | { 10 | /// 11 | /// 指示欧姆龙对象的设备节点信息 12 | /// 13 | public class NodeOmron : DeviceNode, IXmlConvert 14 | { 15 | 16 | #region Constructor 17 | 18 | /// 19 | /// 使用默认的参数实例化一个设备信息 20 | /// 21 | public NodeOmron( ) 22 | { 23 | Name = "欧姆龙设备"; 24 | Description = "此设备安装在角落,编号0001"; 25 | DeviceType = DeviceNode.Omron; 26 | 27 | IpAddress = "192.168.0.3"; 28 | Port = 9600; 29 | 30 | } 31 | 32 | 33 | #endregion 34 | 35 | #region Public Properties 36 | 37 | 38 | /// 39 | /// 设备的Ip地址 40 | /// 41 | public string IpAddress { get; set; } 42 | 43 | 44 | /// 45 | /// 设备的端口号 46 | /// 47 | public int Port { get; set; } 48 | 49 | 50 | /// 51 | /// PLC单元号 52 | /// 53 | public byte DA2 { get; set; } = 0x00; 54 | 55 | /// 56 | /// PLC的节点地址 57 | /// 58 | public byte DA1 { get; set; } = 0x0B; 59 | 60 | /// 61 | /// 上位机的节点地址 62 | /// 63 | public byte SA1 { get; set; } = 0x0C; 64 | 65 | 66 | 67 | #endregion 68 | 69 | 70 | #region Xml Interface 71 | 72 | /// 73 | /// 对象从xml元素解析,初始化指定的数据 74 | /// 75 | /// 包含节点信息的Xml元素 76 | public override void LoadByXmlElement( XElement element ) 77 | { 78 | base.LoadByXmlElement( element ); 79 | IpAddress = element.Attribute( "IpAddress" ).Value; 80 | Port = int.Parse( element.Attribute( "Port" ).Value ); 81 | SA1 = byte.Parse( element.Attribute( "SA1" ).Value ); 82 | DA1 = byte.Parse( element.Attribute( "DA1" ).Value ); 83 | DA2 = byte.Parse( element.Attribute( "DA2" ).Value ); 84 | } 85 | 86 | /// 87 | /// 对象解析为Xml元素,方便的存储 88 | /// 89 | /// 包含节点信息的Xml元素 90 | public override XElement ToXmlElement( ) 91 | { 92 | XElement element = base.ToXmlElement( ); 93 | element.SetAttributeValue( "IpAddress", IpAddress ); 94 | element.SetAttributeValue( "Port", Port.ToString( ) ); 95 | element.SetAttributeValue( "SA1", SA1.ToString( ) ); 96 | element.SetAttributeValue( "DA1", DA1.ToString( ) ); 97 | element.SetAttributeValue( "DA2", DA2.ToString( ) ); 98 | return element; 99 | } 100 | 101 | #endregion 102 | 103 | #region Overide Method 104 | 105 | /// 106 | /// 获取用于在数据表信息中显示的键值数据对信息 107 | /// 108 | /// 键值数据对列表 109 | public override List GetNodeClassRenders( ) 110 | { 111 | var list = base.GetNodeClassRenders( ); 112 | list.Add( NodeClassRenderItem.CreateIpAddress( IpAddress ) ); 113 | list.Add( NodeClassRenderItem.CreateIpPort( Port ) ); 114 | list.Add( new NodeClassRenderItem( "上位机节点号", SA1.ToString( ) ) ); 115 | list.Add( new NodeClassRenderItem( "PLC节点号", DA1.ToString( ) ) ); 116 | list.Add( new NodeClassRenderItem( "PLC单元号", DA2.ToString( ) ) ); 117 | 118 | return list; 119 | } 120 | 121 | #endregion 122 | 123 | #region Object Override 124 | 125 | /// 126 | /// 返回表示当前对象的字符串 127 | /// 128 | /// 字符串信息 129 | public override string ToString( ) 130 | { 131 | return "[欧姆龙设备] " + Name; 132 | } 133 | 134 | #endregion 135 | 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Device/NodeSiemens.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | 8 | namespace SharpNodeSettings.Node.Device 9 | { 10 | public class NodeSiemens : DeviceNode, IXmlConvert 11 | { 12 | 13 | #region Constructor 14 | 15 | /// 16 | /// 使用默认的参数实例化一个设备信息 17 | /// 18 | public NodeSiemens( ) 19 | { 20 | Name = "西门子设备"; 21 | Description = "此设备安装在角落,编号0001"; 22 | DeviceType = DeviceNode.Siemens; 23 | 24 | IpAddress = "192.168.0.3"; 25 | Port = 102; 26 | 27 | PlcType = PLC1200; 28 | } 29 | 30 | 31 | #endregion 32 | 33 | #region Public Properties 34 | 35 | 36 | /// 37 | /// 设备的Ip地址 38 | /// 39 | public string IpAddress { get; set; } 40 | 41 | 42 | /// 43 | /// 设备的端口号 44 | /// 45 | public int Port { get; set; } 46 | 47 | 48 | /// 49 | /// 选择的是什么类型的PLC 50 | /// 51 | public string PlcType { get; set; } 52 | 53 | 54 | #endregion 55 | 56 | #region Xml Interface 57 | 58 | 59 | /// 60 | /// 对象从xml元素解析,初始化指定的数据 61 | /// 62 | /// 包含节点信息的Xml元素 63 | public override void LoadByXmlElement( XElement element ) 64 | { 65 | base.LoadByXmlElement( element ); 66 | IpAddress = element.Attribute( "IpAddress" ).Value; 67 | Port = int.Parse( element.Attribute( "Port" ).Value ); 68 | PlcType = element.Attribute( "PlcType" ).Value; 69 | } 70 | 71 | /// 72 | /// 对象解析为Xml元素,方便的存储 73 | /// 74 | /// 包含节点信息的Xml元素 75 | public override XElement ToXmlElement( ) 76 | { 77 | XElement element = base.ToXmlElement( ); 78 | element.SetAttributeValue( "IpAddress", IpAddress ); 79 | element.SetAttributeValue( "Port", Port ); 80 | element.SetAttributeValue( "PlcType", PlcType ); 81 | return element; 82 | } 83 | 84 | #endregion 85 | 86 | #region Overide Method 87 | 88 | /// 89 | /// 获取用于在数据表信息中显示的键值数据对信息 90 | /// 91 | /// 键值数据对列表 92 | public override List GetNodeClassRenders( ) 93 | { 94 | var list = base.GetNodeClassRenders( ); 95 | list.Add( NodeClassRenderItem.CreateIpAddress( IpAddress ) ); 96 | list.Add( NodeClassRenderItem.CreateIpPort( Port ) ); 97 | list.Add( NodeClassRenderItem.CreatePlcMode( PlcType ) ); 98 | 99 | return list; 100 | } 101 | 102 | #endregion 103 | 104 | #region Const Plc Types 105 | 106 | 107 | public const string PLC300 = "S7-300"; 108 | 109 | public const string PLC1200 = "S7-1200"; 110 | 111 | public const string PLC1500 = "S7-1500"; 112 | 113 | public const string PLC200Smart = "S7-200Smart"; 114 | 115 | public const string PLCFW = "Fetch/Write"; 116 | 117 | #endregion 118 | 119 | #region Object Override 120 | 121 | /// 122 | /// 返回表示当前对象的字符串 123 | /// 124 | /// 字符串信息 125 | public override string ToString( ) 126 | { 127 | return "[西门子设备] " + Name; 128 | } 129 | 130 | #endregion 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Device/NodeSimplifyNet.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | 8 | namespace SharpNodeSettings.Node.Device 9 | { 10 | /// 11 | /// SimplifyNet的设备信息 12 | /// 13 | public class NodeSimplifyNet : DeviceNode 14 | { 15 | #region Constructor 16 | 17 | /// 18 | /// 使用默认的参数实例化一个设备信息 19 | /// 20 | public NodeSimplifyNet( ) 21 | { 22 | Name = "SimplifyNet客户端"; 23 | Description = "设备用途的数据"; 24 | DeviceType = DeviceNode.SimplifyNet; 25 | 26 | IpAddress = "127.0.0.1"; 27 | Port = 6000; 28 | 29 | Token = Guid.Empty; 30 | } 31 | 32 | 33 | #endregion 34 | 35 | #region Public Properties 36 | 37 | 38 | /// 39 | /// 设备的Ip地址 40 | /// 41 | public string IpAddress { get; set; } 42 | 43 | 44 | /// 45 | /// 设备的端口号 46 | /// 47 | public int Port { get; set; } 48 | 49 | 50 | /// 51 | /// Token网络令牌 52 | /// 53 | public Guid Token { get; set; } 54 | 55 | 56 | #endregion 57 | 58 | #region Xml Interface 59 | 60 | public override void LoadByXmlElement( XElement element ) 61 | { 62 | base.LoadByXmlElement( element ); 63 | IpAddress = element.Attribute( "IpAddress" ).Value; 64 | Port = int.Parse( element.Attribute( "Port" ).Value ); 65 | Token = new Guid( element.Attribute( "Token" ).Value ); 66 | } 67 | 68 | public override XElement ToXmlElement( ) 69 | { 70 | XElement element = base.ToXmlElement( ); 71 | element.SetAttributeValue( "IpAddress", IpAddress ); 72 | element.SetAttributeValue( "Port", Port ); 73 | element.SetAttributeValue( "Token", Token.ToString( ) ); 74 | return element; 75 | } 76 | 77 | #endregion 78 | 79 | #region Overide Method 80 | 81 | public override List GetNodeClassRenders( ) 82 | { 83 | var list = base.GetNodeClassRenders( ); 84 | list.Add( NodeClassRenderItem.CreateIpAddress( IpAddress ) ); 85 | list.Add( NodeClassRenderItem.CreateIpPort( Port ) ); 86 | list.Add( new NodeClassRenderItem( "令牌", Token.ToString( ) ) ); 87 | 88 | return list; 89 | } 90 | 91 | 92 | #endregion 93 | 94 | #region Object Override 95 | 96 | /// 97 | /// 返回表示当前对象的字符串 98 | /// 99 | /// 字符串信息 100 | public override string ToString( ) 101 | { 102 | return "[电脑设备] " + Name; 103 | } 104 | 105 | #endregion 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/NodeBase/IXmlConvert.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Linq; 6 | 7 | namespace SharpNodeSettings.Node.NodeBase 8 | { 9 | /// 10 | /// 一个接口,表示该对象就有和Xml元素相互转换的能力 11 | /// 12 | interface IXmlConvert 13 | { 14 | 15 | /// 16 | /// 对象解析为Xml元素,方便的存储 17 | /// 18 | /// 包含节点信息的Xml元素 19 | XElement ToXmlElement( ); 20 | 21 | /// 22 | /// 对象从xml元素解析,初始化指定的数据 23 | /// 24 | /// 包含节点信息的Xml元素 25 | void LoadByXmlElement( XElement element ); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/NodeBase/NodeClass.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Linq; 6 | 7 | namespace SharpNodeSettings.Node.NodeBase 8 | { 9 | /// 10 | /// 节点信息,指示一个具体的分类,并且指定了所有节点的基类 11 | /// 12 | public class NodeClass : IXmlConvert 13 | { 14 | 15 | #region Constructor 16 | 17 | 18 | public NodeClass( ) 19 | { 20 | NodeType = NodeClassInfo.NodeClass; 21 | NodeHead = "NodeClass"; 22 | } 23 | 24 | 25 | #endregion 26 | 27 | #region Public Properties 28 | 29 | /// 30 | /// 节点的名称,在节点上显示的 31 | /// 32 | public string Name { get; set; } 33 | 34 | /// 35 | /// 描述信息 36 | /// 37 | public string Description { get; set; } 38 | 39 | 40 | /// 41 | /// 节点的类型,标记其派生类不同的类型对象 42 | /// 43 | public int NodeType { get; protected set; } 44 | 45 | 46 | #endregion 47 | 48 | #region Protect Member 49 | 50 | 51 | /// 52 | /// 节点的描述信息 53 | /// 54 | protected string NodeHead { get; set; } 55 | 56 | 57 | 58 | #endregion 59 | 60 | #region IXmlConvert Implement 61 | 62 | 63 | /// 64 | /// 对象从xml元素解析,初始化指定的数据 65 | /// 66 | /// 包含节点信息的Xml元素 67 | public virtual void LoadByXmlElement( XElement element ) 68 | { 69 | Name = element.Attribute( "Name" ).Value; 70 | Description = element.Attribute( "Description" ).Value; 71 | } 72 | 73 | /// 74 | /// 对象解析为Xml元素,方便的存储 75 | /// 76 | /// 包含节点信息的Xml元素 77 | public virtual XElement ToXmlElement( ) 78 | { 79 | XElement element = new XElement( NodeHead ); 80 | element.SetAttributeValue( "Name", Name ); 81 | element.SetAttributeValue( "Description", Description ); 82 | return element; 83 | } 84 | 85 | #endregion 86 | 87 | #region RenderValues 88 | 89 | 90 | /// 91 | /// 获取用于在数据表信息中显示的键值数据对信息 92 | /// 93 | /// 键值数据对列表 94 | public virtual List GetNodeClassRenders( ) 95 | { 96 | return new List( ) 97 | { 98 | NodeClassRenderItem.CreatNodeeName(Name), 99 | NodeClassRenderItem.CreateNodeDescription(Description), 100 | }; 101 | } 102 | 103 | 104 | #endregion 105 | 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/NodeBase/NodeClassInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNodeSettings.Node.NodeBase 7 | { 8 | /// 9 | /// 节点类相关的常用资源 10 | /// 11 | public class NodeClassInfo 12 | { 13 | #region 一级节点 14 | 15 | /// 16 | /// 系统的根节点信息 17 | /// 18 | public const int NodeRoot = 0; 19 | 20 | /// 21 | /// 普通的分类节点,允许再跟分类节点 22 | /// 23 | public const int NodeClass = 1; 24 | 25 | /// 26 | /// 设备节点信息,下面只能跟请求节点信息 27 | /// 28 | public const int DeviceNode = 2; 29 | 30 | /// 31 | /// 服务器类型Server的节点 32 | /// 33 | public const int ServerNode = 3; 34 | 35 | /// 36 | /// 解析规则的节点 37 | /// 38 | public const int RegularNode = 4; 39 | 40 | #endregion 41 | 42 | #region 二级节点 43 | 44 | /// 45 | /// 设备的请求信息 46 | /// 47 | public const int DeviceRequest = 100; 48 | 49 | /// 50 | /// 设备的解析规则的子节点 51 | /// 52 | public const int RegularItemNode = 200; 53 | 54 | #endregion 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Regular/RegularNode.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNodeSettings.Node.Regular 8 | { 9 | /// 10 | /// 字节解析规则节点,该节点下挂载解析节点的子项 11 | /// 12 | public class RegularNode : NodeClass 13 | { 14 | /// 15 | /// 实例化一个默认的解析对象 16 | /// 17 | public RegularNode( ) 18 | { 19 | this.NodeType = NodeClassInfo.RegularNode; 20 | this.NodeHead = "RegularNode"; 21 | } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Regular/RegularNodeTypeItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNodeSettings.Node.Regular 8 | { 9 | /// 10 | /// 单个规则配置项相关的类型资源,比如配置了什么类型的数据,多少长之类的 11 | /// 12 | public class RegularNodeTypeItem 13 | { 14 | #region Constructor 15 | 16 | /// 17 | /// 实例化一个默认的对象 18 | /// 19 | public RegularNodeTypeItem( ) 20 | { 21 | 22 | } 23 | 24 | /// 25 | /// 实例化信息 26 | /// 27 | /// 代号 28 | /// 文本 29 | /// 背景色 30 | /// 单位长度 31 | public RegularNodeTypeItem( int code, string text, Brush backColor, int length ) 32 | { 33 | Code = code; 34 | Text = text; 35 | BackColor = backColor; 36 | Length = length; 37 | } 38 | 39 | #endregion 40 | 41 | #region Public Properties 42 | 43 | /// 44 | /// 类型的代号 45 | /// 46 | public int Code { get; set; } 47 | 48 | /// 49 | /// 类型的文本描述 50 | /// 51 | public string Text { get; set; } 52 | 53 | /// 54 | /// 类型使用的背景色 55 | /// 56 | public Brush BackColor { get; set; } 57 | 58 | /// 59 | /// 类型的长度,仅仅是单个数据对象的长度 60 | /// 61 | public int Length { get; set; } 62 | 63 | #endregion 64 | 65 | #region Object Override 66 | 67 | /// 68 | /// 返回表示当前对象的字符串 69 | /// 70 | /// 字符串信息 71 | public override string ToString( ) 72 | { 73 | return Text; 74 | } 75 | 76 | #endregion 77 | 78 | #region Const Resource 79 | 80 | /// 81 | /// Bool数据类型 82 | /// 83 | public static readonly RegularNodeTypeItem Bool = new RegularNodeTypeItem( 1, "bool", Brushes.PaleGreen, 1 ); 84 | /// 85 | /// Byte数据类型 86 | /// 87 | public static readonly RegularNodeTypeItem Byte = new RegularNodeTypeItem( 2, "byt", Brushes.Aquamarine, 1 ); 88 | /// 89 | /// short数据类型 90 | /// 91 | public static readonly RegularNodeTypeItem Int16 = new RegularNodeTypeItem( 3, "short", Brushes.Pink, 2 ); 92 | /// 93 | /// ushort数据类型 94 | /// 95 | public static readonly RegularNodeTypeItem UInt16 = new RegularNodeTypeItem( 4, "ushort", Brushes.Gold, 2 ); 96 | /// 97 | /// int数据类型 98 | /// 99 | public static readonly RegularNodeTypeItem Int32 = new RegularNodeTypeItem( 5, "int", Brushes.BlanchedAlmond, 4 ); 100 | /// 101 | /// uint数据类型 102 | /// 103 | public static readonly RegularNodeTypeItem UInt32 = new RegularNodeTypeItem( 6, "uint", Brushes.DarkKhaki, 4 ); 104 | /// 105 | /// long数据类型 106 | /// 107 | public static readonly RegularNodeTypeItem Int64 = new RegularNodeTypeItem( 7, "long", Brushes.Khaki, 8 ); 108 | /// 109 | /// ulong数据类型 110 | /// 111 | public static readonly RegularNodeTypeItem UInt64 = new RegularNodeTypeItem( 8, "ulong", Brushes.Thistle, 8 ); 112 | /// 113 | /// float数据类型 114 | /// 115 | public static readonly RegularNodeTypeItem Float = new RegularNodeTypeItem( 9, "float", Brushes.Wheat, 4 ); 116 | /// 117 | /// double数据类型 118 | /// 119 | public static readonly RegularNodeTypeItem Double = new RegularNodeTypeItem( 10, "double", Brushes.LightGoldenrodYellow, 8 ); 120 | /// 121 | /// string数据类型,ASCII编码 122 | /// 123 | public static readonly RegularNodeTypeItem StringAscii = new RegularNodeTypeItem( 11, "ascii", Brushes.Yellow, 0 ); 124 | /// 125 | /// string数据类型,Unicode编码 126 | /// 127 | public static readonly RegularNodeTypeItem StringUnicode = new RegularNodeTypeItem( 12, "unicode", Brushes.YellowGreen, 0 ); 128 | /// 129 | /// string数据类型,UTF8编码 130 | /// 131 | public static readonly RegularNodeTypeItem StringUtf8 = new RegularNodeTypeItem( 13, "utf8", Brushes.SandyBrown, 0 ); 132 | 133 | 134 | public static RegularNodeTypeItem GetDataPraseItemByCode( int code ) 135 | { 136 | switch (code) 137 | { 138 | case 1: return Bool; 139 | case 2: return Byte; 140 | case 3: return Int16; 141 | case 4: return UInt16; 142 | case 5: return Int32; 143 | case 6: return UInt32; 144 | case 7: return Int64; 145 | case 8: return UInt64; 146 | case 9: return Float; 147 | case 10: return Double; 148 | case 11: return StringAscii; 149 | case 12: return StringUnicode; 150 | case 13: return StringUtf8; 151 | default: return new RegularNodeTypeItem( code, "none", Brushes.Black, 1 ); 152 | } 153 | } 154 | 155 | #endregion 156 | } 157 | 158 | } 159 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Request/DeviceRequest.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | 8 | namespace SharpNodeSettings.Node.Request 9 | { 10 | /// 11 | /// 通用的客户端模型,指示了一般的客户端模式下的,一次数据请求,一个客户端可以进行多次的数据请求 12 | /// 13 | public class DeviceRequest : NodeClass, IXmlConvert 14 | { 15 | #region Constructor 16 | 17 | /// 18 | /// 实例化一个对象 19 | /// 20 | public DeviceRequest( ) 21 | { 22 | Name = "数据请求"; 23 | Description = "一次完整的数据请求"; 24 | Address = "123"; 25 | Length = 10; 26 | CaptureInterval = 1000; 27 | PraseRegularCode = "ABCDEFG"; 28 | NodeType = NodeClassInfo.DeviceRequest; 29 | NodeHead = "DeviceRequest"; 30 | LastActiveTime = DateTime.Now.AddDays( -1 ); // 自动设置为一天以前 31 | } 32 | 33 | #endregion 34 | 35 | #region Node Properties 36 | 37 | 38 | /// 39 | /// 变量的地址 40 | /// 41 | public string Address { get; set; } 42 | 43 | /// 44 | /// 读取的数据长度 45 | /// 46 | public ushort Length { get; set; } 47 | 48 | /// 49 | /// 本次请求的时间间隔,单位为毫秒 50 | /// 51 | public int CaptureInterval { get; set; } 52 | 53 | /// 54 | /// 本次请求解析字节数据的规则 55 | /// 56 | public string PraseRegularCode { get; set; } 57 | 58 | #endregion 59 | 60 | #region Runtime Properties 61 | 62 | /// 63 | /// 上一次读取数据的时间节点 64 | /// 65 | public DateTime LastActiveTime { get; set; } 66 | 67 | 68 | /// 69 | /// 本次请求所有关联的节点信息 70 | /// 71 | public List RegularNodes { get; set; } 72 | 73 | /// 74 | /// 本次所请求的所有的字节数据在缓存中的位置 75 | /// 76 | public int WriteByteIndex { get; set; } 77 | 78 | #endregion 79 | 80 | #region Xml Support 81 | 82 | /// 83 | /// 对象从xml元素解析,初始化指定的数据 84 | /// 85 | /// 包含节点信息的Xml元素 86 | public override void LoadByXmlElement( XElement element ) 87 | { 88 | base.LoadByXmlElement( element ); 89 | Address = element.Attribute( "Address" ).Value; 90 | Length = ushort.Parse( element.Attribute( "Length" ).Value ); 91 | CaptureInterval = int.Parse( element.Attribute( "CaptureInterval" ).Value ); 92 | PraseRegularCode = element.Attribute( "PraseRegularCode" ).Value; 93 | } 94 | 95 | 96 | 97 | /// 98 | /// 对象解析为Xml元素,方便的存储 99 | /// 100 | /// 包含节点信息的Xml元素 101 | public override XElement ToXmlElement( ) 102 | { 103 | XElement element = base.ToXmlElement( ); 104 | element.SetAttributeValue( "Address", Address ); 105 | element.SetAttributeValue( "Length", Length ); 106 | element.SetAttributeValue( "CaptureInterval", CaptureInterval ); 107 | element.SetAttributeValue( "PraseRegularCode", PraseRegularCode ); 108 | 109 | return element; 110 | } 111 | 112 | 113 | #endregion 114 | 115 | #region Render Support 116 | 117 | /// 118 | /// 获取用于在数据表信息中显示的键值数据对信息 119 | /// 120 | /// 键值数据对列表 121 | public override List GetNodeClassRenders( ) 122 | { 123 | var result = base.GetNodeClassRenders( ); 124 | result.Add( new NodeClassRenderItem( ) 125 | { 126 | ValueName = "地址", 127 | Value = Address, 128 | } ); 129 | result.Add( new NodeClassRenderItem( ) 130 | { 131 | ValueName = "读取长度", 132 | Value = Length.ToString( ), 133 | } ); 134 | result.Add( new NodeClassRenderItem( ) 135 | { 136 | ValueName = "读取间隔", 137 | Value = CaptureInterval.ToString( ), 138 | } ); 139 | result.Add( new NodeClassRenderItem( ) 140 | { 141 | ValueName = "解析代号", 142 | Value = PraseRegularCode, 143 | } ); 144 | 145 | return result; 146 | } 147 | 148 | #endregion 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Server/AlienServerNode.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | 8 | namespace SharpNodeSettings.Node.Server 9 | { 10 | public class AlienServerNode : ServerNode 11 | { 12 | public AlienServerNode( ) 13 | { 14 | ServerType = ServerNode.AlienServer; 15 | 16 | Name = "异形服务器"; 17 | Description = "这是一个异形服务器"; 18 | } 19 | 20 | /// 21 | /// 密码,6位数,为空的话默认都是0x00 22 | /// 23 | public string Password { get; set; } 24 | 25 | 26 | #region Override Method 27 | 28 | /// 29 | /// 获取用于在数据表信息中显示的键值数据对信息 30 | /// 31 | /// 键值数据对列表 32 | public override List GetNodeClassRenders( ) 33 | { 34 | var list = base.GetNodeClassRenders( ); 35 | list.Add( NodeClassRenderItem.CreateIpPort( Port ) ); 36 | list.Add( NodeClassRenderItem.CreatePassword( Password ) ); 37 | return list; 38 | } 39 | 40 | /// 41 | /// 对象解析为Xml元素,方便的存储 42 | /// 43 | /// 包含节点信息的Xml元素 44 | public override XElement ToXmlElement( ) 45 | { 46 | XElement element = base.ToXmlElement( ); 47 | element.SetAttributeValue( "Password", Password ); ; 48 | element.SetAttributeValue( "Port", Port ); 49 | return element; 50 | } 51 | 52 | 53 | /// 54 | /// 对象从xml元素解析,初始化指定的数据 55 | /// 56 | /// 包含节点信息的Xml元素 57 | public override void LoadByXmlElement( XElement element ) 58 | { 59 | base.LoadByXmlElement( element ); 60 | Port = Convert.ToInt32( element.Attribute( "Port" ).Value ); 61 | Password = element.Attribute( "Password" ).Value; 62 | } 63 | 64 | #endregion 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Server/NodeModbusServer.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNodeSettings.Node.Server 8 | { 9 | public class NodeModbusServer : ServerNode 10 | { 11 | 12 | /// 13 | /// 实例化一个Modbus服务器的节点对象 14 | /// 15 | public NodeModbusServer( ) 16 | { 17 | Name = "Modbus 服务器"; 18 | Description = "这是一个Modbus服务器"; 19 | ServerType = ServerNode.ModbusServer; 20 | } 21 | 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SharpNodeSettings/Node/Server/ServerNode.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Node.NodeBase; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Linq; 7 | 8 | namespace SharpNodeSettings.Node.Server 9 | { 10 | /// 11 | /// 服务器节点的基类,包含了端口号信息,服务器类型,服务器创建时间等基本的要素 12 | /// 13 | public class ServerNode : NodeClass 14 | { 15 | 16 | #region Constructor 17 | 18 | /// 19 | /// 实例化一个默认的对象 20 | /// 21 | public ServerNode( ) 22 | { 23 | Port = 502; 24 | CreateTime = DateTime.Now; 25 | NodeType = NodeClassInfo.ServerNode; 26 | Description = "这是一个Alien服务器"; 27 | NodeHead = "ServerNode"; 28 | } 29 | 30 | 31 | #endregion 32 | 33 | /// 34 | /// 当前主站的端口号信息 35 | /// 36 | public int Port { get; set; } 37 | 38 | /// 39 | /// 服务器的创建日期 40 | /// 41 | public DateTime CreateTime { get; set; } 42 | 43 | /// 44 | /// 服务器的类别 45 | /// 46 | public int ServerType { get; set; } 47 | 48 | 49 | #region Override Method 50 | 51 | 52 | 53 | /// 54 | /// 对象解析为Xml元素,方便的存储 55 | /// 56 | /// 包含节点信息的Xml元素 57 | public override XElement ToXmlElement( ) 58 | { 59 | XElement element = base.ToXmlElement( ); 60 | element.SetAttributeValue( "CreateTime", CreateTime.ToString( ) ); ; 61 | element.SetAttributeValue( "Port", Port ); 62 | element.SetAttributeValue( "ServerType", ServerType ); 63 | return element; 64 | } 65 | 66 | /// 67 | /// 对象从xml元素解析,初始化指定的数据 68 | /// 69 | /// 包含节点信息的Xml元素 70 | public override void LoadByXmlElement( XElement element ) 71 | { 72 | base.LoadByXmlElement( element ); 73 | Port = Convert.ToInt32( element.Attribute( "Port" ).Value ); 74 | CreateTime = DateTime.Parse( element.Attribute( "CreateTime" ).Value ); 75 | ServerType = int.Parse( element.Attribute( "ServerType" ).Value ); 76 | } 77 | 78 | 79 | /// 80 | /// 获取用于在数据表信息中显示的键值数据对信息 81 | /// 82 | /// 键值数据对列表 83 | public override List GetNodeClassRenders( ) 84 | { 85 | var list = base.GetNodeClassRenders( ); 86 | list.Add( NodeClassRenderItem.CreateIpPort( Port ) ); 87 | list.Add( NodeClassRenderItem.CreateTime( CreateTime ) ); 88 | list.Add( new NodeClassRenderItem( "服务器类型", ServerType.ToString( ) ) ); 89 | return list; 90 | } 91 | 92 | 93 | #endregion 94 | 95 | 96 | 97 | #region Const Define 98 | 99 | /// 100 | /// Modbus服务器 101 | /// 102 | public const int ModbusServer = 1; 103 | 104 | /// 105 | /// 三菱的Qna兼容3E帧协议的客户端 106 | /// 107 | public const int AlienServer = 2; 108 | 109 | 110 | #endregion 111 | 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /SharpNodeSettings/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("SharpNodeSettings")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SharpNodeSettings")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("3cb75ae4-7129-4b65-9dc2-8e8c0264db0d")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion( "1.2.0.0" )] 36 | [assembly: AssemblyFileVersion( "1.2.0.0" )] 37 | -------------------------------------------------------------------------------- /SharpNodeSettings/Util.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Device; 2 | using SharpNodeSettings.Node.Device; 3 | using SharpNodeSettings.Node.Regular; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using System.Xml.Linq; 12 | 13 | namespace SharpNodeSettings 14 | { 15 | /// 16 | /// 节点配置类的工具辅助类 17 | /// 18 | public class Util 19 | { 20 | 21 | 22 | #region Static Method 23 | 24 | /// 25 | /// 子窗口的图标显示信息 26 | /// 27 | /// 28 | public static Icon GetWinformICon( ) 29 | { 30 | return Icon.ExtractAssociatedIcon( Application.ExecutablePath ); 31 | } 32 | 33 | 34 | 35 | /// 36 | /// 解析一个配置文件中的所有的规则解析,并返回一个词典信息 37 | /// 38 | /// 配置文件的根信息 39 | /// 词典 40 | public static Dictionary> ParesRegular( XElement nodeClass ) 41 | { 42 | Dictionary> regularkeyValuePairs = new Dictionary>( ); 43 | foreach (var xmlNode in nodeClass.Elements( )) 44 | { 45 | if (xmlNode.Attribute( "Name" ).Value == "Regular") 46 | { 47 | foreach (XElement element in xmlNode.Elements( "RegularNode" )) 48 | { 49 | List itemNodes = new List( ); 50 | foreach (XElement xmlItemNode in element.Elements( "RegularItemNode" )) 51 | { 52 | RegularItemNode regularItemNode = new RegularItemNode( ); 53 | regularItemNode.LoadByXmlElement( xmlItemNode ); 54 | itemNodes.Add( regularItemNode ); 55 | } 56 | 57 | if (regularkeyValuePairs.ContainsKey( element.Attribute( "Name" ).Value )) 58 | { 59 | regularkeyValuePairs[element.Attribute( "Name" ).Value] = itemNodes; 60 | } 61 | else 62 | { 63 | regularkeyValuePairs.Add( element.Attribute( "Name" ).Value, itemNodes ); 64 | } 65 | } 66 | } 67 | } 68 | return regularkeyValuePairs; 69 | } 70 | 71 | 72 | /// 73 | /// 通过真实配置的设备信息,来创建一个真实的设备,如果类型不存在,将返回null 74 | /// 75 | /// 设备的配置信息 76 | /// 真实的设备对象 77 | public static DeviceCore CreateFromXElement( XElement device ) 78 | { 79 | int deviceType = int.Parse( device.Attribute( "DeviceType" ).Value ); 80 | 81 | if (deviceType == DeviceNode.ModbusTcpAlien) 82 | { 83 | return new DeviceModbusTcpAlien( device ); 84 | } 85 | else if (deviceType == DeviceNode.ModbusTcpClient) 86 | { 87 | return new DeviceModbusTcp( device ); 88 | } 89 | else if (deviceType == DeviceNode.MelsecMcQna3E) 90 | { 91 | return new DeviceMelsecMc( device ); 92 | } 93 | else if (deviceType == DeviceNode.Omron) 94 | { 95 | return new DeviceOmron( device ); 96 | } 97 | else if (deviceType == DeviceNode.Siemens) 98 | { 99 | return new DeviceSiemens( device ); 100 | } 101 | else 102 | { 103 | return null; 104 | } 105 | } 106 | 107 | #endregion 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /SharpNodeSettings/View/FormSelectDevice.cs: -------------------------------------------------------------------------------- 1 | using SharpNodeSettings.Forms; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using System.Xml.Linq; 12 | 13 | namespace SharpNodeSettings.View 14 | { 15 | public partial class FormSelectDevice : Form 16 | { 17 | public FormSelectDevice( ) 18 | { 19 | InitializeComponent( ); 20 | } 21 | 22 | public XElement DeviceXml { get; set; } 23 | 24 | private void userButton1_Click( object sender, EventArgs e ) 25 | { 26 | // 三菱设备 27 | using(FormMelsec3E form = new FormMelsec3E( )) 28 | { 29 | if(form.ShowDialog()==DialogResult.OK) 30 | { 31 | DeviceXml = form.MelsecMc.ToXmlElement( ); 32 | textBox1.Text = DeviceXml.ToString( ); 33 | } 34 | } 35 | } 36 | 37 | private void userButton2_Click( object sender, EventArgs e ) 38 | { 39 | // 西门子设备 40 | using (FormSiemens form = new FormSiemens( )) 41 | { 42 | if (form.ShowDialog( ) == DialogResult.OK) 43 | { 44 | DeviceXml = form.NodeSiemens.ToXmlElement( ); 45 | textBox1.Text = DeviceXml.ToString( ); 46 | } 47 | } 48 | } 49 | 50 | private void userButton3_Click( object sender, EventArgs e ) 51 | { 52 | // 欧姆龙 53 | using (FormOmron form = new FormOmron( )) 54 | { 55 | if (form.ShowDialog( ) == DialogResult.OK) 56 | { 57 | DeviceXml = form.NodeOmron.ToXmlElement( ); 58 | textBox1.Text = DeviceXml.ToString( ); 59 | } 60 | } 61 | } 62 | 63 | private void userButton4_Click( object sender, EventArgs e ) 64 | { 65 | // Modbus Tcp 66 | using (FormModbusTcp form = new FormModbusTcp( )) 67 | { 68 | if (form.ShowDialog( ) == DialogResult.OK) 69 | { 70 | DeviceXml = form.ModbusTcpNode.ToXmlElement( ); 71 | textBox1.Text = DeviceXml.ToString( ); 72 | } 73 | } 74 | } 75 | 76 | private void userButton5_Click( object sender, EventArgs e ) 77 | { 78 | DialogResult = DialogResult.OK; 79 | return; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /SharpNodeSettings/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /XmlFile/HslCommunication.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/XmlFile/HslCommunication.dll -------------------------------------------------------------------------------- /XmlFile/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/XmlFile/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /XmlFile/SharpNodeSettings.Tools.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/XmlFile/SharpNodeSettings.Tools.exe -------------------------------------------------------------------------------- /XmlFile/SharpNodeSettings.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/XmlFile/SharpNodeSettings.dll -------------------------------------------------------------------------------- /XmlFile/settings.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /dll/BouncyCastle.Crypto.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/BouncyCastle.Crypto.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.Hosting.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.Hosting.Abstractions.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.Hosting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.Hosting.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.Http.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.Http.Abstractions.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.Http.Features.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.Http.Features.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.Http.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.Server.Kestrel.Https.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.Server.Kestrel.Https.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.Server.Kestrel.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.Server.Kestrel.dll -------------------------------------------------------------------------------- /dll/Microsoft.AspNetCore.WebUtilities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.AspNetCore.WebUtilities.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.Configuration.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.Configuration.Abstractions.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.Configuration.EnvironmentVariables.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.Configuration.EnvironmentVariables.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.Configuration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.Configuration.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.DependencyInjection.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.DependencyInjection.Abstractions.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.DependencyInjection.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.DependencyInjection.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.FileProviders.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.FileProviders.Abstractions.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.FileProviders.Physical.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.FileProviders.Physical.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.FileSystemGlobbing.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.FileSystemGlobbing.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.Logging.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.Logging.Abstractions.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.Logging.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.Logging.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.ObjectPool.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.ObjectPool.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.Options.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.Options.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.PlatformAbstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.PlatformAbstractions.dll -------------------------------------------------------------------------------- /dll/Microsoft.Extensions.Primitives.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Extensions.Primitives.dll -------------------------------------------------------------------------------- /dll/Microsoft.Net.Http.Headers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Microsoft.Net.Http.Headers.dll -------------------------------------------------------------------------------- /dll/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /dll/Opc.Ua.CertificateGenerator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Opc.Ua.CertificateGenerator.exe -------------------------------------------------------------------------------- /dll/Opc.Ua.Configuration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Opc.Ua.Configuration.dll -------------------------------------------------------------------------------- /dll/Opc.Ua.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Opc.Ua.Core.dll -------------------------------------------------------------------------------- /dll/Opc.Ua.Server.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Opc.Ua.Server.dll -------------------------------------------------------------------------------- /dll/Opc.Ua.ServerControls.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/Opc.Ua.ServerControls.dll -------------------------------------------------------------------------------- /dll/System.Buffers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Buffers.dll -------------------------------------------------------------------------------- /dll/System.Collections.Immutable.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Collections.Immutable.dll -------------------------------------------------------------------------------- /dll/System.Diagnostics.DiagnosticSource.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Diagnostics.DiagnosticSource.dll -------------------------------------------------------------------------------- /dll/System.Net.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Net.Http.dll -------------------------------------------------------------------------------- /dll/System.Numerics.Vectors.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Numerics.Vectors.dll -------------------------------------------------------------------------------- /dll/System.Reflection.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Reflection.Metadata.dll -------------------------------------------------------------------------------- /dll/System.Runtime.CompilerServices.Unsafe.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Runtime.CompilerServices.Unsafe.dll -------------------------------------------------------------------------------- /dll/System.Runtime.InteropServices.RuntimeInformation.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Runtime.InteropServices.RuntimeInformation.dll -------------------------------------------------------------------------------- /dll/System.Text.Encodings.Web.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Text.Encodings.Web.dll -------------------------------------------------------------------------------- /dll/System.Threading.Tasks.Extensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dathlin/SharpNodeSettings/de3d7e80248b5ff2f12fd0648c88a0595626ff66/dll/System.Threading.Tasks.Extensions.dll --------------------------------------------------------------------------------