Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 2fef6224 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

set physical constants (air density, etc) in vecto3 from gui

parent 79d90872
Branches
Tags
No related merge requests found
......@@ -44,6 +44,7 @@ Imports NLog.Config
Imports NLog.Targets
Imports TUGraz.VectoCore.OutputData
Imports TUGraz.VectoCore.OutputData.FileIO
Imports TUGraz.VectoCore.Utils
''' <summary>
''' Main application form. Loads at application start. Closing form ends application.
......@@ -1618,6 +1619,9 @@ lbFound:
mode = ExecutionMode.Declaration
Else
mode = ExecutionMode.Engineering
Physics.FuelDensity = New SI(Cfg.FuelDens).Kilo.Gramm.Per.Cubic.Dezi.Meter
Physics.AirDensity = New SI(Cfg.AirDensity).Kilo.Gramm.Per.Cubic.Meter
Physics.CO2PerFuelWeight = Cfg.CO2perFC
End If
Dim doneProcesses As List(Of UInteger) = New List(Of UInteger)
......@@ -1637,10 +1641,15 @@ lbFound:
Next
For Each cycle As JobContainer.CycleTypeDescription In jobContainer.GetCycleTypes()
sender.ReportProgress(0, New With {.Target = "ListBox", .Message = String.Format("Detected Cycle {0}: {1}", cycle.Name, cycle.CycleType)})
sender.ReportProgress(0,
New With {.Target = "ListBox", .Message = String.Format("Detected Cycle {0}: {1}", cycle.Name, cycle.CycleType)})
Next
sender.ReportProgress(0, New With {.Target = "ListBox", .Message = String.Format("Starting Simulation ({0} Jobs, {1} Runs)", JobFileList.Count, jobContainer.GetProgress().Count)})
sender.ReportProgress(0,
New _
With {.Target = "ListBox",
.Message = _
String.Format("Starting Simulation ({0} Jobs, {1} Runs)", JobFileList.Count, jobContainer.GetProgress().Count)})
jobContainer.Execute(True)
Dim start As DateTime = DateTime.Now()
......@@ -1657,7 +1666,10 @@ lbFound:
Dim duration As Double = (DateTime.Now() - start).TotalSeconds
sender.ReportProgress(Int((sumProgress*100.0)/progress.Count),
New With {.Target = "Status", .Message = String.Format("Duration: {0:0}s, Current Progress: {1:P} ({2})", duration, sumProgress / progress.Count,
New _
With {.Target = "Status",
.Message = _
String.Format("Duration: {0:0}s, Current Progress: {1:P} ({2})", duration, sumProgress/progress.Count,
String.Join(", ", progress.Select(Function(pair) String.Format("{0,4:P}", pair.Value.Progress))))})
For Each p As KeyValuePair(Of UInteger, JobContainer.ProgressEntry) In progress
......@@ -1666,10 +1678,16 @@ lbFound:
Dim runName As String = String.Format("{0} {1} {2}", p.Value.RunName, p.Value.CycleName, p.Value.RunSuffix)
sender.ReportProgress(0, New With {.Target = "ListBox", .Message = String.Format("Finished Run {0}", runName)})
If Not p.Value.Error Is Nothing Then
sender.ReportProgress(0, New With {.Target = "ListBoxError", .Message = String.Format("ERROR {0}: {1}", runName, p.Value.Error.Message), .Link = modFilename})
sender.ReportProgress(0,
New _
With {.Target = "ListBoxError", .Message = String.Format("ERROR {0}: {1}", runName, p.Value.Error.Message),
.Link = modFilename})
End If
'If Not Cfg.DeclMode Then
sender.ReportProgress(0, New With {.Target = "ListBox", .Message = String.Format("Run {0}: Modal Results written to {1}", runName, modFilename), .Link = modFilename})
sender.ReportProgress(0,
New _
With {.Target = "ListBox",
.Message = String.Format("Run {0}: Modal Results written to {1}", runName, modFilename), .Link = modFilename})
'End If
doneProcesses.Add(p.Key)
......@@ -1680,21 +1698,29 @@ lbFound:
Dim sumFilename As String = fileWriter.GetSumFileName()
If File.Exists(sumFilename) Then
sender.ReportProgress(100, New With {.Target = "ListBox", .Message = String.Format("Sum File written to {0}", sumFilename), .Link = sumFilename})
sender.ReportProgress(100,
New _
With {.Target = "ListBox", .Message = String.Format("Sum File written to {0}", sumFilename),
.Link = sumFilename})
End If
If Cfg.DeclMode Then
For Each job As String In JobFileList
Dim report As String = Path.Combine(Path.GetDirectoryName(job), Path.GetFileNameWithoutExtension(job) + ".pdf")
If File.Exists(report) Then
sender.ReportProgress(100, New With {.Target = "ListBox", .Message = String.Format("PDF Report written to {0}", report), .Link = report})
sender.ReportProgress(100,
New With {.Target = "ListBox", .Message = String.Format("PDF Report written to {0}", report), .Link = report})
End If
Next
End If
For Each progressEntry As KeyValuePair(Of UInteger, JobContainer.ProgressEntry) In jobContainer.GetProgress()
Dim runName As String = String.Format("{0} {1} {2}", progressEntry.Value.RunName, progressEntry.Value.CycleName, progressEntry.Value.RunSuffix)
sender.ReportProgress(100, New With {.Target = "ListBox", .Message = String.Format("{0,-60} {1,8:P} {2,10:F2}s - {3}", runName, progressEntry.Value.Progress,
Dim runName As String = String.Format("{0} {1} {2}", progressEntry.Value.RunName, progressEntry.Value.CycleName,
progressEntry.Value.RunSuffix)
sender.ReportProgress(100,
New _
With {.Target = "ListBox",
.Message = String.Format("{0,-60} {1,8:P} {2,10:F2}s - {3}", runName, progressEntry.Value.Progress,
progressEntry.Value.ExecTime/1000.0,
IIf(progressEntry.Value.Success, "Success", "Aborted"))})
If (Not progressEntry.Value.Success) Then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment