Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit aa334c58 authored by Terry Burns's avatar Terry Burns Committed by Kostis ANAGNOSTOPOULOS
Browse files

Updates Before Changing ElectricalConsumer list to List from Dictionary

git-tfs-id: [http://tfs00.element.root.com:8080/tfs/TFSCollection]$/VECTO;C1643
parent a7eab239
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,12 @@
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsumerList.Designer.vb">
<DependentUpon>ConsumerList.vb</DependentUpon>
</Compile>
<Compile Include="ConsumerList.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dashboard.Designer.vb">
<DependentUpon>Dashboard.vb</DependentUpon>
</Compile>
......@@ -98,6 +104,9 @@
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ConsumerList.resx">
<DependentUpon>ConsumerList.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dashboard.resx">
<DependentUpon>Dashboard.vb</DependentUpon>
</EmbeddedResource>
......
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ConsumerList
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.DataGridView1 = New System.Windows.Forms.DataGridView()
Me.Button1 = New System.Windows.Forms.Button()
CType(Me.DataGridView1,System.ComponentModel.ISupportInitialize).BeginInit
Me.SuspendLayout
'
'DataGridView1
'
Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.DataGridView1.Location = New System.Drawing.Point(46, 193)
Me.DataGridView1.Name = "DataGridView1"
Me.DataGridView1.Size = New System.Drawing.Size(516, 150)
Me.DataGridView1.TabIndex = 0
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(46, 60)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Button1"
Me.Button1.UseVisualStyleBackColor = true
'
'ConsumerList
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(622, 447)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.DataGridView1)
Me.Name = "ConsumerList"
Me.Text = "ConsumerList"
CType(Me.DataGridView1,System.ComponentModel.ISupportInitialize).EndInit
Me.ResumeLayout(false)
End Sub
Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
Friend WithEvents Button1 As System.Windows.Forms.Button
End Class
<?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>
\ No newline at end of file
imports VectoAuxiliaries.Electrics
Public Class ConsumerList
Friend ConsumerList As List(Of IElectricalConsumer)
Private Sub ConsumerList_Load( sender As Object, e As EventArgs) Handles MyBase.Load
ConsumerList = New List(Of IElectricalConsumer)
End Sub
Private sub AddConsumer( consumer as IElectricalConsumer)
If Not ConsumerList.Contains( consumer ) then
ConsumerList.Add(consumer)
Else
MessageBox.Show("Already Exists")
End If
End Sub
Private Sub Button1_Click( sender As Object, e As EventArgs) Handles Button1.Click
AddConsumer( New ElectricalConsumer(False,"Test","Test1",2.2,.5,26.3,1))
End Sub
End Class
\ No newline at end of file
This diff is collapsed.
......@@ -117,13 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="bsElectricalConsumables.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="bndgsElecConsumables.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="BindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>202, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>42</value>
</metadata>
</root>
\ No newline at end of file

Imports VectoAuxiliaries
Imports VectoAuxiliaries
Imports VectoAuxiliaries.Electrics
Public Class Dashboard
public auxEnvironment As New AuxillaryEnvironment("")
Private Sub Dashboard_Load( sender As Object, e As EventArgs) Handles MyBase.Load
cboCycle.SelectedIndex=0
......@@ -37,18 +33,13 @@ Private Sub CreateBindings
chkSmartElectricals.DataBindings.Add("Checked",auxEnvironment.ElectricalUserInputsConfig,"SmartElectrical")
Dim cIndex As Integer = gvElectricalConsumables.Columns.Add("ConsumerName","ConsumerName")
gvElectricalConsumables.Columns(cIndex).DataPropertyName="Value.ConsumerName"
Dim list As New List(of IElectricalConsumer)
'Dim cIndex As Integer = gvElectricalConsumables.Columns.Add("ConsumerName","ConsumerName")
'gvElectricalConsumables.Columns(cIndex).DataPropertyName="Value.ConsumerName"
gvElectricalConsumables.DataSource = list
'Dim list As New List(of IElectricalConsumer)
'gvElectricalConsumables.DataSource = list
End Sub
......
......@@ -32,7 +32,7 @@ Namespace My
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.AuxillaryTestHarness.Dashboard
Me.MainForm = Global.AuxillaryTestHarness.ConsumerList
End Sub
End Class
End Namespace
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>true</MySubMain>
<MainForm>Form1</MainForm>
<MainForm>ConsumerList</MainForm>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>0</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>
</MyApplicationData>
\ No newline at end of file
......@@ -8,6 +8,10 @@
Implements IElectricalConsumer
'Calculated
Private Property AvgConsumptionAmps As Single Implements IElectricalConsumer.AvgConsumptionAmps
......@@ -58,5 +62,23 @@
End Sub
Public Overrides Function Equals(obj As Object) As Boolean
Dim other As IElectricalConsumer = CType(obj, IElectricalConsumer)
Return Me.ConsumerName=other.ConsumerName
End Function
Public Overrides Function GetHashCode() As Integer
Return 0
End Function
End Class
End Namespace
\ No newline at end of file
......@@ -131,36 +131,12 @@
<Compile Include="Pneumatics\PneumaticsAuxilliariesConfig.vb" />
<Compile Include="Pneumatics\PneumaticUserInputsConfig.vb" />
<Compile Include="Signals.vb" />
<Compile Include="UI\ElectricalConsumers.Designer.vb">
<DependentUpon>ElectricalConsumers.vb</DependentUpon>
</Compile>
<Compile Include="UI\ElectricalConsumers.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\F_Alternator.Designer.vb">
<DependentUpon>F_Alternator.vb</DependentUpon>
</Compile>
<Compile Include="UI\F_Alternator.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\F_Compressor.Designer.vb">
<DependentUpon>F_Compressor.vb</DependentUpon>
</Compile>
<Compile Include="UI\F_Compressor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\F_HVAC.Designer.vb">
<DependentUpon>F_HVAC.vb</DependentUpon>
</Compile>
<Compile Include="UI\F_HVAC.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\F_PneumaticConsumers.Designer.vb">
<DependentUpon>F_PneumaticConsumers.vb</DependentUpon>
</Compile>
<Compile Include="UI\F_PneumaticConsumers.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="VectoInputs.vb" />
</ItemGroup>
<ItemGroup>
......@@ -170,15 +146,9 @@
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\F_Compressor.resx">
<DependentUpon>F_Compressor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\F_HVAC.resx">
<DependentUpon>F_HVAC.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\F_PneumaticConsumers.resx">
<DependentUpon>F_PneumaticConsumers.vb</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment