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 63f300e8 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Merge branch 'develop' into...

Merge branch 'develop' into feature/VECTO-1606-modal-data-results-only-provide-necessary-columns-in-output
parents 81b27a12 bed134b6
Branches
Tags
No related merge requests found
Showing
with 163 additions and 269 deletions
......@@ -11,7 +11,7 @@
"VehicleFile": "BatteryElectricVehicle.vveh",
"GearboxFile": "AMT.vgbx",
"TCU": "AMT.vgbx",
"Padd_electric": 3540.0,
"Padd_electric": 0.0,
"VACC": "Truck.vacc",
......
......@@ -11,7 +11,7 @@
"VehicleFile": "BatteryElectricVehicle_Cont30kW.vveh",
"GearboxFile": "AMT.vgbx",
"TCU": "AMT.vgbx",
"Padd_electric": 3540.0,
"Padd_electric": 0.0,
"VACC": "Truck.vacc",
......
......@@ -11,7 +11,7 @@
"VehicleFile": "BatteryElectricVehicle_PTO.vveh",
"GearboxFile": "AMT.vgbx",
"TCU": "AMT.vgbx",
"Padd_electric": 3540.0,
"Padd_electric": 0.0,
"VACC": "Truck.vacc",
......
......@@ -8,7 +8,7 @@
"Body": {
"SavedInDeclMode": false,
"VehicleFile": "BatteryElectricVehicle.vveh",
"Padd_electric": 3540.0,
"Padd_electric": 0.0,
"VACC": "Bus.vacc",
"EngineStopStartAtVehicleStopThreshold": 2.0,
"EngineStopStartMaxOffTimespan": 120.0,
......
......@@ -8,4 +8,8 @@
<DefineConstants />
</PropertyGroup>
<ItemGroup>
<Compile Include="..\VECTOStart\StarterHelper.cs" Link="StarterHelper.cs" />
</ItemGroup>
</Project>
using System;
using Microsoft.Win32;
using System.Diagnostics;
using System.Reflection;
using System.IO;
namespace TUGraz.VECTO
namespace TUGraz.VECTO
{
class Program
{
static void Main()
{
var version = GetHighestNETVersion();
Process.Start(new ProcessStartInfo($"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe") {
WorkingDirectory = Directory.GetCurrentDirectory()
});
}
private static string GetHighestNETVersion()
{
if (SupportsNet60()) {
return "net60";
}
if (SupportsNet48()) {
return "net48";
}
return "net45";
}
private static bool SupportsNet60()
{
try {
var p = Process.Start(new ProcessStartInfo("dotnet", "--list-runtimes") {
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
});
p.WaitForExit();
var output = p.StandardOutput.ReadToEnd();
return output.Contains("Microsoft.WindowsDesktop.App 6");
} catch (Exception e) {
Console.WriteLine(e);
}
return false;
}
private static bool SupportsNet48()
{
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) {
if (ndpKey != null && ndpKey.GetValue("Release") != null) {
var releaseKey = (int)ndpKey.GetValue("Release");
return releaseKey >= 528040;
}
return false;
}
}
static void Main(string[] args) => StarterHelper.StartVECTO(args);
}
}
\ No newline at end of file
......@@ -8,4 +8,12 @@
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants />
</PropertyGroup>
<ItemGroup>
<Compile Include="..\VECTOStart\StarterHelper.cs" Link="StarterHelper.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>
using System;
using Microsoft.Win32;
using System.Diagnostics;
using System.Reflection;
using System.IO;
using System.Windows.Forms;
using System;
namespace TUGraz.VECTO
{
class Program
{
static void Main()
{
var version = GetHighestNETVersion();
Process.Start(new ProcessStartInfo($"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe") {
WorkingDirectory = Directory.GetCurrentDirectory()
});
}
private static string GetHighestNETVersion()
{
//todo mk2022-02-17 hashing tool currently only works under net45. this has to be fixed.
//if (SupportsNet60()) {
// return "net60";
//}
//if (SupportsNet48()) {
// return "net48";
//}
return "net45";
}
private static bool SupportsNet60()
static void Main(string[] args)
{
try {
var p = Process.Start(new ProcessStartInfo("dotnet", "--list-runtimes") {
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
});
p.WaitForExit();
var output = p.StandardOutput.ReadToEnd();
return output.Contains("Microsoft.WindowsDesktop.App 6");
// mk20220707: hashing tool currently only works under net45, therefore we hardcoded the version
StarterHelper.StartVECTO(new[]{"net45"});
} catch (Exception e) {
Console.WriteLine(e);
MessageBox.Show(e.Message);
}
return false;
}
private static bool SupportsNet48()
{
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) {
if (ndpKey != null && ndpKey.GetValue("Release") != null) {
var releaseKey = (int)ndpKey.GetValue("Release");
return releaseKey >= 528040;
}
return false;
}
}
}
}
\ No newline at end of file
using System;
using Microsoft.Win32;
using System.Diagnostics;
using System.Reflection;
using System.IO;
namespace TUGraz.VECTO
namespace TUGraz.VECTO
{
class Program
{
static void Main()
{
var version = GetHighestNETVersion();
Process.Start(new ProcessStartInfo($"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe") {
WorkingDirectory = Directory.GetCurrentDirectory()
});
}
private static string GetHighestNETVersion()
{
if (SupportsNet60()) {
return "net60";
}
if (SupportsNet48()) {
return "net48";
}
return "net45";
}
private static bool SupportsNet60()
{
try {
var p = Process.Start(new ProcessStartInfo("dotnet", "--list-runtimes") {
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
});
p.WaitForExit();
var output = p.StandardOutput.ReadToEnd();
return output.Contains("Microsoft.WindowsDesktop.App 6");
} catch (Exception e) {
Console.WriteLine(e);
}
return false;
}
private static bool SupportsNet48()
{
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) {
if (ndpKey != null && ndpKey.GetValue("Release") != null) {
var releaseKey = (int)ndpKey.GetValue("Release");
return releaseKey >= 528040;
}
return false;
}
}
static void Main(string[] args) => StarterHelper.StartVECTO(args);
}
}
......@@ -9,4 +9,12 @@
<DefineConstants />
</PropertyGroup>
<ItemGroup>
<Compile Include="..\VECTOStart\StarterHelper.cs" Link="StarterHelper.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using System;
namespace TUGraz.VECTO
{
class Program
{
static void Main()
{
var version = GetHighestNETVersion();
Process.Start(new ProcessStartInfo($"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe") {
WorkingDirectory = Directory.GetCurrentDirectory()
});
}
private static string GetHighestNETVersion()
{
if (SupportsNet60()) {
return "net60";
}
return "net48";
}
private static bool SupportsNet60()
static void Main(string[] args)
{
try {
var p = Process.Start(new ProcessStartInfo("dotnet", "--list-runtimes") {
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
});
p.WaitForExit();
var output = p.StandardOutput.ReadToEnd();
return output.Contains("Microsoft.WindowsDesktop.App 6");
StarterHelper.StartVECTO(args, "net48", "net60");
} catch (Exception e) {
Console.WriteLine(e);
MessageBox.Show(e.Message);
}
return false;
}
}
}
......@@ -9,4 +9,12 @@
<DefineConstants />
</PropertyGroup>
<ItemGroup>
<Compile Include="..\VECTOStart\StarterHelper.cs" Link="StarterHelper.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>
using System;
using Microsoft.Win32;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
namespace TUGraz.VECTO
{
class Program
{
static void Main()
{
var version = GetHighestNETVersion();
Process.Start(new ProcessStartInfo($"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe") {
WorkingDirectory = Directory.GetCurrentDirectory()
});
}
private static string GetHighestNETVersion()
{
if (SupportsNet60()) {
return "net60";
}
if (SupportsNet48()) {
return "net48";
}
return "net45";
}
private static bool SupportsNet60()
static void Main(string[] args)
{
try {
var p = Process.Start(new ProcessStartInfo("dotnet", "--list-runtimes") {
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
});
p.WaitForExit();
var output = p.StandardOutput.ReadToEnd();
return output.Contains("Microsoft.WindowsDesktop.App 6");
StarterHelper.StartVECTO(args);
} catch (Exception e) {
Console.WriteLine(e);
}
return false;
}
private static bool SupportsNet48()
{
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) {
if (ndpKey != null && ndpKey.GetValue("Release") != null) {
var releaseKey = (int)ndpKey.GetValue("Release");
return releaseKey >= 528040;
}
return false;
MessageBox.Show(e.Message);
}
}
}
......
using Microsoft.Win32;
using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace TUGraz.VECTO
{
class StarterHelper
{
public static void StartVECTO(string[] args, params string[] validVersions)
{
var path = "No path found.";
string version = "No version found.";
if (validVersions is null || validVersions.Length == 0) {
validVersions = new[] { "net45", "net48", "net60" };
}
try {
if (args.Length > 0) {
version = args[0].ToLower();
} else {
version = GetHighestNETVersion();
}
path = $"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe";
Process.Start(new ProcessStartInfo(path) {
WorkingDirectory = Directory.GetCurrentDirectory()
});
ValidateVersion(version, validVersions);
} catch (Exception e) {
var message = $"Error during starting VECTO.\nDetected .NET version: {version}\nTried to open path: {path}\n{e.Message}";
File.AppendAllText("LOG.txt", $"{DateTime.Now} {message}\n");
Console.WriteLine(message);
throw new Exception(message);
}
}
private static void ValidateVersion(string version, params string[] validVersions)
{
if (!((IList)validVersions).Contains(version))
throw new Exception($"Invalid .NET Version supplied. Only the following values are valid: {string.Join(", ", validVersions)}");
}
private static string GetHighestNETVersion()
{
if (SupportsNet60()) {
return "net60";
}
if (SupportsNet48()) {
return "net48";
}
return "net45";
}
private static bool SupportsNet60()
{
try {
var p = Process.Start(new ProcessStartInfo("dotnet", "--list-runtimes") {
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
});
p.WaitForExit();
var output = p.StandardOutput.ReadToEnd();
return output.Contains("Microsoft.WindowsDesktop.App 6");
} catch (Exception e) {
Console.WriteLine(e);
}
return false;
}
private static bool SupportsNet48()
{
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) {
if (ndpKey != null && ndpKey.GetValue("Release") != null) {
var releaseKey = (int)ndpKey.GetValue("Release");
return releaseKey >= 528040;
}
return false;
}
}
}
}
......@@ -10,4 +10,8 @@
<DefineConstants />
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>
......@@ -15,7 +15,11 @@ Imports TUGraz.VectoCore.Utils
''' </summary>
Public Class AboutBox
Private Sub F10_AboutBox_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Text = "VECTO " & VECTOvers & " / VectoCore" & VectoSimulationCore.BranchSuffix & " " & COREvers
#If NET47_OR_GREATER Or NET5_0_OR_GREATER Then
Text = "VECTO " & VECTOvers & " / VectoCore" & VectoSimulationCore.BranchSuffix & " " & COREvers & " / " & Runtime.InteropServices.RuntimeInformation.FrameworkDescription
#Else
Text = "VECTO " & VECTOvers & " / VectoCore" & VectoSimulationCore.BranchSuffix & " " & COREvers & " / .NET Framework " & If(Environment.Version.Revision < 42000, "4.5", "4.6")
#End If
End Sub
Private Sub LinkLabel1_LinkClicked_1(sender As Object, e As LinkLabelLinkClickedEventArgs) _
......
......@@ -170,7 +170,7 @@ Public Class BusAuxiliariesEngParametersForm
_busAuxParamsFile = ""
Text = "Bus Auxiliaries Parameters Editor"
LbStatus.Text = ""
pnSmartElectricParams.Enabled = false
_changed = False
End Sub
......
......@@ -513,7 +513,7 @@ Public Class GearboxForm
Change()
Dim hasTorqueConverter = gStype.AutomaticTransmission() AndAlso gStype <> GearboxType.APTN
Dim hasTorqueConverter = gStype.AutomaticTransmission() AndAlso gStype <> GearboxType.APTN AndAlso gStype <> GearboxType.IHPC
'ChTCon.Enabled = (GStype.AutomaticTransmission())
gbTC.Enabled = hasTorqueConverter
pnTcEngineering.Enabled = Not Cfg.DeclMode AndAlso hasTorqueConverter
......
......@@ -133,6 +133,7 @@ Public Class HybridStrategyParamsForm
pnCostFactorSoCExponent.Enabled = True
pnGenset.Enabled = False
Case VectoSimulationJobType.SerialHybridVehicle
case VectoSimulationJobType.IEPC_S
pnEquivFactor.Enabled = False
pnEquivFactorCharge.Enabled = False
pnMinSoC.Enabled = True
......@@ -193,6 +194,7 @@ Public Class HybridStrategyParamsForm
tbCostFactorSoCExponent.Text = If(Double.IsNaN(strategyParams.CostFactorSOCExpponent), 5, strategyParams.CostFactorSOCExpponent).ToGUIFormat()
Case VectoSimulationJobType.SerialHybridVehicle
Case VectoSimulationJobType.IEPC_S
tbMinSoC.Text = (strategyParams.MinSoC * 100).ToGUIFormat()
tbTargetSoC.Text = (strategyParams.TargetSoC * 100).ToGUIFormat()
......
......@@ -709,6 +709,10 @@ Public Class IEPCForm
Private Sub cbDesignTypeWheelMotor_CheckedChanged(sender As Object, e As EventArgs) Handles cbDesignTypeWheelMotor.CheckedChanged
tbNumberOfDesignTypeWheelMotor.Enabled = cbDesignTypeWheelMotor.Checked
cbDifferentialIncluded.Enabled = Not cbDesignTypeWheelMotor.Checked
if (cbDesignTypeWheelMotor.Checked) then
cbDifferentialIncluded.Checked = False
end if
If tbNumberOfDesignTypeWheelMotor.Enabled = False Then _
tbNumberOfDesignTypeWheelMotor.Text = "0"
Change()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment