From 6bec49b4112f36c49b39e32401d9b120f08ea28d Mon Sep 17 00:00:00 2001
From: "VKMTHD\\haraldmartini" <harald.martini@student.tugraz.at>
Date: Mon, 7 Nov 2022 11:28:58 +0100
Subject: [PATCH] added command line argument to execute vecto single threaded
 (for debugging purposes only)

---
 VECTO/Configuration.vb               |  5 +++++
 VECTO/GUI/MainForm.vb                |  2 +-
 VECTO/My Project/launchSettings.json | 11 +++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 VECTO/My Project/launchSettings.json

diff --git a/VECTO/Configuration.vb b/VECTO/Configuration.vb
index be269f4d78..8b6eac1d55 100644
--- a/VECTO/Configuration.vb
+++ b/VECTO/Configuration.vb
@@ -29,6 +29,7 @@ Public Class Configuration
 	Public Co2PerFc As Double
 	Public FirstRun As Boolean
 	Public DeclMode As Boolean
+	Public Multithreaded As Boolean
 
 	Public ValidateRunData As Boolean
 
@@ -61,10 +62,14 @@ Public Class Configuration
 		DeclMode = True
 		ValidateRunData = True
         OutputFolder = ""
+		Multithreaded = True
 	End Sub
 
 	Public Sub Load()
 		SetDefault()
+	    If Environment.GetCommandLineArgs().Contains("-st") Then 
+			Multithreaded = False
+	    End If
 
 		If Not File.Exists(FilePath) Then
 			Exit Sub
diff --git a/VECTO/GUI/MainForm.vb b/VECTO/GUI/MainForm.vb
index d827cc5a89..33d7b72ee6 100644
--- a/VECTO/GUI/MainForm.vb
+++ b/VECTO/GUI/MainForm.vb
@@ -1095,7 +1095,7 @@ lbFound:
                                  $"Starting Simulation ({JobFileList.Count} Jobs, {jobContainer.GetProgress().Count _
                                  } Runs)"})
 
-        jobContainer.Execute(True)
+        jobContainer.Execute(Cfg.Multithreaded)
 
         Dim start As DateTime = DateTime.Now()
 
diff --git a/VECTO/My Project/launchSettings.json b/VECTO/My Project/launchSettings.json
new file mode 100644
index 0000000000..87b7d25d68
--- /dev/null
+++ b/VECTO/My Project/launchSettings.json	
@@ -0,0 +1,11 @@
+{
+  "profiles": {
+    "VECTO": {
+      "commandName": "Project"
+    },
+    "VECTO_singlethreaded": {
+      "commandName": "Project",
+      "commandLineArgs": "-st"
+    }
+  }
+}
\ No newline at end of file
-- 
GitLab