Aggiunta preliminare codice x OPC-UA

This commit is contained in:
Samuele Locatelli
2021-03-25 18:25:25 +01:00
parent b11dcc4faf
commit f428298a01
934 changed files with 1149811 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+258
View File
@@ -0,0 +1,258 @@
# Rules in this file were initially inferred by Visual Studio IntelliCode from the UA-.NETStandard
# codebase based on best match to current usage at 12/15/2019
# You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style = space
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
end_of_line = crlf
insert_final_newline = true
# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2
# JSON files
[*.json]
indent_size = 2
###############################
# .NET Coding Conventions #
###############################
#### C# Formatting Rules ####
[*.cs]
# Null-checking preferences
csharp_style_throw_expression = true : suggestion
csharp_style_conditional_delegate_call = true : suggestion
# Modifier preferences
# require braces to be on a new line for control_blocks, types, and methods (also known as "Allman" style)
csharp_new_line_before_open_brace = control_blocks, types, methods, properties, accessors
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async : suggestion
csharp_new_line_before_catch = true
csharp_new_line_before_else = true : suggestion
csharp_new_line_before_finally = true : suggestion
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
#Formatting - organize using options
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
#Formatting - spacing options
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
#Formatting - wrapping options
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
#Pattern - matching preferences
csharp_style_pattern_local_over_anonymous_function = true : suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true : suggestion
csharp_style_pattern_matching_over_as_with_null_check = true : suggestion
#Style - expression bodied member options
csharp_style_expression_bodied_operators = false : silent
csharp_style_expression_bodied_indexers = true : silent
csharp_style_expression_bodied_accessors = true : suggestion
csharp_style_expression_bodied_constructors = false : suggestion
csharp_style_expression_bodied_methods = false : suggestion
csharp_style_expression_bodied_properties = true : silent
#Style - expression level options
csharp_prefer_braces = true : silent
csharp_style_deconstructed_variable_declaration = true : suggestion
csharp_prefer_simple_default_expression = true : suggestion
csharp_style_inlined_variable_declaration = false : suggestion
dotnet_style_predefined_type_for_member_access = false : suggestion
#Style - implicit and explicit types
csharp_style_var_for_built_in_types = false : silent
csharp_style_var_when_type_is_apparent = true : silent
csharp_style_var_elsewhere = false : silent
#Style - language keyword and framework type options
#prefer the language keyword for local variables, method parameters, and class members,
#instead of the type name, for types that have a keyword to represent them
dotnet_style_predefined_type_for_locals_parameters_members = true : suggestion
#Style - qualification options
dotnet_style_qualification_for_event = false : suggestion
dotnet_style_qualification_for_field = false : suggestion
dotnet_style_qualification_for_method = false : suggestion
dotnet_style_qualification_for_property = false : suggestion
#Style - Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity : silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity : silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity : silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary : silent
#Style - Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members : silent
dotnet_style_readonly_field = true : suggestion
#Style - Expression-level preferences
dotnet_style_object_initializer = true : suggestion
dotnet_style_collection_initializer = true : suggestion
dotnet_style_explicit_tuple_names = true : suggestion
dotnet_style_null_propagation = true : suggestion
dotnet_style_coalesce_expression = true : suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true : silent
dotnet_style_prefer_inferred_tuple_names = true : suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true : suggestion
dotnet_style_prefer_auto_properties = true : silent
dotnet_style_prefer_conditional_expression_over_assignment = true : suggestion
dotnet_style_prefer_conditional_expression_over_return = true : suggestion
# Naming rules
# Private Constants are PascalCase and start with k
dotnet_naming_rule.constants_private_should_start_with_k.severity = suggestion
dotnet_naming_rule.constants_private_should_start_with_k.symbols = constants_with_k
dotnet_naming_rule.constants_private_should_start_with_k.style = constants_with_k_style
dotnet_naming_symbols.constants_with_k.applicable_kinds = field, local
dotnet_naming_symbols.constants_with_k.applicable_accessibilities = private, protected, private_protected, protected_friend
dotnet_naming_symbols.constants_with_k.required_modifiers = const
dotnet_naming_style.constants_with_k_style.capitalization = pascal_case
dotnet_naming_style.constants_with_k_style.required_prefix = k
# Constants are PascalCase
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.applicable_accessibilities = public, internal, protected_internal
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_style.constant_style.capitalization = pascal_case
# Non-private readonly fields are PascalCase
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_field_style
dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
dotnet_naming_style.non_private_readonly_field_style.capitalization = pascal_case
# Non-private static fields are PascalCase
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style
dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_static_fields.required_modifiers = static
dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
# Private static fields are camelCase and start with s_
dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, protected, private_protected, protected_friend
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_style.static_field_style.capitalization = camel_case
dotnet_naming_style.static_field_style.required_prefix = s_
# Private instance fields are camelCase and start with m_
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
dotnet_naming_symbols.instance_fields.applicable_kinds = field
dotnet_naming_symbols.instance_fields.applicable_accessibilities = private, protected, private_protected, protected_friend
dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix = m_
# Locals and parameters are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
dotnet_naming_style.camel_case_style.capitalization = camel_case
# Local functions are PascalCase
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
dotnet_naming_style.local_function_style.capitalization = pascal_case
# By default, name items with PascalCase
dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.all_members.applicable_kinds = *
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
+30
View File
@@ -0,0 +1,30 @@
# Default behavior: if Git thinks a file is text (as opposed to binary), it
# will normalize line endings to LF in the repository, but convert to your
# platform's native line endings on checkout (e.g., CRLF for Windows).
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout. E.g.,
# *.txt text
# Declare files that will always have CRLF line endings on checkout. E.g.,
#*.sln text eol=crlf
# Declare files that will always have LF line endings on checkout. E.g.,
*.sh text eol=lf
*.json text eol=lf
# Denote all files that should not have line endings normalized, should not be
# merged, and should not show in a textual diff.
*.docm binary
*.docx binary
*.ico binary
*.lib binary
*.png binary
*.pptx binary
*.snk binary
*.vsdx binary
*.xps binary
# OPC UA
*.uanodes binary
+248
View File
@@ -0,0 +1,248 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Microsoft Azure ApplicationInsights config file
ApplicationInsights.config
# Windows Store app package directory
AppPackages/
BundleArtifacts/
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
# FAKE - F# Make
.fake/
# OPC UA Sample app certificate stores
OPC\ Foundation/
*.der
*.pfx
/UA-NetStandard.VC.db
*.log.txt
/ComIOP/Wrapper/ProxyServer/OpcUaComProxyServer.h
*.VC.db
/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.xml
/SampleApplications/Samples/OPCOutput
!**/Assets/*.*
+8
View File
@@ -0,0 +1,8 @@
{
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure"
},
"issueSettings": {
"minSeverityLevel": "HIGH"
}
}
@@ -0,0 +1,65 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class AttributeListCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
}
#endregion
}
}
@@ -0,0 +1,417 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays a list of attributes and their values.
/// </summary>
public partial class AttributeListCtrl : Opc.Ua.Client.Controls.BaseListCtrl
{
/// <summary>
/// Initializes a new instance of the <see cref="AttributeListCtrl"/> class.
/// </summary>
public AttributeListCtrl()
{
InitializeComponent();
SetColumns(m_ColumnNames);
}
#region Private Fields
private Session m_session;
// The columns to display in the control.
private readonly object[][] m_ColumnNames = new object[][]
{
new object[] { "Name", HorizontalAlignment.Left, null },
new object[] { "Value", HorizontalAlignment.Left, null }
};
private class ItemInfo
{
public NodeId NodeId;
public uint AttributeId;
public string Name;
public DataValue Value;
}
#endregion
/// <summary>
/// Initializes the control with a set of items.
/// </summary>
public void Initialize(Session session, ExpandedNodeId nodeId)
{
ItemsLV.Items.Clear();
m_session = session;
if (m_session == null)
{
return;
}
ILocalNode node = m_session.NodeCache.Find(nodeId) as ILocalNode;
if (node == null)
{
return;
}
uint[] attributesIds = Attributes.GetIdentifiers();
for (int ii = 0; ii < attributesIds.Length; ii++)
{
uint attributesId = attributesIds[ii];
if (!node.SupportsAttribute(attributesId))
{
continue;
}
ItemInfo info = new ItemInfo();
info.NodeId = node.NodeId;
info.AttributeId = attributesId;
info.Name = Attributes.GetBrowseName(attributesId);
info.Value = new DataValue(StatusCodes.BadWaitingForInitialData);
ServiceResult result = node.Read(null, attributesId, info.Value);
if (ServiceResult.IsBad(result))
{
info.Value = new DataValue(result.StatusCode);
}
AddItem(info);
}
IList<IReference> references = node.References.Find(ReferenceTypes.HasProperty, false, true, m_session.TypeTree);
for (int ii = 0; ii < references.Count; ii++)
{
IReference reference = references[ii];
ILocalNode property = m_session.NodeCache.Find(reference.TargetId) as ILocalNode;
if (property == null)
{
return;
}
ItemInfo info = new ItemInfo();
info.NodeId = property.NodeId;
info.AttributeId = Attributes.Value;
info.Name = Utils.Format("{0}", property.DisplayName);
info.Value = new DataValue(StatusCodes.BadWaitingForInitialData);
ServiceResult result = property.Read(null, Attributes.Value, info.Value);
if (ServiceResult.IsBad(result))
{
info.Value = new DataValue(result.StatusCode);
}
AddItem(info);
}
UpdateValues();
}
/// <summary>
/// Updates the values from the server.
/// </summary>
private void UpdateValues()
{
ReadValueIdCollection valuesToRead = new ReadValueIdCollection();
foreach (ListViewItem item in ItemsLV.Items)
{
ItemInfo info = item.Tag as ItemInfo;
if (info == null)
{
continue;
}
ReadValueId valueToRead = new ReadValueId();
valueToRead.NodeId = info.NodeId;
valueToRead.AttributeId = info.AttributeId;
valueToRead.Handle = item;
valuesToRead.Add(valueToRead);
}
DataValueCollection results;
DiagnosticInfoCollection diagnosticInfos;
m_session.Read(
null,
0,
TimestampsToReturn.Neither,
valuesToRead,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, valuesToRead);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, valuesToRead);
for (int ii = 0; ii < valuesToRead.Count; ii++)
{
ListViewItem item = (ListViewItem)valuesToRead[ii].Handle;
ItemInfo info = (ItemInfo)item.Tag;
info.Value = results[ii];
UpdateItem(item, info);
}
AdjustColumns();
}
/// <summary>
/// Formats the value of an attribute.
/// </summary>
private string FormatAttributeValue(uint attributeId, object value)
{
switch (attributeId)
{
case Attributes.NodeClass:
{
if (value != null)
{
return String.Format("{0}", Enum.ToObject(typeof(NodeClass), value));
}
return "(null)";
}
case Attributes.DataType:
{
NodeId datatypeId = value as NodeId;
if (datatypeId != null)
{
INode datatype = m_session.NodeCache.Find(datatypeId);
if (datatype != null)
{
return String.Format("{0}", datatype.DisplayName.Text);
}
else
{
return String.Format("{0}", datatypeId);
}
}
return String.Format("{0}", value);
}
case Attributes.ValueRank:
{
int? valueRank = value as int?;
if (valueRank != null)
{
switch (valueRank.Value)
{
case ValueRanks.Scalar: return "Scalar";
case ValueRanks.OneDimension: return "OneDimension";
case ValueRanks.OneOrMoreDimensions: return "OneOrMoreDimensions";
case ValueRanks.Any: return "Any";
default:
{
return String.Format("{0}", valueRank.Value);
}
}
}
return String.Format("{0}", value);
}
case Attributes.MinimumSamplingInterval:
{
double? minimumSamplingInterval = value as double?;
if (minimumSamplingInterval != null)
{
if (minimumSamplingInterval.Value == MinimumSamplingIntervals.Indeterminate)
{
return "Indeterminate";
}
else if (minimumSamplingInterval.Value == MinimumSamplingIntervals.Continuous)
{
return "Continuous";
}
return String.Format("{0}", minimumSamplingInterval.Value);
}
return String.Format("{0}", value);
}
case Attributes.AccessLevel:
case Attributes.UserAccessLevel:
{
byte accessLevel = Convert.ToByte(value);
StringBuilder bits = new StringBuilder();
if ((accessLevel & AccessLevels.CurrentRead) != 0)
{
bits.Append("Readable");
}
if ((accessLevel & AccessLevels.CurrentWrite) != 0)
{
if (bits.Length > 0)
{
bits.Append(" | ");
}
bits.Append("Writeable");
}
if ((accessLevel & AccessLevels.HistoryRead) != 0)
{
if (bits.Length > 0)
{
bits.Append(" | ");
}
bits.Append("History Read");
}
if ((accessLevel & AccessLevels.HistoryWrite) != 0)
{
if (bits.Length > 0)
{
bits.Append(" | ");
}
bits.Append("History Update");
}
if (bits.Length == 0)
{
bits.Append("No Access");
}
return String.Format("{0}", bits);
}
case Attributes.EventNotifier:
{
byte notifier = Convert.ToByte(value);
StringBuilder bits = new StringBuilder();
if ((notifier & EventNotifiers.SubscribeToEvents) != 0)
{
bits.Append("Subscribe");
}
if ((notifier & EventNotifiers.HistoryRead) != 0)
{
if (bits.Length > 0)
{
bits.Append(" | ");
}
bits.Append("History");
}
if ((notifier & EventNotifiers.HistoryWrite) != 0)
{
if (bits.Length > 0)
{
bits.Append(" | ");
}
bits.Append("History Update");
}
if (bits.Length == 0)
{
bits.Append("No Access");
}
return String.Format("{0}", bits);
}
default:
{
return String.Format("{0}", value);
}
}
}
#region Overridden Methods
/// <see cref="Opc.Ua.Client.Controls.BaseListCtrl.UpdateItem(ListViewItem,object)" />
protected override void UpdateItem(ListViewItem listItem, object item)
{
ItemInfo info = item as ItemInfo;
if (info == null)
{
base.UpdateItem(listItem, item);
return;
}
listItem.SubItems[0].Text = Utils.Format("{0}", info.Name);
if (StatusCode.IsBad(info.Value.StatusCode))
{
listItem.SubItems[1].Text = Utils.Format("{0}", info.Value.StatusCode);
}
else
{
listItem.SubItems[1].Text = FormatAttributeValue(info.AttributeId, info.Value.Value);
}
if (info.AttributeId != Attributes.Value)
{
listItem.ImageKey = GuiUtils.Icons.Attribute;
}
else
{
listItem.ImageKey = GuiUtils.Icons.Property;
}
listItem.Tag = info;
}
#endregion
}
}
@@ -0,0 +1,65 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class BrowseListCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
}
#endregion
}
}
@@ -0,0 +1,150 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays a list of references for a node.
/// </summary>
public partial class BrowseListCtrl : Opc.Ua.Client.Controls.BaseListCtrl
{
/// <summary>
/// Initializes a new instance of the <see cref="BrowseListCtrl"/> class.
/// </summary>
public BrowseListCtrl()
{
InitializeComponent();
SetColumns(m_ColumnNames);
}
#region Private Fields
private Session m_session;
// The columns to display in the control.
private readonly object[][] m_ColumnNames = new object[][]
{
new object[] { "Type", HorizontalAlignment.Left, null },
new object[] { "Target", HorizontalAlignment.Left, null }
};
#endregion
/// <summary>
/// Initializes the control with a set of items.
/// </summary>
public void Initialize(Session session, ExpandedNodeId nodeId)
{
ItemsLV.Items.Clear();
m_session = session;
if (m_session == null)
{
return;
}
ILocalNode node = m_session.NodeCache.Find(nodeId) as ILocalNode;
if (node == null)
{
return;
}
IList<IReference> references = null;
references = node.References.Find(ReferenceTypes.NonHierarchicalReferences, false, true, m_session.TypeTree);
for (int ii = 0; ii < references.Count; ii++)
{
AddItem(references[ii]);
}
references = node.References.Find(ReferenceTypes.NonHierarchicalReferences, true, true, m_session.TypeTree);
for (int ii = 0; ii < references.Count; ii++)
{
AddItem(references[ii]);
}
AdjustColumns();
}
#region Overridden Methods
/// <see cref="Opc.Ua.Client.Controls.BaseListCtrl.UpdateItem(ListViewItem,object)" />
protected override void UpdateItem(ListViewItem listItem, object item)
{
IReference reference = item as IReference;
if (reference == null)
{
base.UpdateItem(listItem, item);
return;
}
IReferenceType referenceType = m_session.NodeCache.Find(reference.ReferenceTypeId) as IReferenceType;
if (referenceType != null)
{
if (reference.IsInverse)
{
listItem.SubItems[0].Text = Utils.Format("{0}", referenceType.InverseName);
}
else
{
listItem.SubItems[0].Text = Utils.Format("{0}", referenceType.DisplayName);
}
}
else
{
listItem.SubItems[0].Text = Utils.Format("{0}", reference.ReferenceTypeId);
}
INode target = m_session.NodeCache.Find(reference.TargetId) as INode;
if (target != null)
{
listItem.SubItems[1].Text = Utils.Format("{0}", target.DisplayName);
}
else
{
listItem.SubItems[1].Text = Utils.Format("{0}", reference.TargetId);
}
listItem.ImageKey = GuiUtils.GetTargetIcon(m_session, NodeClass.ReferenceType, null);
listItem.Tag = reference;
}
#endregion
}
}
@@ -0,0 +1,171 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class BrowseTreeCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.TopPN = new System.Windows.Forms.Panel();
this.RootBTN = new System.Windows.Forms.Button();
this.BrowseDirectionCTRL = new System.Windows.Forms.ComboBox();
this.PopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.SelectMI = new System.Windows.Forms.ToolStripMenuItem();
this.SelectChildrenMI = new System.Windows.Forms.ToolStripMenuItem();
this.ReferenceTypeCTRL = new Opc.Ua.Client.Controls.ReferenceTypeCtrl();
this.TopPN.SuspendLayout();
this.PopupMenu.SuspendLayout();
this.SuspendLayout();
//
// NodesTV
//
this.NodesTV.ContextMenuStrip = this.PopupMenu;
this.NodesTV.LineColor = System.Drawing.Color.Black;
this.NodesTV.Location = new System.Drawing.Point(0, 24);
this.NodesTV.Size = new System.Drawing.Size(325, 192);
//
// TopPN
//
this.TopPN.Controls.Add(this.RootBTN);
this.TopPN.Controls.Add(this.ReferenceTypeCTRL);
this.TopPN.Controls.Add(this.BrowseDirectionCTRL);
this.TopPN.Dock = System.Windows.Forms.DockStyle.Top;
this.TopPN.Location = new System.Drawing.Point(0, 0);
this.TopPN.Name = "TopPN";
this.TopPN.Size = new System.Drawing.Size(325, 24);
this.TopPN.TabIndex = 3;
//
// RootBTN
//
this.RootBTN.Location = new System.Drawing.Point(0, 0);
this.RootBTN.Name = "RootBTN";
this.RootBTN.Size = new System.Drawing.Size(42, 23);
this.RootBTN.TabIndex = 2;
this.RootBTN.Text = "Root";
this.RootBTN.UseVisualStyleBackColor = true;
this.RootBTN.Click += new System.EventHandler(this.RootBTN_Click);
//
// BrowseDirectionCTRL
//
this.BrowseDirectionCTRL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BrowseDirectionCTRL.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.BrowseDirectionCTRL.FormattingEnabled = true;
this.BrowseDirectionCTRL.Location = new System.Drawing.Point(254, 1);
this.BrowseDirectionCTRL.Name = "BrowseDirectionCTRL";
this.BrowseDirectionCTRL.Size = new System.Drawing.Size(71, 21);
this.BrowseDirectionCTRL.TabIndex = 0;
this.BrowseDirectionCTRL.SelectedIndexChanged += new System.EventHandler(this.BrowseDirectionCTRL_SelectedIndexChanged);
//
// PopupMenu
//
this.PopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.SelectMI,
this.SelectChildrenMI});
this.PopupMenu.Name = "PopupMenu";
this.PopupMenu.Size = new System.Drawing.Size(146, 48);
//
// SelectMI
//
this.SelectMI.Name = "SelectMI";
this.SelectMI.Size = new System.Drawing.Size(145, 22);
this.SelectMI.Text = "Select";
this.SelectMI.Click += new System.EventHandler(this.SelectMI_Click);
//
// SelectChildrenMI
//
this.SelectChildrenMI.Name = "SelectChildrenMI";
this.SelectChildrenMI.Size = new System.Drawing.Size(145, 22);
this.SelectChildrenMI.Text = "Select Children";
this.SelectChildrenMI.Click += new System.EventHandler(this.SelectChildrenMI_Click);
//
// ReferenceTypeCTRL
//
this.ReferenceTypeCTRL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ReferenceTypeCTRL.Location = new System.Drawing.Point(48, 1);
this.ReferenceTypeCTRL.MaximumSize = new System.Drawing.Size(4096, 21);
this.ReferenceTypeCTRL.MinimumSize = new System.Drawing.Size(200, 21);
this.ReferenceTypeCTRL.Name = "ReferenceTypeCTRL";
this.ReferenceTypeCTRL.SelectedTypeId = null;
this.ReferenceTypeCTRL.Size = new System.Drawing.Size(200, 21);
this.ReferenceTypeCTRL.TabIndex = 1;
this.ReferenceTypeCTRL.ReferenceSelectionChanged += new System.EventHandler<Opc.Ua.Client.Controls.ReferenceTypeCtrl.ReferenceSelectedEventArgs>(this.ReferenceTypeCTRL_ReferenceSelectionChanged);
//
// BrowseTreeCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.Controls.Add(this.TopPN);
this.MinimumSize = new System.Drawing.Size(325, 216);
this.Name = "BrowseTreeCtrl";
this.Size = new System.Drawing.Size(325, 216);
this.Controls.SetChildIndex(this.TopPN, 0);
this.Controls.SetChildIndex(this.NodesTV, 0);
this.TopPN.ResumeLayout(false);
this.PopupMenu.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel TopPN;
private Opc.Ua.Client.Controls.ReferenceTypeCtrl ReferenceTypeCTRL;
private System.Windows.Forms.ComboBox BrowseDirectionCTRL;
private System.Windows.Forms.Button RootBTN;
private System.Windows.Forms.ContextMenuStrip PopupMenu;
private System.Windows.Forms.ToolStripMenuItem SelectMI;
private System.Windows.Forms.ToolStripMenuItem SelectChildrenMI;
}
}
@@ -0,0 +1,488 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Reflection;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays a hierarchy of nodes.
/// </summary>
public partial class BrowseTreeCtrl : Opc.Ua.Client.Controls.BaseTreeCtrl
{
/// <summary>
/// Initializes a new instance of the <see cref="BrowseTreeCtrl"/> class.
/// </summary>
public BrowseTreeCtrl()
{
InitializeComponent();
foreach (BrowseDirection value in Enum.GetValues(typeof(BrowseDirection)))
{
BrowseDirectionCTRL.Items.Add(value);
}
}
private NodeId m_rootId;
private NodeId m_viewId;
private Session m_session;
private NodeId m_referenceTypeId;
private BrowseDirection m_browseDirection;
private BrowseListCtrl m_referencesCTRL;
private AttributeListCtrl m_attributesCTRL;
private event EventHandler<NodesSelectedEventArgs> m_nodesSelected;
/// <summary>
/// The control that displays the non-hierarchial references for the selected node.
/// </summary>
public BrowseListCtrl ReferencesCTRL
{
get { return m_referencesCTRL; }
set { m_referencesCTRL = value; }
}
/// <summary>
/// The control that displays the attributes/properties for the selected node.
/// </summary>
public AttributeListCtrl AttributesCTRL
{
get { return m_attributesCTRL; }
set { m_attributesCTRL = value; }
}
/// <summary>
/// Raised when the select menu item is clicked.
/// </summary>
public event EventHandler<NodesSelectedEventArgs> NodesSelected
{
add { m_nodesSelected += value; }
remove { m_nodesSelected -= value; }
}
#region NodesSelectedEventArgs Class
/// <summary>
/// Specifies the nodes that where selected in the control.
/// </summary>
public class NodesSelectedEventArgs : EventArgs
{
/// <summary>
/// Constructs a new object.
/// </summary>
public NodesSelectedEventArgs(IList<ReferenceDescription> nodes)
{
m_nodes = nodes;
}
/// <summary>
/// The nodes that where selected.
/// </summary>
public IList<ReferenceDescription> Nodes
{
get { return m_nodes; }
}
private IList<ReferenceDescription> m_nodes;
}
#endregion
/// <summary>
/// Displays the a root in the control.
/// </summary>
public void Initialize(
Session session,
NodeId rootId,
NodeId viewId,
NodeId referenceTypeId,
BrowseDirection browseDirection)
{
m_session = session;
m_rootId = rootId;
m_viewId = viewId;
m_referenceTypeId = referenceTypeId;
m_browseDirection = browseDirection;
NodesTV.Nodes.Clear();
if (m_session == null)
{
return;
}
if (NodeId.IsNull(m_rootId))
{
m_rootId = Objects.RootFolder;
}
if (NodeId.IsNull(m_referenceTypeId))
{
m_referenceTypeId = ReferenceTypeIds.HierarchicalReferences;
}
ReferenceTypeCTRL.Initialize(m_session, ReferenceTypeIds.HierarchicalReferences);
ReferenceTypeCTRL.SelectedTypeId = m_referenceTypeId;
ILocalNode root = m_session.NodeCache.Find(m_rootId) as ILocalNode;
if (root == null)
{
return;
}
ReferenceDescription reference = new ReferenceDescription();
reference.ReferenceTypeId = referenceTypeId;
reference.IsForward = true;
reference.NodeId = root.NodeId;
reference.NodeClass = root.NodeClass;
reference.BrowseName = root.BrowseName;
reference.DisplayName = root.DisplayName;
reference.TypeDefinition = root.TypeDefinitionId;
TreeNode rootNode = new TreeNode(reference.ToString());
rootNode.ImageKey = rootNode.SelectedImageKey = GuiUtils.GetTargetIcon(session, reference);
rootNode.Tag = reference;
rootNode.Nodes.Add(new TreeNode());
NodesTV.Nodes.Add(rootNode);
}
/// <summary>
/// Browses the children of the node and updates the tree.
/// </summary>
private bool BrowseChildren(TreeNode parent)
{
ReferenceDescription reference = parent.Tag as ReferenceDescription;
if (reference == null)
{
return false;
}
parent.Nodes.Clear();
if (reference.NodeId.IsAbsolute)
{
return false;
}
BrowseDescription nodeToBrowse = new BrowseDescription();
nodeToBrowse.NodeId = (NodeId)reference.NodeId;
nodeToBrowse.BrowseDirection = m_browseDirection;
nodeToBrowse.ReferenceTypeId = m_referenceTypeId;
nodeToBrowse.IncludeSubtypes = true;
nodeToBrowse.NodeClassMask = 0;
nodeToBrowse.ResultMask = (uint)(int)BrowseResultMask.All;
BrowseDescriptionCollection nodesToBrowse = new BrowseDescriptionCollection();
nodesToBrowse.Add(nodeToBrowse);
ViewDescription view = null;
if (NodeId.IsNull(m_viewId))
{
view = new ViewDescription();
view.ViewId = m_viewId;
view.Timestamp = DateTime.MinValue;
view.ViewVersion = 0;
}
BrowseResultCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.Browse(
null,
view,
0,
nodesToBrowse,
out results,
out diagnosticInfos);
if (results.Count != 1 || StatusCode.IsBad(results[0].StatusCode))
{
return false;
}
UpdateNode(parent, results[0].References);
while (results[0].ContinuationPoint != null && results[0].ContinuationPoint.Length > 0)
{
ByteStringCollection continuationPoints = new ByteStringCollection();
continuationPoints.Add(results[0].ContinuationPoint);
m_session.BrowseNext(
null,
parent == null,
continuationPoints,
out results,
out diagnosticInfos);
if (results.Count != 1 || StatusCode.IsBad(results[0].StatusCode))
{
return false;
}
UpdateNode(parent, results[0].References);
}
return true;
}
/// <summary>
/// Adds the browse results to the node (if not null).
/// </summary>
private void UpdateNode(TreeNode parent, ReferenceDescriptionCollection references)
{
try
{
for (int ii = 0; ii < references.Count; ii++)
{
ReferenceDescription reference = references[ii];
TreeNode childNode = new TreeNode(reference.ToString());
childNode.ImageKey = childNode.SelectedImageKey = GuiUtils.GetTargetIcon(m_session, reference);
childNode.Tag = reference;
childNode.Nodes.Add(new TreeNode());
parent.Nodes.Add(childNode);
}
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
#region Overridden Members
/// <see cref="BaseTreeCtrl.SelectNode" />
protected override void SelectNode()
{
base.SelectNode();
ReferenceDescription reference = NodesTV.SelectedNode.Tag as ReferenceDescription;
if (reference == null)
{
return;
}
// update attributes control.
if (AttributesCTRL != null)
{
AttributesCTRL.Initialize(m_session, reference.NodeId);
}
// update references control.
if (ReferencesCTRL != null)
{
ReferencesCTRL.Initialize(m_session, reference.NodeId);
}
}
/// <see cref="BaseTreeCtrl.BeforeExpand" />
protected override bool BeforeExpand(TreeNode clickedNode)
{
try
{
// check if a placeholder child is present.
if (clickedNode.Nodes.Count == 1 && clickedNode.Nodes[0].Text == String.Empty)
{
// browse.
return !BrowseChildren(clickedNode);
}
// do not cancel expand.
return false;
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
return false;
}
}
/// <see cref="BaseTreeCtrl.EnableMenuItems" />
protected override void EnableMenuItems(TreeNode clickedNode)
{
if (NodesTV.SelectedNode == null)
{
return;
}
SelectMI.Enabled = true;
if (NodesTV.SelectedNode.Nodes.Count > 0 && NodesTV.SelectedNode.Nodes[0].Text != String.Empty)
{
SelectChildrenMI.Enabled = true;
}
}
#endregion
#region Event Handlers
private void RootBTN_Click(object sender, EventArgs e)
{
try
{
if (NodesTV.SelectedNode == null)
{
return;
}
ReferenceDescription reference = NodesTV.SelectedNode.Tag as ReferenceDescription;
if (reference == null || reference.NodeId.IsAbsolute)
{
return;
}
Initialize(m_session, (NodeId)reference.NodeId, m_viewId, m_referenceTypeId, m_browseDirection);
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
private void BrowseDirectionCTRL_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
m_browseDirection = (BrowseDirection)BrowseDirectionCTRL.SelectedItem;
if (NodesTV.SelectedNode != null)
{
NodesTV.SelectedNode.Collapse();
NodesTV.SelectedNode.Nodes.Clear();
NodesTV.SelectedNode.Nodes.Add(new TreeNode());
NodesTV.SelectedNode.Expand();
return;
}
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
private void SelectMI_Click(object sender, EventArgs e)
{
try
{
if (m_nodesSelected != null)
{
if (NodesTV.SelectedNode == null)
{
return;
}
ReferenceDescription reference = NodesTV.SelectedNode.Tag as ReferenceDescription;
if (reference != null)
{
ReferenceDescriptionCollection collection = new ReferenceDescriptionCollection();
collection.Add(reference);
m_nodesSelected(this, new NodesSelectedEventArgs(collection));
}
}
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
private void SelectChildrenMI_Click(object sender, EventArgs e)
{
try
{
if (m_nodesSelected != null)
{
if (NodesTV.SelectedNode == null || NodesTV.SelectedNode.Nodes.Count == 0)
{
return;
}
ReferenceDescriptionCollection collection = new ReferenceDescriptionCollection();
foreach (TreeNode child in NodesTV.SelectedNode.Nodes)
{
ReferenceDescription reference = child.Tag as ReferenceDescription;
if (reference != null)
{
collection.Add(reference);
}
}
if (collection.Count > 0)
{
m_nodesSelected(this, new NodesSelectedEventArgs(collection));
}
}
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
private void ReferenceTypeCTRL_ReferenceSelectionChanged(object sender, ReferenceTypeCtrl.ReferenceSelectedEventArgs e)
{
try
{
m_referenceTypeId = e.ReferenceTypeId;
if (NodesTV.SelectedNode != null)
{
NodesTV.SelectedNode.Collapse();
NodesTV.SelectedNode.Nodes.Clear();
NodesTV.SelectedNode.Nodes.Add(new TreeNode());
NodesTV.SelectedNode.Expand();
return;
}
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
#endregion
}
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PopupMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
@@ -0,0 +1,109 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class NodeListCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.PopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ViewMI = new System.Windows.Forms.ToolStripMenuItem();
this.DeleteMI = new System.Windows.Forms.ToolStripMenuItem();
this.PopupMenu.SuspendLayout();
this.SuspendLayout();
//
// ItemsLV
//
this.ItemsLV.ContextMenuStrip = this.PopupMenu;
//
// PopupMenu
//
this.PopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ViewMI,
this.DeleteMI});
this.PopupMenu.Name = "PopupMenu";
this.PopupMenu.Size = new System.Drawing.Size(118, 48);
//
// ViewMI
//
this.ViewMI.Name = "ViewMI";
this.ViewMI.Size = new System.Drawing.Size(117, 22);
this.ViewMI.Text = "View...";
//
// DeleteMI
//
this.DeleteMI.Name = "DeleteMI";
this.DeleteMI.Size = new System.Drawing.Size(117, 22);
this.DeleteMI.Text = "Delete...";
this.DeleteMI.Click += new System.EventHandler(this.DeleteMI_Click);
//
// NodeListCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.Instructions = "Add nodes by dragging them into the control.";
this.Name = "NodeListCtrl";
this.Controls.SetChildIndex(this.ItemsLV, 0);
this.PopupMenu.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip PopupMenu;
private System.Windows.Forms.ToolStripMenuItem ViewMI;
private System.Windows.Forms.ToolStripMenuItem DeleteMI;
}
}
@@ -0,0 +1,250 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays a list of nodes.
/// </summary>
public partial class NodeListCtrl : Opc.Ua.Client.Controls.BaseListCtrl
{
/// <summary>
/// Initializes a new instance of the <see cref="NodeListCtrl"/> class.
/// </summary>
public NodeListCtrl()
{
InitializeComponent();
SetColumns(m_ColumnNames);
}
#region Private Fields
private Session m_session;
private BrowseListCtrl m_referencesCTRL;
private AttributeListCtrl m_attributesCTRL;
// The columns to display in the control.
private readonly object[][] m_ColumnNames = new object[][]
{
new object[] { "Name", HorizontalAlignment.Left, null },
new object[] { "ID", HorizontalAlignment.Left, null }
};
#endregion
/// <summary>
/// The control that displays the non-hierarchial references for the selected node.
/// </summary>
public BrowseListCtrl ReferencesCTRL
{
get { return m_referencesCTRL; }
set { m_referencesCTRL = value; }
}
/// <summary>
/// The control that displays the attributes/properties for the selected node.
/// </summary>
public AttributeListCtrl AttributesCTRL
{
get { return m_attributesCTRL; }
set { m_attributesCTRL = value; }
}
/// <summary>
/// Initializes the control with a set of items.
/// </summary>
public void Initialize(Session session, IList<NodeId> nodeIds)
{
ItemsLV.Items.Clear();
m_session = session;
if (m_session == null || nodeIds == null || nodeIds.Count == 0)
{
AdjustColumns();
return;
}
for (int ii = 0; ii < nodeIds.Count; ii++)
{
ILocalNode node = m_session.NodeCache.Find(nodeIds[ii]) as ILocalNode;
if (node == null)
{
continue;
}
AddItem(node);
}
AdjustColumns();
}
/// <summary>
/// Adds a node to the control.
/// </summary>
public void Add(NodeId nodeId)
{
ILocalNode node = m_session.NodeCache.Find(nodeId) as ILocalNode;
if (node != null)
{
AddItem(node);
AdjustColumns();
}
}
/// <summary>
/// Returns the list of nodes in the control.
/// </summary>
public IList<ILocalNode> GetNodeList()
{
List<ILocalNode> items = new List<ILocalNode>(ItemsLV.Items.Count);
for (int ii = 0; ii < ItemsLV.Items.Count; ii++)
{
items.Add(ItemsLV.Items[ii].Tag as ILocalNode);
}
return items;
}
#region Overridden Methods
/// <see cref="BaseListCtrl.SelectItems" />
protected override void SelectItems()
{
base.SelectItems();
ILocalNode node = GetSelectedTag(0) as ILocalNode;
if (node == null)
{
return;
}
// update attributes control.
if (AttributesCTRL != null)
{
AttributesCTRL.Initialize(m_session, node.NodeId);
}
// update references control.
if (ReferencesCTRL != null)
{
ReferencesCTRL.Initialize(m_session, node.NodeId);
}
}
/// <see cref="Opc.Ua.Client.Controls.BaseListCtrl.EnableMenuItems" />
protected override void EnableMenuItems(ListViewItem clickedItem)
{
DeleteMI.Enabled = ItemsLV.SelectedItems.Count > 0;
}
/// <see cref="Opc.Ua.Client.Controls.BaseListCtrl.UpdateItem(ListViewItem,object)" />
protected override void UpdateItem(ListViewItem listItem, object item)
{
ILocalNode node = item as ILocalNode;
if (node == null)
{
base.UpdateItem(listItem, item);
return;
}
listItem.SubItems[0].Text = Utils.Format("{0}", node.DisplayName);
listItem.SubItems[1].Text = Utils.Format("{0}", node.NodeId);
listItem.ImageKey = GuiUtils.GetTargetIcon(m_session, node.NodeClass, node.TypeDefinitionId);
listItem.Tag = item;
}
/// <summary>
/// Handles a drop event.
/// </summary>
protected override void ItemsLV_DragDrop(object sender, DragEventArgs e)
{
try
{
ReferenceDescription reference = e.Data.GetData(typeof(ReferenceDescription)) as ReferenceDescription;
if (reference == null)
{
return;
}
ILocalNode node = m_session.NodeCache.Find(reference.NodeId) as ILocalNode;
if (node == null)
{
return;
}
AddItem(node);
AdjustColumns();
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
#endregion
private void DeleteMI_Click(object sender, EventArgs e)
{
try
{
List<ListViewItem> items = new List<ListViewItem>(ItemsLV.SelectedItems.Count);
for (int ii = 0; ii < ItemsLV.SelectedItems.Count; ii++)
{
items.Add(ItemsLV.SelectedItems[ii]);
}
for (int ii = 0; ii < items.Count; ii++)
{
items[ii].Remove();
}
AdjustColumns();
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
}
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PopupMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
@@ -0,0 +1,257 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class SelectNodesDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ButtonsPN = new System.Windows.Forms.Panel();
this.OkBTN = new System.Windows.Forms.Button();
this.CancelBTN = new System.Windows.Forms.Button();
this.MainPN = new System.Windows.Forms.SplitContainer();
this.LeftPN = new System.Windows.Forms.SplitContainer();
this.BrowseCTRL = new Opc.Ua.Client.Controls.BrowseTreeCtrl();
this.AttributesCTRL = new Opc.Ua.Client.Controls.AttributeListCtrl();
this.ReferencesCTRL = new Opc.Ua.Client.Controls.BrowseListCtrl();
this.RightPN = new System.Windows.Forms.SplitContainer();
this.NodesCTRL = new Opc.Ua.Client.Controls.NodeListCtrl();
this.ButtonsPN.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.MainPN)).BeginInit();
this.MainPN.Panel1.SuspendLayout();
this.MainPN.Panel2.SuspendLayout();
this.MainPN.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LeftPN)).BeginInit();
this.LeftPN.Panel1.SuspendLayout();
this.LeftPN.Panel2.SuspendLayout();
this.LeftPN.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.RightPN)).BeginInit();
this.RightPN.Panel1.SuspendLayout();
this.RightPN.Panel2.SuspendLayout();
this.RightPN.SuspendLayout();
this.SuspendLayout();
//
// ButtonsPN
//
this.ButtonsPN.Controls.Add(this.OkBTN);
this.ButtonsPN.Controls.Add(this.CancelBTN);
this.ButtonsPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ButtonsPN.Location = new System.Drawing.Point(0, 435);
this.ButtonsPN.Name = "ButtonsPN";
this.ButtonsPN.Size = new System.Drawing.Size(1016, 31);
this.ButtonsPN.TabIndex = 0;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.Location = new System.Drawing.Point(4, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 0;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
this.OkBTN.Click += new System.EventHandler(this.OkBTN_Click);
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(937, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 1;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// MainPN
//
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
//
// MainPN.Panel1
//
this.MainPN.Panel1.Controls.Add(this.LeftPN);
this.MainPN.Panel1.Padding = new System.Windows.Forms.Padding(3, 3, 0, 0);
//
// MainPN.Panel2
//
this.MainPN.Panel2.Controls.Add(this.RightPN);
this.MainPN.Panel2.Padding = new System.Windows.Forms.Padding(0, 3, 3, 0);
this.MainPN.Size = new System.Drawing.Size(1016, 435);
this.MainPN.SplitterDistance = 380;
this.MainPN.TabIndex = 33;
//
// LeftPN
//
this.LeftPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.LeftPN.Location = new System.Drawing.Point(3, 3);
this.LeftPN.Name = "LeftPN";
this.LeftPN.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// LeftPN.Panel1
//
this.LeftPN.Panel1.Controls.Add(this.BrowseCTRL);
//
// LeftPN.Panel2
//
this.LeftPN.Panel2.Controls.Add(this.ReferencesCTRL);
this.LeftPN.Size = new System.Drawing.Size(377, 432);
this.LeftPN.SplitterDistance = 255;
this.LeftPN.TabIndex = 0;
//
// BrowseCTRL
//
this.BrowseCTRL.AttributesCTRL = this.AttributesCTRL;
this.BrowseCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseCTRL.EnableDragging = true;
this.BrowseCTRL.Location = new System.Drawing.Point(0, 0);
this.BrowseCTRL.MinimumSize = new System.Drawing.Size(325, 216);
this.BrowseCTRL.Name = "BrowseCTRL";
this.BrowseCTRL.ReferencesCTRL = this.ReferencesCTRL;
this.BrowseCTRL.Size = new System.Drawing.Size(377, 255);
this.BrowseCTRL.TabIndex = 29;
this.BrowseCTRL.NodesSelected += new System.EventHandler<Opc.Ua.Client.Controls.BrowseTreeCtrl.NodesSelectedEventArgs>(this.BrowseCTRL_NodesSelected);
//
// AttributesCTRL
//
this.AttributesCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.AttributesCTRL.Instructions = null;
this.AttributesCTRL.Location = new System.Drawing.Point(0, 0);
this.AttributesCTRL.Name = "AttributesCTRL";
this.AttributesCTRL.Size = new System.Drawing.Size(312, 432);
this.AttributesCTRL.TabIndex = 32;
//
// ReferencesCTRL
//
this.ReferencesCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReferencesCTRL.Instructions = null;
this.ReferencesCTRL.Location = new System.Drawing.Point(0, 0);
this.ReferencesCTRL.Name = "ReferencesCTRL";
this.ReferencesCTRL.Size = new System.Drawing.Size(377, 173);
this.ReferencesCTRL.TabIndex = 31;
//
// RightPN
//
this.RightPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.RightPN.Location = new System.Drawing.Point(0, 3);
this.RightPN.Name = "RightPN";
//
// RightPN.Panel1
//
this.RightPN.Panel1.Controls.Add(this.NodesCTRL);
//
// RightPN.Panel2
//
this.RightPN.Panel2.Controls.Add(this.AttributesCTRL);
this.RightPN.Size = new System.Drawing.Size(629, 432);
this.RightPN.SplitterDistance = 313;
this.RightPN.TabIndex = 0;
//
// NodesCTRL
//
this.NodesCTRL.AllowDrop = true;
this.NodesCTRL.AttributesCTRL = this.AttributesCTRL;
this.NodesCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.NodesCTRL.EnableDragging = true;
this.NodesCTRL.Instructions = null;
this.NodesCTRL.Location = new System.Drawing.Point(0, 0);
this.NodesCTRL.Name = "NodesCTRL";
this.NodesCTRL.ReferencesCTRL = this.ReferencesCTRL;
this.NodesCTRL.Size = new System.Drawing.Size(313, 432);
this.NodesCTRL.TabIndex = 30;
//
// SelectNodesDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1016, 466);
this.Controls.Add(this.MainPN);
this.Controls.Add(this.ButtonsPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "SelectNodesDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Select Nodes";
this.ButtonsPN.ResumeLayout(false);
this.MainPN.Panel1.ResumeLayout(false);
this.MainPN.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.MainPN)).EndInit();
this.MainPN.ResumeLayout(false);
this.LeftPN.Panel1.ResumeLayout(false);
this.LeftPN.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.LeftPN)).EndInit();
this.LeftPN.ResumeLayout(false);
this.RightPN.Panel1.ResumeLayout(false);
this.RightPN.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.RightPN)).EndInit();
this.RightPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel ButtonsPN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Button CancelBTN;
private Opc.Ua.Client.Controls.BrowseTreeCtrl BrowseCTRL;
private Opc.Ua.Client.Controls.NodeListCtrl NodesCTRL;
private Opc.Ua.Client.Controls.AttributeListCtrl AttributesCTRL;
private Opc.Ua.Client.Controls.BrowseListCtrl ReferencesCTRL;
private System.Windows.Forms.SplitContainer MainPN;
private System.Windows.Forms.SplitContainer LeftPN;
private System.Windows.Forms.SplitContainer RightPN;
}
}
@@ -0,0 +1,114 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// A dialog used to selected one or more nodes.
/// </summary>
public partial class SelectNodesDlg : Form
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="SelectNodesDlg"/> class.
/// </summary>
public SelectNodesDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Displays the dialog.
/// </summary>
public IList<ILocalNode> ShowDialog(Session session, NodeId rootId, IList<NodeId> nodeIds)
{
BrowseCTRL.Initialize(session, rootId, null, null, BrowseDirection.Forward);
ReferencesCTRL.Initialize(session, rootId);
AttributesCTRL.Initialize(session, rootId);
NodesCTRL.Initialize(session, nodeIds);
if (ShowDialog() != DialogResult.OK)
{
return null;
}
return NodesCTRL.GetNodeList();
}
#endregion
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
private void BrowseCTRL_NodesSelected(object sender, BrowseTreeCtrl.NodesSelectedEventArgs e)
{
try
{
foreach (ReferenceDescription reference in e.Nodes)
{
if (!reference.NodeId.IsAbsolute)
{
NodesCTRL.Add((NodeId)reference.NodeId);
}
}
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,135 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class AttributesListViewCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AttributesMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.Attributes_ViewMI = new System.Windows.Forms.ToolStripMenuItem();
this.AttributesLV = new System.Windows.Forms.ListView();
this.NameCH = new System.Windows.Forms.ColumnHeader();
this.DataTypeCH = new System.Windows.Forms.ColumnHeader();
this.ValueCH = new System.Windows.Forms.ColumnHeader();
this.AttributesMenu.SuspendLayout();
this.SuspendLayout();
//
// AttributesMenu
//
this.AttributesMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Attributes_ViewMI});
this.AttributesMenu.Name = "BrowseMenu";
this.AttributesMenu.Size = new System.Drawing.Size(100, 26);
//
// Attributes_ViewMI
//
this.Attributes_ViewMI.Name = "Attributes_ViewMI";
this.Attributes_ViewMI.Size = new System.Drawing.Size(99, 22);
this.Attributes_ViewMI.Text = "View";
this.Attributes_ViewMI.Click += new System.EventHandler(this.AttributesLV_DoubleClick);
//
// AttributesLV
//
this.AttributesLV.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.NameCH,
this.DataTypeCH,
this.ValueCH});
this.AttributesLV.ContextMenuStrip = this.AttributesMenu;
this.AttributesLV.Dock = System.Windows.Forms.DockStyle.Fill;
this.AttributesLV.FullRowSelect = true;
this.AttributesLV.Location = new System.Drawing.Point(0, 0);
this.AttributesLV.Name = "AttributesLV";
this.AttributesLV.Size = new System.Drawing.Size(1003, 569);
this.AttributesLV.TabIndex = 2;
this.AttributesLV.UseCompatibleStateImageBehavior = false;
this.AttributesLV.View = System.Windows.Forms.View.Details;
this.AttributesLV.DoubleClick += new System.EventHandler(this.AttributesLV_DoubleClick);
//
// NameCH
//
this.NameCH.Text = "Name";
//
// DataTypeCH
//
this.DataTypeCH.Text = "Data Type";
this.DataTypeCH.Width = 100;
//
// ValueCH
//
this.ValueCH.Text = "Value";
//
// AttributesListViewCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.AttributesLV);
this.Name = "AttributesListViewCtrl";
this.Size = new System.Drawing.Size(1003, 569);
this.AttributesMenu.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip AttributesMenu;
private System.Windows.Forms.ToolStripMenuItem Attributes_ViewMI;
private System.Windows.Forms.ListView AttributesLV;
private System.Windows.Forms.ColumnHeader NameCH;
private System.Windows.Forms.ColumnHeader DataTypeCH;
private System.Windows.Forms.ColumnHeader ValueCH;
}
}
@@ -0,0 +1,336 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// A control which displays browse tree.
/// </summary>
public partial class AttributesListViewCtrl : UserControl
{
#region Constructors
/// <summary>
/// Creates a new instance of the control.
/// </summary>
public AttributesListViewCtrl()
{
InitializeComponent();
AttributesLV.SmallImageList = new ClientUtils().ImageList;
}
#endregion
#region Private Fields
private Session m_session;
#endregion
#region Public Interface
/// <summary>
/// The view to use.
/// </summary>
public ViewDescription View { get; set; }
/// <summary>
/// Changes the session used by the control.
/// </summary>
/// <param name="session">The session.</param>
public void ChangeSession(Session session)
{
m_session = session;
}
/// <summary>
/// Gets or sets the context menu for the attributes list.
/// </summary>
public ContextMenuStrip AttributesMenuStrip
{
get { return AttributesLV.ContextMenuStrip; }
set { AttributesLV.ContextMenuStrip = value; }
}
/// <summary>
/// Returns the attribute at the specified index.
/// </summary>
public ReadValueId GetSelectedAttribute(int index)
{
if (index >=0 && index < AttributesLV.SelectedItems.Count)
{
AttributeInfo info = AttributesLV.SelectedItems[index].Tag as AttributeInfo;
if (info != null)
{
return info.NodeToRead;
}
}
return null;
}
/// <summary>
/// Reads the attributes for the node.
/// </summary>
public void ReadAttributes(NodeId nodeId, bool showProperties)
{
AttributesLV.Items.Clear();
if (NodeId.IsNull(nodeId))
{
return;
}
// build list of attributes to read.
ReadValueIdCollection nodesToRead = new ReadValueIdCollection();
foreach (uint attributeId in Attributes.GetIdentifiers())
{
ReadValueId nodeToRead = new ReadValueId();
nodeToRead.NodeId = nodeId;
nodeToRead.AttributeId = attributeId;
nodesToRead.Add(nodeToRead);
}
// read the attributes.
DataValueCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.Read(
null,
0,
TimestampsToReturn.Neither,
nodesToRead,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToRead);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToRead);
// add the results to the display.
for (int ii = 0; ii < results.Count; ii++)
{
// check for error.
if (StatusCode.IsBad(results[ii].StatusCode))
{
if (results[ii].StatusCode == StatusCodes.BadAttributeIdInvalid)
{
continue;
}
}
// add the metadata for the attribute.
uint attributeId = nodesToRead[ii].AttributeId;
ListViewItem item = new ListViewItem(Attributes.GetBrowseName(attributeId));
item.SubItems.Add(Attributes.GetBuiltInType(attributeId).ToString());
if (Attributes.GetValueRank(attributeId) >= 0)
{
item.SubItems[0].Text += "[]";
}
// add the value.
if (StatusCode.IsBad(results[ii].StatusCode))
{
item.SubItems.Add(results[ii].StatusCode.ToString());
}
else
{
item.SubItems.Add(ClientUtils.GetAttributeDisplayText(m_session, attributeId, results[ii].WrappedValue));
}
item.Tag = new AttributeInfo() { NodeToRead = nodesToRead[ii], Value = results[ii] };
item.ImageIndex = ClientUtils.GetImageIndex(nodesToRead[ii].AttributeId, results[ii].Value);
// display in list.
AttributesLV.Items.Add(item);
}
if (showProperties)
{
ReadProperties(nodeId);
}
// set the column widths.
for (int ii = 0; ii < AttributesLV.Columns.Count; ii++)
{
AttributesLV.Columns[ii].Width = -2;
}
}
#endregion
#region AttributeInfo Class
/// <summary>
/// The saved information for an attribute/property displayed in the control.
/// </summary>
private class AttributeInfo
{
public ReadValueId NodeToRead;
public DataValue Value;
}
#endregion
#region Private Methods
/// <summary>
/// Reads the properties for the node.
/// </summary>
private void ReadProperties(NodeId nodeId)
{
// build list of references to browse.
BrowseDescriptionCollection nodesToBrowse = new BrowseDescriptionCollection();
BrowseDescription nodeToBrowse = new BrowseDescription();
nodeToBrowse.NodeId = nodeId;
nodeToBrowse.BrowseDirection = BrowseDirection.Forward;
nodeToBrowse.ReferenceTypeId = Opc.Ua.ReferenceTypeIds.HasProperty;
nodeToBrowse.IncludeSubtypes = true;
nodeToBrowse.NodeClassMask = (uint)NodeClass.Variable;
nodeToBrowse.ResultMask = (uint)BrowseResultMask.All;
nodesToBrowse.Add(nodeToBrowse);
// find properties.
ReferenceDescriptionCollection references = ClientUtils.Browse(m_session, View, nodesToBrowse, false);
// build list of properties to read.
ReadValueIdCollection nodesToRead = new ReadValueIdCollection();
for (int ii = 0; references != null && ii < references.Count; ii++)
{
ReferenceDescription reference = references[ii];
// ignore out of server references.
if (reference.NodeId.IsAbsolute)
{
continue;
}
ReadValueId nodeToRead = new ReadValueId();
nodeToRead.NodeId = (NodeId)reference.NodeId;
nodeToRead.AttributeId = Attributes.Value;
nodeToRead.Handle = reference;
nodesToRead.Add(nodeToRead);
}
if (nodesToRead.Count == 0)
{
return;
}
// read the properties.
DataValueCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.Read(
null,
0,
TimestampsToReturn.Neither,
nodesToRead,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToRead);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToRead);
// add the results to the display.
for (int ii = 0; ii < results.Count; ii++)
{
ReferenceDescription reference = (ReferenceDescription)nodesToRead[ii].Handle;
TypeInfo typeInfo = TypeInfo.Construct(results[ii].Value);
// add the metadata for the attribute.
ListViewItem item = new ListViewItem(reference.ToString());
item.SubItems.Add(typeInfo.BuiltInType.ToString());
if (typeInfo.ValueRank >= 0)
{
item.SubItems[1].Text += "[]";
}
// add the value.
if (StatusCode.IsBad(results[ii].StatusCode))
{
item.SubItems.Add(results[ii].StatusCode.ToString());
}
else
{
item.SubItems.Add(results[ii].WrappedValue.ToString());
}
item.Tag = new AttributeInfo() { NodeToRead = nodesToRead[ii], Value = results[ii] };
item.ImageIndex = ClientUtils.GetImageIndex(m_session, NodeClass.Variable, Opc.Ua.VariableTypeIds.PropertyType, false);
// display in list.
AttributesLV.Items.Add(item);
}
}
#endregion
#region Event Handlers
private void AttributesLV_DoubleClick(object sender, EventArgs e)
{
try
{
if (AttributesLV.SelectedItems.Count == 0)
{
return;
}
AttributeInfo info = AttributesLV.SelectedItems[0].Tag as AttributeInfo;
if (info == null || info.Value == null)
{
return;
}
new EditComplexValueDlg().ShowDialog(
m_session,
info.NodeToRead.NodeId,
info.NodeToRead.AttributeId,
null,
info.Value.Value,
true,
"View Attribute Value");
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="AttributesMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>16, 25</value>
</metadata>
</root>
@@ -0,0 +1,134 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class BrowseNodeCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.MainPN = new System.Windows.Forms.SplitContainer();
this.BrowseCTRL = new Opc.Ua.Client.Controls.BrowseTreeViewCtrl();
this.AttributesCTRL = new Opc.Ua.Client.Controls.AttributesListViewCtrl();
this.MainPN.Panel1.SuspendLayout();
this.MainPN.Panel2.SuspendLayout();
this.MainPN.SuspendLayout();
this.SuspendLayout();
//
// MainPN
//
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
//
// MainPN.Panel1
//
this.MainPN.Panel1.Controls.Add(this.BrowseCTRL);
//
// MainPN.Panel2
//
this.MainPN.Panel2.Controls.Add(this.AttributesCTRL);
this.MainPN.Size = new System.Drawing.Size(1003, 569);
this.MainPN.SplitterDistance = 387;
this.MainPN.TabIndex = 11;
//
// BrowseCTRL
//
this.BrowseCTRL.AttributesControl = this.AttributesCTRL;
this.BrowseCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseCTRL.Location = new System.Drawing.Point(0, 0);
this.BrowseCTRL.Name = "BrowseCTRL";
this.BrowseCTRL.Size = new System.Drawing.Size(387, 569);
this.BrowseCTRL.TabIndex = 0;
this.BrowseCTRL.View = null;
//
// AttributesCTRL
//
this.AttributesCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.AttributesCTRL.Location = new System.Drawing.Point(0, 0);
this.AttributesCTRL.Name = "AttributesCTRL";
this.AttributesCTRL.Size = new System.Drawing.Size(612, 569);
this.AttributesCTRL.TabIndex = 0;
this.AttributesCTRL.View = null;
//
// BrowseNodeCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.MainPN);
this.Name = "BrowseNodeCtrl";
this.Size = new System.Drawing.Size(1003, 569);
this.MainPN.Panel1.ResumeLayout(false);
this.MainPN.Panel2.ResumeLayout(false);
this.MainPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer MainPN;
/// <summary>
/// The browse list control.
/// </summary>
public BrowseTreeViewCtrl BrowseCTRL;
/// <summary>
/// The attribute list control.
/// </summary>
public AttributesListViewCtrl AttributesCTRL;
}
}
@@ -0,0 +1,191 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// A control which displays browse tree.
/// </summary>
public partial class BrowseNodeCtrl : UserControl
{
#region Constructors
/// <summary>
/// Creates a new instance of the control.
/// </summary>
public BrowseNodeCtrl()
{
InitializeComponent();
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Initializes the control with a root and a set of hierarchial reference types to follow.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="rootId">The root of the hierarchy to browse.</param>
/// <param name="referenceTypeIds">The reference types to follow.</param>
public void Initialize(
Session session,
NodeId rootId,
params NodeId[] referenceTypeIds)
{
BrowseCTRL.Initialize(session, rootId, referenceTypeIds);
}
/// <summary>
/// Changes the session used by the control.
/// </summary>
/// <param name="session">The session.</param>
public void ChangeSession(Session session)
{
BrowseCTRL.ChangeSession(session);
}
/// <summary>
/// The view to use.
/// </summary>
public ViewDescription View
{
get { return BrowseCTRL.View; }
set { BrowseCTRL.View = value; }
}
/// <summary>
/// Gets or sets the default position of the splitter
/// </summary>
public int SplitterDistance
{
get { return MainPN.SplitterDistance; }
set { MainPN.SplitterDistance = value; }
}
/// <summary>
/// Gets or sets a flag that indicates whether the attributes should be displayed.
/// </summary>
public bool AttributesListCollapsed
{
get { return MainPN.Panel2Collapsed; }
set { MainPN.Panel2Collapsed = value; }
}
/// <summary>
/// Gets or sets the context menu for the browse tree.
/// </summary>
public ContextMenuStrip BrowseMenuStrip
{
get { return BrowseCTRL.BrowseMenuStrip; }
set { BrowseCTRL.BrowseMenuStrip = value; }
}
/// <summary>
/// Gets or sets the context menu for the attributes list.
/// </summary>
public ContextMenuStrip AttributesMenuStrip
{
get { return AttributesCTRL.AttributesMenuStrip; }
set { AttributesCTRL.AttributesMenuStrip = value; }
}
/// <summary>
/// The reference for the currently selected node.
/// </summary>
public ReferenceDescription SelectedNode
{
get
{
return BrowseCTRL.SelectedNode;
}
}
/// <summary>
/// The reference for the parent of the currently selected node.
/// </summary>
public ReferenceDescription SelectedParent
{
get
{
return BrowseCTRL.SelectedParent;
}
}
/// <summary>
/// Returns the child node at the specified index.
/// </summary>
public ReferenceDescription GetChildOfSelectedNode(int index)
{
return BrowseCTRL.GetChildOfSelectedNode(index);
}
/// <summary>
/// Returns the attribute at the specified index.
/// </summary>
public ReadValueId GetSelectedAttribute(int index)
{
return AttributesCTRL.GetSelectedAttribute(index);
}
/// <summary>
/// The reference for the parent of the currently selected node.
/// </summary>
public void RefreshSelection()
{
BrowseCTRL.RefreshSelection();
}
/// <summary>
/// Raised after a node is selected in the control.
/// </summary>
public event EventHandler AfterSelect
{
add { BrowseCTRL.AfterSelect += value; }
remove { BrowseCTRL.AfterSelect -= value; }
}
#endregion
#region Private Methods
#endregion
#region Event Handlers
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,114 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class BrowseTreeViewCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.BrowseMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.Browse_RefreshMI = new System.Windows.Forms.ToolStripMenuItem();
this.BrowseTV = new System.Windows.Forms.TreeView();
this.BrowseMenu.SuspendLayout();
this.SuspendLayout();
//
// BrowseMenu
//
this.BrowseMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Browse_RefreshMI});
this.BrowseMenu.Name = "BrowseMenu";
this.BrowseMenu.Size = new System.Drawing.Size(114, 26);
//
// Browse_RefreshMI
//
this.Browse_RefreshMI.Name = "Browse_RefreshMI";
this.Browse_RefreshMI.Size = new System.Drawing.Size(113, 22);
this.Browse_RefreshMI.Text = "Refresh";
this.Browse_RefreshMI.Click += new System.EventHandler(this.Browse_RefreshMI_Click);
//
// BrowseTV
//
this.BrowseTV.ContextMenuStrip = this.BrowseMenu;
this.BrowseTV.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseTV.Location = new System.Drawing.Point(0, 0);
this.BrowseTV.Name = "BrowseTV";
this.BrowseTV.Size = new System.Drawing.Size(1003, 569);
this.BrowseTV.TabIndex = 2;
this.BrowseTV.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.BrowseTV_BeforeExpand);
this.BrowseTV.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.BrowseTV_AfterSelect);
//
// BrowseTreeViewCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.BrowseTV);
this.Name = "BrowseTreeViewCtrl";
this.Size = new System.Drawing.Size(1003, 569);
this.BrowseMenu.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip BrowseMenu;
private System.Windows.Forms.ToolStripMenuItem Browse_RefreshMI;
/// <summary>
/// The tree control.
/// </summary>
public System.Windows.Forms.TreeView BrowseTV;
}
}
@@ -0,0 +1,503 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// A control which displays browse tree.
/// </summary>
public partial class BrowseTreeViewCtrl : UserControl
{
#region Constructors
/// <summary>
/// Creates a new instance of the control.
/// </summary>
public BrowseTreeViewCtrl()
{
InitializeComponent();
BrowseTV.ImageList = new ClientUtils().ImageList;
m_typeImageMapping = new Dictionary<NodeId, int>();
}
#endregion
#region Private Fields
private Session m_session;
private NodeId m_rootId;
private NodeId[] m_referenceTypeIds;
private NodeId m_selectedNodeId;
private event EventHandler m_AfterSelect;
private ViewDescription m_view;
private Dictionary<NodeId, int> m_typeImageMapping;
#endregion
#region Public Interface
/// <summary>
/// The view to use.
/// </summary>
public AttributesListViewCtrl AttributesControl { get; set; }
/// <summary>
/// Initializes the control with a root and a set of hierarchial reference types to follow.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="rootId">The root of the hierarchy to browse.</param>
/// <param name="referenceTypeIds">The reference types to follow.</param>
public void Initialize(
Session session,
NodeId rootId,
params NodeId[] referenceTypeIds)
{
// set default root.
if (NodeId.IsNull(rootId))
{
rootId = Opc.Ua.ObjectIds.ObjectsFolder;
}
// set default reference type.
if (referenceTypeIds == null)
{
referenceTypeIds = new NodeId[] { Opc.Ua.ReferenceTypeIds.HierarchicalReferences };
}
m_rootId = rootId;
m_referenceTypeIds = referenceTypeIds;
// save session.
ChangeSession(session, true);
}
/// <summary>
/// Selects a node in the control.
/// </summary>
public bool SelectNode(NodeId nodeId)
{
return SelectNode(BrowseTV.Nodes, nodeId);
}
/// <summary>
/// Changes the session used by the control.
/// </summary>
/// <param name="session">The session.</param>
public void ChangeSession(Session session)
{
if (Object.ReferenceEquals(session, m_session))
{
return;
}
ChangeSession(session, false);
}
/// <summary>
/// The view to use.
/// </summary>
public ViewDescription View
{
get
{
return m_view;
}
set
{
if (AttributesControl != null)
{
AttributesControl.View = value;
}
m_view = value;
}
}
/// <summary>
/// Gets or sets the context menu for the browse tree.
/// </summary>
public ContextMenuStrip BrowseMenuStrip
{
get { return BrowseTV.ContextMenuStrip; }
set { BrowseTV.ContextMenuStrip = value; }
}
/// <summary>
/// The reference for the currently selected node.
/// </summary>
public ReferenceDescription SelectedNode
{
get
{
if (BrowseTV.SelectedNode == null)
{
return null;
}
return BrowseTV.SelectedNode.Tag as ReferenceDescription;
}
}
/// <summary>
/// The reference for the parent of the currently selected node.
/// </summary>
public ReferenceDescription SelectedParent
{
get
{
if (BrowseTV.SelectedNode == null || BrowseTV.SelectedNode.Parent == null)
{
return null;
}
return BrowseTV.SelectedNode.Parent.Tag as ReferenceDescription;
}
}
/// <summary>
/// Returns the child node at the specified index.
/// </summary>
public ReferenceDescription GetChildOfSelectedNode(int index)
{
if (BrowseTV.SelectedNode == null)
{
return null;
}
if (BrowseTV.SelectedNode.Nodes.Count == 1 && BrowseTV.SelectedNode.Nodes[0].Text == String.Empty)
{
BrowseTV.SelectedNode.Expand();
}
if (index < 0 || index >= BrowseTV.SelectedNode.Nodes.Count)
{
return null;
}
return BrowseTV.SelectedNode.Nodes[index].Tag as ReferenceDescription;
}
/// <summary>
/// The reference for the parent of the currently selected node.
/// </summary>
public void RefreshSelection()
{
if (BrowseTV.SelectedNode == null || BrowseTV.SelectedNode.Parent == null)
{
return;
}
BrowseTV.SelectedNode.Collapse();
BrowseTV.SelectedNode.Nodes.Clear();
BrowseTV.SelectedNode.Nodes.Add(new TreeNode());
BrowseTV.SelectedNode.Expand();
}
/// <summary>
/// Raised after a node is selected in the control.
/// </summary>
public event EventHandler AfterSelect { add { m_AfterSelect += value; } remove { m_AfterSelect -= value; } }
#endregion
#region Private Methods
/// <summary>
/// Recursively finds and selects a node in the control.
/// </summary>
private bool SelectNode(TreeNodeCollection nodes, NodeId nodeId)
{
foreach (TreeNode node in nodes)
{
ReferenceDescription reference = node.Tag as ReferenceDescription;
if (reference != null)
{
if (reference.NodeId == nodeId)
{
BrowseTV.SelectedNode = node;
node.EnsureVisible();
node.Checked = true;
return true;
}
}
SelectNode(node.Nodes, nodeId);
}
return false;
}
/// <summary>
/// Changes the session used by the control.
/// </summary>
private void ChangeSession(Session session, bool refresh)
{
m_session = session;
if (AttributesControl != null)
{
AttributesControl.ChangeSession(session);
}
BrowseTV.Nodes.Clear();
if (m_session != null)
{
INode node = m_session.NodeCache.Find(m_rootId);
if (node != null)
{
TreeNode root = new TreeNode(node.ToString());
root.ImageIndex = ClientUtils.GetImageIndex(m_session, node.NodeClass, node.TypeDefinitionId, false);
root.SelectedImageIndex = ClientUtils.GetImageIndex(m_session, node.NodeClass, node.TypeDefinitionId, true);
ReferenceDescription reference = new ReferenceDescription();
reference.NodeId = node.NodeId;
reference.NodeClass = node.NodeClass;
reference.BrowseName = node.BrowseName;
reference.DisplayName = node.DisplayName;
reference.TypeDefinition = node.TypeDefinitionId;
root.Tag = reference;
root.Nodes.Add(new TreeNode());
BrowseTV.Nodes.Add(root);
root.Expand();
BrowseTV.SelectedNode = root;
}
}
}
#endregion
#region Event Handlers
/// <summary>
/// Handles the DoubleClick event of the BrowseTV control.
/// </summary>
private void BrowseTV_DoubleClick(object sender, EventArgs e)
{
try
{
if (BrowseTV.SelectedNode == null)
{
return;
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
ClientUtils.HandleException(this.Text, exception);
}
}
/// <summary>
/// Handles the AfterSelect event of the BrowseTV control.
/// </summary>
private void BrowseTV_AfterSelect(object sender, TreeViewEventArgs e)
{
try
{
m_selectedNodeId = null;
if (BrowseTV.SelectedNode == null)
{
if (m_AfterSelect != null) m_AfterSelect(this, new EventArgs());
return;
}
// get node to browse.
ReferenceDescription reference = (ReferenceDescription)e.Node.Tag;
NodeId nodeId = m_rootId;
if (reference != null)
{
nodeId = (NodeId)reference.NodeId;
}
m_selectedNodeId = nodeId;
if (AttributesControl != null)
{
AttributesControl.ReadAttributes(m_selectedNodeId, true);
}
// raise event.
if (m_AfterSelect != null) m_AfterSelect(this, new EventArgs());
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
/// <summary>
/// Handles the BeforeExpand event of the BrowseTV control.
/// </summary>
private void BrowseTV_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
try
{
ReferenceDescription reference = (ReferenceDescription)e.Node.Tag;
e.Node.Nodes.Clear();
// build list of references to browse.
BrowseDescriptionCollection nodesToBrowse = new BrowseDescriptionCollection();
for (int ii = 0; ii < m_referenceTypeIds.Length; ii++)
{
BrowseDescription nodeToBrowse = new BrowseDescription();
nodeToBrowse.NodeId = m_rootId;
nodeToBrowse.BrowseDirection = BrowseDirection.Forward;
nodeToBrowse.ReferenceTypeId = m_referenceTypeIds[ii];
nodeToBrowse.IncludeSubtypes = true;
nodeToBrowse.NodeClassMask = 0;
nodeToBrowse.ResultMask = (uint)BrowseResultMask.All;
if (reference != null)
{
nodeToBrowse.NodeId = (NodeId)reference.NodeId;
}
nodesToBrowse.Add(nodeToBrowse);
}
// add the childen to the control.
SortedDictionary<ExpandedNodeId, TreeNode> dictionary = new SortedDictionary<ExpandedNodeId, TreeNode>();
ReferenceDescriptionCollection references = ClientUtils.Browse(m_session, View, nodesToBrowse, false);
for (int ii = 0; references != null && ii < references.Count; ii++)
{
reference = references[ii];
// ignore out of server references.
if (reference.NodeId.IsAbsolute)
{
continue;
}
if (dictionary.ContainsKey(reference.NodeId))
{
continue;
}
TreeNode child = new TreeNode(reference.ToString());
child.Nodes.Add(new TreeNode());
child.Tag = reference;
if (!reference.TypeDefinition.IsAbsolute)
{
try
{
if (!m_typeImageMapping.ContainsKey((NodeId)reference.TypeDefinition))
{
List<NodeId> nodeIds = ClientUtils.TranslateBrowsePaths(m_session, (NodeId)reference.TypeDefinition, m_session.NamespaceUris, Opc.Ua.BrowseNames.Icon);
if (nodeIds.Count > 0 && nodeIds[0] != null)
{
DataValue value = m_session.ReadValue(nodeIds[0]);
byte[] bytes = value.Value as byte[];
if (bytes != null)
{
System.IO.MemoryStream istrm = new System.IO.MemoryStream(bytes);
Image icon = Image.FromStream(istrm);
BrowseTV.ImageList.Images.Add(icon);
m_typeImageMapping[(NodeId)reference.TypeDefinition] = BrowseTV.ImageList.Images.Count - 1;
}
}
}
}
catch (Exception exception)
{
Utils.Trace(exception, "Error loading image.");
}
}
int index = 0;
if (!m_typeImageMapping.TryGetValue((NodeId)reference.TypeDefinition, out index))
{
child.ImageIndex = ClientUtils.GetImageIndex(m_session, reference.NodeClass, reference.TypeDefinition, false);
child.SelectedImageIndex = ClientUtils.GetImageIndex(m_session, reference.NodeClass, reference.TypeDefinition, true);
}
else
{
child.ImageIndex = index;
child.SelectedImageIndex = index;
}
dictionary[reference.NodeId] = child;
}
// add nodes to tree.
foreach (TreeNode node in dictionary.Values.OrderBy(i => i.Text))
{
e.Node.Nodes.Add(node);
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void BrowseTV_MouseDown(object sender, MouseEventArgs e)
{
try
{
BrowseTV.SelectedNode = BrowseTV.GetNodeAt(e.X, e.Y);
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void Browse_RefreshMI_Click(object sender, EventArgs e)
{
try
{
RefreshSelection();
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="BrowseMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
@@ -0,0 +1,147 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class CallRequestDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ButtonPN = new System.Windows.Forms.FlowLayoutPanel();
this.CloseBTN = new System.Windows.Forms.Button();
this.CallBTN = new System.Windows.Forms.Button();
this.BackBTN = new System.Windows.Forms.Button();
this.CallRequestCTRL = new Opc.Ua.Client.Controls.CallRequestListViewCtrl();
this.ButtonPN.SuspendLayout();
this.SuspendLayout();
//
// ButtonPN
//
this.ButtonPN.Controls.Add(this.CloseBTN);
this.ButtonPN.Controls.Add(this.CallBTN);
this.ButtonPN.Controls.Add(this.BackBTN);
this.ButtonPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ButtonPN.Location = new System.Drawing.Point(0, 233);
this.ButtonPN.Name = "ButtonPN";
this.ButtonPN.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.ButtonPN.Size = new System.Drawing.Size(784, 29);
this.ButtonPN.TabIndex = 1;
//
// CloseBTN
//
this.CloseBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CloseBTN.Location = new System.Drawing.Point(706, 3);
this.CloseBTN.Name = "CloseBTN";
this.CloseBTN.Size = new System.Drawing.Size(75, 23);
this.CloseBTN.TabIndex = 0;
this.CloseBTN.Text = "Close";
this.CloseBTN.UseVisualStyleBackColor = true;
this.CloseBTN.Click += new System.EventHandler(this.CloseBTN_Click);
//
// CallBTN
//
this.CallBTN.Location = new System.Drawing.Point(625, 3);
this.CallBTN.Name = "CallBTN";
this.CallBTN.Size = new System.Drawing.Size(75, 23);
this.CallBTN.TabIndex = 1;
this.CallBTN.Text = "Call";
this.CallBTN.UseVisualStyleBackColor = true;
this.CallBTN.Click += new System.EventHandler(this.CallBTN_Click);
//
// BackBTN
//
this.BackBTN.Location = new System.Drawing.Point(544, 3);
this.BackBTN.Name = "BackBTN";
this.BackBTN.Size = new System.Drawing.Size(75, 23);
this.BackBTN.TabIndex = 2;
this.BackBTN.Text = "Back";
this.BackBTN.UseVisualStyleBackColor = true;
this.BackBTN.Visible = false;
this.BackBTN.Click += new System.EventHandler(this.BackBTN_Click);
//
// CallRequestCTRL
//
this.CallRequestCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.CallRequestCTRL.Location = new System.Drawing.Point(0, 0);
this.CallRequestCTRL.Name = "CallRequestCTRL";
this.CallRequestCTRL.Size = new System.Drawing.Size(784, 233);
this.CallRequestCTRL.TabIndex = 0;
//
// CallRequestDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(784, 262);
this.Controls.Add(this.CallRequestCTRL);
this.Controls.Add(this.ButtonPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "CallRequestDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Call Method";
this.ButtonPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private CallRequestListViewCtrl CallRequestCTRL;
private System.Windows.Forms.FlowLayoutPanel ButtonPN;
private System.Windows.Forms.Button CloseBTN;
private System.Windows.Forms.Button CallBTN;
private System.Windows.Forms.Button BackBTN;
}
}
@@ -0,0 +1,139 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Allows the user to edit and issue call requests.
/// </summary>
public partial class CallRequestDlg : Form, ISessionForm
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public CallRequestDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
}
#endregion
#region Private Fields
private Session m_session;
#endregion
#region Public Interface
/// <summary>
/// Changes the session used for the call request.
/// </summary>
public void ChangeSession(Session session)
{
m_session = session;
CallRequestCTRL.ChangeSession(session);
}
/// <summary>
/// Sets the method called by the control.
/// </summary>
public void SetMethod(NodeId objectId, NodeId methodId)
{
StringBuilder buffer = new StringBuilder();
buffer.Append("Calling Method ");
buffer.Append(m_session.NodeCache.GetDisplayText(methodId));
buffer.Append(" on Object ");
buffer.Append(m_session.NodeCache.GetDisplayText(objectId));
this.Text = buffer.ToString();
CallRequestCTRL.SetMethod(objectId, methodId);
}
#endregion
#region Private Methods
#endregion
#region Event Handlers
private void CallBTN_Click(object sender, EventArgs e)
{
try
{
CallRequestCTRL.Call();
CallBTN.Visible = false;
BackBTN.Visible = true;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void BackBTN_Click(object sender, EventArgs e)
{
try
{
CallRequestCTRL.Back();
CallBTN.Visible = true;
BackBTN.Visible = false;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void CloseBTN_Click(object sender, EventArgs e)
{
try
{
if (this.Modal)
{
DialogResult = DialogResult.Cancel;
}
else
{
this.Close();
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,202 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class CallRequestListViewCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.PopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.EditMI = new System.Windows.Forms.ToolStripMenuItem();
this.ImageList = new System.Windows.Forms.ImageList(this.components);
this.NoArgumentsLB = new System.Windows.Forms.Label();
this.ResultsDV = new System.Windows.Forms.DataGridView();
this.Icon = new System.Windows.Forms.DataGridViewImageColumn();
this.NameCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DataTypeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ValueCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ResultCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.PopupMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ResultsDV)).BeginInit();
this.SuspendLayout();
//
// PopupMenu
//
this.PopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.EditMI});
this.PopupMenu.Name = "PopupMenu";
this.PopupMenu.Size = new System.Drawing.Size(104, 26);
//
// EditMI
//
this.EditMI.Name = "EditMI";
this.EditMI.Size = new System.Drawing.Size(103, 22);
this.EditMI.Text = "Edit...";
this.EditMI.Click += new System.EventHandler(this.EditMI_Click);
//
// ImageList
//
this.ImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.ImageList.ImageSize = new System.Drawing.Size(16, 16);
this.ImageList.TransparentColor = System.Drawing.Color.White;
//
// NoArgumentsLB
//
this.NoArgumentsLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.NoArgumentsLB.Location = new System.Drawing.Point(0, 0);
this.NoArgumentsLB.Name = "NoArgumentsLB";
this.NoArgumentsLB.Size = new System.Drawing.Size(779, 365);
this.NoArgumentsLB.TabIndex = 4;
this.NoArgumentsLB.Text = "No arguments to display.";
this.NoArgumentsLB.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.NoArgumentsLB.Visible = false;
//
// ResultsDV
//
this.ResultsDV.AllowUserToAddRows = false;
this.ResultsDV.AllowUserToDeleteRows = false;
this.ResultsDV.AllowUserToResizeRows = false;
this.ResultsDV.BackgroundColor = System.Drawing.SystemColors.Window;
this.ResultsDV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.ResultsDV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Icon,
this.NameCH,
this.DataTypeCH,
this.ValueCH,
this.ResultCH});
this.ResultsDV.ContextMenuStrip = this.PopupMenu;
this.ResultsDV.Dock = System.Windows.Forms.DockStyle.Fill;
this.ResultsDV.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.ResultsDV.Location = new System.Drawing.Point(0, 0);
this.ResultsDV.Name = "ResultsDV";
this.ResultsDV.RowHeadersVisible = false;
this.ResultsDV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.ResultsDV.Size = new System.Drawing.Size(779, 365);
this.ResultsDV.TabIndex = 5;
this.ResultsDV.DoubleClick += new System.EventHandler(this.EditMI_Click);
//
// Icon
//
this.Icon.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.Icon.DataPropertyName = "Icon";
this.Icon.HeaderText = "";
this.Icon.Name = "Icon";
this.Icon.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Icon.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.Icon.Width = 19;
//
// NameCH
//
this.NameCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.NameCH.DataPropertyName = "Name";
this.NameCH.HeaderText = "Name";
this.NameCH.Name = "NameCH";
this.NameCH.ReadOnly = true;
this.NameCH.Width = 60;
//
// DataTypeCH
//
this.DataTypeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.DataTypeCH.DataPropertyName = "DataType";
this.DataTypeCH.HeaderText = "Data Type";
this.DataTypeCH.Name = "DataTypeCH";
this.DataTypeCH.ReadOnly = true;
this.DataTypeCH.Width = 82;
//
// ValueCH
//
this.ValueCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.ValueCH.DataPropertyName = "Value";
this.ValueCH.HeaderText = "Value";
this.ValueCH.Name = "ValueCH";
this.ValueCH.ReadOnly = true;
//
// ResultCH
//
this.ResultCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.ResultCH.DataPropertyName = "Result";
this.ResultCH.HeaderText = "Result";
this.ResultCH.Name = "ResultCH";
this.ResultCH.ReadOnly = true;
this.ResultCH.Visible = false;
//
// CallRequestListViewCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.NoArgumentsLB);
this.Controls.Add(this.ResultsDV);
this.Name = "CallRequestListViewCtrl";
this.Size = new System.Drawing.Size(779, 365);
this.PopupMenu.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ResultsDV)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip PopupMenu;
private System.Windows.Forms.ToolStripMenuItem EditMI;
private System.Windows.Forms.ImageList ImageList;
private System.Windows.Forms.Label NoArgumentsLB;
private System.Windows.Forms.DataGridView ResultsDV;
private System.Windows.Forms.DataGridViewImageColumn Icon;
private System.Windows.Forms.DataGridViewTextBoxColumn NameCH;
private System.Windows.Forms.DataGridViewTextBoxColumn DataTypeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn ValueCH;
private System.Windows.Forms.DataGridViewTextBoxColumn ResultCH;
}
}
@@ -0,0 +1,390 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays the results from a history read operation.
/// </summary>
public partial class CallRequestListViewCtrl : UserControl
{
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
public CallRequestListViewCtrl()
{
InitializeComponent();
ResultsDV.AutoGenerateColumns = false;
ImageList = new ClientUtils().ImageList;
m_dataset = new DataSet();
m_dataset.Tables.Add("Arguments");
m_dataset.Tables[0].Columns.Add("Argument", typeof(Argument));
m_dataset.Tables[0].Columns.Add("Icon", typeof(Image));
m_dataset.Tables[0].Columns.Add("Name", typeof(string));
m_dataset.Tables[0].Columns.Add("DataType", typeof(string));
m_dataset.Tables[0].Columns.Add("Value", typeof(Variant));
m_dataset.Tables[0].Columns.Add("Result", typeof(string));
ResultsDV.DataSource = m_dataset.Tables[0];
}
#endregion
#region Private Fields
private DataSet m_dataset;
private Session m_session;
private NodeId m_objectId;
private NodeId m_methodId;
private Argument[] m_inputArguments;
private Argument[] m_outputArguments;
#endregion
#region Public Members
/// <summary>
/// Changes the session used for the call request.
/// </summary>
public void ChangeSession(Session session)
{
m_session = session;
}
/// <summary>
/// Sets the method for the call request.
/// </summary>
public void SetMethod(NodeId objectId, NodeId methodId)
{
if (objectId == null)
{
new ArgumentNullException("objectId");
}
if (methodId == null)
{
new ArgumentNullException("methodId");
}
m_objectId = objectId;
m_methodId = methodId;
ReadArguments(methodId);
DisplayInputArguments();
}
/// <summary>
/// Calls the method.
/// </summary>
public void Call()
{
// build list of methods to call.
CallMethodRequestCollection methodsToCall = new CallMethodRequestCollection();
CallMethodRequest methodToCall = new CallMethodRequest();
methodToCall.ObjectId = m_objectId;
methodToCall.MethodId = m_methodId;
foreach (DataRow row in m_dataset.Tables[0].Rows)
{
Argument argument = (Argument)row[0];
Variant value = (Variant)row[4];
argument.Value = value.Value;
methodToCall.InputArguments.Add(value);
}
methodsToCall.Add(methodToCall);
// call the method.
CallMethodResultCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
ResponseHeader responseHeader = m_session.Call(
null,
methodsToCall,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, methodsToCall);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, methodsToCall);
for (int ii = 0; ii < results.Count; ii++)
{
// display any input argument errors.
if (results[ii].InputArgumentResults != null)
{
for (int jj = 0; jj < results[ii].InputArgumentResults.Count; jj++)
{
if (StatusCode.IsBad(results[ii].InputArgumentResults[jj]))
{
DataRow row = m_dataset.Tables[0].Rows[jj];
row[5] = results[ii].InputArgumentResults[jj].ToString();
ResultCH.Visible = true;
}
}
}
// throw an exception on error.
if (StatusCode.IsBad(results[ii].StatusCode))
{
throw ServiceResultException.Create(results[ii].StatusCode, ii, diagnosticInfos, responseHeader.StringTable);
}
// display the output arguments
ResultCH.Visible = false;
NoArgumentsLB.Visible = m_outputArguments == null || m_outputArguments.Length == 0;
NoArgumentsLB.Text = "Method invoked successfully.\r\nNo output arguments to display.";
m_dataset.Tables[0].Rows.Clear();
if (m_outputArguments != null)
{
for (int jj = 0; jj < m_outputArguments.Length; jj++)
{
DataRow row = m_dataset.Tables[0].NewRow();
if (results[ii].OutputArguments.Count > jj)
{
UpdateRow(row, m_outputArguments[jj], results[ii].OutputArguments[jj], true);
}
else
{
UpdateRow(row, m_outputArguments[jj], Variant.Null, true);
}
m_dataset.Tables[0].Rows.Add(row);
}
}
}
}
/// <summary>
/// Returns the grid to the enter input arguments state.
/// </summary>
public void Back()
{
DisplayInputArguments();
// clear any selection.
foreach (DataGridViewRow row in ResultsDV.Rows)
{
row.Selected = false;
}
}
#endregion
#region Private Methods
/// <summary>
/// Displays the input arguments.
/// </summary>
private void DisplayInputArguments()
{
ResultCH.Visible = false;
NoArgumentsLB.Visible = m_inputArguments == null || m_inputArguments.Length == 0;
NoArgumentsLB.Text = "No input arguments to display.";
m_dataset.Tables[0].Rows.Clear();
if (m_inputArguments != null)
{
foreach (Argument argument in m_inputArguments)
{
DataRow row = m_dataset.Tables[0].NewRow();
UpdateRow(row, argument, new Variant(argument.Value), false);
m_dataset.Tables[0].Rows.Add(row);
}
}
}
/// <summary>
/// Updates the row with an argument and its value.
/// </summary>
private void UpdateRow(DataRow row, Argument argument, Variant value, bool isOutputArgument)
{
string dataType = m_session.NodeCache.GetDisplayText(argument.DataType);
if (argument.ValueRank >= 0)
{
dataType += "[]";
}
row[0] = argument;
row[1] = ImageList.Images[ClientUtils.GetImageIndex(isOutputArgument, value.Value)];
row[2] = argument.Name;
row[3] = dataType;
row[4] = value;
row[5] = String.Empty;
}
/// <summary>
/// Reads the arguments for the method.
/// </summary>
private void ReadArguments(NodeId nodeId)
{
m_inputArguments = null;
m_outputArguments = null;
// build list of references to browse.
BrowseDescriptionCollection nodesToBrowse = new BrowseDescriptionCollection();
BrowseDescription nodeToBrowse = new BrowseDescription();
nodeToBrowse.NodeId = nodeId;
nodeToBrowse.BrowseDirection = BrowseDirection.Forward;
nodeToBrowse.ReferenceTypeId = Opc.Ua.ReferenceTypeIds.HasProperty;
nodeToBrowse.IncludeSubtypes = true;
nodeToBrowse.NodeClassMask = (uint)NodeClass.Variable;
nodeToBrowse.ResultMask = (uint)BrowseResultMask.BrowseName;
nodesToBrowse.Add(nodeToBrowse);
// find properties.
ReferenceDescriptionCollection references = ClientUtils.Browse(m_session, null, nodesToBrowse, false);
// build list of properties to read.
ReadValueIdCollection nodesToRead = new ReadValueIdCollection();
for (int ii = 0; references != null && ii < references.Count; ii++)
{
ReferenceDescription reference = references[ii];
// ignore out of server references.
if (reference.NodeId.IsAbsolute)
{
continue;
}
// ignore other properties.
if (reference.BrowseName != Opc.Ua.BrowseNames.InputArguments && reference.BrowseName != Opc.Ua.BrowseNames.OutputArguments)
{
continue;
}
ReadValueId nodeToRead = new ReadValueId();
nodeToRead.NodeId = (NodeId)reference.NodeId;
nodeToRead.AttributeId = Attributes.Value;
nodeToRead.Handle = reference;
nodesToRead.Add(nodeToRead);
}
// method has no arguments.
if (nodesToRead.Count == 0)
{
return;
}
// read the arguments.
DataValueCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.Read(
null,
0,
TimestampsToReturn.Neither,
nodesToRead,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToRead);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToRead);
// save the results.
for (int ii = 0; ii < results.Count; ii++)
{
ReferenceDescription reference = (ReferenceDescription)nodesToRead[ii].Handle;
if (StatusCode.IsGood(results[ii].StatusCode))
{
if (reference.BrowseName == Opc.Ua.BrowseNames.InputArguments)
{
m_inputArguments = (Argument[])ExtensionObject.ToArray(results[ii].GetValue<ExtensionObject[]>(null), typeof(Argument));
}
if (reference.BrowseName == Opc.Ua.BrowseNames.OutputArguments)
{
m_outputArguments = (Argument[])ExtensionObject.ToArray(results[ii].GetValue<ExtensionObject[]>(null), typeof(Argument));
}
}
}
// set default values for input arguments.
if (m_inputArguments != null)
{
foreach (Argument argument in m_inputArguments)
{
argument.Value = TypeInfo.GetDefaultValue(argument.DataType, argument.ValueRank, m_session.TypeTree);
}
}
}
#endregion
#region Event Handlers
private void EditMI_Click(object sender, EventArgs e)
{
try
{
foreach (DataGridViewRow row in ResultsDV.SelectedRows)
{
DataRowView source = row.DataBoundItem as DataRowView;
Argument argument = (Argument)source.Row[0];
BuiltInType builtInType = TypeInfo.GetBuiltInType(argument.DataType, m_session.TypeTree);
object result = new EditComplexValueDlg().ShowDialog(
new TypeInfo(builtInType, argument.ValueRank),
argument.Name,
argument.Value,
"Edit Input Argument");
if (result != null)
{
argument.Value = result;
UpdateRow(source.Row, argument, new Variant(result), false);
}
break;
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PopupMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>136, 17</value>
</metadata>
<metadata name="Icon.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="NameCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DataTypeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ValueCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ResultCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
@@ -0,0 +1,121 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class ConnectServerCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ConnectBTN = new System.Windows.Forms.Button();
this.UseSecurityCK = new System.Windows.Forms.CheckBox();
this.UrlCB = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// ConnectBTN
//
this.ConnectBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ConnectBTN.Location = new System.Drawing.Point(425, 0);
this.ConnectBTN.Name = "ConnectBTN";
this.ConnectBTN.Size = new System.Drawing.Size(75, 23);
this.ConnectBTN.TabIndex = 2;
this.ConnectBTN.Text = "Connect";
this.ConnectBTN.UseVisualStyleBackColor = true;
this.ConnectBTN.Click += new System.EventHandler(this.Server_ConnectMI_Click);
//
// UseSecurityCK
//
this.UseSecurityCK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.UseSecurityCK.AutoSize = true;
this.UseSecurityCK.Checked = true;
this.UseSecurityCK.CheckState = System.Windows.Forms.CheckState.Checked;
this.UseSecurityCK.Location = new System.Drawing.Point(335, 3);
this.UseSecurityCK.Name = "UseSecurityCK";
this.UseSecurityCK.Size = new System.Drawing.Size(86, 17);
this.UseSecurityCK.TabIndex = 1;
this.UseSecurityCK.Text = "Use Security";
this.UseSecurityCK.UseVisualStyleBackColor = true;
//
// UrlCB
//
this.UrlCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.UrlCB.FormattingEnabled = true;
this.UrlCB.Location = new System.Drawing.Point(0, 1);
this.UrlCB.Name = "UrlCB";
this.UrlCB.Size = new System.Drawing.Size(327, 21);
this.UrlCB.TabIndex = 0;
//
// ConnectServerCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.ConnectBTN);
this.Controls.Add(this.UseSecurityCK);
this.Controls.Add(this.UrlCB);
this.MaximumSize = new System.Drawing.Size(2048, 23);
this.MinimumSize = new System.Drawing.Size(500, 23);
this.Name = "ConnectServerCtrl";
this.Size = new System.Drawing.Size(500, 23);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button ConnectBTN;
private System.Windows.Forms.CheckBox UseSecurityCK;
private System.Windows.Forms.ComboBox UrlCB;
}
}
@@ -0,0 +1,755 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
using Opc.Ua.Client.ComplexTypes;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// A tool bar used to connect to a server.
/// </summary>
public partial class ConnectServerCtrl : UserControl
{
#region Constructors
/// <summary>
/// Initializes the object.
/// </summary>
public ConnectServerCtrl()
{
InitializeComponent();
m_CertificateValidation = new CertificateValidationEventHandler(CertificateValidator_CertificateValidation);
m_endpoints = new Dictionary<Uri, EndpointDescription>();
}
#endregion
#region Private Fields
private ApplicationConfiguration m_configuration;
private Session m_session;
private SessionReconnectHandler m_reconnectHandler;
private CertificateValidationEventHandler m_CertificateValidation;
private EventHandler m_ReconnectComplete;
private EventHandler m_ReconnectStarting;
private EventHandler m_KeepAliveComplete;
private EventHandler m_ConnectComplete;
private StatusStrip m_StatusStrip;
private ToolStripItem m_ServerStatusLB;
private ToolStripItem m_StatusUpateTimeLB;
private Dictionary<Uri, EndpointDescription> m_endpoints;
#endregion
#region Public Members
/// <summary>
/// Default session values.
/// </summary>
public static readonly uint DefaultSessionTimeout = 60000;
public static readonly int DefaultDiscoverTimeout = 15000;
public static readonly int DefaultReconnectPeriod = 10;
/// <summary>
/// A strip used to display session status information.
/// </summary>
public StatusStrip StatusStrip
{
get => m_StatusStrip;
set
{
if (!Object.ReferenceEquals(m_StatusStrip, value))
{
m_StatusStrip = value;
if (value != null)
{
m_ServerStatusLB = new ToolStripStatusLabel();
m_StatusUpateTimeLB = new ToolStripStatusLabel();
m_StatusStrip.Items.Add(m_ServerStatusLB);
m_StatusStrip.Items.Add(m_StatusUpateTimeLB);
}
}
}
}
/// <summary>
/// A control that contains the last time a keep alive was returned from the server.
/// </summary>
public ToolStripItem ServerStatusControl { get => m_ServerStatusLB; set => m_ServerStatusLB = value; }
/// <summary>
/// A control that contains the last time a keep alive was returned from the server.
/// </summary>
public ToolStripItem StatusUpateTimeControl { get => m_StatusUpateTimeLB; set => m_StatusUpateTimeLB = value; }
/// <summary>
/// The name of the session to create.
/// </summary>
public string SessionName { get; set; }
/// <summary>
/// Gets or sets a flag indicating that the domain checks should be ignored when connecting.
/// </summary>
public bool DisableDomainCheck { get; set; }
/// <summary>
/// Gets the cached EndpointDescription for a Url.
/// </summary>
public EndpointDescription GetEndpointDescription(Uri url)
{
EndpointDescription endpointDescription;
if (m_endpoints.TryGetValue(url, out endpointDescription))
{
return endpointDescription;
}
return null;
}
/// <summary>
/// The URL displayed in the control.
/// </summary>
public string ServerUrl
{
get
{
if (UrlCB.SelectedIndex >= 0)
{
return (string)UrlCB.SelectedItem;
}
return UrlCB.Text;
}
set
{
UrlCB.SelectedIndex = -1;
UrlCB.Text = value;
}
}
/// <summary>
/// Whether to use security when connecting.
/// </summary>
public bool UseSecurity
{
get => UseSecurityCK.Checked;
set => UseSecurityCK.Checked = value;
}
/// <summary>
/// The locales to use when creating the session.
/// </summary>
public string[] PreferredLocales { get; set; }
/// <summary>
/// The user identity to use when creating the session.
/// </summary>
public IUserIdentity UserIdentity { get; set; }
/// <summary>
/// The client application configuration.
/// </summary>
public ApplicationConfiguration Configuration
{
get => m_configuration;
set
{
if (!Object.ReferenceEquals(m_configuration, value))
{
if (m_configuration != null)
{
m_configuration.CertificateValidator.CertificateValidation -= m_CertificateValidation;
}
m_configuration = value;
if (m_configuration != null)
{
m_configuration.CertificateValidator.CertificateValidation += m_CertificateValidation;
}
}
}
}
/// <summary>
/// The currently active session.
/// </summary>
public Session Session => m_session;
/// <summary>
/// The number of seconds between reconnect attempts (0 means reconnect is disabled).
/// </summary>
public int ReconnectPeriod { get; set; } = DefaultReconnectPeriod;
/// <summary>
/// The discover timeout.
/// </summary>
public int DiscoverTimeout { get; set; } = DefaultDiscoverTimeout;
/// <summary>
/// The session timeout.
/// </summary>
public uint SessionTimeout { get; set; } = DefaultSessionTimeout;
/// <summary>
/// Raised when a good keep alive from the server arrives.
/// </summary>
public event EventHandler KeepAliveComplete
{
add { m_KeepAliveComplete += value; }
remove { m_KeepAliveComplete -= value; }
}
/// <summary>
/// Raised when a reconnect operation starts.
/// </summary>
public event EventHandler ReconnectStarting
{
add { m_ReconnectStarting += value; }
remove { m_ReconnectStarting -= value; }
}
/// <summary>
/// Raised when a reconnect operation completes.
/// </summary>
public event EventHandler ReconnectComplete
{
add { m_ReconnectComplete += value; }
remove { m_ReconnectComplete -= value; }
}
/// <summary>
/// Raised after successfully connecting to or disconnecing from a server.
/// </summary>
public event EventHandler ConnectComplete
{
add { m_ConnectComplete += value; }
remove { m_ConnectComplete -= value; }
}
/// <summary>
/// Sets the URLs shown in the control.
/// </summary>
public void SetAvailableUrls(IList<string> urls)
{
UrlCB.Items.Clear();
if (urls != null)
{
foreach (string url in urls)
{
int index = url.LastIndexOf("/discovery", StringComparison.InvariantCultureIgnoreCase);
if (index != -1)
{
UrlCB.Items.Add(url.Substring(0, index));
continue;
}
UrlCB.Items.Add(url);
}
if (UrlCB.Items.Count > 0)
{
UrlCB.SelectedIndex = 0;
}
}
}
/// <summary>
/// Creates a new session.
/// </summary>
/// <returns>The new session object.</returns>
private async Task<Session> Connect(
ITransportWaitingConnection connection,
EndpointDescription endpointDescription,
bool useSecurity,
uint sessionTimeout = 0)
{
// disconnect from existing session.
InternalDisconnect();
// select the best endpoint.
if (endpointDescription == null)
{
endpointDescription = CoreClientUtils.SelectEndpoint(m_configuration, connection, useSecurity, DiscoverTimeout);
}
EndpointConfiguration endpointConfiguration = EndpointConfiguration.Create(m_configuration);
ConfiguredEndpoint endpoint = new ConfiguredEndpoint(null, endpointDescription, endpointConfiguration);
m_session = await Session.Create(
m_configuration,
connection,
endpoint,
false,
!DisableDomainCheck,
(String.IsNullOrEmpty(SessionName)) ? m_configuration.ApplicationName : SessionName,
sessionTimeout,
UserIdentity,
PreferredLocales);
// set up keep alive callback.
m_session.KeepAlive += new KeepAliveEventHandler(Session_KeepAlive);
// raise an event.
DoConnectComplete(null);
try
{
UpdateStatus(false, DateTime.Now, "Connected, loading complex type system.");
var typeSystemLoader = new ComplexTypeSystem(m_session);
await typeSystemLoader.Load();
}
catch (Exception e)
{
UpdateStatus(true, DateTime.Now, "Connected, failed to load complex type system.");
Utils.Trace(e, "Failed to load complex type system.");
}
// return the new session.
return m_session;
}
/// <summary>
/// Creates a new session.
/// </summary>
/// <returns>The new session object.</returns>
public Task<Session> Connect()
{
// determine the URL that was selected.
string serverUrl = UrlCB.Text;
if (UrlCB.SelectedIndex >= 0)
{
serverUrl = (string)UrlCB.SelectedItem;
}
bool useSecurity = UseSecurityCK.Checked;
return Connect(serverUrl, useSecurity);
}
/// <summary>
/// Creates a new session.
/// </summary>
/// <returns>The new session object.</returns>
private async Task<Session> Connect(
string serverUrl,
bool useSecurity,
uint sessionTimeout = 0)
{
// disconnect from existing session.
InternalDisconnect();
// select the best endpoint.
var endpointDescription = CoreClientUtils.SelectEndpoint(serverUrl, useSecurity, DiscoverTimeout);
var endpointConfiguration = EndpointConfiguration.Create(m_configuration);
var endpoint = new ConfiguredEndpoint(null, endpointDescription, endpointConfiguration);
m_session = await Session.Create(
m_configuration,
endpoint,
false,
!DisableDomainCheck,
(String.IsNullOrEmpty(SessionName)) ? m_configuration.ApplicationName : SessionName,
sessionTimeout == 0 ? DefaultSessionTimeout : sessionTimeout,
UserIdentity,
PreferredLocales);
// set up keep alive callback.
m_session.KeepAlive += new KeepAliveEventHandler(Session_KeepAlive);
// raise an event.
DoConnectComplete(null);
try
{
UpdateStatus(false, DateTime.Now, "Connected, loading complex type system.");
var typeSystemLoader = new ComplexTypeSystem(m_session);
await typeSystemLoader.Load();
}
catch (Exception e)
{
UpdateStatus(true, DateTime.Now, "Connected, failed to load complex type system.");
Utils.Trace(e, "Failed to load complex type system.");
}
// return the new session.
return m_session;
}
/// <summary>
/// Creates a new session.
/// </summary>
/// <param name="serverUrl">The URL of a server endpoint.</param>
/// <param name="useSecurity">Whether to use security.</param>
/// <returns>The new session object.</returns>
public async Task<Session> ConnectAsync(
string serverUrl = null,
bool useSecurity = false,
uint sessionTimeout = 0
)
{
if (serverUrl == null)
{
serverUrl = UrlCB.Text;
if (UrlCB.SelectedIndex >= 0)
{
serverUrl = (string)UrlCB.SelectedItem;
}
useSecurity = UseSecurityCK.Checked;
}
else
{
UrlCB.Text = serverUrl;
UseSecurityCK.Checked = useSecurity;
}
return await Task.Run(() => Connect(serverUrl, useSecurity, sessionTimeout));
}
/// <summary>
/// Create a new reverse connection.
/// </summary>
/// <param name="connection"></param>
/// <param name="useSecurity"></param>
public async Task<Session> ConnectAsync(
ITransportWaitingConnection connection,
bool useSecurity,
int discoverTimeout = -1,
uint sessionTimeout = 0
)
{
if (connection.EndpointUrl == null)
{
throw new ArgumentException("Endpoint URL is not valid.");
}
UrlCB.Text = connection.EndpointUrl.ToString();
UseSecurityCK.Checked = useSecurity;
EndpointDescription endpointDescription = null;
if (!m_endpoints.TryGetValue(connection.EndpointUrl, out endpointDescription))
{
// Discovery uses the reverse connection and closes it
// return and wait for next reverse hello
endpointDescription = CoreClientUtils.SelectEndpoint(m_configuration, connection, useSecurity, discoverTimeout);
m_endpoints[connection.EndpointUrl] = endpointDescription;
return null;
}
return await Connect(connection, endpointDescription, UseSecurityCK.Checked, sessionTimeout);
}
/// <summary>
/// Disconnects from the server.
/// </summary>
public Task DisconnectAsync()
{
UpdateStatus(false, DateTime.UtcNow, "Disconnected");
return Task.Run(() => InternalDisconnect());
}
/// <summary>
/// Disconnects from the server.
/// </summary>
private void InternalDisconnect()
{
// stop any reconnect operation.
if (m_reconnectHandler != null)
{
m_reconnectHandler.Dispose();
m_reconnectHandler = null;
}
// disconnect any existing session.
if (m_session != null)
{
m_session.KeepAlive -= Session_KeepAlive;
m_session.Close(10000);
m_session = null;
}
// raise an event.
DoConnectComplete(null);
}
/// <summary>
/// Disconnects from the server.
/// </summary>
public void Disconnect()
{
UpdateStatus(false, DateTime.UtcNow, "Disconnected");
// stop any reconnect operation.
InternalDisconnect();
}
/// <summary>
/// Prompts the user to choose a server on another host.
/// </summary>
public void Discover(string hostName)
{
string endpointUrl = new DiscoverServerDlg().ShowDialog(m_configuration, hostName);
if (endpointUrl != null)
{
ServerUrl = endpointUrl;
}
}
#endregion
#region Private Methods
/// <summary>
/// Raises the connect complete event on the main GUI thread.
/// </summary>
private void DoConnectComplete(object state)
{
if (m_ConnectComplete != null)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new System.Threading.WaitCallback(DoConnectComplete), state);
return;
}
m_ConnectComplete(this, null);
}
}
/// <summary>
/// Finds the endpoint that best matches the current settings.
/// </summary>
private EndpointDescription SelectEndpoint()
{
try
{
Cursor = Cursors.WaitCursor;
// determine the URL that was selected.
string discoveryUrl = UrlCB.Text;
if (UrlCB.SelectedIndex >= 0)
{
discoveryUrl = (string)UrlCB.SelectedItem;
}
// return the selected endpoint.
return CoreClientUtils.SelectEndpoint(discoveryUrl, UseSecurityCK.Checked, DiscoverTimeout);
}
finally
{
Cursor = Cursors.Default;
}
}
#endregion
#region Event Handlers
private delegate void UpdateStatusCallback(bool error, DateTime time, string status, params object[] arg);
/// <summary>
/// Updates the status control.
/// </summary>
/// <param name="error">Whether the status represents an error.</param>
/// <param name="time">The time associated with the status.</param>
/// <param name="status">The status message.</param>
/// <param name="args">Arguments used to format the status message.</param>
private void UpdateStatus(bool error, DateTime time, string status, params object[] args)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new UpdateStatusCallback(UpdateStatus), error, time, status, args);
return;
}
if (m_ServerStatusLB != null)
{
m_ServerStatusLB.Text = String.Format(status, args);
m_ServerStatusLB.ForeColor = (error) ? Color.Red : Color.Empty;
}
if (m_StatusUpateTimeLB != null)
{
m_StatusUpateTimeLB.Text = time.ToLocalTime().ToString("hh:mm:ss");
m_StatusUpateTimeLB.ForeColor = (error) ? Color.Red : Color.Empty;
}
}
/// <summary>
/// Handles a keep alive event from a session.
/// </summary>
private void Session_KeepAlive(Session session, KeepAliveEventArgs e)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new KeepAliveEventHandler(Session_KeepAlive), session, e);
return;
}
try
{
// check for events from discarded sessions.
if (!Object.ReferenceEquals(session, m_session))
{
return;
}
// start reconnect sequence on communication error.
if (ServiceResult.IsBad(e.Status))
{
if (ReconnectPeriod <= 0)
{
UpdateStatus(true, e.CurrentTime, "Communication Error ({0})", e.Status);
return;
}
UpdateStatus(true, e.CurrentTime, "Reconnecting in {0}s", ReconnectPeriod);
if (m_reconnectHandler == null)
{
if (m_ReconnectStarting != null)
{
m_ReconnectStarting(this, e);
}
m_reconnectHandler = new SessionReconnectHandler();
m_reconnectHandler.BeginReconnect(m_session, ReconnectPeriod * 1000, Server_ReconnectComplete);
}
return;
}
// update status.
UpdateStatus(false, e.CurrentTime, "Connected [{0}]", session.Endpoint.EndpointUrl);
// raise any additional notifications.
if (m_KeepAliveComplete != null)
{
m_KeepAliveComplete(this, e);
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
/// <summary>
/// Handles a click on the connect button.
/// </summary>
private async void Server_ConnectMI_Click(object sender, EventArgs e)
{
try
{
await ConnectAsync();
}
catch (ServiceResultException sre)
{
if (sre.StatusCode == StatusCodes.BadCertificateHostNameInvalid)
{
if (GuiUtils.HandleDomainCheckError(this.FindForm().Text, sre.Result))
{
DisableDomainCheck = true;
};
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
/// <summary>
/// Handles a reconnect event complete from the reconnect handler.
/// </summary>
private void Server_ReconnectComplete(object sender, EventArgs e)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new EventHandler(Server_ReconnectComplete), sender, e);
return;
}
try
{
// ignore callbacks from discarded objects.
if (!Object.ReferenceEquals(sender, m_reconnectHandler))
{
return;
}
m_session = m_reconnectHandler.Session;
m_reconnectHandler.Dispose();
m_reconnectHandler = null;
// raise any additional notifications.
if (m_ReconnectComplete != null)
{
m_ReconnectComplete(this, e);
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
/// <summary>
/// Handles a certificate validation error.
/// </summary>
private void CertificateValidator_CertificateValidation(CertificateValidator sender, CertificateValidationEventArgs e)
{
if (this.InvokeRequired)
{
this.Invoke(new CertificateValidationEventHandler(CertificateValidator_CertificateValidation), sender, e);
return;
}
try
{
if (!m_configuration.SecurityConfiguration.AutoAcceptUntrustedCertificates)
{
GuiUtils.HandleCertificateValidationError(this.FindForm(), sender, e);
}
else
{
e.Accept = true;
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,226 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EditAnnotationDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BottomPN = new System.Windows.Forms.Panel();
this.ControlsPN = new System.Windows.Forms.TableLayoutPanel();
this.AnnotationTimeLB = new System.Windows.Forms.Label();
this.AnnotationTimeDP = new System.Windows.Forms.DateTimePicker();
this.UserNameLB = new System.Windows.Forms.Label();
this.UserNameTB = new System.Windows.Forms.TextBox();
this.CommentLB = new System.Windows.Forms.Label();
this.CommentTB = new System.Windows.Forms.TextBox();
this.BottomPN.SuspendLayout();
this.ControlsPN.SuspendLayout();
this.SuspendLayout();
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(375, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 0;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.Location = new System.Drawing.Point(3, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 1;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
this.OkBTN.Click += new System.EventHandler(this.OkBTN_Click);
//
// BottomPN
//
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 80);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(453, 30);
this.BottomPN.TabIndex = 0;
//
// ControlsPN
//
this.ControlsPN.ColumnCount = 2;
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 115F));
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.Controls.Add(this.AnnotationTimeLB, 0, 2);
this.ControlsPN.Controls.Add(this.AnnotationTimeDP, 1, 2);
this.ControlsPN.Controls.Add(this.UserNameLB, 0, 1);
this.ControlsPN.Controls.Add(this.UserNameTB, 1, 1);
this.ControlsPN.Controls.Add(this.CommentLB, 0, 0);
this.ControlsPN.Controls.Add(this.CommentTB, 1, 0);
this.ControlsPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.ControlsPN.Location = new System.Drawing.Point(0, 0);
this.ControlsPN.Name = "ControlsPN";
this.ControlsPN.RowCount = 4;
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.Size = new System.Drawing.Size(453, 80);
this.ControlsPN.TabIndex = 1;
//
// AnnotationTimeLB
//
this.AnnotationTimeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.AnnotationTimeLB.AutoSize = true;
this.AnnotationTimeLB.Location = new System.Drawing.Point(3, 52);
this.AnnotationTimeLB.Name = "AnnotationTimeLB";
this.AnnotationTimeLB.Size = new System.Drawing.Size(84, 26);
this.AnnotationTimeLB.TabIndex = 4;
this.AnnotationTimeLB.Text = "Annotation Time";
this.AnnotationTimeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// AnnotationTimeDP
//
this.AnnotationTimeDP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.AnnotationTimeDP.CustomFormat = "HH:mm:ss yyyy-MM-dd";
this.AnnotationTimeDP.Enabled = false;
this.AnnotationTimeDP.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.AnnotationTimeDP.Location = new System.Drawing.Point(118, 55);
this.AnnotationTimeDP.Name = "AnnotationTimeDP";
this.AnnotationTimeDP.Size = new System.Drawing.Size(138, 20);
this.AnnotationTimeDP.TabIndex = 5;
//
// UserNameLB
//
this.UserNameLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.UserNameLB.AutoSize = true;
this.UserNameLB.Location = new System.Drawing.Point(3, 26);
this.UserNameLB.Name = "UserNameLB";
this.UserNameLB.Size = new System.Drawing.Size(60, 26);
this.UserNameLB.TabIndex = 2;
this.UserNameLB.Text = "User Name";
this.UserNameLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// UserNameTB
//
this.UserNameTB.Location = new System.Drawing.Point(118, 29);
this.UserNameTB.Name = "UserNameTB";
this.UserNameTB.Size = new System.Drawing.Size(138, 20);
this.UserNameTB.TabIndex = 3;
//
// CommentLB
//
this.CommentLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.CommentLB.AutoSize = true;
this.CommentLB.Location = new System.Drawing.Point(3, 0);
this.CommentLB.Name = "CommentLB";
this.CommentLB.Size = new System.Drawing.Size(50, 26);
this.CommentLB.TabIndex = 0;
this.CommentLB.Text = "Message";
this.CommentLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// CommentTB
//
this.CommentTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.CommentTB.Location = new System.Drawing.Point(118, 3);
this.CommentTB.Multiline = true;
this.CommentTB.Name = "CommentTB";
this.CommentTB.Size = new System.Drawing.Size(332, 20);
this.CommentTB.TabIndex = 1;
//
// EditAnnotationDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBTN;
this.ClientSize = new System.Drawing.Size(453, 110);
this.Controls.Add(this.ControlsPN);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditAnnotationDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Annotation";
this.BottomPN.ResumeLayout(false);
this.ControlsPN.ResumeLayout(false);
this.ControlsPN.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.TableLayoutPanel ControlsPN;
private System.Windows.Forms.Label AnnotationTimeLB;
private System.Windows.Forms.DateTimePicker AnnotationTimeDP;
private System.Windows.Forms.Label UserNameLB;
private System.Windows.Forms.TextBox UserNameTB;
private System.Windows.Forms.Label CommentLB;
private System.Windows.Forms.TextBox CommentTB;
}
}
@@ -0,0 +1,115 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Prompts the user to edit a value.
/// </summary>
public partial class EditAnnotationDlg : Form
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public EditAnnotationDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
}
#endregion
#region Private Fields
private Session m_session;
#endregion
#region Public Interface
/// <summary>
/// Prompts the user to edit an annotation.
/// </summary>
public Annotation ShowDialog(Session session, Annotation annotation, string caption)
{
if (caption != null)
{
this.Text = caption;
}
m_session = session;
if (annotation == null)
{
annotation = new Annotation();
annotation.AnnotationTime = DateTime.UtcNow;
annotation.UserName = Environment.GetEnvironmentVariable("USERNAME");
annotation.Message = "<insert your message here>";
}
AnnotationTimeDP.Value = annotation.AnnotationTime;
UserNameTB.Text = annotation.UserName;
CommentTB.Text = annotation.Message;
if (ShowDialog() != DialogResult.OK)
{
return null;
}
annotation = new Annotation();
annotation.AnnotationTime = AnnotationTimeDP.Value;
annotation.UserName = UserNameTB.Text;
annotation.Message = CommentTB.Text;
return annotation;
}
#endregion
#region Event Handlers
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,246 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EditComplexValue2Dlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditComplexValue2Dlg));
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BottomPN = new System.Windows.Forms.Panel();
this.UpdateBTN = new System.Windows.Forms.Button();
this.RefreshBTN = new System.Windows.Forms.Button();
this.MainPN = new System.Windows.Forms.Panel();
this.ValueTB = new System.Windows.Forms.TextBox();
this.StatusCTRL = new System.Windows.Forms.StatusStrip();
this.DataTypeLB = new System.Windows.Forms.ToolStripStatusLabel();
this.DataTypeTB = new System.Windows.Forms.ToolStripStatusLabel();
this.EncodingCB = new System.Windows.Forms.ToolStripDropDownButton();
this.Encoding_DefaultXMLMI = new System.Windows.Forms.ToolStripMenuItem();
this.Encoding_DefaultBinaryMI = new System.Windows.Forms.ToolStripMenuItem();
this.BottomPN.SuspendLayout();
this.MainPN.SuspendLayout();
this.StatusCTRL.SuspendLayout();
this.SuspendLayout();
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(582, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 1;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.Location = new System.Drawing.Point(3, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 2;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
this.OkBTN.Click += new System.EventHandler(this.OkBTN_Click);
//
// BottomPN
//
this.BottomPN.Controls.Add(this.UpdateBTN);
this.BottomPN.Controls.Add(this.RefreshBTN);
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 273);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(660, 30);
this.BottomPN.TabIndex = 0;
//
// UpdateBTN
//
this.UpdateBTN.Location = new System.Drawing.Point(165, 4);
this.UpdateBTN.Name = "UpdateBTN";
this.UpdateBTN.Size = new System.Drawing.Size(75, 23);
this.UpdateBTN.TabIndex = 0;
this.UpdateBTN.Text = "Update";
this.UpdateBTN.UseVisualStyleBackColor = true;
this.UpdateBTN.Click += new System.EventHandler(this.UpdateBTN_Click);
//
// RefreshBTN
//
this.RefreshBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.RefreshBTN.Location = new System.Drawing.Point(84, 4);
this.RefreshBTN.Name = "RefreshBTN";
this.RefreshBTN.Size = new System.Drawing.Size(75, 23);
this.RefreshBTN.TabIndex = 3;
this.RefreshBTN.Text = "Refresh";
this.RefreshBTN.UseVisualStyleBackColor = true;
this.RefreshBTN.Click += new System.EventHandler(this.RefreshBTN_Click);
//
// MainPN
//
this.MainPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.MainPN.Controls.Add(this.ValueTB);
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
this.MainPN.Padding = new System.Windows.Forms.Padding(3);
this.MainPN.Size = new System.Drawing.Size(660, 273);
this.MainPN.TabIndex = 2;
//
// ValueTB
//
this.ValueTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ValueTB.Location = new System.Drawing.Point(3, 3);
this.ValueTB.MaxLength = 10240000;
this.ValueTB.Multiline = true;
this.ValueTB.Name = "ValueTB";
this.ValueTB.Size = new System.Drawing.Size(654, 267);
this.ValueTB.TabIndex = 0;
this.ValueTB.TextChanged += new System.EventHandler(this.ValueTB_TextChanged);
//
// StatusCTRL
//
this.StatusCTRL.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.DataTypeLB,
this.DataTypeTB,
this.EncodingCB});
this.StatusCTRL.Location = new System.Drawing.Point(0, 303);
this.StatusCTRL.Name = "StatusCTRL";
this.StatusCTRL.Size = new System.Drawing.Size(660, 22);
this.StatusCTRL.TabIndex = 1;
this.StatusCTRL.Text = "statusStrip1";
//
// DataTypeLB
//
this.DataTypeLB.Name = "DataTypeLB";
this.DataTypeLB.Size = new System.Drawing.Size(60, 17);
this.DataTypeLB.Text = "Data Type";
//
// DataTypeTB
//
this.DataTypeTB.Name = "DataTypeTB";
this.DataTypeTB.Size = new System.Drawing.Size(55, 17);
this.DataTypeTB.Text = "Structure";
//
// EncodingCB
//
this.EncodingCB.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.EncodingCB.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Encoding_DefaultXMLMI,
this.Encoding_DefaultBinaryMI});
this.EncodingCB.Image = ((System.Drawing.Image)(resources.GetObject("EncodingCB.Image")));
this.EncodingCB.ImageTransparentColor = System.Drawing.Color.Magenta;
this.EncodingCB.Name = "EncodingCB";
this.EncodingCB.Size = new System.Drawing.Size(85, 20);
this.EncodingCB.Text = "Default XML";
this.EncodingCB.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
//
// Encoding_DefaultXMLMI
//
this.Encoding_DefaultXMLMI.Name = "Encoding_DefaultXMLMI";
this.Encoding_DefaultXMLMI.Size = new System.Drawing.Size(148, 22);
this.Encoding_DefaultXMLMI.Text = "Default XML";
//
// Encoding_DefaultBinaryMI
//
this.Encoding_DefaultBinaryMI.Name = "Encoding_DefaultBinaryMI";
this.Encoding_DefaultBinaryMI.Size = new System.Drawing.Size(148, 22);
this.Encoding_DefaultBinaryMI.Text = "Default Binary";
//
// EditComplexValue2Dlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBTN;
this.ClientSize = new System.Drawing.Size(660, 325);
this.Controls.Add(this.MainPN);
this.Controls.Add(this.BottomPN);
this.Controls.Add(this.StatusCTRL);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditComplexValue2Dlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Value";
this.BottomPN.ResumeLayout(false);
this.MainPN.ResumeLayout(false);
this.MainPN.PerformLayout();
this.StatusCTRL.ResumeLayout(false);
this.StatusCTRL.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.Panel MainPN;
private System.Windows.Forms.TextBox ValueTB;
private System.Windows.Forms.Button UpdateBTN;
private System.Windows.Forms.Button RefreshBTN;
private System.Windows.Forms.StatusStrip StatusCTRL;
private System.Windows.Forms.ToolStripStatusLabel DataTypeLB;
private System.Windows.Forms.ToolStripStatusLabel DataTypeTB;
private System.Windows.Forms.ToolStripDropDownButton EncodingCB;
private System.Windows.Forms.ToolStripMenuItem Encoding_DefaultXMLMI;
private System.Windows.Forms.ToolStripMenuItem Encoding_DefaultBinaryMI;
}
}
@@ -0,0 +1,386 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Prompts the user to edit a value.
/// </summary>
public partial class EditComplexValue2Dlg : Form
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public EditComplexValue2Dlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
}
#endregion
#region Private Fields
private Session m_session;
private NodeId m_variableId;
private Variant m_value;
private bool m_textChanged;
private QualifiedName m_encodingName;
#endregion
#region Public Interface
/// <summary>
/// Prompts the user to edit a value.
/// </summary>
public Variant ShowDialog(Session session, NodeId variableId, Variant value, string caption)
{
if (caption != null)
{
this.Text = caption;
}
m_session = session;
m_variableId = variableId;
SetValue(value);
if (ShowDialog() != DialogResult.OK)
{
return Variant.Null;
}
return GetValue();
}
#endregion
/// <summary>
/// Sets the value shown in the control.
/// </summary>
private void SetValue(Variant value)
{
ValueTB.ForeColor = Color.Empty;
ValueTB.Font = new Font(ValueTB.Font, FontStyle.Regular);
m_textChanged = false;
// check for null.
if (Variant.Null == value)
{
ValueTB.Text = String.Empty;
m_value = Variant.Null;
return;
}
// get the source type.
TypeInfo sourceType = value.TypeInfo;
if (sourceType == null)
{
sourceType = TypeInfo.Construct(value.Value);
}
m_value = new Variant(value.Value, sourceType);
// display value as text.
StringBuilder buffer = new StringBuilder();
XmlWriter writer = XmlWriter.Create(buffer, new XmlWriterSettings() { Indent = true, OmitXmlDeclaration = true });
XmlEncoder encoder = new XmlEncoder(new XmlQualifiedName("Value", Namespaces.OpcUaXsd), writer, m_session.MessageContext);
encoder.WriteVariantContents(m_value.Value, m_value.TypeInfo);
writer.Close();
ValueTB.Text = buffer.ToString();
// extract the encoding id from the value.
ExpandedNodeId encodingId = null;
ExtensionObjectEncoding encoding = ExtensionObjectEncoding.None;
if (sourceType.BuiltInType == BuiltInType.ExtensionObject)
{
ExtensionObject extension = null;
if (sourceType.ValueRank == ValueRanks.Scalar)
{
extension = (ExtensionObject)m_value.Value;
}
else
{
// only use the first item in the list for arrays.
ExtensionObject[] list = (ExtensionObject[])m_value.Value;
if (list.Length > 0)
{
extension = list[0];
}
}
encodingId = extension.TypeId;
encoding = extension.Encoding;
}
if (encodingId == null)
{
StatusCTRL.Visible = false;
return;
}
// check if the encoding is known.
IObject encodingNode = m_session.NodeCache.Find(encodingId) as IObject;
if (encodingNode == null)
{
StatusCTRL.Visible = false;
return;
}
// update the encoding shown.
if (encoding == ExtensionObjectEncoding.EncodeableObject)
{
EncodingCB.Text = "(Converted to XML by Client)";
}
else
{
EncodingCB.Text = m_session.NodeCache.GetDisplayText(encodingNode);
}
m_encodingName = encodingNode.BrowseName;
// find the data type for the encoding.
IDataType dataTypeNode = null;
foreach (INode node in m_session.NodeCache.Find(encodingNode.NodeId, Opc.Ua.ReferenceTypeIds.HasEncoding, true, false))
{
dataTypeNode = node as IDataType;
if (dataTypeNode != null)
{
break;
}
}
if (dataTypeNode == null)
{
StatusCTRL.Visible = false;
return;
}
// update data type display.
DataTypeTB.Text = m_session.NodeCache.GetDisplayText(dataTypeNode);
DataTypeTB.Tag = dataTypeNode;
// update encoding drop down.
EncodingCB.DropDownItems.Clear();
foreach (INode node in m_session.NodeCache.Find(dataTypeNode.NodeId, Opc.Ua.ReferenceTypeIds.HasEncoding, false, false))
{
IObject encodingNode2 = node as IObject;
if (encodingNode2 != null)
{
ToolStripMenuItem item = new ToolStripMenuItem(m_session.NodeCache.GetDisplayText(encodingNode2));
item.Tag = encodingNode2;
item.Click += new EventHandler(EncodingCB_Item_Click);
EncodingCB.DropDownItems.Add(item);
}
}
StatusCTRL.Visible = true;
}
/// <summary>
/// Converts the XML back to a value.
/// </summary>
private Variant GetValue()
{
if (!m_textChanged)
{
return m_value;
}
XmlDocument document = new XmlDocument();
document.InnerXml = ValueTB.Text;
// find the first element.
XmlElement element = null;
for (XmlNode node = document.DocumentElement.FirstChild; node != null; node = node.NextSibling)
{
element = node as XmlElement;
if (element != null)
{
break;
}
}
XmlDecoder decoder = new XmlDecoder(element, m_session.MessageContext);
decoder.PushNamespace(Namespaces.OpcUaXsd);
TypeInfo typeInfo = null;
object value = decoder.ReadVariantContents(out typeInfo);
return new Variant(value, typeInfo);
}
#region Event Handlers
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
private void EncodingCB_Item_Click(object sender, EventArgs e)
{
try
{
ToolStripMenuItem item = sender as ToolStripMenuItem;
if (item != null)
{
IObject encodingNode = item.Tag as IObject;
m_encodingName = encodingNode.BrowseName;
EncodingCB.Text = item.Text;
ValueTB.Text = null;
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void RefreshBTN_Click(object sender, EventArgs e)
{
try
{
ReadValueId nodeToRead = new ReadValueId();
nodeToRead.NodeId = m_variableId;
nodeToRead.AttributeId = Attributes.Value;
nodeToRead.DataEncoding = m_encodingName;
ReadValueIdCollection nodesToRead = new ReadValueIdCollection();
nodesToRead.Add(nodeToRead);
// read the attributes.
DataValueCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.Read(
null,
0,
TimestampsToReturn.Neither,
nodesToRead,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToRead);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToRead);
// check for error.
if (StatusCode.IsBad(results[0].StatusCode))
{
ValueTB.Text = results[0].StatusCode.ToString();
ValueTB.ForeColor = Color.Red;
ValueTB.Font = new Font(ValueTB.Font, FontStyle.Bold);
return;
}
SetValue(results[0].WrappedValue);
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void UpdateBTN_Click(object sender, EventArgs e)
{
try
{
WriteValue nodeToWrite = new WriteValue();
nodeToWrite.NodeId = m_variableId;
nodeToWrite.AttributeId = Attributes.Value;
nodeToWrite.Value = new DataValue();
nodeToWrite.Value.WrappedValue = GetValue();
WriteValueCollection nodesToWrite = new WriteValueCollection();
nodesToWrite.Add(nodeToWrite);
// read the attributes.
StatusCodeCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
ResponseHeader responseHeader = m_session.Write(
null,
nodesToWrite,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToWrite);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToWrite);
// check for error.
if (StatusCode.IsBad(results[0]))
{
throw ServiceResultException.Create(results[0], 0, diagnosticInfos, responseHeader.StringTable);
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void ValueTB_TextChanged(object sender, EventArgs e)
{
m_textChanged = true;
}
private void EncodingCB_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="StatusCTRL.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="EncodingCB.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
</root>
@@ -0,0 +1,191 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls.Common
{
partial class EditComplexValueCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.ValuesDV = new System.Windows.Forms.DataGridView();
this.Icon = new System.Windows.Forms.DataGridViewImageColumn();
this.NameCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DataTypeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ValueCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.NavigationMENU = new System.Windows.Forms.MenuStrip();
this.ImageList = new System.Windows.Forms.ImageList(this.components);
this.TextValueTB = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.ValuesDV)).BeginInit();
this.SuspendLayout();
//
// ValuesDV
//
this.ValuesDV.AllowUserToAddRows = false;
this.ValuesDV.AllowUserToDeleteRows = false;
this.ValuesDV.AllowUserToResizeRows = false;
this.ValuesDV.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
this.ValuesDV.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.ValuesDV.BackgroundColor = System.Drawing.SystemColors.Window;
this.ValuesDV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.ValuesDV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Icon,
this.NameCH,
this.DataTypeCH,
this.ValueCH});
this.ValuesDV.Dock = System.Windows.Forms.DockStyle.Fill;
this.ValuesDV.Location = new System.Drawing.Point(0, 24);
this.ValuesDV.MultiSelect = false;
this.ValuesDV.Name = "ValuesDV";
this.ValuesDV.RowHeadersVisible = false;
this.ValuesDV.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
this.ValuesDV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.ValuesDV.Size = new System.Drawing.Size(512, 214);
this.ValuesDV.TabIndex = 0;
this.ValuesDV.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.ValuesDV_CellValueChanged);
this.ValuesDV.DoubleClick += new System.EventHandler(this.ValuesDV_DoubleClick);
this.ValuesDV.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.ValuesDV_CellValidating);
//
// Icon
//
this.Icon.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.Icon.DataPropertyName = "Icon";
this.Icon.HeaderText = "";
this.Icon.Name = "Icon";
this.Icon.ReadOnly = true;
this.Icon.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Icon.Width = 5;
//
// NameCH
//
this.NameCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.NameCH.DataPropertyName = "Name";
this.NameCH.HeaderText = "Name";
this.NameCH.Name = "NameCH";
this.NameCH.ReadOnly = true;
this.NameCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
this.NameCH.Width = 60;
//
// DataTypeCH
//
this.DataTypeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.DataTypeCH.DataPropertyName = "DataType";
this.DataTypeCH.HeaderText = "Data Type";
this.DataTypeCH.Name = "DataTypeCH";
this.DataTypeCH.ReadOnly = true;
this.DataTypeCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
this.DataTypeCH.Width = 82;
//
// ValueCH
//
this.ValueCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.ValueCH.DataPropertyName = "Value";
this.ValueCH.HeaderText = "Value";
this.ValueCH.Name = "ValueCH";
this.ValueCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
//
// NavigationMENU
//
this.NavigationMENU.Location = new System.Drawing.Point(0, 0);
this.NavigationMENU.Name = "NavigationMENU";
this.NavigationMENU.Size = new System.Drawing.Size(512, 24);
this.NavigationMENU.TabIndex = 1;
this.NavigationMENU.Text = "menuStrip1";
//
// ImageList
//
this.ImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.ImageList.ImageSize = new System.Drawing.Size(16, 16);
this.ImageList.TransparentColor = System.Drawing.Color.White;
//
// TextValueTB
//
this.TextValueTB.AcceptsReturn = true;
this.TextValueTB.AcceptsTab = true;
this.TextValueTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.TextValueTB.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.TextValueTB.Location = new System.Drawing.Point(0, 24);
this.TextValueTB.Multiline = true;
this.TextValueTB.Name = "TextValueTB";
this.TextValueTB.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.TextValueTB.Size = new System.Drawing.Size(512, 214);
this.TextValueTB.TabIndex = 2;
this.TextValueTB.WordWrap = false;
//
// EditComplexValueCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.ValuesDV);
this.Controls.Add(this.TextValueTB);
this.Controls.Add(this.NavigationMENU);
this.Name = "EditComplexValueCtrl";
this.Size = new System.Drawing.Size(512, 238);
((System.ComponentModel.ISupportInitialize)(this.ValuesDV)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DataGridView ValuesDV;
private System.Windows.Forms.MenuStrip NavigationMENU;
private System.Windows.Forms.ImageList ImageList;
private System.Windows.Forms.TextBox TextValueTB;
private System.Windows.Forms.DataGridViewImageColumn Icon;
private System.Windows.Forms.DataGridViewTextBoxColumn NameCH;
private System.Windows.Forms.DataGridViewTextBoxColumn DataTypeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn ValueCH;
}
}
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="Icon.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="NameCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DataTypeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ValueCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Icon.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="NameCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DataTypeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ValueCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="NavigationMENU.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>163, 17</value>
</metadata>
</root>
@@ -0,0 +1,206 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EditComplexValueDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.MainPN = new System.Windows.Forms.Panel();
this.ValueCTRL = new Opc.Ua.Client.Controls.Common.EditComplexValueCtrl();
this.BottomPN = new System.Windows.Forms.Panel();
this.ButtonsPN = new System.Windows.Forms.FlowLayoutPanel();
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BackBTN = new System.Windows.Forms.Button();
this.SetArraySizeBTN = new System.Windows.Forms.Button();
this.SetTypeCB = new System.Windows.Forms.ComboBox();
this.MainPN.SuspendLayout();
this.BottomPN.SuspendLayout();
this.ButtonsPN.SuspendLayout();
this.SuspendLayout();
//
// MainPN
//
this.MainPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.MainPN.Controls.Add(this.ValueCTRL);
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
this.MainPN.Size = new System.Drawing.Size(658, 221);
this.MainPN.TabIndex = 1;
//
// ValueCTRL
//
this.ValueCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.ValueCTRL.Location = new System.Drawing.Point(0, 0);
this.ValueCTRL.Name = "ValueCTRL";
this.ValueCTRL.Size = new System.Drawing.Size(658, 221);
this.ValueCTRL.TabIndex = 0;
this.ValueCTRL.ValueChanged += new System.EventHandler(this.ValueCTRL_ValueChanged);
//
// BottomPN
//
this.BottomPN.Controls.Add(this.ButtonsPN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 221);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(658, 28);
this.BottomPN.TabIndex = 3;
//
// ButtonsPN
//
this.ButtonsPN.Controls.Add(this.CancelBTN);
this.ButtonsPN.Controls.Add(this.OkBTN);
this.ButtonsPN.Controls.Add(this.BackBTN);
this.ButtonsPN.Controls.Add(this.SetArraySizeBTN);
this.ButtonsPN.Controls.Add(this.SetTypeCB);
this.ButtonsPN.Dock = System.Windows.Forms.DockStyle.Right;
this.ButtonsPN.Location = new System.Drawing.Point(174, 0);
this.ButtonsPN.Name = "ButtonsPN";
this.ButtonsPN.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.ButtonsPN.Size = new System.Drawing.Size(484, 28);
this.ButtonsPN.TabIndex = 5;
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(406, 3);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 7;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OkBTN.Location = new System.Drawing.Point(325, 3);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 6;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
this.OkBTN.Click += new System.EventHandler(this.OkBTN_Click);
//
// BackBTN
//
this.BackBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.BackBTN.Location = new System.Drawing.Point(244, 3);
this.BackBTN.Name = "BackBTN";
this.BackBTN.Size = new System.Drawing.Size(75, 23);
this.BackBTN.TabIndex = 5;
this.BackBTN.Text = "Back";
this.BackBTN.UseVisualStyleBackColor = true;
this.BackBTN.Click += new System.EventHandler(this.BackBTN_Click);
//
// SetArraySizeBTN
//
this.SetArraySizeBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.SetArraySizeBTN.Location = new System.Drawing.Point(148, 3);
this.SetArraySizeBTN.Name = "SetArraySizeBTN";
this.SetArraySizeBTN.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.SetArraySizeBTN.Size = new System.Drawing.Size(90, 23);
this.SetArraySizeBTN.TabIndex = 9;
this.SetArraySizeBTN.Text = "Set Array Size...";
this.SetArraySizeBTN.UseVisualStyleBackColor = true;
this.SetArraySizeBTN.Click += new System.EventHandler(this.SetTypeBTN_Click);
//
// SetTypeCB
//
this.SetTypeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.SetTypeCB.FormattingEnabled = true;
this.SetTypeCB.Location = new System.Drawing.Point(27, 4);
this.SetTypeCB.Margin = new System.Windows.Forms.Padding(3, 4, 3, 3);
this.SetTypeCB.Name = "SetTypeCB";
this.SetTypeCB.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.SetTypeCB.Size = new System.Drawing.Size(115, 21);
this.SetTypeCB.TabIndex = 10;
this.SetTypeCB.SelectedIndexChanged += new System.EventHandler(this.SetTypeCB_SelectedIndexChanged);
//
// EditComplexValueDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(658, 249);
this.Controls.Add(this.MainPN);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditComplexValueDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Value";
this.MainPN.ResumeLayout(false);
this.BottomPN.ResumeLayout(false);
this.ButtonsPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel MainPN;
private Opc.Ua.Client.Controls.Common.EditComplexValueCtrl ValueCTRL;
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.FlowLayoutPanel ButtonsPN;
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Button BackBTN;
private System.Windows.Forms.Button SetArraySizeBTN;
private System.Windows.Forms.ComboBox SetTypeCB;
}
}
@@ -0,0 +1,239 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Prompts the user to edit a value.
/// </summary>
public partial class EditComplexValueDlg : Form
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public EditComplexValueDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
for (BuiltInType ii = BuiltInType.Boolean; ii <= BuiltInType.StatusCode; ii++)
{
SetTypeCB.Items.Add(ii);
}
SetTypeCB.SelectedItem = BuiltInType.String;
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Prompts the user to view or edit the value.
/// </summary>
public object ShowDialog(
Session session,
NodeId nodeId,
uint attributeId,
string name,
object value,
bool readOnly,
string caption)
{
if (!String.IsNullOrEmpty(caption))
{
this.Text = caption;
}
OkBTN.Visible = !readOnly;
ValueCTRL.ChangeSession(session);
ValueCTRL.ShowValue(nodeId, attributeId, name, value, readOnly);
if (base.ShowDialog() != DialogResult.OK)
{
return null;
}
return ValueCTRL.GetValue();
}
/// <summary>
/// Prompts the user to edit the value.
/// </summary>
public object ShowDialog(
Session session,
string name,
NodeId dataType,
int valueRank,
object value,
string caption)
{
if (!String.IsNullOrEmpty(caption))
{
this.Text = caption;
}
OkBTN.Visible = true;
ValueCTRL.ChangeSession(session);
ValueCTRL.ShowValue(name, dataType, valueRank, value);
if (base.ShowDialog() != DialogResult.OK)
{
return null;
}
return ValueCTRL.GetValue();
}
/// <summary>
/// Prompts the user to edit the value.
/// </summary>
public object ShowDialog(
TypeInfo expectedType,
string name,
object value,
string caption)
{
if (!String.IsNullOrEmpty(caption))
{
this.Text = caption;
}
OkBTN.Visible = true;
ValueCTRL.ChangeSession(null);
ValueCTRL.ShowValue(expectedType, name, value);
if (base.ShowDialog() != DialogResult.OK)
{
return null;
}
return ValueCTRL.GetValue();
}
/// <summary>
/// Changes the session used.
/// </summary>
public void ChangeSession(Session session)
{
ValueCTRL.ChangeSession(session);
}
/// <summary>
/// Updates the value shown in the control.
/// </summary>
public void UpdateValue(
NodeId nodeId,
uint attributeId,
string name,
object value)
{
ValueCTRL.ShowValue(nodeId, attributeId, name, value, true);
}
#endregion
#region Event Handlers
private void ValueCTRL_ValueChanged(object sender, EventArgs e)
{
try
{
BackBTN.Visible = ValueCTRL.CanGoBack;
SetTypeCB.Visible = ValueCTRL.CanChangeType;
SetTypeCB.SelectedItem = ValueCTRL.CurrentType;
SetArraySizeBTN.Visible = ValueCTRL.CanSetArraySize;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void BackBTN_Click(object sender, EventArgs e)
{
try
{
ValueCTRL.Back();
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
ValueCTRL.EndEdit();
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void SetTypeBTN_Click(object sender, EventArgs e)
{
try
{
ValueCTRL.SetArraySize();
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void SetTypeCB_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
ValueCTRL.SetType((BuiltInType)SetTypeCB.SelectedItem);
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,517 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EditMonitoredItemDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BottomPN = new System.Windows.Forms.Panel();
this.MainPN = new System.Windows.Forms.Panel();
this.ControlsPN = new System.Windows.Forms.TableLayoutPanel();
this.TriggerTypeCB = new System.Windows.Forms.ComboBox();
this.TriggerTypeLB = new System.Windows.Forms.Label();
this.DeadbandValueLB = new System.Windows.Forms.Label();
this.DeadbandValueUP = new System.Windows.Forms.NumericUpDown();
this.DeadbandTypeCB = new System.Windows.Forms.ComboBox();
this.MonitoringModeCB = new System.Windows.Forms.ComboBox();
this.MonitoringModeLB = new System.Windows.Forms.Label();
this.DeadbandTypeLB = new System.Windows.Forms.Label();
this.DiscardOldestLB = new System.Windows.Forms.Label();
this.QueueSizeLB = new System.Windows.Forms.Label();
this.SamplingIntervalLB = new System.Windows.Forms.Label();
this.NodeLB = new System.Windows.Forms.Label();
this.IndexRangeTB = new System.Windows.Forms.TextBox();
this.AttributeCB = new System.Windows.Forms.ComboBox();
this.AttributeLB = new System.Windows.Forms.Label();
this.IndexRangeLB = new System.Windows.Forms.Label();
this.DataEncodingLB = new System.Windows.Forms.Label();
this.DataEncodingCB = new System.Windows.Forms.ComboBox();
this.NodeTB = new System.Windows.Forms.TextBox();
this.NodeBTN = new Opc.Ua.Client.Controls.SelectNodeCtrl();
this.QueueSizeUP = new System.Windows.Forms.NumericUpDown();
this.SamplingIntervalUP = new System.Windows.Forms.NumericUpDown();
this.DiscardOldestCK = new System.Windows.Forms.CheckBox();
this.BottomPN.SuspendLayout();
this.MainPN.SuspendLayout();
this.ControlsPN.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DeadbandValueUP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.QueueSizeUP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SamplingIntervalUP)).BeginInit();
this.SuspendLayout();
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(293, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 0;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.Location = new System.Drawing.Point(3, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 1;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
this.OkBTN.Click += new System.EventHandler(this.OkBTN_Click);
//
// BottomPN
//
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 285);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(371, 30);
this.BottomPN.TabIndex = 0;
//
// MainPN
//
this.MainPN.AutoSize = true;
this.MainPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.MainPN.Controls.Add(this.ControlsPN);
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
this.MainPN.Size = new System.Drawing.Size(371, 285);
this.MainPN.TabIndex = 1;
//
// ControlsPN
//
this.ControlsPN.AutoSize = true;
this.ControlsPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ControlsPN.ColumnCount = 3;
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.Controls.Add(this.TriggerTypeCB, 1, 10);
this.ControlsPN.Controls.Add(this.TriggerTypeLB, 0, 10);
this.ControlsPN.Controls.Add(this.DeadbandValueLB, 0, 9);
this.ControlsPN.Controls.Add(this.DeadbandValueUP, 1, 9);
this.ControlsPN.Controls.Add(this.DeadbandTypeCB, 1, 8);
this.ControlsPN.Controls.Add(this.MonitoringModeCB, 1, 4);
this.ControlsPN.Controls.Add(this.MonitoringModeLB, 0, 4);
this.ControlsPN.Controls.Add(this.DeadbandTypeLB, 0, 8);
this.ControlsPN.Controls.Add(this.DiscardOldestLB, 0, 7);
this.ControlsPN.Controls.Add(this.QueueSizeLB, 0, 6);
this.ControlsPN.Controls.Add(this.SamplingIntervalLB, 0, 5);
this.ControlsPN.Controls.Add(this.NodeLB, 0, 0);
this.ControlsPN.Controls.Add(this.IndexRangeTB, 1, 2);
this.ControlsPN.Controls.Add(this.AttributeCB, 1, 1);
this.ControlsPN.Controls.Add(this.AttributeLB, 0, 1);
this.ControlsPN.Controls.Add(this.IndexRangeLB, 0, 2);
this.ControlsPN.Controls.Add(this.DataEncodingLB, 0, 3);
this.ControlsPN.Controls.Add(this.DataEncodingCB, 1, 3);
this.ControlsPN.Controls.Add(this.NodeTB, 1, 0);
this.ControlsPN.Controls.Add(this.NodeBTN, 2, 0);
this.ControlsPN.Controls.Add(this.QueueSizeUP, 1, 6);
this.ControlsPN.Controls.Add(this.SamplingIntervalUP, 1, 5);
this.ControlsPN.Controls.Add(this.DiscardOldestCK, 1, 7);
this.ControlsPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.ControlsPN.Location = new System.Drawing.Point(0, 0);
this.ControlsPN.Name = "ControlsPN";
this.ControlsPN.RowCount = 12;
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.ControlsPN.Size = new System.Drawing.Size(371, 285);
this.ControlsPN.TabIndex = 0;
//
// TriggerTypeCB
//
this.TriggerTypeCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.TriggerTypeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.TriggerTypeCB.FormattingEnabled = true;
this.TriggerTypeCB.Location = new System.Drawing.Point(97, 261);
this.TriggerTypeCB.Name = "TriggerTypeCB";
this.TriggerTypeCB.Size = new System.Drawing.Size(138, 21);
this.TriggerTypeCB.TabIndex = 22;
//
// TriggerTypeLB
//
this.TriggerTypeLB.AutoSize = true;
this.TriggerTypeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.TriggerTypeLB.Location = new System.Drawing.Point(3, 258);
this.TriggerTypeLB.Name = "TriggerTypeLB";
this.TriggerTypeLB.Size = new System.Drawing.Size(88, 27);
this.TriggerTypeLB.TabIndex = 21;
this.TriggerTypeLB.Text = "Trigger Type";
this.TriggerTypeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DeadbandValueLB
//
this.DeadbandValueLB.AutoSize = true;
this.DeadbandValueLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.DeadbandValueLB.Location = new System.Drawing.Point(3, 232);
this.DeadbandValueLB.Name = "DeadbandValueLB";
this.DeadbandValueLB.Size = new System.Drawing.Size(88, 26);
this.DeadbandValueLB.TabIndex = 19;
this.DeadbandValueLB.Text = "Deadband Value";
this.DeadbandValueLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DeadbandValueUP
//
this.DeadbandValueUP.Location = new System.Drawing.Point(97, 235);
this.DeadbandValueUP.Maximum = new decimal(new int[] {
0,
1,
0,
0});
this.DeadbandValueUP.Name = "DeadbandValueUP";
this.DeadbandValueUP.Size = new System.Drawing.Size(138, 20);
this.DeadbandValueUP.TabIndex = 20;
//
// DeadbandTypeCB
//
this.DeadbandTypeCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.DeadbandTypeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.DeadbandTypeCB.FormattingEnabled = true;
this.DeadbandTypeCB.Location = new System.Drawing.Point(97, 208);
this.DeadbandTypeCB.Name = "DeadbandTypeCB";
this.DeadbandTypeCB.Size = new System.Drawing.Size(138, 21);
this.DeadbandTypeCB.TabIndex = 18;
//
// MonitoringModeCB
//
this.MonitoringModeCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.MonitoringModeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.MonitoringModeCB.FormattingEnabled = true;
this.MonitoringModeCB.Location = new System.Drawing.Point(97, 109);
this.MonitoringModeCB.Name = "MonitoringModeCB";
this.MonitoringModeCB.Size = new System.Drawing.Size(138, 21);
this.MonitoringModeCB.TabIndex = 10;
//
// MonitoringModeLB
//
this.MonitoringModeLB.AutoSize = true;
this.MonitoringModeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.MonitoringModeLB.Location = new System.Drawing.Point(3, 106);
this.MonitoringModeLB.Name = "MonitoringModeLB";
this.MonitoringModeLB.Size = new System.Drawing.Size(88, 27);
this.MonitoringModeLB.TabIndex = 9;
this.MonitoringModeLB.Text = "Monitoring Mode";
this.MonitoringModeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DeadbandTypeLB
//
this.DeadbandTypeLB.AutoSize = true;
this.DeadbandTypeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.DeadbandTypeLB.Location = new System.Drawing.Point(3, 205);
this.DeadbandTypeLB.Name = "DeadbandTypeLB";
this.DeadbandTypeLB.Size = new System.Drawing.Size(88, 27);
this.DeadbandTypeLB.TabIndex = 17;
this.DeadbandTypeLB.Text = "Deadband Type";
this.DeadbandTypeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DiscardOldestLB
//
this.DiscardOldestLB.AutoSize = true;
this.DiscardOldestLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.DiscardOldestLB.Location = new System.Drawing.Point(3, 185);
this.DiscardOldestLB.Name = "DiscardOldestLB";
this.DiscardOldestLB.Size = new System.Drawing.Size(88, 20);
this.DiscardOldestLB.TabIndex = 15;
this.DiscardOldestLB.Text = "Discard Oldest";
this.DiscardOldestLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// QueueSizeLB
//
this.QueueSizeLB.AutoSize = true;
this.QueueSizeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.QueueSizeLB.Location = new System.Drawing.Point(3, 159);
this.QueueSizeLB.Name = "QueueSizeLB";
this.QueueSizeLB.Size = new System.Drawing.Size(88, 26);
this.QueueSizeLB.TabIndex = 13;
this.QueueSizeLB.Text = "Queue Size";
this.QueueSizeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// SamplingIntervalLB
//
this.SamplingIntervalLB.AutoSize = true;
this.SamplingIntervalLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.SamplingIntervalLB.Location = new System.Drawing.Point(3, 133);
this.SamplingIntervalLB.Name = "SamplingIntervalLB";
this.SamplingIntervalLB.Size = new System.Drawing.Size(88, 26);
this.SamplingIntervalLB.TabIndex = 11;
this.SamplingIntervalLB.Text = "Sampling Interval";
this.SamplingIntervalLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// NodeLB
//
this.NodeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeLB.AutoSize = true;
this.NodeLB.Location = new System.Drawing.Point(3, 0);
this.NodeLB.Name = "NodeLB";
this.NodeLB.Size = new System.Drawing.Size(33, 26);
this.NodeLB.TabIndex = 0;
this.NodeLB.Text = "Node";
this.NodeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// IndexRangeTB
//
this.IndexRangeTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.IndexRangeTB.Location = new System.Drawing.Point(97, 56);
this.IndexRangeTB.Name = "IndexRangeTB";
this.IndexRangeTB.Size = new System.Drawing.Size(247, 20);
this.IndexRangeTB.TabIndex = 6;
//
// AttributeCB
//
this.AttributeCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.AttributeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.AttributeCB.FormattingEnabled = true;
this.AttributeCB.Location = new System.Drawing.Point(97, 29);
this.AttributeCB.Name = "AttributeCB";
this.AttributeCB.Size = new System.Drawing.Size(138, 21);
this.AttributeCB.TabIndex = 4;
//
// AttributeLB
//
this.AttributeLB.AutoSize = true;
this.AttributeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.AttributeLB.Location = new System.Drawing.Point(3, 26);
this.AttributeLB.Name = "AttributeLB";
this.AttributeLB.Size = new System.Drawing.Size(88, 27);
this.AttributeLB.TabIndex = 3;
this.AttributeLB.Text = "Attribute";
this.AttributeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// IndexRangeLB
//
this.IndexRangeLB.AutoSize = true;
this.IndexRangeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.IndexRangeLB.Location = new System.Drawing.Point(3, 53);
this.IndexRangeLB.Name = "IndexRangeLB";
this.IndexRangeLB.Size = new System.Drawing.Size(88, 26);
this.IndexRangeLB.TabIndex = 5;
this.IndexRangeLB.Text = "Index Range";
this.IndexRangeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DataEncodingLB
//
this.DataEncodingLB.AutoSize = true;
this.DataEncodingLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.DataEncodingLB.Location = new System.Drawing.Point(3, 79);
this.DataEncodingLB.Name = "DataEncodingLB";
this.DataEncodingLB.Size = new System.Drawing.Size(88, 27);
this.DataEncodingLB.TabIndex = 7;
this.DataEncodingLB.Text = "Data Encoding";
this.DataEncodingLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DataEncodingCB
//
this.DataEncodingCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.DataEncodingCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.DataEncodingCB.FormattingEnabled = true;
this.DataEncodingCB.Location = new System.Drawing.Point(97, 82);
this.DataEncodingCB.Name = "DataEncodingCB";
this.DataEncodingCB.Size = new System.Drawing.Size(138, 21);
this.DataEncodingCB.TabIndex = 8;
//
// NodeTB
//
this.NodeTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.NodeTB.Location = new System.Drawing.Point(97, 3);
this.NodeTB.Name = "NodeTB";
this.NodeTB.ReadOnly = true;
this.NodeTB.Size = new System.Drawing.Size(247, 20);
this.NodeTB.TabIndex = 1;
//
// NodeBTN
//
this.NodeBTN.Location = new System.Drawing.Point(347, 0);
this.NodeBTN.Margin = new System.Windows.Forms.Padding(0);
this.NodeBTN.Name = "NodeBTN";
this.NodeBTN.NodeControl = this.NodeTB;
this.NodeBTN.ReferenceTypeIds = null;
this.NodeBTN.RootId = null;
this.NodeBTN.SelectedNode = null;
this.NodeBTN.SelectedReference = null;
this.NodeBTN.Session = null;
this.NodeBTN.Size = new System.Drawing.Size(24, 24);
this.NodeBTN.TabIndex = 2;
this.NodeBTN.View = null;
//
// QueueSizeUP
//
this.QueueSizeUP.Location = new System.Drawing.Point(97, 162);
this.QueueSizeUP.Maximum = new decimal(new int[] {
0,
1,
0,
0});
this.QueueSizeUP.Name = "QueueSizeUP";
this.QueueSizeUP.Size = new System.Drawing.Size(138, 20);
this.QueueSizeUP.TabIndex = 14;
//
// SamplingIntervalUP
//
this.SamplingIntervalUP.Increment = new decimal(new int[] {
1000,
0,
0,
0});
this.SamplingIntervalUP.Location = new System.Drawing.Point(97, 136);
this.SamplingIntervalUP.Maximum = new decimal(new int[] {
0,
1,
0,
0});
this.SamplingIntervalUP.Minimum = new decimal(new int[] {
1,
0,
0,
-2147483648});
this.SamplingIntervalUP.Name = "SamplingIntervalUP";
this.SamplingIntervalUP.Size = new System.Drawing.Size(138, 20);
this.SamplingIntervalUP.TabIndex = 12;
this.SamplingIntervalUP.ThousandsSeparator = true;
//
// DiscardOldestCK
//
this.DiscardOldestCK.AutoSize = true;
this.DiscardOldestCK.Checked = true;
this.DiscardOldestCK.CheckState = System.Windows.Forms.CheckState.Checked;
this.DiscardOldestCK.Location = new System.Drawing.Point(97, 188);
this.DiscardOldestCK.Name = "DiscardOldestCK";
this.DiscardOldestCK.Size = new System.Drawing.Size(15, 14);
this.DiscardOldestCK.TabIndex = 16;
this.DiscardOldestCK.UseVisualStyleBackColor = true;
//
// EditMonitoredItemDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.CancelButton = this.CancelBTN;
this.ClientSize = new System.Drawing.Size(371, 315);
this.Controls.Add(this.MainPN);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditMonitoredItemDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Monitored Item";
this.BottomPN.ResumeLayout(false);
this.MainPN.ResumeLayout(false);
this.MainPN.PerformLayout();
this.ControlsPN.ResumeLayout(false);
this.ControlsPN.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.DeadbandValueUP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.QueueSizeUP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SamplingIntervalUP)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.Panel MainPN;
private System.Windows.Forms.TableLayoutPanel ControlsPN;
private System.Windows.Forms.Label NodeLB;
private System.Windows.Forms.TextBox IndexRangeTB;
private System.Windows.Forms.ComboBox AttributeCB;
private System.Windows.Forms.Label AttributeLB;
private System.Windows.Forms.Label IndexRangeLB;
private System.Windows.Forms.Label DataEncodingLB;
private System.Windows.Forms.ComboBox DataEncodingCB;
private System.Windows.Forms.TextBox NodeTB;
private SelectNodeCtrl NodeBTN;
private System.Windows.Forms.ComboBox MonitoringModeCB;
private System.Windows.Forms.Label MonitoringModeLB;
private System.Windows.Forms.Label DeadbandTypeLB;
private System.Windows.Forms.Label DiscardOldestLB;
private System.Windows.Forms.Label QueueSizeLB;
private System.Windows.Forms.Label SamplingIntervalLB;
private System.Windows.Forms.NumericUpDown QueueSizeUP;
private System.Windows.Forms.NumericUpDown SamplingIntervalUP;
private System.Windows.Forms.CheckBox DiscardOldestCK;
private System.Windows.Forms.ComboBox TriggerTypeCB;
private System.Windows.Forms.Label TriggerTypeLB;
private System.Windows.Forms.Label DeadbandValueLB;
private System.Windows.Forms.NumericUpDown DeadbandValueUP;
private System.Windows.Forms.ComboBox DeadbandTypeCB;
}
}
@@ -0,0 +1,302 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Prompts the user to edit a value.
/// </summary>
public partial class EditMonitoredItemDlg : Form
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public EditMonitoredItemDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
// add the attributes in numerical order.
foreach (uint attributeId in Attributes.GetIdentifiers())
{
AttributeCB.Items.Add(Attributes.GetBrowseName(attributeId));
}
AttributeCB.SelectedIndex = 0;
MonitoringModeCB.Items.Add(MonitoringMode.Reporting);
MonitoringModeCB.Items.Add(MonitoringMode.Sampling);
MonitoringModeCB.Items.Add(MonitoringMode.Disabled);
MonitoringModeCB.SelectedIndex = 0;
DeadbandTypeCB.Items.Add(DeadbandType.None);
DeadbandTypeCB.Items.Add(DeadbandType.Absolute);
DeadbandTypeCB.Items.Add(DeadbandType.Percent);
DeadbandTypeCB.SelectedIndex = 0;
TriggerTypeCB.Items.Add(DataChangeTrigger.StatusValue);
TriggerTypeCB.Items.Add(DataChangeTrigger.Status);
TriggerTypeCB.Items.Add(DataChangeTrigger.StatusValueTimestamp);
TriggerTypeCB.SelectedIndex = 0;
}
#endregion
#region EncodingInfo Class
/// <summary>
/// Stores information about a data encoding.
/// </summary>
private class EncodingInfo
{
public QualifiedName EncodingName;
public override string ToString()
{
if (EncodingName != null)
{
return EncodingName.ToString();
}
return "Not Set";
}
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Prompts the user to edit the monitored item.
/// </summary>
public bool ShowDialog(Session session, MonitoredItem monitoredItem, bool isEvent)
{
if (!monitoredItem.Created)
{
NodeBTN.Session = session;
NodeBTN.SelectedNode = monitoredItem.StartNodeId;
}
// hide fields not used for events.
NodeLB.Visible = !monitoredItem.Created;
NodeTB.Visible = !monitoredItem.Created;
NodeBTN.Visible = !monitoredItem.Created;
AttributeLB.Visible = !isEvent && !monitoredItem.Created;
AttributeCB.Visible = !isEvent && !monitoredItem.Created;
IndexRangeLB.Visible = !isEvent && !monitoredItem.Created;
IndexRangeTB.Visible = !isEvent && !monitoredItem.Created;
DataEncodingLB.Visible = !isEvent && !monitoredItem.Created;
DataEncodingCB.Visible = !isEvent && !monitoredItem.Created;
MonitoringModeLB.Visible = !monitoredItem.Created;
MonitoringModeCB.Visible = !monitoredItem.Created;
SamplingIntervalLB.Visible = true;
SamplingIntervalUP.Visible = true;
QueueSizeLB.Visible = !isEvent;
QueueSizeUP.Visible = !isEvent;
DiscardOldestLB.Visible = true;
DiscardOldestCK.Visible = true;
DeadbandTypeLB.Visible = !isEvent;
DeadbandTypeCB.Visible = !isEvent;
DeadbandValueLB.Visible = !isEvent;
DeadbandValueUP.Visible = !isEvent;
TriggerTypeLB.Visible = !isEvent;
TriggerTypeCB.Visible = !isEvent;
// fill in values.
SamplingIntervalUP.Value = monitoredItem.SamplingInterval;
DiscardOldestCK.Checked = monitoredItem.DiscardOldest;
if (!isEvent)
{
AttributeCB.SelectedIndex = (int)(monitoredItem.AttributeId - 1);
IndexRangeTB.Text = monitoredItem.IndexRange;
MonitoringModeCB.SelectedItem = monitoredItem.MonitoringMode;
QueueSizeUP.Value = monitoredItem.QueueSize;
DataChangeFilter filter = monitoredItem.Filter as DataChangeFilter;
if (filter != null)
{
DeadbandTypeCB.SelectedItem = (DeadbandType)filter.DeadbandType;
DeadbandValueUP.Value = (decimal)filter.DeadbandValue;
TriggerTypeCB.SelectedItem = filter.Trigger;
}
if (!monitoredItem.Created)
{
// fetch the available encodings for the first node in the list from the server.
IVariableBase variable = session.NodeCache.Find(monitoredItem.StartNodeId) as IVariableBase;
DataEncodingCB.Items.Add(new EncodingInfo());
DataEncodingCB.SelectedIndex = 0;
if (variable != null)
{
if (session.NodeCache.IsTypeOf(variable.DataType, Opc.Ua.DataTypeIds.Structure))
{
foreach (INode encoding in session.NodeCache.Find(variable.DataType, Opc.Ua.ReferenceTypeIds.HasEncoding, false, true))
{
DataEncodingCB.Items.Add(new EncodingInfo() { EncodingName = encoding.BrowseName });
if (monitoredItem.Encoding == encoding.BrowseName)
{
DataEncodingCB.SelectedIndex = DataEncodingCB.Items.Count - 1;
}
}
}
}
}
}
else
{
AttributeCB.SelectedIndex = ((int)Attributes.EventNotifier - 1);
}
if (base.ShowDialog() != DialogResult.OK)
{
return false;
}
// update monitored item.
if (!monitoredItem.Created)
{
monitoredItem.StartNodeId = NodeBTN.SelectedNode;
monitoredItem.DisplayName = session.NodeCache.GetDisplayText(monitoredItem.StartNodeId);
monitoredItem.RelativePath = null;
monitoredItem.AttributeId = (uint)(AttributeCB.SelectedIndex + 1);
monitoredItem.MonitoringMode = (MonitoringMode)MonitoringModeCB.SelectedItem;
}
monitoredItem.SamplingInterval = (int)SamplingIntervalUP.Value;
monitoredItem.DiscardOldest = DiscardOldestCK.Checked;
if (!isEvent)
{
if (!monitoredItem.Created)
{
monitoredItem.IndexRange = IndexRangeTB.Text.Trim();
monitoredItem.Encoding = ((EncodingInfo)DataEncodingCB.SelectedItem).EncodingName;
}
monitoredItem.QueueSize = (uint)QueueSizeUP.Value;
DataChangeTrigger trigger = (DataChangeTrigger)TriggerTypeCB.SelectedItem;
DeadbandType deadbandType = (DeadbandType)DeadbandTypeCB.SelectedItem;
if (monitoredItem.Filter != null || deadbandType != DeadbandType.None || trigger != DataChangeTrigger.StatusValue)
{
DataChangeFilter filter = new DataChangeFilter();
filter.DeadbandType = (uint)deadbandType;
filter.DeadbandValue = (double)DeadbandValueUP.Value;
filter.Trigger = trigger;
monitoredItem.Filter = filter;
}
}
else
{
if (!monitoredItem.Created)
{
monitoredItem.IndexRange = null;
monitoredItem.Encoding = null;
}
monitoredItem.QueueSize = 0;
monitoredItem.Filter = new EventFilter();
}
return true;
}
/// <summary>
/// Prompts the user to specify a monitoring mode.
/// </summary>
public MonitoringMode ShowDialog(MonitoringMode monitoringMode)
{
NodeLB.Visible = false;
NodeTB.Visible = false;
NodeBTN.Visible = false;
AttributeLB.Visible = false;
AttributeCB.Visible = false;
IndexRangeLB.Visible = false;
IndexRangeTB.Visible = false;
DataEncodingLB.Visible = false;
DataEncodingCB.Visible = false;
MonitoringModeLB.Visible = true;
MonitoringModeCB.Visible = true;
SamplingIntervalLB.Visible = false;
SamplingIntervalUP.Visible = false;
QueueSizeLB.Visible = false;
QueueSizeUP.Visible = false;
DiscardOldestLB.Visible = false;
DiscardOldestCK.Visible = false;
DeadbandTypeLB.Visible = false;
DeadbandTypeCB.Visible = false;
DeadbandValueLB.Visible = false;
DeadbandValueUP.Visible = false;
TriggerTypeLB.Visible = false;
TriggerTypeCB.Visible = false;
MonitoringModeCB.SelectedItem = monitoringMode;
if (base.ShowDialog() != DialogResult.OK)
{
return monitoringMode;
}
return (MonitoringMode)MonitoringModeCB.SelectedItem;
}
#endregion
#region Event Handlers
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
if (IndexRangeTB.Visible)
{
NumericRange.Parse(IndexRangeTB.Text);
}
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,293 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EditReadValueIdDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BottomPN = new System.Windows.Forms.Panel();
this.MainPN = new System.Windows.Forms.Panel();
this.ControlsPN = new System.Windows.Forms.TableLayoutPanel();
this.NodeLB = new System.Windows.Forms.Label();
this.IndexRangeTB = new System.Windows.Forms.TextBox();
this.AttributeCB = new System.Windows.Forms.ComboBox();
this.AttributeLB = new System.Windows.Forms.Label();
this.IndexRangeLB = new System.Windows.Forms.Label();
this.DataEncodingLB = new System.Windows.Forms.Label();
this.DataEncodingCB = new System.Windows.Forms.ComboBox();
this.NodeTB = new System.Windows.Forms.TextBox();
this.NodeBTN = new Opc.Ua.Client.Controls.SelectNodeCtrl();
this.BottomPN.SuspendLayout();
this.MainPN.SuspendLayout();
this.ControlsPN.SuspendLayout();
this.SuspendLayout();
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(282, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 0;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.Location = new System.Drawing.Point(3, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 1;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
this.OkBTN.Click += new System.EventHandler(this.OkBTN_Click);
//
// BottomPN
//
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 107);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(360, 30);
this.BottomPN.TabIndex = 0;
//
// MainPN
//
this.MainPN.AutoSize = true;
this.MainPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.MainPN.Controls.Add(this.ControlsPN);
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
this.MainPN.Size = new System.Drawing.Size(360, 107);
this.MainPN.TabIndex = 1;
//
// ControlsPN
//
this.ControlsPN.AutoSize = true;
this.ControlsPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ControlsPN.ColumnCount = 3;
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.Controls.Add(this.NodeLB, 0, 0);
this.ControlsPN.Controls.Add(this.IndexRangeTB, 1, 2);
this.ControlsPN.Controls.Add(this.AttributeCB, 1, 1);
this.ControlsPN.Controls.Add(this.AttributeLB, 0, 1);
this.ControlsPN.Controls.Add(this.IndexRangeLB, 0, 2);
this.ControlsPN.Controls.Add(this.DataEncodingLB, 0, 3);
this.ControlsPN.Controls.Add(this.DataEncodingCB, 1, 3);
this.ControlsPN.Controls.Add(this.NodeTB, 1, 0);
this.ControlsPN.Controls.Add(this.NodeBTN, 2, 0);
this.ControlsPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.ControlsPN.Location = new System.Drawing.Point(0, 0);
this.ControlsPN.Name = "ControlsPN";
this.ControlsPN.RowCount = 4;
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.ControlsPN.Size = new System.Drawing.Size(360, 107);
this.ControlsPN.TabIndex = 1;
//
// NodeLB
//
this.NodeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeLB.AutoSize = true;
this.NodeLB.Location = new System.Drawing.Point(3, 0);
this.NodeLB.Name = "NodeLB";
this.NodeLB.Size = new System.Drawing.Size(33, 26);
this.NodeLB.TabIndex = 19;
this.NodeLB.Text = "Node";
this.NodeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// IndexRangeTB
//
this.IndexRangeTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.IndexRangeTB.Location = new System.Drawing.Point(87, 56);
this.IndexRangeTB.Name = "IndexRangeTB";
this.IndexRangeTB.Size = new System.Drawing.Size(246, 20);
this.IndexRangeTB.TabIndex = 18;
//
// AttributeCB
//
this.AttributeCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.AttributeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.AttributeCB.FormattingEnabled = true;
this.AttributeCB.Location = new System.Drawing.Point(87, 29);
this.AttributeCB.Name = "AttributeCB";
this.AttributeCB.Size = new System.Drawing.Size(138, 21);
this.AttributeCB.TabIndex = 17;
//
// AttributeLB
//
this.AttributeLB.AutoSize = true;
this.AttributeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.AttributeLB.Location = new System.Drawing.Point(3, 26);
this.AttributeLB.Name = "AttributeLB";
this.AttributeLB.Size = new System.Drawing.Size(78, 27);
this.AttributeLB.TabIndex = 16;
this.AttributeLB.Text = "Attribute";
this.AttributeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// IndexRangeLB
//
this.IndexRangeLB.AutoSize = true;
this.IndexRangeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.IndexRangeLB.Location = new System.Drawing.Point(3, 53);
this.IndexRangeLB.Name = "IndexRangeLB";
this.IndexRangeLB.Size = new System.Drawing.Size(78, 26);
this.IndexRangeLB.TabIndex = 3;
this.IndexRangeLB.Text = "Index Range";
this.IndexRangeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DataEncodingLB
//
this.DataEncodingLB.AutoSize = true;
this.DataEncodingLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.DataEncodingLB.Location = new System.Drawing.Point(3, 79);
this.DataEncodingLB.Name = "DataEncodingLB";
this.DataEncodingLB.Size = new System.Drawing.Size(78, 28);
this.DataEncodingLB.TabIndex = 5;
this.DataEncodingLB.Text = "Data Encoding";
this.DataEncodingLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DataEncodingCB
//
this.DataEncodingCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.DataEncodingCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.DataEncodingCB.FormattingEnabled = true;
this.DataEncodingCB.Location = new System.Drawing.Point(87, 82);
this.DataEncodingCB.Name = "DataEncodingCB";
this.DataEncodingCB.Size = new System.Drawing.Size(138, 21);
this.DataEncodingCB.TabIndex = 6;
//
// NodeTB
//
this.NodeTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.NodeTB.Location = new System.Drawing.Point(87, 3);
this.NodeTB.Name = "NodeTB";
this.NodeTB.ReadOnly = true;
this.NodeTB.Size = new System.Drawing.Size(246, 20);
this.NodeTB.TabIndex = 2;
//
// NodeBTN
//
this.NodeBTN.Location = new System.Drawing.Point(336, 0);
this.NodeBTN.Margin = new System.Windows.Forms.Padding(0);
this.NodeBTN.Name = "NodeBTN";
this.NodeBTN.NodeControl = this.NodeTB;
this.NodeBTN.ReferenceTypeIds = null;
this.NodeBTN.RootId = null;
this.NodeBTN.SelectedNode = null;
this.NodeBTN.SelectedReference = null;
this.NodeBTN.Session = null;
this.NodeBTN.Size = new System.Drawing.Size(24, 24);
this.NodeBTN.TabIndex = 15;
this.NodeBTN.View = null;
//
// EditReadValueIdDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.CancelButton = this.CancelBTN;
this.ClientSize = new System.Drawing.Size(360, 137);
this.Controls.Add(this.MainPN);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditReadValueIdDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Read Request";
this.BottomPN.ResumeLayout(false);
this.MainPN.ResumeLayout(false);
this.MainPN.PerformLayout();
this.ControlsPN.ResumeLayout(false);
this.ControlsPN.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.Panel MainPN;
private System.Windows.Forms.TableLayoutPanel ControlsPN;
private System.Windows.Forms.Label NodeLB;
private System.Windows.Forms.TextBox IndexRangeTB;
private System.Windows.Forms.ComboBox AttributeCB;
private System.Windows.Forms.Label AttributeLB;
private System.Windows.Forms.Label IndexRangeLB;
private System.Windows.Forms.Label DataEncodingLB;
private System.Windows.Forms.ComboBox DataEncodingCB;
private System.Windows.Forms.TextBox NodeTB;
private SelectNodeCtrl NodeBTN;
}
}
@@ -0,0 +1,289 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Prompts the user to edit a value.
/// </summary>
public partial class EditReadValueIdDlg : Form
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public EditReadValueIdDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
// add the attributes in numerical order.
foreach (uint attributeId in Attributes.GetIdentifiers())
{
AttributeCB.Items.Add(Attributes.GetBrowseName(attributeId));
}
}
#endregion
#region EncodingInfo Class
/// <summary>
/// Stores information about a data encoding.
/// </summary>
private class EncodingInfo
{
public QualifiedName EncodingName;
public override string ToString()
{
if (EncodingName != null)
{
return EncodingName.ToString();
}
return "Not Set";
}
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Prompts the user to edit the read request parameters for the set of nodes provided.
/// </summary>
public ReadValueId[] ShowDialog(Session session, params ReadValueId[] nodesToRead)
{
NodeBTN.Session = session;
NodeBTN.SelectedReference = null;
bool editNode = true;
bool editAttribute = true;
bool editIndexRange = true;
bool editDataEncoding = true;
// populate the controls.
if (nodesToRead != null && nodesToRead.Length > 0)
{
bool nonValueAttribute = false;
for (int ii = 0; ii < nodesToRead.Length; ii++)
{
if (nodesToRead[ii] == null)
{
continue;
}
// only show the node if all have the same node id.
if (editNode)
{
if (NodeBTN.SelectedNode != null && nodesToRead[ii].NodeId != NodeBTN.SelectedNode)
{
NodeTB.Visible = false;
NodeLB.Visible = false;
NodeBTN.Visible = false;
editNode = false;
}
else
{
NodeBTN.SelectedNode = nodesToRead[ii].NodeId;
}
}
// only show the attribute if all have the same attribute id.
if (editAttribute)
{
// check if any non-value attributes are present.
if (nodesToRead[ii].AttributeId != Attributes.Value)
{
nonValueAttribute = true;
}
int index = (int)nodesToRead[ii].AttributeId - 1;
if (AttributeCB.SelectedIndex != -1 && index != AttributeCB.SelectedIndex)
{
AttributeCB.Visible = false;
AttributeLB.Visible = false;
editAttribute = false;
}
else
{
AttributeCB.SelectedIndex = index;
}
}
}
DataEncodingCB.Items.Clear();
editIndexRange = !nonValueAttribute;
IndexRangeLB.Visible = editIndexRange;
IndexRangeTB.Visible = editIndexRange;
if (!nonValueAttribute)
{
// use the index range for the first node as template.
IndexRangeTB.Text = nodesToRead[0].IndexRange;
// fetch the available encodings for the first node in the list from the server.
IVariableBase variable = session.NodeCache.Find(nodesToRead[0].NodeId) as IVariableBase;
if (variable != null)
{
if (session.NodeCache.IsTypeOf(variable.DataType, Opc.Ua.DataTypeIds.Structure))
{
DataEncodingCB.Items.Add(new EncodingInfo());
DataEncodingCB.SelectedIndex = 0;
foreach (INode encoding in session.NodeCache.Find(variable.DataType, Opc.Ua.ReferenceTypeIds.HasEncoding, false, true))
{
DataEncodingCB.Items.Add(new EncodingInfo() { EncodingName = encoding.BrowseName });
if (nodesToRead[0].DataEncoding == encoding.BrowseName)
{
DataEncodingCB.SelectedIndex = DataEncodingCB.Items.Count - 1;
}
}
}
}
}
// hide the data encodings if none to select.
if (DataEncodingCB.Items.Count == 0)
{
DataEncodingCB.Visible = false;
DataEncodingLB.Visible = false;
editDataEncoding = false;
}
}
if (!editNode && !editAttribute && !editIndexRange && !editDataEncoding)
{
throw new ArgumentException("nodesToRead", "It is not possible to edit the current selection as a group.");
}
if (base.ShowDialog() != DialogResult.OK)
{
return null;
}
// create the list of results.
ReadValueId[] results = null;
if (nodesToRead == null || nodesToRead.Length == 0)
{
results = new ReadValueId[1];
}
else
{
results = new ReadValueId[nodesToRead.Length];
}
// copy the controls into the results.
for (int ii = 0; ii < results.Length; ii++)
{
// preserve the existing settings if they are not being changed.
if (nodesToRead != null && nodesToRead.Length > 0)
{
results[ii] = (ReadValueId)nodesToRead[ii].MemberwiseClone();
}
else
{
results[ii] = new ReadValueId();
}
// only copy results that were actually being edited.
if (editNode)
{
results[ii].NodeId = NodeBTN.SelectedNode;
}
if (editAttribute)
{
results[ii].AttributeId = (uint)(AttributeCB.SelectedIndex + 1);
}
if (editIndexRange)
{
results[ii].ParsedIndexRange = NumericRange.Parse(IndexRangeTB.Text);
if (NumericRange.Empty != results[ii].ParsedIndexRange)
{
results[ii].IndexRange = results[ii].ParsedIndexRange.ToString();
}
else
{
results[ii].IndexRange = String.Empty;
}
}
if (editDataEncoding)
{
results[ii].DataEncoding = null;
EncodingInfo encoding = DataEncodingCB.SelectedItem as EncodingInfo;
if (encoding != null)
{
results[ii].DataEncoding = encoding.EncodingName;
}
}
}
return results;
}
#endregion
#region Event Handlers
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
if (IndexRangeTB.Visible)
{
NumericRange.Parse(IndexRangeTB.Text);
}
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,357 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EditSubscriptionDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BottomPN = new System.Windows.Forms.Panel();
this.MainPN = new System.Windows.Forms.Panel();
this.ControlsPN = new System.Windows.Forms.TableLayoutPanel();
this.PriorityTB = new System.Windows.Forms.NumericUpDown();
this.PriorityLB = new System.Windows.Forms.Label();
this.MaxNotificationsPerPublishUP = new System.Windows.Forms.NumericUpDown();
this.MaxNotificationsPerPublishLB = new System.Windows.Forms.Label();
this.LifetimeCountLB = new System.Windows.Forms.Label();
this.LifetimeCountUP = new System.Windows.Forms.NumericUpDown();
this.PublishingEnabledLB = new System.Windows.Forms.Label();
this.KeepAliveCountLB = new System.Windows.Forms.Label();
this.PublishingIntervalLB = new System.Windows.Forms.Label();
this.PublishingIntervalUP = new System.Windows.Forms.NumericUpDown();
this.PublishingEnabledCK = new System.Windows.Forms.CheckBox();
this.KeepAliveCountUP = new System.Windows.Forms.NumericUpDown();
this.BottomPN.SuspendLayout();
this.MainPN.SuspendLayout();
this.ControlsPN.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PriorityTB)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MaxNotificationsPerPublishUP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.LifetimeCountUP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PublishingIntervalUP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.KeepAliveCountUP)).BeginInit();
this.SuspendLayout();
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(170, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 0;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.Location = new System.Drawing.Point(3, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 1;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
this.OkBTN.Click += new System.EventHandler(this.OkBTN_Click);
//
// BottomPN
//
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 149);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(248, 30);
this.BottomPN.TabIndex = 0;
//
// MainPN
//
this.MainPN.AutoSize = true;
this.MainPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.MainPN.Controls.Add(this.ControlsPN);
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
this.MainPN.Size = new System.Drawing.Size(248, 149);
this.MainPN.TabIndex = 1;
//
// ControlsPN
//
this.ControlsPN.AutoSize = true;
this.ControlsPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ControlsPN.ColumnCount = 3;
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.Controls.Add(this.PriorityTB, 1, 4);
this.ControlsPN.Controls.Add(this.PriorityLB, 0, 4);
this.ControlsPN.Controls.Add(this.MaxNotificationsPerPublishUP, 1, 3);
this.ControlsPN.Controls.Add(this.MaxNotificationsPerPublishLB, 0, 3);
this.ControlsPN.Controls.Add(this.LifetimeCountLB, 0, 2);
this.ControlsPN.Controls.Add(this.LifetimeCountUP, 1, 2);
this.ControlsPN.Controls.Add(this.PublishingEnabledLB, 0, 5);
this.ControlsPN.Controls.Add(this.KeepAliveCountLB, 0, 1);
this.ControlsPN.Controls.Add(this.PublishingIntervalLB, 0, 0);
this.ControlsPN.Controls.Add(this.PublishingIntervalUP, 1, 0);
this.ControlsPN.Controls.Add(this.PublishingEnabledCK, 1, 5);
this.ControlsPN.Controls.Add(this.KeepAliveCountUP, 1, 1);
this.ControlsPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.ControlsPN.Location = new System.Drawing.Point(0, 0);
this.ControlsPN.Name = "ControlsPN";
this.ControlsPN.RowCount = 7;
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.Size = new System.Drawing.Size(248, 149);
this.ControlsPN.TabIndex = 0;
//
// PriorityTB
//
this.PriorityTB.Location = new System.Drawing.Point(106, 107);
this.PriorityTB.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.PriorityTB.Name = "PriorityTB";
this.PriorityTB.Size = new System.Drawing.Size(138, 20);
this.PriorityTB.TabIndex = 9;
//
// PriorityLB
//
this.PriorityLB.AutoSize = true;
this.PriorityLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.PriorityLB.Location = new System.Drawing.Point(3, 104);
this.PriorityLB.Name = "PriorityLB";
this.PriorityLB.Size = new System.Drawing.Size(97, 26);
this.PriorityLB.TabIndex = 8;
this.PriorityLB.Text = "Priority";
this.PriorityLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// MaxNotificationsPerPublishUP
//
this.MaxNotificationsPerPublishUP.Location = new System.Drawing.Point(106, 81);
this.MaxNotificationsPerPublishUP.Maximum = new decimal(new int[] {
0,
1,
0,
0});
this.MaxNotificationsPerPublishUP.Name = "MaxNotificationsPerPublishUP";
this.MaxNotificationsPerPublishUP.Size = new System.Drawing.Size(138, 20);
this.MaxNotificationsPerPublishUP.TabIndex = 7;
//
// MaxNotificationsPerPublishLB
//
this.MaxNotificationsPerPublishLB.AutoSize = true;
this.MaxNotificationsPerPublishLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.MaxNotificationsPerPublishLB.Location = new System.Drawing.Point(3, 78);
this.MaxNotificationsPerPublishLB.Name = "MaxNotificationsPerPublishLB";
this.MaxNotificationsPerPublishLB.Size = new System.Drawing.Size(97, 26);
this.MaxNotificationsPerPublishLB.TabIndex = 6;
this.MaxNotificationsPerPublishLB.Text = "Max Notifications";
this.MaxNotificationsPerPublishLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// LifetimeCountLB
//
this.LifetimeCountLB.AutoSize = true;
this.LifetimeCountLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.LifetimeCountLB.Location = new System.Drawing.Point(3, 52);
this.LifetimeCountLB.Name = "LifetimeCountLB";
this.LifetimeCountLB.Size = new System.Drawing.Size(97, 26);
this.LifetimeCountLB.TabIndex = 4;
this.LifetimeCountLB.Text = "Lifetime Count";
this.LifetimeCountLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// LifetimeCountUP
//
this.LifetimeCountUP.Location = new System.Drawing.Point(106, 55);
this.LifetimeCountUP.Maximum = new decimal(new int[] {
0,
1,
0,
0});
this.LifetimeCountUP.Name = "LifetimeCountUP";
this.LifetimeCountUP.Size = new System.Drawing.Size(138, 20);
this.LifetimeCountUP.TabIndex = 5;
//
// PublishingEnabledLB
//
this.PublishingEnabledLB.AutoSize = true;
this.PublishingEnabledLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.PublishingEnabledLB.Location = new System.Drawing.Point(3, 130);
this.PublishingEnabledLB.Name = "PublishingEnabledLB";
this.PublishingEnabledLB.Size = new System.Drawing.Size(97, 20);
this.PublishingEnabledLB.TabIndex = 10;
this.PublishingEnabledLB.Text = "Publishing Enabled";
this.PublishingEnabledLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// KeepAliveCountLB
//
this.KeepAliveCountLB.AutoSize = true;
this.KeepAliveCountLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.KeepAliveCountLB.Location = new System.Drawing.Point(3, 26);
this.KeepAliveCountLB.Name = "KeepAliveCountLB";
this.KeepAliveCountLB.Size = new System.Drawing.Size(97, 26);
this.KeepAliveCountLB.TabIndex = 2;
this.KeepAliveCountLB.Text = "Keep Alive Count";
this.KeepAliveCountLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// PublishingIntervalLB
//
this.PublishingIntervalLB.AutoSize = true;
this.PublishingIntervalLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.PublishingIntervalLB.Location = new System.Drawing.Point(3, 0);
this.PublishingIntervalLB.Name = "PublishingIntervalLB";
this.PublishingIntervalLB.Size = new System.Drawing.Size(97, 26);
this.PublishingIntervalLB.TabIndex = 0;
this.PublishingIntervalLB.Text = "Publishing Interval";
this.PublishingIntervalLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// PublishingIntervalUP
//
this.PublishingIntervalUP.Increment = new decimal(new int[] {
1000,
0,
0,
0});
this.PublishingIntervalUP.Location = new System.Drawing.Point(106, 3);
this.PublishingIntervalUP.Maximum = new decimal(new int[] {
0,
1,
0,
0});
this.PublishingIntervalUP.Name = "PublishingIntervalUP";
this.PublishingIntervalUP.Size = new System.Drawing.Size(138, 20);
this.PublishingIntervalUP.TabIndex = 1;
//
// PublishingEnabledCK
//
this.PublishingEnabledCK.AutoSize = true;
this.PublishingEnabledCK.Checked = true;
this.PublishingEnabledCK.CheckState = System.Windows.Forms.CheckState.Checked;
this.PublishingEnabledCK.Location = new System.Drawing.Point(106, 133);
this.PublishingEnabledCK.Name = "PublishingEnabledCK";
this.PublishingEnabledCK.Size = new System.Drawing.Size(15, 14);
this.PublishingEnabledCK.TabIndex = 11;
this.PublishingEnabledCK.UseVisualStyleBackColor = true;
//
// KeepAliveCountUP
//
this.KeepAliveCountUP.Location = new System.Drawing.Point(106, 29);
this.KeepAliveCountUP.Maximum = new decimal(new int[] {
0,
1,
0,
0});
this.KeepAliveCountUP.Name = "KeepAliveCountUP";
this.KeepAliveCountUP.Size = new System.Drawing.Size(138, 20);
this.KeepAliveCountUP.TabIndex = 3;
//
// EditSubscriptionDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.CancelButton = this.CancelBTN;
this.ClientSize = new System.Drawing.Size(248, 179);
this.Controls.Add(this.MainPN);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditSubscriptionDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Subscription";
this.BottomPN.ResumeLayout(false);
this.MainPN.ResumeLayout(false);
this.MainPN.PerformLayout();
this.ControlsPN.ResumeLayout(false);
this.ControlsPN.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.PriorityTB)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MaxNotificationsPerPublishUP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.LifetimeCountUP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PublishingIntervalUP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.KeepAliveCountUP)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.Panel MainPN;
private System.Windows.Forms.TableLayoutPanel ControlsPN;
private System.Windows.Forms.Label PublishingEnabledLB;
private System.Windows.Forms.Label KeepAliveCountLB;
private System.Windows.Forms.Label PublishingIntervalLB;
private System.Windows.Forms.NumericUpDown KeepAliveCountUP;
private System.Windows.Forms.NumericUpDown PublishingIntervalUP;
private System.Windows.Forms.CheckBox PublishingEnabledCK;
private System.Windows.Forms.Label LifetimeCountLB;
private System.Windows.Forms.NumericUpDown LifetimeCountUP;
private System.Windows.Forms.NumericUpDown MaxNotificationsPerPublishUP;
private System.Windows.Forms.Label MaxNotificationsPerPublishLB;
private System.Windows.Forms.NumericUpDown PriorityTB;
private System.Windows.Forms.Label PriorityLB;
}
}
@@ -0,0 +1,101 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Prompts the user to edit a value.
/// </summary>
public partial class EditSubscriptionDlg : Form
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public EditSubscriptionDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Prompts the user to edit the monitored item.
/// </summary>
public bool ShowDialog(Subscription subscription)
{
PublishingIntervalUP.Value = subscription.PublishingInterval;
KeepAliveCountUP.Value = subscription.KeepAliveCount;
LifetimeCountUP.Value = subscription.LifetimeCount;
MaxNotificationsPerPublishUP.Value = subscription.MaxNotificationsPerPublish;
PriorityTB.Value = subscription.Priority;
PublishingEnabledCK.Checked = subscription.PublishingEnabled;
if (base.ShowDialog() != DialogResult.OK)
{
return false;
}
subscription.PublishingInterval = (int)PublishingIntervalUP.Value;
subscription.KeepAliveCount = (uint)KeepAliveCountUP.Value;
subscription.LifetimeCount = (uint)LifetimeCountUP.Value;
subscription.MaxNotificationsPerPublish = (uint)MaxNotificationsPerPublishUP.Value;
subscription.Priority = (byte)PriorityTB.Value;
subscription.PublishingEnabled = PublishingEnabledCK.Checked;
return true;
}
#endregion
#region Event Handlers
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,89 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EditValue2Ctrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.BrowseBTN = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// BrowseBTN
//
this.BrowseBTN.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseBTN.Location = new System.Drawing.Point(0, 0);
this.BrowseBTN.Name = "BrowseBTN";
this.BrowseBTN.Size = new System.Drawing.Size(24, 24);
this.BrowseBTN.TabIndex = 0;
this.BrowseBTN.Text = "...";
this.BrowseBTN.UseVisualStyleBackColor = true;
this.BrowseBTN.Click += new System.EventHandler(this.BrowseBTN_Click);
//
// SelectFileCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.BrowseBTN);
this.Name = "SelectFileCtrl";
this.Size = new System.Drawing.Size(24, 24);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button BrowseBTN;
}
}
@@ -0,0 +1,127 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// A control with button that displays edit array dialog.
/// </summary>
public partial class EditValue2Ctrl : UserControl
{
#region Constructors
/// <summary>
/// Creates a new instance of the control.
/// </summary>
public EditValue2Ctrl()
{
InitializeComponent();
}
#endregion
#region Private Fields
private event EventHandler m_ValueChanged;
private Variant m_value;
#endregion
#region Public Interface
/// <summary>
/// The value in the control.
/// </summary>
public Variant Value
{
get
{
return m_value;
}
set
{
if (CurrentValueControl != null)
{
CurrentValueControl.Text = value.ToString();
}
m_value = value;
}
}
/// <summary>
/// Gets or sets the control that shows the current value.
/// </summary>
public Control CurrentValueControl { get; set; }
/// <summary>
/// Raised when the value is changed.
/// </summary>
public event EventHandler ValueChanged
{
add { m_ValueChanged += value; }
remove { m_ValueChanged -= value; }
}
#endregion
#region Event Handlers
private void BrowseBTN_Click(object sender, EventArgs e)
{
if (CurrentValueControl == null)
{
return;
}
object value = new EditComplexValueDlg().ShowDialog(
m_value.TypeInfo,
null,
m_value.Value,
"Edit Value");
if (value == null)
{
return;
}
Value = new Variant(value);
if (m_ValueChanged != null)
{
m_ValueChanged(this, e);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,426 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EditWriteValueDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BottomPN = new System.Windows.Forms.Panel();
this.MainPN = new System.Windows.Forms.Panel();
this.ControlsPN = new System.Windows.Forms.TableLayoutPanel();
this.SourceTimestampCK = new System.Windows.Forms.CheckBox();
this.ServerTimestampCK = new System.Windows.Forms.CheckBox();
this.ServerTimestampLB = new System.Windows.Forms.Label();
this.ServerTimestampTB = new System.Windows.Forms.TextBox();
this.SourceTimestampTB = new System.Windows.Forms.TextBox();
this.SourceTimestampLB = new System.Windows.Forms.Label();
this.StatusCodeTB = new System.Windows.Forms.TextBox();
this.StatusCodeLB = new System.Windows.Forms.Label();
this.ValueTB = new System.Windows.Forms.TextBox();
this.NodeLB = new System.Windows.Forms.Label();
this.IndexRangeTB = new System.Windows.Forms.TextBox();
this.AttributeCB = new System.Windows.Forms.ComboBox();
this.AttributeLB = new System.Windows.Forms.Label();
this.IndexRangeLB = new System.Windows.Forms.Label();
this.ValueLB = new System.Windows.Forms.Label();
this.NodeTB = new System.Windows.Forms.TextBox();
this.NodeBTN = new Opc.Ua.Client.Controls.SelectNodeCtrl();
this.ValueBTN = new Opc.Ua.Client.Controls.EditValue2Ctrl();
this.StatusCodeCK = new System.Windows.Forms.CheckBox();
this.BottomPN.SuspendLayout();
this.MainPN.SuspendLayout();
this.ControlsPN.SuspendLayout();
this.SuspendLayout();
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(282, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 0;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.Location = new System.Drawing.Point(3, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 1;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
this.OkBTN.Click += new System.EventHandler(this.OkBTN_Click);
//
// BottomPN
//
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 189);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(360, 30);
this.BottomPN.TabIndex = 0;
//
// MainPN
//
this.MainPN.AutoSize = true;
this.MainPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.MainPN.Controls.Add(this.ControlsPN);
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
this.MainPN.Size = new System.Drawing.Size(360, 189);
this.MainPN.TabIndex = 1;
//
// ControlsPN
//
this.ControlsPN.AutoSize = true;
this.ControlsPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ControlsPN.ColumnCount = 3;
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.Controls.Add(this.SourceTimestampCK, 2, 5);
this.ControlsPN.Controls.Add(this.ServerTimestampCK, 2, 6);
this.ControlsPN.Controls.Add(this.ServerTimestampLB, 0, 6);
this.ControlsPN.Controls.Add(this.ServerTimestampTB, 1, 6);
this.ControlsPN.Controls.Add(this.SourceTimestampTB, 1, 5);
this.ControlsPN.Controls.Add(this.SourceTimestampLB, 0, 5);
this.ControlsPN.Controls.Add(this.StatusCodeTB, 1, 4);
this.ControlsPN.Controls.Add(this.StatusCodeLB, 0, 4);
this.ControlsPN.Controls.Add(this.ValueTB, 1, 3);
this.ControlsPN.Controls.Add(this.NodeLB, 0, 0);
this.ControlsPN.Controls.Add(this.IndexRangeTB, 1, 2);
this.ControlsPN.Controls.Add(this.AttributeCB, 1, 1);
this.ControlsPN.Controls.Add(this.AttributeLB, 0, 1);
this.ControlsPN.Controls.Add(this.IndexRangeLB, 0, 2);
this.ControlsPN.Controls.Add(this.ValueLB, 0, 3);
this.ControlsPN.Controls.Add(this.NodeTB, 1, 0);
this.ControlsPN.Controls.Add(this.NodeBTN, 2, 0);
this.ControlsPN.Controls.Add(this.ValueBTN, 2, 3);
this.ControlsPN.Controls.Add(this.StatusCodeCK, 2, 4);
this.ControlsPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.ControlsPN.Location = new System.Drawing.Point(0, 0);
this.ControlsPN.Name = "ControlsPN";
this.ControlsPN.RowCount = 8;
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.Size = new System.Drawing.Size(360, 189);
this.ControlsPN.TabIndex = 1;
//
// SourceTimestampCK
//
this.SourceTimestampCK.AutoSize = true;
this.SourceTimestampCK.Location = new System.Drawing.Point(341, 138);
this.SourceTimestampCK.Margin = new System.Windows.Forms.Padding(5, 7, 3, 3);
this.SourceTimestampCK.Name = "SourceTimestampCK";
this.SourceTimestampCK.Size = new System.Drawing.Size(15, 14);
this.SourceTimestampCK.TabIndex = 30;
this.SourceTimestampCK.UseVisualStyleBackColor = true;
this.SourceTimestampCK.CheckedChanged += new System.EventHandler(this.SourceTimestampCK_CheckedChanged);
//
// ServerTimestampCK
//
this.ServerTimestampCK.AutoSize = true;
this.ServerTimestampCK.Location = new System.Drawing.Point(341, 164);
this.ServerTimestampCK.Margin = new System.Windows.Forms.Padding(5, 7, 3, 3);
this.ServerTimestampCK.Name = "ServerTimestampCK";
this.ServerTimestampCK.Size = new System.Drawing.Size(15, 14);
this.ServerTimestampCK.TabIndex = 29;
this.ServerTimestampCK.UseVisualStyleBackColor = true;
this.ServerTimestampCK.CheckedChanged += new System.EventHandler(this.ServerTimestampCK_CheckedChanged);
//
// ServerTimestampLB
//
this.ServerTimestampLB.AutoSize = true;
this.ServerTimestampLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ServerTimestampLB.Location = new System.Drawing.Point(3, 157);
this.ServerTimestampLB.Name = "ServerTimestampLB";
this.ServerTimestampLB.Size = new System.Drawing.Size(95, 26);
this.ServerTimestampLB.TabIndex = 27;
this.ServerTimestampLB.Text = "Server Timestamp";
this.ServerTimestampLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ServerTimestampTB
//
this.ServerTimestampTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ServerTimestampTB.Enabled = false;
this.ServerTimestampTB.Location = new System.Drawing.Point(104, 160);
this.ServerTimestampTB.Name = "ServerTimestampTB";
this.ServerTimestampTB.Size = new System.Drawing.Size(229, 20);
this.ServerTimestampTB.TabIndex = 26;
//
// SourceTimestampTB
//
this.SourceTimestampTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.SourceTimestampTB.Enabled = false;
this.SourceTimestampTB.Location = new System.Drawing.Point(104, 134);
this.SourceTimestampTB.Name = "SourceTimestampTB";
this.SourceTimestampTB.Size = new System.Drawing.Size(229, 20);
this.SourceTimestampTB.TabIndex = 25;
//
// SourceTimestampLB
//
this.SourceTimestampLB.AutoSize = true;
this.SourceTimestampLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.SourceTimestampLB.Location = new System.Drawing.Point(3, 131);
this.SourceTimestampLB.Name = "SourceTimestampLB";
this.SourceTimestampLB.Size = new System.Drawing.Size(95, 26);
this.SourceTimestampLB.TabIndex = 24;
this.SourceTimestampLB.Text = "Source Timestamp";
this.SourceTimestampLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// StatusCodeTB
//
this.StatusCodeTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.StatusCodeTB.Enabled = false;
this.StatusCodeTB.Location = new System.Drawing.Point(104, 108);
this.StatusCodeTB.Name = "StatusCodeTB";
this.StatusCodeTB.Size = new System.Drawing.Size(229, 20);
this.StatusCodeTB.TabIndex = 23;
//
// StatusCodeLB
//
this.StatusCodeLB.AutoSize = true;
this.StatusCodeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.StatusCodeLB.Location = new System.Drawing.Point(3, 105);
this.StatusCodeLB.Name = "StatusCodeLB";
this.StatusCodeLB.Size = new System.Drawing.Size(95, 26);
this.StatusCodeLB.TabIndex = 22;
this.StatusCodeLB.Text = "Status Code";
this.StatusCodeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ValueTB
//
this.ValueTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ValueTB.Location = new System.Drawing.Point(104, 82);
this.ValueTB.Name = "ValueTB";
this.ValueTB.ReadOnly = true;
this.ValueTB.Size = new System.Drawing.Size(229, 20);
this.ValueTB.TabIndex = 20;
//
// NodeLB
//
this.NodeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeLB.AutoSize = true;
this.NodeLB.Location = new System.Drawing.Point(3, 0);
this.NodeLB.Name = "NodeLB";
this.NodeLB.Size = new System.Drawing.Size(33, 26);
this.NodeLB.TabIndex = 19;
this.NodeLB.Text = "Node";
this.NodeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// IndexRangeTB
//
this.IndexRangeTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.IndexRangeTB.Location = new System.Drawing.Point(104, 56);
this.IndexRangeTB.Name = "IndexRangeTB";
this.IndexRangeTB.Size = new System.Drawing.Size(229, 20);
this.IndexRangeTB.TabIndex = 18;
//
// AttributeCB
//
this.AttributeCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.AttributeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.AttributeCB.FormattingEnabled = true;
this.AttributeCB.Location = new System.Drawing.Point(104, 29);
this.AttributeCB.Name = "AttributeCB";
this.AttributeCB.Size = new System.Drawing.Size(147, 21);
this.AttributeCB.TabIndex = 17;
//
// AttributeLB
//
this.AttributeLB.AutoSize = true;
this.AttributeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.AttributeLB.Location = new System.Drawing.Point(3, 26);
this.AttributeLB.Name = "AttributeLB";
this.AttributeLB.Size = new System.Drawing.Size(95, 27);
this.AttributeLB.TabIndex = 16;
this.AttributeLB.Text = "Attribute";
this.AttributeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// IndexRangeLB
//
this.IndexRangeLB.AutoSize = true;
this.IndexRangeLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.IndexRangeLB.Location = new System.Drawing.Point(3, 53);
this.IndexRangeLB.Name = "IndexRangeLB";
this.IndexRangeLB.Size = new System.Drawing.Size(95, 26);
this.IndexRangeLB.TabIndex = 3;
this.IndexRangeLB.Text = "Index Range";
this.IndexRangeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ValueLB
//
this.ValueLB.AutoSize = true;
this.ValueLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ValueLB.Location = new System.Drawing.Point(3, 79);
this.ValueLB.Name = "ValueLB";
this.ValueLB.Size = new System.Drawing.Size(95, 26);
this.ValueLB.TabIndex = 5;
this.ValueLB.Text = "Value";
this.ValueLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// NodeTB
//
this.NodeTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.NodeTB.Location = new System.Drawing.Point(104, 3);
this.NodeTB.Name = "NodeTB";
this.NodeTB.ReadOnly = true;
this.NodeTB.Size = new System.Drawing.Size(229, 20);
this.NodeTB.TabIndex = 2;
//
// NodeBTN
//
this.NodeBTN.Location = new System.Drawing.Point(336, 0);
this.NodeBTN.Margin = new System.Windows.Forms.Padding(0);
this.NodeBTN.Name = "NodeBTN";
this.NodeBTN.NodeControl = this.NodeTB;
this.NodeBTN.ReferenceTypeIds = null;
this.NodeBTN.RootId = null;
this.NodeBTN.SelectedNode = null;
this.NodeBTN.SelectedReference = null;
this.NodeBTN.Session = null;
this.NodeBTN.Size = new System.Drawing.Size(24, 24);
this.NodeBTN.TabIndex = 15;
this.NodeBTN.View = null;
//
// ValueBTN
//
this.ValueBTN.CurrentValueControl = this.ValueTB;
this.ValueBTN.Location = new System.Drawing.Point(336, 79);
this.ValueBTN.Margin = new System.Windows.Forms.Padding(0);
this.ValueBTN.Name = "ValueBTN";
this.ValueBTN.Size = new System.Drawing.Size(24, 24);
this.ValueBTN.TabIndex = 21;
//
// StatusCodeCK
//
this.StatusCodeCK.AutoSize = true;
this.StatusCodeCK.Location = new System.Drawing.Point(341, 112);
this.StatusCodeCK.Margin = new System.Windows.Forms.Padding(5, 7, 3, 3);
this.StatusCodeCK.Name = "StatusCodeCK";
this.StatusCodeCK.Size = new System.Drawing.Size(15, 14);
this.StatusCodeCK.TabIndex = 28;
this.StatusCodeCK.UseVisualStyleBackColor = true;
this.StatusCodeCK.CheckedChanged += new System.EventHandler(this.StatusCodeCK_CheckedChanged);
//
// EditWriteValueDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.CancelButton = this.CancelBTN;
this.ClientSize = new System.Drawing.Size(360, 219);
this.Controls.Add(this.MainPN);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditWriteValueDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Write Request";
this.BottomPN.ResumeLayout(false);
this.MainPN.ResumeLayout(false);
this.MainPN.PerformLayout();
this.ControlsPN.ResumeLayout(false);
this.ControlsPN.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.Panel MainPN;
private System.Windows.Forms.TableLayoutPanel ControlsPN;
private System.Windows.Forms.Label NodeLB;
private System.Windows.Forms.TextBox IndexRangeTB;
private System.Windows.Forms.ComboBox AttributeCB;
private System.Windows.Forms.Label AttributeLB;
private System.Windows.Forms.Label IndexRangeLB;
private System.Windows.Forms.Label ValueLB;
private System.Windows.Forms.TextBox NodeTB;
private SelectNodeCtrl NodeBTN;
private System.Windows.Forms.TextBox ValueTB;
private EditValue2Ctrl ValueBTN;
private System.Windows.Forms.TextBox StatusCodeTB;
private System.Windows.Forms.Label StatusCodeLB;
private System.Windows.Forms.Label ServerTimestampLB;
private System.Windows.Forms.TextBox ServerTimestampTB;
private System.Windows.Forms.TextBox SourceTimestampTB;
private System.Windows.Forms.Label SourceTimestampLB;
private System.Windows.Forms.CheckBox SourceTimestampCK;
private System.Windows.Forms.CheckBox ServerTimestampCK;
private System.Windows.Forms.CheckBox StatusCodeCK;
}
}
@@ -0,0 +1,205 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Prompts the user to edit a value.
/// </summary>
public partial class EditWriteValueDlg : Form
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public EditWriteValueDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
// add the attributes in numerical order.
foreach (uint attributeId in Attributes.GetIdentifiers())
{
AttributeCB.Items.Add(Attributes.GetBrowseName(attributeId));
}
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Prompts the user to edit the write request parameters for the set of nodes provided.
/// </summary>
public WriteValue ShowDialog(Session session, WriteValue nodeToWrite)
{
NodeBTN.Session = session;
NodeBTN.SelectedReference = null;
// fill in the control.
NodeBTN.SelectedNode = nodeToWrite.NodeId;
AttributeCB.SelectedIndex = (int)nodeToWrite.AttributeId - 1;
IndexRangeTB.Text = nodeToWrite.IndexRange;
ValueBTN.Value = nodeToWrite.Value.WrappedValue;
if (nodeToWrite.Value.StatusCode != StatusCodes.Good)
{
StatusCodeTB.Text = (string)TypeInfo.Cast(nodeToWrite.Value.StatusCode, BuiltInType.String);
StatusCodeCK.Checked = true;
}
if (nodeToWrite.Value.SourceTimestamp != DateTime.MinValue)
{
SourceTimestampTB.Text = (string)TypeInfo.Cast(nodeToWrite.Value.SourceTimestamp, BuiltInType.String);
SourceTimestampCK.Checked = true;
}
if (nodeToWrite.Value.ServerTimestamp != DateTime.MinValue)
{
ServerTimestampTB.Text = (string)TypeInfo.Cast(nodeToWrite.Value.ServerTimestamp, BuiltInType.String);
ServerTimestampCK.Checked = true;
}
if (base.ShowDialog() != DialogResult.OK)
{
return null;
}
// create the result.
WriteValue result = new WriteValue();
result.NodeId = NodeBTN.SelectedNode;
result.AttributeId = (uint)(AttributeCB.SelectedIndex + 1);
result.ParsedIndexRange = NumericRange.Parse(IndexRangeTB.Text);
result.Value.WrappedValue = ValueBTN.Value;
if (StatusCodeCK.Checked)
{
result.Value.StatusCode = (StatusCode)TypeInfo.Cast(StatusCodeTB.Text, BuiltInType.StatusCode);
}
if (SourceTimestampCK.Checked)
{
result.Value.SourceTimestamp = (DateTime)TypeInfo.Cast(SourceTimestampTB.Text, BuiltInType.DateTime);
}
if (ServerTimestampCK.Checked)
{
result.Value.ServerTimestamp = (DateTime)TypeInfo.Cast(ServerTimestampTB.Text, BuiltInType.DateTime);
}
if (NumericRange.Empty != result.ParsedIndexRange)
{
result.IndexRange = result.ParsedIndexRange.ToString();
}
else
{
result.IndexRange = String.Empty;
}
return result;
}
#endregion
#region Event Handlers
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
IndexRangeTB.Text = IndexRangeTB.Text.Trim();
if (String.IsNullOrEmpty(IndexRangeTB.Text))
{
NumericRange.Parse(IndexRangeTB.Text);
}
StatusCodeTB.Text = StatusCodeTB.Text.Trim();
if (StatusCodeCK.Checked)
{
TypeInfo.Cast(StatusCodeTB.Text, BuiltInType.StatusCode);
}
SourceTimestampTB.Text = SourceTimestampTB.Text.Trim();
if (SourceTimestampCK.Checked)
{
TypeInfo.Cast(SourceTimestampTB.Text, BuiltInType.DateTime);
}
ServerTimestampTB.Text = ServerTimestampTB.Text.Trim();
if (ServerTimestampCK.Checked)
{
TypeInfo.Cast(ServerTimestampTB.Text, BuiltInType.DateTime);
}
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void StatusCodeCK_CheckedChanged(object sender, EventArgs e)
{
StatusCodeTB.Enabled = StatusCodeCK.Checked;
}
private void SourceTimestampCK_CheckedChanged(object sender, EventArgs e)
{
SourceTimestampTB.Enabled = SourceTimestampCK.Checked;
if (SourceTimestampTB.Enabled && String.IsNullOrEmpty(SourceTimestampTB.Text))
{
SourceTimestampTB.Text = (string)TypeInfo.Cast(DateTime.UtcNow, BuiltInType.String);
}
}
private void ServerTimestampCK_CheckedChanged(object sender, EventArgs e)
{
ServerTimestampTB.Enabled = ServerTimestampCK.Checked;
if (ServerTimestampTB.Enabled && String.IsNullOrEmpty(ServerTimestampTB.Text))
{
ServerTimestampTB.Text = (string)TypeInfo.Cast(DateTime.UtcNow, BuiltInType.String);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,272 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EventFilterListViewCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.PopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.MoveUpMI = new System.Windows.Forms.ToolStripMenuItem();
this.MoveDownMI = new System.Windows.Forms.ToolStripMenuItem();
this.DeleteMI = new System.Windows.Forms.ToolStripMenuItem();
this.FilterDV = new System.Windows.Forms.DataGridView();
this.RightPN = new System.Windows.Forms.Panel();
this.ImageList = new System.Windows.Forms.ImageList(this.components);
this.BrowseCTRL = new Opc.Ua.Client.Controls.BrowseNodeCtrl();
this.Icon = new System.Windows.Forms.DataGridViewImageColumn();
this.BrowsePathCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SelectFieldCH = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.DisplayInListCH = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.FilterEnabledCH = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.FilterOperatorCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FilterValueCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.PopupMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.FilterDV)).BeginInit();
this.RightPN.SuspendLayout();
this.SuspendLayout();
//
// PopupMenu
//
this.PopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MoveUpMI,
this.MoveDownMI,
this.DeleteMI});
this.PopupMenu.Name = "PopupMenu";
this.PopupMenu.Size = new System.Drawing.Size(139, 70);
//
// MoveUpMI
//
this.MoveUpMI.Name = "MoveUpMI";
this.MoveUpMI.Size = new System.Drawing.Size(138, 22);
this.MoveUpMI.Text = "Move Up";
this.MoveUpMI.Click += new System.EventHandler(this.MoveUpMI_Click);
//
// MoveDownMI
//
this.MoveDownMI.Name = "MoveDownMI";
this.MoveDownMI.Size = new System.Drawing.Size(138, 22);
this.MoveDownMI.Text = "Move Down";
//
// DeleteMI
//
this.DeleteMI.Name = "DeleteMI";
this.DeleteMI.Size = new System.Drawing.Size(138, 22);
this.DeleteMI.Text = "Delete";
//
// FilterDV
//
this.FilterDV.AllowUserToAddRows = false;
this.FilterDV.AllowUserToDeleteRows = false;
this.FilterDV.AllowUserToResizeRows = false;
this.FilterDV.BackgroundColor = System.Drawing.SystemColors.Window;
this.FilterDV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.FilterDV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Icon,
this.BrowsePathCH,
this.SelectFieldCH,
this.DisplayInListCH,
this.FilterEnabledCH,
this.FilterOperatorCH,
this.FilterValueCH});
this.FilterDV.ContextMenuStrip = this.PopupMenu;
this.FilterDV.Dock = System.Windows.Forms.DockStyle.Fill;
this.FilterDV.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.FilterDV.Location = new System.Drawing.Point(0, 0);
this.FilterDV.Name = "FilterDV";
this.FilterDV.RowHeadersVisible = false;
this.FilterDV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.FilterDV.Size = new System.Drawing.Size(754, 346);
this.FilterDV.TabIndex = 0;
this.FilterDV.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.FilterDV_CellDoubleClick);
this.FilterDV.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.FilterDV_ColumnHeaderMouseClick);
this.FilterDV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.FilterDV_CellContentClick);
//
// RightPN
//
this.RightPN.Controls.Add(this.FilterDV);
this.RightPN.Controls.Add(this.BrowseCTRL);
this.RightPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.RightPN.Location = new System.Drawing.Point(0, 0);
this.RightPN.Name = "RightPN";
this.RightPN.Size = new System.Drawing.Size(754, 346);
this.RightPN.TabIndex = 3;
//
// ImageList
//
this.ImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.ImageList.ImageSize = new System.Drawing.Size(16, 16);
this.ImageList.TransparentColor = System.Drawing.Color.White;
//
// BrowseCTRL
//
this.BrowseCTRL.AttributesListCollapsed = false;
this.BrowseCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseCTRL.Location = new System.Drawing.Point(0, 0);
this.BrowseCTRL.Name = "BrowseCTRL";
this.BrowseCTRL.Size = new System.Drawing.Size(754, 346);
this.BrowseCTRL.SplitterDistance = 387;
this.BrowseCTRL.TabIndex = 1;
this.BrowseCTRL.View = null;
//
// Icon
//
this.Icon.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.Icon.DataPropertyName = "Icon";
this.Icon.HeaderText = "";
this.Icon.Name = "Icon";
this.Icon.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Icon.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
this.Icon.Width = 19;
//
// BrowsePathCH
//
this.BrowsePathCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.BrowsePathCH.DataPropertyName = "BrowsePath";
this.BrowsePathCH.HeaderText = "Browse Path";
this.BrowsePathCH.Name = "BrowsePathCH";
this.BrowsePathCH.ReadOnly = true;
this.BrowsePathCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
this.BrowsePathCH.Width = 92;
//
// SelectFieldCH
//
this.SelectFieldCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.SelectFieldCH.DataPropertyName = "SelectField";
this.SelectFieldCH.FalseValue = "SelectField";
this.SelectFieldCH.HeaderText = "Select";
this.SelectFieldCH.Name = "SelectFieldCH";
this.SelectFieldCH.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.SelectFieldCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
this.SelectFieldCH.TrueValue = "SelectField";
this.SelectFieldCH.Width = 62;
//
// DisplayInListCH
//
this.DisplayInListCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.DisplayInListCH.DataPropertyName = "DisplayInList";
this.DisplayInListCH.FalseValue = "DisplayInList";
this.DisplayInListCH.HeaderText = "Display";
this.DisplayInListCH.Name = "DisplayInListCH";
this.DisplayInListCH.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.DisplayInListCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
this.DisplayInListCH.TrueValue = "DisplayInList";
this.DisplayInListCH.Width = 66;
//
// FilterEnabledCH
//
this.FilterEnabledCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.FilterEnabledCH.DataPropertyName = "FilterEnabled";
this.FilterEnabledCH.FalseValue = "FilterEnabled";
this.FilterEnabledCH.HeaderText = "Filter";
this.FilterEnabledCH.Name = "FilterEnabledCH";
this.FilterEnabledCH.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.FilterEnabledCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
this.FilterEnabledCH.TrueValue = "FilterEnabled";
this.FilterEnabledCH.Width = 54;
//
// FilterOperatorCH
//
this.FilterOperatorCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.FilterOperatorCH.DataPropertyName = "FilterOperator";
this.FilterOperatorCH.HeaderText = "Filter Operator";
this.FilterOperatorCH.Name = "FilterOperatorCH";
this.FilterOperatorCH.ReadOnly = true;
this.FilterOperatorCH.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.FilterOperatorCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
this.FilterOperatorCH.Width = 98;
//
// FilterValueCH
//
this.FilterValueCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.FilterValueCH.DataPropertyName = "FilterValue";
this.FilterValueCH.HeaderText = "Filter Value";
this.FilterValueCH.Name = "FilterValueCH";
this.FilterValueCH.ReadOnly = true;
this.FilterValueCH.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
//
// EventFilterListViewCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.RightPN);
this.Name = "EventFilterListViewCtrl";
this.Size = new System.Drawing.Size(754, 346);
this.PopupMenu.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.FilterDV)).EndInit();
this.RightPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip PopupMenu;
private System.Windows.Forms.DataGridView FilterDV;
private System.Windows.Forms.Panel RightPN;
private System.Windows.Forms.ToolStripMenuItem MoveDownMI;
private System.Windows.Forms.ImageList ImageList;
private System.Windows.Forms.ToolStripMenuItem MoveUpMI;
private System.Windows.Forms.ToolStripMenuItem DeleteMI;
private BrowseNodeCtrl BrowseCTRL;
private System.Windows.Forms.DataGridViewImageColumn Icon;
private System.Windows.Forms.DataGridViewTextBoxColumn BrowsePathCH;
private System.Windows.Forms.DataGridViewCheckBoxColumn SelectFieldCH;
private System.Windows.Forms.DataGridViewCheckBoxColumn DisplayInListCH;
private System.Windows.Forms.DataGridViewCheckBoxColumn FilterEnabledCH;
private System.Windows.Forms.DataGridViewTextBoxColumn FilterOperatorCH;
private System.Windows.Forms.DataGridViewTextBoxColumn FilterValueCH;
}
}
@@ -0,0 +1,315 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays the results from a history read operation.
/// </summary>
public partial class EventFilterListViewCtrl : UserControl
{
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
public EventFilterListViewCtrl()
{
InitializeComponent();
FilterDV.AutoGenerateColumns = false;
ImageList = new ClientUtils().ImageList;
m_dataset = new DataSet();
m_dataset.Tables.Add("Events");
m_dataset.Tables[0].Columns.Add("Field", typeof(FilterDeclarationField));
m_dataset.Tables[0].Columns.Add("Icon", typeof(Image));
m_dataset.Tables[0].Columns.Add("BrowsePath", typeof(string));
m_dataset.Tables[0].Columns.Add("SelectField", typeof(bool));
m_dataset.Tables[0].Columns.Add("DisplayInList", typeof(bool));
m_dataset.Tables[0].Columns.Add("FilterEnabled", typeof(bool));
m_dataset.Tables[0].Columns.Add("FilterOperator", typeof(FilterOperator));
m_dataset.Tables[0].Columns.Add("FilterValue", typeof(Variant));
m_dataset.Tables[0].Columns.Add("Index", typeof(int));
m_dataset.Tables[0].DefaultView.Sort = "Index";
FilterDV.DataSource = m_dataset.Tables[0].DefaultView;
}
#endregion
#region Private Fields
private DataSet m_dataset;
private Session m_session;
private int m_counter;
#endregion
#region Public Members
/// <summary>
/// Changes the session used for the read request.
/// </summary>
public void ChangeSession(Session session)
{
m_session = session;
}
/// <summary>
/// Sets the filter to edit.
/// </summary>
public void SetFilter(FilterDeclaration filter)
{
m_dataset.Tables[0].Rows.Clear();
if (filter != null)
{
foreach (FilterDeclarationField field in filter.Fields)
{
DataRow row = m_dataset.Tables[0].NewRow();
UpdateRow(row, field);
m_dataset.Tables[0].Rows.Add(row);
}
}
}
#endregion
#region Private Methods
/// <summary>
/// Updates the row.
/// </summary>
public void UpdateRow(DataRow row, FilterDeclarationField field)
{
row[0] = field;
row[1] = ImageList.Images[ClientUtils.GetImageIndex(m_session, field.InstanceDeclaration.NodeClass, field.InstanceDeclaration.RootTypeId, false)];
row[2] = field.InstanceDeclaration.BrowsePathDisplayText;
row[3] = field.Selected;
row[4] = field.DisplayInList;
row[5] = field.FilterEnabled;
if (field.FilterEnabled)
{
row[6] = field.FilterOperator;
row[7] = field.FilterValue;
}
row[8] = m_counter++;
}
#endregion
#region Event Handlers
private void FilterDV_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.RowIndex == -1)
{
return;
}
DataRowView source = FilterDV.Rows[e.RowIndex].DataBoundItem as DataRowView;
FilterDeclarationField field = (FilterDeclarationField)source.Row[0];
if (e.ColumnIndex == 5)
{
FilterOperator filterOperator = field.FilterOperator;
if (new SetFilterOperatorDlg().ShowDialog(ref filterOperator))
{
field.FilterEnabled = true;
source.Row[5] = field.FilterEnabled;
field.FilterOperator = filterOperator;
source.Row[6] = field.FilterOperator;
}
return;
}
if (e.ColumnIndex == 6)
{
if (field.FilterOperator == FilterOperator.IsNull)
{
field.FilterValue = Variant.Null;
return;
}
InstanceDeclaration declaration = field.InstanceDeclaration;
object result = new EditComplexValueDlg().ShowDialog(
m_session,
declaration.DisplayName,
declaration.DataType,
declaration.ValueRank,
field.FilterValue.Value,
"Edit Filter Value");
if (result != null)
{
field.FilterEnabled = true;
source.Row[5] = field.FilterEnabled;
source.Row[6] = field.FilterOperator;
field.FilterValue = new Variant(result);
source.Row[7] = field.FilterValue;
}
return;
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void FilterDV_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.RowIndex == -1)
{
return;
}
DataRowView source = FilterDV.Rows[e.RowIndex].DataBoundItem as DataRowView;
FilterDeclarationField field = (FilterDeclarationField)source.Row[0];
if (e.ColumnIndex == 2)
{
field.Selected = !field.Selected;
source.Row[3] = field.Selected;
return;
}
if (e.ColumnIndex == 3)
{
field.DisplayInList = !field.DisplayInList;
source.Row[4] = field.DisplayInList;
return;
}
if (e.ColumnIndex == 4)
{
field.FilterEnabled = !field.FilterEnabled;
source.Row[5] = field.FilterEnabled;
return;
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void MoveUpMI_Click(object sender, EventArgs e)
{
try
{
// need to sort the rows by index.
List<DataGridViewRow> rows = new List<DataGridViewRow>();
foreach (DataGridViewRow row in FilterDV.SelectedRows)
{
bool inserted = false;
for (int ii = 0; ii < rows.Count; ii++)
{
if (rows[ii].Index > row.Index)
{
rows.Insert(ii, row);
inserted = true;
break;
}
}
if (!inserted)
{
rows.Add(row);
}
}
// move all of the rows up one.
for (int ii = 0; ii < rows.Count; ii++)
{
DataRowView source = FilterDV.Rows[rows[ii].Index].DataBoundItem as DataRowView;
if (rows[ii].Index > 0)
{
DataRowView target = FilterDV.Rows[rows[ii].Index-1].DataBoundItem as DataRowView;
int index = (int)target.Row[8];
target.Row[8] = source.Row[8];
source.Row[8] = index;
}
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void FilterDV_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
try
{
if (e.ColumnIndex == 2)
{
bool state = false;
if (m_dataset.Tables[0].DefaultView.Count > 0)
{
state = (bool)m_dataset.Tables[0].DefaultView[0].Row[3];
}
state = !state;
foreach (DataRowView row in m_dataset.Tables[0].DefaultView)
{
FilterDeclarationField field = (FilterDeclarationField)row.Row[0];
row.Row[3] = field.Selected = state;
}
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PopupMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="Icon.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="BrowsePathCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SelectFieldCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DisplayInListCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FilterEnabledCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FilterOperatorCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FilterValueCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>136, 17</value>
</metadata>
</root>
@@ -0,0 +1,182 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class EventListViewCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.PopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.DetailsMI = new System.Windows.Forms.ToolStripMenuItem();
this.DeleteMI = new System.Windows.Forms.ToolStripMenuItem();
this.EventsDV = new System.Windows.Forms.DataGridView();
this.RightPN = new System.Windows.Forms.Panel();
this.ImageList = new System.Windows.Forms.ImageList(this.components);
this.BrowseCTRL = new Opc.Ua.Client.Controls.BrowseNodeCtrl();
this.ClearMI = new System.Windows.Forms.ToolStripMenuItem();
this.Separator01 = new System.Windows.Forms.ToolStripSeparator();
this.PopupMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.EventsDV)).BeginInit();
this.RightPN.SuspendLayout();
this.SuspendLayout();
//
// PopupMenu
//
this.PopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.DetailsMI,
this.DeleteMI,
this.Separator01,
this.ClearMI});
this.PopupMenu.Name = "PopupMenu";
this.PopupMenu.Size = new System.Drawing.Size(153, 98);
//
// DetailsMI
//
this.DetailsMI.Name = "DetailsMI";
this.DetailsMI.Size = new System.Drawing.Size(152, 22);
this.DetailsMI.Text = "Details...";
this.DetailsMI.Click += new System.EventHandler(this.DetailsMI_Click);
//
// DeleteMI
//
this.DeleteMI.Name = "DeleteMI";
this.DeleteMI.Size = new System.Drawing.Size(152, 22);
this.DeleteMI.Text = "Delete";
this.DeleteMI.Click += new System.EventHandler(this.DeleteMI_Click);
//
// EventsDV
//
this.EventsDV.AllowUserToAddRows = false;
this.EventsDV.AllowUserToDeleteRows = false;
this.EventsDV.AllowUserToResizeRows = false;
this.EventsDV.BackgroundColor = System.Drawing.SystemColors.Window;
this.EventsDV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.EventsDV.ContextMenuStrip = this.PopupMenu;
this.EventsDV.Dock = System.Windows.Forms.DockStyle.Fill;
this.EventsDV.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.EventsDV.Location = new System.Drawing.Point(0, 0);
this.EventsDV.Name = "EventsDV";
this.EventsDV.RowHeadersVisible = false;
this.EventsDV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.EventsDV.Size = new System.Drawing.Size(754, 346);
this.EventsDV.TabIndex = 0;
this.EventsDV.ColumnAdded += new System.Windows.Forms.DataGridViewColumnEventHandler(this.EventsDV_ColumnAdded);
//
// RightPN
//
this.RightPN.Controls.Add(this.EventsDV);
this.RightPN.Controls.Add(this.BrowseCTRL);
this.RightPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.RightPN.Location = new System.Drawing.Point(0, 0);
this.RightPN.Name = "RightPN";
this.RightPN.Size = new System.Drawing.Size(754, 346);
this.RightPN.TabIndex = 3;
//
// ImageList
//
this.ImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.ImageList.ImageSize = new System.Drawing.Size(16, 16);
this.ImageList.TransparentColor = System.Drawing.Color.White;
//
// BrowseCTRL
//
this.BrowseCTRL.AttributesListCollapsed = false;
this.BrowseCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseCTRL.Location = new System.Drawing.Point(0, 0);
this.BrowseCTRL.Name = "BrowseCTRL";
this.BrowseCTRL.Size = new System.Drawing.Size(754, 346);
this.BrowseCTRL.SplitterDistance = 387;
this.BrowseCTRL.TabIndex = 1;
this.BrowseCTRL.View = null;
//
// ClearMI
//
this.ClearMI.Name = "ClearMI";
this.ClearMI.Size = new System.Drawing.Size(152, 22);
this.ClearMI.Text = "Clear";
this.ClearMI.Click += new System.EventHandler(this.ClearMI_Click);
//
// Separator01
//
this.Separator01.Name = "Separator01";
this.Separator01.Size = new System.Drawing.Size(149, 6);
//
// EventListViewCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.RightPN);
this.Name = "EventListViewCtrl";
this.Size = new System.Drawing.Size(754, 346);
this.PopupMenu.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.EventsDV)).EndInit();
this.RightPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip PopupMenu;
private System.Windows.Forms.DataGridView EventsDV;
private System.Windows.Forms.Panel RightPN;
private System.Windows.Forms.ImageList ImageList;
private System.Windows.Forms.ToolStripMenuItem DetailsMI;
private System.Windows.Forms.ToolStripMenuItem DeleteMI;
private BrowseNodeCtrl BrowseCTRL;
private System.Windows.Forms.ToolStripMenuItem ClearMI;
private System.Windows.Forms.ToolStripSeparator Separator01;
}
}
@@ -0,0 +1,343 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays the results from a history read operation.
/// </summary>
public partial class EventListViewCtrl : UserControl
{
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
public EventListViewCtrl()
{
InitializeComponent();
EventsDV.AutoGenerateColumns = true;
ImageList = new ClientUtils().ImageList;
}
#endregion
#region Private Fields
private DataSet m_dataset;
private Session m_session;
private FilterDeclaration m_filter;
#endregion
#region Public Members
/// <summary>
/// Changes the session used for the read request.
/// </summary>
public void ChangeSession(Session session)
{
m_session = session;
}
/// <summary>
/// Sets the filter to edit.
/// </summary>
public void SetFilter(FilterDeclaration filter)
{
m_filter = filter;
m_dataset = new DataSet();
m_dataset.Tables.Add("Events");
m_dataset.Tables[0].Columns.Add("Event", typeof(VariantCollection));
if (m_filter != null)
{
foreach (FilterDeclarationField field in m_filter.Fields)
{
if (field.DisplayInList)
{
m_dataset.Tables[0].Columns.Add(field.InstanceDeclaration.DisplayName, typeof(string));
}
}
}
EventsDV.DataSource = m_dataset.Tables[0];
}
/// <summary>
/// Displays the event.
/// </summary>
public void DisplayEvent(EventFieldList e)
{
if (e != null)
{
DisplayEvent(e.EventFields);
}
}
#endregion
#region Private Methods
/// <summary>
/// Sets the filter to edit.
/// </summary>
public void DisplayEvent(VariantCollection fields)
{
if (m_filter != null)
{
int index = 0;
DataRow row = m_dataset.Tables[0].NewRow();
row[index++] = fields;
for (int ii = 0; ii < m_filter.Fields.Count; ii++)
{
if (m_filter.Fields[ii].DisplayInList)
{
if (ii < fields.Count - 1)
{
// increment because the first field is always the event NodeId when using FilterDeclarations to create EventFilters.
row[index] = fields[ii + 1].ToString();
}
index++;
}
}
m_dataset.Tables[0].Rows.Add(row);
}
}
/// <summary>
/// Fetches the recent history.
/// </summary>
private void ReadHistory(ReadEventDetails details, NodeId areaId)
{
HistoryReadValueIdCollection nodesToRead = new HistoryReadValueIdCollection();
HistoryReadValueId nodeToRead = new HistoryReadValueId();
nodeToRead.NodeId = areaId;
nodesToRead.Add(nodeToRead);
HistoryReadResultCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.HistoryRead(
null,
new ExtensionObject(details),
TimestampsToReturn.Neither,
false,
nodesToRead,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToRead);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToRead);
if (StatusCode.IsBad(results[0].StatusCode))
{
throw new ServiceResultException(results[0].StatusCode);
}
HistoryEvent events = ExtensionObject.ToEncodeable(results[0].HistoryData) as HistoryEvent;
foreach (HistoryEventFieldList e in events.Events)
{
DisplayEvent(e.EventFields);
}
// release continuation points.
if (results[0].ContinuationPoint != null && results[0].ContinuationPoint.Length > 0)
{
nodeToRead.ContinuationPoint = results[0].ContinuationPoint;
m_session.HistoryRead(
null,
new ExtensionObject(details),
TimestampsToReturn.Neither,
true,
nodesToRead,
out results,
out diagnosticInfos);
}
}
/// <summary>
/// Deletes the recent history.
/// </summary>
private void DeleteHistory(NodeId areaId, List<VariantCollection> events, FilterDeclaration filter)
{
// find the event id.
int index = 0;
foreach (FilterDeclarationField field in filter.Fields)
{
if (field.InstanceDeclaration.BrowseName == Opc.Ua.BrowseNames.EventId)
{
break;
}
index++;
}
// can't delete events if no event id.
if (index >= filter.Fields.Count)
{
throw ServiceResultException.Create(StatusCodes.BadEventIdUnknown, "Cannot delete events if EventId was not selected.");
}
// build list of nodes to delete.
DeleteEventDetails details = new DeleteEventDetails();
details.NodeId = areaId;
foreach (VariantCollection e in events)
{
byte[] eventId = null;
if (e.Count > index)
{
eventId = e[index].Value as byte[];
}
details.EventIds.Add(eventId);
}
// delete the events.
ExtensionObjectCollection nodesToUpdate = new ExtensionObjectCollection();
nodesToUpdate.Add(new ExtensionObject(details));
HistoryUpdateResultCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.HistoryUpdate(
null,
nodesToUpdate,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToUpdate);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToUpdate);
if (StatusCode.IsBad(results[0].StatusCode))
{
throw new ServiceResultException(results[0].StatusCode);
}
// check for item level errors.
if (results[0].OperationResults.Count > 0)
{
int count = 0;
for (int ii = 0; ii < results[0].OperationResults.Count; ii++)
{
if (StatusCode.IsBad(results[0].OperationResults[ii]))
{
count++;
}
}
// raise an error.
if (count > 0)
{
throw ServiceResultException.Create(
StatusCodes.BadEventIdUnknown,
"Error deleting events. Only {0} of {1} deletes succeeded.",
events.Count - count,
events.Count);
}
}
}
#endregion
#region Event Handlers
private void EventsDV_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
if (e.Column.Index == 0)
{
EventsDV.Columns[0].Visible = false;
}
if (EventsDV.Columns.Count > 1)
{
EventsDV.Columns[EventsDV.Columns.Count-1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
}
}
private void DetailsMI_Click(object sender, EventArgs e)
{
try
{
foreach (DataGridViewRow row in EventsDV.SelectedRows)
{
DataRowView source = row.DataBoundItem as DataRowView;
EventFieldList e2 = (EventFieldList)source.Row[0];
new ViewEventDetailsDlg().ShowDialog(m_filter, e2.EventFields);
break;
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void DeleteMI_Click(object sender, EventArgs e)
{
try
{
foreach (DataGridViewRow row in EventsDV.SelectedRows)
{
DataRowView source = row.DataBoundItem as DataRowView;
source.Row.Delete();
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void ClearMI_Click(object sender, EventArgs e)
{
try
{
m_dataset.Tables[0].Rows.Clear();
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PopupMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>136, 17</value>
</metadata>
</root>
@@ -0,0 +1,494 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class GdsDiscoverServersDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.BottomPN = new System.Windows.Forms.Panel();
this.BrowseCK = new System.Windows.Forms.CheckBox();
this.SearchBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.CancelBTN = new System.Windows.Forms.Button();
this.ServersLV = new System.Windows.Forms.ListView();
this.ApplicationNameCH = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ApplicationTypeCH = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.DNSNamesCH = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ProtocolsCH = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.PopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.DetailsMI = new System.Windows.Forms.ToolStripMenuItem();
this.TopPN = new System.Windows.Forms.TableLayoutPanel();
this.ProductUriTB = new System.Windows.Forms.TextBox();
this.ProductUriCB = new System.Windows.Forms.ComboBox();
this.ProductUriLB = new System.Windows.Forms.Label();
this.SystemElementTB = new System.Windows.Forms.TextBox();
this.SystemElementLB = new System.Windows.Forms.Label();
this.MachineNameCB = new System.Windows.Forms.ComboBox();
this.ApplicationUriCB = new System.Windows.Forms.ComboBox();
this.ApplicationUriTB = new System.Windows.Forms.TextBox();
this.MachineNameLB = new System.Windows.Forms.Label();
this.MachineNameTB = new System.Windows.Forms.TextBox();
this.ApplicationUriLB = new System.Windows.Forms.Label();
this.ApplicationNameTB = new System.Windows.Forms.TextBox();
this.ApplicationNameLB = new System.Windows.Forms.Label();
this.ApplicationNameCB = new System.Windows.Forms.ComboBox();
this.SystemElementBTN = new Opc.Ua.Client.Controls.SelectNodeCtrl();
this.SearchPN = new System.Windows.Forms.Panel();
this.BrowseCTRL = new Opc.Ua.Client.Controls.BrowseNodeCtrl();
this.ServerCTRL = new Opc.Ua.Client.Controls.ConnectServerCtrl();
this.BottomPN.SuspendLayout();
this.PopupMenu.SuspendLayout();
this.TopPN.SuspendLayout();
this.SearchPN.SuspendLayout();
this.SuspendLayout();
//
// BottomPN
//
this.BottomPN.Controls.Add(this.BrowseCK);
this.BottomPN.Controls.Add(this.SearchBTN);
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 332);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(784, 30);
this.BottomPN.TabIndex = 6;
//
// BrowseCK
//
this.BrowseCK.AutoSize = true;
this.BrowseCK.Location = new System.Drawing.Point(84, 4);
this.BrowseCK.Name = "BrowseCK";
this.BrowseCK.Padding = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.BrowseCK.Size = new System.Drawing.Size(61, 23);
this.BrowseCK.TabIndex = 5;
this.BrowseCK.Text = "Browse";
this.BrowseCK.UseVisualStyleBackColor = true;
this.BrowseCK.CheckedChanged += new System.EventHandler(this.BrowseCK_CheckedChanged);
//
// SearchBTN
//
this.SearchBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.SearchBTN.Location = new System.Drawing.Point(3, 4);
this.SearchBTN.Name = "SearchBTN";
this.SearchBTN.Size = new System.Drawing.Size(75, 23);
this.SearchBTN.TabIndex = 2;
this.SearchBTN.Text = "Search";
this.SearchBTN.UseVisualStyleBackColor = true;
this.SearchBTN.Click += new System.EventHandler(this.SearchBTN_Click);
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OkBTN.DialogResult = System.Windows.Forms.DialogResult.OK;
this.OkBTN.Location = new System.Drawing.Point(625, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 1;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(706, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 0;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// ServersLV
//
this.ServersLV.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.ApplicationNameCH,
this.ApplicationTypeCH,
this.DNSNamesCH,
this.ProtocolsCH});
this.ServersLV.ContextMenuStrip = this.PopupMenu;
this.ServersLV.Dock = System.Windows.Forms.DockStyle.Fill;
this.ServersLV.FullRowSelect = true;
this.ServersLV.Location = new System.Drawing.Point(0, 138);
this.ServersLV.Name = "ServersLV";
this.ServersLV.Size = new System.Drawing.Size(784, 163);
this.ServersLV.TabIndex = 7;
this.ServersLV.UseCompatibleStateImageBehavior = false;
this.ServersLV.View = System.Windows.Forms.View.Details;
this.ServersLV.SelectedIndexChanged += new System.EventHandler(this.ServersLV_SelectedIndexChanged);
//
// ApplicationNameCH
//
this.ApplicationNameCH.Text = "Application Name";
this.ApplicationNameCH.Width = 114;
//
// ApplicationTypeCH
//
this.ApplicationTypeCH.Text = "Application Type";
this.ApplicationTypeCH.Width = 112;
//
// DNSNamesCH
//
this.DNSNamesCH.Text = "DNS Names";
this.DNSNamesCH.Width = 95;
//
// ProtocolsCH
//
this.ProtocolsCH.Text = "Protocols";
this.ProtocolsCH.Width = 147;
//
// PopupMenu
//
this.PopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.DetailsMI});
this.PopupMenu.Name = "PopupMenu";
this.PopupMenu.Size = new System.Drawing.Size(119, 26);
//
// DetailsMI
//
this.DetailsMI.Name = "DetailsMI";
this.DetailsMI.Size = new System.Drawing.Size(118, 22);
this.DetailsMI.Text = "Details...";
//
// TopPN
//
this.TopPN.ColumnCount = 4;
this.TopPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.TopPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.TopPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.TopPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.TopPN.Controls.Add(this.ProductUriTB, 2, 4);
this.TopPN.Controls.Add(this.ProductUriCB, 1, 4);
this.TopPN.Controls.Add(this.ProductUriLB, 0, 4);
this.TopPN.Controls.Add(this.SystemElementTB, 1, 0);
this.TopPN.Controls.Add(this.SystemElementLB, 0, 0);
this.TopPN.Controls.Add(this.MachineNameCB, 1, 2);
this.TopPN.Controls.Add(this.ApplicationUriCB, 1, 3);
this.TopPN.Controls.Add(this.ApplicationUriTB, 2, 3);
this.TopPN.Controls.Add(this.MachineNameLB, 0, 2);
this.TopPN.Controls.Add(this.MachineNameTB, 2, 2);
this.TopPN.Controls.Add(this.ApplicationUriLB, 0, 3);
this.TopPN.Controls.Add(this.ApplicationNameTB, 2, 1);
this.TopPN.Controls.Add(this.ApplicationNameLB, 0, 1);
this.TopPN.Controls.Add(this.ApplicationNameCB, 1, 1);
this.TopPN.Controls.Add(this.SystemElementBTN, 3, 0);
this.TopPN.Dock = System.Windows.Forms.DockStyle.Top;
this.TopPN.Location = new System.Drawing.Point(0, 0);
this.TopPN.Name = "TopPN";
this.TopPN.RowCount = 7;
this.TopPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TopPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TopPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TopPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TopPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TopPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TopPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TopPN.Size = new System.Drawing.Size(784, 138);
this.TopPN.TabIndex = 8;
//
// ProductUriTB
//
this.ProductUriTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ProductUriTB.Location = new System.Drawing.Point(197, 110);
this.ProductUriTB.Name = "ProductUriTB";
this.ProductUriTB.Size = new System.Drawing.Size(388, 20);
this.ProductUriTB.TabIndex = 15;
//
// ProductUriCB
//
this.ProductUriCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ProductUriCB.FormattingEnabled = true;
this.ProductUriCB.Location = new System.Drawing.Point(99, 110);
this.ProductUriCB.Name = "ProductUriCB";
this.ProductUriCB.Size = new System.Drawing.Size(92, 21);
this.ProductUriCB.TabIndex = 14;
//
// ProductUriLB
//
this.ProductUriLB.AutoSize = true;
this.ProductUriLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ProductUriLB.Location = new System.Drawing.Point(3, 107);
this.ProductUriLB.Name = "ProductUriLB";
this.ProductUriLB.Size = new System.Drawing.Size(90, 27);
this.ProductUriLB.TabIndex = 13;
this.ProductUriLB.Text = "Product URI";
this.ProductUriLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// SystemElementTB
//
this.TopPN.SetColumnSpan(this.SystemElementTB, 2);
this.SystemElementTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.SystemElementTB.Location = new System.Drawing.Point(99, 3);
this.SystemElementTB.Name = "SystemElementTB";
this.SystemElementTB.ReadOnly = true;
this.SystemElementTB.Size = new System.Drawing.Size(486, 20);
this.SystemElementTB.TabIndex = 12;
//
// SystemElementLB
//
this.SystemElementLB.AutoSize = true;
this.SystemElementLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.SystemElementLB.Location = new System.Drawing.Point(3, 0);
this.SystemElementLB.Name = "SystemElementLB";
this.SystemElementLB.Size = new System.Drawing.Size(90, 26);
this.SystemElementLB.TabIndex = 11;
this.SystemElementLB.Text = "System Element";
this.SystemElementLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// MachineNameCB
//
this.MachineNameCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.MachineNameCB.FormattingEnabled = true;
this.MachineNameCB.Location = new System.Drawing.Point(99, 56);
this.MachineNameCB.Name = "MachineNameCB";
this.MachineNameCB.Size = new System.Drawing.Size(92, 21);
this.MachineNameCB.TabIndex = 10;
//
// ApplicationUriCB
//
this.ApplicationUriCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ApplicationUriCB.FormattingEnabled = true;
this.ApplicationUriCB.Location = new System.Drawing.Point(99, 83);
this.ApplicationUriCB.Name = "ApplicationUriCB";
this.ApplicationUriCB.Size = new System.Drawing.Size(92, 21);
this.ApplicationUriCB.TabIndex = 9;
//
// ApplicationUriTB
//
this.ApplicationUriTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ApplicationUriTB.Location = new System.Drawing.Point(197, 83);
this.ApplicationUriTB.Name = "ApplicationUriTB";
this.ApplicationUriTB.Size = new System.Drawing.Size(388, 20);
this.ApplicationUriTB.TabIndex = 6;
//
// MachineNameLB
//
this.MachineNameLB.AutoSize = true;
this.MachineNameLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.MachineNameLB.Location = new System.Drawing.Point(3, 53);
this.MachineNameLB.Name = "MachineNameLB";
this.MachineNameLB.Size = new System.Drawing.Size(90, 27);
this.MachineNameLB.TabIndex = 5;
this.MachineNameLB.Text = "Machine Name";
this.MachineNameLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// MachineNameTB
//
this.MachineNameTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.MachineNameTB.Location = new System.Drawing.Point(197, 56);
this.MachineNameTB.Name = "MachineNameTB";
this.MachineNameTB.Size = new System.Drawing.Size(388, 20);
this.MachineNameTB.TabIndex = 4;
//
// ApplicationUriLB
//
this.ApplicationUriLB.AutoSize = true;
this.ApplicationUriLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ApplicationUriLB.Location = new System.Drawing.Point(3, 80);
this.ApplicationUriLB.Name = "ApplicationUriLB";
this.ApplicationUriLB.Size = new System.Drawing.Size(90, 27);
this.ApplicationUriLB.TabIndex = 3;
this.ApplicationUriLB.Text = "Application URI";
this.ApplicationUriLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ApplicationNameTB
//
this.ApplicationNameTB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ApplicationNameTB.Location = new System.Drawing.Point(197, 29);
this.ApplicationNameTB.Name = "ApplicationNameTB";
this.ApplicationNameTB.Size = new System.Drawing.Size(388, 20);
this.ApplicationNameTB.TabIndex = 2;
//
// ApplicationNameLB
//
this.ApplicationNameLB.AutoSize = true;
this.ApplicationNameLB.Dock = System.Windows.Forms.DockStyle.Fill;
this.ApplicationNameLB.Location = new System.Drawing.Point(3, 26);
this.ApplicationNameLB.Name = "ApplicationNameLB";
this.ApplicationNameLB.Size = new System.Drawing.Size(90, 27);
this.ApplicationNameLB.TabIndex = 1;
this.ApplicationNameLB.Text = "Application Name";
this.ApplicationNameLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ApplicationNameCB
//
this.ApplicationNameCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ApplicationNameCB.FormattingEnabled = true;
this.ApplicationNameCB.Location = new System.Drawing.Point(99, 29);
this.ApplicationNameCB.Name = "ApplicationNameCB";
this.ApplicationNameCB.Size = new System.Drawing.Size(92, 21);
this.ApplicationNameCB.TabIndex = 8;
//
// SystemElementBTN
//
this.SystemElementBTN.Location = new System.Drawing.Point(589, 1);
this.SystemElementBTN.Margin = new System.Windows.Forms.Padding(1);
this.SystemElementBTN.Name = "SystemElementBTN";
this.SystemElementBTN.NodeControl = this.SystemElementTB;
this.SystemElementBTN.ReferenceTypeIds = null;
this.SystemElementBTN.RootId = null;
this.SystemElementBTN.SelectedNode = null;
this.SystemElementBTN.SelectedReference = null;
this.SystemElementBTN.Session = null;
this.SystemElementBTN.Size = new System.Drawing.Size(24, 24);
this.SystemElementBTN.TabIndex = 16;
this.SystemElementBTN.View = null;
//
// SearchPN
//
this.SearchPN.Controls.Add(this.ServersLV);
this.SearchPN.Controls.Add(this.TopPN);
this.SearchPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.SearchPN.Location = new System.Drawing.Point(0, 31);
this.SearchPN.Name = "SearchPN";
this.SearchPN.Size = new System.Drawing.Size(784, 301);
this.SearchPN.TabIndex = 11;
//
// BrowseCTRL
//
this.BrowseCTRL.AttributesListCollapsed = false;
this.BrowseCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseCTRL.Location = new System.Drawing.Point(0, 31);
this.BrowseCTRL.Name = "BrowseCTRL";
this.BrowseCTRL.Size = new System.Drawing.Size(784, 301);
this.BrowseCTRL.SplitterDistance = 387;
this.BrowseCTRL.TabIndex = 9;
this.BrowseCTRL.View = null;
this.BrowseCTRL.AfterSelect += new System.EventHandler(this.BrowseCTRL_AfterSelect);
//
// ServerCTRL
//
this.ServerCTRL.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.ServerCTRL.Configuration = null;
this.ServerCTRL.DisableDomainCheck = false;
this.ServerCTRL.Dock = System.Windows.Forms.DockStyle.Top;
this.ServerCTRL.Location = new System.Drawing.Point(0, 0);
this.ServerCTRL.MaximumSize = new System.Drawing.Size(2048, 31);
this.ServerCTRL.MinimumSize = new System.Drawing.Size(500, 31);
this.ServerCTRL.Name = "ServerCTRL";
this.ServerCTRL.Padding = new System.Windows.Forms.Padding(3);
this.ServerCTRL.PreferredLocales = null;
this.ServerCTRL.ServerStatusControl = null;
this.ServerCTRL.ServerUrl = "";
this.ServerCTRL.SessionName = null;
this.ServerCTRL.Size = new System.Drawing.Size(784, 31);
this.ServerCTRL.StatusStrip = null;
this.ServerCTRL.StatusUpateTimeControl = null;
this.ServerCTRL.TabIndex = 10;
this.ServerCTRL.UserIdentity = null;
this.ServerCTRL.UseSecurity = true;
this.ServerCTRL.ReconnectComplete += new System.EventHandler(this.ServerCTRL_ReconnectComplete);
this.ServerCTRL.ConnectComplete += new System.EventHandler(this.ServerCTRL_ConnectComplete);
//
// GdsDiscoverServersDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(784, 362);
this.Controls.Add(this.SearchPN);
this.Controls.Add(this.BrowseCTRL);
this.Controls.Add(this.ServerCTRL);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "GdsDiscoverServersDlg";
this.Text = "Global Directory Service";
this.BottomPN.ResumeLayout(false);
this.BottomPN.PerformLayout();
this.PopupMenu.ResumeLayout(false);
this.TopPN.ResumeLayout(false);
this.TopPN.PerformLayout();
this.SearchPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button SearchBTN;
private System.Windows.Forms.ListView ServersLV;
private System.Windows.Forms.ColumnHeader ApplicationNameCH;
private System.Windows.Forms.ColumnHeader DNSNamesCH;
private System.Windows.Forms.ColumnHeader ProtocolsCH;
private System.Windows.Forms.TableLayoutPanel TopPN;
private System.Windows.Forms.TextBox ProductUriTB;
private System.Windows.Forms.ComboBox ProductUriCB;
private System.Windows.Forms.Label ProductUriLB;
private System.Windows.Forms.TextBox SystemElementTB;
private System.Windows.Forms.Label SystemElementLB;
private System.Windows.Forms.ComboBox MachineNameCB;
private System.Windows.Forms.ComboBox ApplicationUriCB;
private System.Windows.Forms.TextBox ApplicationUriTB;
private System.Windows.Forms.Label MachineNameLB;
private System.Windows.Forms.TextBox MachineNameTB;
private System.Windows.Forms.Label ApplicationUriLB;
private System.Windows.Forms.TextBox ApplicationNameTB;
private System.Windows.Forms.Label ApplicationNameLB;
private System.Windows.Forms.ComboBox ApplicationNameCB;
private Opc.Ua.Client.Controls.SelectNodeCtrl SystemElementBTN;
private System.Windows.Forms.ContextMenuStrip PopupMenu;
private System.Windows.Forms.ToolStripMenuItem DetailsMI;
private BrowseNodeCtrl BrowseCTRL;
private ConnectServerCtrl ServerCTRL;
private System.Windows.Forms.Panel SearchPN;
private System.Windows.Forms.CheckBox BrowseCK;
private System.Windows.Forms.ColumnHeader ApplicationTypeCH;
}
}
@@ -0,0 +1,538 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Opc.Ua.Client;
using Opc.Ua.Client.Controls;
using System.Threading.Tasks;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Searches for the servers in a GDS.
/// </summary>
public partial class GdsDiscoverServersDlg : Form
{
#region Constructors
/// <summary>
/// Constructs the form.
/// </summary>
public GdsDiscoverServersDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
ServersLV.SmallImageList = new ClientUtils().ImageList;
List<object> items = new List<object>();
foreach (object value in Enum.GetValues(typeof(Match)))
{
items.Add(value);
}
ApplicationNameCB.Items.AddRange(items.ToArray());
MachineNameCB.Items.AddRange(items.ToArray());
ApplicationUriCB.Items.AddRange(items.ToArray());
ProductUriCB.Items.AddRange(items.ToArray());
ApplicationNameCB.SelectedIndex = 0;
MachineNameCB.SelectedIndex = 0;
ApplicationUriCB.SelectedIndex = 0;
ProductUriCB.SelectedIndex = 0;
}
#endregion
#region Match Enumeration
private enum Match
{
StartsWith,
IsExactly,
EndsWith,
Contains
}
#endregion
#region Private Fields
private ApplicationDescription m_application;
#endregion
#region Private Constants
/// <summary>
/// The identifier for the Directory Object.
/// </summary>
private const uint GdsId_Directory = 584;
/// <summary>
/// The identifier for the Directory_Applications Object.
/// </summary>
private const uint GdsId_Directory_Applications = 586;
/// <summary>
/// The identifier for the RootDirectoryEntryType_QueryServers Method.
/// </summary>
private const uint GdsId_RootDirectoryEntryType_QueryServers = 550;
/// <summary>
/// The identifier for the ApplicationElementType ObjectType.
/// </summary>
public const uint GdsId_ApplicationElementType = 572;
#endregion
#region Public Interface
/// <summary>
/// Shows the dialog.
/// </summary>
public async Task<ApplicationDescription> ShowDialog(ApplicationConfiguration configuration, bool showSearchPanel)
{
List<string> urls = new List<string>();
foreach (EndpointDescription endpoint in configuration.ClientConfiguration.DiscoveryServers)
{
urls.Add(endpoint.EndpointUrl);
}
if (urls.Count == 0)
{
// TODO find servers with LDS
urls.Add("opc.tcp://localhost:58800/GlobalDiscoveryServer");
}
ServerCTRL.Configuration = configuration;
ServerCTRL.SetAvailableUrls(urls);
try
{
await ServerCTRL.Connect();
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
OkBTN.Visible = true;
CancelBTN.Visible = true;
BrowseCK.Checked = showSearchPanel;
BrowseCK.Checked = !showSearchPanel;
if (base.ShowDialog() != DialogResult.OK)
{
return null;
}
return m_application;
}
#endregion
#region Private Methods
/// <summary>
/// Adds the results to the control.
/// </summary>
private void UpdateResults(ApplicationDescription[] descriptions)
{
ServersLV.Items.Clear();
if (descriptions == null)
{
return;
}
for (int ii = 0; ii < descriptions.Length; ii++)
{
ApplicationDescription description = descriptions[ii];
if (description == null)
{
continue;
}
ListViewItem item = new ListViewItem();
item.Text = Utils.Format("{0}", description.ApplicationName);
item.ImageIndex = ClientUtils.GetImageIndex(ServerCTRL.Session, NodeClass.Object, null, false);
item.SubItems.Add(new ListViewItem.ListViewSubItem());
item.SubItems.Add(new ListViewItem.ListViewSubItem());
item.SubItems.Add(new ListViewItem.ListViewSubItem());
item.Tag = description;
ServersLV.Items.Add(item);
item.SubItems[1].Text = description.ApplicationType.ToString();
if (description.DiscoveryUrls == null)
{
continue;
}
// collect the domains and protocols.
List<string> domains = new List<string>();
List<string> protocols = new List<string>();
foreach (string discoveryUrl in description.DiscoveryUrls)
{
Uri url = Utils.ParseUri(discoveryUrl);
if (url != null)
{
if (!domains.Contains(url.DnsSafeHost))
{
domains.Add(url.DnsSafeHost);
}
if (!protocols.Contains(url.Scheme))
{
protocols.Add(url.Scheme);
}
}
}
// format the domains.
StringBuilder buffer = new StringBuilder();
foreach (string domain in domains)
{
if (buffer.Length > 0)
{
buffer.Append(", ");
}
buffer.Append(domain);
}
item.SubItems[2].Text = buffer.ToString();
// format the protocols.
buffer = new StringBuilder();
foreach (string protocol in protocols)
{
if (buffer.Length > 0)
{
buffer.Append(", ");
}
buffer.Append(protocol);
}
item.SubItems[3].Text = buffer.ToString();
}
// adjust column widths.
for (int ii = 0; ii < ServersLV.Columns.Count; ii++)
{
ServersLV.Columns[ii].Width = -2;
}
}
/// <summary>
/// Adds wildcards to the filter.
/// </summary>
private string ProcessFilter(ComboBox selection, TextBox filter)
{
if (String.IsNullOrEmpty(filter.Text))
{
return String.Empty;
}
string text = filter.Text;
Match match = (Match)selection.SelectedItem;
if (match == Match.Contains || match == Match.StartsWith)
{
if (!text.EndsWith("%"))
{
text = text + "%";
}
}
if (match == Match.Contains || match == Match.EndsWith)
{
if (!text.StartsWith("%"))
{
text = "%" + text;
}
}
return text;
}
/// <summary>
/// Searches the server for servers.
/// </summary>
private void Search()
{
Session session = ServerCTRL.Session;
if (session == null)
{
return;
}
NodeId elementId = null;
ReferenceDescription reference = SystemElementBTN.SelectedReference;
if (reference != null && !reference.NodeId.IsAbsolute)
{
elementId = (NodeId)reference.NodeId;
}
ushort namespaceIndex = (ushort)session.NamespaceUris.GetIndex(Namespaces.OpcUaGds);
IList<object> outputArguments = session.Call(
new NodeId(GdsId_Directory, namespaceIndex),
new NodeId(GdsId_RootDirectoryEntryType_QueryServers, namespaceIndex),
elementId,
ProcessFilter(ApplicationNameCB, ApplicationNameTB),
ProcessFilter(MachineNameCB, MachineNameTB),
ProcessFilter(ApplicationUriCB, ApplicationUriTB),
ProcessFilter(ProductUriCB, ProductUriTB));
if (outputArguments != null && outputArguments.Count == 1)
{
ExtensionObject[] extensions = outputArguments[0] as ExtensionObject[];
ApplicationDescription[] descriptions = (ApplicationDescription[])ExtensionObject.ToArray(extensions, typeof(ApplicationDescription));
UpdateResults(descriptions);
}
}
/// <summary>
/// Reads the application description from the GDS.
/// </summary>
private ApplicationDescription Read(NodeId nodeId)
{
NamespaceTable wellKnownNamespaceUris = new NamespaceTable();
wellKnownNamespaceUris.Append(Namespaces.OpcUaGds);
string[] browsePaths = new string[]
{
"1:ApplicationName",
"1:ApplicationType",
"1:ApplicationUri",
"1:ProductUri",
"1:GatewayServerUri",
"1:DiscoveryUrls"
};
List<NodeId> propertyIds = ClientUtils.TranslateBrowsePaths(
ServerCTRL.Session,
nodeId,
wellKnownNamespaceUris,
browsePaths);
ReadValueIdCollection nodesToRead = new ReadValueIdCollection();
foreach (NodeId propertyId in propertyIds)
{
ReadValueId nodeToRead = new ReadValueId();
nodeToRead.NodeId = propertyId;
nodeToRead.AttributeId = Attributes.Value;
nodesToRead.Add(nodeToRead);
}
DataValueCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
ServerCTRL.Session.Read(
null,
0,
TimestampsToReturn.Neither,
nodesToRead,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToRead);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToRead);
ApplicationDescription application = new ApplicationDescription();
application.ApplicationName = results[0].GetValue<LocalizedText>(null);
application.ApplicationType = (ApplicationType)results[1].GetValue<int>((int)ApplicationType.Server);
application.ApplicationUri = results[2].GetValue<string>(null);
application.ProductUri = results[3].GetValue<string>(null);
application.GatewayServerUri = results[4].GetValue<string>(null);
string[] discoveryUrls = results[5].GetValue<string[]>(null);
if (discoveryUrls != null)
{
application.DiscoveryUrls = new StringCollection(discoveryUrls);
}
return application;
}
#endregion
#region Event Handlers
private void SearchBTN_Click(object sender, EventArgs e)
{
try
{
Search();
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void CloseBTN_Click(object sender, EventArgs e)
{
try
{
Close();
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void ServerCTRL_ConnectComplete(object sender, EventArgs e)
{
try
{
Session session = ServerCTRL.Session;
if (session != null)
{
ushort namespaceIndex = (ushort)session.NamespaceUris.GetIndex(Opc.Ua.Namespaces.OpcUaGds);
NodeId rootId = new NodeId(GdsId_Directory_Applications, namespaceIndex);
NodeId[] referenceTypeIds = new NodeId[] { Opc.Ua.ReferenceTypeIds.Organizes, Opc.Ua.ReferenceTypeIds.HasChild };
BrowseCTRL.Initialize(session, rootId, referenceTypeIds);
SystemElementBTN.Session = session;
SystemElementBTN.RootId = rootId;
SystemElementBTN.ReferenceTypeIds = referenceTypeIds;
}
else
{
BrowseCTRL.ChangeSession(session);
SystemElementBTN.Session = session;
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void ServerCTRL_ReconnectComplete(object sender, EventArgs e)
{
try
{
Session session = ServerCTRL.Session;
BrowseCTRL.ChangeSession(session);
SystemElementBTN.Session = session;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void BrowseCK_CheckedChanged(object sender, EventArgs e)
{
try
{
SearchPN.Visible = !BrowseCK.Checked;
SearchBTN.Enabled = !BrowseCK.Checked;
BrowseCTRL.Visible = BrowseCK.Checked;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void ServersLV_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (ServerCTRL.Session == null)
{
return;
}
foreach (ListViewItem item in ServersLV.SelectedItems)
{
m_application = item.Tag as ApplicationDescription;
OkBTN.Enabled = m_application.ApplicationType == ApplicationType.Server || m_application.ApplicationType == ApplicationType.ClientAndServer;
return;
}
m_application = null;
OkBTN.Enabled = false;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void BrowseCTRL_AfterSelect(object sender, EventArgs e)
{
try
{
if (ServerCTRL.Session == null)
{
return;
}
ushort namespaceIndex = (ushort)ServerCTRL.Session.NamespaceUris.GetIndex(Opc.Ua.Namespaces.OpcUaGds);
NodeId typeId = new NodeId(GdsId_ApplicationElementType, namespaceIndex);
ReferenceDescription reference = BrowseCTRL.SelectedNode;
if (reference != null)
{
if (reference.TypeDefinition == typeId)
{
m_application = Read((NodeId)reference.NodeId);
OkBTN.Enabled = m_application.ApplicationType == ApplicationType.Server || m_application.ApplicationType == ApplicationType.ClientAndServer;
return;
}
}
m_application = null;
OkBTN.Enabled = false;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PopupMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
@@ -0,0 +1,98 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class HistoryDataDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.HistoryDataCTRL = new Opc.Ua.Client.Controls.HistoryDataListView();
this.SuspendLayout();
//
// HistoryDataCTRL
//
this.HistoryDataCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.HistoryDataCTRL.EndTime = new System.DateTime(((long)(0)));
this.HistoryDataCTRL.Location = new System.Drawing.Point(0, 0);
this.HistoryDataCTRL.MaxReturnValues = ((uint)(0u));
this.HistoryDataCTRL.Name = "HistoryDataCTRL";
this.HistoryDataCTRL.NodeId = null;
this.HistoryDataCTRL.ProcessingInterval = 10000D;
this.HistoryDataCTRL.ReadType = Opc.Ua.Client.Controls.HistoryDataListView.HistoryReadType.Raw;
this.HistoryDataCTRL.ReturnBounds = false;
this.HistoryDataCTRL.Size = new System.Drawing.Size(784, 362);
this.HistoryDataCTRL.StartTime = new System.DateTime(2015, 5, 25, 16, 46, 5, 399);
this.HistoryDataCTRL.TabIndex = 13;
//
// HistoryDataDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(784, 362);
this.Controls.Add(this.HistoryDataCTRL);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "HistoryDataDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "History Data";
this.ResumeLayout(false);
}
#endregion
private HistoryDataListView HistoryDataCTRL;
}
}
@@ -0,0 +1,115 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
using System.Data;
using System.Drawing;
using Opc.Ua;
using Opc.Ua.Client;
using Opc.Ua.Client.Controls;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Allows the user to read and update history for a variable.
/// </summary>
public partial class HistoryDataDlg : Form, ISessionForm
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public HistoryDataDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Changes the session used.
/// </summary>
public void ChangeSession(Session session)
{
HistoryDataCTRL.ChangeSession(session);
}
/// <summary>
/// Sets the variable shown in the dialog.
/// </summary>
public void SetVariable(NodeId variableId)
{
HistoryDataCTRL.ChangeNode(variableId);
}
#endregion
#region Private Methods
#endregion
#region Event Handlers
private void OkBTN_Click(object sender, EventArgs e)
{
try
{
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void CancelBTN_Click(object sender, EventArgs e)
{
try
{
if (this.Modal)
{
DialogResult = DialogResult.Cancel;
}
else
{
Close();
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,992 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class HistoryDataListView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.PopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.AddValueMI = new System.Windows.Forms.ToolStripMenuItem();
this.EditValueMI = new System.Windows.Forms.ToolStripMenuItem();
this.RemoveValueMI = new System.Windows.Forms.ToolStripMenuItem();
this.InsertAnnotationMI = new System.Windows.Forms.ToolStripMenuItem();
this.ShowServerTimestampMI = new System.Windows.Forms.ToolStripMenuItem();
this.ResultsDV = new System.Windows.Forms.DataGridView();
this.SourceTimestampCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ServerTimestampCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ValueCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StatusCodeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.HistoryInfoCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UpdateTypeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UpdateTimeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UserNameCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UpdateResultCN = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.LeftPN = new System.Windows.Forms.Panel();
this.ControlsPN = new System.Windows.Forms.TableLayoutPanel();
this.PropertyCB = new System.Windows.Forms.ComboBox();
this.PropertyLB = new System.Windows.Forms.Label();
this.UseSimpleBoundsCK = new System.Windows.Forms.CheckBox();
this.UseSimpleBoundsLB = new System.Windows.Forms.Label();
this.SamplingIntervalUnitsLB = new System.Windows.Forms.Label();
this.TimeStepUnitsLB = new System.Windows.Forms.Label();
this.SamplingIntervalNP = new System.Windows.Forms.NumericUpDown();
this.TimeStepNP = new System.Windows.Forms.NumericUpDown();
this.SamplingIntervalLB = new System.Windows.Forms.Label();
this.TimeStepLB = new System.Windows.Forms.Label();
this.NodeIdBTN = new System.Windows.Forms.Button();
this.NodeIdTB = new System.Windows.Forms.TextBox();
this.StartTimeCK = new System.Windows.Forms.CheckBox();
this.NodeIdLB = new System.Windows.Forms.Label();
this.ReturnBoundsLB = new System.Windows.Forms.Label();
this.ResampleIntervalLB = new System.Windows.Forms.Label();
this.ReadTypeCB = new System.Windows.Forms.ComboBox();
this.EndTimeLB = new System.Windows.Forms.Label();
this.ProcessingIntervalNP = new System.Windows.Forms.NumericUpDown();
this.ReadTypeLB = new System.Windows.Forms.Label();
this.AggregateCB = new System.Windows.Forms.ComboBox();
this.StartTimeLB = new System.Windows.Forms.Label();
this.StartTimeDP = new System.Windows.Forms.DateTimePicker();
this.EndTimeDP = new System.Windows.Forms.DateTimePicker();
this.EndTimeCK = new System.Windows.Forms.CheckBox();
this.AggregateLB = new System.Windows.Forms.Label();
this.MaxReturnValuesLB = new System.Windows.Forms.Label();
this.MaxReturnValuesNP = new System.Windows.Forms.NumericUpDown();
this.MaxReturnValuesCK = new System.Windows.Forms.CheckBox();
this.ReturnBoundsCK = new System.Windows.Forms.CheckBox();
this.ResampleIntervalUnitsLB = new System.Windows.Forms.Label();
this.StatusTB = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.StopBTN = new System.Windows.Forms.Button();
this.NextBTN = new System.Windows.Forms.Button();
this.TimeShiftBTN = new System.Windows.Forms.Button();
this.GoBTN = new System.Windows.Forms.Button();
this.DetectLimitsBTN = new System.Windows.Forms.Button();
this.RightPN = new System.Windows.Forms.Panel();
this.PopupMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ResultsDV)).BeginInit();
this.LeftPN.SuspendLayout();
this.ControlsPN.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.SamplingIntervalNP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.TimeStepNP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ProcessingIntervalNP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MaxReturnValuesNP)).BeginInit();
this.panel1.SuspendLayout();
this.RightPN.SuspendLayout();
this.SuspendLayout();
//
// PopupMenu
//
this.PopupMenu.ImageScalingSize = new System.Drawing.Size(32, 32);
this.PopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.AddValueMI,
this.EditValueMI,
this.RemoveValueMI,
this.InsertAnnotationMI,
this.ShowServerTimestampMI});
this.PopupMenu.Name = "PopupMenu";
this.PopupMenu.Size = new System.Drawing.Size(348, 194);
//
// AddValueMI
//
this.AddValueMI.Enabled = false;
this.AddValueMI.Name = "AddValueMI";
this.AddValueMI.Size = new System.Drawing.Size(347, 38);
this.AddValueMI.Text = "Add...";
//
// EditValueMI
//
this.EditValueMI.Enabled = false;
this.EditValueMI.Name = "EditValueMI";
this.EditValueMI.Size = new System.Drawing.Size(347, 38);
this.EditValueMI.Text = "Edit...";
this.EditValueMI.Click += new System.EventHandler(this.EditValueMI_Click);
//
// RemoveValueMI
//
this.RemoveValueMI.Enabled = false;
this.RemoveValueMI.Name = "RemoveValueMI";
this.RemoveValueMI.Size = new System.Drawing.Size(347, 38);
this.RemoveValueMI.Text = "Remove";
//
// InsertAnnotationMI
//
this.InsertAnnotationMI.Name = "InsertAnnotationMI";
this.InsertAnnotationMI.Size = new System.Drawing.Size(347, 38);
this.InsertAnnotationMI.Text = "Insert Annotation...";
this.InsertAnnotationMI.Click += new System.EventHandler(this.InsertAnnotationMI_Click);
//
// ShowServerTimestampMI
//
this.ShowServerTimestampMI.CheckOnClick = true;
this.ShowServerTimestampMI.Name = "ShowServerTimestampMI";
this.ShowServerTimestampMI.Size = new System.Drawing.Size(347, 38);
this.ShowServerTimestampMI.Text = "Show Server Timestamp";
this.ShowServerTimestampMI.CheckedChanged += new System.EventHandler(this.ShowServerTimestampMI_CheckedChanged);
//
// ResultsDV
//
this.ResultsDV.AllowUserToAddRows = false;
this.ResultsDV.AllowUserToDeleteRows = false;
this.ResultsDV.AllowUserToResizeRows = false;
this.ResultsDV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.ResultsDV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.SourceTimestampCH,
this.ServerTimestampCH,
this.ValueCH,
this.StatusCodeCH,
this.HistoryInfoCH,
this.UpdateTypeCH,
this.UpdateTimeCH,
this.UserNameCH,
this.UpdateResultCN});
this.ResultsDV.ContextMenuStrip = this.PopupMenu;
this.ResultsDV.Dock = System.Windows.Forms.DockStyle.Fill;
this.ResultsDV.Location = new System.Drawing.Point(0, 0);
this.ResultsDV.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.ResultsDV.Name = "ResultsDV";
this.ResultsDV.RowHeadersWidth = 82;
this.ResultsDV.Size = new System.Drawing.Size(1310, 1096);
this.ResultsDV.TabIndex = 0;
//
// SourceTimestampCH
//
this.SourceTimestampCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.SourceTimestampCH.DataPropertyName = "SourceTimestamp";
this.SourceTimestampCH.HeaderText = "SourceTimestamp";
this.SourceTimestampCH.MinimumWidth = 10;
this.SourceTimestampCH.Name = "SourceTimestampCH";
this.SourceTimestampCH.ReadOnly = true;
this.SourceTimestampCH.Width = 230;
//
// ServerTimestampCH
//
this.ServerTimestampCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.ServerTimestampCH.DataPropertyName = "ServerTimestamp";
this.ServerTimestampCH.HeaderText = "ServerTimestamp";
this.ServerTimestampCH.MinimumWidth = 10;
this.ServerTimestampCH.Name = "ServerTimestampCH";
this.ServerTimestampCH.ReadOnly = true;
this.ServerTimestampCH.Visible = false;
this.ServerTimestampCH.Width = 200;
//
// ValueCH
//
this.ValueCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.ValueCH.DataPropertyName = "Value";
this.ValueCH.HeaderText = "Value";
this.ValueCH.MinimumWidth = 10;
this.ValueCH.Name = "ValueCH";
this.ValueCH.ReadOnly = true;
//
// StatusCodeCH
//
this.StatusCodeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.StatusCodeCH.DataPropertyName = "StatusCode";
this.StatusCodeCH.HeaderText = "StatusCode";
this.StatusCodeCH.MinimumWidth = 10;
this.StatusCodeCH.Name = "StatusCodeCH";
this.StatusCodeCH.ReadOnly = true;
this.StatusCodeCH.Width = 169;
//
// HistoryInfoCH
//
this.HistoryInfoCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.HistoryInfoCH.DataPropertyName = "HistoryInfo";
this.HistoryInfoCH.HeaderText = "HistoryInfo";
this.HistoryInfoCH.MinimumWidth = 10;
this.HistoryInfoCH.Name = "HistoryInfoCH";
this.HistoryInfoCH.Width = 159;
//
// UpdateTypeCH
//
this.UpdateTypeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.UpdateTypeCH.DataPropertyName = "UpdateType";
this.UpdateTypeCH.HeaderText = "UpdateType";
this.UpdateTypeCH.MinimumWidth = 10;
this.UpdateTypeCH.Name = "UpdateTypeCH";
this.UpdateTypeCH.ReadOnly = true;
this.UpdateTypeCH.Visible = false;
this.UpdateTypeCH.Width = 200;
//
// UpdateTimeCH
//
this.UpdateTimeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.UpdateTimeCH.DataPropertyName = "UpdateTime";
this.UpdateTimeCH.HeaderText = "UpdateTime";
this.UpdateTimeCH.MinimumWidth = 10;
this.UpdateTimeCH.Name = "UpdateTimeCH";
this.UpdateTimeCH.ReadOnly = true;
this.UpdateTimeCH.Visible = false;
this.UpdateTimeCH.Width = 200;
//
// UserNameCH
//
this.UserNameCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.UserNameCH.DataPropertyName = "UserName";
this.UserNameCH.HeaderText = "UserName";
this.UserNameCH.MinimumWidth = 10;
this.UserNameCH.Name = "UserNameCH";
this.UserNameCH.ReadOnly = true;
this.UserNameCH.Visible = false;
this.UserNameCH.Width = 200;
//
// UpdateResultCN
//
this.UpdateResultCN.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.UpdateResultCN.DataPropertyName = "UpdateResult";
this.UpdateResultCN.HeaderText = "Update Result";
this.UpdateResultCN.MinimumWidth = 10;
this.UpdateResultCN.Name = "UpdateResultCN";
this.UpdateResultCN.ReadOnly = true;
this.UpdateResultCN.Visible = false;
this.UpdateResultCN.Width = 200;
//
// LeftPN
//
this.LeftPN.Controls.Add(this.ControlsPN);
this.LeftPN.Dock = System.Windows.Forms.DockStyle.Left;
this.LeftPN.Location = new System.Drawing.Point(0, 0);
this.LeftPN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.LeftPN.Name = "LeftPN";
this.LeftPN.Size = new System.Drawing.Size(612, 1096);
this.LeftPN.TabIndex = 2;
//
// ControlsPN
//
this.ControlsPN.ColumnCount = 3;
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 230F));
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.Controls.Add(this.PropertyCB, 1, 1);
this.ControlsPN.Controls.Add(this.PropertyLB, 0, 1);
this.ControlsPN.Controls.Add(this.UseSimpleBoundsCK, 1, 7);
this.ControlsPN.Controls.Add(this.UseSimpleBoundsLB, 0, 7);
this.ControlsPN.Controls.Add(this.SamplingIntervalUnitsLB, 2, 3);
this.ControlsPN.Controls.Add(this.TimeStepUnitsLB, 2, 11);
this.ControlsPN.Controls.Add(this.SamplingIntervalNP, 1, 3);
this.ControlsPN.Controls.Add(this.TimeStepNP, 1, 11);
this.ControlsPN.Controls.Add(this.SamplingIntervalLB, 0, 3);
this.ControlsPN.Controls.Add(this.TimeStepLB, 0, 11);
this.ControlsPN.Controls.Add(this.NodeIdBTN, 2, 0);
this.ControlsPN.Controls.Add(this.NodeIdTB, 1, 0);
this.ControlsPN.Controls.Add(this.StartTimeCK, 2, 4);
this.ControlsPN.Controls.Add(this.NodeIdLB, 0, 0);
this.ControlsPN.Controls.Add(this.ReturnBoundsLB, 0, 8);
this.ControlsPN.Controls.Add(this.ResampleIntervalLB, 0, 10);
this.ControlsPN.Controls.Add(this.ReadTypeCB, 1, 2);
this.ControlsPN.Controls.Add(this.EndTimeLB, 0, 5);
this.ControlsPN.Controls.Add(this.ProcessingIntervalNP, 1, 10);
this.ControlsPN.Controls.Add(this.ReadTypeLB, 0, 2);
this.ControlsPN.Controls.Add(this.AggregateCB, 1, 9);
this.ControlsPN.Controls.Add(this.StartTimeLB, 0, 4);
this.ControlsPN.Controls.Add(this.StartTimeDP, 1, 4);
this.ControlsPN.Controls.Add(this.EndTimeDP, 1, 5);
this.ControlsPN.Controls.Add(this.EndTimeCK, 2, 5);
this.ControlsPN.Controls.Add(this.AggregateLB, 0, 9);
this.ControlsPN.Controls.Add(this.MaxReturnValuesLB, 0, 6);
this.ControlsPN.Controls.Add(this.MaxReturnValuesNP, 1, 6);
this.ControlsPN.Controls.Add(this.MaxReturnValuesCK, 2, 6);
this.ControlsPN.Controls.Add(this.ReturnBoundsCK, 1, 8);
this.ControlsPN.Controls.Add(this.ResampleIntervalUnitsLB, 2, 10);
this.ControlsPN.Controls.Add(this.StatusTB, 0, 13);
this.ControlsPN.Controls.Add(this.panel1, 0, 12);
this.ControlsPN.Dock = System.Windows.Forms.DockStyle.Top;
this.ControlsPN.Location = new System.Drawing.Point(0, 0);
this.ControlsPN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.ControlsPN.Name = "ControlsPN";
this.ControlsPN.RowCount = 14;
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 110F));
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F));
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
this.ControlsPN.Size = new System.Drawing.Size(612, 748);
this.ControlsPN.TabIndex = 0;
//
// PropertyCB
//
this.PropertyCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.PropertyCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.PropertyCB.FormattingEnabled = true;
this.PropertyCB.Location = new System.Drawing.Point(236, 78);
this.PropertyCB.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.PropertyCB.Name = "PropertyCB";
this.PropertyCB.Size = new System.Drawing.Size(272, 33);
this.PropertyCB.TabIndex = 6;
//
// PropertyLB
//
this.PropertyLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.PropertyLB.AutoSize = true;
this.PropertyLB.Location = new System.Drawing.Point(6, 72);
this.PropertyLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.PropertyLB.Name = "PropertyLB";
this.PropertyLB.Size = new System.Drawing.Size(155, 45);
this.PropertyLB.TabIndex = 5;
this.PropertyLB.Text = "Property Name";
this.PropertyLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// UseSimpleBoundsCK
//
this.UseSimpleBoundsCK.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.UseSimpleBoundsCK.AutoSize = true;
this.ControlsPN.SetColumnSpan(this.UseSimpleBoundsCK, 2);
this.UseSimpleBoundsCK.Location = new System.Drawing.Point(236, 347);
this.UseSimpleBoundsCK.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.UseSimpleBoundsCK.Name = "UseSimpleBoundsCK";
this.UseSimpleBoundsCK.Size = new System.Drawing.Size(28, 27);
this.UseSimpleBoundsCK.TabIndex = 22;
this.UseSimpleBoundsCK.UseVisualStyleBackColor = true;
this.UseSimpleBoundsCK.Visible = false;
//
// UseSimpleBoundsLB
//
this.UseSimpleBoundsLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.UseSimpleBoundsLB.AutoSize = true;
this.UseSimpleBoundsLB.Location = new System.Drawing.Point(6, 341);
this.UseSimpleBoundsLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.UseSimpleBoundsLB.Name = "UseSimpleBoundsLB";
this.UseSimpleBoundsLB.Size = new System.Drawing.Size(200, 39);
this.UseSimpleBoundsLB.TabIndex = 21;
this.UseSimpleBoundsLB.Text = "Use Simple Bounds";
this.UseSimpleBoundsLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.UseSimpleBoundsLB.Visible = false;
//
// SamplingIntervalUnitsLB
//
this.SamplingIntervalUnitsLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.SamplingIntervalUnitsLB.AutoSize = true;
this.SamplingIntervalUnitsLB.Location = new System.Drawing.Point(524, 162);
this.SamplingIntervalUnitsLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.SamplingIntervalUnitsLB.Name = "SamplingIntervalUnitsLB";
this.SamplingIntervalUnitsLB.Size = new System.Drawing.Size(40, 43);
this.SamplingIntervalUnitsLB.TabIndex = 11;
this.SamplingIntervalUnitsLB.Text = "ms";
this.SamplingIntervalUnitsLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// TimeStepUnitsLB
//
this.TimeStepUnitsLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.TimeStepUnitsLB.AutoSize = true;
this.TimeStepUnitsLB.Location = new System.Drawing.Point(524, 507);
this.TimeStepUnitsLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.TimeStepUnitsLB.Name = "TimeStepUnitsLB";
this.TimeStepUnitsLB.Size = new System.Drawing.Size(40, 43);
this.TimeStepUnitsLB.TabIndex = 32;
this.TimeStepUnitsLB.Text = "ms";
this.TimeStepUnitsLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// SamplingIntervalNP
//
this.SamplingIntervalNP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.SamplingIntervalNP.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.SamplingIntervalNP.Location = new System.Drawing.Point(236, 168);
this.SamplingIntervalNP.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.SamplingIntervalNP.Maximum = new decimal(new int[] {
1000000000,
0,
0,
0});
this.SamplingIntervalNP.Name = "SamplingIntervalNP";
this.SamplingIntervalNP.Size = new System.Drawing.Size(276, 31);
this.SamplingIntervalNP.TabIndex = 10;
//
// TimeStepNP
//
this.TimeStepNP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.TimeStepNP.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.TimeStepNP.Location = new System.Drawing.Point(236, 513);
this.TimeStepNP.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.TimeStepNP.Maximum = new decimal(new int[] {
1000000000,
0,
0,
0});
this.TimeStepNP.Name = "TimeStepNP";
this.TimeStepNP.Size = new System.Drawing.Size(276, 31);
this.TimeStepNP.TabIndex = 31;
this.TimeStepNP.Value = new decimal(new int[] {
10000,
0,
0,
0});
//
// SamplingIntervalLB
//
this.SamplingIntervalLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.SamplingIntervalLB.AutoSize = true;
this.SamplingIntervalLB.Location = new System.Drawing.Point(6, 162);
this.SamplingIntervalLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.SamplingIntervalLB.Name = "SamplingIntervalLB";
this.SamplingIntervalLB.Size = new System.Drawing.Size(177, 43);
this.SamplingIntervalLB.TabIndex = 9;
this.SamplingIntervalLB.Text = "Sampling Interval";
this.SamplingIntervalLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// TimeStepLB
//
this.TimeStepLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.TimeStepLB.AutoSize = true;
this.TimeStepLB.Location = new System.Drawing.Point(6, 507);
this.TimeStepLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.TimeStepLB.Name = "TimeStepLB";
this.TimeStepLB.Size = new System.Drawing.Size(109, 43);
this.TimeStepLB.TabIndex = 30;
this.TimeStepLB.Text = "Time Step";
this.TimeStepLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// NodeIdBTN
//
this.NodeIdBTN.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeIdBTN.Location = new System.Drawing.Point(524, 6);
this.NodeIdBTN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.NodeIdBTN.Name = "NodeIdBTN";
this.NodeIdBTN.Size = new System.Drawing.Size(48, 60);
this.NodeIdBTN.TabIndex = 4;
this.NodeIdBTN.Text = "...";
this.NodeIdBTN.UseVisualStyleBackColor = true;
this.NodeIdBTN.Click += new System.EventHandler(this.NodeIdBTN_Click);
//
// NodeIdTB
//
this.NodeIdTB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeIdTB.Location = new System.Drawing.Point(236, 6);
this.NodeIdTB.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.NodeIdTB.Name = "NodeIdTB";
this.NodeIdTB.Size = new System.Drawing.Size(272, 31);
this.NodeIdTB.TabIndex = 3;
//
// StartTimeCK
//
this.StartTimeCK.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.StartTimeCK.AutoSize = true;
this.StartTimeCK.Location = new System.Drawing.Point(524, 211);
this.StartTimeCK.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.StartTimeCK.Name = "StartTimeCK";
this.StartTimeCK.Size = new System.Drawing.Size(28, 31);
this.StartTimeCK.TabIndex = 14;
this.StartTimeCK.UseVisualStyleBackColor = true;
this.StartTimeCK.CheckedChanged += new System.EventHandler(this.StartTimeCK_CheckedChanged);
//
// NodeIdLB
//
this.NodeIdLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeIdLB.AutoSize = true;
this.NodeIdLB.Location = new System.Drawing.Point(6, 0);
this.NodeIdLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.NodeIdLB.Name = "NodeIdLB";
this.NodeIdLB.Size = new System.Drawing.Size(91, 72);
this.NodeIdLB.TabIndex = 2;
this.NodeIdLB.Text = "Variable";
this.NodeIdLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ReturnBoundsLB
//
this.ReturnBoundsLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ReturnBoundsLB.AutoSize = true;
this.ReturnBoundsLB.Location = new System.Drawing.Point(6, 380);
this.ReturnBoundsLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.ReturnBoundsLB.Name = "ReturnBoundsLB";
this.ReturnBoundsLB.Size = new System.Drawing.Size(155, 39);
this.ReturnBoundsLB.TabIndex = 23;
this.ReturnBoundsLB.Text = "Return Bounds";
this.ReturnBoundsLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.ReturnBoundsLB.Visible = false;
//
// ResampleIntervalLB
//
this.ResampleIntervalLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ResampleIntervalLB.AutoSize = true;
this.ResampleIntervalLB.Location = new System.Drawing.Point(6, 464);
this.ResampleIntervalLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.ResampleIntervalLB.Name = "ResampleIntervalLB";
this.ResampleIntervalLB.Size = new System.Drawing.Size(195, 43);
this.ResampleIntervalLB.TabIndex = 27;
this.ResampleIntervalLB.Text = "Processing Interval";
this.ResampleIntervalLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ReadTypeCB
//
this.ReadTypeCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ReadTypeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ReadTypeCB.FormattingEnabled = true;
this.ReadTypeCB.Location = new System.Drawing.Point(236, 123);
this.ReadTypeCB.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.ReadTypeCB.Name = "ReadTypeCB";
this.ReadTypeCB.Size = new System.Drawing.Size(272, 33);
this.ReadTypeCB.TabIndex = 8;
this.ReadTypeCB.SelectedIndexChanged += new System.EventHandler(this.ReadTypeCB_SelectedIndexChanged);
//
// EndTimeLB
//
this.EndTimeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.EndTimeLB.AutoSize = true;
this.EndTimeLB.Location = new System.Drawing.Point(6, 248);
this.EndTimeLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.EndTimeLB.Name = "EndTimeLB";
this.EndTimeLB.Size = new System.Drawing.Size(103, 43);
this.EndTimeLB.TabIndex = 15;
this.EndTimeLB.Text = "End Time";
this.EndTimeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ProcessingIntervalNP
//
this.ProcessingIntervalNP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ProcessingIntervalNP.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.ProcessingIntervalNP.Location = new System.Drawing.Point(236, 470);
this.ProcessingIntervalNP.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.ProcessingIntervalNP.Maximum = new decimal(new int[] {
1000000000,
0,
0,
0});
this.ProcessingIntervalNP.Name = "ProcessingIntervalNP";
this.ProcessingIntervalNP.Size = new System.Drawing.Size(276, 31);
this.ProcessingIntervalNP.TabIndex = 28;
this.ProcessingIntervalNP.Value = new decimal(new int[] {
10000,
0,
0,
0});
//
// ReadTypeLB
//
this.ReadTypeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ReadTypeLB.AutoSize = true;
this.ReadTypeLB.Location = new System.Drawing.Point(6, 117);
this.ReadTypeLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.ReadTypeLB.Name = "ReadTypeLB";
this.ReadTypeLB.Size = new System.Drawing.Size(117, 45);
this.ReadTypeLB.TabIndex = 7;
this.ReadTypeLB.Text = "Read Type";
this.ReadTypeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// AggregateCB
//
this.AggregateCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.AggregateCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.AggregateCB.FormattingEnabled = true;
this.AggregateCB.Location = new System.Drawing.Point(236, 425);
this.AggregateCB.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.AggregateCB.Name = "AggregateCB";
this.AggregateCB.Size = new System.Drawing.Size(272, 33);
this.AggregateCB.TabIndex = 26;
//
// StartTimeLB
//
this.StartTimeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.StartTimeLB.AutoSize = true;
this.StartTimeLB.Location = new System.Drawing.Point(6, 205);
this.StartTimeLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.StartTimeLB.Name = "StartTimeLB";
this.StartTimeLB.Size = new System.Drawing.Size(110, 43);
this.StartTimeLB.TabIndex = 12;
this.StartTimeLB.Text = "Start Time";
this.StartTimeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// StartTimeDP
//
this.StartTimeDP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.StartTimeDP.CustomFormat = "HH:mm:ss yyyy-MM-dd";
this.StartTimeDP.Enabled = false;
this.StartTimeDP.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.StartTimeDP.Location = new System.Drawing.Point(236, 211);
this.StartTimeDP.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.StartTimeDP.Name = "StartTimeDP";
this.StartTimeDP.Size = new System.Drawing.Size(272, 31);
this.StartTimeDP.TabIndex = 13;
this.StartTimeDP.ValueChanged += new System.EventHandler(this.StartTimeDP_ValueChanged);
//
// EndTimeDP
//
this.EndTimeDP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.EndTimeDP.CustomFormat = "HH:mm:ss yyyy-MM-dd";
this.EndTimeDP.Enabled = false;
this.EndTimeDP.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.EndTimeDP.Location = new System.Drawing.Point(236, 254);
this.EndTimeDP.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.EndTimeDP.Name = "EndTimeDP";
this.EndTimeDP.Size = new System.Drawing.Size(272, 31);
this.EndTimeDP.TabIndex = 16;
this.EndTimeDP.ValueChanged += new System.EventHandler(this.StartTimeDP_ValueChanged);
//
// EndTimeCK
//
this.EndTimeCK.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.EndTimeCK.AutoSize = true;
this.EndTimeCK.Location = new System.Drawing.Point(524, 254);
this.EndTimeCK.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.EndTimeCK.Name = "EndTimeCK";
this.EndTimeCK.Size = new System.Drawing.Size(28, 31);
this.EndTimeCK.TabIndex = 17;
this.EndTimeCK.UseVisualStyleBackColor = true;
this.EndTimeCK.CheckedChanged += new System.EventHandler(this.EndTimeCK_CheckedChanged);
//
// AggregateLB
//
this.AggregateLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.AggregateLB.AutoSize = true;
this.AggregateLB.Location = new System.Drawing.Point(6, 419);
this.AggregateLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.AggregateLB.Name = "AggregateLB";
this.AggregateLB.Size = new System.Drawing.Size(111, 45);
this.AggregateLB.TabIndex = 25;
this.AggregateLB.Text = "Aggregate";
this.AggregateLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// MaxReturnValuesLB
//
this.MaxReturnValuesLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.MaxReturnValuesLB.AutoSize = true;
this.MaxReturnValuesLB.Location = new System.Drawing.Point(6, 291);
this.MaxReturnValuesLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.MaxReturnValuesLB.Name = "MaxReturnValuesLB";
this.MaxReturnValuesLB.Size = new System.Drawing.Size(131, 50);
this.MaxReturnValuesLB.TabIndex = 18;
this.MaxReturnValuesLB.Text = "Max Values Returned";
this.MaxReturnValuesLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// MaxReturnValuesNP
//
this.MaxReturnValuesNP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.MaxReturnValuesNP.Enabled = false;
this.MaxReturnValuesNP.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.MaxReturnValuesNP.Location = new System.Drawing.Point(236, 297);
this.MaxReturnValuesNP.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.MaxReturnValuesNP.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.MaxReturnValuesNP.Name = "MaxReturnValuesNP";
this.MaxReturnValuesNP.Size = new System.Drawing.Size(276, 31);
this.MaxReturnValuesNP.TabIndex = 19;
//
// MaxReturnValuesCK
//
this.MaxReturnValuesCK.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.MaxReturnValuesCK.AutoSize = true;
this.MaxReturnValuesCK.Location = new System.Drawing.Point(524, 297);
this.MaxReturnValuesCK.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.MaxReturnValuesCK.Name = "MaxReturnValuesCK";
this.MaxReturnValuesCK.Size = new System.Drawing.Size(28, 38);
this.MaxReturnValuesCK.TabIndex = 20;
this.MaxReturnValuesCK.UseVisualStyleBackColor = true;
this.MaxReturnValuesCK.CheckedChanged += new System.EventHandler(this.MaxReturnValuesCK_CheckedChanged);
//
// ReturnBoundsCK
//
this.ReturnBoundsCK.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ReturnBoundsCK.AutoSize = true;
this.ControlsPN.SetColumnSpan(this.ReturnBoundsCK, 2);
this.ReturnBoundsCK.Location = new System.Drawing.Point(236, 386);
this.ReturnBoundsCK.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.ReturnBoundsCK.Name = "ReturnBoundsCK";
this.ReturnBoundsCK.Size = new System.Drawing.Size(28, 27);
this.ReturnBoundsCK.TabIndex = 24;
this.ReturnBoundsCK.UseVisualStyleBackColor = true;
this.ReturnBoundsCK.Visible = false;
//
// ResampleIntervalUnitsLB
//
this.ResampleIntervalUnitsLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ResampleIntervalUnitsLB.AutoSize = true;
this.ResampleIntervalUnitsLB.Location = new System.Drawing.Point(524, 464);
this.ResampleIntervalUnitsLB.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.ResampleIntervalUnitsLB.Name = "ResampleIntervalUnitsLB";
this.ResampleIntervalUnitsLB.Size = new System.Drawing.Size(40, 43);
this.ResampleIntervalUnitsLB.TabIndex = 29;
this.ResampleIntervalUnitsLB.Text = "ms";
this.ResampleIntervalUnitsLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// StatusTB
//
this.StatusTB.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.StatusTB.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.ControlsPN.SetColumnSpan(this.StatusTB, 3);
this.StatusTB.Location = new System.Drawing.Point(6, 666);
this.StatusTB.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.StatusTB.Multiline = true;
this.StatusTB.Name = "StatusTB";
this.StatusTB.ReadOnly = true;
this.StatusTB.Size = new System.Drawing.Size(600, 76);
this.StatusTB.TabIndex = 34;
//
// panel1
//
this.ControlsPN.SetColumnSpan(this.panel1, 3);
this.panel1.Controls.Add(this.StopBTN);
this.panel1.Controls.Add(this.NextBTN);
this.panel1.Controls.Add(this.TimeShiftBTN);
this.panel1.Controls.Add(this.GoBTN);
this.panel1.Controls.Add(this.DetectLimitsBTN);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(6, 556);
this.panel1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(600, 98);
this.panel1.TabIndex = 33;
//
// StopBTN
//
this.StopBTN.Location = new System.Drawing.Point(416, 27);
this.StopBTN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.StopBTN.Name = "StopBTN";
this.StopBTN.Size = new System.Drawing.Size(150, 44);
this.StopBTN.TabIndex = 2;
this.StopBTN.Text = "Stop";
this.StopBTN.UseVisualStyleBackColor = true;
this.StopBTN.Click += new System.EventHandler(this.StopBTN_Click);
//
// NextBTN
//
this.NextBTN.Location = new System.Drawing.Point(226, 27);
this.NextBTN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.NextBTN.Name = "NextBTN";
this.NextBTN.Size = new System.Drawing.Size(150, 44);
this.NextBTN.TabIndex = 1;
this.NextBTN.Text = "Next";
this.NextBTN.UseVisualStyleBackColor = true;
this.NextBTN.Click += new System.EventHandler(this.NextBTN_Click);
//
// TimeShiftBTN
//
this.TimeShiftBTN.Location = new System.Drawing.Point(42, 27);
this.TimeShiftBTN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.TimeShiftBTN.Name = "TimeShiftBTN";
this.TimeShiftBTN.Size = new System.Drawing.Size(150, 44);
this.TimeShiftBTN.TabIndex = 0;
this.TimeShiftBTN.Text = "Time Shift";
this.TimeShiftBTN.UseVisualStyleBackColor = true;
this.TimeShiftBTN.Visible = false;
this.TimeShiftBTN.Click += new System.EventHandler(this.TimeShiftBTN_Click);
//
// GoBTN
//
this.GoBTN.Location = new System.Drawing.Point(226, 27);
this.GoBTN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.GoBTN.Name = "GoBTN";
this.GoBTN.Size = new System.Drawing.Size(150, 44);
this.GoBTN.TabIndex = 37;
this.GoBTN.Text = "Go";
this.GoBTN.UseVisualStyleBackColor = true;
this.GoBTN.Click += new System.EventHandler(this.GoBTN_Click);
//
// DetectLimitsBTN
//
this.DetectLimitsBTN.Location = new System.Drawing.Point(42, 27);
this.DetectLimitsBTN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.DetectLimitsBTN.Name = "DetectLimitsBTN";
this.DetectLimitsBTN.Size = new System.Drawing.Size(150, 44);
this.DetectLimitsBTN.TabIndex = 41;
this.DetectLimitsBTN.Text = "Auto Detect";
this.DetectLimitsBTN.UseVisualStyleBackColor = true;
this.DetectLimitsBTN.Click += new System.EventHandler(this.DetectLimitsBTN_Click);
//
// RightPN
//
this.RightPN.Controls.Add(this.ResultsDV);
this.RightPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.RightPN.Location = new System.Drawing.Point(612, 0);
this.RightPN.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.RightPN.Name = "RightPN";
this.RightPN.Size = new System.Drawing.Size(1310, 1096);
this.RightPN.TabIndex = 3;
//
// HistoryDataListView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.RightPN);
this.Controls.Add(this.LeftPN);
this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.Name = "HistoryDataListView";
this.Size = new System.Drawing.Size(1922, 1096);
this.PopupMenu.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ResultsDV)).EndInit();
this.LeftPN.ResumeLayout(false);
this.ControlsPN.ResumeLayout(false);
this.ControlsPN.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.SamplingIntervalNP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.TimeStepNP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ProcessingIntervalNP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MaxReturnValuesNP)).EndInit();
this.panel1.ResumeLayout(false);
this.RightPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip PopupMenu;
private System.Windows.Forms.DataGridView ResultsDV;
private System.Windows.Forms.Panel LeftPN;
private System.Windows.Forms.Panel RightPN;
private System.Windows.Forms.ToolStripMenuItem RemoveValueMI;
private System.Windows.Forms.ToolStripMenuItem AddValueMI;
private System.Windows.Forms.ToolStripMenuItem InsertAnnotationMI;
private System.Windows.Forms.ToolStripMenuItem EditValueMI;
private System.Windows.Forms.TableLayoutPanel ControlsPN;
private System.Windows.Forms.ComboBox PropertyCB;
private System.Windows.Forms.Label PropertyLB;
private System.Windows.Forms.CheckBox UseSimpleBoundsCK;
private System.Windows.Forms.Label UseSimpleBoundsLB;
private System.Windows.Forms.Label SamplingIntervalUnitsLB;
private System.Windows.Forms.Label TimeStepUnitsLB;
private System.Windows.Forms.NumericUpDown SamplingIntervalNP;
private System.Windows.Forms.NumericUpDown TimeStepNP;
private System.Windows.Forms.Label SamplingIntervalLB;
private System.Windows.Forms.Label TimeStepLB;
private System.Windows.Forms.Button NodeIdBTN;
private System.Windows.Forms.TextBox NodeIdTB;
private System.Windows.Forms.CheckBox StartTimeCK;
private System.Windows.Forms.Label NodeIdLB;
private System.Windows.Forms.Label ReturnBoundsLB;
private System.Windows.Forms.Label ResampleIntervalLB;
private System.Windows.Forms.ComboBox ReadTypeCB;
private System.Windows.Forms.Label EndTimeLB;
private System.Windows.Forms.NumericUpDown ProcessingIntervalNP;
private System.Windows.Forms.Label ReadTypeLB;
private System.Windows.Forms.ComboBox AggregateCB;
private System.Windows.Forms.Label StartTimeLB;
private System.Windows.Forms.DateTimePicker StartTimeDP;
private System.Windows.Forms.DateTimePicker EndTimeDP;
private System.Windows.Forms.CheckBox EndTimeCK;
private System.Windows.Forms.Label AggregateLB;
private System.Windows.Forms.Label MaxReturnValuesLB;
private System.Windows.Forms.NumericUpDown MaxReturnValuesNP;
private System.Windows.Forms.CheckBox MaxReturnValuesCK;
private System.Windows.Forms.CheckBox ReturnBoundsCK;
private System.Windows.Forms.Label ResampleIntervalUnitsLB;
private System.Windows.Forms.TextBox StatusTB;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button StopBTN;
private System.Windows.Forms.Button NextBTN;
private System.Windows.Forms.Button TimeShiftBTN;
private System.Windows.Forms.Button GoBTN;
private System.Windows.Forms.Button DetectLimitsBTN;
private System.Windows.Forms.ToolStripMenuItem ShowServerTimestampMI;
private System.Windows.Forms.DataGridViewTextBoxColumn SourceTimestampCH;
private System.Windows.Forms.DataGridViewTextBoxColumn ServerTimestampCH;
private System.Windows.Forms.DataGridViewTextBoxColumn ValueCH;
private System.Windows.Forms.DataGridViewTextBoxColumn StatusCodeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn HistoryInfoCH;
private System.Windows.Forms.DataGridViewTextBoxColumn UpdateTypeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn UpdateTimeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn UserNameCH;
private System.Windows.Forms.DataGridViewTextBoxColumn UpdateResultCN;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PopupMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="SourceTimestampCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ServerTimestampCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ValueCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="StatusCodeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="HistoryInfoCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UpdateTypeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UpdateTimeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UserNameCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UpdateResultCN.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
@@ -0,0 +1,500 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class HistoryEventCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.LeftPN = new System.Windows.Forms.Panel();
this.ControlsPN = new System.Windows.Forms.TableLayoutPanel();
this.panel1 = new System.Windows.Forms.Panel();
this.StopBTN = new System.Windows.Forms.Button();
this.NextBTN = new System.Windows.Forms.Button();
this.TimeShiftBTN = new System.Windows.Forms.Button();
this.GoBTN = new System.Windows.Forms.Button();
this.DetectLimitsBTN = new System.Windows.Forms.Button();
this.StatusTB = new System.Windows.Forms.TextBox();
this.TimeStepUnitsLB = new System.Windows.Forms.Label();
this.TimeStepNP = new System.Windows.Forms.NumericUpDown();
this.TimeStepLB = new System.Windows.Forms.Label();
this.NodeIdBTN = new System.Windows.Forms.Button();
this.NodeIdTB = new System.Windows.Forms.TextBox();
this.StartTimeCK = new System.Windows.Forms.CheckBox();
this.NodeIdLB = new System.Windows.Forms.Label();
this.ReadTypeCB = new System.Windows.Forms.ComboBox();
this.EndTimeLB = new System.Windows.Forms.Label();
this.ReadTypeLB = new System.Windows.Forms.Label();
this.StartTimeLB = new System.Windows.Forms.Label();
this.StartTimeDP = new System.Windows.Forms.DateTimePicker();
this.EndTimeDP = new System.Windows.Forms.DateTimePicker();
this.EndTimeCK = new System.Windows.Forms.CheckBox();
this.RightPN = new System.Windows.Forms.Panel();
this.EventsCTRL = new Opc.Ua.Client.Controls.EventListViewCtrl();
this.FilterLB = new System.Windows.Forms.Label();
this.FilterTB = new System.Windows.Forms.TextBox();
this.FilterBTN = new System.Windows.Forms.Button();
this.LeftPN.SuspendLayout();
this.ControlsPN.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.TimeStepNP)).BeginInit();
this.RightPN.SuspendLayout();
this.SuspendLayout();
//
// LeftPN
//
this.LeftPN.Controls.Add(this.ControlsPN);
this.LeftPN.Dock = System.Windows.Forms.DockStyle.Left;
this.LeftPN.Location = new System.Drawing.Point(0, 0);
this.LeftPN.Name = "LeftPN";
this.LeftPN.Size = new System.Drawing.Size(306, 400);
this.LeftPN.TabIndex = 2;
//
// ControlsPN
//
this.ControlsPN.ColumnCount = 3;
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 115F));
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.ControlsPN.Controls.Add(this.FilterTB, 1, 4);
this.ControlsPN.Controls.Add(this.FilterLB, 0, 4);
this.ControlsPN.Controls.Add(this.TimeStepUnitsLB, 2, 5);
this.ControlsPN.Controls.Add(this.TimeStepNP, 1, 5);
this.ControlsPN.Controls.Add(this.TimeStepLB, 0, 5);
this.ControlsPN.Controls.Add(this.NodeIdBTN, 2, 0);
this.ControlsPN.Controls.Add(this.NodeIdTB, 1, 0);
this.ControlsPN.Controls.Add(this.StartTimeCK, 2, 2);
this.ControlsPN.Controls.Add(this.NodeIdLB, 0, 0);
this.ControlsPN.Controls.Add(this.ReadTypeCB, 1, 1);
this.ControlsPN.Controls.Add(this.EndTimeLB, 0, 3);
this.ControlsPN.Controls.Add(this.ReadTypeLB, 0, 1);
this.ControlsPN.Controls.Add(this.StartTimeLB, 0, 2);
this.ControlsPN.Controls.Add(this.StartTimeDP, 1, 2);
this.ControlsPN.Controls.Add(this.EndTimeDP, 1, 3);
this.ControlsPN.Controls.Add(this.EndTimeCK, 2, 3);
this.ControlsPN.Controls.Add(this.StatusTB, 0, 7);
this.ControlsPN.Controls.Add(this.panel1, 0, 6);
this.ControlsPN.Controls.Add(this.FilterBTN, 2, 4);
this.ControlsPN.Dock = System.Windows.Forms.DockStyle.Top;
this.ControlsPN.Location = new System.Drawing.Point(0, 0);
this.ControlsPN.Name = "ControlsPN";
this.ControlsPN.RowCount = 8;
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 57F));
this.ControlsPN.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F));
this.ControlsPN.Size = new System.Drawing.Size(306, 389);
this.ControlsPN.TabIndex = 0;
//
// panel1
//
this.ControlsPN.SetColumnSpan(this.panel1, 3);
this.panel1.Controls.Add(this.StopBTN);
this.panel1.Controls.Add(this.NextBTN);
this.panel1.Controls.Add(this.TimeShiftBTN);
this.panel1.Controls.Add(this.GoBTN);
this.panel1.Controls.Add(this.DetectLimitsBTN);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 160);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(300, 51);
this.panel1.TabIndex = 33;
//
// StopBTN
//
this.StopBTN.Location = new System.Drawing.Point(208, 14);
this.StopBTN.Name = "StopBTN";
this.StopBTN.Size = new System.Drawing.Size(75, 23);
this.StopBTN.TabIndex = 2;
this.StopBTN.Text = "Stop";
this.StopBTN.UseVisualStyleBackColor = true;
//
// NextBTN
//
this.NextBTN.Location = new System.Drawing.Point(113, 14);
this.NextBTN.Name = "NextBTN";
this.NextBTN.Size = new System.Drawing.Size(75, 23);
this.NextBTN.TabIndex = 1;
this.NextBTN.Text = "Next";
this.NextBTN.UseVisualStyleBackColor = true;
this.NextBTN.Click += new System.EventHandler(this.NextBTN_Click);
//
// TimeShiftBTN
//
this.TimeShiftBTN.Location = new System.Drawing.Point(21, 14);
this.TimeShiftBTN.Name = "TimeShiftBTN";
this.TimeShiftBTN.Size = new System.Drawing.Size(75, 23);
this.TimeShiftBTN.TabIndex = 0;
this.TimeShiftBTN.Text = "Time Shift";
this.TimeShiftBTN.UseVisualStyleBackColor = true;
this.TimeShiftBTN.Visible = false;
this.TimeShiftBTN.Click += new System.EventHandler(this.TimeShiftBTN_Click);
//
// GoBTN
//
this.GoBTN.Location = new System.Drawing.Point(113, 14);
this.GoBTN.Name = "GoBTN";
this.GoBTN.Size = new System.Drawing.Size(75, 23);
this.GoBTN.TabIndex = 37;
this.GoBTN.Text = "Go";
this.GoBTN.UseVisualStyleBackColor = true;
this.GoBTN.Click += new System.EventHandler(this.GoBTN_Click);
//
// DetectLimitsBTN
//
this.DetectLimitsBTN.Location = new System.Drawing.Point(21, 14);
this.DetectLimitsBTN.Name = "DetectLimitsBTN";
this.DetectLimitsBTN.Size = new System.Drawing.Size(75, 23);
this.DetectLimitsBTN.TabIndex = 41;
this.DetectLimitsBTN.Text = "Auto Detect";
this.DetectLimitsBTN.UseVisualStyleBackColor = true;
//
// StatusTB
//
this.StatusTB.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.StatusTB.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.ControlsPN.SetColumnSpan(this.StatusTB, 3);
this.StatusTB.Location = new System.Drawing.Point(3, 217);
this.StatusTB.Multiline = true;
this.StatusTB.Name = "StatusTB";
this.StatusTB.ReadOnly = true;
this.StatusTB.Size = new System.Drawing.Size(300, 169);
this.StatusTB.TabIndex = 34;
//
// TimeStepUnitsLB
//
this.TimeStepUnitsLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.TimeStepUnitsLB.AutoSize = true;
this.TimeStepUnitsLB.Location = new System.Drawing.Point(262, 131);
this.TimeStepUnitsLB.Name = "TimeStepUnitsLB";
this.TimeStepUnitsLB.Size = new System.Drawing.Size(20, 26);
this.TimeStepUnitsLB.TabIndex = 32;
this.TimeStepUnitsLB.Text = "ms";
this.TimeStepUnitsLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// TimeStepNP
//
this.TimeStepNP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.TimeStepNP.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.TimeStepNP.Location = new System.Drawing.Point(118, 134);
this.TimeStepNP.Maximum = new decimal(new int[] {
1000000000,
0,
0,
0});
this.TimeStepNP.Name = "TimeStepNP";
this.TimeStepNP.Size = new System.Drawing.Size(138, 20);
this.TimeStepNP.TabIndex = 31;
this.TimeStepNP.Value = new decimal(new int[] {
10000,
0,
0,
0});
//
// TimeStepLB
//
this.TimeStepLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.TimeStepLB.AutoSize = true;
this.TimeStepLB.Location = new System.Drawing.Point(3, 131);
this.TimeStepLB.Name = "TimeStepLB";
this.TimeStepLB.Size = new System.Drawing.Size(55, 26);
this.TimeStepLB.TabIndex = 30;
this.TimeStepLB.Text = "Time Step";
this.TimeStepLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// NodeIdBTN
//
this.NodeIdBTN.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeIdBTN.Location = new System.Drawing.Point(262, 1);
this.NodeIdBTN.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.NodeIdBTN.Name = "NodeIdBTN";
this.NodeIdBTN.Size = new System.Drawing.Size(24, 24);
this.NodeIdBTN.TabIndex = 4;
this.NodeIdBTN.Text = "...";
this.NodeIdBTN.UseVisualStyleBackColor = true;
this.NodeIdBTN.Click += new System.EventHandler(this.NodeIdBTN_Click);
//
// NodeIdTB
//
this.NodeIdTB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeIdTB.Location = new System.Drawing.Point(118, 3);
this.NodeIdTB.Name = "NodeIdTB";
this.NodeIdTB.Size = new System.Drawing.Size(138, 20);
this.NodeIdTB.TabIndex = 3;
//
// StartTimeCK
//
this.StartTimeCK.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.StartTimeCK.AutoSize = true;
this.StartTimeCK.Location = new System.Drawing.Point(262, 56);
this.StartTimeCK.Name = "StartTimeCK";
this.StartTimeCK.Size = new System.Drawing.Size(15, 20);
this.StartTimeCK.TabIndex = 14;
this.StartTimeCK.UseVisualStyleBackColor = true;
this.StartTimeCK.CheckedChanged += new System.EventHandler(this.StartTimeCK_CheckedChanged);
//
// NodeIdLB
//
this.NodeIdLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.NodeIdLB.AutoSize = true;
this.NodeIdLB.Location = new System.Drawing.Point(3, 0);
this.NodeIdLB.Name = "NodeIdLB";
this.NodeIdLB.Size = new System.Drawing.Size(40, 26);
this.NodeIdLB.TabIndex = 2;
this.NodeIdLB.Text = "Notifier";
this.NodeIdLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ReadTypeCB
//
this.ReadTypeCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ReadTypeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ReadTypeCB.FormattingEnabled = true;
this.ReadTypeCB.Location = new System.Drawing.Point(118, 29);
this.ReadTypeCB.Name = "ReadTypeCB";
this.ReadTypeCB.Size = new System.Drawing.Size(138, 21);
this.ReadTypeCB.TabIndex = 8;
this.ReadTypeCB.SelectedIndexChanged += new System.EventHandler(this.ReadTypeCB_SelectedIndexChanged);
//
// EndTimeLB
//
this.EndTimeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.EndTimeLB.AutoSize = true;
this.EndTimeLB.Location = new System.Drawing.Point(3, 79);
this.EndTimeLB.Name = "EndTimeLB";
this.EndTimeLB.Size = new System.Drawing.Size(52, 26);
this.EndTimeLB.TabIndex = 15;
this.EndTimeLB.Text = "End Time";
this.EndTimeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ReadTypeLB
//
this.ReadTypeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ReadTypeLB.AutoSize = true;
this.ReadTypeLB.Location = new System.Drawing.Point(3, 26);
this.ReadTypeLB.Name = "ReadTypeLB";
this.ReadTypeLB.Size = new System.Drawing.Size(60, 27);
this.ReadTypeLB.TabIndex = 7;
this.ReadTypeLB.Text = "Read Type";
this.ReadTypeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// StartTimeLB
//
this.StartTimeLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.StartTimeLB.AutoSize = true;
this.StartTimeLB.Location = new System.Drawing.Point(3, 53);
this.StartTimeLB.Name = "StartTimeLB";
this.StartTimeLB.Size = new System.Drawing.Size(55, 26);
this.StartTimeLB.TabIndex = 12;
this.StartTimeLB.Text = "Start Time";
this.StartTimeLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// StartTimeDP
//
this.StartTimeDP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.StartTimeDP.CustomFormat = "HH:mm:ss yyyy-MM-dd";
this.StartTimeDP.Enabled = false;
this.StartTimeDP.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.StartTimeDP.Location = new System.Drawing.Point(118, 56);
this.StartTimeDP.Name = "StartTimeDP";
this.StartTimeDP.Size = new System.Drawing.Size(138, 20);
this.StartTimeDP.TabIndex = 13;
this.StartTimeDP.ValueChanged += new System.EventHandler(this.StartTimeDP_ValueChanged);
//
// EndTimeDP
//
this.EndTimeDP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.EndTimeDP.CustomFormat = "HH:mm:ss yyyy-MM-dd";
this.EndTimeDP.Enabled = false;
this.EndTimeDP.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.EndTimeDP.Location = new System.Drawing.Point(118, 82);
this.EndTimeDP.Name = "EndTimeDP";
this.EndTimeDP.Size = new System.Drawing.Size(138, 20);
this.EndTimeDP.TabIndex = 16;
this.EndTimeDP.ValueChanged += new System.EventHandler(this.StartTimeDP_ValueChanged);
//
// EndTimeCK
//
this.EndTimeCK.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.EndTimeCK.AutoSize = true;
this.EndTimeCK.Location = new System.Drawing.Point(262, 82);
this.EndTimeCK.Name = "EndTimeCK";
this.EndTimeCK.Size = new System.Drawing.Size(15, 20);
this.EndTimeCK.TabIndex = 17;
this.EndTimeCK.UseVisualStyleBackColor = true;
this.EndTimeCK.CheckedChanged += new System.EventHandler(this.EndTimeCK_CheckedChanged);
//
// RightPN
//
this.RightPN.Controls.Add(this.EventsCTRL);
this.RightPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.RightPN.Location = new System.Drawing.Point(306, 0);
this.RightPN.Name = "RightPN";
this.RightPN.Size = new System.Drawing.Size(494, 400);
this.RightPN.TabIndex = 3;
//
// EventsCTRL
//
this.EventsCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.EventsCTRL.Location = new System.Drawing.Point(0, 0);
this.EventsCTRL.Name = "EventsCTRL";
this.EventsCTRL.Size = new System.Drawing.Size(494, 400);
this.EventsCTRL.TabIndex = 0;
//
// FilterLB
//
this.FilterLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.FilterLB.AutoSize = true;
this.FilterLB.Location = new System.Drawing.Point(3, 105);
this.FilterLB.Name = "FilterLB";
this.FilterLB.Size = new System.Drawing.Size(29, 26);
this.FilterLB.TabIndex = 35;
this.FilterLB.Text = "Filter";
this.FilterLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// FilterTB
//
this.FilterTB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.FilterTB.Location = new System.Drawing.Point(118, 108);
this.FilterTB.Name = "FilterTB";
this.FilterTB.Size = new System.Drawing.Size(138, 20);
this.FilterTB.TabIndex = 36;
//
// FilterBTN
//
this.FilterBTN.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.FilterBTN.Location = new System.Drawing.Point(262, 106);
this.FilterBTN.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.FilterBTN.Name = "FilterBTN";
this.FilterBTN.Size = new System.Drawing.Size(24, 24);
this.FilterBTN.TabIndex = 37;
this.FilterBTN.Text = "...";
this.FilterBTN.UseVisualStyleBackColor = true;
//
// HistoryEventCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.RightPN);
this.Controls.Add(this.LeftPN);
this.Name = "HistoryEventCtrl";
this.Size = new System.Drawing.Size(800, 400);
this.LeftPN.ResumeLayout(false);
this.ControlsPN.ResumeLayout(false);
this.ControlsPN.PerformLayout();
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.TimeStepNP)).EndInit();
this.RightPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel LeftPN;
private System.Windows.Forms.Panel RightPN;
private System.Windows.Forms.TableLayoutPanel ControlsPN;
private System.Windows.Forms.Label TimeStepUnitsLB;
private System.Windows.Forms.NumericUpDown TimeStepNP;
private System.Windows.Forms.Label TimeStepLB;
private System.Windows.Forms.Button NodeIdBTN;
private System.Windows.Forms.TextBox NodeIdTB;
private System.Windows.Forms.CheckBox StartTimeCK;
private System.Windows.Forms.Label NodeIdLB;
private System.Windows.Forms.ComboBox ReadTypeCB;
private System.Windows.Forms.Label EndTimeLB;
private System.Windows.Forms.Label ReadTypeLB;
private System.Windows.Forms.Label StartTimeLB;
private System.Windows.Forms.DateTimePicker StartTimeDP;
private System.Windows.Forms.DateTimePicker EndTimeDP;
private System.Windows.Forms.CheckBox EndTimeCK;
private System.Windows.Forms.TextBox StatusTB;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button StopBTN;
private System.Windows.Forms.Button NextBTN;
private System.Windows.Forms.Button TimeShiftBTN;
private System.Windows.Forms.Button GoBTN;
private System.Windows.Forms.Button DetectLimitsBTN;
private EventListViewCtrl EventsCTRL;
private System.Windows.Forms.TextBox FilterTB;
private System.Windows.Forms.Label FilterLB;
private System.Windows.Forms.Button FilterBTN;
}
}
@@ -0,0 +1,464 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays the results from a history read operation.
/// </summary>
public partial class HistoryEventCtrl : UserControl
{
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
public HistoryEventCtrl()
{
InitializeComponent();
LeftPN.Enabled = false;
ReadTypeCB.Items.Add(HistoryOperation.Read);
ReadTypeCB.Items.Add(HistoryOperation.Update);
ReadTypeCB.Items.Add(HistoryOperation.Delete);
ReadTypeCB.SelectedIndex = 0;
}
#endregion
#region HistoryOperation Enumeration
/// <summary>
/// The available history operations.
/// </summary>
public enum HistoryOperation
{
/// <summary>
/// Read raw data.
/// </summary>
Read,
/// <summary>
/// Read modified data.
/// </summary>
Update,
/// <summary>
/// Read data at the specified times.
/// </summary>
Delete,
}
#endregion
#region Private Fields
private Session m_session;
private NodeId m_nodeId;
#endregion
#region Public Members
/// <summary>
/// The node id to use.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public NodeId NodeId
{
get
{
return m_nodeId;
}
set
{
m_nodeId = value;
if (m_session != null)
{
NodeIdTB.Text = m_session.NodeCache.GetDisplayText(m_nodeId);
}
else
{
if (NodeId.IsNull(m_nodeId))
{
NodeIdTB.Text = String.Empty;
}
else
{
NodeIdTB.Text = m_nodeId.ToString();
}
}
}
}
/// <summary>
/// The type of read operation.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public HistoryOperation Operation
{
get { return (HistoryOperation)ReadTypeCB.SelectedItem; }
set { ReadTypeCB.SelectedItem = value; }
}
/// <summary>
/// The start time for the query.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public DateTime StartTime
{
get
{
if (StartTimeCK.Checked)
{
return DateTime.MinValue;
}
return StartTimeDP.Value;
}
set
{
if (value < Utils.TimeBase)
{
StartTimeCK.Checked = false;
return;
}
if (value.Kind == DateTimeKind.Local)
{
value = value.ToUniversalTime();
}
StartTimeCK.Checked = true;
StartTimeDP.Value = value;
}
}
/// <summary>
/// The end time for the query.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public DateTime EndTime
{
get
{
if (EndTimeCK.Checked)
{
return DateTime.MinValue;
}
return EndTimeDP.Value;
}
set
{
if (value < Utils.TimeBase)
{
EndTimeCK.Checked = false;
return;
}
if (value.Kind == DateTimeKind.Local)
{
value = value.ToUniversalTime();
}
EndTimeCK.Checked = true;
EndTimeDP.Value = value;
}
}
/// <summary>
/// Changes the session.
/// </summary>
public void ChangeSession(Session session)
{
m_session = session;
LeftPN.Enabled = m_session != null;
}
/// <summary>
/// Updates the control after the session has reconnected.
/// </summary>
public void SessionReconnected(Session session)
{
m_session = session;
}
/// <summary>
/// Changes the node monitored by the control.
/// </summary>
public void ChangeNode(NodeId nodeId)
{
m_nodeId = nodeId;
NodeIdTB.Text = m_session.NodeCache.GetDisplayText(m_nodeId);
}
/// <summary>
/// A kludge to get around the stupid designer that keeps setting property values to bogus defaults.
/// </summary>
public void Reset()
{
NodeId = null;
Operation = HistoryOperation.Read;
StartTime = DateTime.MinValue;
EndTime = DateTime.MinValue;
StartTimeCK.Checked = true;
EndTimeCK.Checked = false;
}
#endregion
#region Private Methods
/// <summary>
/// Recursively collects the variables in a NodeState and returns a collection of BrowsePaths.
/// </summary>
public void GetBrowsePathFromNodeState(
ISystemContext context,
NodeId rootId,
NodeState parent,
RelativePath parentPath,
BrowsePathCollection browsePaths)
{
List<BaseInstanceState> children = new List<BaseInstanceState>();
parent.GetChildren(context, children);
for (int ii = 0; ii < children.Count; ii++)
{
BaseInstanceState child = children[ii];
BrowsePath browsePath = new BrowsePath();
browsePath.StartingNode = rootId;
browsePath.Handle = child;
if (parentPath != null)
{
browsePath.RelativePath.Elements.AddRange(parentPath.Elements);
}
RelativePathElement element = new RelativePathElement();
element.ReferenceTypeId = child.ReferenceTypeId;
element.IsInverse = false;
element.IncludeSubtypes = false;
element.TargetName = child.BrowseName;
browsePath.RelativePath.Elements.Add(element);
if (child.NodeClass == NodeClass.Variable)
{
browsePaths.Add(browsePath);
}
GetBrowsePathFromNodeState(context, rootId, child, browsePath.RelativePath, browsePaths);
}
}
private void NodeIdBTN_Click(object sender, EventArgs e)
{
try
{
if (m_session == null)
{
return;
}
ReferenceDescription reference = new SelectNodeDlg().ShowDialog(
m_session,
Opc.Ua.ObjectIds.Server,
null,
"Select Notifier",
Opc.Ua.ReferenceTypeIds.HasNotifier);
if (reference == null)
{
return;
}
if (reference.NodeId != m_nodeId)
{
ChangeNode((NodeId)reference.NodeId);
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void GoBTN_Click(object sender, EventArgs e)
{
try
{
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void NextBTN_Click(object sender, EventArgs e)
{
try
{
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void ReadTypeCB_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
HistoryOperation operation = (HistoryOperation)ReadTypeCB.SelectedItem;
switch (operation)
{
case HistoryOperation.Read:
{
StartTimeLB.Visible = true;
StartTimeDP.Visible = true;
StartTimeCK.Visible = true;
StartTimeCK.Enabled = true;
StartTimeCK.Checked = true;
EndTimeLB.Visible = true;
EndTimeDP.Visible = true;
EndTimeCK.Visible = true;
EndTimeCK.Enabled = true;
TimeStepLB.Visible = false;
TimeStepNP.Visible = false;
TimeStepUnitsLB.Visible = false;
TimeShiftBTN.Visible = false;
break;
}
case HistoryOperation.Update:
{
StartTimeLB.Visible = true;
StartTimeDP.Visible = true;
StartTimeCK.Visible = true;
StartTimeCK.Enabled = true;
StartTimeCK.Checked = true;
EndTimeLB.Visible = true;
EndTimeDP.Visible = true;
EndTimeCK.Visible = true;
EndTimeCK.Enabled = true;
TimeStepLB.Visible = false;
TimeStepNP.Visible = false;
TimeStepUnitsLB.Visible = false;
TimeShiftBTN.Visible = false;
break;
}
case HistoryOperation.Delete:
{
StartTimeLB.Visible = true;
StartTimeDP.Visible = true;
StartTimeCK.Visible = true;
StartTimeCK.Enabled = false;
StartTimeCK.Checked = true;
EndTimeLB.Visible = true;
EndTimeDP.Visible = true;
EndTimeCK.Visible = true;
EndTimeCK.Enabled = false;
EndTimeCK.Checked = true;
TimeStepLB.Visible = false;
TimeStepNP.Visible = false;
TimeStepUnitsLB.Visible = false;
TimeShiftBTN.Visible = false;
break;
}
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
#region Event Handlers
private void StartTimeDP_ValueChanged(object sender, EventArgs e)
{
try
{
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void StartTimeCK_CheckedChanged(object sender, EventArgs e)
{
try
{
StartTimeDP.Enabled = StartTimeCK.Checked;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void EndTimeCK_CheckedChanged(object sender, EventArgs e)
{
try
{
EndTimeDP.Enabled = EndTimeCK.Checked;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void TimeShiftBTN_Click(object sender, EventArgs e)
{
try
{
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,48 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// An interface for forms that use a session.
/// </summary>
public interface ISessionForm
{
/// <summary>
/// Changes the session being used by the form.
/// </summary>
/// <param name="session">The new session to use. A null value means the session has been disconnected.</param>
void ChangeSession(Session session);
}
}
@@ -0,0 +1,147 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class ReadRequestDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ButtonPN = new System.Windows.Forms.FlowLayoutPanel();
this.CloseBTN = new System.Windows.Forms.Button();
this.ReadBTN = new System.Windows.Forms.Button();
this.BackBTN = new System.Windows.Forms.Button();
this.ReadRequestCTRL = new Opc.Ua.Client.Controls.ReadRequestListViewCtrl();
this.ButtonPN.SuspendLayout();
this.SuspendLayout();
//
// ButtonPN
//
this.ButtonPN.Controls.Add(this.CloseBTN);
this.ButtonPN.Controls.Add(this.ReadBTN);
this.ButtonPN.Controls.Add(this.BackBTN);
this.ButtonPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ButtonPN.Location = new System.Drawing.Point(0, 233);
this.ButtonPN.Name = "ButtonPN";
this.ButtonPN.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.ButtonPN.Size = new System.Drawing.Size(784, 29);
this.ButtonPN.TabIndex = 1;
//
// CloseBTN
//
this.CloseBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CloseBTN.Location = new System.Drawing.Point(706, 3);
this.CloseBTN.Name = "CloseBTN";
this.CloseBTN.Size = new System.Drawing.Size(75, 23);
this.CloseBTN.TabIndex = 0;
this.CloseBTN.Text = "Close";
this.CloseBTN.UseVisualStyleBackColor = true;
this.CloseBTN.Click += new System.EventHandler(this.CloseBTN_Click);
//
// ReadBTN
//
this.ReadBTN.Location = new System.Drawing.Point(625, 3);
this.ReadBTN.Name = "ReadBTN";
this.ReadBTN.Size = new System.Drawing.Size(75, 23);
this.ReadBTN.TabIndex = 1;
this.ReadBTN.Text = "Read";
this.ReadBTN.UseVisualStyleBackColor = true;
this.ReadBTN.Click += new System.EventHandler(this.ReadBTN_Click);
//
// BackBTN
//
this.BackBTN.Location = new System.Drawing.Point(544, 3);
this.BackBTN.Name = "BackBTN";
this.BackBTN.Size = new System.Drawing.Size(75, 23);
this.BackBTN.TabIndex = 2;
this.BackBTN.Text = "Back";
this.BackBTN.UseVisualStyleBackColor = true;
this.BackBTN.Visible = false;
this.BackBTN.Click += new System.EventHandler(this.BackBTN_Click);
//
// ReadRequestCTRL
//
this.ReadRequestCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReadRequestCTRL.Location = new System.Drawing.Point(0, 0);
this.ReadRequestCTRL.Name = "ReadRequestCTRL";
this.ReadRequestCTRL.Size = new System.Drawing.Size(784, 233);
this.ReadRequestCTRL.TabIndex = 0;
//
// ReadRequestDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(784, 262);
this.Controls.Add(this.ReadRequestCTRL);
this.Controls.Add(this.ButtonPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ReadRequestDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Read Attribute Values";
this.ButtonPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private ReadRequestListViewCtrl ReadRequestCTRL;
private System.Windows.Forms.FlowLayoutPanel ButtonPN;
private System.Windows.Forms.Button CloseBTN;
private System.Windows.Forms.Button ReadBTN;
private System.Windows.Forms.Button BackBTN;
}
}
@@ -0,0 +1,128 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Allows the user to edit and issue read requests.
/// </summary>
public partial class ReadRequestDlg : Form, ISessionForm
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public ReadRequestDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
}
#endregion
#region Private Fields
#endregion
#region Public Interface
/// <summary>
/// Changes the session used for the read request.
/// </summary>
public void ChangeSession(Session session)
{
ReadRequestCTRL.ChangeSession(session);
}
/// <summary>
/// Adds the nodes to the read request.
/// </summary>
public void AddNodes(params ReadValueId[] nodesToRead)
{
ReadRequestCTRL.AddNodes(nodesToRead);
}
#endregion
#region Private Methods
#endregion
#region Event Handlers
private void ReadBTN_Click(object sender, EventArgs e)
{
try
{
ReadRequestCTRL.Read();
BackBTN.Visible = true;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void BackBTN_Click(object sender, EventArgs e)
{
try
{
ReadRequestCTRL.Back();
BackBTN.Visible = false;
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void CloseBTN_Click(object sender, EventArgs e)
{
try
{
if (this.Modal)
{
DialogResult = DialogResult.Cancel;
}
else
{
this.Close();
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,283 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class ReadRequestListViewCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.PopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.EditMI = new System.Windows.Forms.ToolStripMenuItem();
this.ResultsDV = new System.Windows.Forms.DataGridView();
this.Icon = new System.Windows.Forms.DataGridViewImageColumn();
this.NodeNameCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.AttributeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.IndexRangeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DataEncodingCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DataTypeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ValueCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StatusCodeCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SourceTimestampCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ServerTimestampCH = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RightPN = new System.Windows.Forms.Panel();
this.ImageList = new System.Windows.Forms.ImageList(this.components);
this.DeleteMI = new System.Windows.Forms.ToolStripMenuItem();
this.NewMI = new System.Windows.Forms.ToolStripMenuItem();
this.PopupMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ResultsDV)).BeginInit();
this.RightPN.SuspendLayout();
this.SuspendLayout();
//
// PopupMenu
//
this.PopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.NewMI,
this.EditMI,
this.DeleteMI});
this.PopupMenu.Name = "PopupMenu";
this.PopupMenu.Size = new System.Drawing.Size(153, 92);
this.PopupMenu.Opening += new System.ComponentModel.CancelEventHandler(this.PopupMenu_Opening);
//
// EditMI
//
this.EditMI.Name = "EditMI";
this.EditMI.Size = new System.Drawing.Size(152, 22);
this.EditMI.Text = "Edit...";
this.EditMI.Click += new System.EventHandler(this.EditMI_Click);
//
// ResultsDV
//
this.ResultsDV.AllowUserToAddRows = false;
this.ResultsDV.AllowUserToDeleteRows = false;
this.ResultsDV.AllowUserToResizeRows = false;
this.ResultsDV.BackgroundColor = System.Drawing.SystemColors.Window;
this.ResultsDV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.ResultsDV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Icon,
this.NodeNameCH,
this.AttributeCH,
this.IndexRangeCH,
this.DataEncodingCH,
this.DataTypeCH,
this.ValueCH,
this.StatusCodeCH,
this.SourceTimestampCH,
this.ServerTimestampCH});
this.ResultsDV.ContextMenuStrip = this.PopupMenu;
this.ResultsDV.Dock = System.Windows.Forms.DockStyle.Fill;
this.ResultsDV.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.ResultsDV.Location = new System.Drawing.Point(0, 0);
this.ResultsDV.Name = "ResultsDV";
this.ResultsDV.RowHeadersVisible = false;
this.ResultsDV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.ResultsDV.Size = new System.Drawing.Size(754, 346);
this.ResultsDV.TabIndex = 0;
this.ResultsDV.DoubleClick += new System.EventHandler(this.EditMI_Click);
//
// Icon
//
this.Icon.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.Icon.DataPropertyName = "Icon";
this.Icon.HeaderText = "";
this.Icon.Name = "Icon";
this.Icon.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Icon.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.Icon.Width = 19;
//
// NodeNameCH
//
this.NodeNameCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.NodeNameCH.DataPropertyName = "NodeName";
this.NodeNameCH.HeaderText = "Node";
this.NodeNameCH.Name = "NodeNameCH";
this.NodeNameCH.ReadOnly = true;
this.NodeNameCH.Width = 58;
//
// AttributeCH
//
this.AttributeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.AttributeCH.DataPropertyName = "Attribute";
this.AttributeCH.HeaderText = "Attribute";
this.AttributeCH.Name = "AttributeCH";
this.AttributeCH.ReadOnly = true;
this.AttributeCH.Width = 71;
//
// IndexRangeCH
//
this.IndexRangeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.IndexRangeCH.DataPropertyName = "IndexRange";
this.IndexRangeCH.HeaderText = "Index Range";
this.IndexRangeCH.Name = "IndexRangeCH";
this.IndexRangeCH.ReadOnly = true;
this.IndexRangeCH.Width = 93;
//
// DataEncodingCH
//
this.DataEncodingCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.DataEncodingCH.DataPropertyName = "DataEncoding";
this.DataEncodingCH.HeaderText = "Data Encoding";
this.DataEncodingCH.Name = "DataEncodingCH";
this.DataEncodingCH.ReadOnly = true;
this.DataEncodingCH.Resizable = System.Windows.Forms.DataGridViewTriState.True;
//
// DataTypeCH
//
this.DataTypeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.DataTypeCH.DataPropertyName = "DataType";
this.DataTypeCH.HeaderText = "Data Type";
this.DataTypeCH.Name = "DataTypeCH";
this.DataTypeCH.ReadOnly = true;
this.DataTypeCH.Width = 82;
//
// ValueCH
//
this.ValueCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.ValueCH.DataPropertyName = "Value";
this.ValueCH.HeaderText = "Value";
this.ValueCH.Name = "ValueCH";
this.ValueCH.ReadOnly = true;
this.ValueCH.Visible = false;
//
// StatusCodeCH
//
this.StatusCodeCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.StatusCodeCH.DataPropertyName = "StatusCode";
this.StatusCodeCH.HeaderText = "StatusCode";
this.StatusCodeCH.Name = "StatusCodeCH";
this.StatusCodeCH.ReadOnly = true;
this.StatusCodeCH.Visible = false;
//
// SourceTimestampCH
//
this.SourceTimestampCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.SourceTimestampCH.DataPropertyName = "SourceTimestamp";
this.SourceTimestampCH.HeaderText = "SourceTimestamp";
this.SourceTimestampCH.Name = "SourceTimestampCH";
this.SourceTimestampCH.ReadOnly = true;
this.SourceTimestampCH.Visible = false;
//
// ServerTimestampCH
//
this.ServerTimestampCH.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.ServerTimestampCH.DataPropertyName = "ServerTimestamp";
this.ServerTimestampCH.HeaderText = "ServerTimestamp";
this.ServerTimestampCH.Name = "ServerTimestampCH";
this.ServerTimestampCH.ReadOnly = true;
this.ServerTimestampCH.Visible = false;
//
// RightPN
//
this.RightPN.Controls.Add(this.ResultsDV);
this.RightPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.RightPN.Location = new System.Drawing.Point(0, 0);
this.RightPN.Name = "RightPN";
this.RightPN.Size = new System.Drawing.Size(754, 346);
this.RightPN.TabIndex = 3;
//
// ImageList
//
this.ImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.ImageList.ImageSize = new System.Drawing.Size(16, 16);
this.ImageList.TransparentColor = System.Drawing.Color.White;
//
// DeleteMI
//
this.DeleteMI.Name = "DeleteMI";
this.DeleteMI.Size = new System.Drawing.Size(152, 22);
this.DeleteMI.Text = "Delete";
this.DeleteMI.Click += new System.EventHandler(this.DeleteMI_Click);
//
// NewMI
//
this.NewMI.Name = "NewMI";
this.NewMI.Size = new System.Drawing.Size(152, 22);
this.NewMI.Text = "New...";
this.NewMI.Click += new System.EventHandler(this.NewMI_Click);
//
// ReadRequestListView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.RightPN);
this.Name = "ReadRequestListView";
this.Size = new System.Drawing.Size(754, 346);
this.PopupMenu.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ResultsDV)).EndInit();
this.RightPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip PopupMenu;
private System.Windows.Forms.DataGridView ResultsDV;
private System.Windows.Forms.Panel RightPN;
private System.Windows.Forms.ToolStripMenuItem EditMI;
private System.Windows.Forms.ImageList ImageList;
private System.Windows.Forms.DataGridViewImageColumn Icon;
private System.Windows.Forms.DataGridViewTextBoxColumn NodeNameCH;
private System.Windows.Forms.DataGridViewTextBoxColumn AttributeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn IndexRangeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn DataEncodingCH;
private System.Windows.Forms.DataGridViewTextBoxColumn DataTypeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn ValueCH;
private System.Windows.Forms.DataGridViewTextBoxColumn StatusCodeCH;
private System.Windows.Forms.DataGridViewTextBoxColumn SourceTimestampCH;
private System.Windows.Forms.DataGridViewTextBoxColumn ServerTimestampCH;
private System.Windows.Forms.ToolStripMenuItem NewMI;
private System.Windows.Forms.ToolStripMenuItem DeleteMI;
}
}
@@ -0,0 +1,343 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Displays the results from a history read operation.
/// </summary>
public partial class ReadRequestListViewCtrl : UserControl
{
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
public ReadRequestListViewCtrl()
{
InitializeComponent();
ResultsDV.AutoGenerateColumns = false;
ImageList = new ClientUtils().ImageList;
m_dataset = new DataSet();
m_dataset.Tables.Add("Requests");
m_dataset.Tables[0].Columns.Add("ReadValueId", typeof(ReadValueId));
m_dataset.Tables[0].Columns.Add("Icon", typeof(Image));
m_dataset.Tables[0].Columns.Add("NodeName", typeof(string));
m_dataset.Tables[0].Columns.Add("Attribute", typeof(string));
m_dataset.Tables[0].Columns.Add("IndexRange", typeof(string));
m_dataset.Tables[0].Columns.Add("DataEncoding", typeof(QualifiedName));
m_dataset.Tables[0].Columns.Add("DataValue", typeof(DataValue));
m_dataset.Tables[0].Columns.Add("DataType", typeof(string));
m_dataset.Tables[0].Columns.Add("Value", typeof(Variant));
m_dataset.Tables[0].Columns.Add("StatusCode", typeof(StatusCode));
m_dataset.Tables[0].Columns.Add("SourceTimestamp", typeof(string));
m_dataset.Tables[0].Columns.Add("ServerTimestamp", typeof(string));
ResultsDV.DataSource = m_dataset.Tables[0];
}
#endregion
#region Private Fields
private DataSet m_dataset;
private Session m_session;
private bool m_showResults;
#endregion
#region Public Members
/// <summary>
/// Changes the session used for the read request.
/// </summary>
public void ChangeSession(Session session)
{
m_session = session;
}
/// <summary>
/// Adds a node to the read request.
/// </summary>
public void AddNodes(params ReadValueId[] nodesToRead)
{
if (nodesToRead != null)
{
for (int ii = 0; ii < nodesToRead.Length; ii++)
{
if (nodesToRead[ii] == null)
{
continue;
}
DataRow row = m_dataset.Tables[0].NewRow();
UpdateRow(row, nodesToRead[ii]);
m_dataset.Tables[0].Rows.Add(row);
}
}
}
/// <summary>
/// Reads the values displayed in the control and moves to the display results state.
/// </summary>
public void Read()
{
if (m_session == null)
{
throw new ServiceResultException(StatusCodes.BadNotConnected);
}
// build list of values to read.
ReadValueIdCollection nodesToRead = new ReadValueIdCollection();
foreach (DataGridViewRow row in ResultsDV.Rows)
{
DataRowView source = row.DataBoundItem as DataRowView;
ReadValueId value = (ReadValueId)source.Row[0];
row.Selected = false;
nodesToRead.Add(value);
}
// read the values.
DataValueCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.Read(
null,
0,
TimestampsToReturn.Both,
nodesToRead,
out results,
out diagnosticInfos);
ClientBase.ValidateResponse(results, nodesToRead);
ClientBase.ValidateDiagnosticInfos(diagnosticInfos, nodesToRead);
IndexRangeCH.Visible = false;
DataEncodingCH.Visible = false;
DataTypeCH.Visible = true;
ValueCH.Visible = true;
StatusCodeCH.Visible = true;
SourceTimestampCH.Visible = true;
ServerTimestampCH.Visible = true;
m_showResults = true;
// add the results to the display.
for (int ii = 0; ii < results.Count; ii++)
{
DataRowView source = ResultsDV.Rows[ii].DataBoundItem as DataRowView;
UpdateRow(source.Row, results[ii]);
}
}
/// <summary>
/// Returns the grid to edit ReadValueIds state.
/// </summary>
public void Back()
{
IndexRangeCH.Visible = true;
DataEncodingCH.Visible = true;
DataTypeCH.Visible = false;
ValueCH.Visible = false;
StatusCodeCH.Visible = false;
SourceTimestampCH.Visible = false;
ServerTimestampCH.Visible = false;
m_showResults = false;
// clear any selection.
foreach (DataGridViewRow row in ResultsDV.Rows)
{
row.Selected = false;
}
}
#endregion
#region Private Methods
/// <summary>
/// Updates the row with the node to read.
/// </summary>
public void UpdateRow(DataRow row, DataValue value)
{
row[6] = value;
row[7] = (value.WrappedValue.TypeInfo != null) ? value.WrappedValue.TypeInfo.ToString() : String.Empty;
row[8] = value.WrappedValue;
row[9] = value.StatusCode;
row[10] = (value.SourceTimestamp != DateTime.MinValue) ? Utils.Format("{0:hh:mm:ss.fff}", value.SourceTimestamp.ToLocalTime()) : String.Empty;
row[11] = (value.ServerTimestamp != DateTime.MinValue) ? Utils.Format("{0:hh:mm:ss.fff}", value.ServerTimestamp.ToLocalTime()) : String.Empty;
}
/// <summary>
/// Updates the row with the node to read.
/// </summary>
public void UpdateRow(DataRow row, ReadValueId nodeToRead)
{
row[0] = nodeToRead;
row[1] = ImageList.Images[ClientUtils.GetImageIndex(nodeToRead.AttributeId, null)];
row[2] = (m_session != null) ? m_session.NodeCache.GetDisplayText(nodeToRead.NodeId) : Utils.ToString(nodeToRead.NodeId);
row[3] = Attributes.GetBrowseName(nodeToRead.AttributeId);
row[4] = nodeToRead.IndexRange;
row[5] = (nodeToRead.DataEncoding != null) ? nodeToRead.DataEncoding : QualifiedName.Null;
}
#endregion
#region Event Handlers
private void PopupMenu_Opening(object sender, CancelEventArgs e)
{
NewMI.Visible = !m_showResults;
EditMI.Enabled = ResultsDV.SelectedRows.Count > 0;
DeleteMI.Enabled = ResultsDV.SelectedRows.Count > 0;
DeleteMI.Visible = !m_showResults;
}
private void NewMI_Click(object sender, EventArgs e)
{
try
{
if (!m_showResults)
{
ReadValueId nodeToRead = null;
// use the first selected row as a template.
foreach (DataGridViewRow row in ResultsDV.SelectedRows)
{
DataRowView source = row.DataBoundItem as DataRowView;
ReadValueId value = (ReadValueId)source.Row[0];
nodeToRead = (ReadValueId)value.MemberwiseClone();
break;
}
if (nodeToRead == null)
{
nodeToRead = new ReadValueId() { AttributeId = Attributes.Value };
}
// edit the parameters.
ReadValueId[] results = new EditReadValueIdDlg().ShowDialog(m_session, nodeToRead);
if (results != null)
{
// add the new rows.
for (int ii = 0; ii < results.Length; ii++)
{
DataRow row = m_dataset.Tables[0].NewRow();
UpdateRow(row, results[ii]);
m_dataset.Tables[0].Rows.Add(row);
}
}
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void EditMI_Click(object sender, EventArgs e)
{
try
{
if (m_showResults)
{
foreach (DataGridViewRow row in ResultsDV.SelectedRows)
{
DataRowView source = row.DataBoundItem as DataRowView;
ReadValueId nodeToRead = (ReadValueId)source.Row[0];
DataValue value = (DataValue)source.Row[6];
new EditComplexValueDlg().ShowDialog(
m_session,
null,
0,
null,
value,
true,
"View Read Result");
break;
}
}
else
{
List<ReadValueId> nodesToRead = new List<ReadValueId>();
foreach (DataGridViewRow row in ResultsDV.SelectedRows)
{
DataRowView source = row.DataBoundItem as DataRowView;
ReadValueId value = (ReadValueId)source.Row[0];
nodesToRead.Add(value);
}
ReadValueId[] results = new EditReadValueIdDlg().ShowDialog(m_session, nodesToRead.ToArray());
if (results != null)
{
for (int ii = 0; ii < results.Length; ii++)
{
DataRowView source = ResultsDV.SelectedRows[ii].DataBoundItem as DataRowView;
UpdateRow(source.Row, results[ii]);
}
}
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
private void DeleteMI_Click(object sender, EventArgs e)
{
try
{
if (!m_showResults)
{
foreach (DataGridViewRow row in ResultsDV.SelectedRows)
{
DataRowView source = row.DataBoundItem as DataRowView;
source.Row.Delete();
}
m_dataset.AcceptChanges();
}
}
catch (Exception exception)
{
ClientUtils.HandleException(this.Text, exception);
}
}
#endregion
}
}
@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PopupMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="Icon.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="NodeNameCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="AttributeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="IndexRangeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DataEncodingCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DataTypeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ValueCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="StatusCodeCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SourceTimestampCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ServerTimestampCH.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>136, 17</value>
</metadata>
</root>
@@ -0,0 +1,149 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class SelectLocaleDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BottomPN = new System.Windows.Forms.Panel();
this.LocaleCB = new System.Windows.Forms.ComboBox();
this.panel1 = new System.Windows.Forms.Panel();
this.BottomPN.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(206, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 0;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.DialogResult = System.Windows.Forms.DialogResult.OK;
this.OkBTN.Location = new System.Drawing.Point(3, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 1;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
//
// BottomPN
//
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 32);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(284, 30);
this.BottomPN.TabIndex = 0;
//
// LocaleCB
//
this.LocaleCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.LocaleCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.LocaleCB.FormattingEnabled = true;
this.LocaleCB.Location = new System.Drawing.Point(3, 6);
this.LocaleCB.Name = "LocaleCB";
this.LocaleCB.Size = new System.Drawing.Size(278, 21);
this.LocaleCB.TabIndex = 0;
//
// panel1
//
this.panel1.Controls.Add(this.LocaleCB);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(284, 32);
this.panel1.TabIndex = 1;
//
// SelectLocaleDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBTN;
this.ClientSize = new System.Drawing.Size(284, 62);
this.Controls.Add(this.panel1);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SelectLocaleDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Select Locale";
this.BottomPN.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.ComboBox LocaleCB;
private System.Windows.Forms.Panel panel1;
}
}
@@ -0,0 +1,109 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
using Opc.Ua;
using Opc.Ua.Client;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// Prompts the user to select an area to use as an event filter.
/// </summary>
public partial class SelectLocaleDlg : Form
{
#region Constructors
/// <summary>
/// Creates an empty form.
/// </summary>
public SelectLocaleDlg()
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
}
#endregion
#region Private Fields
private Session m_session;
#endregion
#region Public Interface
/// <summary>
/// Displays the available areas in a tree view.
/// </summary>
/// <param name="session">The session.</param>
/// <returns></returns>
public string ShowDialog(Session session)
{
m_session = session;
LocaleCB.Items.Clear();
// get the locales from the server.
DataValue value = m_session.ReadValue(VariableIds.Server_ServerCapabilities_LocaleIdArray);
if (value != null)
{
string[] availableLocales = value.GetValue<string[]>(null);
if (availableLocales != null)
{
for (int ii = 0; ii < availableLocales.Length; ii++)
{
LocaleCB.Items.Add(availableLocales[ii]);
}
}
}
// select the current locale.
if (LocaleCB.Items.Count > 0)
{
LocaleCB.SelectedIndex = 0;
}
// display the dialog.
if (ShowDialog() != DialogResult.OK)
{
return null;
}
return LocaleCB.SelectedItem as string;
}
#endregion
#region Private Methods
#endregion
#region Event Handlers
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,89 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class SelectNodeCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.BrowseBTN = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// BrowseBTN
//
this.BrowseBTN.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseBTN.Location = new System.Drawing.Point(0, 0);
this.BrowseBTN.Name = "BrowseBTN";
this.BrowseBTN.Size = new System.Drawing.Size(24, 24);
this.BrowseBTN.TabIndex = 0;
this.BrowseBTN.Text = "...";
this.BrowseBTN.UseVisualStyleBackColor = true;
this.BrowseBTN.Click += new System.EventHandler(this.BrowseBTN_Click);
//
// SelectFileCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.BrowseBTN);
this.Name = "SelectFileCtrl";
this.Size = new System.Drawing.Size(24, 24);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button BrowseBTN;
}
}
@@ -0,0 +1,197 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Opc.Ua.Client.Controls
{
/// <summary>
/// A control with button that displays an open file dialog.
/// </summary>
public partial class SelectNodeCtrl : UserControl
{
#region Constructors
/// <summary>
/// Creates a new instance of the control.
/// </summary>
public SelectNodeCtrl()
{
InitializeComponent();
}
#endregion
#region Private Fields
private event EventHandler m_NodeSelected;
private ReferenceDescription m_selectedNode;
#endregion
#region Public Interface
/// <summary>
/// Gets or sets the current session.
/// </summary>
public Session Session { get; set; }
/// <summary>
/// Gets or sets starting node.
/// </summary>
public NodeId RootId { get; set; }
/// <summary>
/// Gets or sets the view to use.
/// </summary>
public ViewDescription View { get; set; }
/// <summary>
/// Gets or sets the reference types to follow.
/// </summary>
public NodeId[] ReferenceTypeIds { get; set; }
/// <summary>
/// Gets or sets the currently selected node.
/// </summary>
public NodeId SelectedNode
{
get
{
if (m_selectedNode != null)
{
return (NodeId)m_selectedNode.NodeId;
}
return null;
}
set
{
if (NodeControl != null)
{
NodeControl.Text = null;
if (value != null && Session != null)
{
NodeControl.Text = Session.NodeCache.GetDisplayText(value);
}
}
ReferenceDescription reference = new ReferenceDescription();
reference.NodeId = value;
if (Session != null)
{
INode node = Session.NodeCache.Find(value);
if (node != null)
{
reference.BrowseName = node.BrowseName;
reference.DisplayName = node.DisplayName;
}
}
m_selectedNode = reference;
}
}
/// <summary>
/// Gets or sets the currently selected reference.
/// </summary>
public ReferenceDescription SelectedReference
{
get
{
return m_selectedNode;
}
set
{
if (NodeControl != null)
{
NodeControl.Text = null;
if (value != null && !NodeId.IsNull(value.NodeId))
{
NodeControl.Text = value.ToString();
}
}
if (value == null || NodeId.IsNull(value.NodeId))
{
m_selectedNode = null;
return;
}
m_selectedNode = value;
}
}
/// <summary>
/// Gets or sets the control that is stores with the current node.
/// </summary>
public Control NodeControl { get; set; }
/// <summary>
/// Raised when a new node is selected.
/// </summary>
public event EventHandler NodeSelected
{
add { m_NodeSelected += value; }
remove { m_NodeSelected -= value; }
}
#endregion
#region Event Handlers
private void BrowseBTN_Click(object sender, EventArgs e)
{
ReferenceDescription reference = new SelectNodeDlg().ShowDialog(
Session,
RootId,
View,
null,
ReferenceTypeIds);
if (reference != null)
{
SelectedReference = reference;
if (m_NodeSelected != null)
{
m_NodeSelected(this, new EventArgs());
}
}
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,137 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Opc.Ua.Client.Controls
{
partial class SelectNodeDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.CancelBTN = new System.Windows.Forms.Button();
this.OkBTN = new System.Windows.Forms.Button();
this.BottomPN = new System.Windows.Forms.Panel();
this.BrowseCTRL = new Opc.Ua.Client.Controls.BrowseNodeCtrl();
this.BottomPN.SuspendLayout();
this.SuspendLayout();
//
// CancelBTN
//
this.CancelBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBTN.Location = new System.Drawing.Point(725, 4);
this.CancelBTN.Name = "CancelBTN";
this.CancelBTN.Size = new System.Drawing.Size(75, 23);
this.CancelBTN.TabIndex = 5;
this.CancelBTN.Text = "Cancel";
this.CancelBTN.UseVisualStyleBackColor = true;
//
// OkBTN
//
this.OkBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OkBTN.DialogResult = System.Windows.Forms.DialogResult.OK;
this.OkBTN.Location = new System.Drawing.Point(3, 4);
this.OkBTN.Name = "OkBTN";
this.OkBTN.Size = new System.Drawing.Size(75, 23);
this.OkBTN.TabIndex = 4;
this.OkBTN.Text = "OK";
this.OkBTN.UseVisualStyleBackColor = true;
//
// BottomPN
//
this.BottomPN.Controls.Add(this.OkBTN);
this.BottomPN.Controls.Add(this.CancelBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 388);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(803, 30);
this.BottomPN.TabIndex = 9;
//
// BrowseCTRL
//
this.BrowseCTRL.AttributesListCollapsed = false;
this.BrowseCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.BrowseCTRL.Location = new System.Drawing.Point(0, 0);
this.BrowseCTRL.Name = "BrowseCTRL";
this.BrowseCTRL.Size = new System.Drawing.Size(803, 388);
this.BrowseCTRL.SplitterDistance = 300;
this.BrowseCTRL.TabIndex = 10;
this.BrowseCTRL.View = null;
//
// SelectNodeDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBTN;
this.ClientSize = new System.Drawing.Size(803, 418);
this.Controls.Add(this.BrowseCTRL);
this.Controls.Add(this.BottomPN);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SelectNodeDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Select Node";
this.BottomPN.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button CancelBTN;
private System.Windows.Forms.Button OkBTN;
private System.Windows.Forms.Panel BottomPN;
private BrowseNodeCtrl BrowseCTRL;
}
}

Some files were not shown because too many files have changed in this diff Show More