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

Skip to content
Snippets Groups Projects
Commit c8d79920 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

fix: xml export, gearbox form: only allow export in declaration mode

parent 2682e33f
No related branches found
No related tags found
No related merge requests found
......@@ -102,7 +102,7 @@ Public Class GearboxForm
TbMinTimeBetweenShifts.Text = DeclarationData.Gearbox.MinTimeBetweenGearshifts.ToGUIFormat()
'cDeclaration.MinTimeBetweenGearshift(GStype)
TbTqResv.Text = (DeclarationData.Gearbox.TorqueReserve * 100).ToGUIFormat() ' cDeclaration.TqResv
TbTqResv.Text = (DeclarationData.Gearbox.TorqueReserve * 100).ToGUIFormat() ' cDeclaration.TqResv
TbTqResvStart.Text = (DeclarationData.Gearbox.TorqueReserveStart * 100).ToGUIFormat() 'cDeclaration.TqResvStart
TbStartSpeed.Text = DeclarationData.Gearbox.StartSpeed.ToGUIFormat() 'cDeclaration.StartSpeed
TbStartAcc.Text = DeclarationData.Gearbox.StartAcceleration.ToGUIFormat() ' cDeclaration.StartAcc
......@@ -911,10 +911,11 @@ Public Class GearboxForm
If (rDyn.IsEqual(0)) Then
Return Nothing
End If
Dim shiftLines As ShiftPolygon = DeclarationData.Gearbox.ComputeShiftPolygon(CType(CbGStype.SelectedValue, GearboxType), gear - 1,
engine.FullLoadCurves(CType(gear, UInteger)), gears, engine,
Double.Parse(LvGears.Items(0).SubItems(GearboxTbl.Ratio).Text, CultureInfo.InvariantCulture),
(rDyn))
Dim shiftLines As ShiftPolygon = DeclarationData.Gearbox.ComputeShiftPolygon(
CType(CbGStype.SelectedValue, GearboxType), gear - 1,
engine.FullLoadCurves(CType(gear, UInteger)), gears, engine,
Double.Parse(LvGears.Items(0).SubItems(GearboxTbl.Ratio).Text, CultureInfo.InvariantCulture),
(rDyn))
Return shiftLines
End Function
......@@ -926,7 +927,10 @@ Public Class GearboxForm
If _
gbx(i).SubItems(GearboxTbl.Ratio).Text <> "" AndAlso Double.TryParse(gbx(i).SubItems(GearboxTbl.Ratio).Text, value) _
Then
Dim maxSpeed As PerSecond = If(String.IsNullOrWhiteSpace(gbx(i).SubItems(GearboxTbl.MaxSpeed).Text), Nothing, gbx(i).SubItems(GearboxTbl.MaxSpeed).Text.ToDouble().RPMtoRad())
Dim maxSpeed As PerSecond =
If _
(String.IsNullOrWhiteSpace(gbx(i).SubItems(GearboxTbl.MaxSpeed).Text), Nothing,
gbx(i).SubItems(GearboxTbl.MaxSpeed).Text.ToDouble().RPMtoRad())
retVal.Add(
New TransmissionInputData() _
With {.Ratio = value, .MaxInputSpeed = maxSpeed})
......@@ -974,6 +978,10 @@ Public Class GearboxForm
End Sub
Private Sub btnExportXML_Click(sender As Object, e As EventArgs) Handles btnExportXML.Click
If Not Cfg.DeclMode Then
MsgBox("XML Export is only supported in Declaration Mode")
Exit Sub
End If
If Not FolderFileBrowser.OpenDialog("") Then
Exit Sub
End If
......@@ -991,6 +999,10 @@ Public Class GearboxForm
End Sub
Private Sub btnExportAxlGearXML_Click(sender As Object, e As EventArgs) Handles btnExportAxlGearXML.Click
If Not Cfg.DeclMode Then
MsgBox("XML Export is only supported in Declaration Mode")
Exit Sub
End If
If Not FolderFileBrowser.OpenDialog("") Then
Exit Sub
End If
......
......@@ -60,6 +60,7 @@ Partial Class MainForm
Me.TabPgOptions = New System.Windows.Forms.TabPage()
Me.PanelOptAllg = New System.Windows.Forms.Panel()
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
Me.cbActVmod = New System.Windows.Forms.CheckBox()
Me.cbValidateRunData = New System.Windows.Forms.CheckBox()
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
Me.ChBoxModOut = New System.Windows.Forms.CheckBox()
......@@ -114,7 +115,6 @@ Partial Class MainForm
Me.OpenInGraphWindowToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ShowInFolderToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.cbActVmod = New System.Windows.Forms.CheckBox()
Me.StatusBAR.SuspendLayout()
Me.TabControl1.SuspendLayout()
Me.TabPageGEN.SuspendLayout()
......@@ -393,6 +393,15 @@ Partial Class MainForm
Me.GroupBox3.TabStop = False
Me.GroupBox3.Text = "Misc"
'
'cbActVmod
'
Me.cbActVmod.Location = New System.Drawing.Point(6, 41)
Me.cbActVmod.Name = "cbActVmod"
Me.cbActVmod.Size = New System.Drawing.Size(161, 63)
Me.cbActVmod.TabIndex = 18
Me.cbActVmod.Text = "Output values in vmod at beginning and end of simulation interval (EXPERT!)"
Me.cbActVmod.UseVisualStyleBackColor = True
'
'cbValidateRunData
'
Me.cbValidateRunData.AutoSize = True
......@@ -803,15 +812,6 @@ Partial Class MainForm
Me.ShowInFolderToolStripMenuItem.Size = New System.Drawing.Size(173, 22)
Me.ShowInFolderToolStripMenuItem.Text = "Show in Folder"
'
'cbActVmod
'
Me.cbActVmod.Location = New System.Drawing.Point(6, 41)
Me.cbActVmod.Name = "cbActVmod"
Me.cbActVmod.Size = New System.Drawing.Size(161, 63)
Me.cbActVmod.TabIndex = 18
Me.cbActVmod.Text = "Output values in vmod at beginning and end of simulation interval (EXPERT!)"
Me.cbActVmod.UseVisualStyleBackColor = True
'
'MainForm
'
Me.AcceptButton = Me.btStartV3
......
......@@ -223,9 +223,6 @@
<metadata name="CmOpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>732, 12</value>
</metadata>
<metadata name="ToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>850, 12</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>49</value>
</metadata>
......
......@@ -12,13 +12,13 @@ Public Class XMLExportJobDialog
Public Sub Initialize(data As IInputDataProvider)
Dim source As String
Dim allowSingleFile As Boolean
Dim eng As IEngineeringInputDataProvider = CType(data, IEngineeringInputDataProvider)
Dim eng As IEngineeringInputDataProvider = TryCast(data, IEngineeringInputDataProvider)
If (Not eng Is Nothing AndAlso Not eng.JobInputData().SavedInDeclarationMode) Then
source = eng.JobInputData().JobName
_mode = ExecutionMode.Engineering
allowSingleFile = True
Else
Dim decl As IDeclarationInputDataProvider = CType(data, IDeclarationInputDataProvider)
Dim decl As IDeclarationInputDataProvider = TryCast(data, IDeclarationInputDataProvider)
If (Not decl Is Nothing AndAlso decl.JobInputData().SavedInDeclarationMode) Then
source = decl.JobInputData().JobName
_mode = ExecutionMode.Declaration
......
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