From 8c1a7dde77453236dc829a4ea9951a09440eecb5 Mon Sep 17 00:00:00 2001 From: "Burns, Terry" <Terry.Burns@ricardo.com> Date: Thu, 20 Nov 2014 10:53:50 +0000 Subject: [PATCH] Reverting Vecto To Original Before Very Initial Attempts made to Auxiliarise it. So back to square one as far as Vecto is concerned git-tfs-id: [http://tfs00.element.root.com:8080/tfs/TFSCollection]$/VECTO;C1683 --- VECTO/GUI/F_MAINForm.vb | 6 +- VECTO/GUI/F_VECTO.vb | 268 +++++++++------------------- VECTO/GUI/F_VEH_AuxDlog.Designer.vb | 255 +++++--------------------- VECTO/GUI/F_VEH_AuxDlog.resx | 6 - VECTO/GUI/F_VEH_AuxDlog.vb | 213 ++-------------------- VECTO/Input Files/cVECTO.vb | 43 ++--- 6 files changed, 149 insertions(+), 642 deletions(-) diff --git a/VECTO/GUI/F_MAINForm.vb b/VECTO/GUI/F_MAINForm.vb index 820ba2b1b0..3a8f6b1bba 100644 --- a/VECTO/GUI/F_MAINForm.vb +++ b/VECTO/GUI/F_MAINForm.vb @@ -452,15 +452,12 @@ Public Class F_MAINForm ComLineShutDown = False - 'File Browser Initialise - Comment Added TB 25/9/14 FB_Initialize() - 'File Form Title - Including Version - Comment Added TB 25/9/14 Me.Text = "VECTO " & VECTOvers - 'FileLists_________________________________________________ - + 'FileLists JobListView = New cFileListView(MyConfPath & "joblist.txt") JobListView.LVbox = Me.LvGEN CycleListView = New cFileListView(MyConfPath & "cyclelist.txt") @@ -737,7 +734,6 @@ Public Class F_MAINForm End Select End Sub - 'Invoke Vecto Form on Double click - Edits Job : Comment Added TB 25/9/14 Private Sub ListViewGEN_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LvGEN.DoubleClick If Me.LvGEN.SelectedItems.Count > 0 Then Me.LvGEN.SelectedItems(0).Checked = Not Me.LvGEN.SelectedItems(0).Checked diff --git a/VECTO/GUI/F_VECTO.vb b/VECTO/GUI/F_VECTO.vb index 3d91ee9264..5450c0c757 100644 --- a/VECTO/GUI/F_VECTO.vb +++ b/VECTO/GUI/F_VECTO.vb @@ -19,26 +19,14 @@ Public Class F_VECTO Private VECTOfile As String Private Changed As Boolean = False + Private pgDriver As TabPage + Private pgDriverON As Boolean = True Private AuxDlog As F_VEH_AuxDlog - Private EStechs As New List(Of String) - - ''TB:29/9/14 - New Fields associated with HVAC,PNeumatics as Electrical Systems ********************* - ' Public ConsumerListES As List(Of VectoAuxiliaries.Electrics.ElectricalConsumer) = New List(Of VectoAuxiliaries.Electrics.ElectricalConsumer)() - ' Public PulleyGearEfficiencyES As Single - ' Public PulleyGearRatioES As Single - - ' Public ConsumerListPS As List(Of VectoAuxiliaries.Pneumatics.PneumaticConsumer) = New List(Of VectoAuxiliaries.Pneumatics.PneumaticConsumer)() - ' Public PulleyGearEfficiencyPS As Single - ' Public PulleyGearRatioPS As Single - - ' Public HVACMapInputs As Dictionary(Of String, Single) = New Dictionary(Of String, Single)() - ' Public PulleyGearEfficiencyHVAC As Single - ' Public PulleyGearRatioHVAC As Single - '************************************************************************************************** + Private EStechs As New List(Of String) 'Initialise form Private Sub F02_GEN_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load @@ -104,9 +92,6 @@ Public Class F_VECTO Me.TbUnderSpeed.Text = cDeclaration.Underspeed Me.TbVmin.Text = cDeclaration.ECvmin - - 'TB 29/9/14 - Note on existing code. - 'This sets Up Default Values for Aux Type is exactly the right numbers of them and their ID's are not in the list. these dont seem to need to be added by the user I guess. If LvAux.Items.Count <> 5 OrElse (Me.LvAux.Items(0).Text <> sKey.AUX.Fan OrElse Me.LvAux.Items(1).Text <> sKey.AUX.SteerPump OrElse Me.LvAux.Items(2).Text <> sKey.AUX.HVAC OrElse Me.LvAux.Items(3).Text <> sKey.AUX.ElecSys OrElse Me.LvAux.Items(4).Text <> sKey.AUX.PneumSys) Then Me.LvAux.Items.Clear() @@ -155,8 +140,6 @@ Public Class F_VECTO End If Me.LvAux.Items.Add(LV0) - - End If @@ -177,7 +160,7 @@ Public Class F_VECTO End If End If End Sub - 'This is just a test comment. TODO: REMOVE IT + #Region "Browse Buttons" @@ -348,7 +331,7 @@ Public Class F_VECTO Public Sub VECTOload2Form(ByVal file As String) Dim x As Int16 Dim VEC0 As cVECTO - Dim AuxEntryKV As KeyValuePair(Of String, cAuxEntry) + Dim AuxEntryKV As KeyValuePair(Of String, cVECTO.cAuxEntry) Dim LV0 As ListViewItem Dim sb As cSubPath @@ -400,9 +383,6 @@ Public Class F_VECTO 'VACC Me.TbDesMaxFile.Text = VEC0.DesMaxFile(True) - - - Me.LvAux.Items.Clear() For Each AuxEntryKV In VEC0.AuxPaths LV0 = New ListViewItem @@ -410,18 +390,8 @@ Public Class F_VECTO LV0.SubItems.Add(AuxEntryKV.Value.Type) If Cfg.DeclMode Then LV0.SubItems.Add(AuxEntryKV.Value.TechStr) - - 'TB 29/9/2014 - TODO: Need to work out what to do about Declaration mode for the augmentations. - Else LV0.SubItems.Add(AuxEntryKV.Value.Path.OriginalPath) - - ' - 'TB 29/9/2014 - This is where we read the contents of the auxilaries and add them to the respective properties of this form's class. - - - - End If LvAux.Items.Add(LV0) Next @@ -481,7 +451,7 @@ Public Class F_VECTO Private Function VECTOsave(ByVal file As String) As Boolean Dim VEC0 As cVECTO - Dim AuxEntry As cAuxEntry + Dim AuxEntry As cVECTO.cAuxEntry Dim LV0 As ListViewItem Dim sb As cSubPath @@ -511,49 +481,17 @@ Public Class F_VECTO 'a_DesMax VEC0.DesMaxFile = Me.TbDesMaxFile.Text - 'TB 29/9/2014 - Here is where we assemble the cAuxEntry instances for addition For Each LV0 In LvAux.Items - AuxEntry = New cAuxEntry + AuxEntry = New cVECTO.cAuxEntry If Cfg.DeclMode Then AuxEntry.TechStr = LV0.SubItems(2).Text - - 'TB: 29/9/2014 - TODO: Need to know how to set Declaration Mode Values for this stuff here. - - Else AuxEntry.Path.Init(fPATH(file), LV0.SubItems(2).Text) - - 'Engineering Mode. - 'Detect which system we are currently addressing. - - 'Select Case LV0.SubItems(0).Text - - ' Case sKey.AUX.HVAC - ' AuxEntry.HVACMapInputs = Me.HVACMapInputs - ' AuxEntry.PulleyGearEfficiencyHVAC = Me.PulleyGearEfficiencyHVAC - ' AuxEntry.PulleyGearRatioHVAC = Me.PulleyGearRatioHVAC - - ' Case sKey.AUX.ElecSys - ' AuxEntry.ConsumerListES = Me.ConsumerListES - ' AuxEntry.PulleyGearEfficiencyES = Me.PulleyGearEfficiencyES - ' AuxEntry.PulleyGearRatioES = Me.PulleyGearRatioES - - ' Case sKey.AUX.PneumSys - ' AuxEntry.ConsumerListPS = Me.ConsumerListPS - ' AuxEntry.PulleyGearEfficiencyPS = Me.PulleyGearEfficiencyPS - ' AuxEntry.PulleyGearRatioPS = Me.PulleyGearRatioPS - - 'End Select - - - End If AuxEntry.Type = LV0.SubItems(1).Text VEC0.AuxPaths.Add(LV0.SubItems(0).Text, AuxEntry) - - Next VEC0.EStechs = EStechs @@ -731,9 +669,11 @@ Public Class F_VECTO Dim LV0 As ListViewItem Dim ID As String - AuxDlog.ClearAllValues(True) AuxDlog.VehPath = fPATH(VECTOfile) - + AuxDlog.TbPath.Text = "" + AuxDlog.CbType.SelectedIndex = -1 + AuxDlog.CbType.Text = "" + AuxDlog.TbID.Text = "" '!!! Vorher Type setzen weil ID beim ändern von Type überschrieben wird !!!" lbDlog: If AuxDlog.ShowDialog = Windows.Forms.DialogResult.OK Then @@ -795,7 +735,7 @@ lbDlog: SelItem = LvAux.SelectedItems(0) AuxDlog.VehPath = fPATH(VECTOfile) - + AuxDlog.CbType.SelectedIndex = -1 AuxDlog.CbType.Text = SelItem.SubItems(1).Text AuxDlog.TbID.Text = SelItem.SubItems(0).Text 'After Type-set! @@ -819,52 +759,6 @@ lbDlog: End If If AuxDlog.ShowDialog = Windows.Forms.DialogResult.OK Then - -'Set New Systems Properties - - - 'Select Case AuxDlog.TbID.Text - - ' '**** ELECTRICS **** - ' Case sKey.AUX.ElecSys.ToString() - ' For Each item As KeyValuePair(Of String, Single) In AuxDlog.ListItems - ' ConsumerListES.Add(New VectoAuxiliaries.Electrics.ElectricalConsumer(item.Key, item.Value)) - ' Next - - ' PulleyGearEfficiencyES = CType(AuxDlog.txtPulleyGearEfficiency.Text, Single) - ' PulleyGearRatioES = CType(AuxDlog.txtPulleyGearRatio.Text, Single) - - ' '============================================================================================ - - ' '**** PNEUMATICS **** - ' Case sKey.AUX.PneumSys.ToString() - ' For Each item As KeyValuePair(Of String, Single) In AuxDlog.ListItems - ' ConsumerListPS.Add(New VectoAuxiliaries.Pneumatics.PneumaticConsumer(item.Key, item.Value)) - ' Next - ' '------Get Pully Values - ' PulleyGearEfficiencyPS = CType(AuxDlog.txtPulleyGearEfficiency.Text, Single) - ' PulleyGearRatioPS = CType(AuxDlog.txtPulleyGearRatio.Text, Single) - - ' '============================================================================================ - - ' '**** HVAC **** - ' Case sKey.AUX.HVAC.ToString() - - ' '----- Get list of MAP Inputs - ' For Each item As KeyValuePair(Of String, Single) In AuxDlog.ListItems - ' HVACMapInputs.Add(item.Key, item.Value) - ' Next - - ' '------Get Pully Values - ' PulleyGearEfficiencyHVAC = CType(AuxDlog.txtPulleyGearEfficiency.Text, Single) - ' PulleyGearRatioHVAC = CType(AuxDlog.txtPulleyGearRatio.Text, Single) - - ' '============================================================================================ - - 'End Select - - - SelItem.SubItems(0).Text = UCase(Trim(AuxDlog.TbID.Text)) SelItem.SubItems(1).Text = Trim(AuxDlog.CbType.Text) @@ -928,7 +822,74 @@ lbDlog: Me.Close() End Sub +#Region "Cycle list" + + Private Sub LvCycles_DoubleClick(sender As Object, e As System.EventArgs) Handles LvCycles.DoubleClick + If Me.LvCycles.SelectedItems.Count > 0 Then OpenFiles(fFileRepl(Me.LvCycles.SelectedItems(0).SubItems(0).Text, fPATH(VECTOfile))) + End Sub + + Private Sub LvCycles_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles LvCycles.KeyDown + Select Case e.KeyCode + Case Keys.Delete, Keys.Back + RemoveCycle() + Case Keys.Enter + If Me.LvCycles.SelectedItems.Count > 0 Then Me.LvCycles.SelectedItems(0).BeginEdit() + End Select + End Sub + + Private Sub BtDRIadd_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIadd.Click + Dim str As String + Dim GenDir As String + + GenDir = fPATH(VECTOfile) + + If fbDRI.OpenDialog("", True) Then + + For Each str In fbDRI.Files + Me.LvCycles.Items.Add(fFileWoDir(str, GenDir)) + Next + + Change() + + End If + + End Sub + + Private Sub BtDRIrem_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIrem.Click + RemoveCycle() + End Sub + + Private Sub RemoveCycle() + Dim i As Integer + + If LvCycles.SelectedItems.Count = 0 Then + If LvCycles.Items.Count = 0 Then + Exit Sub + Else + LvCycles.Items(LvCycles.Items.Count - 1).Selected = True + End If + End If + + i = LvCycles.SelectedItems(0).Index + + LvCycles.SelectedItems(0).Remove() + + If LvCycles.Items.Count > 0 Then + If i < LvCycles.Items.Count Then + LvCycles.Items(i).Selected = True + Else + LvCycles.Items(LvCycles.Items.Count - 1).Selected = True + End If + + LvCycles.Focus() + End If + + Change() + + End Sub + +#End Region #Region "Enable/Disable GUI controls" @@ -993,7 +954,7 @@ lbDlog: #End Region -Public Sub UpdatePic() + Public Sub UpdatePic() Dim VEH0 As New cVEH Dim ENG0 As cENG Dim GBX0 As cGBX @@ -1246,6 +1207,7 @@ Public Sub UpdatePic() End Sub + #Region "Open File Context Menu" Private CmFiles As String() @@ -1280,74 +1242,6 @@ Public Sub UpdatePic() #End Region -#Region "Cycle list" - - Private Sub LvCycles_DoubleClick(sender As Object, e As System.EventArgs) Handles LvCycles.DoubleClick - If Me.LvCycles.SelectedItems.Count > 0 Then OpenFiles(fFileRepl(Me.LvCycles.SelectedItems(0).SubItems(0).Text, fPATH(VECTOfile))) - End Sub - - Private Sub LvCycles_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles LvCycles.KeyDown - Select Case e.KeyCode - Case Keys.Delete, Keys.Back - RemoveCycle() - Case Keys.Enter - If Me.LvCycles.SelectedItems.Count > 0 Then Me.LvCycles.SelectedItems(0).BeginEdit() - End Select - End Sub - - - Private Sub BtDRIadd_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIadd.Click - Dim str As String - Dim GenDir As String - - GenDir = fPATH(VECTOfile) - - If fbDRI.OpenDialog("", True) Then - - For Each str In fbDRI.Files - Me.LvCycles.Items.Add(fFileWoDir(str, GenDir)) - Next - - Change() - - End If - - End Sub - - Private Sub BtDRIrem_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIrem.Click - RemoveCycle() - End Sub - - Private Sub RemoveCycle() - Dim i As Integer - - If LvCycles.SelectedItems.Count = 0 Then - If LvCycles.Items.Count = 0 Then - Exit Sub - Else - LvCycles.Items(LvCycles.Items.Count - 1).Selected = True - End If - End If - - i = LvCycles.SelectedItems(0).Index - - LvCycles.SelectedItems(0).Remove() - - If LvCycles.Items.Count > 0 Then - If i < LvCycles.Items.Count Then - LvCycles.Items(i).Selected = True - Else - LvCycles.Items(LvCycles.Items.Count - 1).Selected = True - End If - - LvCycles.Focus() - End If - - Change() - - End Sub - -#End Region End Class diff --git a/VECTO/GUI/F_VEH_AuxDlog.Designer.vb b/VECTO/GUI/F_VEH_AuxDlog.Designer.vb index c6aefd30bd..55414e1091 100644 --- a/VECTO/GUI/F_VEH_AuxDlog.Designer.vb +++ b/VECTO/GUI/F_VEH_AuxDlog.Designer.vb @@ -32,6 +32,7 @@ Partial Class F_VEH_AuxDlog 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() Me.OK_Button = New System.Windows.Forms.Button() Me.Cancel_Button = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() @@ -45,35 +46,29 @@ Partial Class F_VEH_AuxDlog Me.Label4 = New System.Windows.Forms.Label() Me.CbTech = New System.Windows.Forms.ComboBox() Me.PnTech = New System.Windows.Forms.Panel() - Me.LVTech = New System.Windows.Forms.ListView() - Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader) - Me.Tabs = New System.Windows.Forms.TabControl() - Me.tabMain = New System.Windows.Forms.TabPage() Me.PnFile = New System.Windows.Forms.Panel() - Me.Label6 = New System.Windows.Forms.Label() - Me.Label5 = New System.Windows.Forms.Label() - Me.txtPulleyGearRatio = New System.Windows.Forms.TextBox() - Me.txtPulleyGearEfficiency = New System.Windows.Forms.TextBox() - Me.tabListItems = New System.Windows.Forms.TabPage() - Me.pnlListItems = New System.Windows.Forms.Panel() - Me.dgvInputs = New System.Windows.Forms.DataGridView() - Me.ItemName = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.ItemValue = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.btnConsumerRemove = New System.Windows.Forms.Button() - Me.btnConsumerAdd = New System.Windows.Forms.Button() - Me.tabTechnologies = New System.Windows.Forms.TabPage() - Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() + Me.LVTech = New System.Windows.Forms.ListView() + Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.TableLayoutPanel1.SuspendLayout() Me.PnTech.SuspendLayout() - Me.Tabs.SuspendLayout() - Me.tabMain.SuspendLayout() Me.PnFile.SuspendLayout() - Me.tabListItems.SuspendLayout() - Me.pnlListItems.SuspendLayout() - CType(Me.dgvInputs, System.ComponentModel.ISupportInitialize).BeginInit() - Me.tabTechnologies.SuspendLayout() - Me.TableLayoutPanel1.SuspendLayout() Me.SuspendLayout() ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.TableLayoutPanel1.ColumnCount = 2 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) + Me.TableLayoutPanel1.Location = New System.Drawing.Point(301, 388) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 1 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 29) + Me.TableLayoutPanel1.TabIndex = 25 + ' 'OK_Button ' Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None @@ -181,58 +176,14 @@ Partial Class F_VEH_AuxDlog ' Me.PnTech.Controls.Add(Me.CbTech) Me.PnTech.Controls.Add(Me.Label4) - Me.PnTech.Location = New System.Drawing.Point(31, 52) + Me.PnTech.Location = New System.Drawing.Point(12, 12) Me.PnTech.Name = "PnTech" Me.PnTech.Size = New System.Drawing.Size(435, 34) Me.PnTech.TabIndex = 28 ' - 'LVTech - ' - Me.LVTech.CheckBoxes = True - Me.LVTech.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1}) - Me.LVTech.FullRowSelect = True - Me.LVTech.GridLines = True - Me.LVTech.Location = New System.Drawing.Point(31, 92) - Me.LVTech.Name = "LVTech" - Me.LVTech.Size = New System.Drawing.Size(435, 202) - Me.LVTech.TabIndex = 30 - Me.LVTech.UseCompatibleStateImageBehavior = False - Me.LVTech.View = System.Windows.Forms.View.Details - ' - 'ColumnHeader1 - ' - Me.ColumnHeader1.Text = "Technologies" - Me.ColumnHeader1.Width = 420 - ' - 'Tabs - ' - Me.Tabs.Controls.Add(Me.tabMain) - Me.Tabs.Controls.Add(Me.tabListItems) - Me.Tabs.Controls.Add(Me.tabTechnologies) - Me.Tabs.Location = New System.Drawing.Point(12, 24) - Me.Tabs.Name = "Tabs" - Me.Tabs.SelectedIndex = 0 - Me.Tabs.Size = New System.Drawing.Size(505, 387) - Me.Tabs.TabIndex = 35 - ' - 'tabMain - ' - Me.tabMain.Controls.Add(Me.PnFile) - Me.tabMain.Location = New System.Drawing.Point(4, 22) - Me.tabMain.Name = "tabMain" - Me.tabMain.Padding = New System.Windows.Forms.Padding(3) - Me.tabMain.Size = New System.Drawing.Size(497, 361) - Me.tabMain.TabIndex = 0 - Me.tabMain.Text = "Main" - Me.tabMain.UseVisualStyleBackColor = True - ' 'PnFile ' Me.PnFile.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.PnFile.Controls.Add(Me.Label6) - Me.PnFile.Controls.Add(Me.Label5) - Me.PnFile.Controls.Add(Me.txtPulleyGearRatio) - Me.PnFile.Controls.Add(Me.txtPulleyGearEfficiency) Me.PnFile.Controls.Add(Me.LbIDhelp) Me.PnFile.Controls.Add(Me.BtBrowse) Me.PnFile.Controls.Add(Me.CbType) @@ -241,128 +192,28 @@ Partial Class F_VEH_AuxDlog Me.PnFile.Controls.Add(Me.Label2) Me.PnFile.Controls.Add(Me.Label3) Me.PnFile.Controls.Add(Me.Label1) - Me.PnFile.Location = New System.Drawing.Point(16, 55) + Me.PnFile.Location = New System.Drawing.Point(12, 293) Me.PnFile.Name = "PnFile" - Me.PnFile.Size = New System.Drawing.Size(435, 231) + Me.PnFile.Size = New System.Drawing.Size(435, 89) Me.PnFile.TabIndex = 29 ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(242, 109) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(98, 13) - Me.Label6.TabIndex = 34 - Me.Label6.Text = "Pulley Gear Ratio : " - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(16, 109) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(119, 13) - Me.Label5.TabIndex = 33 - Me.Label5.Text = "Pulley Gear Efficiency : " - ' - 'txtPulleyGearRatio - ' - Me.txtPulleyGearRatio.Location = New System.Drawing.Point(346, 105) - Me.txtPulleyGearRatio.Name = "txtPulleyGearRatio" - Me.txtPulleyGearRatio.Size = New System.Drawing.Size(72, 20) - Me.txtPulleyGearRatio.TabIndex = 32 - ' - 'txtPulleyGearEfficiency - ' - Me.txtPulleyGearEfficiency.Location = New System.Drawing.Point(136, 105) - Me.txtPulleyGearEfficiency.Name = "txtPulleyGearEfficiency" - Me.txtPulleyGearEfficiency.Size = New System.Drawing.Size(76, 20) - Me.txtPulleyGearEfficiency.TabIndex = 31 - ' - 'tabListItems - ' - Me.tabListItems.Controls.Add(Me.pnlListItems) - Me.tabListItems.Location = New System.Drawing.Point(4, 22) - Me.tabListItems.Name = "tabListItems" - Me.tabListItems.Padding = New System.Windows.Forms.Padding(3) - Me.tabListItems.Size = New System.Drawing.Size(497, 361) - Me.tabListItems.TabIndex = 1 - Me.tabListItems.Text = "ListItems" - Me.tabListItems.UseVisualStyleBackColor = True - ' - 'pnlListItems - ' - Me.pnlListItems.Controls.Add(Me.dgvInputs) - Me.pnlListItems.Controls.Add(Me.btnConsumerRemove) - Me.pnlListItems.Controls.Add(Me.btnConsumerAdd) - Me.pnlListItems.Location = New System.Drawing.Point(19, 31) - Me.pnlListItems.Name = "pnlListItems" - Me.pnlListItems.Size = New System.Drawing.Size(452, 324) - Me.pnlListItems.TabIndex = 35 - ' - 'dgvInputs - ' - Me.dgvInputs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgvInputs.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.ItemName, Me.ItemValue}) - Me.dgvInputs.Location = New System.Drawing.Point(3, 42) - Me.dgvInputs.Name = "dgvInputs" - Me.dgvInputs.Size = New System.Drawing.Size(432, 268) - Me.dgvInputs.TabIndex = 31 - ' - 'ItemName - ' - Me.ItemName.HeaderText = "ItemName" - Me.ItemName.Name = "ItemName" - Me.ItemName.Width = 289 - ' - 'ItemValue - ' - Me.ItemValue.HeaderText = "ItemValue" - Me.ItemValue.Name = "ItemValue" - ' - 'btnConsumerRemove - ' - Me.btnConsumerRemove.Enabled = False - Me.btnConsumerRemove.Image = Global.VECTO.My.Resources.Resources.minus_circle_icon - Me.btnConsumerRemove.Location = New System.Drawing.Point(406, 13) - Me.btnConsumerRemove.Name = "btnConsumerRemove" - Me.btnConsumerRemove.Size = New System.Drawing.Size(29, 23) - Me.btnConsumerRemove.TabIndex = 34 - Me.btnConsumerRemove.UseVisualStyleBackColor = True - ' - 'btnConsumerAdd - ' - Me.btnConsumerAdd.Image = Global.VECTO.My.Resources.Resources.plus_circle_icon - Me.btnConsumerAdd.Location = New System.Drawing.Point(353, 13) - Me.btnConsumerAdd.Name = "btnConsumerAdd" - Me.btnConsumerAdd.Size = New System.Drawing.Size(29, 23) - Me.btnConsumerAdd.TabIndex = 33 - Me.btnConsumerAdd.UseVisualStyleBackColor = True - ' - 'tabTechnologies - ' - Me.tabTechnologies.Controls.Add(Me.PnTech) - Me.tabTechnologies.Controls.Add(Me.LVTech) - Me.tabTechnologies.Location = New System.Drawing.Point(4, 22) - Me.tabTechnologies.Name = "tabTechnologies" - Me.tabTechnologies.Size = New System.Drawing.Size(497, 361) - Me.tabTechnologies.TabIndex = 2 - Me.tabTechnologies.Text = "Technologies" - Me.tabTechnologies.UseVisualStyleBackColor = True + 'LVTech ' - 'TableLayoutPanel1 + Me.LVTech.CheckBoxes = True + Me.LVTech.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1}) + Me.LVTech.FullRowSelect = True + Me.LVTech.GridLines = True + Me.LVTech.Location = New System.Drawing.Point(12, 52) + Me.LVTech.Name = "LVTech" + Me.LVTech.Size = New System.Drawing.Size(435, 235) + Me.LVTech.TabIndex = 30 + Me.LVTech.UseCompatibleStateImageBehavior = False + Me.LVTech.View = System.Windows.Forms.View.Details ' - Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TableLayoutPanel1.ColumnCount = 2 - Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) - Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) - Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) - Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) - Me.TableLayoutPanel1.Location = New System.Drawing.Point(385, 440) - Me.TableLayoutPanel1.Name = "TableLayoutPanel1" - Me.TableLayoutPanel1.RowCount = 1 - Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) - Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 29) - Me.TableLayoutPanel1.TabIndex = 25 + 'ColumnHeader1 + ' + Me.ColumnHeader1.Text = "Technologies" + Me.ColumnHeader1.Width = 420 ' 'F_VEH_AuxDlog ' @@ -370,8 +221,10 @@ Partial Class F_VEH_AuxDlog Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.Cancel_Button - Me.ClientSize = New System.Drawing.Size(543, 481) - Me.Controls.Add(Me.Tabs) + Me.ClientSize = New System.Drawing.Size(459, 429) + Me.Controls.Add(Me.LVTech) + Me.Controls.Add(Me.PnFile) + Me.Controls.Add(Me.PnTech) Me.Controls.Add(Me.TableLayoutPanel1) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog Me.MaximizeBox = False @@ -380,20 +233,15 @@ Partial Class F_VEH_AuxDlog Me.ShowInTaskbar = False Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent Me.Text = "Auxiliary" + Me.TableLayoutPanel1.ResumeLayout(False) Me.PnTech.ResumeLayout(False) Me.PnTech.PerformLayout() - Me.Tabs.ResumeLayout(False) - Me.tabMain.ResumeLayout(False) Me.PnFile.ResumeLayout(False) Me.PnFile.PerformLayout() - Me.tabListItems.ResumeLayout(False) - Me.pnlListItems.ResumeLayout(False) - CType(Me.dgvInputs, System.ComponentModel.ISupportInitialize).EndInit() - Me.tabTechnologies.ResumeLayout(False) - Me.TableLayoutPanel1.ResumeLayout(False) Me.ResumeLayout(False) End Sub + Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel Friend WithEvents OK_Button As System.Windows.Forms.Button Friend WithEvents Cancel_Button As System.Windows.Forms.Button Friend WithEvents Label1 As System.Windows.Forms.Label @@ -407,23 +255,8 @@ Partial Class F_VEH_AuxDlog Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents CbTech As System.Windows.Forms.ComboBox Friend WithEvents PnTech As System.Windows.Forms.Panel + Friend WithEvents PnFile As System.Windows.Forms.Panel Friend WithEvents LVTech As System.Windows.Forms.ListView Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader - Friend WithEvents Tabs As System.Windows.Forms.TabControl - Friend WithEvents tabMain As System.Windows.Forms.TabPage - Friend WithEvents tabListItems As System.Windows.Forms.TabPage - Friend WithEvents btnConsumerRemove As System.Windows.Forms.Button - Friend WithEvents btnConsumerAdd As System.Windows.Forms.Button - Friend WithEvents dgvInputs As System.Windows.Forms.DataGridView - Friend WithEvents ItemName As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ItemValue As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents tabTechnologies As System.Windows.Forms.TabPage - Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel - Friend WithEvents PnFile As System.Windows.Forms.Panel - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents txtPulleyGearRatio As System.Windows.Forms.TextBox - Friend WithEvents txtPulleyGearEfficiency As System.Windows.Forms.TextBox - Friend WithEvents pnlListItems As System.Windows.Forms.Panel End Class diff --git a/VECTO/GUI/F_VEH_AuxDlog.resx b/VECTO/GUI/F_VEH_AuxDlog.resx index d666c55242..1af7de150c 100644 --- a/VECTO/GUI/F_VEH_AuxDlog.resx +++ b/VECTO/GUI/F_VEH_AuxDlog.resx @@ -117,10 +117,4 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="ItemName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="ItemValue.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> </root> \ No newline at end of file diff --git a/VECTO/GUI/F_VEH_AuxDlog.vb b/VECTO/GUI/F_VEH_AuxDlog.vb index a32d29639e..093bac2547 100644 --- a/VECTO/GUI/F_VEH_AuxDlog.vb +++ b/VECTO/GUI/F_VEH_AuxDlog.vb @@ -10,7 +10,6 @@ ' See the LICENSE.txt for the specific language governing permissions and limitations. Imports System.Windows.Forms Imports System.Collections.Generic -Imports VectoAuxiliaries.Hvac ''' <summary> ''' Aux Config Editor (Job Editor sub-dialog) @@ -20,9 +19,6 @@ Public Class F_VEH_AuxDlog Public VehPath As String = "" - Public Property ListItems As New Dictionary(Of String, Single) - - 'New instance Public Sub New() @@ -41,47 +37,23 @@ Public Class F_VEH_AuxDlog End Sub - - - 'Initialise form Private Sub F_VEH_AuxDlog_Load(sender As Object, e As System.EventArgs) Handles Me.Load Me.Text = CbType.Text End Sub - 'Set generic values for Declaration mode Private Sub DeclInit() Dim txt As String Dim kv As KeyValuePair(Of String, Dictionary(Of tMission, Single)) - Me.CbTech.Items.Clear() - - 'Added this section to enable or disable the new controls for Post file version 2 - TB 25/9/14 - Tabs.TabPages.Clear() - Tabs.TabPages.Add(tabMain) - - Select Case TbID.Text - - Case sKey.AUX.ElecSys.ToString() - tabListItems.Text = "Electrical Consumers" - Tabs.TabPages.Add(tabListItems) - - Case sKey.AUX.PneumSys.ToString() - tabListItems.Text = "Pneumatic Consumers" - Tabs.TabPages.Add(tabListItems) - - Case sKey.AUX.HVAC.ToString() - tabListItems.Text = "Map Inputs" - Tabs.TabPages.Add(tabListItems) - - Case sKey.AUX.Fan - Tabs.TabPages.Add(tabTechnologies) - - Case sKey.AUX.SteerPump - Tabs.TabPages.Add(tabTechnologies) + If Not Cfg.DeclMode Then + Me.LVTech.Visible = False + Me.Height = 220 + Exit Sub + End If - End Select + Me.CbTech.Items.Clear() Select Case TbID.Text Case sKey.AUX.Fan @@ -107,7 +79,7 @@ Public Class F_VEH_AuxDlog Me.CbTech.SelectedIndex = 0 - Case sKey.AUX.PneumSys + Case Else 'sKey.AUX.PneumSys For Each txt In Declaration.AuxTechs(tAux.PneumSys) Me.CbTech.Items.Add(txt) Next @@ -124,14 +96,12 @@ Public Class F_VEH_AuxDlog Next Me.LVTech.Visible = True - 'TB Removed for newer design of existing form 25/9/14 - ' Me.Height = 457 + Me.Height = 457 Else Me.LVTech.Visible = False - 'TB Removed for newer design of existing form 25/9/14 - ' Me.Height = 220 + Me.Height = 220 End If @@ -165,164 +135,26 @@ Public Class F_VEH_AuxDlog If Cfg.DeclMode Then - 'Old Tech only seems to apply to electricals - If Me.CbTech.Text = "" AndAlso sKey.AUX.ElecSys.ToString() = TbID.Text Then + If Me.CbTech.Text = "" Then MsgBox("Form is incomplete!", MsgBoxStyle.Critical) e.Cancel = True End If Else - 'Engineering Mode If Trim(Me.TbPath.Text) = "" Then MsgBox("Form is incomplete!", MsgBoxStyle.Critical) e.Cancel = True End If - 'Determin specific Validation based on type - Select Case TbID.Text - - Case sKey.AUX.HVAC - e.Cancel = Not ValidateHVAC() - - - - End Select - - - End If End If End Sub - ''' <summary> - ''' HVAC VALIDATION - ''' </summary> - ''' <returns></returns> - ''' <remarks></remarks> - Private Function ValidateHVAC() As Boolean - - Dim message As String = String.Empty - - 'Validate Pulley - If Not ValidatePulley(message) Then - MessageBox.Show(message) - Return False - End If - - 'Validate Inputs - If Not ValidateHVACInputs(message) Then - MessageBox.Show(message) - Return False - End If - - Return True - - End Function - - ''' <summary> - ''' HVAC and Alternators use pulleys, this routine checks them - ''' </summary> - ''' <param name="message"></param> - ''' <returns></returns> - ''' <remarks></remarks> - Private Function ValidatePulley(ByRef message As String) As Boolean - - Dim pulleyEfficiency As String = txtPulleyGearEfficiency.Text.Trim - Dim pulleyGearRatio As String = txtPulleyGearRatio.Text.Trim - - 'Values present - If (pulleyEfficiency.Length = 0) OrElse (pulleyGearRatio.Length = 0) Then - message = "Please fill in the pulley values in the main tab." - Return False - End If - - 'Values numeric - If Not IsNumeric(pulleyEfficiency) OrElse Not IsNumeric(pulleyGearRatio) Then - message = "One of the pulley values on the main tab is not a numeric value." - Return False - End If - - 'Value Ranges - Dim efficiencyValue As Single = CType(pulleyEfficiency, Single) - Dim gearRatio As Single = CType(pulleyGearRatio, Single) - - Const TooLowRatio As Single = 0.0 - Const TooHighRatio As Single = 6.0 - Const TooLowEfficiency As Single = 0 - Const TooHighEfficiency As Single = 1 - - 'Efficiency check - If (efficiencyValue <= TooLowEfficiency) OrElse (efficiencyValue >= TooHighEfficiency) Then - message = "Efficiency value must be greater than 0 and less than 1" - Return False - End If - - 'Ratio Check - If (gearRatio <= TooLowRatio) OrElse (gearRatio >= TooHighRatio) Then - message = "Pulley gear ratio value must be greater than 0 and less than 6" - Return False - End If - - message = String.Empty - Return True - - End Function - - ''' <summary> - ''' HVAC Require the correct number of inputs, for this we need to instantiate the HVACLoad Demand - ''' Using the HVACMap lookup Map File - ''' </summary> - ''' <param name="message"></param> - ''' <returns></returns> - ''' <remarks></remarks> - Private Function ValidateHVACInputs(ByRef message As String) As Boolean - - 'Validate Number of inputs - If dgvInputs.Rows.Count < 2 Then - message = "No Inputs are available please select the lookup map on the Main tab" - Return False - End If - - Return True - - End Function - 'Browse for .vaux files Private Sub BtBrowse_Click(sender As System.Object, e As System.EventArgs) Handles BtBrowse.Click - - If fbAUX.OpenDialog(fFileRepl(Me.TbPath.Text, VehPath)) Then Me.TbPath.Text = fFileWoDir(fbAUX.Files(0), VehPath) - - If (TbID.Text = sKey.AUX.HVAC AndAlso Me.TbPath.Text.Length <> 0) Then - 'Dim frmHVAC As New VectoAuxiliaries.UI.F_HVAC(Me.TbPath.Text) - - ''If we have results then populate the inputs tab - 'If (frmHVAC.ShowDialog() = Windows.Forms.DialogResult.OK) Then - - ' dgvInputs.Rows.Clear() - - ' ListItems.Clear() - - ' For Each item As KeyValuePair(Of String, String) In frmHVAC.Inputs - - ' Dim row As DataGridViewRow = dgvInputs.Rows(dgvInputs.Rows.Add()) - ' row.Cells(0).Value = item.Key - ' row.Cells(1).Value = item.Value - - - ' ListItems.Add(item.Key, item.Value) - - ' Next - - - 'End If - - - End If - - End Sub 'Update ID when Aux Type was changed @@ -340,15 +172,13 @@ Public Class F_VEH_AuxDlog Case Else '2 Me.TbID.Text = sKey.AUX.HVAC + End Select Else Me.TbID.Text = Trim(UCase(Me.CbType.Text.Substring(0, CInt(Math.Min(Me.CbType.Text.Length, 3))))) End If End If - - - End Sub 'Update help label if ID was changed @@ -365,25 +195,4 @@ Public Class F_VEH_AuxDlog End Sub - Private Sub btnConsumerAdd_Click(sender As Object, e As EventArgs) Handles btnConsumerAdd.Click - - End Sub - - - Public Sub ClearAllValues(Optional clearTypes As Boolean = False) - - If (clearTypes) Then - Me.CbType.SelectedIndex = -1 - Me.CbType.Text = "" - Me.TbID.Text = "" - End If - - Me.TbPath.Text = "" - Me.txtPulleyGearEfficiency.Text = String.Empty - Me.txtPulleyGearRatio.Text = String.Empty - Me.dgvInputs.ClearSelection() - Me.LVTech.Clear() - - End Sub - End Class diff --git a/VECTO/Input Files/cVECTO.vb b/VECTO/Input Files/cVECTO.vb index d64bcba953..05e289f9b5 100644 --- a/VECTO/Input Files/cVECTO.vb +++ b/VECTO/Input Files/cVECTO.vb @@ -9,7 +9,6 @@ ' ' See the LICENSE.txt for the specific language governing permissions and limitations. - Imports System.Collections.Generic Public Class cVECTO @@ -60,7 +59,16 @@ Public Class cVECTO Public SavedInDeclMode As Boolean + Public Class cAuxEntry + Public Type As String + Public Path As cSubPath + Public TechStr As String = "" + + Public Sub New() + Path = New cSubPath + End Sub + End Class Public Function CreateFileList() As Boolean Dim Aux0 As cAuxEntry @@ -183,8 +191,6 @@ Public Class cVECTO dic0.Add("Cycles", ls) End If - 'Limited Information regarding Auxillaries under 2.0.4-Beta release, - 'Aux If AuxPaths.Count > 0 Then ls = New List(Of Object) @@ -195,30 +201,9 @@ Public Class cVECTO dic.Add("Path", AuxEntryKV.Value.Path.PathOrDummy) dic.Add("Technology", AuxEntryKV.Value.TechStr) - 'TB 29/9/2014 - Augmentation of Auxillary information to be stored in the configuration file post 2.0.4-Beta release - - ''TODO - TB BIG CHANGE HERE ELECTRICAL SYSTEM - 'If AuxEntryKV.Key = sKey.AUX.ElecSys Then - ' dic.Add("PulleyGearEfficiencyES", AuxEntryKV.Value.PulleyGearEfficiencyES) - ' dic.Add("PulleyGearRatioES", AuxEntryKV.Value.PulleyGearRatioES) - ' dic.Add("TechList", EStechs) - ' dic.Add("ConsumersES", AuxEntryKV.Value.ConsumerListES) - 'End If - - ''TODO - TB BIG CHANGE HERE ( HVAC SYSTEM ) - 'If AuxEntryKV.Key = sKey.AUX.HVAC Then - ' dic.Add("PulleyGearEfficiencyHVAC", AuxEntryKV.Value.PulleyGearEfficiencyHVAC) - ' dic.Add("PulleyGearRatioHVAC", AuxEntryKV.Value.PulleyGearRatioHVAC) - ' dic.Add("MapInputs", AuxEntryKV.Value.HVACMapInputs) - 'End If - - ''TODO - TB BIG CHANGE HERE ( PNEUMATIC SYSTEM ) - 'If AuxEntryKV.Key = sKey.AUX.PneumSys Then - ' dic.Add("PulleyGearEfficiencyPS", AuxEntryKV.Value.PulleyGearEfficiencyPS) - ' dic.Add("PulleyGearRatioPS", AuxEntryKV.Value.PulleyGearRatioPS) - ' dic.Add("ConsumersPS", AuxEntryKV.Value.ConsumerListPS) - - 'End If + If AuxEntryKV.Key = sKey.AUX.ElecSys Then + dic.Add("TechList", EStechs) + End If ls.Add(dic) Next @@ -321,7 +306,6 @@ Public Class cVECTO AuxEntry.Type = dic("Type") AuxEntry.Path.Init(MyPath, dic("Path")) - If Not dic("Technology") Is Nothing Then AuxEntry.TechStr = dic("Technology") AuxPaths.Add(AuxID, AuxEntry) @@ -336,9 +320,6 @@ Public Class cVECTO End If End If - 'TB 29/9/2014 Here is where we read the Auxilliary Augmented Properties where they appear. - ' - Next End If -- GitLab