初始化项目

This commit is contained in:
2025-12-11 14:22:51 +08:00
commit 4243e3e4d8
919 changed files with 840529 additions and 0 deletions

View File

@@ -0,0 +1,173 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class PowerSupplyForm
Inherits System.Windows.Forms.Form
'Form 重写 Dispose以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.SplitContainer2 = New System.Windows.Forms.SplitContainer()
Me.SplitContainer3 = New System.Windows.Forms.SplitContainer()
Me.PortTable = New FlexCell.Grid()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button6 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.IfGrid = New FlexCell.Grid()
CType(Me.SplitContainer2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainer2.Panel1.SuspendLayout()
Me.SplitContainer2.Panel2.SuspendLayout()
Me.SplitContainer2.SuspendLayout()
CType(Me.SplitContainer3, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainer3.Panel1.SuspendLayout()
Me.SplitContainer3.Panel2.SuspendLayout()
Me.SplitContainer3.SuspendLayout()
Me.SuspendLayout()
'
'SplitContainer2
'
Me.SplitContainer2.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainer2.Location = New System.Drawing.Point(0, 0)
Me.SplitContainer2.Name = "SplitContainer2"
Me.SplitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal
'
'SplitContainer2.Panel1
'
Me.SplitContainer2.Panel1.Controls.Add(Me.SplitContainer3)
'
'SplitContainer2.Panel2
'
Me.SplitContainer2.Panel2.Controls.Add(Me.IfGrid)
Me.SplitContainer2.Size = New System.Drawing.Size(930, 582)
Me.SplitContainer2.SplitterDistance = 191
Me.SplitContainer2.TabIndex = 1
'
'SplitContainer3
'
Me.SplitContainer3.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainer3.Location = New System.Drawing.Point(0, 0)
Me.SplitContainer3.Name = "SplitContainer3"
'
'SplitContainer3.Panel1
'
Me.SplitContainer3.Panel1.Controls.Add(Me.PortTable)
'
'SplitContainer3.Panel2
'
Me.SplitContainer3.Panel2.Controls.Add(Me.Button5)
Me.SplitContainer3.Panel2.Controls.Add(Me.Button6)
Me.SplitContainer3.Panel2.Controls.Add(Me.Button3)
Me.SplitContainer3.Panel2.Controls.Add(Me.Button2)
Me.SplitContainer3.Size = New System.Drawing.Size(930, 191)
Me.SplitContainer3.SplitterDistance = 718
Me.SplitContainer3.TabIndex = 0
'
'PortTable
'
Me.PortTable.CheckedImage = Nothing
Me.PortTable.DefaultFont = New System.Drawing.Font("宋体", 9.0!)
Me.PortTable.Dock = System.Windows.Forms.DockStyle.Fill
Me.PortTable.ExtendLastCol = True
Me.PortTable.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.PortTable.GridColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
Me.PortTable.Location = New System.Drawing.Point(0, 0)
Me.PortTable.Name = "PortTable"
Me.PortTable.Size = New System.Drawing.Size(718, 191)
Me.PortTable.TabIndex = 1
Me.PortTable.UncheckedImage = Nothing
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(125, 130)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(75, 23)
Me.Button5.TabIndex = 3
Me.Button5.Text = "添加条件组"
Me.Button5.UseVisualStyleBackColor = True
'
'Button6
'
Me.Button6.Location = New System.Drawing.Point(13, 130)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(75, 23)
Me.Button6.TabIndex = 2
Me.Button6.Text = "删除条件组"
Me.Button6.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(125, 164)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(75, 23)
Me.Button3.TabIndex = 1
Me.Button3.Text = "添加条件"
Me.Button3.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(13, 164)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(75, 23)
Me.Button2.TabIndex = 0
Me.Button2.Text = "删除条件"
Me.Button2.UseVisualStyleBackColor = True
'
'IfGrid
'
Me.IfGrid.CheckedImage = Nothing
Me.IfGrid.DefaultFont = New System.Drawing.Font("宋体", 9.0!)
Me.IfGrid.Dock = System.Windows.Forms.DockStyle.Fill
Me.IfGrid.ExtendLastCol = True
Me.IfGrid.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.IfGrid.GridColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
Me.IfGrid.Location = New System.Drawing.Point(0, 0)
Me.IfGrid.Name = "IfGrid"
Me.IfGrid.Size = New System.Drawing.Size(930, 387)
Me.IfGrid.TabIndex = 1
Me.IfGrid.UncheckedImage = Nothing
'
'PowerSupplyForm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(930, 582)
Me.Controls.Add(Me.SplitContainer2)
Me.Name = "PowerSupplyForm"
Me.Text = "Form1"
Me.SplitContainer2.Panel1.ResumeLayout(False)
Me.SplitContainer2.Panel2.ResumeLayout(False)
CType(Me.SplitContainer2, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainer2.ResumeLayout(False)
Me.SplitContainer3.Panel1.ResumeLayout(False)
Me.SplitContainer3.Panel2.ResumeLayout(False)
CType(Me.SplitContainer3, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainer3.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents SplitContainer2 As SplitContainer
Friend WithEvents SplitContainer3 As SplitContainer
Friend WithEvents PortTable As FlexCell.Grid
Protected WithEvents Button5 As Button
Friend WithEvents Button6 As Button
Protected WithEvents Button3 As Button
Friend WithEvents Button2 As Button
Friend WithEvents IfGrid As FlexCell.Grid
End Class

View File

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

View File

@@ -0,0 +1,391 @@
Imports Newtonsoft.Json
Public Class PowerSupplyForm
Implements FromInterface1
Private Dic_Devicemodel As Dictionary(Of String DeviceModel)
Private Sub PowerSupplyForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
InitIfGrid(UniqueDevice.Desc.DevDescription)
InitPortTable(NoCardNode)
End Sub
Private UniqueDevice As DeviceModel
Private NoCardNode As DeviceChildNodeClass
Private ParseDevDic As Dictionary(Of String Dictionary(Of String, Dictionary(Of String, List(Of (String, String)))))
Public Sub ParseDeviceList(Devicemodel As Dictionary(Of String DeviceModel)
Dic_Devicemodel = Devicemodel
ParseDevDic = New Dictionary(Of String, Dictionary(Of String, Dictionary(Of String, List(Of (String, String)))))
Dim typename As String
For Each index In Dic_Devicemodel.Values
For Each node In index.Nodes
If node.Name.Equals("Virtual_Card") Then
UniqueDevice = index
NoCardNode = node
Exit For
End If
If node.Interface.Equals("DI") Then
typename = GetAnotherName(node.Name)
typename = $"{node.Name}"
If String.IsNullOrEmpty(typename) Then
Continue For
Else
Dim addressdic As Dictionary(Of String, Dictionary(Of String, List(Of (String, String))))
If ParseDevDic.ContainsKey(typename) Then
addressdic = ParseDevDic.Item(typename)
Else
addressdic = New Dictionary(Of String, Dictionary(Of String, List(Of (String, String))))
ParseDevDic.Add(typename, addressdic)
End If
Dim addr As String
Dim loopdic As Dictionary(Of String, List(Of (String, String)))
Dim loopli As List(Of (String, String))
If index.Desc.Name.Equals("BLV_C12") Then
addr = 0
Else
addr = FindAttributeValueUnderModel(index, "设备存在", "拨码地址")
End If
If addressdic.ContainsKey(addr) Then
loopdic = addressdic.Item(addr)
Else
loopdic = New Dictionary(Of String, List(Of (String, String)))
addressdic.Add(addr, loopdic)
End If
If loopdic.ContainsKey(node.DEV_TYPE_DATA) Then
loopli = loopdic.Item(node.DEV_TYPE_DATA)
Else
loopli = New List(Of (String, String))
loopdic.Add(node.DEV_TYPE_DATA, loopli)
End If
For Each liindex In node.Nodes
loopli.Add((liindex.LoopAddr, liindex.DefaultAliasName))
Next
End If
Else
Continue For
End If
Next
Next
End Sub
Public Shared Function GetAnotherName(str As String) As String
Dim result As String = String.Empty
If String.IsNullOrEmpty(str) Then
Return result
Else
Select Case str
Case "CLED_FRESHAIR"
result = "CLED新风"
Case "CLEDFLOORHEAT"
result = "CLED地暖"
Case "485FloorHeat"
result = "地暖"
Case "485FreshAir"
result = "新风"
Case "485MUSIC"
result = "485音乐"
Case "CURTAIN"
result = "干接点窗帘"
Case "INFRARED_FORWARD"
result = "红外"
Case "RS485_Curtain"
result = "485窗帘"
Case "RELAY"
result = "继电器"
Case "MUSIC"
result = "音乐"
Case "Dimming"
result = "调光"
Case "DO"
result = "输出"
Case "Temp"
result = "空调"
Case "PB_LINE_CONTROL"
result = "主机恒压调光"
Case "PB_STRIP_DEVICE"
result = "PLC恒压调光"
Case "PB_RELAY_DEVICE"
result = "PLC继电器"
'Case "KEY"
' result = "普通按键"
Case Else
result = $"{str}"
End Select
End If
Return result
End Function
Private Function FindAttributeValueUnderModel(pNode As DeviceModel, groupName As String, attributeName As String) As String
For Each cnode In pNode.Config
If cnode.Name.Equals(groupName) Then
For Each ccnode In cnode.Attributes
If ccnode.Name.Equals(attributeName) Then
Return ccnode.Value
End If
Next
End If
Next
End Function
Private IfGridRowdic As Dictionary(Of String, List(Of String))
Public Sub InitIfGrid(jsonstr As String, Optional ifbn As Boolean = True)
IfGrid.NewFile()
IfGrid.ExtendLastCol = False
IfGrid.Cols = 15
IfGrid.Rows = 1
IfGrid.Cell(0, 0).Text = "条件组"
IfGrid.Cell(0, 1).Text = "条件序号"
IfGrid.Cell(0, 2).Text = "有无人标记"
IfGrid.Cell(0, 3).Text = "端口1"
IfGrid.Cell(0, 4).Text = "端口2"
IfGrid.Cell(0, 5).Text = "端口3"
IfGrid.Cell(0, 6).Text = "端口4"
IfGrid.Cell(0, 7).Text = "端口5"
IfGrid.Cell(0, 8).Text = "端口6"
IfGrid.Cell(0, 9).Text = "端口7"
IfGrid.Cell(0, 10).Text = "端口8"
IfGrid.Cell(0, 11).Text = "端口9"
IfGrid.Cell(0, 12).Text = "端口10"
IfGrid.Cell(0, 13).Text = "延时时间"
IfGrid.Cell(0, 14).Text = "延时单位"
IfGrid.Column(2).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(3).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(4).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(5).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(6).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(7).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(8).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(9).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(10).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(11).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(12).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(13).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(14).CellType = FlexCell.CellTypeEnum.ComboBox
IfGrid.Column(0).Width = 50
IfGrid.Column(1).Width = 60
IfGrid.Column(2).Width = 60
IfGrid.Column(3).Width = 60
IfGrid.Column(4).Width = 60
IfGrid.Column(5).Width = 60
IfGrid.Column(6).Width = 60
IfGrid.Column(7).Width = 60
IfGrid.Column(8).Width = 60
IfGrid.Column(9).Width = 60
IfGrid.Column(10).Width = 60
IfGrid.Column(11).Width = 60
IfGrid.Column(12).Width = 60
IfGrid.Column(13).Width = 60
IfGrid.Column(14).Width = 60
IfGrid.Column(1).Locked = True
IfGrid.Column(0).Locked = True
IfGrid.ComboBox(2).Locked = True
IfGrid.ComboBox(3).Locked = True
IfGrid.ComboBox(5).Locked = True
IfGrid.ComboBox(6).Locked = True
IfGrid.ComboBox(7).Locked = True
IfGrid.ComboBox(11).Locked = True
IfGrid.ComboBox(12).Locked = True
IfGrid.ComboBox(4).Locked = True
IfGrid.ComboBox(8).Locked = True
IfGrid.ComboBox(9).Locked = True
IfGrid.ComboBox(10).Locked = True
IfGrid.ComboBox(13).Locked = True
IfGrid.ComboBox(14).Locked = True
IfGrid.Column(0).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(1).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(2).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(3).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(4).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(5).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(6).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(7).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(8).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(9).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(10).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(11).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(12).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(13).Alignment = FlexCell.AlignmentEnum.CenterCenter
IfGrid.Column(14).Alignment = FlexCell.AlignmentEnum.CenterCenter
Try
IfGridRowdic = JsonConvert.DeserializeObject(Of Dictionary(Of String, List(Of String)))(jsonstr)
If IsNothing(IfGridRowdic) OrElse IfGridRowdic.Count < 1 Then
IfGridRowdic = New Dictionary(Of String, List(Of String))
'Dim li As List(Of String) = New List(Of String)
For i = 1 To 3
Dim li As List(Of String) = New List(Of String)
IfGrid.AddItem("")
IfGrid.Cell(IfGrid.Rows - 1, 0).Text = $"{i}"
IfGrid.Cell(IfGrid.Rows - 1, 1).Text = 1
IfGrid.Cell(IfGrid.Rows - 1, 2).Text = "1:无人至有人"
IfGrid.Cell(IfGrid.Rows - 1, 3).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 4).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 5).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 6).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 7).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 8).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 9).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 10).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 11).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 12).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 13).Text = $"0"
IfGrid.Cell(IfGrid.Rows - 1, 14).Text = $""
li.Add($"{i},1,1,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0,秒")
IfGridRowdic.Add(i, li)
Next
Else
Dim headrow As Integer
For Each node In IfGridRowdic
IfGrid.AddItem("")
headrow = IfGrid.Rows - 1
For i = 0 To node.Value.Count - 1
If i = 0 Then
Else
IfGrid.AddItem("")
End If
IfGrid.Cell(IfGrid.Rows - 1, 0).Text = $"{node.Key}"
Dim rowstr() As String = node.Value(i).Split(",")
For j = 1 To rowstr.Length
If ifbn Then
IfGrid.Cell(IfGrid.Rows - 1, j).Text = rowstr(j - 1)
Else
If j = rowstr.Length Then Continue For
IfGrid.Cell(IfGrid.Rows - 1, j).Text = rowstr(j)
End If
Next
Next
'IfGrid.Range(headrow, 0 IfGrid.Rows - 1, 0).Merge()
Next
End If
Catch ex As Exception
IfGridRowdic = New Dictionary(Of String, List(Of String))
For i = 1 To 3
Dim li As List(Of String) = New List(Of String)
IfGrid.AddItem("")
IfGrid.Cell(IfGrid.Rows - 1, 0).Text = $"{i}"
IfGrid.Cell(IfGrid.Rows - 1, 1).Text = 1
IfGrid.Cell(IfGrid.Rows - 1, 2).Text = "1:无人至有人"
IfGrid.Cell(IfGrid.Rows - 1, 3).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 4).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 5).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 6).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 7).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 8).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 9).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 10).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 11).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 12).Text = $"0:不判断"
IfGrid.Cell(IfGrid.Rows - 1, 13).Text = $"0"
IfGrid.Cell(IfGrid.Rows - 1, 14).Text = $""
li.Add($"{i},1,1,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0:不判断,0,秒")
IfGridRowdic.Add(i, li)
Next
End Try
End Sub
Public isxiugai1 As Boolean = False
Public Sub InitPortTable(Node As DeviceChildNodeClass)
PortTable.NewFile()
PortTable.ExtendLastCol = False
PortTable.Cols = 6
PortTable.Rows = Node.Nodes.Count + 1
PortTable.Cell(0, 0).Text = "端口"
PortTable.Cell(0, 1).Text = "别名"
PortTable.Cell(0, 2).Text = "端口类型"
PortTable.Cell(0, 3).Text = "端口地址"
PortTable.Cell(0, 4).Text = "端口回路"
PortTable.Cell(0, 5).Text = "触发时间(百分比)阈值"
PortTable.Row(0).Locked = True
PortTable.Column(0).Width = 100
PortTable.Column(2).Width = 80
PortTable.Column(3).Width = 80
PortTable.Column(4).Width = 800
PortTable.Column(5).Width = 120
PortTable.Column(1).Width = 100
' PortTable.Column(1).CellType = FlexCell.CellTypeEnum.ComboBox
PortTable.Column(2).CellType = FlexCell.CellTypeEnum.ComboBox
PortTable.Column(3).CellType = FlexCell.CellTypeEnum.ComboBox
PortTable.Column(4).CellType = FlexCell.CellTypeEnum.ComboBox
PortTable.Column(5).CellType = FlexCell.CellTypeEnum.ComboBox
PortTable.ComboBox(5).Locked = True
'PortTable.Column(1).Locked = True
PortTable.ComboBox(2).Locked = True
PortTable.ComboBox(3).Locked = True
PortTable.ComboBox(4).Locked = True
PortTable.Column(0).Alignment = FlexCell.AlignmentEnum.CenterCenter
PortTable.Column(1).Alignment = FlexCell.AlignmentEnum.CenterCenter
PortTable.Column(2).Alignment = FlexCell.AlignmentEnum.CenterCenter
PortTable.Column(3).Alignment = FlexCell.AlignmentEnum.CenterCenter
PortTable.Column(4).Alignment = FlexCell.AlignmentEnum.CenterCenter
PortTable.Column(5).Alignment = FlexCell.AlignmentEnum.CenterCenter
isxiugai1 = False
Dim sbuf() As String
For i = 1 To Node.Nodes.Count
PortTable.Cell(i, 1).Text = " "
PortTable.Cell(i, 0).Text = Node.Nodes(i - 1).Name
sbuf = Node.Nodes(i - 1).Description.Split(",")
If sbuf.Length = 6 Then
PortTable.Cell(i, 1).Text = sbuf(0)
PortTable.Cell(i, 2).Text = sbuf(1)
PortTable.Cell(i, 3).Text = sbuf(2)
PortTable.Cell(i, 4).Text = sbuf(3)
PortTable.Cell(i, 4).Tag = sbuf(5)
PortTable.Cell(i, 5).Text = sbuf(4)
End If
Next
isxiugai1 = True
End Sub
Public Function GetPortTable() As Boolean
If IsNothing(NoCardNode) Then Return False
Dim rstr As String = String.Empty
For i = 1 To PortTable.Rows - 1
rstr = String.Empty
For j = 1 To PortTable.Cols - 1
rstr = $"{rstr},{PortTable.Cell(i, j).Text}"
Next
rstr = $"{rstr},{PortTable.Cell(i, 4).Tag}"
rstr = rstr.Remove(0, 1)
NoCardNode.Nodes(i - 1).Description = rstr
Next
Return True
End Function
Public Function SetFormPattern(ParamArray args() As Object) As Boolean Implements FromInterface1.SetFormPattern
If TypeOf args(0) Is Dictionary(Of String, DeviceModel) Then
' someObject 是 Dictionary(Of String, DeviceModel) 类型
If Not (args(0) Is Nothing) Then
Dic_Devicemodel = DirectCast(args(0), Dictionary(Of String, DeviceModel))
ParseDeviceList(Dic_Devicemodel)
Return True
Else
'MsgBox("设备加载异常")
Return False
End If
Else
' someObject 不是 Dictionary(Of String, DeviceModel) 类型
'MsgBox("设备加载异常")
Return False
End If
End Function
Public Function GetFormData() As Object Implements FromInterface1.GetFormData
Throw New NotImplementedException()
End Function
End Class