From 7fc6c1fff602b829761b2328680c63086da2f937 Mon Sep 17 00:00:00 2001 From: "Burns, Terry" <Terry.Burns@ricardo.com> Date: Tue, 30 Sep 2014 15:29:38 +0000 Subject: [PATCH] Reading File Up To VECO level, just about to pus through to the AudDlg itself. - Saftey Checkin git-tfs-id: [http://tfs00.element.root.com:8080/tfs/TFSCollection]$/VECTO;C1624 --- VECTO/GUI/F_VECTO.Designer.vb | 2 +- VECTO/GUI/F_VECTO.vb | 96 +++++++++++++++++++++++++++++++++-- VECTO/GUI/F_VEH_AuxDlog.vb | 3 ++ VECTO/Input Files/cVECTO.vb | 36 +++++++++++-- VECTO/VECTO.vbproj | 1 + 5 files changed, 131 insertions(+), 7 deletions(-) diff --git a/VECTO/GUI/F_VECTO.Designer.vb b/VECTO/GUI/F_VECTO.Designer.vb index a8d8868ab1..b121c8e048 100644 --- a/VECTO/GUI/F_VECTO.Designer.vb +++ b/VECTO/GUI/F_VECTO.Designer.vb @@ -1079,7 +1079,7 @@ Partial Class F_VECTO Me.ResumeLayout(False) Me.PerformLayout() - End Sub +End Sub Friend WithEvents TabPgGen As System.Windows.Forms.TabPage Friend WithEvents TabControl1 As System.Windows.Forms.TabControl Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip diff --git a/VECTO/GUI/F_VECTO.vb b/VECTO/GUI/F_VECTO.vb index aff9881192..f299d9a392 100644 --- a/VECTO/GUI/F_VECTO.vb +++ b/VECTO/GUI/F_VECTO.vb @@ -363,6 +363,8 @@ Public Class F_VECTO If Not VEC0.ReadFile() Then VEC0 = Nothing MsgBox("Failed to load " & fFILE(file, True) & "!") + + Exit Sub End If Catch ex As Exception @@ -384,6 +386,9 @@ Public Class F_VECTO End If + + + 'Update Form 'Files ----------------------------- @@ -416,11 +421,45 @@ Public Class F_VECTO 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. + 'TB 30/9/14 - Read Aux Path Entries and add to form. + If Not VEC0.AuxPaths(sKey.AUX.HVAC) Is Nothing Then + + If (Not VEC0.AuxPaths(sKey.AUX.HVAC).HVACMapInputs Is Nothing) Then + HVACMapInputs = VEC0.AuxPaths(sKey.AUX.HVAC).HVACMapInputs + Else + HVACMapInputs = New Dictionary(Of String, Single)() + End If + + PulleyGearEfficiencyHVAC = VEC0.AuxPaths(sKey.AUX.HVAC).PulleyGearEfficiencyHVAC + PulleyGearRatioHVAC = VEC0.AuxPaths(sKey.AUX.HVAC).PulleyGearRatioHVAC + End If + If Not VEC0.AuxPaths(sKey.AUX.ElecSys) Is Nothing Then + + If (Not VEC0.AuxPaths(sKey.AUX.ElecSys).ConsumerListES Is Nothing) Then + ConsumerListES = VEC0.AuxPaths(sKey.AUX.ElecSys).ConsumerListES + Else + ConsumerListES = New List(Of VectoAuxiliaries.Electrics.ElectricalConsumer) + End If + + PulleyGearEfficiencyES = VEC0.AuxPaths(sKey.AUX.ElecSys).PulleyGearEfficiencyES + PulleyGearRatioES = VEC0.AuxPaths(sKey.AUX.ElecSys).PulleyGearEfficiencyES + End If + + If Not VEC0.AuxPaths(sKey.AUX.PneumSys).ConsumerListPS Is Nothing Then + + If (Not VEC0.AuxPaths(sKey.AUX.PneumSys).ConsumerListPS Is Nothing) Then + ConsumerListPS = VEC0.AuxPaths(sKey.AUX.PneumSys).ConsumerListPS + Else + ConsumerListPS = New List(Of VectoAuxiliaries.Pneumatics.PneumaticConsumer) + End If + + PulleyGearEfficiencyPS = VEC0.AuxPaths(sKey.AUX.ElecSys).PulleyGearEfficiencyPS + PulleyGearRatioES = VEC0.AuxPaths(sKey.AUX.ElecSys).PulleyGearEfficiencyPS + + End If End If LvAux.Items.Add(LV0) @@ -818,11 +857,59 @@ lbDlog: AuxDlog.TbPath.Text = SelItem.SubItems(2).Text End If + + 'Preset the DIALOG Details depending on the edit type. + AuxDlog.ListItems.Clear() + Select AuxDlog.TbID.Text + + '**** ELECTRICS **** + Case sKey.AUX.ElecSys.ToString() + For Each item As VectoAuxiliaries.Electrics.ElectricalConsumer In ConsumerListES + AuxDlog.ListItems.Add(item.Name, item.Power) + Next + + AuxDlog.txtPulleyGearEfficiency.Text = PulleyGearEfficiencyES.ToString() + AuxDlog.txtPulleyGearRatio.Text = PulleyGearRatioES.ToString() + + '============================================================================================ + + '**** PNEUMATICS **** + Case sKey.AUX.PneumSys.ToString() + For Each item As VectoAuxiliaries.Pneumatics.PneumaticConsumer In ConsumerListPS + AuxDlog.ListItems.Add(item.Name, item.VolumePerCycle) + Next + + '------Get Pully Values + AuxDlog.txtPulleyGearEfficiency.Text = PulleyGearEfficiencyPS.ToString() + AuxDlog.txtPulleyGearRatio.Text = PulleyGearRatioPS + + '============================================================================================ + + '**** HVAC **** + Case sKey.AUX.HVAC.ToString() + + '----- Get list of MAP Inputs + + For Each item As KeyValuePair(Of String, Single) In HVACMapInputs + AuxDlog.ListItems.Add(item.Key, item.Value) + Next + + '------Get Pully Values + AuxDlog.txtPulleyGearEfficiency.Text = PulleyGearEfficiencyHVAC.ToString() + AuxDlog.txtPulleyGearRatio.Text = PulleyGearRatioHVAC.ToString() + + '============================================================================================ + + + End Select + If AuxDlog.ShowDialog = Windows.Forms.DialogResult.OK Then -'Set New Systems Properties + + 'GET DIALOG DETAILS Dependend on type being edited. + Select Case AuxDlog.TbID.Text '**** ELECTRICS **** @@ -1350,4 +1437,7 @@ Public Sub UpdatePic() #End Region +Private Sub LvAux_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LvAux.SelectedIndexChanged + +End Sub End Class diff --git a/VECTO/GUI/F_VEH_AuxDlog.vb b/VECTO/GUI/F_VEH_AuxDlog.vb index 068a2ba1f8..e076506e0a 100644 --- a/VECTO/GUI/F_VEH_AuxDlog.vb +++ b/VECTO/GUI/F_VEH_AuxDlog.vb @@ -41,6 +41,9 @@ 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 diff --git a/VECTO/Input Files/cVECTO.vb b/VECTO/Input Files/cVECTO.vb index 60186ceda9..abfd86129b 100644 --- a/VECTO/Input Files/cVECTO.vb +++ b/VECTO/Input Files/cVECTO.vb @@ -210,7 +210,7 @@ Public Class cVECTO 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) + dic.Add("HVACMapInputs", AuxEntryKV.Value.HVACMapInputs) End If 'TODO - TB BIG CHANGE HERE ( PNEUMATIC SYSTEM ) @@ -329,16 +329,46 @@ Public Class cVECTO AuxDef = True + + + 'TB 29/9/2014 Here is where we read the Auxilliary Augmented Properties where they appear. + + 'Electrical System If AuxID = sKey.AUX.ElecSys Then If Not dic("TechList") Is Nothing Then For Each str In dic("TechList") EStechs.Add(str) Next End If + + End If + + + 'HVAC System + If AuxID = sKey.AUX.HVAC Then + + If Not dic("HVACMapInputs") Is Nothing Then + AuxEntry.HVACMapInputs = Newtonsoft.Json.JsonConvert.DeserializeObject(dic("HVACMapInputs").ToString, GetType(Dictionary(Of String, Single))) + End If + + If Not dic("PulleyGearRatioHVAC") Is Nothing Then + AuxEntry.PulleyGearRatioHVAC = dic("PulleyGearRatioHVAC") + End If + + If Not dic("PulleyGearEfficiencyHVAC") Is Nothing Then + AuxEntry.PulleyGearEfficiencyHVAC = dic("PulleyGearEfficiencyHVAC") + End If + + + End If + + + 'Pneumatic Systems + If AuxID = sKey.AUX.PneumSys Then + + End If - 'TB 29/9/2014 Here is where we read the Auxilliary Augmented Properties where they appear. - ' Next End If diff --git a/VECTO/VECTO.vbproj b/VECTO/VECTO.vbproj index 4eca1918c8..79274f9429 100644 --- a/VECTO/VECTO.vbproj +++ b/VECTO/VECTO.vbproj @@ -177,6 +177,7 @@ </Compile> <Compile Include="Input Files\cAux.vb" /> <Compile Include="Input Files\cAuxEntry.vb" /> + <Compile Include="Input Files\cAuxEntryPS.vb" /> <Compile Include="Input Files\cENG.vb" /> <Compile Include="Input Files\cGBX.vb" /> <Compile Include="cConfig.vb" /> -- GitLab