diff --git a/VECTO/GUI/F_MAINForm.vb b/VECTO/GUI/F_MAINForm.vb
index 4e9c4f037ea934ac95fd327be5d123af0cd4a275..820ba2b1b0fabcd33f8f33c27522fdad0aecdef7 100644
--- a/VECTO/GUI/F_MAINForm.vb
+++ b/VECTO/GUI/F_MAINForm.vb
@@ -1,2448 +1,2452 @@
-' Copyright 2014 European Union.
-' Licensed under the EUPL (the 'Licence');
-'
-' * You may not use this work except in compliance with the Licence.
-' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
-' * Unless required by applicable law or agreed to in writing,
-'   software distributed under the Licence is distributed on an "AS IS" basis,
-'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-'
-' See the LICENSE.txt for the specific language governing permissions and limitations.
-
-Imports System.Collections.Generic
-
-''' <summary>
-''' Main application form. Loads at application start. Closing form ends application.
-''' </summary>
-''' <remarks></remarks>
-
-Public Class F_MAINForm
-
-    Private JobListView As cFileListView
-    Private CycleListView As cFileListView
-
-    Private LastModeName As String
-    Private ConMenTarget As ListView
-    Private ConMenTarJob As Boolean
-
-    Private MODpath As String
-    Private MODVehList As Int32()
-
-    Private CycleTabPage As TabPage
-    Private CycleTabPageVisible As Boolean
-
-    Private ComLineShutDown As Boolean
-
-    Private GUIlocked As Boolean
-
-    Private CheckedItems As List(Of ListViewItem)
-
-    Private DEVpage As TabPage
-    Private CmDEVitem As ListViewItem
-
-    Private CheckLock As Boolean
-    Private GENchecked As Integer
-    Private DRIchecked As Integer
-    Private GENcheckAllLock As Boolean
-    Private DRIcheckAllLock As Boolean
-
-    Private CbDeclLock As Boolean = False
-
-
-#Region "SLEEP Control - Prevent sleep while VECTO is running"
-
-    Private Declare Function SetThreadExecutionState Lib "kernel32" (ByVal esFlags As Long) As Long
-
-    Private Sub AllowSleepOFF()
-#If Not PLATFORM = "x86" Then
-        SetThreadExecutionState(tEXECUTION_STATE.ES_CONTINUOUS Or tEXECUTION_STATE.ES_SYSTEM_REQUIRED)
-#End If
-    End Sub
-
-    Private Sub AllowSleepON()
-#If Not PLATFORM = "x86" Then
-        SetThreadExecutionState(tEXECUTION_STATE.ES_CONTINUOUS)
-#End If
-    End Sub
-
-    Private Enum tEXECUTION_STATE As Integer
-        ''' Informs the system that the state being set should remain in effect until the next call that uses ES_CONTINUOUS and one of the other state flags is cleared.
-        ES_CONTINUOUS = &H80000000
-        ''' Forces the display to be on by resetting the display idle timer.
-        ES_DISPLAY_REQUIRED = &H2
-        ''' Forces the system to be in the working state by resetting the system idle timer.
-        ES_SYSTEM_REQUIRED = &H1
-    End Enum
-
-#End Region
-
-#Region "FileBrowser Init/Close"
-    Private Sub FB_Initialize()
-        FB_Init = False
-        fbFolder = New cFileBrowser("WorkDir", True)
-        fbFileLists = New cFileBrowser("FileLists")
-        fbVECTO = New cFileBrowser("vecto")
-        fbVEH = New cFileBrowser("vveh")
-        fbMAP = New cFileBrowser("vmap")
-        fbDRI = New cFileBrowser("vdri")
-        fbFLD = New cFileBrowser("vfld")
-        fbENG = New cFileBrowser("veng")
-        fbGBX = New cFileBrowser("vgbx")
-        fbACC = New cFileBrowser("vacc")
-        fbAUX = New cFileBrowser("vaux")
-        fbGBS = New cFileBrowser("vgbs")
-        fbRLM = New cFileBrowser("vrlm")
-        fbTLM = New cFileBrowser("vtlm")
-        fbTCC = New cFileBrowser("vtcc")
-        fbCDx = New cFileBrowser("vcdx")
-
-        fbVMOD = New cFileBrowser("vmod")
-
-
-        '-------------------------------------------------------
-        fbFileLists.Extensions = New String() {"txt"}
-        fbVECTO.Extensions = New String() {"vecto"}
-        fbVEH.Extensions = New String() {"vveh"}
-        fbMAP.Extensions = New String() {"vmap"}
-        fbDRI.Extensions = New String() {"vdri"}
-        fbFLD.Extensions = New String() {"vfld"}
-        fbENG.Extensions = New String() {"veng"}
-        fbGBX.Extensions = New String() {"vgbx"}
-        fbACC.Extensions = New String() {"vacc"}
-        fbAUX.Extensions = New String() {"vaux"}
-        fbGBS.Extensions = New String() {"vgbs"}
-        fbRLM.Extensions = New String() {"vrlm"}
-        fbTLM.Extensions = New String() {"vtlm"}
-        fbTCC.Extensions = New String() {"vtcc"}
-        fbCDx.Extensions = New String() {"vcdv", "vcdb"}
-
-        fbVMOD.Extensions = New String() {"vmod"}
-
-
-    End Sub
-    Private Sub FB_Close()
-        fbFolder.Close()
-        fbFileLists.Close()
-        fbVECTO.Close()
-        fbVEH.Close()
-        fbMAP.Close()
-        fbDRI.Close()
-        fbFLD.Close()
-        fbENG.Close()
-        fbGBX.Close()
-        fbACC.Close()
-        fbAUX.Close()
-        fbGBS.Close()
-        fbRLM.Close()
-        fbTLM.Close()
-        fbTCC.Close()
-        fbCDx.Close()
-        fbVMOD.Close()
-    End Sub
-
-#End Region
-
-#Region "VECTO-Worker"
-
-    'VECTO-Launcher
-    Public Sub VECTO_Launcher()
-        Dim ProgOverall As Boolean
-        Dim GEN0 As cVECTO
-
-        'Called when VECTO already running
-        If VECTOworker.IsBusy Then
-            GUImsg(tMsgID.Err, "VECTO is already running!")
-            Exit Sub
-        End If
-
-        'Delete GENlist-Selection
-        Me.LvGEN.SelectedItems.Clear()
-
-        'If more than 100 calculations, ask whether to write by-second results
-        If Cfg.BatchMode And ((Me.LvGEN.CheckedItems.Count) * (Me.LvDRI.CheckedItems.Count) > 100) And Me.ChBoxModOut.Checked Then
-            Select Case MsgBox("You are about to run Batch Mode with " & (Me.LvGEN.CheckedItems.Count) * (Me.LvDRI.CheckedItems.Count) & " calculations!" & ChrW(10) & "Do you still want to write modal results?", MsgBoxStyle.YesNoCancel)
-                Case MsgBoxResult.No
-                    Me.ChBoxModOut.Checked = False
-                Case MsgBoxResult.Cancel
-                    GUImsg(tMsgID.Normal, "Aborted by User")
-                    Exit Sub
-            End Select
-        End If
-
-        'Status
-        Status("Launching VECTO...")
-
-
-        'Define Job-0list
-
-        'Define File / Cycle list
-        SetJobList()
-
-        'Zyklus-Liste definieren (falls nicht BATCH-Modus wird in SetCycleList nur die Liste gelöscht und nicht neu belegt) |@@| Define Cycle-list (if not BATCH mode in SetCycleList deleted only the list and not reassigned)
-        SetCycleList()
-
-        If JobFileList.Count = 0 Then
-            GUImsg(tMsgID.Err, "No job file selected!")
-            Exit Sub
-        End If
-
-        'Check whether Overall-progbar is needed
-        If Cfg.BatchMode Or JobFileList.Count > 1 Or Cfg.DeclMode Then
-            ProgOverall = True
-        Else
-            GEN0 = New cVECTO
-            GEN0.FilePath = JobFileList(0)
-            If Not GEN0.ReadFile Then
-                GUImsg(tMsgID.Err, "Failed to job file (" & fFILE(JobFileList(0), True) & ")!")
-                Exit Sub
-            End If
-            ProgOverall = (GEN0.CycleFiles.Count > 1)
-        End If
-
-        'Launch through Job_Launcher
-        Job_Launcher(ProgOverall)
-
-    End Sub
-
-    'Lock certain GUI elements while VECTO is running
-    Private Sub LockGUI(ByVal Lock As Boolean)
-        GUIlocked = Lock
-
-        Me.PanelOptAllg.Enabled = Not Lock
-        Me.GrBoxSTD.Enabled = Not Lock
-        Me.GrBoxBATCH.Enabled = Not Lock
-
-        Me.BtGENup.Enabled = Not Lock
-        Me.BtGENdown.Enabled = Not Lock
-        Me.ButtonGENadd.Enabled = Not Lock
-        Me.ButtonGENremove.Enabled = Not Lock
-        Me.LvGEN.LabelEdit = Not Lock
-        Me.ChBoxAllGEN.Enabled = Not Lock
-
-        Me.BtDRIup.Enabled = Not Lock
-        Me.BtDRIdown.Enabled = Not Lock
-        Me.ButtonDRIadd.Enabled = Not Lock
-        Me.ButtonDRIremove.Enabled = Not Lock
-        Me.LvDRI.LabelEdit = Not Lock
-        Me.ChBoxAllDRI.Enabled = Not Lock
-
-        If DEV.Enabled Then
-            Me.LvDEVoptions.Enabled = Not Lock
-        End If
-
-    End Sub
-
-    'Define job file list
-    Private Sub SetJobList()
-        Dim LV0 As ListViewItem
-        Dim x As Integer
-
-        JobFileList.Clear()
-        CheckedItems.Clear()
-
-        x = -1
-        For Each LV0 In Me.LvGEN.CheckedItems
-            x += 1
-            LV0.SubItems(1).Text = ""
-            CheckedItems.Add(LV0)
-            SetCheckedItemColor(x, tJobStatus.Queued)
-            JobFileList.Add(fFileRepl(LV0.SubItems(0).Text))
-        Next
-
-    End Sub
-
-    'Define cycle list (BATCH mode only)
-    Private Sub SetCycleList()
-        Dim LV0 As ListViewItem
-
-        JobCycleList.Clear()
-
-        If Cfg.BatchMode Then
-            For Each LV0 In Me.LvDRI.CheckedItems
-                JobCycleList.Add(fFileRepl(LV0.SubItems(0).Text))
-            Next
-        End If
-
-    End Sub
-
-    'Job Launcher
-    Private Sub Job_Launcher(ByVal ProgOverallEnabled As Boolean)
-
-        If VECTOworker.IsBusy Then Exit Sub
-
-        'Load Options from Options Tab
-        SetOptions()
-
-        'Save Config
-        Cfg.ConfigSAVE()
-
-        If DEV.Enabled Then DEV.SaveToFile()
-
-        'Reset Msg-output
-        ClearMSG()
-
-        'Button switch
-        Me.Button1.Text = "STOP"
-        Me.Button1.Image = My.Resources.Stop_icon
-
-        'Disable Options
-        LockGUI(True)
-
-        'ProgBars start
-        If ProgOverallEnabled Then
-            Me.ToolStripProgBarOverall.Value = 0
-            Me.ToolStripProgBarOverall.Style = ProgressBarStyle.Marquee
-            Me.ToolStripProgBarOverall.Visible = True
-        End If
-
-        ProgBarCtrl.ProgJobInt = 0
-        ProgSecStart()
-
-        'BG-Worker start
-        VECTOworker.RunWorkerAsync()
-
-    End Sub
-
-    'Abort Job
-    Private Sub JobAbort()
-        Me.Button1.Enabled = False
-        Me.Button1.Text = "Aborting..."
-        Me.Button1.Image = My.Resources.Play_icon_gray
-        VECTOworker.CancelAsync()
-    End Sub
-
-
-#Region "BackgroundWorker Events"
-
-    'DoWork - Start Calculations
-    Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
-
-        'Prevent SLEEP
-        AllowSleepOFF()
-
-        If SetCulture Then
-            Try
-                System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")
-            Catch ex As Exception
-                GUImsg(tMsgID.Err, "Failed to set thread culture 'en-US'! Check system decimal- and group- separators!")
-            End Try
-        End If
-
-        e.Result = VECTO()
-
-
-    End Sub
-
-    'Progress Report - Progressbar, Messages, etc.
-    Private Sub BackgroundWorker1_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
-        Dim x As cWorkProg
-        x = e.UserState
-
-        Select Case x.Target
-            Case tWorkMsgType.StatusListBox
-                MSGtoForm(e.UserState.ID, e.UserState.Msg, x.Source, x.Link)
-
-            Case tWorkMsgType.StatusBar
-                Status(e.UserState.Msg)
-
-            Case tWorkMsgType.ProgBars
-                Me.ToolStripProgBarOverall.Value = e.ProgressPercentage
-                ProgSecStart()
-
-            Case tWorkMsgType.JobStatus
-                CheckedItems(x.FileIndex).SubItems(1).Text = x.Msg
-                SetCheckedItemColor(x.FileIndex, x.Status)
-
-            Case tWorkMsgType.CycleStatus
-                Try
-                    Me.LvDRI.CheckedItems(x.FileIndex).SubItems(1).Text = x.Msg
-                Catch ex As Exception
-                End Try
-
-            Case tWorkMsgType.InitProgBar
-                Me.ToolStripProgBarOverall.Style = ProgressBarStyle.Continuous
-
-            Case Else ' tWorkMsgType.Abort
-                JobAbort()
-
-        End Select
-    End Sub
-
-    'Work completed
-    Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
-
-        Dim Result As tCalcResult
-
-        'Progbar reset
-        Me.ToolStripProgBarOverall.Visible = False
-        Me.ToolStripProgBarOverall.Style = ProgressBarStyle.Continuous
-        Me.ToolStripProgBarOverall.Value = 0
-        ProgSecStop()
-
-        'So ListView-Item Colors (Warning = Yellow, etc..) are correctly visible
-        Me.LvGEN.SelectedIndices.Clear()
-
-        Result = e.Result
-
-        'ShutDown when Unexpected Error
-        If e.Error IsNot Nothing Then
-            MsgBox("An Unexpected Error occurred!" & ChrW(10) & ChrW(10) & _
-                     e.Error.Message.ToString, MsgBoxStyle.Critical, "Unexpected Error")
-            LogFile.WriteToLog(tMsgID.Err, ">>>Unexpected Error:" & e.Error.ToString())
-            Me.Close()
-        End If
-
-        'Options enable / GUI reset
-        LockGUI(False)
-        Me.Button1.Enabled = True
-        Me.Button1.Text = "START"
-        Me.Button1.Image = My.Resources.Play_icon
-        Status(LastModeName & " Mode")
-
-        'Command Line Shutdown
-        If ComLineShutDown Then Me.Close()
-
-        'Auto Shutdown
-        If Me.ChBoxAutoSD.Checked Then
-            Me.ChBoxAutoSD.Checked = False
-            If Not Result = tCalcResult.Abort Then
-                If F_ShutDown.ShutDown Then
-                    GUImsg(tMsgID.Warn, "Shutting down...")
-                    Me.Close()
-                End If
-            End If
-        End If
-
-        'SLEEP reactivate
-        AllowSleepON()
-
-    End Sub
-
-#End Region
-
-#End Region
-
-#Region "Form Init/Close"
-
-    'Initialise
-    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-        Dim x As Integer
-
-        GUIlocked = False
-        CheckLock = False
-        GENcheckAllLock = False
-        DRIcheckAllLock = False
-        DRIchecked = 0
-        GENchecked = 0
-
-        CheckedItems = New List(Of ListViewItem)
-
-        'Load Tabs properly (otherwise problem with ListViews)
-        For x = 0 To Me.TabControl1.TabCount - 1
-            Me.TabControl1.TabPages(x).Show()
-        Next
-
-        CycleTabPageVisible = True
-        CycleTabPage = Me.TabPageDRI
-
-        DEVpage = Me.TabPageDEV
-        Me.TabControl1.Controls.Remove(DEVpage)
-
-        LastModeName = ""
-
-        ComLineShutDown = False
-
-        FB_Initialize()
-
-        Me.Text = "VECTO " & VECTOvers
-
-
-        'FileLists
-        JobListView = New cFileListView(MyConfPath & "joblist.txt")
-        JobListView.LVbox = Me.LvGEN
-        CycleListView = New cFileListView(MyConfPath & "cyclelist.txt")
-        CycleListView.LVbox = Me.LvDRI
-
-        JobListView.LoadList()
-
-        'Load GUI Options (here, the GEN/ADV/DRI lists are loaded)
-        LoadOptions()
-
-        'Resize columns ... after Loading the @file-lists
-        Me.LvGEN.Columns(1).Width = -2
-        Me.LvDRI.Columns(1).Width = -2
-        Me.LvMsg.Columns(2).Width = -2
-
-        'Initialize BackgroundWorker
-        VECTOworker = Me.BackgroundWorker1
-        VECTOworker.WorkerReportsProgress = True
-        VECTOworker.WorkerSupportsCancellation = True
-
-        'Set mode (Batch/Standard)
-        ModeUpdate()
-
-        'License check
-        If Not Lic.LICcheck() Then
-            MsgBox("License File invalid!" & vbCrLf & vbCrLf & Lic.FailMsg)
-            If Lic.CreateActFile(MyAppPath & "ActivationCode.dat") Then
-                MsgBox("Activation File created.")
-            Else
-                MsgBox("Failed to create Activation File! Is Directory Read-Only?")
-            End If
-            Me.Close()
-        Else
-            GUImsg(tMsgID.Normal, "License File validated.")
-            If Lic.TimeWarn Then GUImsg(tMsgID.Warn, "License expiring date (y/m/d): " & Lic.ExpTime)
-        End If
-
-        DEV.Enabled = Lic.LicFeature(9)
-
-        If DEV.Enabled Then
-            DEV.LoadFromFile()
-            LoadDEVconfigs()
-        End If
-
-        DeclOnOff()
-
-    End Sub
-
-    'Declaration mode GUI settings
-    Private Sub DeclOnOff()
-
-        If Cfg.DeclMode Then
-            Me.Text = "VECTO " & VECTOvers & " - Declaration Mode"
-            Me.CbBatch.Checked = False
-            Cfg.DeclInit()
-        Else
-            Me.Text = "VECTO " & VECTOvers
-        End If
-
-        If Cfg.DeclMode Then
-            LastModeName = "Declaration"
-        Else
-            If Cfg.BatchMode Then
-                LastModeName = "Batch"
-            Else
-                LastModeName = "Engineering"
-            End If
-        End If
-
-        Status(LastModeName & " Mode")
-
-        Me.LoadOptions()
-
-        Me.LbDecl.Visible = Cfg.DeclMode
-
-        Me.PnDeclOpt.Enabled = Not Cfg.DeclMode
-
-    End Sub
-
-    'Shown Event (Form-Load finished) ... here StartUp Forms are loaded (DEV, GEN/ADV- Editor ..)
-    Private Sub F01_MAINForm_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
-        Dim fwelcome As F_Welcome
-
-        'DEV Form
-        If DEV.Enabled Then
-            Me.TabControl1.TabPages.Insert(Me.TabControl1.TabPages.Count, DEVpage)
-        End If
-
-        'VECTO Init
-        Declaration.Init()
-
-        'Command Line Args
-        If Command() <> "" Then
-            CmdLineCtrl(My.Application.CommandLineArgs)
-        Else
-            If Cfg.FirstRun Then
-                Cfg.FirstRun = False
-                fwelcome = New F_Welcome
-                fwelcome.ShowDialog()
-            End If
-        End If
-
-    End Sub
-
-    'Open file
-    Private Sub CmdLineCtrl(ByVal ComLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String))
-        Dim bBATCH As Boolean
-        Dim bRUN As Boolean
-        Dim x As Object
-        Dim str As String
-        Dim ComFile As String = ""
-        Dim vecFiles As New List(Of String)
-        Dim driFiles As New List(Of String)
-
-        bBATCH = False
-        bRUN = False
-        ComFile = sKey.NoFile
-
-        'Read Command-Line Args
-        For Each x In ComLineArgs
-            str = Trim(Replace(x.ToString, ChrW(34), ""))
-            Select Case UCase(str)
-                Case "-BATCH"
-                    bBATCH = True
-                Case "-CLOSE"
-                    ComLineShutDown = True
-                Case "-RUN"
-                    bRUN = True
-                Case Else
-                    Select Case UCase(fEXT(str))
-                        Case ".VECTO"
-                            vecFiles.Add(fFileRepl(str))
-                        Case ".VDRI"
-                            driFiles.Add(fFileRepl(str))
-                        Case Else
-                            ComFile = fFileRepl(str)
-                    End Select
-            End Select
-        Next
-
-        'Mode switch and load Driving Cycles
-        If bBATCH Then
-            Me.CbBatch.Checked = True
-
-            If driFiles.Count > 0 Then
-                LvDRI.Items.Clear()
-                AddToCycleListView(driFiles.ToArray)
-            End If
-
-        Else
-            Me.CbBatch.Checked = False
-        End If
-
-        'Load Vecto files or open editor (if only one file)
-        If vecFiles.Count > 0 Then
-            If vecFiles.Count > 1 Or bRUN Then
-                LvGEN.Items.Clear()
-                AddToJobListView(vecFiles.ToArray)
-            Else
-                ComFile = vecFiles(0)
-            End If
-        End If
-
-        'Run or open file editor if file is specified
-        If bRUN Then
-            VECTO_Launcher()
-        Else
-            If ComFile <> sKey.NoFile Then OpenVectoFile(ComFile)
-        End If
-
-    End Sub
-
-    'Close
-    Private Sub F01_MAINForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
-
-        'Save File-Lists
-        SaveFileLists()
-
-        'Close log
-        LogFile.CloseLog()
-
-        'Config save
-        SetOptions()
-        Cfg.ConfigSAVE()
-        If DEV.Enabled Then DEV.SaveToFile()
-
-        'File browser instances close
-        FB_Close()
-
-    End Sub
-
-#End Region
-
-    'Open file - Job, vehicle, engine, gearbox or signature file
-    Public Sub OpenVectoFile(ByVal File As String)
-
-        If Not IO.File.Exists(File) Then
-
-            GUImsg(tMsgID.Err, "File not found! (" & File & ")")
-            MsgBox("File not found! (" & File & ")", MsgBoxStyle.Critical)
-
-        Else
-
-            Select Case UCase(fEXT(File))
-                Case ".VGBX"
-                    If Not F_GBX.Visible Then
-                        F_GBX.Show()
-                    Else
-                        F_GBX.JobDir = ""
-                        If F_GBX.WindowState = FormWindowState.Minimized Then F_GBX.WindowState = FormWindowState.Normal
-                        F_GBX.BringToFront()
-                    End If
-                    F_GBX.openGBX(File)
-                Case ".VVEH"
-                    If Not F_VEH.Visible Then
-                        F_VEH.Show()
-                    Else
-                        F_VEH.JobDir = ""
-                        If F_VEH.WindowState = FormWindowState.Minimized Then F_VEH.WindowState = FormWindowState.Normal
-                        F_VEH.BringToFront()
-                    End If
-                    F_VEH.openVEH(File)
-                Case ".VENG"
-                    If Not F_ENG.Visible Then
-                        F_ENG.Show()
-                    Else
-                        F_ENG.JobDir = ""
-                        If F_ENG.WindowState = FormWindowState.Minimized Then F_ENG.WindowState = FormWindowState.Normal
-                        F_ENG.BringToFront()
-                    End If
-                    F_ENG.openENG(File)
-                Case ".VECTO"
-                    OpenVECTOeditor(File)
-                Case ".VSIG"
-                    OpenSigFile(File)
-                Case Else
-                    MsgBox("Type '" & fEXT(File) & "' unknown!", MsgBoxStyle.Critical)
-            End Select
-
-        End If
-
-    End Sub
-
-#Region "Job file list"
-
-#Region "Events"
-
-    Private Sub ButtonGENremove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGENremove.Click
-        RemoveJobFile()
-    End Sub
-
-    Private Sub ButtonGENadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGENadd.Click
-        AddJobFile()
-    End Sub
-
-    Private Sub ButtonGENoptions_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGENopt.Click
-        ConMenTarget = Me.LvGEN
-        ConMenTarJob = True
-
-        'Locked functions show/hide
-        Me.LoadListToolStripMenuItem.Enabled = Not GUIlocked
-        Me.LoadDefaultListToolStripMenuItem.Enabled = Not GUIlocked
-        Me.ClearListToolStripMenuItem.Enabled = Not GUIlocked
-
-        Me.ConMenFilelist.Show(Control.MousePosition)
-    End Sub
-
-    Private Sub ListViewGEN_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles LvGEN.KeyDown
-        Select Case e.KeyCode
-            Case Keys.Delete, Keys.Back
-                If Not GUIlocked Then RemoveJobFile()
-            Case Keys.Enter
-                OpenJobFile()
-        End Select
-    End Sub
-
-    Private Sub ListViewGEN_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LvGEN.DoubleClick
-        If Me.LvGEN.SelectedItems.Count > 0 Then
-            Me.LvGEN.SelectedItems(0).Checked = Not Me.LvGEN.SelectedItems(0).Checked
-            OpenJobFile()
-        End If
-    End Sub
-
-    Private Sub LvGEN_ItemChecked(sender As Object, e As System.Windows.Forms.ItemCheckedEventArgs) Handles LvGEN.ItemChecked
-
-        If e.Item.Checked Then
-            GENchecked += 1
-        Else
-            GENchecked -= 1
-        End If
-
-        If CheckLock Then Exit Sub
-        UpdateJobTabText()
-
-    End Sub
-
-    Private Sub ChBoxAllGEN_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChBoxAllGEN.CheckedChanged
-
-        If GENcheckAllLock And Me.ChBoxAllGEN.CheckState = CheckState.Indeterminate Then Exit Sub
-
-        CheckAllGEN(Me.ChBoxAllGEN.Checked)
-    End Sub
-    Private Sub CheckAllGEN(ByVal Check As Boolean)
-        Dim x As ListViewItem
-
-        CheckLock = True
-        Me.LvGEN.BeginUpdate()
-
-        For Each x In Me.LvGEN.Items
-            x.Checked = Check
-        Next
-
-        Me.LvGEN.EndUpdate()
-        CheckLock = False
-
-        GENchecked = Me.LvGEN.CheckedItems.Count
-        UpdateJobTabText()
-    End Sub
-
-    Private Sub ListGEN_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LvGEN.DragEnter
-        If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
-            e.Effect = DragDropEffects.Copy
-        End If
-    End Sub
-    Private Sub ListGEN_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LvGEN.DragDrop
-        Dim f As String()
-        f = CType(e.Data.GetData(DataFormats.FileDrop), Array)
-        AddToJobListView(f)
-    End Sub
-
-    Private Sub BtGENup_Click(sender As System.Object, e As System.EventArgs) Handles BtGENup.Click
-        MoveItem(LvGEN, True)
-    End Sub
-
-    Private Sub BtGENdown_Click(sender As System.Object, e As System.EventArgs) Handles BtGENdown.Click
-        MoveItem(LvGEN, False)
-    End Sub
-
-#End Region
-
-    'Remove selected file(s) from job list
-    Private Sub RemoveJobFile()
-        Dim lastindx As Integer
-        Dim SelIx() As Integer
-        Dim i As Integer
-
-        If Me.LvGEN.SelectedItems.Count < 1 Then
-            If Me.LvGEN.Items.Count = 1 Then
-                Me.LvGEN.Items(0).Selected = True
-            Else
-                Exit Sub
-            End If
-        End If
-
-        LvGEN.BeginUpdate()
-        CheckLock = True
-
-        ReDim SelIx(LvGEN.SelectedItems.Count - 1)
-        LvGEN.SelectedIndices.CopyTo(SelIx, 0)
-
-        lastindx = LvGEN.SelectedIndices(LvGEN.SelectedItems.Count - 1)
-
-        For i = UBound(SelIx) To 0 Step -1
-            LvGEN.Items.RemoveAt(SelIx(i))
-        Next
-
-        If lastindx < LvGEN.Items.Count Then
-            LvGEN.Items(lastindx).Selected = True
-        Else
-            If LvGEN.Items.Count > 0 Then LvGEN.Items(LvGEN.Items.Count - 1).Selected = True
-        End If
-
-        LvGEN.EndUpdate()
-        CheckLock = False
-
-        GENchecked = LvGEN.CheckedItems.Count
-        UpdateJobTabText()
-    End Sub
-
-    'Browse for job file(s) and add to job list with AddToJobListView
-    Private Sub AddJobFile()
-        Dim x As String()
-        Dim Chck As Boolean = False
-
-        x = New String() {""}
-
-        'STANDARD/BATCH
-        If fbVECTO.OpenDialog("", True, "vecto") Then
-            Chck = True
-            x = fbVECTO.Files
-        End If
-
-        If Chck Then AddToJobListView(x)
-
-    End Sub
-
-    'Open file in list
-    Private Sub OpenJobFile()
-        Dim f As String
-
-        If Me.LvGEN.SelectedItems.Count < 1 Then
-            If Me.LvGEN.Items.Count = 1 Then
-                Me.LvGEN.Items(0).Selected = True
-            Else
-                Exit Sub
-            End If
-        End If
-
-        f = Me.LvGEN.SelectedItems(0).SubItems(0).Text
-        f = fFileRepl(f)
-        If Not IO.File.Exists(f) Then
-            MsgBox(f & " not found!")
-        Else
-            OpenVECTOeditor(f)
-        End If
-    End Sub
-
-    'Add File to job listview (multiple files)
-    Private Sub AddToJobListView(ByVal Path As String(), Optional ByVal Txt As String = " ")
-        Dim pDim As Int16
-        Dim p As Int16
-        Dim f As Int16
-        Dim fList As String()
-        Dim fListDim As Int16 = -1
-        Dim ListViewItem0 As ListViewItem
-
-        'If VECTO runs: Cancel operation (because Mode-change during calculation is not very clever)
-        If VECTOworker.IsBusy Then Exit Sub
-
-        pDim = UBound(Path)
-        ReDim fList(0)     'um Nullverweisausnahme-Warnung zu verhindern
-
-        '******************************************* Begin Update '*******************************************
-        Me.LvGEN.BeginUpdate()
-        CheckLock = True
-
-        Me.LvGEN.SelectedIndices.Clear()
-
-        If pDim = 0 Then
-            fListDim = Me.LvGEN.Items.Count - 1
-            ReDim fList(fListDim)
-            For f = 0 To fListDim
-                fList(f) = fFileRepl(Me.LvGEN.Items(f).SubItems(0).Text)
-            Next
-        End If
-
-        For p = 0 To pDim
-
-            If pDim = 0 Then
-
-                For f = 0 To fListDim
-
-                    'If file already exists in the list: Do not append (only when a single file)
-                    If UCase(Path(p)) = UCase(fList(f)) Then
-
-                        'Status reset
-                        Me.LvGEN.Items(f).SubItems(1).Text = Txt
-                        Me.LvGEN.Items(f).BackColor = Color.FromKnownColor(KnownColor.Window)
-                        Me.LvGEN.Items(f).ForeColor = Color.FromKnownColor(KnownColor.WindowText)
-
-                        'Element auswählen und anhaken |@@| Element selection and hook
-                        Me.LvGEN.Items(f).Selected = True
-                        Me.LvGEN.Items(f).Checked = True
-                        Me.LvGEN.Items(f).EnsureVisible()
-
-                        GoTo lbFound
-                    End If
-                Next
-
-            End If
-
-            'Otherwise: Add File (without WorkDir)
-            ListViewItem0 = New ListViewItem(Path(p))   'fFileWD(Path(p)))
-            ListViewItem0.SubItems.Add(" ")
-            ListViewItem0.Checked = True
-            ListViewItem0.Selected = True
-            Me.LvGEN.Items.Add(ListViewItem0)
-            ListViewItem0.EnsureVisible()
-lbFound:
-        Next
-
-        Me.LvGEN.EndUpdate()
-        CheckLock = False
-        '******************************************* End Update '*******************************************
-
-        'Number update
-        GENchecked = Me.LvGEN.CheckedItems.Count
-        UpdateJobTabText()
-
-
-    End Sub
-
-    'Add File to job listview (single file)
-    Public Sub AddToJobListView(ByVal Path As String, Optional ByVal Txt As String = " ")
-        Dim p(0) As String
-        p(0) = Path
-        AddToJobListView(p, Txt)
-    End Sub
-
-    'Update job files counter in tab titel
-    Private Sub UpdateJobTabText()
-        Dim c As Integer
-        c = Me.LvGEN.Items.Count
-
-        Me.TabPageGEN.Text = "Job Files ( " & GENchecked & " / " & c & " )"
-        'Me.TabPageGEN.Text = "Job Files (" & c & ")"
-
-        GENcheckAllLock = True
-
-        If GENchecked = 0 Then
-            Me.ChBoxAllGEN.CheckState = CheckState.Unchecked
-        ElseIf GENchecked = c Then
-            Me.ChBoxAllGEN.CheckState = CheckState.Checked
-        Else
-            Me.ChBoxAllGEN.CheckState = CheckState.Indeterminate
-        End If
-
-        GENcheckAllLock = False
-
-    End Sub
-
-#End Region
-
-#Region "Cycle list (BATCH)"
-
-
-#Region "Events"
-
-    Private Sub ButtonDRIadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDRIadd.Click
-        AddCycle()
-    End Sub
-
-    Private Sub ButtonDRIremove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDRIremove.Click
-        RemoveCycle()
-    End Sub
-
-    Private Sub ButtonDRIoptions_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDRIedit.Click
-        ConMenTarget = Me.LvDRI
-        ConMenTarJob = False
-        Me.ConMenFilelist.Show(Control.MousePosition)
-    End Sub
-
-    Private Sub LvDRI_ItemChecked(sender As Object, e As System.Windows.Forms.ItemCheckedEventArgs) Handles LvDRI.ItemChecked
-
-        If e.Item.Checked Then
-            DRIchecked += 1
-        Else
-            DRIchecked -= 1
-        End If
-
-        If CheckLock Then Exit Sub
-        UpdateCycleTabText()
-
-    End Sub
-
-    Private Sub ChBoxAllDRI_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChBoxAllDRI.CheckedChanged
-        Dim Check As Boolean
-        Dim x As ListViewItem
-
-        If DRIcheckAllLock Or Me.ChBoxAllDRI.CheckState = CheckState.Indeterminate Then Exit Sub
-
-        Check = Me.ChBoxAllDRI.Checked
-
-        CheckLock = True
-        Me.LvDRI.BeginUpdate()
-
-        For Each x In Me.LvDRI.Items
-            x.Checked = Check
-        Next
-
-        Me.LvDRI.EndUpdate()
-        CheckLock = False
-
-        DRIchecked = Me.LvDRI.CheckedItems.Count
-        UpdateCycleTabText()
-
-    End Sub
-
-    Private Sub ListViewDRI_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LvDRI.DoubleClick
-        If Me.LvDRI.SelectedItems.Count > 0 Then
-            Me.LvDRI.SelectedItems(0).Checked = Not Me.LvDRI.SelectedItems(0).Checked
-            OpenCycle()
-        Else
-            AddCycle()
-        End If
-    End Sub
-
-    Private Sub ListViewDRI_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles LvDRI.KeyDown
-        Select Case e.KeyCode
-            Case Keys.Delete, Keys.Back
-                If Not GUIlocked Then RemoveCycle()
-            Case Keys.Enter
-                OpenCycle()
-        End Select
-    End Sub
-
-    'Drag n' Drop
-    Private Sub ListDRI_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LvDRI.DragEnter
-        If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then e.Effect = DragDropEffects.Copy
-    End Sub
-    Private Sub ListDRI_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LvDRI.DragDrop
-        Dim f As String()
-        f = CType(e.Data.GetData(DataFormats.FileDrop), Array)
-        AddToCycleListView(f)
-        If LvDRI.Items.Count > 0 Then LvDRI.Items(LvDRI.Items.Count - 1).Selected = True
-    End Sub
-
-    Private Sub BtDRIup_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIup.Click
-        MoveItem(LvDRI, True)
-    End Sub
-
-    Private Sub BtDRIdown_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIdown.Click
-        MoveItem(LvDRI, False)
-    End Sub
-
-#End Region
-
-    'Remove selected file(s) from cycle list
-    Private Sub RemoveCycle()
-        Dim lastindx As Integer
-        Dim SelIx() As Integer
-        Dim i As Integer
-
-        If Me.LvDRI.SelectedItems.Count < 1 Then
-            If Me.LvDRI.Items.Count = 1 Then
-                Me.LvDRI.Items(0).Selected = True
-            Else
-                Exit Sub
-            End If
-        End If
-
-        CheckLock = True
-        LvDRI.BeginUpdate()
-
-        ReDim SelIx(LvDRI.SelectedItems.Count - 1)
-        LvDRI.SelectedIndices.CopyTo(SelIx, 0)
-
-        lastindx = LvDRI.SelectedIndices(LvDRI.SelectedItems.Count - 1)
-
-        For i = UBound(SelIx) To 0 Step -1
-            LvDRI.Items.RemoveAt(SelIx(i))
-        Next
-
-        If lastindx < LvDRI.Items.Count Then
-            LvDRI.Items(lastindx).Selected = True
-        Else
-            If LvDRI.Items.Count > 0 Then LvDRI.Items(LvDRI.Items.Count - 1).Selected = True
-        End If
-
-        CheckLock = False
-        LvDRI.EndUpdate()
-
-        DRIchecked = LvDRI.CheckedItems.Count
-        UpdateCycleTabText()
-    End Sub
-
-    'Browse for cycle file(s) and add to cycle list with AddToCycleListView
-    Private Sub AddCycle()
-        If fbDRI.OpenDialog("", True) Then
-            AddToCycleListView(fbDRI.Files)
-            If LvDRI.Items.Count > 0 Then LvDRI.Items(LvDRI.Items.Count - 1).Selected = True
-        End If
-    End Sub
-
-    'Open cycle in list
-    Private Sub OpenCycle()
-
-        If Me.LvDRI.SelectedItems.Count < 1 Then
-            If Me.LvDRI.Items.Count = 1 Then
-                Me.LvDRI.Items(0).Selected = True
-            Else
-                Exit Sub
-            End If
-        End If
-
-        OpenFiles(fFileRepl(Me.LvDRI.SelectedItems(0).SubItems(0).Text))
-    End Sub
-
-    'Add File to cycle listview (multiple files)
-    Private Sub AddToCycleListView(ByVal Path As String())
-        Dim pDim As Int16
-        Dim p As Int16
-        Dim ListViewItem0 As ListViewItem
-
-        pDim = UBound(Path)
-
-        Me.LvDRI.BeginUpdate()
-        CheckLock = True
-
-        'Mode switch if necessary
-        If Not Me.CbBatch.Checked Then Me.CbBatch.Checked = True
-
-        For p = 0 To pDim
-            ListViewItem0 = New ListViewItem(Path(p))   'fFileWD(Path(p)))
-            ListViewItem0.SubItems.Add(" ")
-            ListViewItem0.Checked = True
-            Me.LvDRI.Items.Add(ListViewItem0)
-lbFound:
-        Next
-
-        Me.LvDRI.EndUpdate()
-        CheckLock = False
-
-        'Number update
-        DRIchecked = Me.LvDRI.CheckedItems.Count
-        UpdateCycleTabText()
-
-    End Sub
-
-    'Add File to cycle listview (single file)
-    Private Sub AddToCycleListView(ByVal Path As String)
-        Dim p(0) As String
-        p(0) = Path
-        AddToCycleListView(p)
-    End Sub
-
-    'Update cycle files counter in tab titel
-    Private Sub UpdateCycleTabText()
-        Dim c As Integer
-        c = Me.LvDRI.Items.Count
-
-        Me.TabPageDRI.Text = "Driving Cycles ( " & DRIchecked & " / " & c & " )"
-        'Me.TabPageDRI.Text = "Driving Cycles (" & c & ")"
-
-        DRIcheckAllLock = True
-
-        If DRIchecked = 0 Then
-            Me.ChBoxAllDRI.CheckState = CheckState.Unchecked
-        ElseIf DRIchecked = c Then
-            Me.ChBoxAllDRI.CheckState = CheckState.Checked
-        Else
-            Me.ChBoxAllDRI.CheckState = CheckState.Indeterminate
-        End If
-
-        DRIcheckAllLock = False
-
-    End Sub
-
-#End Region
-
-#Region "Toolstrip"
-
-    'New Job file
-    Private Sub ToolStripBtNew_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtNew.Click
-        OpenVECTOeditor("<New>")
-    End Sub
-
-    'Open input file
-    Private Sub ToolStripBtOpen_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtOpen.Click
-
-        If fbVECTO.OpenDialog("", False, "vecto,vveh,vgbx,veng,vsig") Then
-            OpenVectoFile(fbVECTO.Files(0))
-        End If
-
-    End Sub
-
-    Private Sub GENEditorToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles GENEditorToolStripMenuItem1.Click
-        OpenVECTOeditor("<New>")
-    End Sub
-
-    Private Sub VEHEditorToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles VEHEditorToolStripMenuItem.Click
-        If Not F_VEH.Visible Then
-            F_VEH.Show()
-        Else
-            If F_VEH.WindowState = FormWindowState.Minimized Then F_VEH.WindowState = FormWindowState.Normal
-            F_VEH.BringToFront()
-        End If
-    End Sub
-
-    Private Sub EngineEditorToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles EngineEditorToolStripMenuItem.Click
-        If Not F_ENG.Visible Then
-            F_ENG.Show()
-        Else
-            If F_ENG.WindowState = FormWindowState.Minimized Then F_ENG.WindowState = FormWindowState.Normal
-            F_ENG.BringToFront()
-        End If
-    End Sub
-
-    Private Sub GearboxEditorToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GearboxEditorToolStripMenuItem.Click
-        If Not F_GBX.Visible Then
-            F_GBX.Show()
-        Else
-            If F_GBX.WindowState = FormWindowState.Minimized Then F_GBX.WindowState = FormWindowState.Normal
-            F_GBX.BringToFront()
-        End If
-    End Sub
-
-    Private Sub GraphToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GraphToolStripMenuItem.Click
-        Dim FGraph As New F_Graph
-        FGraph.Show()
-    End Sub
-
-    Private Sub SignOrVerifyFilesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SignOrVerifyFilesToolStripMenuItem.Click
-        If Not F_FileSign.Visible Then
-            F_FileSign.Show()
-        Else
-            If F_FileSign.WindowState = FormWindowState.Minimized Then F_FileSign.WindowState = FormWindowState.Normal
-            F_FileSign.BringToFront()
-        End If
-    End Sub
-
-    Private Sub OpenLogToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenLogToolStripMenuItem.Click
-        System.Diagnostics.Process.Start(MyAppPath & "log.txt")
-    End Sub
-
-    Private Sub SettingsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SettingsToolStripMenuItem.Click
-        F_Settings.ShowDialog()
-    End Sub
-
-    Private Sub UserManualToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles UserManualToolStripMenuItem.Click
-        If IO.File.Exists(MyAppPath & "User Manual\usermanual.html") Then
-            System.Diagnostics.Process.Start(MyAppPath & "User Manual\usermanual.html")
-        Else
-            MsgBox("User Manual not found!", MsgBoxStyle.Critical)
-        End If
-    End Sub
-
-    Private Sub UpdateNotesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles UpdateNotesToolStripMenuItem.Click
-        If IO.File.Exists(MyAppPath & "User Manual\Release Notes.pdf") Then
-            System.Diagnostics.Process.Start(MyAppPath & "User Manual\Release Notes.pdf")
-        Else
-            MsgBox("Release Notes not found!", MsgBoxStyle.Critical)
-        End If
-    End Sub
-
-    Private Sub CreateActivationFileToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CreateActivationFileToolStripMenuItem.Click
-        If MsgBox("Create Activation File ?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
-            If Lic.CreateActFile(MyAppPath & "ActivationCode.dat") Then
-                GUImsg(tMsgID.Normal, "Activation File created.")
-            Else
-                GUImsg(tMsgID.Err, "Failed to create Activation File!")
-                MsgBox("ERROR! Failed to create Activation File!", MsgBoxStyle.Critical)
-            End If
-        End If
-    End Sub
-
-    Private Sub AboutVECTOToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles AboutVECTOToolStripMenuItem1.Click
-        F_AboutBox.ShowDialog()
-    End Sub
-
-
-
-
-#End Region
-
-    'Move job/cycle file up or down in list view
-    Private Sub MoveItem(ByRef ListV As ListView, ByVal MoveUp As Boolean)
-        Dim x As Int32
-        Dim y As Int32
-        Dim y1 As Int32
-        Dim items() As String
-        Dim check() As Boolean
-        Dim index() As Integer
-        Dim ListViewItem0 As ListViewItem
-
-        If GUIlocked Then Exit Sub
-
-        'Cache Selected Items
-        y1 = ListV.SelectedItems.Count - 1
-        ReDim items(y1)
-        ReDim check(y1)
-        ReDim index(y1)
-        y = 0
-        For Each x In ListV.SelectedIndices
-            items(y) = ListV.Items(x).SubItems(0).Text
-            check(y) = ListV.Items(x).Checked
-            If MoveUp Then
-                If x = 0 Then Exit Sub
-                index(y) = x - 1
-            Else
-                If x = ListV.Items.Count - 1 Then Exit Sub
-                index(y) = x + 1
-            End If
-            y += 1
-        Next
-
-        ListV.BeginUpdate()
-
-        'Delete Selected Items
-        For Each ListViewItem0 In ListV.SelectedItems
-            ListViewItem0.Remove()
-        Next
-
-        'Items select and Insert
-        'For y = y1 To 0 Step -1
-        For y = 0 To y1
-            If Not check(y) Then GENchecked += 1
-            ListViewItem0 = ListV.Items.Insert(index(y), items(y))
-            ListViewItem0.SubItems.Add(" ")
-            ListViewItem0.Checked = check(y)
-            ListV.SelectedIndices.Add(index(y))
-        Next
-
-        ListV.EndUpdate()
-
-    End Sub
-
-
-#Region "job/cycle file List - Context Menu"
-
-    'Save List
-    Private Sub SaveListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveListToolStripMenuItem.Click
-        If fbFileLists.SaveDialog("") Then
-            If ConMenTarJob Then
-                JobListView.SaveList(fbFileLists.Files(0))
-            Else
-                CycleListView.SaveList(fbFileLists.Files(0))
-            End If
-        End If
-    End Sub
-
-    'Load List
-    Private Sub LoadListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadListToolStripMenuItem.Click
-
-        If GUIlocked Then Exit Sub
-
-        If fbFileLists.OpenDialog("") Then
-
-            If ConMenTarJob Then    'GEN
-                JobListView.LoadList(fbFileLists.Files(0))
-                GENchecked = Me.LvGEN.CheckedItems.Count
-                UpdateJobTabText()
-            Else                    'DRI
-                'Mode toggle 
-                If Not Me.CbBatch.Checked Then Me.CbBatch.Checked = True
-                CycleListView.LoadList(fbFileLists.Files(0))
-                DRIchecked = Me.LvDRI.CheckedItems.Count
-                UpdateCycleTabText()
-            End If
-
-        End If
-
-    End Sub
-
-    'Load Default List
-    Private Sub LoadDefaultListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadDefaultListToolStripMenuItem.Click
-
-        If GUIlocked Then Exit Sub
-
-        If ConMenTarJob Then
-
-            JobListView.LoadList()
-
-            GENchecked = Me.LvGEN.CheckedItems.Count
-            UpdateJobTabText()
-        Else
-            CycleListView.LoadList()
-            DRIchecked = Me.LvDRI.CheckedItems.Count
-            UpdateCycleTabText()
-        End If
-    End Sub
-
-    'Clear List
-    Private Sub ClearListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearListToolStripMenuItem.Click
-        'Dim ListViewItem0 As ListViewItem
-        'For Each ListViewItem0 In ConMenTarget.SelectedItems
-        '    ListViewItem0.Remove()
-        'Next
-        If GUIlocked Then Exit Sub
-
-        ConMenTarget.Items.Clear()
-        If ConMenTarJob Then
-            GENchecked = Me.LvGEN.CheckedItems.Count
-            UpdateJobTabText()
-        Else
-            DRIchecked = Me.LvDRI.CheckedItems.Count
-            UpdateCycleTabText()
-        End If
-    End Sub
-
-#End Region
-
-    'VECTO Start button - Calls VECTO_Launcher or aborts calculation
-    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
-        'VECTO Start/Stop
-        If VECTOworker.IsBusy Then
-
-            'If VECTO already running: STOP
-            ComLineShutDown = False
-            JobAbort()
-
-        Else
-
-            '...Otherwise: START
-
-            'Save Lists if Crash
-            SaveFileLists()
-
-            'Start
-            VECTO_Launcher()
-
-        End If
-
-    End Sub
-
-    'Mode Change (STANDARD/BATCH)
-    Private Sub CbBatch_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CbBatch.CheckedChanged
-        ModeUpdate()
-    End Sub
-
-    Private Sub ModeUpdate()
-
-        'Save lists
-        JobListView.SaveList()
-        If Cfg.BatchMode Then CycleListView.SaveList()
-
-        'New mode
-        Cfg.BatchMode = Me.CbBatch.Checked
-
-        'GUI changes according to current mode
-
-        If Cfg.BatchMode Then
-
-            LastModeName = "Batch"
-
-            'Load cycle list
-            CycleListView.LoadList()
-
-            'Update cycle counter
-            DRIchecked = Me.LvDRI.CheckedItems.Count
-            UpdateCycleTabText()
-
-            'Show mode-specific settings
-            Me.GrBoxSTD.Visible = False
-            Me.GrBoxBATCH.Visible = True
-
-            'Show Cycle Tab Page
-            If Not CycleTabPageVisible Then
-                Me.TabControl1.TabPages.Insert(1, CycleTabPage)
-                CycleTabPageVisible = True
-            End If
-
-        Else
-
-            If Cfg.DeclMode Then
-                LastModeName = "Declaration"
-            Else
-                LastModeName = "Engineering"
-            End If
-
-            'Show mode-specific settings
-            Me.GrBoxSTD.Visible = False  'Currently no specific settings for STANDARD mode, therefore always 'False'
-            Me.GrBoxBATCH.Visible = False
-
-            'Hide Cycle Tab Page
-            If CycleTabPageVisible Then
-                Me.TabControl1.Controls.Remove(CycleTabPage)
-                CycleTabPageVisible = False
-            End If
-
-        End If
-
-        'Update job counter
-        GENchecked = Me.LvGEN.CheckedItems.Count
-        UpdateJobTabText()
-
-        'Status label
-        Status(LastModeName & " Mode")
-
-    End Sub
-
-    'Class for ListView control - Job and cycle lists
-    Private Class cFileListView
-
-        Private FilePath As String
-        Private LoadedDefault As Boolean
-        Public LVbox As ListView
-
-        Public Sub New(ByVal Path As String)
-            FilePath = Path
-            LoadedDefault = False
-        End Sub
-
-        Public Sub SaveList(Optional ByVal Path As String = "")
-            Dim x As Int32
-            Dim file As cFile_V3
-            'If LVbox.Items.Count = 0 Then Exit Sub
-            file = New cFile_V3
-            If Path = "" Then
-                If Not LoadedDefault Then Exit Sub
-                Path = FilePath
-            End If
-            file.OpenWrite(Path, "?")
-            For x = 1 To LVbox.Items.Count
-                file.WriteLine(LVbox.Items(x - 1).SubItems(0).Text, Math.Abs(CInt(LVbox.Items(x - 1).Checked)))
-            Next
-            file.Close()
-            file = Nothing
-        End Sub
-
-        Public Sub LoadList(Optional ByVal Path As String = "")
-            Dim line As String()
-            Dim NoCheck As Boolean
-            Dim file As cFile_V3
-            Dim ListViewItem0 As ListViewItem
-
-            If Path = "" Then
-                Path = FilePath
-                LoadedDefault = True
-            End If
-
-            file = New cFile_V3
-
-            If Not file.OpenRead(Path, "?") Then
-                If Not LoadedDefault Then GUImsg(tMsgID.Err, "Cannot open file (" & Path & ")!")
-                Exit Sub
-            End If
-
-            F_MAINForm.CheckLock = True
-            LVbox.BeginUpdate()
-
-            LVbox.Items.Clear()
-
-            NoCheck = False
-            Do While Not file.EndOfFile
-                line = file.ReadLine
-
-                ListViewItem0 = New ListViewItem(line(0))
-                ListViewItem0.SubItems.Add(" ")
-
-                If NoCheck Then
-                    ListViewItem0.Checked = True
-                Else
-                    If UBound(line) < 1 Then
-                        NoCheck = True
-                        ListViewItem0.Checked = True
-                    Else
-                        If IsNumeric(line(1)) Then
-                            ListViewItem0.Checked = CBool(line(1))
-                        Else
-                            ListViewItem0.Checked = True
-                        End If
-                    End If
-                End If
-                LVbox.Items.Add(ListViewItem0)
-            Loop
-
-            file.Close()
-
-            LVbox.EndUpdate()
-            F_MAINForm.CheckLock = False
-
-            If LVbox.Items.Count > 0 Then LVbox.Items(LVbox.Items.Count - 1).EnsureVisible()
-
-        End Sub
-
-    End Class
-
-    'Set color of job files in list (Error, Warnings, Currently running, etc.)
-    Private Sub SetCheckedItemColor(ByVal LvID As Integer, ByVal Status As tJobStatus)
-        Dim lv0 As ListViewItem
-
-        lv0 = CheckedItems(LvID)
-
-        Select Case Status
-            Case tJobStatus.Err
-                lv0.BackColor = Color.Red
-                lv0.ForeColor = Color.White
-            Case tJobStatus.OK
-                lv0.BackColor = Color.White
-                lv0.ForeColor = Color.DarkGreen
-            Case tJobStatus.Warn
-                lv0.BackColor = Color.Khaki
-                lv0.ForeColor = Color.DarkBlue      'FromArgb(218, 125, 0) 'DarkOrange 'OrangeRed
-            Case tJobStatus.Queued
-                lv0.BackColor = Color.LightGray
-                lv0.ForeColor = Color.DarkBlue
-            Case tJobStatus.Running
-                lv0.BackColor = Color.DarkBlue
-                lv0.ForeColor = Color.White
-            Case tJobStatus.Undef
-                lv0.BackColor = Color.FromKnownColor(KnownColor.Window)
-                lv0.ForeColor = Color.FromKnownColor(KnownColor.WindowText)
-        End Select
-
-    End Sub
-
-    'Open Job Editor and open file (or new file)
-    Friend Sub OpenVECTOeditor(ByVal x As String)
-
-        If Not F_VECTO.Visible Then
-            F_VECTO.Show()
-        Else
-            If F_VECTO.WindowState = FormWindowState.Minimized Then F_VECTO.WindowState = FormWindowState.Normal
-            F_VECTO.BringToFront()
-        End If
-
-        If x = "<New>" Then
-            F_VECTO.VECTOnew()
-        Else
-            F_VECTO.VECTOload2Form(x)
-        End If
-
-        F_VECTO.Activate()
-
-    End Sub
-
-    'Open signature file (.vsig)
-    Friend Sub OpenSigFile(ByVal file As String)
-        If Not F_FileSign.Visible Then
-            F_FileSign.Show()
-
-        End If
-        F_FileSign.WindowState = FormWindowState.Normal
-        F_FileSign.TbSigFile.Text = file
-        F_FileSign.VerifySigFile()
-        F_FileSign.Activate()
-    End Sub
-
-    'Save job and cycle file lists
-    Private Sub SaveFileLists()
-        JobListView.SaveList()
-        If Cfg.BatchMode Then CycleListView.SaveList()
-    End Sub
-
-
-#Region "Progressbar controls"
-
-    'Initialise progress bar (Start of next job in calculation)
-    Private Sub ProgSecStart()
-        Me.ToolStripProgBarJob.Value = 0
-        Me.ToolStripProgBarJob.Style = ProgressBarStyle.Marquee
-        Me.ToolStripProgBarJob.Visible = True
-        Me.TmProgSec.Start()
-    End Sub
-
-    'Stop - Hide progress bar
-    Private Sub ProgSecStop()
-        Me.TmProgSec.Stop()
-        Me.ToolStripProgBarJob.Visible = False
-        Me.ToolStripProgBarJob.Value = 0
-    End Sub
-
-    'Timer to update progress bar regularly
-    Private Sub TmProgSec_Tick(sender As Object, e As System.EventArgs) Handles TmProgSec.Tick
-        If GUItest0.TestActive Then
-            Call GUItest0.TestTick()
-            Exit Sub
-        Else
-            If Not ProgBarCtrl.ProgLock Then ProgSecUpdate()
-        End If
-    End Sub
-
-    'Update progress bar (timer controlled)
-    Private Sub ProgSecUpdate()
-
-        With ProgBarCtrl
-
-            If .ProgJobInt > 0 AndAlso Me.ToolStripProgBarJob.Style = ProgressBarStyle.Marquee Then
-                Me.ToolStripProgBarJob.Style = ProgressBarStyle.Continuous
-            End If
-
-            If .ProgJobInt < 0 Then
-                .ProgJobInt = 0
-            ElseIf .ProgJobInt > 100 Then
-                .ProgJobInt = 100
-            End If
-
-            Me.ToolStripProgBarJob.Value = .ProgJobInt
-
-            If .ProgOverallStartInt > -1 Then
-                Me.ToolStripProgBarOverall.Value = CInt(.ProgOverallStartInt + (.PgroOverallEndInt - .ProgOverallStartInt) * .ProgJobInt / 100)
-            End If
-
-        End With
-
-    End Sub
-
-
-#End Region
-
-#Region "Options Tab"
-
-    'Load options from config class
-    Public Sub LoadOptions()
-        Me.ChBoxCyclDistCor.Checked = Cfg.DistCorr
-        Me.ChBoxUseGears.Checked = Cfg.GnUfromCycle
-        Me.ChBoxModOut.Checked = Cfg.ModOut
-        CbBOmode.SelectedIndex = -1
-        Select Case UCase(Cfg.BATCHoutpath)
-            Case sKey.JobPath
-                CbBOmode.SelectedIndex = 0
-            Case Else
-                CbBOmode.SelectedIndex = 1
-                Me.TbBOpath.Text = Cfg.BATCHoutpath
-        End Select
-        Me.ChBoxBatchSubD.Checked = Cfg.BATCHoutSubD
-
-        'Set Mode
-        If Not Cfg.DeclMode Then Me.CbBatch.Checked = Cfg.BatchMode
-
-        Me.RbDecl.Checked = Cfg.DeclMode
-
-    End Sub
-
-    'Update config class from options in GUI, e.g. before running calculations 
-    Private Sub SetOptions()
-
-        'General(Allgemein)
-        Cfg.DistCorr = Me.ChBoxCyclDistCor.Checked
-        Cfg.GnUfromCycle = Me.ChBoxUseGears.Checked
-
-        'BATCH
-        Cfg.ModOut = Me.ChBoxModOut.Checked
-        Select Case CbBOmode.SelectedIndex
-            Case 0
-                Cfg.BATCHoutpath = sKey.JobPath
-            Case Else
-                Cfg.BATCHoutpath = Trim(Me.TbBOpath.Text)
-                If Microsoft.VisualBasic.Right(Cfg.BATCHoutpath, 1) <> "\" Then Cfg.BATCHoutpath &= "\"
-        End Select
-        Cfg.BATCHoutSubD = Me.ChBoxBatchSubD.Checked
-
-        DEV.SetOptions()
-
-
-    End Sub
-
-#Region "Events"
-
-    Private Sub ChBoxAutoSD_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChBoxAutoSD.CheckedChanged
-        Me.LbAutoShDown.Visible = Me.ChBoxAutoSD.Checked
-    End Sub
-
-    Private Sub CbBOmode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CbBOmode.SelectedIndexChanged
-        Me.TbBOpath.Visible = (Me.CbBOmode.SelectedIndex = 2)
-        Me.ButBObrowse.Visible = (Me.CbBOmode.SelectedIndex = 2)
-    End Sub
-
-    Private Sub ButBObrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButBObrowse.Click
-        If fbFolder.OpenDialog(Me.TbBOpath.Text) Then
-            Me.TbBOpath.Text = fbFolder.Files(0)
-        End If
-    End Sub
-
-    Private Sub ChBoxBatchOut_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChBoxModOut.CheckedChanged
-        Me.ChBoxBatchSubD.Enabled = Me.ChBoxModOut.Checked
-    End Sub
-
-#End Region
-
-
-#End Region
-
-#Region "Developer options (DEV) Tab"
-
-    'Load DEV options
-    Private Sub LoadDEVconfigs()
-        Dim LV0 As ListViewItem
-        Dim i As Integer
-        Dim Config0 As KeyValuePair(Of String, cDEVoption)
-
-        Me.LvDEVoptions.Items.Clear()
-
-        i = -1
-        For Each Config0 In DEV.Options
-            i += 1
-
-            LV0 = New ListViewItem
-            LV0.SubItems(0).Text = Config0.Key
-            LV0.SubItems.Add(Config0.Value.Description)
-            LV0.SubItems.Add(Config0.Value.TypeString)
-            LV0.SubItems.Add("")
-            LV0.SubItems.Add(Config0.Value.ValTextDef)
-
-            If Config0.Value.ConfigType = tDEVconfType.tAction Then
-                LV0.SubItems.Add("")
-            Else
-                If Config0.Value.SaveInFile Then
-                    LV0.SubItems.Add("True")
-                Else
-                    LV0.SubItems.Add("False")
-                End If
-            End If
-
-
-
-            LV0.Tag = Config0.Key
-
-            If Not Config0.Value.Enabled Then
-                LV0.ForeColor = Color.DarkGray
-            End If
-
-            Me.LvDEVoptions.Items.Add(LV0)
-
-            UpdateDEVconfigs(LV0)
-
-        Next
-
-    End Sub
-
-    'Update value of specific DEV option
-    Private Sub UpdateDEVconfigs(ByRef LV0 As ListViewItem)
-        LV0.SubItems(3).Text = DEV.Options(LV0.Tag).ValText
-    End Sub
-
-    'Change value of DEV option or execute action-type DEV options
-    Private Sub LvDEVoptions_DoubleClick(sender As Object, e As System.EventArgs) Handles LvDEVoptions.DoubleClick
-        Dim Config0 As cDEVoption
-        Dim str As String
-        Dim i As Integer
-
-        Config0 = DEV.Options(Me.LvDEVoptions.SelectedItems(0).Tag)
-
-        If Not Config0.Enabled Then Exit Sub
-
-        Select Case Config0.ConfigType
-            Case tDEVconfType.tAction
-                Config0.DoAction()
-
-            Case tDEVconfType.tBoolean
-                Config0.BoolVal = Not Config0.BoolVal
-
-            Case tDEVconfType.tSelection
-
-                CmDEVitem = Me.LvDEVoptions.SelectedItems(0)
-
-                CmDEV.Items.Clear()
-
-                i = -1
-                For Each str In Config0.Modes
-                    i += 1
-                    CmDEV.Items.Add("(" & i & ") " & str)
-                    CmDEV.Items(i).Tag = i
-                Next
-
-                CmDEV.Show(Cursor.Position)
-
-            Case tDEVconfType.tIntVal
-                str = InputBox("New Value <" & Config0.TypeString & "> =", , Config0.ValToString)
-                If str <> "" AndAlso IsNumeric(str) Then
-                    Config0.IntVal = CInt(str)
-                End If
-
-            Case tDEVconfType.tSingleVal
-                str = InputBox("New Value <" & Config0.TypeString & "> =", , Config0.ValToString)
-                If str <> "" AndAlso IsNumeric(str) Then
-                    Config0.SingleVal = CSng(str)
-                End If
-
-            Case Else 'tDEVconfType.tStringVal
-                Dim dlg As New F_StrInpBox
-                Config0.StringVal = dlg.ShowDlog("New Value <" & Config0.TypeString & "> =", Config0.StringVal)
-        End Select
-
-        UpdateDEVconfigs(Me.LvDEVoptions.SelectedItems(0))
-
-    End Sub
-
-    'Context menu for selection-type DEV options
-    Private Sub CmDEV_ItemClicked(sender As Object, e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles CmDEV.ItemClicked
-        Dim i As Integer
-
-        i = e.ClickedItem.Tag
-
-        DEV.Options(CmDEVitem.Tag).ModeIndex = i
-
-        UpdateDEVconfigs(CmDEVitem)
-
-    End Sub
-
-
-
-
-#End Region
-
-    'Add message to message list
-    Public Sub MSGtoForm(ByVal ID As tMsgID, ByVal Msg As String, ByVal Source As String, ByVal Link As String)
-
-        Dim lv0 As ListViewItem
-
-        lv0 = New ListViewItem
-        lv0.Text = Msg
-        lv0.SubItems.Add(Now.ToString)
-        lv0.SubItems.Add(Source)
-
-        If LvMsg.Items.Count > 9999 Then LvMsg.Items.RemoveAt(0)
-
-        LogFile.WriteToLog(ID, Msg & vbTab & Source)
-
-        Select Case ID
-
-            Case tMsgID.Err
-
-                lv0.BackColor = Color.Red
-                lv0.ForeColor = Color.White
-
-            Case tMsgID.Warn
-
-                lv0.BackColor = Color.Khaki              'FromArgb(218, 125, 0) 'DarkOrange
-                lv0.ForeColor = Color.Black
-
-            Case Else
-
-                If ID = tMsgID.NewJob Then
-                    lv0.BackColor = Color.LightGray
-                    lv0.ForeColor = Color.DarkBlue
-                End If
-
-        End Select
-
-        If Link <> "" Then
-            If Not ID = tMsgID.Err Then lv0.ForeColor = Color.Blue
-            lv0.SubItems(0).Font = New Font(Me.LvMsg.Font, FontStyle.Underline)
-            lv0.Tag = Link
-        End If
-
-
-        LvMsg.Items.Add(lv0)
-
-        lv0.EnsureVisible()
-
-    End Sub
-
-
-
-
-    'Open link in message list
-    Private Sub LvMsg_MouseClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles LvMsg.MouseClick
-        Dim txt As String
-        If Me.LvMsg.SelectedIndices.Count > 0 Then
-            If Not Me.LvMsg.SelectedItems(0).Tag Is Nothing Then
-                If Len(CStr(Me.LvMsg.SelectedItems(0).Tag)) > 4 AndAlso Microsoft.VisualBasic.Left(CStr(Me.LvMsg.SelectedItems(0).Tag), 4) = "<UM>" Then
-                    txt = CStr(Me.LvMsg.SelectedItems(0).Tag).Replace("<UM>", MyAppPath & "User Manual")
-                    txt = txt.Replace(" ", "%20")
-                    txt = txt.Replace("\", "/")
-                    txt = "file:///" & txt
-                    Try
-                        System.Diagnostics.Process.Start(txt)
-                    Catch ex As Exception
-                        MsgBox("Cannot open link! (-_-;)")
-                    End Try
-                ElseIf Len(CStr(Me.LvMsg.SelectedItems(0).Tag)) > 5 AndAlso Microsoft.VisualBasic.Left(CStr(Me.LvMsg.SelectedItems(0).Tag), 5) = "<GUI>" Then
-                    txt = CStr(Me.LvMsg.SelectedItems(0).Tag).Replace("<GUI>", "")
-                    OpenVectoFile(txt)
-                ElseIf Len(CStr(Me.LvMsg.SelectedItems(0).Tag)) > 5 AndAlso Microsoft.VisualBasic.Left(CStr(Me.LvMsg.SelectedItems(0).Tag), 5) = "<RUN>" Then
-                    txt = CStr(Me.LvMsg.SelectedItems(0).Tag).Replace("<RUN>", "")
-                    Try
-                        Process.Start(txt)
-                    Catch ex As Exception
-                        GUImsg(tMsgID.Err, "Could not run '" & txt & "'!")
-                    End Try
-                Else
-                    OpenFiles(CStr(Me.LvMsg.SelectedItems(0).Tag))
-                End If
-            End If
-        End If
-    End Sub
-
-    'Link-cursor (Hand) for links
-    Private Sub LvMsg_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles LvMsg.MouseMove
-        Dim lv0 As ListViewItem
-        lv0 = Me.LvMsg.GetItemAt(e.Location.X, e.Location.Y)
-        If lv0 Is Nothing OrElse lv0.Tag Is Nothing Then
-            LvMsg.Cursor = Cursors.Arrow
-        Else
-            LvMsg.Cursor = Cursors.Hand
-        End If
-    End Sub
-
-#Region "Open File Context Menu"
-
-    Private CmFiles As String()
-
-    'Initialise and open context menu
-    Private Sub OpenFiles(ParamArray files() As String)
-
-        If files.Length = 0 Then Exit Sub
-
-        CmFiles = files
-
-        Me.OpenInGraphWindowToolStripMenuItem.Enabled = (UCase(fEXT(CmFiles(0))) = ".VMOD")
-
-
-        OpenWithToolStripMenuItem.Text = "Open with " & Cfg.OpenCmdName
-
-        CmOpenFile.Show(Cursor.Position)
-
-    End Sub
-
-    'Open with tool defined in Settings
-    Private Sub OpenWithToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenWithToolStripMenuItem.Click
-        If Not FileOpenAlt(CmFiles(0)) Then MsgBox("Failed to open file!")
-    End Sub
-
-    Private Sub OpenInGraphWindowToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenInGraphWindowToolStripMenuItem.Click
-        Dim FGraph As New F_Graph
-        FGraph.Show()
-        FGraph.LoadNewFile(CmFiles(0))
-    End Sub
-
-    'Show in folder
-    Private Sub ShowInFolderToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ShowInFolderToolStripMenuItem.Click
-        If IO.File.Exists(CmFiles(0)) Then
-            Try
-                System.Diagnostics.Process.Start("explorer", "/select,""" & CmFiles(0) & "")
-            Catch ex As Exception
-                MsgBox("Failed to open file!")
-            End Try
-        Else
-            MsgBox("File not found!")
-        End If
-    End Sub
-
-#End Region
-
-    'Change Declaraion Mode
-    Private Sub RbDecl_CheckedChanged(sender As Object, e As System.EventArgs) Handles RbDecl.CheckedChanged
-        If CbDeclLock Then Exit Sub
-
-        If F_VECTO.Visible Or F_VEH.Visible Or F_GBX.Visible Or F_ENG.Visible Then
-            CbDeclLock = True
-            Me.RbDecl.Checked = Not Me.RbDecl.Checked
-            CbDeclLock = False
-            MsgBox("Please close all dialog windows (e.g. Job Editor) before changing mode!")
-        Else
-            Cfg.DeclMode = Me.RbDecl.Checked
-            Me.RbDev.Checked = Not Me.RbDecl.Checked
-            DeclOnOff()
-        End If
-
-    End Sub
-
-
-
-
-
-#Region "GUI Tests"
-
-    Private GUItest0 As New GUItest(Me)
-
-    Private Class GUItest
-        Private RowLim As Int16 = 9
-        Private ColLim As Int16 = 45
-        Public TestActive As Boolean = False
-        Private TestAborted As Boolean
-        Private xCtrl As Int16
-        Private xPanel As Int16
-        Private Scr As Int32
-        Private PRbAlt As Boolean
-        Private Ctrls(RowLim + 1) As Int16
-        Private Pnls(RowLim + 1) As Int16
-        Private CtrlC As Int16
-        Private CtrlCL As Int16
-        Private PnDir As Int16
-        Private PnDirC As Int16
-        Private PnDirCL As Int16
-        Private PnDirRnd As Int16
-        Private CtrlRnd As Int16
-        Private DiffC As Int16
-        Private DiffLvl As Int16
-        Private bInit As Int16
-        Private MyForm As F_MAINForm
-        Private KeyCode As List(Of Integer)
-
-        Private Sub TestRun()
-
-            Dim z As Int16
-
-            xPanel = ColLim - 10
-            xCtrl = ColLim - 10
-            PRbAlt = False
-            Scr = 0
-            PnDir = 0
-            PnDirCL = 10
-            PnDirC = 0 ' StrDirCL
-            CtrlCL = 5
-            CtrlC = CtrlCL
-            PnDirRnd = 5
-            CtrlRnd = 8
-            DiffC = 0
-            DiffLvl = 1
-            bInit = 0
-            TestAborted = False
-            Randomize()
-
-
-            MyForm.LvMsg.Items.Clear()
-            MyForm.ToolStripLbStatus.Text = "Score: 0000             Press <Esc> to Quit"
-
-            For z = 1 To RowLim - 6
-                PRbAlt = Not PRbAlt
-                If Not PRbAlt Then
-                    MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|       |*")
-                Else
-                    MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|   |   |*")
-                End If
-            Next
-
-            PRbAlt = False
-
-            MyForm.LvMsg.Items.Add("  VECTO Interactive Mode" & Space(ColLim - 35) & "*|       |*")
-            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|   |   |*")
-            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|       |*")
-            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|   |   |*")
-            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|       |*")
-            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|   ∆   |*")
-
-            For z = 1 To RowLim + 1
-                Pnls(z) = ColLim - 10
-                Ctrls(z) = 0
-            Next
-
-            MyForm.TmProgSec.Interval = 200
-
-            MyForm.LvMsg.Focus()
-
-            MyForm.TmProgSec.Start()
-
-
-        End Sub
-
-        Public Sub TestStop()
-            MyForm.TmProgSec.Stop()
-            TestActive = False
-            MyForm.LvMsg.Items.Clear()
-            CtrlC = 0
-            MyForm.ToolStripLbStatus.Text = MyForm.LastModeName & " Mode"
-        End Sub
-
-        Public Sub TestTick()
-
-            If bInit = 24 Then GoTo LbRace
-            bInit += 1
-
-            Select Case bInit
-                Case 10
-                    MyForm.LvMsg.Items.RemoveAt(RowLim - 6)
-                    MyForm.LvMsg.Items.RemoveAt(RowLim - 5)
-                    MyForm.LvMsg.Items.Insert(RowLim - 6, Space(ColLim - 11) & "*|       |*")
-                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & "  3      " & Space(10) & "*|       |*")
-                Case 14
-                    MyForm.LvMsg.Items.RemoveAt(RowLim - 4)
-                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & "  2      " & Space(10) & "*|       |*")
-                Case 18
-                    MyForm.LvMsg.Items.RemoveAt(RowLim - 4)
-                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & "  1      " & Space(10) & "*|       |*")
-                Case 22
-                    MyForm.LvMsg.Items.RemoveAt(RowLim - 4)
-                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & " Go!     " & Space(10) & "*|       |*")
-                Case 24
-                    MyForm.LvMsg.Items.RemoveAt(RowLim - 4)
-                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & "         " & Space(10) & "*|       |*")
-            End Select
-            Exit Sub
-LbRace:
-
-            PRbAlt = Not PRbAlt
-
-            MyForm.LvMsg.BeginUpdate()
-
-            sLists()
-
-            sAlign()
-
-            sSetCtrl()
-
-            sSetPanel()
-
-            MyForm.LvMsg.Items.RemoveAt(RowLim)
-
-            sUpdateCtrl()
-
-            MyForm.LvMsg.EndUpdate()
-
-            If Math.Abs(xCtrl - Pnls(2)) > 4 Then
-                sAbort()
-                Exit Sub
-            ElseIf Ctrls(2) <> 0 Then
-                If xCtrl = Pnls(2) + Ctrls(2) - 4 Then
-                    sAbort()
-                    Exit Sub
-                End If
-                Scr += 5 * DiffLvl
-            End If
-
-            Scr += DiffLvl
-            DiffC += 1
-
-            'Erhöhe Schwierigkeitsgrad
-            If DiffC = (DiffLvl + 3) * 4 Then
-                DiffC = 0
-                DiffLvl += 1
-                If DiffLvl > 2 And DiffLvl < 7 Then MyForm.TmProgSec.Interval = 300 - (DiffLvl) * 30
-                Scr += 100
-                Select Case DiffLvl
-                    Case 3
-                        PnDirCL = 3
-                        CtrlCL = 4
-                        CtrlRnd = 6
-                    Case 5
-                        PnDirCL = 2
-                        PnDirRnd = 4
-                    Case 8
-                        CtrlCL = 2
-                    Case 10
-                        CtrlRnd = 4
-                        PnDirRnd = 3
-                End Select
-            End If
-
-        End Sub
-
-        Public Sub TestKey(ByVal Key0 As Integer)
-
-            If TestActive Then
-                Select Case Key0
-                    Case Keys.Left
-                        xCtrl -= 1
-                        sUpdateCtrl()
-                    Case Keys.Right
-                        xCtrl += 1
-                        sUpdateCtrl()
-                    Case Keys.Escape
-                        TestStop()
-                End Select
-            Else
-
-                If KeyCode(CtrlC) = Key0 Then
-                    CtrlC += 1
-                    If CtrlC = KeyCode.Count Then
-                        TestActive = True
-                        TestRun()
-                    End If
-                Else
-                    CtrlC = 0
-                End If
-
-            End If
-        End Sub
-
-        Private Sub sAbort()
-
-            Dim s As String, s1 As String
-
-            If TestAborted Then Exit Sub
-
-            TestAborted = True
-
-            MyForm.TmProgSec.Stop()
-
-            MyForm.LvMsg.BeginUpdate()
-
-            s = MyForm.LvMsg.Items(0).Text
-            MyForm.LvMsg.Items.RemoveAt(0)
-            MyForm.LvMsg.Items.Insert(0, "You crashed!" & Microsoft.VisualBasic.Right(s, Len(s) - 12))
-
-            s = MyForm.LvMsg.Items(1).Text
-            s1 = "Score: " & Scr & " "
-            MyForm.LvMsg.Items.RemoveAt(1)
-            MyForm.LvMsg.Items.Insert(1, s1 & Microsoft.VisualBasic.Right(s, Len(s) - Len(s1)))
-
-            MyForm.LvMsg.EndUpdate()
-
-            LogFile.WriteToLog(tMsgID.Normal, "*** Race Score: " & Scr.ToString("0000") & " ***")
-
-            CtrlC = 0
-            TestActive = False
-
-            MyForm.ToolStripLbStatus.Text = MyForm.LastModeName & " Mode"
-
-
-        End Sub
-
-        Private Sub sSetCtrl()
-            Dim x As Int16
-            If Scr < 10 Then Exit Sub
-            Ctrls(RowLim + 1) = 0
-            CtrlC += 1
-            If CtrlC < CtrlCL Then Exit Sub
-            Select Case CInt(Int((CtrlRnd * Rnd()) + 1))
-                Case 1, 2
-                    CtrlC = 0
-                    x = CInt(Int((7 * Rnd()) + 1))
-                    Ctrls(RowLim + 1) = x
-                Case Else
-            End Select
-        End Sub
-
-        Private Sub sUpdateCtrl()
-            Dim s As String
-            If bInit < 21 Then
-                xCtrl = ColLim - 10
-                Exit Sub
-            End If
-            If Math.Abs(xCtrl - Pnls(1)) > 5 Then
-                sAbort()
-                Exit Sub
-            End If
-            s = Replace(MyForm.LvMsg.Items(RowLim - 1).Text.ToString, "∆", " ") & "   "
-            s = Microsoft.VisualBasic.Left(s, ColLim + 15)
-            's = s.Remove(0, 20)
-            's = "Press <Esc> to Quit " & s
-            If Mid(s, xCtrl + 5, 1) = "X" Then
-                sAbort()
-                Exit Sub
-            End If
-            s = s.Remove(xCtrl + 4, 1)
-            's = Trim(s.Insert(xCar + 4, "∆")) & Space(ColLim + 5 - Streets(2)) & "Pts: " & Pts & " Lv: " & DiffLvl
-            s = Space(Pnls(2) - 1) & Trim(s.Insert(xCtrl + 4, "∆"))
-            MyForm.LvMsg.Items.RemoveAt(RowLim - 1)
-            MyForm.LvMsg.Items.Insert(RowLim - 1, s)
-            MyForm.ToolStripLbStatus.Text = "Score: " & Scr.ToString("0000") & "             Press <Esc> to Quit"
-        End Sub
-
-        Private Sub sSetPanel()
-            Dim s As String
-            s = "*|   |   |*"
-            If PRbAlt Then
-                s = s.Remove(5, 1)
-                s = s.Insert(5, " ")
-            End If
-            If Ctrls(RowLim + 1) <> 0 Then
-                s = s.Remove(Ctrls(RowLim + 1) + 1, 1)
-                s = s.Insert(Ctrls(RowLim + 1) + 1, "X")
-            End If
-            Select Case xPanel - Pnls(RowLim)
-                Case -1
-                    s = Replace(s, "|", "\")
-                Case 1
-                    s = Replace(s, "|", "/")
-            End Select
-            MyForm.LvMsg.Items.Insert(0, Space(xPanel - 1) & s)
-        End Sub
-
-        Private Sub sAlign()
-            PnDirC += 1
-            If PnDirC < PnDirCL Then GoTo Lb1
-            PnDirC = 0
-            Select Case CInt(Int((PnDirRnd * Rnd()) + 1))
-                Case 1
-                    PnDir = 1
-                Case 2
-                    PnDir = -1
-                Case Else
-                    PnDir = 0
-            End Select
-Lb1:
-            xPanel += PnDir
-            If xPanel > ColLim Then
-                xPanel = ColLim
-            ElseIf xPanel < 22 Then
-                xPanel = 22
-            End If
-            Pnls(RowLim + 1) = xPanel
-        End Sub
-
-        Private Sub sLists()
-            Dim x As Int16
-            For x = 2 To RowLim + 1
-                Ctrls(x - 1) = Ctrls(x)
-                Pnls(x - 1) = Pnls(x)
-            Next
-        End Sub
-
-        Public Sub New(ByVal Form As F_MAINForm)
-            MyForm = Form
-            KeyCode = New List(Of Integer)
-            KeyCode.Add(Keys.Up)
-            KeyCode.Add(Keys.Up)
-            KeyCode.Add(Keys.Down)
-            KeyCode.Add(Keys.Down)
-            KeyCode.Add(Keys.Left)
-            KeyCode.Add(Keys.Right)
-            KeyCode.Add(Keys.Left)
-            KeyCode.Add(Keys.Right)
-            KeyCode.Add(Keys.B)
-            KeyCode.Add(Keys.A)
-            CtrlC = 0
-        End Sub
-
-    End Class
-
-    Private Sub LvMsg_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles LvMsg.KeyDown
-        GUItest0.TestKey(e.KeyValue)
-        If GUItest0.TestActive Then e.SuppressKeyPress = True
-    End Sub
-
-    Private Sub LvMsg_LostFocus(sender As Object, e As System.EventArgs) Handles LvMsg.LostFocus
-        If GUItest0.TestActive Then GUItest0.TestStop()
-    End Sub
-
-#End Region
-
-
-   
-End Class
+' Copyright 2014 European Union.
+' Licensed under the EUPL (the 'Licence');
+'
+' * You may not use this work except in compliance with the Licence.
+' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
+' * Unless required by applicable law or agreed to in writing,
+'   software distributed under the Licence is distributed on an "AS IS" basis,
+'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+'
+' See the LICENSE.txt for the specific language governing permissions and limitations.
+
+Imports System.Collections.Generic
+
+''' <summary>
+''' Main application form. Loads at application start. Closing form ends application.
+''' </summary>
+''' <remarks></remarks>
+
+Public Class F_MAINForm
+
+    Private JobListView As cFileListView
+    Private CycleListView As cFileListView
+
+    Private LastModeName As String
+    Private ConMenTarget As ListView
+    Private ConMenTarJob As Boolean
+
+    Private MODpath As String
+    Private MODVehList As Int32()
+
+    Private CycleTabPage As TabPage
+    Private CycleTabPageVisible As Boolean
+
+    Private ComLineShutDown As Boolean
+
+    Private GUIlocked As Boolean
+
+    Private CheckedItems As List(Of ListViewItem)
+
+    Private DEVpage As TabPage
+    Private CmDEVitem As ListViewItem
+
+    Private CheckLock As Boolean
+    Private GENchecked As Integer
+    Private DRIchecked As Integer
+    Private GENcheckAllLock As Boolean
+    Private DRIcheckAllLock As Boolean
+
+    Private CbDeclLock As Boolean = False
+
+
+#Region "SLEEP Control - Prevent sleep while VECTO is running"
+
+    Private Declare Function SetThreadExecutionState Lib "kernel32" (ByVal esFlags As Long) As Long
+
+    Private Sub AllowSleepOFF()
+#If Not PLATFORM = "x86" Then
+        SetThreadExecutionState(tEXECUTION_STATE.ES_CONTINUOUS Or tEXECUTION_STATE.ES_SYSTEM_REQUIRED)
+#End If
+    End Sub
+
+    Private Sub AllowSleepON()
+#If Not PLATFORM = "x86" Then
+        SetThreadExecutionState(tEXECUTION_STATE.ES_CONTINUOUS)
+#End If
+    End Sub
+
+    Private Enum tEXECUTION_STATE As Integer
+        ''' Informs the system that the state being set should remain in effect until the next call that uses ES_CONTINUOUS and one of the other state flags is cleared.
+        ES_CONTINUOUS = &H80000000
+        ''' Forces the display to be on by resetting the display idle timer.
+        ES_DISPLAY_REQUIRED = &H2
+        ''' Forces the system to be in the working state by resetting the system idle timer.
+        ES_SYSTEM_REQUIRED = &H1
+    End Enum
+
+#End Region
+
+#Region "FileBrowser Init/Close"
+    Private Sub FB_Initialize()
+        FB_Init = False
+        fbFolder = New cFileBrowser("WorkDir", True)
+        fbFileLists = New cFileBrowser("FileLists")
+        fbVECTO = New cFileBrowser("vecto")
+        fbVEH = New cFileBrowser("vveh")
+        fbMAP = New cFileBrowser("vmap")
+        fbDRI = New cFileBrowser("vdri")
+        fbFLD = New cFileBrowser("vfld")
+        fbENG = New cFileBrowser("veng")
+        fbGBX = New cFileBrowser("vgbx")
+        fbACC = New cFileBrowser("vacc")
+        fbAUX = New cFileBrowser("vaux")
+        fbGBS = New cFileBrowser("vgbs")
+        fbRLM = New cFileBrowser("vrlm")
+        fbTLM = New cFileBrowser("vtlm")
+        fbTCC = New cFileBrowser("vtcc")
+        fbCDx = New cFileBrowser("vcdx")
+
+        fbVMOD = New cFileBrowser("vmod")
+
+
+        '-------------------------------------------------------
+        fbFileLists.Extensions = New String() {"txt"}
+        fbVECTO.Extensions = New String() {"vecto"}
+        fbVEH.Extensions = New String() {"vveh"}
+        fbMAP.Extensions = New String() {"vmap"}
+        fbDRI.Extensions = New String() {"vdri"}
+        fbFLD.Extensions = New String() {"vfld"}
+        fbENG.Extensions = New String() {"veng"}
+        fbGBX.Extensions = New String() {"vgbx"}
+        fbACC.Extensions = New String() {"vacc"}
+        fbAUX.Extensions = New String() {"vaux"}
+        fbGBS.Extensions = New String() {"vgbs"}
+        fbRLM.Extensions = New String() {"vrlm"}
+        fbTLM.Extensions = New String() {"vtlm"}
+        fbTCC.Extensions = New String() {"vtcc"}
+        fbCDx.Extensions = New String() {"vcdv", "vcdb"}
+
+        fbVMOD.Extensions = New String() {"vmod"}
+
+
+    End Sub
+    Private Sub FB_Close()
+        fbFolder.Close()
+        fbFileLists.Close()
+        fbVECTO.Close()
+        fbVEH.Close()
+        fbMAP.Close()
+        fbDRI.Close()
+        fbFLD.Close()
+        fbENG.Close()
+        fbGBX.Close()
+        fbACC.Close()
+        fbAUX.Close()
+        fbGBS.Close()
+        fbRLM.Close()
+        fbTLM.Close()
+        fbTCC.Close()
+        fbCDx.Close()
+        fbVMOD.Close()
+    End Sub
+
+#End Region
+
+#Region "VECTO-Worker"
+
+    'VECTO-Launcher
+    Public Sub VECTO_Launcher()
+        Dim ProgOverall As Boolean
+        Dim GEN0 As cVECTO
+
+        'Called when VECTO already running
+        If VECTOworker.IsBusy Then
+            GUImsg(tMsgID.Err, "VECTO is already running!")
+            Exit Sub
+        End If
+
+        'Delete GENlist-Selection
+        Me.LvGEN.SelectedItems.Clear()
+
+        'If more than 100 calculations, ask whether to write by-second results
+        If Cfg.BatchMode And ((Me.LvGEN.CheckedItems.Count) * (Me.LvDRI.CheckedItems.Count) > 100) And Me.ChBoxModOut.Checked Then
+            Select Case MsgBox("You are about to run Batch Mode with " & (Me.LvGEN.CheckedItems.Count) * (Me.LvDRI.CheckedItems.Count) & " calculations!" & ChrW(10) & "Do you still want to write modal results?", MsgBoxStyle.YesNoCancel)
+                Case MsgBoxResult.No
+                    Me.ChBoxModOut.Checked = False
+                Case MsgBoxResult.Cancel
+                    GUImsg(tMsgID.Normal, "Aborted by User")
+                    Exit Sub
+            End Select
+        End If
+
+        'Status
+        Status("Launching VECTO...")
+
+
+        'Define Job-0list
+
+        'Define File / Cycle list
+        SetJobList()
+
+        'Zyklus-Liste definieren (falls nicht BATCH-Modus wird in SetCycleList nur die Liste gelöscht und nicht neu belegt) |@@| Define Cycle-list (if not BATCH mode in SetCycleList deleted only the list and not reassigned)
+        SetCycleList()
+
+        If JobFileList.Count = 0 Then
+            GUImsg(tMsgID.Err, "No job file selected!")
+            Exit Sub
+        End If
+
+        'Check whether Overall-progbar is needed
+        If Cfg.BatchMode Or JobFileList.Count > 1 Or Cfg.DeclMode Then
+            ProgOverall = True
+        Else
+            GEN0 = New cVECTO
+            GEN0.FilePath = JobFileList(0)
+            If Not GEN0.ReadFile Then
+                GUImsg(tMsgID.Err, "Failed to job file (" & fFILE(JobFileList(0), True) & ")!")
+                Exit Sub
+            End If
+            ProgOverall = (GEN0.CycleFiles.Count > 1)
+        End If
+
+        'Launch through Job_Launcher
+        Job_Launcher(ProgOverall)
+
+    End Sub
+
+    'Lock certain GUI elements while VECTO is running
+    Private Sub LockGUI(ByVal Lock As Boolean)
+        GUIlocked = Lock
+
+        Me.PanelOptAllg.Enabled = Not Lock
+        Me.GrBoxSTD.Enabled = Not Lock
+        Me.GrBoxBATCH.Enabled = Not Lock
+
+        Me.BtGENup.Enabled = Not Lock
+        Me.BtGENdown.Enabled = Not Lock
+        Me.ButtonGENadd.Enabled = Not Lock
+        Me.ButtonGENremove.Enabled = Not Lock
+        Me.LvGEN.LabelEdit = Not Lock
+        Me.ChBoxAllGEN.Enabled = Not Lock
+
+        Me.BtDRIup.Enabled = Not Lock
+        Me.BtDRIdown.Enabled = Not Lock
+        Me.ButtonDRIadd.Enabled = Not Lock
+        Me.ButtonDRIremove.Enabled = Not Lock
+        Me.LvDRI.LabelEdit = Not Lock
+        Me.ChBoxAllDRI.Enabled = Not Lock
+
+        If DEV.Enabled Then
+            Me.LvDEVoptions.Enabled = Not Lock
+        End If
+
+    End Sub
+
+    'Define job file list
+    Private Sub SetJobList()
+        Dim LV0 As ListViewItem
+        Dim x As Integer
+
+        JobFileList.Clear()
+        CheckedItems.Clear()
+
+        x = -1
+        For Each LV0 In Me.LvGEN.CheckedItems
+            x += 1
+            LV0.SubItems(1).Text = ""
+            CheckedItems.Add(LV0)
+            SetCheckedItemColor(x, tJobStatus.Queued)
+            JobFileList.Add(fFileRepl(LV0.SubItems(0).Text))
+        Next
+
+    End Sub
+
+    'Define cycle list (BATCH mode only)
+    Private Sub SetCycleList()
+        Dim LV0 As ListViewItem
+
+        JobCycleList.Clear()
+
+        If Cfg.BatchMode Then
+            For Each LV0 In Me.LvDRI.CheckedItems
+                JobCycleList.Add(fFileRepl(LV0.SubItems(0).Text))
+            Next
+        End If
+
+    End Sub
+
+    'Job Launcher
+    Private Sub Job_Launcher(ByVal ProgOverallEnabled As Boolean)
+
+        If VECTOworker.IsBusy Then Exit Sub
+
+        'Load Options from Options Tab
+        SetOptions()
+
+        'Save Config
+        Cfg.ConfigSAVE()
+
+        If DEV.Enabled Then DEV.SaveToFile()
+
+        'Reset Msg-output
+        ClearMSG()
+
+        'Button switch
+        Me.Button1.Text = "STOP"
+        Me.Button1.Image = My.Resources.Stop_icon
+
+        'Disable Options
+        LockGUI(True)
+
+        'ProgBars start
+        If ProgOverallEnabled Then
+            Me.ToolStripProgBarOverall.Value = 0
+            Me.ToolStripProgBarOverall.Style = ProgressBarStyle.Marquee
+            Me.ToolStripProgBarOverall.Visible = True
+        End If
+
+        ProgBarCtrl.ProgJobInt = 0
+        ProgSecStart()
+
+        'BG-Worker start
+        VECTOworker.RunWorkerAsync()
+
+    End Sub
+
+    'Abort Job
+    Private Sub JobAbort()
+        Me.Button1.Enabled = False
+        Me.Button1.Text = "Aborting..."
+        Me.Button1.Image = My.Resources.Play_icon_gray
+        VECTOworker.CancelAsync()
+    End Sub
+
+
+#Region "BackgroundWorker Events"
+
+    'DoWork - Start Calculations
+    Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
+
+        'Prevent SLEEP
+        AllowSleepOFF()
+
+        If SetCulture Then
+            Try
+                System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")
+            Catch ex As Exception
+                GUImsg(tMsgID.Err, "Failed to set thread culture 'en-US'! Check system decimal- and group- separators!")
+            End Try
+        End If
+
+        e.Result = VECTO()
+
+
+    End Sub
+
+    'Progress Report - Progressbar, Messages, etc.
+    Private Sub BackgroundWorker1_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
+        Dim x As cWorkProg
+        x = e.UserState
+
+        Select Case x.Target
+            Case tWorkMsgType.StatusListBox
+                MSGtoForm(e.UserState.ID, e.UserState.Msg, x.Source, x.Link)
+
+            Case tWorkMsgType.StatusBar
+                Status(e.UserState.Msg)
+
+            Case tWorkMsgType.ProgBars
+                Me.ToolStripProgBarOverall.Value = e.ProgressPercentage
+                ProgSecStart()
+
+            Case tWorkMsgType.JobStatus
+                CheckedItems(x.FileIndex).SubItems(1).Text = x.Msg
+                SetCheckedItemColor(x.FileIndex, x.Status)
+
+            Case tWorkMsgType.CycleStatus
+                Try
+                    Me.LvDRI.CheckedItems(x.FileIndex).SubItems(1).Text = x.Msg
+                Catch ex As Exception
+                End Try
+
+            Case tWorkMsgType.InitProgBar
+                Me.ToolStripProgBarOverall.Style = ProgressBarStyle.Continuous
+
+            Case Else ' tWorkMsgType.Abort
+                JobAbort()
+
+        End Select
+    End Sub
+
+    'Work completed
+    Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
+
+        Dim Result As tCalcResult
+
+        'Progbar reset
+        Me.ToolStripProgBarOverall.Visible = False
+        Me.ToolStripProgBarOverall.Style = ProgressBarStyle.Continuous
+        Me.ToolStripProgBarOverall.Value = 0
+        ProgSecStop()
+
+        'So ListView-Item Colors (Warning = Yellow, etc..) are correctly visible
+        Me.LvGEN.SelectedIndices.Clear()
+
+        Result = e.Result
+
+        'ShutDown when Unexpected Error
+        If e.Error IsNot Nothing Then
+            MsgBox("An Unexpected Error occurred!" & ChrW(10) & ChrW(10) & _
+                     e.Error.Message.ToString, MsgBoxStyle.Critical, "Unexpected Error")
+            LogFile.WriteToLog(tMsgID.Err, ">>>Unexpected Error:" & e.Error.ToString())
+            Me.Close()
+        End If
+
+        'Options enable / GUI reset
+        LockGUI(False)
+        Me.Button1.Enabled = True
+        Me.Button1.Text = "START"
+        Me.Button1.Image = My.Resources.Play_icon
+        Status(LastModeName & " Mode")
+
+        'Command Line Shutdown
+        If ComLineShutDown Then Me.Close()
+
+        'Auto Shutdown
+        If Me.ChBoxAutoSD.Checked Then
+            Me.ChBoxAutoSD.Checked = False
+            If Not Result = tCalcResult.Abort Then
+                If F_ShutDown.ShutDown Then
+                    GUImsg(tMsgID.Warn, "Shutting down...")
+                    Me.Close()
+                End If
+            End If
+        End If
+
+        'SLEEP reactivate
+        AllowSleepON()
+
+    End Sub
+
+#End Region
+
+#End Region
+
+#Region "Form Init/Close"
+
+    'Initialise
+    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+        Dim x As Integer
+
+        GUIlocked = False
+        CheckLock = False
+        GENcheckAllLock = False
+        DRIcheckAllLock = False
+        DRIchecked = 0
+        GENchecked = 0
+
+        CheckedItems = New List(Of ListViewItem)
+
+        'Load Tabs properly (otherwise problem with ListViews)
+        For x = 0 To Me.TabControl1.TabCount - 1
+            Me.TabControl1.TabPages(x).Show()
+        Next
+
+        CycleTabPageVisible = True
+        CycleTabPage = Me.TabPageDRI
+
+        DEVpage = Me.TabPageDEV
+        Me.TabControl1.Controls.Remove(DEVpage)
+
+        LastModeName = ""
+
+        ComLineShutDown = False
+
+        'File Browser Initialise  - Comment Added TB 25/9/14
+        FB_Initialize()
+
+        'File Form Title - Including Version - Comment Added TB 25/9/14
+        Me.Text = "VECTO " & VECTOvers
+
+
+        'FileLists_________________________________________________
+
+        JobListView = New cFileListView(MyConfPath & "joblist.txt")
+        JobListView.LVbox = Me.LvGEN
+        CycleListView = New cFileListView(MyConfPath & "cyclelist.txt")
+        CycleListView.LVbox = Me.LvDRI
+
+        JobListView.LoadList()
+
+        'Load GUI Options (here, the GEN/ADV/DRI lists are loaded)
+        LoadOptions()
+
+        'Resize columns ... after Loading the @file-lists
+        Me.LvGEN.Columns(1).Width = -2
+        Me.LvDRI.Columns(1).Width = -2
+        Me.LvMsg.Columns(2).Width = -2
+
+        'Initialize BackgroundWorker
+        VECTOworker = Me.BackgroundWorker1
+        VECTOworker.WorkerReportsProgress = True
+        VECTOworker.WorkerSupportsCancellation = True
+
+        'Set mode (Batch/Standard)
+        ModeUpdate()
+
+        'License check
+        If Not Lic.LICcheck() Then
+            MsgBox("License File invalid!" & vbCrLf & vbCrLf & Lic.FailMsg)
+            If Lic.CreateActFile(MyAppPath & "ActivationCode.dat") Then
+                MsgBox("Activation File created.")
+            Else
+                MsgBox("Failed to create Activation File! Is Directory Read-Only?")
+            End If
+            Me.Close()
+        Else
+            GUImsg(tMsgID.Normal, "License File validated.")
+            If Lic.TimeWarn Then GUImsg(tMsgID.Warn, "License expiring date (y/m/d): " & Lic.ExpTime)
+        End If
+
+        DEV.Enabled = Lic.LicFeature(9)
+
+        If DEV.Enabled Then
+            DEV.LoadFromFile()
+            LoadDEVconfigs()
+        End If
+
+        DeclOnOff()
+
+    End Sub
+
+    'Declaration mode GUI settings
+    Private Sub DeclOnOff()
+
+        If Cfg.DeclMode Then
+            Me.Text = "VECTO " & VECTOvers & " - Declaration Mode"
+            Me.CbBatch.Checked = False
+            Cfg.DeclInit()
+        Else
+            Me.Text = "VECTO " & VECTOvers
+        End If
+
+        If Cfg.DeclMode Then
+            LastModeName = "Declaration"
+        Else
+            If Cfg.BatchMode Then
+                LastModeName = "Batch"
+            Else
+                LastModeName = "Engineering"
+            End If
+        End If
+
+        Status(LastModeName & " Mode")
+
+        Me.LoadOptions()
+
+        Me.LbDecl.Visible = Cfg.DeclMode
+
+        Me.PnDeclOpt.Enabled = Not Cfg.DeclMode
+
+    End Sub
+
+    'Shown Event (Form-Load finished) ... here StartUp Forms are loaded (DEV, GEN/ADV- Editor ..)
+    Private Sub F01_MAINForm_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
+        Dim fwelcome As F_Welcome
+
+        'DEV Form
+        If DEV.Enabled Then
+            Me.TabControl1.TabPages.Insert(Me.TabControl1.TabPages.Count, DEVpage)
+        End If
+
+        'VECTO Init
+        Declaration.Init()
+
+        'Command Line Args
+        If Command() <> "" Then
+            CmdLineCtrl(My.Application.CommandLineArgs)
+        Else
+            If Cfg.FirstRun Then
+                Cfg.FirstRun = False
+                fwelcome = New F_Welcome
+                fwelcome.ShowDialog()
+            End If
+        End If
+
+    End Sub
+
+    'Open file
+    Private Sub CmdLineCtrl(ByVal ComLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String))
+        Dim bBATCH As Boolean
+        Dim bRUN As Boolean
+        Dim x As Object
+        Dim str As String
+        Dim ComFile As String = ""
+        Dim vecFiles As New List(Of String)
+        Dim driFiles As New List(Of String)
+
+        bBATCH = False
+        bRUN = False
+        ComFile = sKey.NoFile
+
+        'Read Command-Line Args
+        For Each x In ComLineArgs
+            str = Trim(Replace(x.ToString, ChrW(34), ""))
+            Select Case UCase(str)
+                Case "-BATCH"
+                    bBATCH = True
+                Case "-CLOSE"
+                    ComLineShutDown = True
+                Case "-RUN"
+                    bRUN = True
+                Case Else
+                    Select Case UCase(fEXT(str))
+                        Case ".VECTO"
+                            vecFiles.Add(fFileRepl(str))
+                        Case ".VDRI"
+                            driFiles.Add(fFileRepl(str))
+                        Case Else
+                            ComFile = fFileRepl(str)
+                    End Select
+            End Select
+        Next
+
+        'Mode switch and load Driving Cycles
+        If bBATCH Then
+            Me.CbBatch.Checked = True
+
+            If driFiles.Count > 0 Then
+                LvDRI.Items.Clear()
+                AddToCycleListView(driFiles.ToArray)
+            End If
+
+        Else
+            Me.CbBatch.Checked = False
+        End If
+
+        'Load Vecto files or open editor (if only one file)
+        If vecFiles.Count > 0 Then
+            If vecFiles.Count > 1 Or bRUN Then
+                LvGEN.Items.Clear()
+                AddToJobListView(vecFiles.ToArray)
+            Else
+                ComFile = vecFiles(0)
+            End If
+        End If
+
+        'Run or open file editor if file is specified
+        If bRUN Then
+            VECTO_Launcher()
+        Else
+            If ComFile <> sKey.NoFile Then OpenVectoFile(ComFile)
+        End If
+
+    End Sub
+
+    'Close
+    Private Sub F01_MAINForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
+
+        'Save File-Lists
+        SaveFileLists()
+
+        'Close log
+        LogFile.CloseLog()
+
+        'Config save
+        SetOptions()
+        Cfg.ConfigSAVE()
+        If DEV.Enabled Then DEV.SaveToFile()
+
+        'File browser instances close
+        FB_Close()
+
+    End Sub
+
+#End Region
+
+    'Open file - Job, vehicle, engine, gearbox or signature file
+    Public Sub OpenVectoFile(ByVal File As String)
+
+        If Not IO.File.Exists(File) Then
+
+            GUImsg(tMsgID.Err, "File not found! (" & File & ")")
+            MsgBox("File not found! (" & File & ")", MsgBoxStyle.Critical)
+
+        Else
+
+            Select Case UCase(fEXT(File))
+                Case ".VGBX"
+                    If Not F_GBX.Visible Then
+                        F_GBX.Show()
+                    Else
+                        F_GBX.JobDir = ""
+                        If F_GBX.WindowState = FormWindowState.Minimized Then F_GBX.WindowState = FormWindowState.Normal
+                        F_GBX.BringToFront()
+                    End If
+                    F_GBX.openGBX(File)
+                Case ".VVEH"
+                    If Not F_VEH.Visible Then
+                        F_VEH.Show()
+                    Else
+                        F_VEH.JobDir = ""
+                        If F_VEH.WindowState = FormWindowState.Minimized Then F_VEH.WindowState = FormWindowState.Normal
+                        F_VEH.BringToFront()
+                    End If
+                    F_VEH.openVEH(File)
+                Case ".VENG"
+                    If Not F_ENG.Visible Then
+                        F_ENG.Show()
+                    Else
+                        F_ENG.JobDir = ""
+                        If F_ENG.WindowState = FormWindowState.Minimized Then F_ENG.WindowState = FormWindowState.Normal
+                        F_ENG.BringToFront()
+                    End If
+                    F_ENG.openENG(File)
+                Case ".VECTO"
+                    OpenVECTOeditor(File)
+                Case ".VSIG"
+                    OpenSigFile(File)
+                Case Else
+                    MsgBox("Type '" & fEXT(File) & "' unknown!", MsgBoxStyle.Critical)
+            End Select
+
+        End If
+
+    End Sub
+
+#Region "Job file list"
+
+#Region "Events"
+
+    Private Sub ButtonGENremove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGENremove.Click
+        RemoveJobFile()
+    End Sub
+
+    Private Sub ButtonGENadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGENadd.Click
+        AddJobFile()
+    End Sub
+
+    Private Sub ButtonGENoptions_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGENopt.Click
+        ConMenTarget = Me.LvGEN
+        ConMenTarJob = True
+
+        'Locked functions show/hide
+        Me.LoadListToolStripMenuItem.Enabled = Not GUIlocked
+        Me.LoadDefaultListToolStripMenuItem.Enabled = Not GUIlocked
+        Me.ClearListToolStripMenuItem.Enabled = Not GUIlocked
+
+        Me.ConMenFilelist.Show(Control.MousePosition)
+    End Sub
+
+    Private Sub ListViewGEN_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles LvGEN.KeyDown
+        Select Case e.KeyCode
+            Case Keys.Delete, Keys.Back
+                If Not GUIlocked Then RemoveJobFile()
+            Case Keys.Enter
+                OpenJobFile()
+        End Select
+    End Sub
+
+    'Invoke Vecto Form on Double click - Edits Job : Comment Added TB 25/9/14
+    Private Sub ListViewGEN_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LvGEN.DoubleClick
+        If Me.LvGEN.SelectedItems.Count > 0 Then
+            Me.LvGEN.SelectedItems(0).Checked = Not Me.LvGEN.SelectedItems(0).Checked
+            OpenJobFile()
+        End If
+    End Sub
+
+    Private Sub LvGEN_ItemChecked(sender As Object, e As System.Windows.Forms.ItemCheckedEventArgs) Handles LvGEN.ItemChecked
+
+        If e.Item.Checked Then
+            GENchecked += 1
+        Else
+            GENchecked -= 1
+        End If
+
+        If CheckLock Then Exit Sub
+        UpdateJobTabText()
+
+    End Sub
+
+    Private Sub ChBoxAllGEN_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChBoxAllGEN.CheckedChanged
+
+        If GENcheckAllLock And Me.ChBoxAllGEN.CheckState = CheckState.Indeterminate Then Exit Sub
+
+        CheckAllGEN(Me.ChBoxAllGEN.Checked)
+    End Sub
+    Private Sub CheckAllGEN(ByVal Check As Boolean)
+        Dim x As ListViewItem
+
+        CheckLock = True
+        Me.LvGEN.BeginUpdate()
+
+        For Each x In Me.LvGEN.Items
+            x.Checked = Check
+        Next
+
+        Me.LvGEN.EndUpdate()
+        CheckLock = False
+
+        GENchecked = Me.LvGEN.CheckedItems.Count
+        UpdateJobTabText()
+    End Sub
+
+    Private Sub ListGEN_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LvGEN.DragEnter
+        If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
+            e.Effect = DragDropEffects.Copy
+        End If
+    End Sub
+    Private Sub ListGEN_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LvGEN.DragDrop
+        Dim f As String()
+        f = CType(e.Data.GetData(DataFormats.FileDrop), Array)
+        AddToJobListView(f)
+    End Sub
+
+    Private Sub BtGENup_Click(sender As System.Object, e As System.EventArgs) Handles BtGENup.Click
+        MoveItem(LvGEN, True)
+    End Sub
+
+    Private Sub BtGENdown_Click(sender As System.Object, e As System.EventArgs) Handles BtGENdown.Click
+        MoveItem(LvGEN, False)
+    End Sub
+
+#End Region
+
+    'Remove selected file(s) from job list
+    Private Sub RemoveJobFile()
+        Dim lastindx As Integer
+        Dim SelIx() As Integer
+        Dim i As Integer
+
+        If Me.LvGEN.SelectedItems.Count < 1 Then
+            If Me.LvGEN.Items.Count = 1 Then
+                Me.LvGEN.Items(0).Selected = True
+            Else
+                Exit Sub
+            End If
+        End If
+
+        LvGEN.BeginUpdate()
+        CheckLock = True
+
+        ReDim SelIx(LvGEN.SelectedItems.Count - 1)
+        LvGEN.SelectedIndices.CopyTo(SelIx, 0)
+
+        lastindx = LvGEN.SelectedIndices(LvGEN.SelectedItems.Count - 1)
+
+        For i = UBound(SelIx) To 0 Step -1
+            LvGEN.Items.RemoveAt(SelIx(i))
+        Next
+
+        If lastindx < LvGEN.Items.Count Then
+            LvGEN.Items(lastindx).Selected = True
+        Else
+            If LvGEN.Items.Count > 0 Then LvGEN.Items(LvGEN.Items.Count - 1).Selected = True
+        End If
+
+        LvGEN.EndUpdate()
+        CheckLock = False
+
+        GENchecked = LvGEN.CheckedItems.Count
+        UpdateJobTabText()
+    End Sub
+
+    'Browse for job file(s) and add to job list with AddToJobListView
+    Private Sub AddJobFile()
+        Dim x As String()
+        Dim Chck As Boolean = False
+
+        x = New String() {""}
+
+        'STANDARD/BATCH
+        If fbVECTO.OpenDialog("", True, "vecto") Then
+            Chck = True
+            x = fbVECTO.Files
+        End If
+
+        If Chck Then AddToJobListView(x)
+
+    End Sub
+
+    'Open file in list
+    Private Sub OpenJobFile()
+        Dim f As String
+
+        If Me.LvGEN.SelectedItems.Count < 1 Then
+            If Me.LvGEN.Items.Count = 1 Then
+                Me.LvGEN.Items(0).Selected = True
+            Else
+                Exit Sub
+            End If
+        End If
+
+        f = Me.LvGEN.SelectedItems(0).SubItems(0).Text
+        f = fFileRepl(f)
+        If Not IO.File.Exists(f) Then
+            MsgBox(f & " not found!")
+        Else
+            OpenVECTOeditor(f)
+        End If
+    End Sub
+
+    'Add File to job listview (multiple files)
+    Private Sub AddToJobListView(ByVal Path As String(), Optional ByVal Txt As String = " ")
+        Dim pDim As Int16
+        Dim p As Int16
+        Dim f As Int16
+        Dim fList As String()
+        Dim fListDim As Int16 = -1
+        Dim ListViewItem0 As ListViewItem
+
+        'If VECTO runs: Cancel operation (because Mode-change during calculation is not very clever)
+        If VECTOworker.IsBusy Then Exit Sub
+
+        pDim = UBound(Path)
+        ReDim fList(0)     'um Nullverweisausnahme-Warnung zu verhindern
+
+        '******************************************* Begin Update '*******************************************
+        Me.LvGEN.BeginUpdate()
+        CheckLock = True
+
+        Me.LvGEN.SelectedIndices.Clear()
+
+        If pDim = 0 Then
+            fListDim = Me.LvGEN.Items.Count - 1
+            ReDim fList(fListDim)
+            For f = 0 To fListDim
+                fList(f) = fFileRepl(Me.LvGEN.Items(f).SubItems(0).Text)
+            Next
+        End If
+
+        For p = 0 To pDim
+
+            If pDim = 0 Then
+
+                For f = 0 To fListDim
+
+                    'If file already exists in the list: Do not append (only when a single file)
+                    If UCase(Path(p)) = UCase(fList(f)) Then
+
+                        'Status reset
+                        Me.LvGEN.Items(f).SubItems(1).Text = Txt
+                        Me.LvGEN.Items(f).BackColor = Color.FromKnownColor(KnownColor.Window)
+                        Me.LvGEN.Items(f).ForeColor = Color.FromKnownColor(KnownColor.WindowText)
+
+                        'Element auswählen und anhaken |@@| Element selection and hook
+                        Me.LvGEN.Items(f).Selected = True
+                        Me.LvGEN.Items(f).Checked = True
+                        Me.LvGEN.Items(f).EnsureVisible()
+
+                        GoTo lbFound
+                    End If
+                Next
+
+            End If
+
+            'Otherwise: Add File (without WorkDir)
+            ListViewItem0 = New ListViewItem(Path(p))   'fFileWD(Path(p)))
+            ListViewItem0.SubItems.Add(" ")
+            ListViewItem0.Checked = True
+            ListViewItem0.Selected = True
+            Me.LvGEN.Items.Add(ListViewItem0)
+            ListViewItem0.EnsureVisible()
+lbFound:
+        Next
+
+        Me.LvGEN.EndUpdate()
+        CheckLock = False
+        '******************************************* End Update '*******************************************
+
+        'Number update
+        GENchecked = Me.LvGEN.CheckedItems.Count
+        UpdateJobTabText()
+
+
+    End Sub
+
+    'Add File to job listview (single file)
+    Public Sub AddToJobListView(ByVal Path As String, Optional ByVal Txt As String = " ")
+        Dim p(0) As String
+        p(0) = Path
+        AddToJobListView(p, Txt)
+    End Sub
+
+    'Update job files counter in tab titel
+    Private Sub UpdateJobTabText()
+        Dim c As Integer
+        c = Me.LvGEN.Items.Count
+
+        Me.TabPageGEN.Text = "Job Files ( " & GENchecked & " / " & c & " )"
+        'Me.TabPageGEN.Text = "Job Files (" & c & ")"
+
+        GENcheckAllLock = True
+
+        If GENchecked = 0 Then
+            Me.ChBoxAllGEN.CheckState = CheckState.Unchecked
+        ElseIf GENchecked = c Then
+            Me.ChBoxAllGEN.CheckState = CheckState.Checked
+        Else
+            Me.ChBoxAllGEN.CheckState = CheckState.Indeterminate
+        End If
+
+        GENcheckAllLock = False
+
+    End Sub
+
+#End Region
+
+#Region "Cycle list (BATCH)"
+
+
+#Region "Events"
+
+    Private Sub ButtonDRIadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDRIadd.Click
+        AddCycle()
+    End Sub
+
+    Private Sub ButtonDRIremove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDRIremove.Click
+        RemoveCycle()
+    End Sub
+
+    Private Sub ButtonDRIoptions_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDRIedit.Click
+        ConMenTarget = Me.LvDRI
+        ConMenTarJob = False
+        Me.ConMenFilelist.Show(Control.MousePosition)
+    End Sub
+
+    Private Sub LvDRI_ItemChecked(sender As Object, e As System.Windows.Forms.ItemCheckedEventArgs) Handles LvDRI.ItemChecked
+
+        If e.Item.Checked Then
+            DRIchecked += 1
+        Else
+            DRIchecked -= 1
+        End If
+
+        If CheckLock Then Exit Sub
+        UpdateCycleTabText()
+
+    End Sub
+
+    Private Sub ChBoxAllDRI_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChBoxAllDRI.CheckedChanged
+        Dim Check As Boolean
+        Dim x As ListViewItem
+
+        If DRIcheckAllLock Or Me.ChBoxAllDRI.CheckState = CheckState.Indeterminate Then Exit Sub
+
+        Check = Me.ChBoxAllDRI.Checked
+
+        CheckLock = True
+        Me.LvDRI.BeginUpdate()
+
+        For Each x In Me.LvDRI.Items
+            x.Checked = Check
+        Next
+
+        Me.LvDRI.EndUpdate()
+        CheckLock = False
+
+        DRIchecked = Me.LvDRI.CheckedItems.Count
+        UpdateCycleTabText()
+
+    End Sub
+
+    Private Sub ListViewDRI_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LvDRI.DoubleClick
+        If Me.LvDRI.SelectedItems.Count > 0 Then
+            Me.LvDRI.SelectedItems(0).Checked = Not Me.LvDRI.SelectedItems(0).Checked
+            OpenCycle()
+        Else
+            AddCycle()
+        End If
+    End Sub
+
+    Private Sub ListViewDRI_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles LvDRI.KeyDown
+        Select Case e.KeyCode
+            Case Keys.Delete, Keys.Back
+                If Not GUIlocked Then RemoveCycle()
+            Case Keys.Enter
+                OpenCycle()
+        End Select
+    End Sub
+
+    'Drag n' Drop
+    Private Sub ListDRI_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LvDRI.DragEnter
+        If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then e.Effect = DragDropEffects.Copy
+    End Sub
+    Private Sub ListDRI_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LvDRI.DragDrop
+        Dim f As String()
+        f = CType(e.Data.GetData(DataFormats.FileDrop), Array)
+        AddToCycleListView(f)
+        If LvDRI.Items.Count > 0 Then LvDRI.Items(LvDRI.Items.Count - 1).Selected = True
+    End Sub
+
+    Private Sub BtDRIup_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIup.Click
+        MoveItem(LvDRI, True)
+    End Sub
+
+    Private Sub BtDRIdown_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIdown.Click
+        MoveItem(LvDRI, False)
+    End Sub
+
+#End Region
+
+    'Remove selected file(s) from cycle list
+    Private Sub RemoveCycle()
+        Dim lastindx As Integer
+        Dim SelIx() As Integer
+        Dim i As Integer
+
+        If Me.LvDRI.SelectedItems.Count < 1 Then
+            If Me.LvDRI.Items.Count = 1 Then
+                Me.LvDRI.Items(0).Selected = True
+            Else
+                Exit Sub
+            End If
+        End If
+
+        CheckLock = True
+        LvDRI.BeginUpdate()
+
+        ReDim SelIx(LvDRI.SelectedItems.Count - 1)
+        LvDRI.SelectedIndices.CopyTo(SelIx, 0)
+
+        lastindx = LvDRI.SelectedIndices(LvDRI.SelectedItems.Count - 1)
+
+        For i = UBound(SelIx) To 0 Step -1
+            LvDRI.Items.RemoveAt(SelIx(i))
+        Next
+
+        If lastindx < LvDRI.Items.Count Then
+            LvDRI.Items(lastindx).Selected = True
+        Else
+            If LvDRI.Items.Count > 0 Then LvDRI.Items(LvDRI.Items.Count - 1).Selected = True
+        End If
+
+        CheckLock = False
+        LvDRI.EndUpdate()
+
+        DRIchecked = LvDRI.CheckedItems.Count
+        UpdateCycleTabText()
+    End Sub
+
+    'Browse for cycle file(s) and add to cycle list with AddToCycleListView
+    Private Sub AddCycle()
+        If fbDRI.OpenDialog("", True) Then
+            AddToCycleListView(fbDRI.Files)
+            If LvDRI.Items.Count > 0 Then LvDRI.Items(LvDRI.Items.Count - 1).Selected = True
+        End If
+    End Sub
+
+    'Open cycle in list
+    Private Sub OpenCycle()
+
+        If Me.LvDRI.SelectedItems.Count < 1 Then
+            If Me.LvDRI.Items.Count = 1 Then
+                Me.LvDRI.Items(0).Selected = True
+            Else
+                Exit Sub
+            End If
+        End If
+
+        OpenFiles(fFileRepl(Me.LvDRI.SelectedItems(0).SubItems(0).Text))
+    End Sub
+
+    'Add File to cycle listview (multiple files)
+    Private Sub AddToCycleListView(ByVal Path As String())
+        Dim pDim As Int16
+        Dim p As Int16
+        Dim ListViewItem0 As ListViewItem
+
+        pDim = UBound(Path)
+
+        Me.LvDRI.BeginUpdate()
+        CheckLock = True
+
+        'Mode switch if necessary
+        If Not Me.CbBatch.Checked Then Me.CbBatch.Checked = True
+
+        For p = 0 To pDim
+            ListViewItem0 = New ListViewItem(Path(p))   'fFileWD(Path(p)))
+            ListViewItem0.SubItems.Add(" ")
+            ListViewItem0.Checked = True
+            Me.LvDRI.Items.Add(ListViewItem0)
+lbFound:
+        Next
+
+        Me.LvDRI.EndUpdate()
+        CheckLock = False
+
+        'Number update
+        DRIchecked = Me.LvDRI.CheckedItems.Count
+        UpdateCycleTabText()
+
+    End Sub
+
+    'Add File to cycle listview (single file)
+    Private Sub AddToCycleListView(ByVal Path As String)
+        Dim p(0) As String
+        p(0) = Path
+        AddToCycleListView(p)
+    End Sub
+
+    'Update cycle files counter in tab titel
+    Private Sub UpdateCycleTabText()
+        Dim c As Integer
+        c = Me.LvDRI.Items.Count
+
+        Me.TabPageDRI.Text = "Driving Cycles ( " & DRIchecked & " / " & c & " )"
+        'Me.TabPageDRI.Text = "Driving Cycles (" & c & ")"
+
+        DRIcheckAllLock = True
+
+        If DRIchecked = 0 Then
+            Me.ChBoxAllDRI.CheckState = CheckState.Unchecked
+        ElseIf DRIchecked = c Then
+            Me.ChBoxAllDRI.CheckState = CheckState.Checked
+        Else
+            Me.ChBoxAllDRI.CheckState = CheckState.Indeterminate
+        End If
+
+        DRIcheckAllLock = False
+
+    End Sub
+
+#End Region
+
+#Region "Toolstrip"
+
+    'New Job file
+    Private Sub ToolStripBtNew_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtNew.Click
+        OpenVECTOeditor("<New>")
+    End Sub
+
+    'Open input file
+    Private Sub ToolStripBtOpen_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtOpen.Click
+
+        If fbVECTO.OpenDialog("", False, "vecto,vveh,vgbx,veng,vsig") Then
+            OpenVectoFile(fbVECTO.Files(0))
+        End If
+
+    End Sub
+
+    Private Sub GENEditorToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles GENEditorToolStripMenuItem1.Click
+        OpenVECTOeditor("<New>")
+    End Sub
+
+    Private Sub VEHEditorToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles VEHEditorToolStripMenuItem.Click
+        If Not F_VEH.Visible Then
+            F_VEH.Show()
+        Else
+            If F_VEH.WindowState = FormWindowState.Minimized Then F_VEH.WindowState = FormWindowState.Normal
+            F_VEH.BringToFront()
+        End If
+    End Sub
+
+    Private Sub EngineEditorToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles EngineEditorToolStripMenuItem.Click
+        If Not F_ENG.Visible Then
+            F_ENG.Show()
+        Else
+            If F_ENG.WindowState = FormWindowState.Minimized Then F_ENG.WindowState = FormWindowState.Normal
+            F_ENG.BringToFront()
+        End If
+    End Sub
+
+    Private Sub GearboxEditorToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GearboxEditorToolStripMenuItem.Click
+        If Not F_GBX.Visible Then
+            F_GBX.Show()
+        Else
+            If F_GBX.WindowState = FormWindowState.Minimized Then F_GBX.WindowState = FormWindowState.Normal
+            F_GBX.BringToFront()
+        End If
+    End Sub
+
+    Private Sub GraphToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GraphToolStripMenuItem.Click
+        Dim FGraph As New F_Graph
+        FGraph.Show()
+    End Sub
+
+    Private Sub SignOrVerifyFilesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SignOrVerifyFilesToolStripMenuItem.Click
+        If Not F_FileSign.Visible Then
+            F_FileSign.Show()
+        Else
+            If F_FileSign.WindowState = FormWindowState.Minimized Then F_FileSign.WindowState = FormWindowState.Normal
+            F_FileSign.BringToFront()
+        End If
+    End Sub
+
+    Private Sub OpenLogToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenLogToolStripMenuItem.Click
+        System.Diagnostics.Process.Start(MyAppPath & "log.txt")
+    End Sub
+
+    Private Sub SettingsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SettingsToolStripMenuItem.Click
+        F_Settings.ShowDialog()
+    End Sub
+
+    Private Sub UserManualToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles UserManualToolStripMenuItem.Click
+        If IO.File.Exists(MyAppPath & "User Manual\usermanual.html") Then
+            System.Diagnostics.Process.Start(MyAppPath & "User Manual\usermanual.html")
+        Else
+            MsgBox("User Manual not found!", MsgBoxStyle.Critical)
+        End If
+    End Sub
+
+    Private Sub UpdateNotesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles UpdateNotesToolStripMenuItem.Click
+        If IO.File.Exists(MyAppPath & "User Manual\Release Notes.pdf") Then
+            System.Diagnostics.Process.Start(MyAppPath & "User Manual\Release Notes.pdf")
+        Else
+            MsgBox("Release Notes not found!", MsgBoxStyle.Critical)
+        End If
+    End Sub
+
+    Private Sub CreateActivationFileToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CreateActivationFileToolStripMenuItem.Click
+        If MsgBox("Create Activation File ?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
+            If Lic.CreateActFile(MyAppPath & "ActivationCode.dat") Then
+                GUImsg(tMsgID.Normal, "Activation File created.")
+            Else
+                GUImsg(tMsgID.Err, "Failed to create Activation File!")
+                MsgBox("ERROR! Failed to create Activation File!", MsgBoxStyle.Critical)
+            End If
+        End If
+    End Sub
+
+    Private Sub AboutVECTOToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles AboutVECTOToolStripMenuItem1.Click
+        F_AboutBox.ShowDialog()
+    End Sub
+
+
+
+
+#End Region
+
+    'Move job/cycle file up or down in list view
+    Private Sub MoveItem(ByRef ListV As ListView, ByVal MoveUp As Boolean)
+        Dim x As Int32
+        Dim y As Int32
+        Dim y1 As Int32
+        Dim items() As String
+        Dim check() As Boolean
+        Dim index() As Integer
+        Dim ListViewItem0 As ListViewItem
+
+        If GUIlocked Then Exit Sub
+
+        'Cache Selected Items
+        y1 = ListV.SelectedItems.Count - 1
+        ReDim items(y1)
+        ReDim check(y1)
+        ReDim index(y1)
+        y = 0
+        For Each x In ListV.SelectedIndices
+            items(y) = ListV.Items(x).SubItems(0).Text
+            check(y) = ListV.Items(x).Checked
+            If MoveUp Then
+                If x = 0 Then Exit Sub
+                index(y) = x - 1
+            Else
+                If x = ListV.Items.Count - 1 Then Exit Sub
+                index(y) = x + 1
+            End If
+            y += 1
+        Next
+
+        ListV.BeginUpdate()
+
+        'Delete Selected Items
+        For Each ListViewItem0 In ListV.SelectedItems
+            ListViewItem0.Remove()
+        Next
+
+        'Items select and Insert
+        'For y = y1 To 0 Step -1
+        For y = 0 To y1
+            If Not check(y) Then GENchecked += 1
+            ListViewItem0 = ListV.Items.Insert(index(y), items(y))
+            ListViewItem0.SubItems.Add(" ")
+            ListViewItem0.Checked = check(y)
+            ListV.SelectedIndices.Add(index(y))
+        Next
+
+        ListV.EndUpdate()
+
+    End Sub
+
+
+#Region "job/cycle file List - Context Menu"
+
+    'Save List
+    Private Sub SaveListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveListToolStripMenuItem.Click
+        If fbFileLists.SaveDialog("") Then
+            If ConMenTarJob Then
+                JobListView.SaveList(fbFileLists.Files(0))
+            Else
+                CycleListView.SaveList(fbFileLists.Files(0))
+            End If
+        End If
+    End Sub
+
+    'Load List
+    Private Sub LoadListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadListToolStripMenuItem.Click
+
+        If GUIlocked Then Exit Sub
+
+        If fbFileLists.OpenDialog("") Then
+
+            If ConMenTarJob Then    'GEN
+                JobListView.LoadList(fbFileLists.Files(0))
+                GENchecked = Me.LvGEN.CheckedItems.Count
+                UpdateJobTabText()
+            Else                    'DRI
+                'Mode toggle 
+                If Not Me.CbBatch.Checked Then Me.CbBatch.Checked = True
+                CycleListView.LoadList(fbFileLists.Files(0))
+                DRIchecked = Me.LvDRI.CheckedItems.Count
+                UpdateCycleTabText()
+            End If
+
+        End If
+
+    End Sub
+
+    'Load Default List
+    Private Sub LoadDefaultListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadDefaultListToolStripMenuItem.Click
+
+        If GUIlocked Then Exit Sub
+
+        If ConMenTarJob Then
+
+            JobListView.LoadList()
+
+            GENchecked = Me.LvGEN.CheckedItems.Count
+            UpdateJobTabText()
+        Else
+            CycleListView.LoadList()
+            DRIchecked = Me.LvDRI.CheckedItems.Count
+            UpdateCycleTabText()
+        End If
+    End Sub
+
+    'Clear List
+    Private Sub ClearListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearListToolStripMenuItem.Click
+        'Dim ListViewItem0 As ListViewItem
+        'For Each ListViewItem0 In ConMenTarget.SelectedItems
+        '    ListViewItem0.Remove()
+        'Next
+        If GUIlocked Then Exit Sub
+
+        ConMenTarget.Items.Clear()
+        If ConMenTarJob Then
+            GENchecked = Me.LvGEN.CheckedItems.Count
+            UpdateJobTabText()
+        Else
+            DRIchecked = Me.LvDRI.CheckedItems.Count
+            UpdateCycleTabText()
+        End If
+    End Sub
+
+#End Region
+
+    'VECTO Start button - Calls VECTO_Launcher or aborts calculation
+    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
+
+        'VECTO Start/Stop
+        If VECTOworker.IsBusy Then
+
+            'If VECTO already running: STOP
+            ComLineShutDown = False
+            JobAbort()
+
+        Else
+
+            '...Otherwise: START
+
+            'Save Lists if Crash
+            SaveFileLists()
+
+            'Start
+            VECTO_Launcher()
+
+        End If
+
+    End Sub
+
+    'Mode Change (STANDARD/BATCH)
+    Private Sub CbBatch_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CbBatch.CheckedChanged
+        ModeUpdate()
+    End Sub
+
+    Private Sub ModeUpdate()
+
+        'Save lists
+        JobListView.SaveList()
+        If Cfg.BatchMode Then CycleListView.SaveList()
+
+        'New mode
+        Cfg.BatchMode = Me.CbBatch.Checked
+
+        'GUI changes according to current mode
+
+        If Cfg.BatchMode Then
+
+            LastModeName = "Batch"
+
+            'Load cycle list
+            CycleListView.LoadList()
+
+            'Update cycle counter
+            DRIchecked = Me.LvDRI.CheckedItems.Count
+            UpdateCycleTabText()
+
+            'Show mode-specific settings
+            Me.GrBoxSTD.Visible = False
+            Me.GrBoxBATCH.Visible = True
+
+            'Show Cycle Tab Page
+            If Not CycleTabPageVisible Then
+                Me.TabControl1.TabPages.Insert(1, CycleTabPage)
+                CycleTabPageVisible = True
+            End If
+
+        Else
+
+            If Cfg.DeclMode Then
+                LastModeName = "Declaration"
+            Else
+                LastModeName = "Engineering"
+            End If
+
+            'Show mode-specific settings
+            Me.GrBoxSTD.Visible = False  'Currently no specific settings for STANDARD mode, therefore always 'False'
+            Me.GrBoxBATCH.Visible = False
+
+            'Hide Cycle Tab Page
+            If CycleTabPageVisible Then
+                Me.TabControl1.Controls.Remove(CycleTabPage)
+                CycleTabPageVisible = False
+            End If
+
+        End If
+
+        'Update job counter
+        GENchecked = Me.LvGEN.CheckedItems.Count
+        UpdateJobTabText()
+
+        'Status label
+        Status(LastModeName & " Mode")
+
+    End Sub
+
+    'Class for ListView control - Job and cycle lists
+    Private Class cFileListView
+
+        Private FilePath As String
+        Private LoadedDefault As Boolean
+        Public LVbox As ListView
+
+        Public Sub New(ByVal Path As String)
+            FilePath = Path
+            LoadedDefault = False
+        End Sub
+
+        Public Sub SaveList(Optional ByVal Path As String = "")
+            Dim x As Int32
+            Dim file As cFile_V3
+            'If LVbox.Items.Count = 0 Then Exit Sub
+            file = New cFile_V3
+            If Path = "" Then
+                If Not LoadedDefault Then Exit Sub
+                Path = FilePath
+            End If
+            file.OpenWrite(Path, "?")
+            For x = 1 To LVbox.Items.Count
+                file.WriteLine(LVbox.Items(x - 1).SubItems(0).Text, Math.Abs(CInt(LVbox.Items(x - 1).Checked)))
+            Next
+            file.Close()
+            file = Nothing
+        End Sub
+
+        Public Sub LoadList(Optional ByVal Path As String = "")
+            Dim line As String()
+            Dim NoCheck As Boolean
+            Dim file As cFile_V3
+            Dim ListViewItem0 As ListViewItem
+
+            If Path = "" Then
+                Path = FilePath
+                LoadedDefault = True
+            End If
+
+            file = New cFile_V3
+
+            If Not file.OpenRead(Path, "?") Then
+                If Not LoadedDefault Then GUImsg(tMsgID.Err, "Cannot open file (" & Path & ")!")
+                Exit Sub
+            End If
+
+            F_MAINForm.CheckLock = True
+            LVbox.BeginUpdate()
+
+            LVbox.Items.Clear()
+
+            NoCheck = False
+            Do While Not file.EndOfFile
+                line = file.ReadLine
+
+                ListViewItem0 = New ListViewItem(line(0))
+                ListViewItem0.SubItems.Add(" ")
+
+                If NoCheck Then
+                    ListViewItem0.Checked = True
+                Else
+                    If UBound(line) < 1 Then
+                        NoCheck = True
+                        ListViewItem0.Checked = True
+                    Else
+                        If IsNumeric(line(1)) Then
+                            ListViewItem0.Checked = CBool(line(1))
+                        Else
+                            ListViewItem0.Checked = True
+                        End If
+                    End If
+                End If
+                LVbox.Items.Add(ListViewItem0)
+            Loop
+
+            file.Close()
+
+            LVbox.EndUpdate()
+            F_MAINForm.CheckLock = False
+
+            If LVbox.Items.Count > 0 Then LVbox.Items(LVbox.Items.Count - 1).EnsureVisible()
+
+        End Sub
+
+    End Class
+
+    'Set color of job files in list (Error, Warnings, Currently running, etc.)
+    Private Sub SetCheckedItemColor(ByVal LvID As Integer, ByVal Status As tJobStatus)
+        Dim lv0 As ListViewItem
+
+        lv0 = CheckedItems(LvID)
+
+        Select Case Status
+            Case tJobStatus.Err
+                lv0.BackColor = Color.Red
+                lv0.ForeColor = Color.White
+            Case tJobStatus.OK
+                lv0.BackColor = Color.White
+                lv0.ForeColor = Color.DarkGreen
+            Case tJobStatus.Warn
+                lv0.BackColor = Color.Khaki
+                lv0.ForeColor = Color.DarkBlue      'FromArgb(218, 125, 0) 'DarkOrange 'OrangeRed
+            Case tJobStatus.Queued
+                lv0.BackColor = Color.LightGray
+                lv0.ForeColor = Color.DarkBlue
+            Case tJobStatus.Running
+                lv0.BackColor = Color.DarkBlue
+                lv0.ForeColor = Color.White
+            Case tJobStatus.Undef
+                lv0.BackColor = Color.FromKnownColor(KnownColor.Window)
+                lv0.ForeColor = Color.FromKnownColor(KnownColor.WindowText)
+        End Select
+
+    End Sub
+
+    'Open Job Editor and open file (or new file)
+    Friend Sub OpenVECTOeditor(ByVal x As String)
+
+        If Not F_VECTO.Visible Then
+            F_VECTO.Show()
+        Else
+            If F_VECTO.WindowState = FormWindowState.Minimized Then F_VECTO.WindowState = FormWindowState.Normal
+            F_VECTO.BringToFront()
+        End If
+
+        If x = "<New>" Then
+            F_VECTO.VECTOnew()
+        Else
+            F_VECTO.VECTOload2Form(x)
+        End If
+
+        F_VECTO.Activate()
+
+    End Sub
+
+    'Open signature file (.vsig)
+    Friend Sub OpenSigFile(ByVal file As String)
+        If Not F_FileSign.Visible Then
+            F_FileSign.Show()
+
+        End If
+        F_FileSign.WindowState = FormWindowState.Normal
+        F_FileSign.TbSigFile.Text = file
+        F_FileSign.VerifySigFile()
+        F_FileSign.Activate()
+    End Sub
+
+    'Save job and cycle file lists
+    Private Sub SaveFileLists()
+        JobListView.SaveList()
+        If Cfg.BatchMode Then CycleListView.SaveList()
+    End Sub
+
+
+#Region "Progressbar controls"
+
+    'Initialise progress bar (Start of next job in calculation)
+    Private Sub ProgSecStart()
+        Me.ToolStripProgBarJob.Value = 0
+        Me.ToolStripProgBarJob.Style = ProgressBarStyle.Marquee
+        Me.ToolStripProgBarJob.Visible = True
+        Me.TmProgSec.Start()
+    End Sub
+
+    'Stop - Hide progress bar
+    Private Sub ProgSecStop()
+        Me.TmProgSec.Stop()
+        Me.ToolStripProgBarJob.Visible = False
+        Me.ToolStripProgBarJob.Value = 0
+    End Sub
+
+    'Timer to update progress bar regularly
+    Private Sub TmProgSec_Tick(sender As Object, e As System.EventArgs) Handles TmProgSec.Tick
+        If GUItest0.TestActive Then
+            Call GUItest0.TestTick()
+            Exit Sub
+        Else
+            If Not ProgBarCtrl.ProgLock Then ProgSecUpdate()
+        End If
+    End Sub
+
+    'Update progress bar (timer controlled)
+    Private Sub ProgSecUpdate()
+
+        With ProgBarCtrl
+
+            If .ProgJobInt > 0 AndAlso Me.ToolStripProgBarJob.Style = ProgressBarStyle.Marquee Then
+                Me.ToolStripProgBarJob.Style = ProgressBarStyle.Continuous
+            End If
+
+            If .ProgJobInt < 0 Then
+                .ProgJobInt = 0
+            ElseIf .ProgJobInt > 100 Then
+                .ProgJobInt = 100
+            End If
+
+            Me.ToolStripProgBarJob.Value = .ProgJobInt
+
+            If .ProgOverallStartInt > -1 Then
+                Me.ToolStripProgBarOverall.Value = CInt(.ProgOverallStartInt + (.PgroOverallEndInt - .ProgOverallStartInt) * .ProgJobInt / 100)
+            End If
+
+        End With
+
+    End Sub
+
+
+#End Region
+
+#Region "Options Tab"
+
+    'Load options from config class
+    Public Sub LoadOptions()
+        Me.ChBoxCyclDistCor.Checked = Cfg.DistCorr
+        Me.ChBoxUseGears.Checked = Cfg.GnUfromCycle
+        Me.ChBoxModOut.Checked = Cfg.ModOut
+        CbBOmode.SelectedIndex = -1
+        Select Case UCase(Cfg.BATCHoutpath)
+            Case sKey.JobPath
+                CbBOmode.SelectedIndex = 0
+            Case Else
+                CbBOmode.SelectedIndex = 1
+                Me.TbBOpath.Text = Cfg.BATCHoutpath
+        End Select
+        Me.ChBoxBatchSubD.Checked = Cfg.BATCHoutSubD
+
+        'Set Mode
+        If Not Cfg.DeclMode Then Me.CbBatch.Checked = Cfg.BatchMode
+
+        Me.RbDecl.Checked = Cfg.DeclMode
+
+    End Sub
+
+    'Update config class from options in GUI, e.g. before running calculations 
+    Private Sub SetOptions()
+
+        'General(Allgemein)
+        Cfg.DistCorr = Me.ChBoxCyclDistCor.Checked
+        Cfg.GnUfromCycle = Me.ChBoxUseGears.Checked
+
+        'BATCH
+        Cfg.ModOut = Me.ChBoxModOut.Checked
+        Select Case CbBOmode.SelectedIndex
+            Case 0
+                Cfg.BATCHoutpath = sKey.JobPath
+            Case Else
+                Cfg.BATCHoutpath = Trim(Me.TbBOpath.Text)
+                If Microsoft.VisualBasic.Right(Cfg.BATCHoutpath, 1) <> "\" Then Cfg.BATCHoutpath &= "\"
+        End Select
+        Cfg.BATCHoutSubD = Me.ChBoxBatchSubD.Checked
+
+        DEV.SetOptions()
+
+
+    End Sub
+
+#Region "Events"
+
+    Private Sub ChBoxAutoSD_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChBoxAutoSD.CheckedChanged
+        Me.LbAutoShDown.Visible = Me.ChBoxAutoSD.Checked
+    End Sub
+
+    Private Sub CbBOmode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CbBOmode.SelectedIndexChanged
+        Me.TbBOpath.Visible = (Me.CbBOmode.SelectedIndex = 2)
+        Me.ButBObrowse.Visible = (Me.CbBOmode.SelectedIndex = 2)
+    End Sub
+
+    Private Sub ButBObrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButBObrowse.Click
+        If fbFolder.OpenDialog(Me.TbBOpath.Text) Then
+            Me.TbBOpath.Text = fbFolder.Files(0)
+        End If
+    End Sub
+
+    Private Sub ChBoxBatchOut_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChBoxModOut.CheckedChanged
+        Me.ChBoxBatchSubD.Enabled = Me.ChBoxModOut.Checked
+    End Sub
+
+#End Region
+
+
+#End Region
+
+#Region "Developer options (DEV) Tab"
+
+    'Load DEV options
+    Private Sub LoadDEVconfigs()
+        Dim LV0 As ListViewItem
+        Dim i As Integer
+        Dim Config0 As KeyValuePair(Of String, cDEVoption)
+
+        Me.LvDEVoptions.Items.Clear()
+
+        i = -1
+        For Each Config0 In DEV.Options
+            i += 1
+
+            LV0 = New ListViewItem
+            LV0.SubItems(0).Text = Config0.Key
+            LV0.SubItems.Add(Config0.Value.Description)
+            LV0.SubItems.Add(Config0.Value.TypeString)
+            LV0.SubItems.Add("")
+            LV0.SubItems.Add(Config0.Value.ValTextDef)
+
+            If Config0.Value.ConfigType = tDEVconfType.tAction Then
+                LV0.SubItems.Add("")
+            Else
+                If Config0.Value.SaveInFile Then
+                    LV0.SubItems.Add("True")
+                Else
+                    LV0.SubItems.Add("False")
+                End If
+            End If
+
+
+
+            LV0.Tag = Config0.Key
+
+            If Not Config0.Value.Enabled Then
+                LV0.ForeColor = Color.DarkGray
+            End If
+
+            Me.LvDEVoptions.Items.Add(LV0)
+
+            UpdateDEVconfigs(LV0)
+
+        Next
+
+    End Sub
+
+    'Update value of specific DEV option
+    Private Sub UpdateDEVconfigs(ByRef LV0 As ListViewItem)
+        LV0.SubItems(3).Text = DEV.Options(LV0.Tag).ValText
+    End Sub
+
+    'Change value of DEV option or execute action-type DEV options
+    Private Sub LvDEVoptions_DoubleClick(sender As Object, e As System.EventArgs) Handles LvDEVoptions.DoubleClick
+        Dim Config0 As cDEVoption
+        Dim str As String
+        Dim i As Integer
+
+        Config0 = DEV.Options(Me.LvDEVoptions.SelectedItems(0).Tag)
+
+        If Not Config0.Enabled Then Exit Sub
+
+        Select Case Config0.ConfigType
+            Case tDEVconfType.tAction
+                Config0.DoAction()
+
+            Case tDEVconfType.tBoolean
+                Config0.BoolVal = Not Config0.BoolVal
+
+            Case tDEVconfType.tSelection
+
+                CmDEVitem = Me.LvDEVoptions.SelectedItems(0)
+
+                CmDEV.Items.Clear()
+
+                i = -1
+                For Each str In Config0.Modes
+                    i += 1
+                    CmDEV.Items.Add("(" & i & ") " & str)
+                    CmDEV.Items(i).Tag = i
+                Next
+
+                CmDEV.Show(Cursor.Position)
+
+            Case tDEVconfType.tIntVal
+                str = InputBox("New Value <" & Config0.TypeString & "> =", , Config0.ValToString)
+                If str <> "" AndAlso IsNumeric(str) Then
+                    Config0.IntVal = CInt(str)
+                End If
+
+            Case tDEVconfType.tSingleVal
+                str = InputBox("New Value <" & Config0.TypeString & "> =", , Config0.ValToString)
+                If str <> "" AndAlso IsNumeric(str) Then
+                    Config0.SingleVal = CSng(str)
+                End If
+
+            Case Else 'tDEVconfType.tStringVal
+                Dim dlg As New F_StrInpBox
+                Config0.StringVal = dlg.ShowDlog("New Value <" & Config0.TypeString & "> =", Config0.StringVal)
+        End Select
+
+        UpdateDEVconfigs(Me.LvDEVoptions.SelectedItems(0))
+
+    End Sub
+
+    'Context menu for selection-type DEV options
+    Private Sub CmDEV_ItemClicked(sender As Object, e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles CmDEV.ItemClicked
+        Dim i As Integer
+
+        i = e.ClickedItem.Tag
+
+        DEV.Options(CmDEVitem.Tag).ModeIndex = i
+
+        UpdateDEVconfigs(CmDEVitem)
+
+    End Sub
+
+
+
+
+#End Region
+
+    'Add message to message list
+    Public Sub MSGtoForm(ByVal ID As tMsgID, ByVal Msg As String, ByVal Source As String, ByVal Link As String)
+
+        Dim lv0 As ListViewItem
+
+        lv0 = New ListViewItem
+        lv0.Text = Msg
+        lv0.SubItems.Add(Now.ToString)
+        lv0.SubItems.Add(Source)
+
+        If LvMsg.Items.Count > 9999 Then LvMsg.Items.RemoveAt(0)
+
+        LogFile.WriteToLog(ID, Msg & vbTab & Source)
+
+        Select Case ID
+
+            Case tMsgID.Err
+
+                lv0.BackColor = Color.Red
+                lv0.ForeColor = Color.White
+
+            Case tMsgID.Warn
+
+                lv0.BackColor = Color.Khaki              'FromArgb(218, 125, 0) 'DarkOrange
+                lv0.ForeColor = Color.Black
+
+            Case Else
+
+                If ID = tMsgID.NewJob Then
+                    lv0.BackColor = Color.LightGray
+                    lv0.ForeColor = Color.DarkBlue
+                End If
+
+        End Select
+
+        If Link <> "" Then
+            If Not ID = tMsgID.Err Then lv0.ForeColor = Color.Blue
+            lv0.SubItems(0).Font = New Font(Me.LvMsg.Font, FontStyle.Underline)
+            lv0.Tag = Link
+        End If
+
+
+        LvMsg.Items.Add(lv0)
+
+        lv0.EnsureVisible()
+
+    End Sub
+
+
+
+
+    'Open link in message list
+    Private Sub LvMsg_MouseClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles LvMsg.MouseClick
+        Dim txt As String
+        If Me.LvMsg.SelectedIndices.Count > 0 Then
+            If Not Me.LvMsg.SelectedItems(0).Tag Is Nothing Then
+                If Len(CStr(Me.LvMsg.SelectedItems(0).Tag)) > 4 AndAlso Microsoft.VisualBasic.Left(CStr(Me.LvMsg.SelectedItems(0).Tag), 4) = "<UM>" Then
+                    txt = CStr(Me.LvMsg.SelectedItems(0).Tag).Replace("<UM>", MyAppPath & "User Manual")
+                    txt = txt.Replace(" ", "%20")
+                    txt = txt.Replace("\", "/")
+                    txt = "file:///" & txt
+                    Try
+                        System.Diagnostics.Process.Start(txt)
+                    Catch ex As Exception
+                        MsgBox("Cannot open link! (-_-;)")
+                    End Try
+                ElseIf Len(CStr(Me.LvMsg.SelectedItems(0).Tag)) > 5 AndAlso Microsoft.VisualBasic.Left(CStr(Me.LvMsg.SelectedItems(0).Tag), 5) = "<GUI>" Then
+                    txt = CStr(Me.LvMsg.SelectedItems(0).Tag).Replace("<GUI>", "")
+                    OpenVectoFile(txt)
+                ElseIf Len(CStr(Me.LvMsg.SelectedItems(0).Tag)) > 5 AndAlso Microsoft.VisualBasic.Left(CStr(Me.LvMsg.SelectedItems(0).Tag), 5) = "<RUN>" Then
+                    txt = CStr(Me.LvMsg.SelectedItems(0).Tag).Replace("<RUN>", "")
+                    Try
+                        Process.Start(txt)
+                    Catch ex As Exception
+                        GUImsg(tMsgID.Err, "Could not run '" & txt & "'!")
+                    End Try
+                Else
+                    OpenFiles(CStr(Me.LvMsg.SelectedItems(0).Tag))
+                End If
+            End If
+        End If
+    End Sub
+
+    'Link-cursor (Hand) for links
+    Private Sub LvMsg_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles LvMsg.MouseMove
+        Dim lv0 As ListViewItem
+        lv0 = Me.LvMsg.GetItemAt(e.Location.X, e.Location.Y)
+        If lv0 Is Nothing OrElse lv0.Tag Is Nothing Then
+            LvMsg.Cursor = Cursors.Arrow
+        Else
+            LvMsg.Cursor = Cursors.Hand
+        End If
+    End Sub
+
+#Region "Open File Context Menu"
+
+    Private CmFiles As String()
+
+    'Initialise and open context menu
+    Private Sub OpenFiles(ParamArray files() As String)
+
+        If files.Length = 0 Then Exit Sub
+
+        CmFiles = files
+
+        Me.OpenInGraphWindowToolStripMenuItem.Enabled = (UCase(fEXT(CmFiles(0))) = ".VMOD")
+
+
+        OpenWithToolStripMenuItem.Text = "Open with " & Cfg.OpenCmdName
+
+        CmOpenFile.Show(Cursor.Position)
+
+    End Sub
+
+    'Open with tool defined in Settings
+    Private Sub OpenWithToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenWithToolStripMenuItem.Click
+        If Not FileOpenAlt(CmFiles(0)) Then MsgBox("Failed to open file!")
+    End Sub
+
+    Private Sub OpenInGraphWindowToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenInGraphWindowToolStripMenuItem.Click
+        Dim FGraph As New F_Graph
+        FGraph.Show()
+        FGraph.LoadNewFile(CmFiles(0))
+    End Sub
+
+    'Show in folder
+    Private Sub ShowInFolderToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ShowInFolderToolStripMenuItem.Click
+        If IO.File.Exists(CmFiles(0)) Then
+            Try
+                System.Diagnostics.Process.Start("explorer", "/select,""" & CmFiles(0) & "")
+            Catch ex As Exception
+                MsgBox("Failed to open file!")
+            End Try
+        Else
+            MsgBox("File not found!")
+        End If
+    End Sub
+
+#End Region
+
+    'Change Declaraion Mode
+    Private Sub RbDecl_CheckedChanged(sender As Object, e As System.EventArgs) Handles RbDecl.CheckedChanged
+        If CbDeclLock Then Exit Sub
+
+        If F_VECTO.Visible Or F_VEH.Visible Or F_GBX.Visible Or F_ENG.Visible Then
+            CbDeclLock = True
+            Me.RbDecl.Checked = Not Me.RbDecl.Checked
+            CbDeclLock = False
+            MsgBox("Please close all dialog windows (e.g. Job Editor) before changing mode!")
+        Else
+            Cfg.DeclMode = Me.RbDecl.Checked
+            Me.RbDev.Checked = Not Me.RbDecl.Checked
+            DeclOnOff()
+        End If
+
+    End Sub
+
+
+
+
+
+#Region "GUI Tests"
+
+    Private GUItest0 As New GUItest(Me)
+
+    Private Class GUItest
+        Private RowLim As Int16 = 9
+        Private ColLim As Int16 = 45
+        Public TestActive As Boolean = False
+        Private TestAborted As Boolean
+        Private xCtrl As Int16
+        Private xPanel As Int16
+        Private Scr As Int32
+        Private PRbAlt As Boolean
+        Private Ctrls(RowLim + 1) As Int16
+        Private Pnls(RowLim + 1) As Int16
+        Private CtrlC As Int16
+        Private CtrlCL As Int16
+        Private PnDir As Int16
+        Private PnDirC As Int16
+        Private PnDirCL As Int16
+        Private PnDirRnd As Int16
+        Private CtrlRnd As Int16
+        Private DiffC As Int16
+        Private DiffLvl As Int16
+        Private bInit As Int16
+        Private MyForm As F_MAINForm
+        Private KeyCode As List(Of Integer)
+
+        Private Sub TestRun()
+
+            Dim z As Int16
+
+            xPanel = ColLim - 10
+            xCtrl = ColLim - 10
+            PRbAlt = False
+            Scr = 0
+            PnDir = 0
+            PnDirCL = 10
+            PnDirC = 0 ' StrDirCL
+            CtrlCL = 5
+            CtrlC = CtrlCL
+            PnDirRnd = 5
+            CtrlRnd = 8
+            DiffC = 0
+            DiffLvl = 1
+            bInit = 0
+            TestAborted = False
+            Randomize()
+
+
+            MyForm.LvMsg.Items.Clear()
+            MyForm.ToolStripLbStatus.Text = "Score: 0000             Press <Esc> to Quit"
+
+            For z = 1 To RowLim - 6
+                PRbAlt = Not PRbAlt
+                If Not PRbAlt Then
+                    MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|       |*")
+                Else
+                    MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|   |   |*")
+                End If
+            Next
+
+            PRbAlt = False
+
+            MyForm.LvMsg.Items.Add("  VECTO Interactive Mode" & Space(ColLim - 35) & "*|       |*")
+            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|   |   |*")
+            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|       |*")
+            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|   |   |*")
+            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|       |*")
+            MyForm.LvMsg.Items.Add(Space(ColLim - 11) & "*|   ∆   |*")
+
+            For z = 1 To RowLim + 1
+                Pnls(z) = ColLim - 10
+                Ctrls(z) = 0
+            Next
+
+            MyForm.TmProgSec.Interval = 200
+
+            MyForm.LvMsg.Focus()
+
+            MyForm.TmProgSec.Start()
+
+
+        End Sub
+
+        Public Sub TestStop()
+            MyForm.TmProgSec.Stop()
+            TestActive = False
+            MyForm.LvMsg.Items.Clear()
+            CtrlC = 0
+            MyForm.ToolStripLbStatus.Text = MyForm.LastModeName & " Mode"
+        End Sub
+
+        Public Sub TestTick()
+
+            If bInit = 24 Then GoTo LbRace
+            bInit += 1
+
+            Select Case bInit
+                Case 10
+                    MyForm.LvMsg.Items.RemoveAt(RowLim - 6)
+                    MyForm.LvMsg.Items.RemoveAt(RowLim - 5)
+                    MyForm.LvMsg.Items.Insert(RowLim - 6, Space(ColLim - 11) & "*|       |*")
+                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & "  3      " & Space(10) & "*|       |*")
+                Case 14
+                    MyForm.LvMsg.Items.RemoveAt(RowLim - 4)
+                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & "  2      " & Space(10) & "*|       |*")
+                Case 18
+                    MyForm.LvMsg.Items.RemoveAt(RowLim - 4)
+                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & "  1      " & Space(10) & "*|       |*")
+                Case 22
+                    MyForm.LvMsg.Items.RemoveAt(RowLim - 4)
+                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & " Go!     " & Space(10) & "*|       |*")
+                Case 24
+                    MyForm.LvMsg.Items.RemoveAt(RowLim - 4)
+                    MyForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & "         " & Space(10) & "*|       |*")
+            End Select
+            Exit Sub
+LbRace:
+
+            PRbAlt = Not PRbAlt
+
+            MyForm.LvMsg.BeginUpdate()
+
+            sLists()
+
+            sAlign()
+
+            sSetCtrl()
+
+            sSetPanel()
+
+            MyForm.LvMsg.Items.RemoveAt(RowLim)
+
+            sUpdateCtrl()
+
+            MyForm.LvMsg.EndUpdate()
+
+            If Math.Abs(xCtrl - Pnls(2)) > 4 Then
+                sAbort()
+                Exit Sub
+            ElseIf Ctrls(2) <> 0 Then
+                If xCtrl = Pnls(2) + Ctrls(2) - 4 Then
+                    sAbort()
+                    Exit Sub
+                End If
+                Scr += 5 * DiffLvl
+            End If
+
+            Scr += DiffLvl
+            DiffC += 1
+
+            'Erhöhe Schwierigkeitsgrad
+            If DiffC = (DiffLvl + 3) * 4 Then
+                DiffC = 0
+                DiffLvl += 1
+                If DiffLvl > 2 And DiffLvl < 7 Then MyForm.TmProgSec.Interval = 300 - (DiffLvl) * 30
+                Scr += 100
+                Select Case DiffLvl
+                    Case 3
+                        PnDirCL = 3
+                        CtrlCL = 4
+                        CtrlRnd = 6
+                    Case 5
+                        PnDirCL = 2
+                        PnDirRnd = 4
+                    Case 8
+                        CtrlCL = 2
+                    Case 10
+                        CtrlRnd = 4
+                        PnDirRnd = 3
+                End Select
+            End If
+
+        End Sub
+
+        Public Sub TestKey(ByVal Key0 As Integer)
+
+            If TestActive Then
+                Select Case Key0
+                    Case Keys.Left
+                        xCtrl -= 1
+                        sUpdateCtrl()
+                    Case Keys.Right
+                        xCtrl += 1
+                        sUpdateCtrl()
+                    Case Keys.Escape
+                        TestStop()
+                End Select
+            Else
+
+                If KeyCode(CtrlC) = Key0 Then
+                    CtrlC += 1
+                    If CtrlC = KeyCode.Count Then
+                        TestActive = True
+                        TestRun()
+                    End If
+                Else
+                    CtrlC = 0
+                End If
+
+            End If
+        End Sub
+
+        Private Sub sAbort()
+
+            Dim s As String, s1 As String
+
+            If TestAborted Then Exit Sub
+
+            TestAborted = True
+
+            MyForm.TmProgSec.Stop()
+
+            MyForm.LvMsg.BeginUpdate()
+
+            s = MyForm.LvMsg.Items(0).Text
+            MyForm.LvMsg.Items.RemoveAt(0)
+            MyForm.LvMsg.Items.Insert(0, "You crashed!" & Microsoft.VisualBasic.Right(s, Len(s) - 12))
+
+            s = MyForm.LvMsg.Items(1).Text
+            s1 = "Score: " & Scr & " "
+            MyForm.LvMsg.Items.RemoveAt(1)
+            MyForm.LvMsg.Items.Insert(1, s1 & Microsoft.VisualBasic.Right(s, Len(s) - Len(s1)))
+
+            MyForm.LvMsg.EndUpdate()
+
+            LogFile.WriteToLog(tMsgID.Normal, "*** Race Score: " & Scr.ToString("0000") & " ***")
+
+            CtrlC = 0
+            TestActive = False
+
+            MyForm.ToolStripLbStatus.Text = MyForm.LastModeName & " Mode"
+
+
+        End Sub
+
+        Private Sub sSetCtrl()
+            Dim x As Int16
+            If Scr < 10 Then Exit Sub
+            Ctrls(RowLim + 1) = 0
+            CtrlC += 1
+            If CtrlC < CtrlCL Then Exit Sub
+            Select Case CInt(Int((CtrlRnd * Rnd()) + 1))
+                Case 1, 2
+                    CtrlC = 0
+                    x = CInt(Int((7 * Rnd()) + 1))
+                    Ctrls(RowLim + 1) = x
+                Case Else
+            End Select
+        End Sub
+
+        Private Sub sUpdateCtrl()
+            Dim s As String
+            If bInit < 21 Then
+                xCtrl = ColLim - 10
+                Exit Sub
+            End If
+            If Math.Abs(xCtrl - Pnls(1)) > 5 Then
+                sAbort()
+                Exit Sub
+            End If
+            s = Replace(MyForm.LvMsg.Items(RowLim - 1).Text.ToString, "∆", " ") & "   "
+            s = Microsoft.VisualBasic.Left(s, ColLim + 15)
+            's = s.Remove(0, 20)
+            's = "Press <Esc> to Quit " & s
+            If Mid(s, xCtrl + 5, 1) = "X" Then
+                sAbort()
+                Exit Sub
+            End If
+            s = s.Remove(xCtrl + 4, 1)
+            's = Trim(s.Insert(xCar + 4, "∆")) & Space(ColLim + 5 - Streets(2)) & "Pts: " & Pts & " Lv: " & DiffLvl
+            s = Space(Pnls(2) - 1) & Trim(s.Insert(xCtrl + 4, "∆"))
+            MyForm.LvMsg.Items.RemoveAt(RowLim - 1)
+            MyForm.LvMsg.Items.Insert(RowLim - 1, s)
+            MyForm.ToolStripLbStatus.Text = "Score: " & Scr.ToString("0000") & "             Press <Esc> to Quit"
+        End Sub
+
+        Private Sub sSetPanel()
+            Dim s As String
+            s = "*|   |   |*"
+            If PRbAlt Then
+                s = s.Remove(5, 1)
+                s = s.Insert(5, " ")
+            End If
+            If Ctrls(RowLim + 1) <> 0 Then
+                s = s.Remove(Ctrls(RowLim + 1) + 1, 1)
+                s = s.Insert(Ctrls(RowLim + 1) + 1, "X")
+            End If
+            Select Case xPanel - Pnls(RowLim)
+                Case -1
+                    s = Replace(s, "|", "\")
+                Case 1
+                    s = Replace(s, "|", "/")
+            End Select
+            MyForm.LvMsg.Items.Insert(0, Space(xPanel - 1) & s)
+        End Sub
+
+        Private Sub sAlign()
+            PnDirC += 1
+            If PnDirC < PnDirCL Then GoTo Lb1
+            PnDirC = 0
+            Select Case CInt(Int((PnDirRnd * Rnd()) + 1))
+                Case 1
+                    PnDir = 1
+                Case 2
+                    PnDir = -1
+                Case Else
+                    PnDir = 0
+            End Select
+Lb1:
+            xPanel += PnDir
+            If xPanel > ColLim Then
+                xPanel = ColLim
+            ElseIf xPanel < 22 Then
+                xPanel = 22
+            End If
+            Pnls(RowLim + 1) = xPanel
+        End Sub
+
+        Private Sub sLists()
+            Dim x As Int16
+            For x = 2 To RowLim + 1
+                Ctrls(x - 1) = Ctrls(x)
+                Pnls(x - 1) = Pnls(x)
+            Next
+        End Sub
+
+        Public Sub New(ByVal Form As F_MAINForm)
+            MyForm = Form
+            KeyCode = New List(Of Integer)
+            KeyCode.Add(Keys.Up)
+            KeyCode.Add(Keys.Up)
+            KeyCode.Add(Keys.Down)
+            KeyCode.Add(Keys.Down)
+            KeyCode.Add(Keys.Left)
+            KeyCode.Add(Keys.Right)
+            KeyCode.Add(Keys.Left)
+            KeyCode.Add(Keys.Right)
+            KeyCode.Add(Keys.B)
+            KeyCode.Add(Keys.A)
+            CtrlC = 0
+        End Sub
+
+    End Class
+
+    Private Sub LvMsg_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles LvMsg.KeyDown
+        GUItest0.TestKey(e.KeyValue)
+        If GUItest0.TestActive Then e.SuppressKeyPress = True
+    End Sub
+
+    Private Sub LvMsg_LostFocus(sender As Object, e As System.EventArgs) Handles LvMsg.LostFocus
+        If GUItest0.TestActive Then GUItest0.TestStop()
+    End Sub
+
+#End Region
+
+
+   
+End Class
diff --git a/VECTO/GUI/F_VECTO.vb b/VECTO/GUI/F_VECTO.vb
index e916ef0687cb145b0093837a456645d1f8b19f8b..aff9881192e9ce0908261784f4c0e40208592c68 100644
--- a/VECTO/GUI/F_VECTO.vb
+++ b/VECTO/GUI/F_VECTO.vb
@@ -1,1247 +1,1353 @@
-' Copyright 2014 European Union.
-' Licensed under the EUPL (the 'Licence');
-'
-' * You may not use this work except in compliance with the Licence.
-' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
-' * Unless required by applicable law or agreed to in writing,
-'   software distributed under the Licence is distributed on an "AS IS" basis,
-'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-'
-' See the LICENSE.txt for the specific language governing permissions and limitations.
-
-Imports System.Collections.Generic
-
-''' <summary>
-''' Job Editor. Create/Edit VECTO job files (.vecto)
-''' </summary>
-''' <remarks></remarks>
-Public Class F_VECTO
-
-    Private VECTOfile As String
-    Private Changed As Boolean = False
-
-    Private pgDriver As TabPage
-
-    Private pgDriverON As Boolean = True
-
-    Private AuxDlog As F_VEH_AuxDlog
-
-    Private EStechs As New List(Of String)
-
-    'Initialise form
-    Private Sub F02_GEN_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-        Dim x As Int16
-
-        AuxDlog = New F_VEH_AuxDlog
-
-        pgDriver = Me.TabPgDriver
-
-        For x = 0 To Me.TabControl1.TabCount - 1
-            Me.TabControl1.TabPages(x).Show()
-        Next
-
-        Me.LvAux.Columns(2).Width = -2
-
-        'Declaration Mode
-        If Cfg.DeclMode Then
-            Me.LvAux.Columns(2).Text = "Technology"
-        Else
-            Me.LvAux.Columns(2).Text = "Input File"
-        End If
-
-        Me.CbEngOnly.Enabled = Not Cfg.DeclMode
-        Me.GrCycles.Enabled = Not Cfg.DeclMode
-        Me.GrVACC.Enabled = Not Cfg.DeclMode
-        Me.PnStartStop.Enabled = Not Cfg.DeclMode
-        Me.RdOff.Enabled = Not Cfg.DeclMode
-        Me.GrLAC.Enabled = Not Cfg.DeclMode
-        Me.ButAuxAdd.Enabled = Not Cfg.DeclMode
-        Me.ButAuxRem.Enabled = Not Cfg.DeclMode
-        Me.PnEcoRoll.Enabled = Not Cfg.DeclMode
-
-        Changed = False
-
-    End Sub
-
-    'Close - Check for unsaved changes
-    Private Sub F02_GEN_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
-        If e.CloseReason <> CloseReason.ApplicationExitCall And e.CloseReason <> CloseReason.WindowsShutDown Then
-            e.Cancel = ChangeCheckCancel()
-        End If
-    End Sub
-
-    'Set generic values for Declaration mode
-    Private Sub DeclInit()
-        Dim LV0 As ListViewItem
-
-        If Not Cfg.DeclMode Then Exit Sub
-
-        Me.LvCycles.Items.Clear()
-        Me.CbEngOnly.Checked = False
-        Me.TbDesMaxFile.Text = ""
-        If Not Me.RdEcoRoll.Checked Then Me.RdOverspeed.Checked = True
-        Me.CbLookAhead.Checked = True
-
-        Me.TbSSspeed.Text = cDeclaration.SSspeed
-        Me.TbSStime.Text = cDeclaration.SStime
-        Me.TbSSdelay.Text = cDeclaration.SSdelay
-        Me.TbAlookahead.Text = cDeclaration.LACa
-        Me.TbVminLA.Text = cDeclaration.LACvmin
-
-        Me.TbOverspeed.Text = cDeclaration.Overspeed
-        Me.TbUnderSpeed.Text = cDeclaration.Underspeed
-        Me.TbVmin.Text = cDeclaration.ECvmin
-
-        If LvAux.Items.Count <> 5 OrElse (Me.LvAux.Items(0).Text <> sKey.AUX.Fan OrElse Me.LvAux.Items(1).Text <> sKey.AUX.SteerPump OrElse Me.LvAux.Items(2).Text <> sKey.AUX.HVAC OrElse Me.LvAux.Items(3).Text <> sKey.AUX.ElecSys OrElse Me.LvAux.Items(4).Text <> sKey.AUX.PneumSys) Then
-            Me.LvAux.Items.Clear()
-
-            LV0 = New ListViewItem(sKey.AUX.Fan)
-            LV0.SubItems.Add("Fan")
-            If Declaration.AuxTechs(tAux.Fan).Count > 1 Then
-                LV0.SubItems.Add("")
-            Else
-                LV0.SubItems.Add(Declaration.AuxTechs(tAux.Fan)(0))
-            End If
-            Me.LvAux.Items.Add(LV0)
-
-            LV0 = New ListViewItem(sKey.AUX.SteerPump)
-            LV0.SubItems.Add("Steering pump")
-            If Declaration.AuxTechs(tAux.SteerPump).Count > 1 Then
-                LV0.SubItems.Add("")
-            Else
-                LV0.SubItems.Add(Declaration.AuxTechs(tAux.SteerPump)(0))
-            End If
-            Me.LvAux.Items.Add(LV0)
-
-            LV0 = New ListViewItem(sKey.AUX.HVAC)
-            LV0.SubItems.Add("HVAC")
-            If Declaration.AuxTechs(tAux.HVAC).Count > 1 Then
-                LV0.SubItems.Add("")
-            Else
-                LV0.SubItems.Add(Declaration.AuxTechs(tAux.HVAC)(0))
-            End If
-            Me.LvAux.Items.Add(LV0)
-
-            LV0 = New ListViewItem(sKey.AUX.ElecSys)
-            LV0.SubItems.Add("Electric System")
-            If Declaration.AuxTechs(tAux.ElectricSys).Count > 1 Then
-                LV0.SubItems.Add("")
-            Else
-                LV0.SubItems.Add(Declaration.AuxTechs(tAux.ElectricSys)(0))
-            End If
-            Me.LvAux.Items.Add(LV0)
-
-            LV0 = New ListViewItem(sKey.AUX.PneumSys)
-            LV0.SubItems.Add("Pneumatic System")
-            If Declaration.AuxTechs(tAux.PneumSys).Count > 1 Then
-                LV0.SubItems.Add("")
-            Else
-                LV0.SubItems.Add(Declaration.AuxTechs(tAux.PneumSys)(0))
-            End If
-            Me.LvAux.Items.Add(LV0)
-
-        End If
-
-
-    End Sub
-
-
-    'Show/Hide "Driver Assist" Tab
-    Private Sub SetDrivertab(ByVal OnOff As Boolean)
-        If OnOff Then
-            If Not pgDriverON Then
-                pgDriverON = True
-                Me.TabControl1.TabPages.Insert(1, pgDriver)
-            End If
-        Else
-            If pgDriverON Then
-                pgDriverON = False
-                Me.TabControl1.Controls.Remove(pgDriver)
-            End If
-        End If
-    End Sub
-
-
-#Region "Browse Buttons"
-
-    Private Sub ButtonVEH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonVEH.Click
-        If fbVEH.OpenDialog(fFileRepl(Me.TbVEH.Text, fPATH(VECTOfile))) Then Me.TbVEH.Text = fFileWoDir(fbVEH.Files(0), fPATH(VECTOfile))
-    End Sub
-
-    Private Sub ButtonMAP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonMAP.Click
-        If fbENG.OpenDialog(fFileRepl(Me.TbENG.Text, fPATH(VECTOfile))) Then Me.TbENG.Text = fFileWoDir(fbENG.Files(0), fPATH(VECTOfile))
-    End Sub
-
-    Private Sub ButtonGBX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGBX.Click
-        If fbGBX.OpenDialog(fFileRepl(Me.TbGBX.Text, fPATH(VECTOfile))) Then Me.TbGBX.Text = fFileWoDir(fbGBX.Files(0), fPATH(VECTOfile))
-    End Sub
-
-    Private Sub BtDesMaxBr_Click_1(sender As System.Object, e As System.EventArgs) Handles BtDesMaxBr.Click
-        If fbACC.OpenDialog(fFileRepl(Me.TbDesMaxFile.Text, fPATH(VECTOfile))) Then Me.TbDesMaxFile.Text = fFileWoDir(fbACC.Files(0), fPATH(VECTOfile))
-    End Sub
-
-    Private Sub BtAccOpen_Click(sender As System.Object, e As System.EventArgs) Handles BtAccOpen.Click
-        OpenFiles(fFileRepl(Me.TbDesMaxFile.Text, fPATH(VECTOfile)))
-    End Sub
-
-#End Region
-
-#Region "Open Buttons"
-
-    'Open Vehicle Editor
-    Private Sub ButOpenVEH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenVEH.Click
-        Dim f As String
-        f = fFileRepl(TbVEH.Text, fPATH(VECTOfile))
-
-        'Thus Veh-file is returned
-        F_VEH.JobDir = fPATH(VECTOfile)
-        F_VEH.AutoSendTo = True
-
-        If Not Trim(f) = "" Then
-            If Not IO.File.Exists(f) Then
-                MsgBox("File not found!")
-                Exit Sub
-            End If
-        End If
-
-        If Not F_VEH.Visible Then
-            F_VEH.Show()
-        Else
-            If F_VEH.WindowState = FormWindowState.Minimized Then F_VEH.WindowState = FormWindowState.Normal
-            F_VEH.BringToFront()
-        End If
-
-        If Not Trim(f) = "" Then F_VEH.openVEH(f)
-
-    End Sub
-
-    'Open Engine Editor
-    Private Sub ButOpenENG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenENG.Click
-        Dim f As String
-        f = fFileRepl(TbENG.Text, fPATH(VECTOfile))
-
-        'Thus Veh-file is returned
-        F_ENG.JobDir = fPATH(VECTOfile)
-        F_ENG.AutoSendTo = True
-
-        If Not Trim(f) = "" Then
-            If Not IO.File.Exists(f) Then
-                MsgBox("File not found!")
-                Exit Sub
-            End If
-        End If
-
-        If Not F_ENG.Visible Then
-            F_ENG.Show()
-        Else
-            If F_ENG.WindowState = FormWindowState.Minimized Then F_ENG.WindowState = FormWindowState.Normal
-            F_ENG.BringToFront()
-        End If
-
-        If Not Trim(f) = "" Then F_ENG.openENG(f)
-
-    End Sub
-
-    'Open Gearbox Editor
-    Private Sub ButOpenGBX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenGBX.Click
-        Dim f As String
-        f = fFileRepl(TbGBX.Text, fPATH(VECTOfile))
-
-        'Thus Veh-file is returned
-        F_GBX.JobDir = fPATH(VECTOfile)
-        F_GBX.AutoSendTo = True
-
-        If Not Trim(f) = "" Then
-            If Not IO.File.Exists(f) Then
-                MsgBox("File not found!")
-                Exit Sub
-            End If
-        End If
-
-        If Not F_GBX.Visible Then
-            F_GBX.Show()
-        Else
-            If F_GBX.WindowState = FormWindowState.Minimized Then F_GBX.WindowState = FormWindowState.Normal
-            F_GBX.BringToFront()
-        End If
-
-        If Not Trim(f) = "" Then F_GBX.openGBX(f)
-
-    End Sub
-
-#End Region
-
-#Region "Toolbar"
-
-    'New
-    Private Sub ToolStripBtNew_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtNew.Click
-        VECTOnew()
-    End Sub
-
-    'Open
-    Private Sub ToolStripBtOpen_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtOpen.Click
-        If fbVECTO.OpenDialog(VECTOfile, False, "vecto") Then VECTOload2Form(fbVECTO.Files(0))
-    End Sub
-
-    'Save
-    Private Sub ToolStripBtSave_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtSave.Click
-        Save()
-    End Sub
-
-    'Save As
-    Private Sub ToolStripBtSaveAs_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtSaveAs.Click
-        If fbVECTO.SaveDialog(VECTOfile) Then Call VECTOsave(fbVECTO.Files(0))
-    End Sub
-
-    'Send to Job file list in main form
-    Private Sub ToolStripBtSendTo_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtSendTo.Click
-        If ChangeCheckCancel() Then Exit Sub
-        If VECTOfile = "" Then
-            MsgBox("File not found!" & ChrW(10) & ChrW(10) & "Save file and try again.")
-        Else
-            F_MAINForm.AddToJobListView(VECTOfile)
-        End If
-    End Sub
-
-    'Help
-    Private Sub ToolStripButton1_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripButton1.Click
-        If IO.File.Exists(MyAppPath & "User Manual\GUI\GUI_Calls\VECTO.html") Then
-            System.Diagnostics.Process.Start(MyAppPath & "User Manual\GUI\GUI_Calls\VECTO.html")
-        Else
-            MsgBox("User Manual not found!", MsgBoxStyle.Critical)
-        End If
-    End Sub
-
-
-#End Region
-
-    'Save ("Save" or "Save As" when new file)
-    Private Function Save() As Boolean
-        If VECTOfile = "" Then
-            If fbVECTO.SaveDialog("") Then
-                VECTOfile = fbVECTO.Files(0)
-            Else
-                Return False
-            End If
-        End If
-        Return VECTOsave(VECTOfile)
-    End Function
-
-    'Open file
-    Public Sub VECTOload2Form(ByVal file As String)
-        Dim x As Int16
-        Dim VEC0 As cVECTO
-        Dim AuxEntryKV As KeyValuePair(Of String, cVECTO.cAuxEntry)
-        Dim LV0 As ListViewItem
-        Dim sb As cSubPath
-
-        If ChangeCheckCancel() Then Exit Sub
-
-        VECTOnew()
-
-        'Read GEN
-        VEC0 = New cVECTO
-        VEC0.FilePath = file
-        Try
-            If Not VEC0.ReadFile() Then
-                VEC0 = Nothing
-                MsgBox("Failed to load " & fFILE(file, True) & "!")
-                Exit Sub
-            End If
-        Catch ex As Exception
-            MsgBox("Failed to load " & fFILE(file, True) & "!")
-            Exit Sub
-        End Try
-
-        If Cfg.DeclMode <> VEC0.SavedInDeclMode Then
-            Select Case WrongMode()
-                Case 1
-                    Me.Close()
-                    F_MAINForm.RbDecl.Checked = Not F_MAINForm.RbDecl.Checked
-                    F_MAINForm.OpenVectoFile(file)
-                Case -1
-                    Exit Sub
-                Case Else '0
-                    'Continue...
-            End Select
-        End If
-
-
-        'Update Form
-
-        'Files -----------------------------
-        TbVEH.Text = VEC0.PathVEH(True)
-        TbENG.Text = VEC0.PathENG(True)
-        TbGBX.Text = VEC0.PathGBX(True)
-
-        'Start/Stop
-        Me.ChBStartStop.Checked = VEC0.StartStop
-        Me.TbSSspeed.Text = VEC0.StStV
-        Me.TbSStime.Text = VEC0.StStT
-        Me.TbSSdelay.Text = VEC0.StStDelay
-
-        'VACC
-        Me.TbDesMaxFile.Text = VEC0.DesMaxFile(True)
-
-        Me.LvAux.Items.Clear()
-        For Each AuxEntryKV In VEC0.AuxPaths
-            LV0 = New ListViewItem
-            LV0.SubItems(0).Text = AuxEntryKV.Key
-            LV0.SubItems.Add(AuxEntryKV.Value.Type)
-            If Cfg.DeclMode Then
-                LV0.SubItems.Add(AuxEntryKV.Value.TechStr)
-            Else
-                LV0.SubItems.Add(AuxEntryKV.Value.Path.OriginalPath)
-            End If
-            LvAux.Items.Add(LV0)
-        Next
-
-        EStechs = VEC0.EStechs
-
-        For Each sb In VEC0.CycleFiles
-            LV0 = New ListViewItem
-            LV0.Text = sb.OriginalPath
-            LvCycles.Items.Add(LV0)
-        Next
-
-        Me.CbEngOnly.Checked = VEC0.EngOnly
-
-        If VEC0.EcoRollOn Then
-            Me.RdEcoRoll.Checked = True
-        ElseIf VEC0.OverSpeedOn Then
-            Me.RdOverspeed.Checked = True
-        Else
-            Me.RdOff.Checked = True
-        End If
-        Me.TbOverspeed.Text = CStr(VEC0.OverSpeed)
-        Me.TbUnderSpeed.Text = CStr(VEC0.UnderSpeed)
-        Me.TbVmin.Text = CStr(VEC0.vMin)
-        Me.CbLookAhead.Checked = VEC0.LookAheadOn
-        Me.TbAlookahead.Text = CStr(VEC0.a_lookahead)
-        Me.TbVminLA.Text = CStr(VEC0.vMinLA)
-
-
-        '-------------------------------------------------------------
-
-        DeclInit()
-
-
-        F_ENG.AutoSendTo = False
-        F_GBX.AutoSendTo = False
-        F_VEH.AutoSendTo = False
-
-
-        VECTOfile = file
-
-        x = Len(file)
-        While Mid(file, x, 1) <> "\" And x > 0
-            x = x - 1
-        End While
-        Me.Text = Mid(file, x + 1, Len(file) - x)
-        Changed = False
-        Me.ToolStripStatusLabelGEN.Text = ""    'file & " opened."
-
-        UpdatePic()
-
-        '-------------------------------------------------------------
-
-    End Sub
-
-    'Save file
-    Private Function VECTOsave(ByVal file As String) As Boolean
-
-        Dim VEC0 As cVECTO
-        Dim AuxEntry As cVECTO.cAuxEntry
-        Dim LV0 As ListViewItem
-        Dim sb As cSubPath
-
-        VEC0 = New cVECTO
-        VEC0.FilePath = file
-
-        'Files ------------------------------------------------- -----------------
-
-        VEC0.PathVEH = Me.TbVEH.Text
-        VEC0.PathENG = Me.TbENG.Text
-
-        For Each LV0 In LvCycles.Items
-            sb = New cSubPath
-            sb.Init(fPATH(file), LV0.Text)
-            VEC0.CycleFiles.Add(sb)
-        Next
-
-        VEC0.PathGBX = Me.TbGBX.Text
-
-
-        'Start/Stop
-        VEC0.StartStop = Me.ChBStartStop.Checked
-        VEC0.StStV = CSng(fTextboxToNumString(Me.TbSSspeed.Text))
-        VEC0.StStT = CSng(fTextboxToNumString(Me.TbSStime.Text))
-        VEC0.StStDelay = CInt(fTextboxToNumString(Me.TbSSdelay.Text))
-
-        'a_DesMax
-        VEC0.DesMaxFile = Me.TbDesMaxFile.Text
-
-        For Each LV0 In LvAux.Items
-            AuxEntry = New cVECTO.cAuxEntry
-
-            If Cfg.DeclMode Then
-                AuxEntry.TechStr = LV0.SubItems(2).Text
-            Else
-                AuxEntry.Path.Init(fPATH(file), LV0.SubItems(2).Text)
-            End If
-
-            AuxEntry.Type = LV0.SubItems(1).Text
-            VEC0.AuxPaths.Add(LV0.SubItems(0).Text, AuxEntry)
-        Next
-
-        VEC0.EStechs = EStechs
-
-
-        VEC0.EngOnly = Me.CbEngOnly.Checked
-
-        VEC0.EcoRollOn = RdEcoRoll.Checked
-        VEC0.OverSpeedOn = RdOverspeed.Checked
-        VEC0.OverSpeed = CSng(fTextboxToNumString(Me.TbOverspeed.Text))
-        VEC0.UnderSpeed = CSng(fTextboxToNumString(Me.TbUnderSpeed.Text))
-        VEC0.vMin = CSng(fTextboxToNumString(Me.TbVmin.Text))
-        VEC0.LookAheadOn = Me.CbLookAhead.Checked
-        VEC0.a_lookahead = CSng(fTextboxToNumString(Me.TbAlookahead.Text))
-        VEC0.vMinLA = CSng(fTextboxToNumString(Me.TbVminLA.Text))
-
-
-        '------------------------------------------------------------
-
-        'SAVE
-        If Not VEC0.SaveFile Then
-            MsgBox("Cannot safe to " & file, MsgBoxStyle.Critical)
-            Return False
-        End If
-
-        VECTOfile = file
-
-        file = fFILE(VECTOfile, True)
-
-        Me.Text = file
-
-        Me.ToolStripStatusLabelGEN.Text = ""
-
-        F_MAINForm.AddToJobListView(VECTOfile)
-
-        Changed = False
-
-        Return True
-
-    End Function
-
-    'New file
-    Public Sub VECTOnew()
-
-        If ChangeCheckCancel() Then Exit Sub
-
-        'Files
-        Me.TbVEH.Text = ""
-        Me.TbENG.Text = ""
-        Me.LvCycles.Items.Clear()
-        Me.TbGBX.Text = ""
-        Me.TbDesMaxFile.Text = ""
-
-        'Start/Stop
-        Me.TbSSspeed.Text = "5"
-        Me.TbSStime.Text = "5"
-        Me.ChBStartStop.Checked = False
-
-        Me.LvAux.Items.Clear()
-
-        Me.CbEngOnly.Checked = False
-
-        Me.RdOff.Checked = True
-        Me.CbLookAhead.Checked = True
-        Me.TbAlookahead.Text = "-0.5"
-        Me.TbOverspeed.Text = ""
-        Me.TbUnderSpeed.Text = ""
-        Me.TbVmin.Text = ""
-        Me.TbVminLA.Text = "50"
-
-        '---------------------------------------------------
-
-        DeclInit()
-
-        F_ENG.AutoSendTo = False
-
-        VECTOfile = ""
-        Me.Text = "Job Editor"
-        Me.ToolStripStatusLabelGEN.Text = ""
-        Changed = False
-        UpdatePic()
-
-    End Sub
-
-
-#Region "Track changes"
-
-#Region "'Change' Events"
-
-    Private Sub TextBoxVEH_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbVEH.TextChanged
-        UpdatePic()
-        Change()
-    End Sub
-    Private Sub TextBoxMAP_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbENG.TextChanged
-        UpdatePic()
-        Change()
-    End Sub
-
-    Private Sub TextBoxFLD_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbGBX.TextChanged
-        UpdatePic()
-        Change()
-    End Sub
-
-    Private Sub TbDesMaxFile_TextChanged_1(sender As System.Object, e As System.EventArgs) Handles TbDesMaxFile.TextChanged
-        Change()
-    End Sub
-
-
-    Private Sub TBSSspeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbSSspeed.TextChanged
-        Change()
-    End Sub
-
-    Private Sub TBSStime_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbSStime.TextChanged, TbSSdelay.TextChanged
-        Change()
-    End Sub
-
-    Private Sub TbOverspeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbOverspeed.TextChanged
-        Change()
-    End Sub
-
-    Private Sub TbUnderSpeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbUnderSpeed.TextChanged
-        Change()
-    End Sub
-
-    Private Sub TbVmin_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbVmin.TextChanged, TbVminLA.TextChanged
-        Change()
-    End Sub
-
-    Private Sub TbAlookahead_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbAlookahead.TextChanged
-        Change()
-    End Sub
-
-    Private Sub LvCycles_AfterLabelEdit(sender As Object, e As System.Windows.Forms.LabelEditEventArgs) Handles LvCycles.AfterLabelEdit
-        Change()
-    End Sub
-
-
-#End Region
-
-    Private Sub Change()
-        If Not Changed Then
-            Me.ToolStripStatusLabelGEN.Text = "Unsaved changes in current file"
-            Changed = True
-        End If
-    End Sub
-
-    ' "Save changes? "... Returns True if User aborts
-    Private Function ChangeCheckCancel() As Boolean
-
-        If Changed Then
-
-            Select Case MsgBox("Save changes ?", MsgBoxStyle.YesNoCancel)
-                Case MsgBoxResult.Yes
-                    Return Not Save()
-                Case MsgBoxResult.Cancel
-                    Return True
-                Case Else 'MsgBoxResult.No
-                    Changed = False
-                    Return False
-            End Select
-
-        Else
-
-            Return False
-
-        End If
-
-    End Function
-
-#End Region
-
-#Region "Aux Listview"
-
-    Private Sub ButAuxAdd_Click(sender As System.Object, e As System.EventArgs) Handles ButAuxAdd.Click
-        Dim LV0 As ListViewItem
-        Dim ID As String
-
-        AuxDlog.VehPath = fPATH(VECTOfile)
-        AuxDlog.TbPath.Text = ""
-        AuxDlog.CbType.SelectedIndex = -1
-        AuxDlog.CbType.Text = ""
-        AuxDlog.TbID.Text = ""       '!!! Vorher Type setzen weil ID beim ändern von Type überschrieben wird !!!"
-
-lbDlog:
-        If AuxDlog.ShowDialog = Windows.Forms.DialogResult.OK Then
-
-            ID = UCase(Trim(AuxDlog.TbID.Text))
-
-            For Each LV0 In LvAux.Items
-                If LV0.SubItems(0).Text = ID Then
-                    MsgBox("ID '" & ID & "' already defined!", MsgBoxStyle.Critical)
-                    AuxDlog.TbID.SelectAll()
-                    AuxDlog.TbID.Focus()
-                    GoTo lbDlog
-                End If
-            Next
-
-            LV0 = New ListViewItem
-            LV0.SubItems(0).Text = UCase(Trim(AuxDlog.TbID.Text))
-            LV0.SubItems.Add(Trim(AuxDlog.CbType.Text))
-            LV0.SubItems.Add(Trim(AuxDlog.TbPath.Text))
-
-            LvAux.Items.Add(LV0)
-
-            If ID = sKey.AUX.ElecSys Then
-                EStechs.Clear()
-                For Each LV0 In AuxDlog.LVTech.CheckedItems
-                    EStechs.Add(LV0.Text)
-                Next
-            End If
-
-            Change()
-
-        End If
-
-    End Sub
-
-    Private Sub ButAuxRem_Click(sender As System.Object, e As System.EventArgs) Handles ButAuxRem.Click
-        RemoveAuxItem()
-    End Sub
-
-    Private Sub LvAux_DoubleClick(sender As Object, e As System.EventArgs) Handles LvAux.DoubleClick
-        EditAuxItem()
-    End Sub
-
-    Private Sub LvAux_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles LvAux.KeyDown
-        Select Case e.KeyCode
-            Case Keys.Delete, Keys.Back
-                If Not Cfg.DeclMode Then RemoveAuxItem()
-            Case Keys.Enter
-                EditAuxItem()
-        End Select
-    End Sub
-
-    Private Sub EditAuxItem()
-        Dim SelItem As ListViewItem
-        Dim LV0 As ListViewItem
-
-        If LvAux.SelectedItems.Count = 0 Then Exit Sub
-
-        SelItem = LvAux.SelectedItems(0)
-
-        AuxDlog.VehPath = fPATH(VECTOfile)
-        AuxDlog.CbType.SelectedIndex = -1
-        AuxDlog.CbType.Text = SelItem.SubItems(1).Text
-        AuxDlog.TbID.Text = SelItem.SubItems(0).Text    'After Type-set!
-
-        If Cfg.DeclMode Then
-            AuxDlog.CbTech.Text = SelItem.SubItems(2).Text
-            AuxDlog.TbPath.Text = ""
-
-            If AuxDlog.TbID.Text = sKey.AUX.ElecSys Then
-                For Each LV0 In AuxDlog.LVTech.Items
-                    If EStechs.Contains(LV0.Text) Then
-                        LV0.Checked = True
-                    Else
-                        LV0.Checked = False
-                    End If
-                Next
-            End If
-
-        Else
-            AuxDlog.CbTech.SelectedIndex = -1
-            AuxDlog.TbPath.Text = SelItem.SubItems(2).Text
-        End If
-
-        If AuxDlog.ShowDialog = Windows.Forms.DialogResult.OK Then
-            SelItem.SubItems(0).Text = UCase(Trim(AuxDlog.TbID.Text))
-            SelItem.SubItems(1).Text = Trim(AuxDlog.CbType.Text)
-
-            If Cfg.DeclMode Then
-                SelItem.SubItems(2).Text = Trim(AuxDlog.CbTech.Text)
-            Else
-                SelItem.SubItems(2).Text = Trim(AuxDlog.TbPath.Text)
-            End If
-
-            If UCase(Trim(AuxDlog.TbID.Text)) = sKey.AUX.ElecSys Then
-                EStechs.Clear()
-                For Each LV0 In AuxDlog.LVTech.CheckedItems
-                    EStechs.Add(LV0.Text)
-                Next
-            End If
-
-            Change()
-
-        End If
-
-    End Sub
-
-    Private Sub RemoveAuxItem()
-        Dim i As Integer
-
-        If LvAux.SelectedItems.Count = 0 Then
-            If LvAux.Items.Count = 0 Then
-                Exit Sub
-            Else
-                LvAux.Items(LvAux.Items.Count - 1).Selected = True
-            End If
-        End If
-
-        i = LvAux.SelectedItems(0).Index
-
-        LvAux.SelectedItems(0).Remove()
-
-        If LvAux.Items.Count > 0 Then
-            If i < LvAux.Items.Count Then
-                LvAux.Items(i).Selected = True
-            Else
-                LvAux.Items(LvAux.Items.Count - 1).Selected = True
-            End If
-            LvAux.Focus()
-        End If
-
-        Change()
-
-    End Sub
-
-#End Region
-
-    'OK (Save & Close)
-    Private Sub ButSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOK.Click
-        If Not Save() Then Exit Sub
-        Me.Close()
-    End Sub
-
-    'Cancel
-    Private Sub ButCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButCancel.Click
-        Me.Close()
-    End Sub
-
-#Region "Cycle list"
-
-    Private Sub LvCycles_DoubleClick(sender As Object, e As System.EventArgs) Handles LvCycles.DoubleClick
-        If Me.LvCycles.SelectedItems.Count > 0 Then OpenFiles(fFileRepl(Me.LvCycles.SelectedItems(0).SubItems(0).Text, fPATH(VECTOfile)))
-    End Sub
-
-    Private Sub LvCycles_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles LvCycles.KeyDown
-        Select Case e.KeyCode
-            Case Keys.Delete, Keys.Back
-                RemoveCycle()
-            Case Keys.Enter
-                If Me.LvCycles.SelectedItems.Count > 0 Then Me.LvCycles.SelectedItems(0).BeginEdit()
-        End Select
-    End Sub
-
-
-    Private Sub BtDRIadd_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIadd.Click
-        Dim str As String
-        Dim GenDir As String
-
-        GenDir = fPATH(VECTOfile)
-
-        If fbDRI.OpenDialog("", True) Then
-
-            For Each str In fbDRI.Files
-                Me.LvCycles.Items.Add(fFileWoDir(str, GenDir))
-            Next
-
-            Change()
-
-        End If
-
-    End Sub
-
-    Private Sub BtDRIrem_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIrem.Click
-        RemoveCycle()
-    End Sub
-
-    Private Sub RemoveCycle()
-        Dim i As Integer
-
-        If LvCycles.SelectedItems.Count = 0 Then
-            If LvCycles.Items.Count = 0 Then
-                Exit Sub
-            Else
-                LvCycles.Items(LvCycles.Items.Count - 1).Selected = True
-            End If
-        End If
-
-        i = LvCycles.SelectedItems(0).Index
-
-        LvCycles.SelectedItems(0).Remove()
-
-        If LvCycles.Items.Count > 0 Then
-            If i < LvCycles.Items.Count Then
-                LvCycles.Items(i).Selected = True
-            Else
-                LvCycles.Items(LvCycles.Items.Count - 1).Selected = True
-            End If
-
-            LvCycles.Focus()
-        End If
-
-        Change()
-
-    End Sub
-
-#End Region
-
-#Region "Enable/Disable GUI controls"
-
-    'Engine only mode changed
-    Private Sub CbEngOnly_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CbEngOnly.CheckedChanged
-        CheckEngOnly()
-        Change()
-    End Sub
-
-    Private Sub CheckEngOnly()
-        Dim OnOff As Boolean
-
-        OnOff = Not CbEngOnly.Checked
-
-        SetDrivertab(OnOff)
-
-        ButOpenVEH.Enabled = OnOff
-        TbVEH.Enabled = OnOff
-        ButtonVEH.Enabled = OnOff
-        ButOpenGBX.Enabled = OnOff
-        TbGBX.Enabled = OnOff
-        ButtonGBX.Enabled = OnOff
-        GrAux.Enabled = OnOff
-
-    End Sub
-
-    'Start/Stop changed 
-    Private Sub ChBStartStop_CheckedChanged_1(sender As System.Object, e As System.EventArgs) Handles ChBStartStop.CheckedChanged
-        Change()
-        If Not Cfg.DeclMode Then Me.PnStartStop.Enabled = Me.ChBStartStop.Checked
-    End Sub
-
-    'LAC changed
-    Private Sub CbLookAhead_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CbLookAhead.CheckedChanged
-        Change()
-        Me.PnLookAhead.Enabled = CbLookAhead.Checked
-    End Sub
-
-    'EcoRoll / Overspeed changed
-    Private Sub RdOff_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RdOff.CheckedChanged, RdOverspeed.CheckedChanged, RdEcoRoll.CheckedChanged
-        Dim EcoR As Boolean
-        Dim Ovr As Boolean
-
-        Change()
-
-        EcoR = Me.RdEcoRoll.Checked
-        Ovr = Me.RdOverspeed.Checked
-
-        Me.TbOverspeed.Enabled = Ovr Or EcoR
-        Me.Label13.Enabled = Ovr Or EcoR
-        Me.Label14.Enabled = Ovr Or EcoR
-
-        Me.TbUnderSpeed.Enabled = EcoR
-        Me.Label22.Enabled = EcoR
-        Me.Label20.Enabled = EcoR
-
-        Me.TbVmin.Enabled = Ovr Or EcoR
-        Me.Label23.Enabled = Ovr Or EcoR
-        Me.Label21.Enabled = Ovr Or EcoR
-
-    End Sub
-
-#End Region
-
-    Public Sub UpdatePic()
-        Dim VEH0 As New cVEH
-        Dim ENG0 As cENG
-        Dim GBX0 As cGBX
-        Dim FLD0 As cFLD
-        Dim Shiftpoly As cGBX.cShiftPolygon
-        Dim MAP0 As cMAP
-        Dim OkCount As Integer
-        Dim i As Integer
-        Dim pmax As Single
-
-        Dim f As cFile_V3 = Nothing
-        Dim lM As List(Of Single)
-        Dim lup As List(Of Single)
-        Dim ldown As List(Of Single)
-        Dim line As String() = Nothing
-
-        Dim s0 As cSegmentTableEntry = Nothing
-        Dim HDVclass As String
-        Dim m0 As tMission
-
-        Dim MyChart As System.Windows.Forms.DataVisualization.Charting.Chart
-        Dim s As System.Windows.Forms.DataVisualization.Charting.Series
-        Dim a As System.Windows.Forms.DataVisualization.Charting.ChartArea
-        Dim img As Image
-
-        Me.TbHVCclass.Text = ""
-        Me.TbVehCat.Text = ""
-        Me.TbMass.Text = ""
-        Me.TbAxleConf.Text = ""
-        Me.TbEngTxt.Text = ""
-        Me.TbGbxTxt.Text = ""
-        Me.PicVehicle.Image = Nothing
-        Me.PicBox.Image = Nothing
-
-
-        VEH0.FilePath = fFileRepl(Me.TbVEH.Text, fPATH(VECTOfile))
-        If VEH0.ReadFile(False) Then
-
-            If Declaration.SegmentTable.SetRef(s0, VEH0.VehCat, VEH0.AxleConf, VEH0.MassMax) Then
-                HDVclass = s0.HDVclass
-
-                If Cfg.DeclMode Then
-                    Me.LvCycles.Items.Clear()
-                    For Each m0 In s0.Missions
-                        Me.LvCycles.Items.Add(Declaration.Missions(m0).NameStr)
-                    Next
-                End If
-
-            Else
-                HDVclass = "-"
-            End If
-
-            Me.PicVehicle.Image = Image.FromFile(Declaration.ConvPicPath(HDVclass, False))
-
-            Me.TbHVCclass.Text = "HDV Class " & HDVclass
-            Me.TbVehCat.Text = ConvVehCat(VEH0.VehCat, True)
-            Me.TbMass.Text = VEH0.MassMax & " t"
-            Me.TbAxleConf.Text = ConvAxleConf(VEH0.AxleConf)
-
-        End If
-
-
-        OkCount = 0
-
-        ENG0 = New cENG
-        ENG0.FilePath = fFileRepl(Me.TbENG.Text, fPATH(VECTOfile))
-
-        'Create plot
-        MyChart = New System.Windows.Forms.DataVisualization.Charting.Chart
-        MyChart.Width = Me.PicBox.Width
-        MyChart.Height = Me.PicBox.Height
-
-        a = New System.Windows.Forms.DataVisualization.Charting.ChartArea
-
-        If ENG0.ReadFile(False) Then
-
-            FLD0 = New cFLD
-
-            For i = 0 To ENG0.fFLD.Count - 1
-
-                FLD0.FilePath = ENG0.fFLD(i).FullPath
-                If FLD0.ReadFile(False) Then
-
-                    s = New System.Windows.Forms.DataVisualization.Charting.Series
-                    s.Points.DataBindXY(FLD0.LnU, FLD0.LTq)
-                    s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
-                    s.BorderWidth = 2
-                    s.Color = Color.DarkBlue
-                    s.Name = "Full load (" & fFILE(FLD0.FilePath, True) & ")"
-                    MyChart.Series.Add(s)
-
-                    s = New System.Windows.Forms.DataVisualization.Charting.Series
-                    s.Points.DataBindXY(FLD0.LnU, FLD0.LTqDrag)
-                    s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
-                    s.BorderWidth = 2
-                    s.Color = Color.Blue
-                    s.Name = "Motoring (" & fFILE(FLD0.FilePath, True) & ")"
-                    MyChart.Series.Add(s)
-
-                    If Cfg.DeclMode Then
-                        FLD0.Init(ENG0.Nidle)
-
-                        Shiftpoly = New cGBX.cShiftPolygon("", 0)
-                        Shiftpoly.SetGenericShiftPoly(FLD0, ENG0.Nidle)
-
-                        s = New System.Windows.Forms.DataVisualization.Charting.Series
-                        s.Points.DataBindXY(Shiftpoly.gs_nUup, Shiftpoly.gs_TqUp)
-                        s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
-                        s.BorderWidth = 2
-                        s.Color = Color.DarkRed
-                        s.Name = "Upshift curve"
-                        MyChart.Series.Add(s)
-
-                        s = New System.Windows.Forms.DataVisualization.Charting.Series
-                        s.Points.DataBindXY(Shiftpoly.gs_nUdown, Shiftpoly.gs_TqDown)
-                        s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
-                        s.BorderWidth = 2
-                        s.Color = Color.DarkRed
-                        s.Name = "Downshift curve"
-                        MyChart.Series.Add(s)
-
-                    End If
-
-                    OkCount += 1
-
-                    pmax = FLD0.Pfull(FLD0.fnUrated)
-
-
-                End If
-
-
-
-            Next
-
-            Me.TbEngTxt.Text = (ENG0.Displ / 1000).ToString("0.0") & " l " & pmax.ToString("#") & " kW  " & ENG0.ModelName
-
-
-            MAP0 = New cMAP
-            MAP0.FilePath = ENG0.PathMAP
-
-            If MAP0.ReadFile(False) Then
-
-                s = New System.Windows.Forms.DataVisualization.Charting.Series
-                s.Points.DataBindXY(MAP0.nU, MAP0.Tq)
-                s.ChartType = DataVisualization.Charting.SeriesChartType.Point
-                s.MarkerSize = 3
-                s.Color = Color.Red
-                s.Name = "Map"
-                MyChart.Series.Add(s)
-
-                OkCount += 1
-
-            End If
-
-        End If
-
-        GBX0 = New cGBX
-        GBX0.FilePath = fFileRepl(Me.TbGBX.Text, fPATH(VECTOfile))
-
-        If GBX0.ReadFile(False) Then
-
-            Me.TbGbxTxt.Text = GBX0.GearCount & "-Speed " & GearboxConv(GBX0.gs_Type) & "  " & GBX0.ModelName
-
-            If Not Cfg.DeclMode Then
-                f = New cFile_V3
-                For i = 0 To GBX0.GearCount - 1
-
-                    lM = New List(Of Single)
-                    lup = New List(Of Single)
-                    ldown = New List(Of Single)
-
-                    If f.OpenRead(GBX0.gsFile(i)) Then
-
-                        f.ReadLine()
-
-                        Try
-
-                            Do While Not f.EndOfFile
-                                line = f.ReadLine
-                                lM.Add(CSng(line(0)))
-                                lup.Add(CSng(line(1)))
-                                ldown.Add(CSng(line(2)))
-                            Loop
-
-                            s = New System.Windows.Forms.DataVisualization.Charting.Series
-                            s.Points.DataBindXY(lup, lM)
-                            s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
-                            s.BorderWidth = 2
-                            s.Color = Color.DarkRed
-                            s.Name = "Upshift curve"
-                            MyChart.Series.Add(s)
-
-                            s = New System.Windows.Forms.DataVisualization.Charting.Series
-                            s.Points.DataBindXY(ldown, lM)
-                            s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
-                            s.BorderWidth = 2
-                            s.Color = Color.DarkRed
-                            s.Name = "Downshift curve"
-                            MyChart.Series.Add(s)
-
-                            OkCount += 1
-
-                            f.Close()
-
-                        Catch ex As Exception
-                            f.Close()
-                        End Try
-
-                    End If
-
-                Next
-
-            End If
-
-        End If
-
-        If OkCount > 0 Then
-
-            a.Name = "main"
-
-            a.AxisX.Title = "engine speed [1/min]"
-            a.AxisX.TitleFont = New Font("Helvetica", 10)
-            a.AxisX.LabelStyle.Font = New Font("Helvetica", 8)
-            a.AxisX.LabelAutoFitStyle = DataVisualization.Charting.LabelAutoFitStyles.None
-            a.AxisX.MajorGrid.LineDashStyle = DataVisualization.Charting.ChartDashStyle.Dot
-
-            a.AxisY.Title = "engine torque [Nm]"
-            a.AxisY.TitleFont = New Font("Helvetica", 10)
-            a.AxisY.LabelStyle.Font = New Font("Helvetica", 8)
-            a.AxisY.LabelAutoFitStyle = DataVisualization.Charting.LabelAutoFitStyles.None
-            a.AxisY.MajorGrid.LineDashStyle = DataVisualization.Charting.ChartDashStyle.Dot
-
-            a.AxisX.Minimum = 300
-            a.BorderDashStyle = DataVisualization.Charting.ChartDashStyle.Solid
-            a.BorderWidth = 1
-
-            a.BackColor = Color.GhostWhite
-
-            MyChart.ChartAreas.Add(a)
-
-            MyChart.Update()
-
-            img = New Bitmap(MyChart.Width, MyChart.Height, Imaging.PixelFormat.Format32bppArgb)
-            MyChart.DrawToBitmap(img, New Rectangle(0, 0, Me.PicBox.Width, Me.PicBox.Height))
-
-            Me.PicBox.Image = img
-
-
-        End If
-
-    End Sub
-
-
-#Region "Open File Context Menu"
-
-    Private CmFiles As String()
-
-    Private Sub OpenFiles(ParamArray files() As String)
-
-        If files.Length = 0 Then Exit Sub
-
-        CmFiles = files
-
-        OpenWithToolStripMenuItem.Text = "Open with " & Cfg.OpenCmdName
-
-        CmOpenFile.Show(Cursor.Position)
-
-    End Sub
-
-    Private Sub OpenWithToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenWithToolStripMenuItem.Click
-        If Not FileOpenAlt(CmFiles(0)) Then MsgBox("Failed to open file!")
-    End Sub
-
-    Private Sub ShowInFolderToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ShowInFolderToolStripMenuItem.Click
-        If IO.File.Exists(CmFiles(0)) Then
-            Try
-                System.Diagnostics.Process.Start("explorer", "/select,""" & CmFiles(0) & "")
-            Catch ex As Exception
-                MsgBox("Failed to open file!")
-            End Try
-        Else
-            MsgBox("File not found!")
-        End If
-    End Sub
-
-#End Region
-
-
-
-End Class
+' Copyright 2014 European Union.
+' Licensed under the EUPL (the 'Licence');
+'
+' * You may not use this work except in compliance with the Licence.
+' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
+' * Unless required by applicable law or agreed to in writing,
+'   software distributed under the Licence is distributed on an "AS IS" basis,
+'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+'
+' See the LICENSE.txt for the specific language governing permissions and limitations.
+
+Imports System.Collections.Generic
+
+''' <summary>
+''' Job Editor. Create/Edit VECTO job files (.vecto)
+''' </summary>
+''' <remarks></remarks>
+Public Class F_VECTO
+
+    Private VECTOfile As String
+    Private Changed As Boolean = False
+    Private pgDriver As TabPage
+    Private pgDriverON As Boolean = True
+
+    Private AuxDlog As F_VEH_AuxDlog
+    Private EStechs As New List(Of String)
+
+    'TB:29/9/14 - New Fields associated with HVAC,PNeumatics as Electrical Systems *********************
+     Public ConsumerListES As List(Of VectoAuxiliaries.Electrics.ElectricalConsumer) = New List(Of VectoAuxiliaries.Electrics.ElectricalConsumer)()
+     Public PulleyGearEfficiencyES As Single
+     Public PulleyGearRatioES As Single
+
+     Public ConsumerListPS As List(Of VectoAuxiliaries.Pneumatics.PneumaticConsumer) = New List(Of VectoAuxiliaries.Pneumatics.PneumaticConsumer)()
+     Public PulleyGearEfficiencyPS As Single
+     Public PulleyGearRatioPS As Single
+
+     Public HVACMapInputs As Dictionary(Of String, Single) = New Dictionary(Of String, Single)()
+     Public PulleyGearEfficiencyHVAC As Single
+     Public PulleyGearRatioHVAC As Single
+
+    '**************************************************************************************************
+
+    'Initialise form
+    Private Sub F02_GEN_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+        Dim x As Int16
+
+        AuxDlog = New F_VEH_AuxDlog
+
+        pgDriver = Me.TabPgDriver
+
+        For x = 0 To Me.TabControl1.TabCount - 1
+            Me.TabControl1.TabPages(x).Show()
+        Next
+
+        Me.LvAux.Columns(2).Width = -2
+
+        'Declaration Mode
+        If Cfg.DeclMode Then
+            Me.LvAux.Columns(2).Text = "Technology"
+        Else
+            Me.LvAux.Columns(2).Text = "Input File"
+        End If
+
+        Me.CbEngOnly.Enabled = Not Cfg.DeclMode
+        Me.GrCycles.Enabled = Not Cfg.DeclMode
+        Me.GrVACC.Enabled = Not Cfg.DeclMode
+        Me.PnStartStop.Enabled = Not Cfg.DeclMode
+        Me.RdOff.Enabled = Not Cfg.DeclMode
+        Me.GrLAC.Enabled = Not Cfg.DeclMode
+        Me.ButAuxAdd.Enabled = Not Cfg.DeclMode
+        Me.ButAuxRem.Enabled = Not Cfg.DeclMode
+        Me.PnEcoRoll.Enabled = Not Cfg.DeclMode
+
+        Changed = False
+
+    End Sub
+
+    'Close - Check for unsaved changes
+    Private Sub F02_GEN_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
+        If e.CloseReason <> CloseReason.ApplicationExitCall And e.CloseReason <> CloseReason.WindowsShutDown Then
+            e.Cancel = ChangeCheckCancel()
+        End If
+    End Sub
+
+    'Set generic values for Declaration mode
+    Private Sub DeclInit()
+        Dim LV0 As ListViewItem
+
+        If Not Cfg.DeclMode Then Exit Sub
+
+        Me.LvCycles.Items.Clear()
+        Me.CbEngOnly.Checked = False
+        Me.TbDesMaxFile.Text = ""
+        If Not Me.RdEcoRoll.Checked Then Me.RdOverspeed.Checked = True
+        Me.CbLookAhead.Checked = True
+
+        Me.TbSSspeed.Text = cDeclaration.SSspeed
+        Me.TbSStime.Text = cDeclaration.SStime
+        Me.TbSSdelay.Text = cDeclaration.SSdelay
+        Me.TbAlookahead.Text = cDeclaration.LACa
+        Me.TbVminLA.Text = cDeclaration.LACvmin
+
+        Me.TbOverspeed.Text = cDeclaration.Overspeed
+        Me.TbUnderSpeed.Text = cDeclaration.Underspeed
+        Me.TbVmin.Text = cDeclaration.ECvmin
+
+
+        'TB 29/9/14 - Note on existing code. 
+        'This sets Up Default Values for Aux Type is exactly the right numbers of them and their ID's are not in the list. these dont seem to need to be added by the user I guess.
+        If LvAux.Items.Count <> 5 OrElse (Me.LvAux.Items(0).Text <> sKey.AUX.Fan OrElse Me.LvAux.Items(1).Text <> sKey.AUX.SteerPump OrElse Me.LvAux.Items(2).Text <> sKey.AUX.HVAC OrElse Me.LvAux.Items(3).Text <> sKey.AUX.ElecSys OrElse Me.LvAux.Items(4).Text <> sKey.AUX.PneumSys) Then
+            Me.LvAux.Items.Clear()
+
+            LV0 = New ListViewItem(sKey.AUX.Fan)
+            LV0.SubItems.Add("Fan")
+            If Declaration.AuxTechs(tAux.Fan).Count > 1 Then
+                LV0.SubItems.Add("")
+            Else
+                LV0.SubItems.Add(Declaration.AuxTechs(tAux.Fan)(0))
+            End If
+            Me.LvAux.Items.Add(LV0)
+
+            LV0 = New ListViewItem(sKey.AUX.SteerPump)
+            LV0.SubItems.Add("Steering pump")
+            If Declaration.AuxTechs(tAux.SteerPump).Count > 1 Then
+                LV0.SubItems.Add("")
+            Else
+                LV0.SubItems.Add(Declaration.AuxTechs(tAux.SteerPump)(0))
+            End If
+            Me.LvAux.Items.Add(LV0)
+
+            LV0 = New ListViewItem(sKey.AUX.HVAC)
+            LV0.SubItems.Add("HVAC")
+            If Declaration.AuxTechs(tAux.HVAC).Count > 1 Then
+                LV0.SubItems.Add("")
+            Else
+                LV0.SubItems.Add(Declaration.AuxTechs(tAux.HVAC)(0))
+            End If
+            Me.LvAux.Items.Add(LV0)
+
+            LV0 = New ListViewItem(sKey.AUX.ElecSys)
+            LV0.SubItems.Add("Electric System")
+            If Declaration.AuxTechs(tAux.ElectricSys).Count > 1 Then
+                LV0.SubItems.Add("")
+            Else
+                LV0.SubItems.Add(Declaration.AuxTechs(tAux.ElectricSys)(0))
+            End If
+            Me.LvAux.Items.Add(LV0)
+
+            LV0 = New ListViewItem(sKey.AUX.PneumSys)
+            LV0.SubItems.Add("Pneumatic System")
+            If Declaration.AuxTechs(tAux.PneumSys).Count > 1 Then
+                LV0.SubItems.Add("")
+            Else
+                LV0.SubItems.Add(Declaration.AuxTechs(tAux.PneumSys)(0))
+            End If
+            Me.LvAux.Items.Add(LV0)
+
+
+
+        End If
+
+
+    End Sub
+
+
+    'Show/Hide "Driver Assist" Tab
+    Private Sub SetDrivertab(ByVal OnOff As Boolean)
+        If OnOff Then
+            If Not pgDriverON Then
+                pgDriverON = True
+                Me.TabControl1.TabPages.Insert(1, pgDriver)
+            End If
+        Else
+            If pgDriverON Then
+                pgDriverON = False
+                Me.TabControl1.Controls.Remove(pgDriver)
+            End If
+        End If
+    End Sub
+    'This is just a test comment. TODO: REMOVE IT
+
+#Region "Browse Buttons"
+
+    Private Sub ButtonVEH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonVEH.Click
+        If fbVEH.OpenDialog(fFileRepl(Me.TbVEH.Text, fPATH(VECTOfile))) Then Me.TbVEH.Text = fFileWoDir(fbVEH.Files(0), fPATH(VECTOfile))
+    End Sub
+
+    Private Sub ButtonMAP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonMAP.Click
+        If fbENG.OpenDialog(fFileRepl(Me.TbENG.Text, fPATH(VECTOfile))) Then Me.TbENG.Text = fFileWoDir(fbENG.Files(0), fPATH(VECTOfile))
+    End Sub
+
+    Private Sub ButtonGBX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGBX.Click
+        If fbGBX.OpenDialog(fFileRepl(Me.TbGBX.Text, fPATH(VECTOfile))) Then Me.TbGBX.Text = fFileWoDir(fbGBX.Files(0), fPATH(VECTOfile))
+    End Sub
+
+    Private Sub BtDesMaxBr_Click_1(sender As System.Object, e As System.EventArgs) Handles BtDesMaxBr.Click
+        If fbACC.OpenDialog(fFileRepl(Me.TbDesMaxFile.Text, fPATH(VECTOfile))) Then Me.TbDesMaxFile.Text = fFileWoDir(fbACC.Files(0), fPATH(VECTOfile))
+    End Sub
+
+    Private Sub BtAccOpen_Click(sender As System.Object, e As System.EventArgs) Handles BtAccOpen.Click
+        OpenFiles(fFileRepl(Me.TbDesMaxFile.Text, fPATH(VECTOfile)))
+    End Sub
+
+#End Region
+
+#Region "Open Buttons"
+
+    'Open Vehicle Editor
+    Private Sub ButOpenVEH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenVEH.Click
+        Dim f As String
+        f = fFileRepl(TbVEH.Text, fPATH(VECTOfile))
+
+        'Thus Veh-file is returned
+        F_VEH.JobDir = fPATH(VECTOfile)
+        F_VEH.AutoSendTo = True
+
+        If Not Trim(f) = "" Then
+            If Not IO.File.Exists(f) Then
+                MsgBox("File not found!")
+                Exit Sub
+            End If
+        End If
+
+        If Not F_VEH.Visible Then
+            F_VEH.Show()
+        Else
+            If F_VEH.WindowState = FormWindowState.Minimized Then F_VEH.WindowState = FormWindowState.Normal
+            F_VEH.BringToFront()
+        End If
+
+        If Not Trim(f) = "" Then F_VEH.openVEH(f)
+
+    End Sub
+
+    'Open Engine Editor
+    Private Sub ButOpenENG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenENG.Click
+        Dim f As String
+        f = fFileRepl(TbENG.Text, fPATH(VECTOfile))
+
+        'Thus Veh-file is returned
+        F_ENG.JobDir = fPATH(VECTOfile)
+        F_ENG.AutoSendTo = True
+
+        If Not Trim(f) = "" Then
+            If Not IO.File.Exists(f) Then
+                MsgBox("File not found!")
+                Exit Sub
+            End If
+        End If
+
+        If Not F_ENG.Visible Then
+            F_ENG.Show()
+        Else
+            If F_ENG.WindowState = FormWindowState.Minimized Then F_ENG.WindowState = FormWindowState.Normal
+            F_ENG.BringToFront()
+        End If
+
+        If Not Trim(f) = "" Then F_ENG.openENG(f)
+
+    End Sub
+
+    'Open Gearbox Editor
+    Private Sub ButOpenGBX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenGBX.Click
+        Dim f As String
+        f = fFileRepl(TbGBX.Text, fPATH(VECTOfile))
+
+        'Thus Veh-file is returned
+        F_GBX.JobDir = fPATH(VECTOfile)
+        F_GBX.AutoSendTo = True
+
+        If Not Trim(f) = "" Then
+            If Not IO.File.Exists(f) Then
+                MsgBox("File not found!")
+                Exit Sub
+            End If
+        End If
+
+        If Not F_GBX.Visible Then
+            F_GBX.Show()
+        Else
+            If F_GBX.WindowState = FormWindowState.Minimized Then F_GBX.WindowState = FormWindowState.Normal
+            F_GBX.BringToFront()
+        End If
+
+        If Not Trim(f) = "" Then F_GBX.openGBX(f)
+
+    End Sub
+
+#End Region
+
+#Region "Toolbar"
+
+    'New
+    Private Sub ToolStripBtNew_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtNew.Click
+        VECTOnew()
+    End Sub
+
+    'Open
+    Private Sub ToolStripBtOpen_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtOpen.Click
+        If fbVECTO.OpenDialog(VECTOfile, False, "vecto") Then VECTOload2Form(fbVECTO.Files(0))
+    End Sub
+
+    'Save
+    Private Sub ToolStripBtSave_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtSave.Click
+        Save()
+    End Sub
+
+    'Save As
+    Private Sub ToolStripBtSaveAs_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtSaveAs.Click
+        If fbVECTO.SaveDialog(VECTOfile) Then Call VECTOsave(fbVECTO.Files(0))
+    End Sub
+
+    'Send to Job file list in main form
+    Private Sub ToolStripBtSendTo_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripBtSendTo.Click
+        If ChangeCheckCancel() Then Exit Sub
+        If VECTOfile = "" Then
+            MsgBox("File not found!" & ChrW(10) & ChrW(10) & "Save file and try again.")
+        Else
+            F_MAINForm.AddToJobListView(VECTOfile)
+        End If
+    End Sub
+
+    'Help
+    Private Sub ToolStripButton1_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripButton1.Click
+        If IO.File.Exists(MyAppPath & "User Manual\GUI\GUI_Calls\VECTO.html") Then
+            System.Diagnostics.Process.Start(MyAppPath & "User Manual\GUI\GUI_Calls\VECTO.html")
+        Else
+            MsgBox("User Manual not found!", MsgBoxStyle.Critical)
+        End If
+    End Sub
+
+
+#End Region
+
+    'Save ("Save" or "Save As" when new file)
+    Private Function Save() As Boolean
+        If VECTOfile = "" Then
+            If fbVECTO.SaveDialog("") Then
+                VECTOfile = fbVECTO.Files(0)
+            Else
+                Return False
+            End If
+        End If
+        Return VECTOsave(VECTOfile)
+    End Function
+
+    'Open file
+    Public Sub VECTOload2Form(ByVal file As String)
+        Dim x As Int16
+        Dim VEC0 As cVECTO
+        Dim AuxEntryKV As KeyValuePair(Of String, cAuxEntry)
+        Dim LV0 As ListViewItem
+        Dim sb As cSubPath
+
+        If ChangeCheckCancel() Then Exit Sub
+
+        VECTOnew()
+
+        'Read GEN
+        VEC0 = New cVECTO
+        VEC0.FilePath = file
+        Try
+            If Not VEC0.ReadFile() Then
+                VEC0 = Nothing
+                MsgBox("Failed to load " & fFILE(file, True) & "!")
+                Exit Sub
+            End If
+        Catch ex As Exception
+            MsgBox("Failed to load " & fFILE(file, True) & "!")
+            Exit Sub
+        End Try
+
+        If Cfg.DeclMode <> VEC0.SavedInDeclMode Then
+            Select Case WrongMode()
+                Case 1
+                    Me.Close()
+                    F_MAINForm.RbDecl.Checked = Not F_MAINForm.RbDecl.Checked
+                    F_MAINForm.OpenVectoFile(file)
+                Case -1
+                    Exit Sub
+                Case Else '0
+                    'Continue...
+            End Select
+        End If
+
+
+        'Update Form
+
+        'Files -----------------------------
+        TbVEH.Text = VEC0.PathVEH(True)
+        TbENG.Text = VEC0.PathENG(True)
+        TbGBX.Text = VEC0.PathGBX(True)
+
+        'Start/Stop
+        Me.ChBStartStop.Checked = VEC0.StartStop
+        Me.TbSSspeed.Text = VEC0.StStV
+        Me.TbSStime.Text = VEC0.StStT
+        Me.TbSSdelay.Text = VEC0.StStDelay
+
+        'VACC
+        Me.TbDesMaxFile.Text = VEC0.DesMaxFile(True)
+
+
+
+
+        Me.LvAux.Items.Clear()
+        For Each AuxEntryKV In VEC0.AuxPaths
+            LV0 = New ListViewItem
+            LV0.SubItems(0).Text = AuxEntryKV.Key
+            LV0.SubItems.Add(AuxEntryKV.Value.Type)
+            If Cfg.DeclMode Then
+                LV0.SubItems.Add(AuxEntryKV.Value.TechStr)
+
+                'TB 29/9/2014 - TODO: Need to work out what to do about Declaration mode for the augmentations.
+
+            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.
+
+
+
+
+            End If
+            LvAux.Items.Add(LV0)
+        Next
+
+        EStechs = VEC0.EStechs
+
+        For Each sb In VEC0.CycleFiles
+            LV0 = New ListViewItem
+            LV0.Text = sb.OriginalPath
+            LvCycles.Items.Add(LV0)
+        Next
+
+        Me.CbEngOnly.Checked = VEC0.EngOnly
+
+        If VEC0.EcoRollOn Then
+            Me.RdEcoRoll.Checked = True
+        ElseIf VEC0.OverSpeedOn Then
+            Me.RdOverspeed.Checked = True
+        Else
+            Me.RdOff.Checked = True
+        End If
+        Me.TbOverspeed.Text = CStr(VEC0.OverSpeed)
+        Me.TbUnderSpeed.Text = CStr(VEC0.UnderSpeed)
+        Me.TbVmin.Text = CStr(VEC0.vMin)
+        Me.CbLookAhead.Checked = VEC0.LookAheadOn
+        Me.TbAlookahead.Text = CStr(VEC0.a_lookahead)
+        Me.TbVminLA.Text = CStr(VEC0.vMinLA)
+
+
+        '-------------------------------------------------------------
+
+        DeclInit()
+
+
+        F_ENG.AutoSendTo = False
+        F_GBX.AutoSendTo = False
+        F_VEH.AutoSendTo = False
+
+
+        VECTOfile = file
+
+        x = Len(file)
+        While Mid(file, x, 1) <> "\" And x > 0
+            x = x - 1
+        End While
+        Me.Text = Mid(file, x + 1, Len(file) - x)
+        Changed = False
+        Me.ToolStripStatusLabelGEN.Text = ""    'file & " opened."
+
+        UpdatePic()
+
+        '-------------------------------------------------------------
+
+    End Sub
+
+    'Save file
+    Private Function VECTOsave(ByVal file As String) As Boolean
+
+        Dim VEC0 As cVECTO
+        Dim AuxEntry As cAuxEntry
+        Dim LV0 As ListViewItem
+        Dim sb As cSubPath
+
+        VEC0 = New cVECTO
+        VEC0.FilePath = file
+
+        'Files ------------------------------------------------- -----------------
+
+        VEC0.PathVEH = Me.TbVEH.Text
+        VEC0.PathENG = Me.TbENG.Text
+
+        For Each LV0 In LvCycles.Items
+            sb = New cSubPath
+            sb.Init(fPATH(file), LV0.Text)
+            VEC0.CycleFiles.Add(sb)
+        Next
+
+        VEC0.PathGBX = Me.TbGBX.Text
+
+
+        'Start/Stop
+        VEC0.StartStop = Me.ChBStartStop.Checked
+        VEC0.StStV = CSng(fTextboxToNumString(Me.TbSSspeed.Text))
+        VEC0.StStT = CSng(fTextboxToNumString(Me.TbSStime.Text))
+        VEC0.StStDelay = CInt(fTextboxToNumString(Me.TbSSdelay.Text))
+
+        'a_DesMax
+        VEC0.DesMaxFile = Me.TbDesMaxFile.Text
+
+        'TB 29/9/2014 - Here is where we assemble the cAuxEntry instances for addition
+        For Each LV0 In LvAux.Items
+            AuxEntry = New cAuxEntry
+
+            If Cfg.DeclMode Then
+                AuxEntry.TechStr = LV0.SubItems(2).Text
+
+                'TB: 29/9/2014 - TODO: Need to know how to set Declaration Mode Values for this stuff here.
+
+
+            Else
+                AuxEntry.Path.Init(fPATH(file), LV0.SubItems(2).Text)
+
+                'Engineering Mode.
+                'Detect which system we are currently addressing.
+
+                Select Case LV0.SubItems(0).Text
+
+                   Case sKey.AUX.HVAC
+                   AuxEntry.HVACMapInputs = Me.HVACMapInputs
+                   AuxEntry.PulleyGearEfficiencyHVAC = Me.PulleyGearEfficiencyHVAC
+                   AuxEntry.PulleyGearRatioHVAC = Me.PulleyGearRatioHVAC
+
+                   Case sKey.AUX.ElecSys
+                   AuxEntry.ConsumerListES = Me.ConsumerListES
+                   AuxEntry.PulleyGearEfficiencyES = Me.PulleyGearEfficiencyES
+                   AuxEntry.PulleyGearRatioES = Me.PulleyGearRatioES
+
+                   Case sKey.AUX.PneumSys
+                   AuxEntry.ConsumerListPS = Me.ConsumerListPS
+                   AuxEntry.PulleyGearEfficiencyPS = Me.PulleyGearEfficiencyPS
+                   AuxEntry.PulleyGearRatioPS = Me.PulleyGearRatioPS
+
+                End Select
+
+
+
+            End If
+
+            AuxEntry.Type = LV0.SubItems(1).Text
+            VEC0.AuxPaths.Add(LV0.SubItems(0).Text, AuxEntry)
+
+
+        Next
+
+        VEC0.EStechs = EStechs
+
+
+        VEC0.EngOnly = Me.CbEngOnly.Checked
+
+        VEC0.EcoRollOn = RdEcoRoll.Checked
+        VEC0.OverSpeedOn = RdOverspeed.Checked
+        VEC0.OverSpeed = CSng(fTextboxToNumString(Me.TbOverspeed.Text))
+        VEC0.UnderSpeed = CSng(fTextboxToNumString(Me.TbUnderSpeed.Text))
+        VEC0.vMin = CSng(fTextboxToNumString(Me.TbVmin.Text))
+        VEC0.LookAheadOn = Me.CbLookAhead.Checked
+        VEC0.a_lookahead = CSng(fTextboxToNumString(Me.TbAlookahead.Text))
+        VEC0.vMinLA = CSng(fTextboxToNumString(Me.TbVminLA.Text))
+
+
+        '------------------------------------------------------------
+
+        'SAVE
+        If Not VEC0.SaveFile Then
+            MsgBox("Cannot safe to " & file, MsgBoxStyle.Critical)
+            Return False
+        End If
+
+        VECTOfile = file
+
+        file = fFILE(VECTOfile, True)
+
+        Me.Text = file
+
+        Me.ToolStripStatusLabelGEN.Text = ""
+
+        F_MAINForm.AddToJobListView(VECTOfile)
+
+        Changed = False
+
+        Return True
+
+    End Function
+
+    'New file
+    Public Sub VECTOnew()
+
+        If ChangeCheckCancel() Then Exit Sub
+
+        'Files
+        Me.TbVEH.Text = ""
+        Me.TbENG.Text = ""
+        Me.LvCycles.Items.Clear()
+        Me.TbGBX.Text = ""
+        Me.TbDesMaxFile.Text = ""
+
+        'Start/Stop
+        Me.TbSSspeed.Text = "5"
+        Me.TbSStime.Text = "5"
+        Me.ChBStartStop.Checked = False
+
+        Me.LvAux.Items.Clear()
+
+        Me.CbEngOnly.Checked = False
+
+        Me.RdOff.Checked = True
+        Me.CbLookAhead.Checked = True
+        Me.TbAlookahead.Text = "-0.5"
+        Me.TbOverspeed.Text = ""
+        Me.TbUnderSpeed.Text = ""
+        Me.TbVmin.Text = ""
+        Me.TbVminLA.Text = "50"
+
+        '---------------------------------------------------
+
+        DeclInit()
+
+        F_ENG.AutoSendTo = False
+
+        VECTOfile = ""
+        Me.Text = "Job Editor"
+        Me.ToolStripStatusLabelGEN.Text = ""
+        Changed = False
+        UpdatePic()
+
+    End Sub
+
+
+#Region "Track changes"
+
+#Region "'Change' Events"
+
+    Private Sub TextBoxVEH_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbVEH.TextChanged
+        UpdatePic()
+        Change()
+    End Sub
+    Private Sub TextBoxMAP_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbENG.TextChanged
+        UpdatePic()
+        Change()
+    End Sub
+
+    Private Sub TextBoxFLD_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbGBX.TextChanged
+        UpdatePic()
+        Change()
+    End Sub
+
+    Private Sub TbDesMaxFile_TextChanged_1(sender As System.Object, e As System.EventArgs) Handles TbDesMaxFile.TextChanged
+        Change()
+    End Sub
+
+
+    Private Sub TBSSspeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbSSspeed.TextChanged
+        Change()
+    End Sub
+
+    Private Sub TBSStime_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbSStime.TextChanged, TbSSdelay.TextChanged
+        Change()
+    End Sub
+
+    Private Sub TbOverspeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbOverspeed.TextChanged
+        Change()
+    End Sub
+
+    Private Sub TbUnderSpeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbUnderSpeed.TextChanged
+        Change()
+    End Sub
+
+    Private Sub TbVmin_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbVmin.TextChanged, TbVminLA.TextChanged
+        Change()
+    End Sub
+
+    Private Sub TbAlookahead_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbAlookahead.TextChanged
+        Change()
+    End Sub
+
+    Private Sub LvCycles_AfterLabelEdit(sender As Object, e As System.Windows.Forms.LabelEditEventArgs) Handles LvCycles.AfterLabelEdit
+        Change()
+    End Sub
+
+
+#End Region
+
+    Private Sub Change()
+        If Not Changed Then
+            Me.ToolStripStatusLabelGEN.Text = "Unsaved changes in current file"
+            Changed = True
+        End If
+    End Sub
+
+    ' "Save changes? "... Returns True if User aborts
+    Private Function ChangeCheckCancel() As Boolean
+
+        If Changed Then
+
+            Select Case MsgBox("Save changes ?", MsgBoxStyle.YesNoCancel)
+                Case MsgBoxResult.Yes
+                    Return Not Save()
+                Case MsgBoxResult.Cancel
+                    Return True
+                Case Else 'MsgBoxResult.No
+                    Changed = False
+                    Return False
+            End Select
+
+        Else
+
+            Return False
+
+        End If
+
+    End Function
+
+#End Region
+
+#Region "Aux Listview"
+
+    Private Sub ButAuxAdd_Click(sender As System.Object, e As System.EventArgs) Handles ButAuxAdd.Click
+        Dim LV0 As ListViewItem
+        Dim ID As String
+
+        AuxDlog.ClearAllValues(True)
+        AuxDlog.VehPath = fPATH(VECTOfile)
+
+
+lbDlog:
+        If AuxDlog.ShowDialog = Windows.Forms.DialogResult.OK Then
+
+            ID = UCase(Trim(AuxDlog.TbID.Text))
+
+            For Each LV0 In LvAux.Items
+                If LV0.SubItems(0).Text = ID Then
+                    MsgBox("ID '" & ID & "' already defined!", MsgBoxStyle.Critical)
+                    AuxDlog.TbID.SelectAll()
+                    AuxDlog.TbID.Focus()
+                    GoTo lbDlog
+                End If
+            Next
+
+            LV0 = New ListViewItem
+            LV0.SubItems(0).Text = UCase(Trim(AuxDlog.TbID.Text))
+            LV0.SubItems.Add(Trim(AuxDlog.CbType.Text))
+            LV0.SubItems.Add(Trim(AuxDlog.TbPath.Text))
+
+            LvAux.Items.Add(LV0)
+
+            If ID = sKey.AUX.ElecSys Then
+                EStechs.Clear()
+                For Each LV0 In AuxDlog.LVTech.CheckedItems
+                    EStechs.Add(LV0.Text)
+                Next
+            End If
+
+            Change()
+
+        End If
+
+    End Sub
+
+    Private Sub ButAuxRem_Click(sender As System.Object, e As System.EventArgs) Handles ButAuxRem.Click
+        RemoveAuxItem()
+    End Sub
+
+    Private Sub LvAux_DoubleClick(sender As Object, e As System.EventArgs) Handles LvAux.DoubleClick
+        EditAuxItem()
+    End Sub
+
+    Private Sub LvAux_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles LvAux.KeyDown
+        Select Case e.KeyCode
+            Case Keys.Delete, Keys.Back
+                If Not Cfg.DeclMode Then RemoveAuxItem()
+            Case Keys.Enter
+                EditAuxItem()
+        End Select
+    End Sub
+
+    Private Sub EditAuxItem()
+        Dim SelItem As ListViewItem
+        Dim LV0 As ListViewItem
+
+        If LvAux.SelectedItems.Count = 0 Then Exit Sub
+
+        SelItem = LvAux.SelectedItems(0)
+
+        AuxDlog.VehPath = fPATH(VECTOfile)
+
+        AuxDlog.CbType.Text = SelItem.SubItems(1).Text
+        AuxDlog.TbID.Text = SelItem.SubItems(0).Text    'After Type-set!
+
+        If Cfg.DeclMode Then
+            AuxDlog.CbTech.Text = SelItem.SubItems(2).Text
+            AuxDlog.TbPath.Text = ""
+
+            If AuxDlog.TbID.Text = sKey.AUX.ElecSys Then
+                For Each LV0 In AuxDlog.LVTech.Items
+                    If EStechs.Contains(LV0.Text) Then
+                        LV0.Checked = True
+                    Else
+                        LV0.Checked = False
+                    End If
+                Next
+            End If
+
+        Else
+            AuxDlog.CbTech.SelectedIndex = -1
+            AuxDlog.TbPath.Text = SelItem.SubItems(2).Text
+        End If
+
+        If AuxDlog.ShowDialog = Windows.Forms.DialogResult.OK Then
+
+'Set New Systems Properties
+
+
+        Select Case AuxDlog.TbID.Text
+
+            '**** ELECTRICS ****
+            Case sKey.AUX.ElecSys.ToString()
+             For Each item As KeyValuePair(Of String, Single) In AuxDlog.ListItems
+               ConsumerListES.Add(New VectoAuxiliaries.Electrics.ElectricalConsumer(item.Key, item.Value))
+             Next
+
+            PulleyGearEfficiencyES = CType(AuxDlog.txtPulleyGearEfficiency.Text, Single)
+            PulleyGearRatioES = CType(AuxDlog.txtPulleyGearRatio.Text, Single)
+
+            '============================================================================================
+
+            '**** PNEUMATICS ****
+            Case sKey.AUX.PneumSys.ToString()
+             For Each item As KeyValuePair(Of String, Single) In AuxDlog.ListItems
+               ConsumerListPS.Add(New VectoAuxiliaries.Pneumatics.PneumaticConsumer(item.Key, item.Value))
+             Next
+            '------Get Pully Values
+            PulleyGearEfficiencyPS = CType(AuxDlog.txtPulleyGearEfficiency.Text, Single)
+            PulleyGearRatioPS = CType(AuxDlog.txtPulleyGearRatio.Text, Single)
+
+            '============================================================================================
+
+            '**** HVAC ****
+            Case sKey.AUX.HVAC.ToString()
+
+            '----- Get list of MAP Inputs
+            For Each item As KeyValuePair(Of String, Single) In AuxDlog.ListItems
+             HVACMapInputs.Add(item.Key, item.Value)
+            Next
+
+            '------Get Pully Values
+            PulleyGearEfficiencyHVAC = CType(AuxDlog.txtPulleyGearEfficiency.Text, Single)
+            PulleyGearRatioHVAC = CType(AuxDlog.txtPulleyGearRatio.Text, Single)
+
+            '============================================================================================
+
+        End Select
+
+
+
+            SelItem.SubItems(0).Text = UCase(Trim(AuxDlog.TbID.Text))
+            SelItem.SubItems(1).Text = Trim(AuxDlog.CbType.Text)
+
+            If Cfg.DeclMode Then
+                SelItem.SubItems(2).Text = Trim(AuxDlog.CbTech.Text)
+            Else
+                SelItem.SubItems(2).Text = Trim(AuxDlog.TbPath.Text)
+            End If
+
+            If UCase(Trim(AuxDlog.TbID.Text)) = sKey.AUX.ElecSys Then
+                EStechs.Clear()
+                For Each LV0 In AuxDlog.LVTech.CheckedItems
+                    EStechs.Add(LV0.Text)
+                Next
+            End If
+
+            Change()
+
+        End If
+
+    End Sub
+
+    Private Sub RemoveAuxItem()
+        Dim i As Integer
+
+        If LvAux.SelectedItems.Count = 0 Then
+            If LvAux.Items.Count = 0 Then
+                Exit Sub
+            Else
+                LvAux.Items(LvAux.Items.Count - 1).Selected = True
+            End If
+        End If
+
+        i = LvAux.SelectedItems(0).Index
+
+        LvAux.SelectedItems(0).Remove()
+
+        If LvAux.Items.Count > 0 Then
+            If i < LvAux.Items.Count Then
+                LvAux.Items(i).Selected = True
+            Else
+                LvAux.Items(LvAux.Items.Count - 1).Selected = True
+            End If
+            LvAux.Focus()
+        End If
+
+        Change()
+
+    End Sub
+
+#End Region
+
+    'OK (Save & Close)
+    Private Sub ButSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOK.Click
+        If Not Save() Then Exit Sub
+        Me.Close()
+    End Sub
+
+    'Cancel
+    Private Sub ButCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButCancel.Click
+        Me.Close()
+    End Sub
+
+
+
+#Region "Enable/Disable GUI controls"
+
+    'Engine only mode changed
+    Private Sub CbEngOnly_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CbEngOnly.CheckedChanged
+        CheckEngOnly()
+        Change()
+    End Sub
+
+    Private Sub CheckEngOnly()
+        Dim OnOff As Boolean
+
+        OnOff = Not CbEngOnly.Checked
+
+        SetDrivertab(OnOff)
+
+        ButOpenVEH.Enabled = OnOff
+        TbVEH.Enabled = OnOff
+        ButtonVEH.Enabled = OnOff
+        ButOpenGBX.Enabled = OnOff
+        TbGBX.Enabled = OnOff
+        ButtonGBX.Enabled = OnOff
+        GrAux.Enabled = OnOff
+
+    End Sub
+
+    'Start/Stop changed 
+    Private Sub ChBStartStop_CheckedChanged_1(sender As System.Object, e As System.EventArgs) Handles ChBStartStop.CheckedChanged
+        Change()
+        If Not Cfg.DeclMode Then Me.PnStartStop.Enabled = Me.ChBStartStop.Checked
+    End Sub
+
+    'LAC changed
+    Private Sub CbLookAhead_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CbLookAhead.CheckedChanged
+        Change()
+        Me.PnLookAhead.Enabled = CbLookAhead.Checked
+    End Sub
+
+    'EcoRoll / Overspeed changed
+    Private Sub RdOff_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RdOff.CheckedChanged, RdOverspeed.CheckedChanged, RdEcoRoll.CheckedChanged
+        Dim EcoR As Boolean
+        Dim Ovr As Boolean
+
+        Change()
+
+        EcoR = Me.RdEcoRoll.Checked
+        Ovr = Me.RdOverspeed.Checked
+
+        Me.TbOverspeed.Enabled = Ovr Or EcoR
+        Me.Label13.Enabled = Ovr Or EcoR
+        Me.Label14.Enabled = Ovr Or EcoR
+
+        Me.TbUnderSpeed.Enabled = EcoR
+        Me.Label22.Enabled = EcoR
+        Me.Label20.Enabled = EcoR
+
+        Me.TbVmin.Enabled = Ovr Or EcoR
+        Me.Label23.Enabled = Ovr Or EcoR
+        Me.Label21.Enabled = Ovr Or EcoR
+
+    End Sub
+
+#End Region
+
+Public Sub UpdatePic()
+        Dim VEH0 As New cVEH
+        Dim ENG0 As cENG
+        Dim GBX0 As cGBX
+        Dim FLD0 As cFLD
+        Dim Shiftpoly As cGBX.cShiftPolygon
+        Dim MAP0 As cMAP
+        Dim OkCount As Integer
+        Dim i As Integer
+        Dim pmax As Single
+
+        Dim f As cFile_V3 = Nothing
+        Dim lM As List(Of Single)
+        Dim lup As List(Of Single)
+        Dim ldown As List(Of Single)
+        Dim line As String() = Nothing
+
+        Dim s0 As cSegmentTableEntry = Nothing
+        Dim HDVclass As String
+        Dim m0 As tMission
+
+        Dim MyChart As System.Windows.Forms.DataVisualization.Charting.Chart
+        Dim s As System.Windows.Forms.DataVisualization.Charting.Series
+        Dim a As System.Windows.Forms.DataVisualization.Charting.ChartArea
+        Dim img As Image
+
+        Me.TbHVCclass.Text = ""
+        Me.TbVehCat.Text = ""
+        Me.TbMass.Text = ""
+        Me.TbAxleConf.Text = ""
+        Me.TbEngTxt.Text = ""
+        Me.TbGbxTxt.Text = ""
+        Me.PicVehicle.Image = Nothing
+        Me.PicBox.Image = Nothing
+
+
+        VEH0.FilePath = fFileRepl(Me.TbVEH.Text, fPATH(VECTOfile))
+        If VEH0.ReadFile(False) Then
+
+            If Declaration.SegmentTable.SetRef(s0, VEH0.VehCat, VEH0.AxleConf, VEH0.MassMax) Then
+                HDVclass = s0.HDVclass
+
+                If Cfg.DeclMode Then
+                    Me.LvCycles.Items.Clear()
+                    For Each m0 In s0.Missions
+                        Me.LvCycles.Items.Add(Declaration.Missions(m0).NameStr)
+                    Next
+                End If
+
+            Else
+                HDVclass = "-"
+            End If
+
+            Me.PicVehicle.Image = Image.FromFile(Declaration.ConvPicPath(HDVclass, False))
+
+            Me.TbHVCclass.Text = "HDV Class " & HDVclass
+            Me.TbVehCat.Text = ConvVehCat(VEH0.VehCat, True)
+            Me.TbMass.Text = VEH0.MassMax & " t"
+            Me.TbAxleConf.Text = ConvAxleConf(VEH0.AxleConf)
+
+        End If
+
+
+        OkCount = 0
+
+        ENG0 = New cENG
+        ENG0.FilePath = fFileRepl(Me.TbENG.Text, fPATH(VECTOfile))
+
+        'Create plot
+        MyChart = New System.Windows.Forms.DataVisualization.Charting.Chart
+        MyChart.Width = Me.PicBox.Width
+        MyChart.Height = Me.PicBox.Height
+
+        a = New System.Windows.Forms.DataVisualization.Charting.ChartArea
+
+        If ENG0.ReadFile(False) Then
+
+            FLD0 = New cFLD
+
+            For i = 0 To ENG0.fFLD.Count - 1
+
+                FLD0.FilePath = ENG0.fFLD(i).FullPath
+                If FLD0.ReadFile(False) Then
+
+                    s = New System.Windows.Forms.DataVisualization.Charting.Series
+                    s.Points.DataBindXY(FLD0.LnU, FLD0.LTq)
+                    s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
+                    s.BorderWidth = 2
+                    s.Color = Color.DarkBlue
+                    s.Name = "Full load (" & fFILE(FLD0.FilePath, True) & ")"
+                    MyChart.Series.Add(s)
+
+                    s = New System.Windows.Forms.DataVisualization.Charting.Series
+                    s.Points.DataBindXY(FLD0.LnU, FLD0.LTqDrag)
+                    s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
+                    s.BorderWidth = 2
+                    s.Color = Color.Blue
+                    s.Name = "Motoring (" & fFILE(FLD0.FilePath, True) & ")"
+                    MyChart.Series.Add(s)
+
+                    If Cfg.DeclMode Then
+                        FLD0.Init(ENG0.Nidle)
+
+                        Shiftpoly = New cGBX.cShiftPolygon("", 0)
+                        Shiftpoly.SetGenericShiftPoly(FLD0, ENG0.Nidle)
+
+                        s = New System.Windows.Forms.DataVisualization.Charting.Series
+                        s.Points.DataBindXY(Shiftpoly.gs_nUup, Shiftpoly.gs_TqUp)
+                        s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
+                        s.BorderWidth = 2
+                        s.Color = Color.DarkRed
+                        s.Name = "Upshift curve"
+                        MyChart.Series.Add(s)
+
+                        s = New System.Windows.Forms.DataVisualization.Charting.Series
+                        s.Points.DataBindXY(Shiftpoly.gs_nUdown, Shiftpoly.gs_TqDown)
+                        s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
+                        s.BorderWidth = 2
+                        s.Color = Color.DarkRed
+                        s.Name = "Downshift curve"
+                        MyChart.Series.Add(s)
+
+                    End If
+
+                    OkCount += 1
+
+                    pmax = FLD0.Pfull(FLD0.fnUrated)
+
+
+                End If
+
+
+
+            Next
+
+            Me.TbEngTxt.Text = (ENG0.Displ / 1000).ToString("0.0") & " l " & pmax.ToString("#") & " kW  " & ENG0.ModelName
+
+
+            MAP0 = New cMAP
+            MAP0.FilePath = ENG0.PathMAP
+
+            If MAP0.ReadFile(False) Then
+
+                s = New System.Windows.Forms.DataVisualization.Charting.Series
+                s.Points.DataBindXY(MAP0.nU, MAP0.Tq)
+                s.ChartType = DataVisualization.Charting.SeriesChartType.Point
+                s.MarkerSize = 3
+                s.Color = Color.Red
+                s.Name = "Map"
+                MyChart.Series.Add(s)
+
+                OkCount += 1
+
+            End If
+
+        End If
+
+        GBX0 = New cGBX
+        GBX0.FilePath = fFileRepl(Me.TbGBX.Text, fPATH(VECTOfile))
+
+        If GBX0.ReadFile(False) Then
+
+            Me.TbGbxTxt.Text = GBX0.GearCount & "-Speed " & GearboxConv(GBX0.gs_Type) & "  " & GBX0.ModelName
+
+            If Not Cfg.DeclMode Then
+                f = New cFile_V3
+                For i = 0 To GBX0.GearCount - 1
+
+                    lM = New List(Of Single)
+                    lup = New List(Of Single)
+                    ldown = New List(Of Single)
+
+                    If f.OpenRead(GBX0.gsFile(i)) Then
+
+                        f.ReadLine()
+
+                        Try
+
+                            Do While Not f.EndOfFile
+                                line = f.ReadLine
+                                lM.Add(CSng(line(0)))
+                                lup.Add(CSng(line(1)))
+                                ldown.Add(CSng(line(2)))
+                            Loop
+
+                            s = New System.Windows.Forms.DataVisualization.Charting.Series
+                            s.Points.DataBindXY(lup, lM)
+                            s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
+                            s.BorderWidth = 2
+                            s.Color = Color.DarkRed
+                            s.Name = "Upshift curve"
+                            MyChart.Series.Add(s)
+
+                            s = New System.Windows.Forms.DataVisualization.Charting.Series
+                            s.Points.DataBindXY(ldown, lM)
+                            s.ChartType = DataVisualization.Charting.SeriesChartType.FastLine
+                            s.BorderWidth = 2
+                            s.Color = Color.DarkRed
+                            s.Name = "Downshift curve"
+                            MyChart.Series.Add(s)
+
+                            OkCount += 1
+
+                            f.Close()
+
+                        Catch ex As Exception
+                            f.Close()
+                        End Try
+
+                    End If
+
+                Next
+
+            End If
+
+        End If
+
+        If OkCount > 0 Then
+
+            a.Name = "main"
+
+            a.AxisX.Title = "engine speed [1/min]"
+            a.AxisX.TitleFont = New Font("Helvetica", 10)
+            a.AxisX.LabelStyle.Font = New Font("Helvetica", 8)
+            a.AxisX.LabelAutoFitStyle = DataVisualization.Charting.LabelAutoFitStyles.None
+            a.AxisX.MajorGrid.LineDashStyle = DataVisualization.Charting.ChartDashStyle.Dot
+
+            a.AxisY.Title = "engine torque [Nm]"
+            a.AxisY.TitleFont = New Font("Helvetica", 10)
+            a.AxisY.LabelStyle.Font = New Font("Helvetica", 8)
+            a.AxisY.LabelAutoFitStyle = DataVisualization.Charting.LabelAutoFitStyles.None
+            a.AxisY.MajorGrid.LineDashStyle = DataVisualization.Charting.ChartDashStyle.Dot
+
+            a.AxisX.Minimum = 300
+            a.BorderDashStyle = DataVisualization.Charting.ChartDashStyle.Solid
+            a.BorderWidth = 1
+
+            a.BackColor = Color.GhostWhite
+
+            MyChart.ChartAreas.Add(a)
+
+            MyChart.Update()
+
+            img = New Bitmap(MyChart.Width, MyChart.Height, Imaging.PixelFormat.Format32bppArgb)
+            MyChart.DrawToBitmap(img, New Rectangle(0, 0, Me.PicBox.Width, Me.PicBox.Height))
+
+            Me.PicBox.Image = img
+
+
+        End If
+
+    End Sub
+
+#Region "Open File Context Menu"
+
+    Private CmFiles As String()
+
+    Private Sub OpenFiles(ParamArray files() As String)
+
+        If files.Length = 0 Then Exit Sub
+
+        CmFiles = files
+
+        OpenWithToolStripMenuItem.Text = "Open with " & Cfg.OpenCmdName
+
+        CmOpenFile.Show(Cursor.Position)
+
+    End Sub
+
+    Private Sub OpenWithToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenWithToolStripMenuItem.Click
+        If Not FileOpenAlt(CmFiles(0)) Then MsgBox("Failed to open file!")
+    End Sub
+
+    Private Sub ShowInFolderToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ShowInFolderToolStripMenuItem.Click
+        If IO.File.Exists(CmFiles(0)) Then
+            Try
+                System.Diagnostics.Process.Start("explorer", "/select,""" & CmFiles(0) & "")
+            Catch ex As Exception
+                MsgBox("Failed to open file!")
+            End Try
+        Else
+            MsgBox("File not found!")
+        End If
+    End Sub
+
+#End Region
+
+#Region "Cycle list"
+
+    Private Sub LvCycles_DoubleClick(sender As Object, e As System.EventArgs) Handles LvCycles.DoubleClick
+        If Me.LvCycles.SelectedItems.Count > 0 Then OpenFiles(fFileRepl(Me.LvCycles.SelectedItems(0).SubItems(0).Text, fPATH(VECTOfile)))
+    End Sub
+
+    Private Sub LvCycles_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles LvCycles.KeyDown
+        Select Case e.KeyCode
+            Case Keys.Delete, Keys.Back
+                RemoveCycle()
+            Case Keys.Enter
+                If Me.LvCycles.SelectedItems.Count > 0 Then Me.LvCycles.SelectedItems(0).BeginEdit()
+        End Select
+    End Sub
+
+
+    Private Sub BtDRIadd_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIadd.Click
+        Dim str As String
+        Dim GenDir As String
+
+        GenDir = fPATH(VECTOfile)
+
+        If fbDRI.OpenDialog("", True) Then
+
+            For Each str In fbDRI.Files
+                Me.LvCycles.Items.Add(fFileWoDir(str, GenDir))
+            Next
+
+            Change()
+
+        End If
+
+    End Sub
+
+    Private Sub BtDRIrem_Click(sender As System.Object, e As System.EventArgs) Handles BtDRIrem.Click
+        RemoveCycle()
+    End Sub
+
+    Private Sub RemoveCycle()
+        Dim i As Integer
+
+        If LvCycles.SelectedItems.Count = 0 Then
+            If LvCycles.Items.Count = 0 Then
+                Exit Sub
+            Else
+                LvCycles.Items(LvCycles.Items.Count - 1).Selected = True
+            End If
+        End If
+
+        i = LvCycles.SelectedItems(0).Index
+
+        LvCycles.SelectedItems(0).Remove()
+
+        If LvCycles.Items.Count > 0 Then
+            If i < LvCycles.Items.Count Then
+                LvCycles.Items(i).Selected = True
+            Else
+                LvCycles.Items(LvCycles.Items.Count - 1).Selected = True
+            End If
+
+            LvCycles.Focus()
+        End If
+
+        Change()
+
+    End Sub
+
+#End Region
+
+
+End Class
diff --git a/VECTO/GUI/F_VEH_AuxDlog.Designer.vb b/VECTO/GUI/F_VEH_AuxDlog.Designer.vb
index f734fbd695a10e17b9ff51f3e44a2a9c57fcdd76..c6aefd30bd0db568b4665e1a405b37fc15cbe9e2 100644
--- a/VECTO/GUI/F_VEH_AuxDlog.Designer.vb
+++ b/VECTO/GUI/F_VEH_AuxDlog.Designer.vb
@@ -1,262 +1,429 @@
-' Copyright 2014 European Union.
-' Licensed under the EUPL (the 'Licence');
-'
-' * You may not use this work except in compliance with the Licence.
-' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
-' * Unless required by applicable law or agreed to in writing,
-'   software distributed under the Licence is distributed on an "AS IS" basis,
-'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-'
-' See the LICENSE.txt for the specific language governing permissions and limitations.
-<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
-Partial Class F_VEH_AuxDlog
-    Inherits System.Windows.Forms.Form
-
-    'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
-    <System.Diagnostics.DebuggerNonUserCode()> _
-    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
-        Try
-            If disposing AndAlso components IsNot Nothing Then
-                components.Dispose()
-            End If
-        Finally
-            MyBase.Dispose(disposing)
-        End Try
-    End Sub
-
-    'Wird vom Windows Form-Designer benötigt.
-    Private components As System.ComponentModel.IContainer
-
-    'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
-    'Das Bearbeiten ist mit dem Windows Form-Designer möglich.  
-    'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
-    <System.Diagnostics.DebuggerStepThrough()> _
-    Private Sub InitializeComponent()
-        Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
-        Me.OK_Button = New System.Windows.Forms.Button()
-        Me.Cancel_Button = New System.Windows.Forms.Button()
-        Me.Label1 = New System.Windows.Forms.Label()
-        Me.Label2 = New System.Windows.Forms.Label()
-        Me.Label3 = New System.Windows.Forms.Label()
-        Me.TbID = New System.Windows.Forms.TextBox()
-        Me.TbPath = New System.Windows.Forms.TextBox()
-        Me.BtBrowse = New System.Windows.Forms.Button()
-        Me.CbType = New System.Windows.Forms.ComboBox()
-        Me.LbIDhelp = New System.Windows.Forms.Label()
-        Me.Label4 = New System.Windows.Forms.Label()
-        Me.CbTech = New System.Windows.Forms.ComboBox()
-        Me.PnTech = New System.Windows.Forms.Panel()
-        Me.PnFile = New System.Windows.Forms.Panel()
-        Me.LVTech = New System.Windows.Forms.ListView()
-        Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
-        Me.TableLayoutPanel1.SuspendLayout()
-        Me.PnTech.SuspendLayout()
-        Me.PnFile.SuspendLayout()
-        Me.SuspendLayout()
-        '
-        'TableLayoutPanel1
-        '
-        Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
-        Me.TableLayoutPanel1.ColumnCount = 2
-        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
-        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
-        Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
-        Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
-        Me.TableLayoutPanel1.Location = New System.Drawing.Point(301, 388)
-        Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
-        Me.TableLayoutPanel1.RowCount = 1
-        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
-        Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 29)
-        Me.TableLayoutPanel1.TabIndex = 25
-        '
-        'OK_Button
-        '
-        Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None
-        Me.OK_Button.Location = New System.Drawing.Point(3, 3)
-        Me.OK_Button.Name = "OK_Button"
-        Me.OK_Button.Size = New System.Drawing.Size(67, 23)
-        Me.OK_Button.TabIndex = 0
-        Me.OK_Button.Text = "OK"
-        '
-        'Cancel_Button
-        '
-        Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None
-        Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
-        Me.Cancel_Button.Location = New System.Drawing.Point(76, 3)
-        Me.Cancel_Button.Name = "Cancel_Button"
-        Me.Cancel_Button.Size = New System.Drawing.Size(67, 23)
-        Me.Cancel_Button.TabIndex = 1
-        Me.Cancel_Button.Text = "Cancel"
-        '
-        'Label1
-        '
-        Me.Label1.AutoSize = True
-        Me.Label1.Location = New System.Drawing.Point(171, 10)
-        Me.Label1.Name = "Label1"
-        Me.Label1.Size = New System.Drawing.Size(18, 13)
-        Me.Label1.TabIndex = 1
-        Me.Label1.Text = "ID"
-        '
-        'Label2
-        '
-        Me.Label2.AutoSize = True
-        Me.Label2.Location = New System.Drawing.Point(9, 10)
-        Me.Label2.Name = "Label2"
-        Me.Label2.Size = New System.Drawing.Size(31, 13)
-        Me.Label2.TabIndex = 1
-        Me.Label2.Text = "Type"
-        '
-        'Label3
-        '
-        Me.Label3.AutoSize = True
-        Me.Label3.Location = New System.Drawing.Point(7, 39)
-        Me.Label3.Name = "Label3"
-        Me.Label3.Size = New System.Drawing.Size(50, 13)
-        Me.Label3.TabIndex = 1
-        Me.Label3.Text = "Input File"
-        '
-        'TbID
-        '
-        Me.TbID.Location = New System.Drawing.Point(195, 7)
-        Me.TbID.Name = "TbID"
-        Me.TbID.Size = New System.Drawing.Size(39, 20)
-        Me.TbID.TabIndex = 5
-        '
-        'TbPath
-        '
-        Me.TbPath.Location = New System.Drawing.Point(7, 55)
-        Me.TbPath.Name = "TbPath"
-        Me.TbPath.Size = New System.Drawing.Size(383, 20)
-        Me.TbPath.TabIndex = 10
-        '
-        'BtBrowse
-        '
-        Me.BtBrowse.Location = New System.Drawing.Point(396, 53)
-        Me.BtBrowse.Name = "BtBrowse"
-        Me.BtBrowse.Size = New System.Drawing.Size(32, 23)
-        Me.BtBrowse.TabIndex = 15
-        Me.BtBrowse.Text = "..."
-        Me.BtBrowse.UseVisualStyleBackColor = True
-        '
-        'CbType
-        '
-        Me.CbType.FormattingEnabled = True
-        Me.CbType.Location = New System.Drawing.Point(46, 7)
-        Me.CbType.Name = "CbType"
-        Me.CbType.Size = New System.Drawing.Size(109, 21)
-        Me.CbType.TabIndex = 0
-        '
-        'LbIDhelp
-        '
-        Me.LbIDhelp.AutoSize = True
-        Me.LbIDhelp.Location = New System.Drawing.Point(240, 10)
-        Me.LbIDhelp.Name = "LbIDhelp"
-        Me.LbIDhelp.Size = New System.Drawing.Size(0, 13)
-        Me.LbIDhelp.TabIndex = 26
-        '
-        'Label4
-        '
-        Me.Label4.AutoSize = True
-        Me.Label4.Location = New System.Drawing.Point(6, 9)
-        Me.Label4.Name = "Label4"
-        Me.Label4.Size = New System.Drawing.Size(63, 13)
-        Me.Label4.TabIndex = 1
-        Me.Label4.Text = "Technology"
-        '
-        'CbTech
-        '
-        Me.CbTech.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
-        Me.CbTech.FormattingEnabled = True
-        Me.CbTech.Location = New System.Drawing.Point(75, 6)
-        Me.CbTech.Name = "CbTech"
-        Me.CbTech.Size = New System.Drawing.Size(352, 21)
-        Me.CbTech.TabIndex = 27
-        '
-        'PnTech
-        '
-        Me.PnTech.Controls.Add(Me.CbTech)
-        Me.PnTech.Controls.Add(Me.Label4)
-        Me.PnTech.Location = New System.Drawing.Point(12, 12)
-        Me.PnTech.Name = "PnTech"
-        Me.PnTech.Size = New System.Drawing.Size(435, 34)
-        Me.PnTech.TabIndex = 28
-        '
-        'PnFile
-        '
-        Me.PnFile.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
-        Me.PnFile.Controls.Add(Me.LbIDhelp)
-        Me.PnFile.Controls.Add(Me.BtBrowse)
-        Me.PnFile.Controls.Add(Me.CbType)
-        Me.PnFile.Controls.Add(Me.TbID)
-        Me.PnFile.Controls.Add(Me.TbPath)
-        Me.PnFile.Controls.Add(Me.Label2)
-        Me.PnFile.Controls.Add(Me.Label3)
-        Me.PnFile.Controls.Add(Me.Label1)
-        Me.PnFile.Location = New System.Drawing.Point(12, 293)
-        Me.PnFile.Name = "PnFile"
-        Me.PnFile.Size = New System.Drawing.Size(435, 89)
-        Me.PnFile.TabIndex = 29
-        '
-        'LVTech
-        '
-        Me.LVTech.CheckBoxes = True
-        Me.LVTech.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1})
-        Me.LVTech.FullRowSelect = True
-        Me.LVTech.GridLines = True
-        Me.LVTech.Location = New System.Drawing.Point(12, 52)
-        Me.LVTech.Name = "LVTech"
-        Me.LVTech.Size = New System.Drawing.Size(435, 235)
-        Me.LVTech.TabIndex = 30
-        Me.LVTech.UseCompatibleStateImageBehavior = False
-        Me.LVTech.View = System.Windows.Forms.View.Details
-        '
-        'ColumnHeader1
-        '
-        Me.ColumnHeader1.Text = "Technologies"
-        Me.ColumnHeader1.Width = 420
-        '
-        'F_VEH_AuxDlog
-        '
-        Me.AcceptButton = Me.OK_Button
-        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
-        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
-        Me.CancelButton = Me.Cancel_Button
-        Me.ClientSize = New System.Drawing.Size(459, 429)
-        Me.Controls.Add(Me.LVTech)
-        Me.Controls.Add(Me.PnFile)
-        Me.Controls.Add(Me.PnTech)
-        Me.Controls.Add(Me.TableLayoutPanel1)
-        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
-        Me.MaximizeBox = False
-        Me.MinimizeBox = False
-        Me.Name = "F_VEH_AuxDlog"
-        Me.ShowInTaskbar = False
-        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
-        Me.Text = "Auxiliary"
-        Me.TableLayoutPanel1.ResumeLayout(False)
-        Me.PnTech.ResumeLayout(False)
-        Me.PnTech.PerformLayout()
-        Me.PnFile.ResumeLayout(False)
-        Me.PnFile.PerformLayout()
-        Me.ResumeLayout(False)
-
-    End Sub
-    Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
-    Friend WithEvents OK_Button As System.Windows.Forms.Button
-    Friend WithEvents Cancel_Button As System.Windows.Forms.Button
-    Friend WithEvents Label1 As System.Windows.Forms.Label
-    Friend WithEvents Label2 As System.Windows.Forms.Label
-    Friend WithEvents Label3 As System.Windows.Forms.Label
-    Friend WithEvents TbID As System.Windows.Forms.TextBox
-    Friend WithEvents TbPath As System.Windows.Forms.TextBox
-    Friend WithEvents BtBrowse As System.Windows.Forms.Button
-    Friend WithEvents CbType As System.Windows.Forms.ComboBox
-    Friend WithEvents LbIDhelp As System.Windows.Forms.Label
-    Friend WithEvents Label4 As System.Windows.Forms.Label
-    Friend WithEvents CbTech As System.Windows.Forms.ComboBox
-    Friend WithEvents PnTech As System.Windows.Forms.Panel
-    Friend WithEvents PnFile As System.Windows.Forms.Panel
-    Friend WithEvents LVTech As System.Windows.Forms.ListView
-    Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
-
-End Class
+' Copyright 2014 European Union.
+' Licensed under the EUPL (the 'Licence');
+'
+' * You may not use this work except in compliance with the Licence.
+' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
+' * Unless required by applicable law or agreed to in writing,
+'   software distributed under the Licence is distributed on an "AS IS" basis,
+'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+'
+' See the LICENSE.txt for the specific language governing permissions and limitations.
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
+Partial Class F_VEH_AuxDlog
+    Inherits System.Windows.Forms.Form
+
+    'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
+    <System.Diagnostics.DebuggerNonUserCode()> _
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Wird vom Windows Form-Designer benötigt.
+    Private components As System.ComponentModel.IContainer
+
+    'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
+    'Das Bearbeiten ist mit dem Windows Form-Designer möglich.  
+    'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
+    <System.Diagnostics.DebuggerStepThrough()> _
+    Private Sub InitializeComponent()
+        Me.OK_Button = New System.Windows.Forms.Button()
+        Me.Cancel_Button = New System.Windows.Forms.Button()
+        Me.Label1 = New System.Windows.Forms.Label()
+        Me.Label2 = New System.Windows.Forms.Label()
+        Me.Label3 = New System.Windows.Forms.Label()
+        Me.TbID = New System.Windows.Forms.TextBox()
+        Me.TbPath = New System.Windows.Forms.TextBox()
+        Me.BtBrowse = New System.Windows.Forms.Button()
+        Me.CbType = New System.Windows.Forms.ComboBox()
+        Me.LbIDhelp = New System.Windows.Forms.Label()
+        Me.Label4 = New System.Windows.Forms.Label()
+        Me.CbTech = New System.Windows.Forms.ComboBox()
+        Me.PnTech = New System.Windows.Forms.Panel()
+        Me.LVTech = New System.Windows.Forms.ListView()
+        Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
+        Me.Tabs = New System.Windows.Forms.TabControl()
+        Me.tabMain = New System.Windows.Forms.TabPage()
+        Me.PnFile = New System.Windows.Forms.Panel()
+        Me.Label6 = New System.Windows.Forms.Label()
+        Me.Label5 = New System.Windows.Forms.Label()
+        Me.txtPulleyGearRatio = New System.Windows.Forms.TextBox()
+        Me.txtPulleyGearEfficiency = New System.Windows.Forms.TextBox()
+        Me.tabListItems = New System.Windows.Forms.TabPage()
+        Me.pnlListItems = New System.Windows.Forms.Panel()
+        Me.dgvInputs = New System.Windows.Forms.DataGridView()
+        Me.ItemName = New System.Windows.Forms.DataGridViewTextBoxColumn()
+        Me.ItemValue = New System.Windows.Forms.DataGridViewTextBoxColumn()
+        Me.btnConsumerRemove = New System.Windows.Forms.Button()
+        Me.btnConsumerAdd = New System.Windows.Forms.Button()
+        Me.tabTechnologies = New System.Windows.Forms.TabPage()
+        Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
+        Me.PnTech.SuspendLayout()
+        Me.Tabs.SuspendLayout()
+        Me.tabMain.SuspendLayout()
+        Me.PnFile.SuspendLayout()
+        Me.tabListItems.SuspendLayout()
+        Me.pnlListItems.SuspendLayout()
+        CType(Me.dgvInputs, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.tabTechnologies.SuspendLayout()
+        Me.TableLayoutPanel1.SuspendLayout()
+        Me.SuspendLayout()
+        '
+        'OK_Button
+        '
+        Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.OK_Button.Location = New System.Drawing.Point(3, 3)
+        Me.OK_Button.Name = "OK_Button"
+        Me.OK_Button.Size = New System.Drawing.Size(67, 23)
+        Me.OK_Button.TabIndex = 0
+        Me.OK_Button.Text = "OK"
+        '
+        'Cancel_Button
+        '
+        Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
+        Me.Cancel_Button.Location = New System.Drawing.Point(76, 3)
+        Me.Cancel_Button.Name = "Cancel_Button"
+        Me.Cancel_Button.Size = New System.Drawing.Size(67, 23)
+        Me.Cancel_Button.TabIndex = 1
+        Me.Cancel_Button.Text = "Cancel"
+        '
+        'Label1
+        '
+        Me.Label1.AutoSize = True
+        Me.Label1.Location = New System.Drawing.Point(171, 10)
+        Me.Label1.Name = "Label1"
+        Me.Label1.Size = New System.Drawing.Size(18, 13)
+        Me.Label1.TabIndex = 1
+        Me.Label1.Text = "ID"
+        '
+        'Label2
+        '
+        Me.Label2.AutoSize = True
+        Me.Label2.Location = New System.Drawing.Point(9, 10)
+        Me.Label2.Name = "Label2"
+        Me.Label2.Size = New System.Drawing.Size(31, 13)
+        Me.Label2.TabIndex = 1
+        Me.Label2.Text = "Type"
+        '
+        'Label3
+        '
+        Me.Label3.AutoSize = True
+        Me.Label3.Location = New System.Drawing.Point(7, 39)
+        Me.Label3.Name = "Label3"
+        Me.Label3.Size = New System.Drawing.Size(50, 13)
+        Me.Label3.TabIndex = 1
+        Me.Label3.Text = "Input File"
+        '
+        'TbID
+        '
+        Me.TbID.Location = New System.Drawing.Point(195, 7)
+        Me.TbID.Name = "TbID"
+        Me.TbID.Size = New System.Drawing.Size(39, 20)
+        Me.TbID.TabIndex = 5
+        '
+        'TbPath
+        '
+        Me.TbPath.Location = New System.Drawing.Point(7, 55)
+        Me.TbPath.Name = "TbPath"
+        Me.TbPath.Size = New System.Drawing.Size(383, 20)
+        Me.TbPath.TabIndex = 10
+        '
+        'BtBrowse
+        '
+        Me.BtBrowse.Location = New System.Drawing.Point(396, 53)
+        Me.BtBrowse.Name = "BtBrowse"
+        Me.BtBrowse.Size = New System.Drawing.Size(32, 23)
+        Me.BtBrowse.TabIndex = 15
+        Me.BtBrowse.Text = "..."
+        Me.BtBrowse.UseVisualStyleBackColor = True
+        '
+        'CbType
+        '
+        Me.CbType.FormattingEnabled = True
+        Me.CbType.Location = New System.Drawing.Point(46, 7)
+        Me.CbType.Name = "CbType"
+        Me.CbType.Size = New System.Drawing.Size(109, 21)
+        Me.CbType.TabIndex = 0
+        '
+        'LbIDhelp
+        '
+        Me.LbIDhelp.AutoSize = True
+        Me.LbIDhelp.Location = New System.Drawing.Point(240, 10)
+        Me.LbIDhelp.Name = "LbIDhelp"
+        Me.LbIDhelp.Size = New System.Drawing.Size(0, 13)
+        Me.LbIDhelp.TabIndex = 26
+        '
+        'Label4
+        '
+        Me.Label4.AutoSize = True
+        Me.Label4.Location = New System.Drawing.Point(6, 9)
+        Me.Label4.Name = "Label4"
+        Me.Label4.Size = New System.Drawing.Size(63, 13)
+        Me.Label4.TabIndex = 1
+        Me.Label4.Text = "Technology"
+        '
+        'CbTech
+        '
+        Me.CbTech.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.CbTech.FormattingEnabled = True
+        Me.CbTech.Location = New System.Drawing.Point(75, 6)
+        Me.CbTech.Name = "CbTech"
+        Me.CbTech.Size = New System.Drawing.Size(352, 21)
+        Me.CbTech.TabIndex = 27
+        '
+        'PnTech
+        '
+        Me.PnTech.Controls.Add(Me.CbTech)
+        Me.PnTech.Controls.Add(Me.Label4)
+        Me.PnTech.Location = New System.Drawing.Point(31, 52)
+        Me.PnTech.Name = "PnTech"
+        Me.PnTech.Size = New System.Drawing.Size(435, 34)
+        Me.PnTech.TabIndex = 28
+        '
+        'LVTech
+        '
+        Me.LVTech.CheckBoxes = True
+        Me.LVTech.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1})
+        Me.LVTech.FullRowSelect = True
+        Me.LVTech.GridLines = True
+        Me.LVTech.Location = New System.Drawing.Point(31, 92)
+        Me.LVTech.Name = "LVTech"
+        Me.LVTech.Size = New System.Drawing.Size(435, 202)
+        Me.LVTech.TabIndex = 30
+        Me.LVTech.UseCompatibleStateImageBehavior = False
+        Me.LVTech.View = System.Windows.Forms.View.Details
+        '
+        'ColumnHeader1
+        '
+        Me.ColumnHeader1.Text = "Technologies"
+        Me.ColumnHeader1.Width = 420
+        '
+        'Tabs
+        '
+        Me.Tabs.Controls.Add(Me.tabMain)
+        Me.Tabs.Controls.Add(Me.tabListItems)
+        Me.Tabs.Controls.Add(Me.tabTechnologies)
+        Me.Tabs.Location = New System.Drawing.Point(12, 24)
+        Me.Tabs.Name = "Tabs"
+        Me.Tabs.SelectedIndex = 0
+        Me.Tabs.Size = New System.Drawing.Size(505, 387)
+        Me.Tabs.TabIndex = 35
+        '
+        'tabMain
+        '
+        Me.tabMain.Controls.Add(Me.PnFile)
+        Me.tabMain.Location = New System.Drawing.Point(4, 22)
+        Me.tabMain.Name = "tabMain"
+        Me.tabMain.Padding = New System.Windows.Forms.Padding(3)
+        Me.tabMain.Size = New System.Drawing.Size(497, 361)
+        Me.tabMain.TabIndex = 0
+        Me.tabMain.Text = "Main"
+        Me.tabMain.UseVisualStyleBackColor = True
+        '
+        'PnFile
+        '
+        Me.PnFile.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+        Me.PnFile.Controls.Add(Me.Label6)
+        Me.PnFile.Controls.Add(Me.Label5)
+        Me.PnFile.Controls.Add(Me.txtPulleyGearRatio)
+        Me.PnFile.Controls.Add(Me.txtPulleyGearEfficiency)
+        Me.PnFile.Controls.Add(Me.LbIDhelp)
+        Me.PnFile.Controls.Add(Me.BtBrowse)
+        Me.PnFile.Controls.Add(Me.CbType)
+        Me.PnFile.Controls.Add(Me.TbID)
+        Me.PnFile.Controls.Add(Me.TbPath)
+        Me.PnFile.Controls.Add(Me.Label2)
+        Me.PnFile.Controls.Add(Me.Label3)
+        Me.PnFile.Controls.Add(Me.Label1)
+        Me.PnFile.Location = New System.Drawing.Point(16, 55)
+        Me.PnFile.Name = "PnFile"
+        Me.PnFile.Size = New System.Drawing.Size(435, 231)
+        Me.PnFile.TabIndex = 29
+        '
+        'Label6
+        '
+        Me.Label6.AutoSize = True
+        Me.Label6.Location = New System.Drawing.Point(242, 109)
+        Me.Label6.Name = "Label6"
+        Me.Label6.Size = New System.Drawing.Size(98, 13)
+        Me.Label6.TabIndex = 34
+        Me.Label6.Text = "Pulley Gear Ratio : "
+        '
+        'Label5
+        '
+        Me.Label5.AutoSize = True
+        Me.Label5.Location = New System.Drawing.Point(16, 109)
+        Me.Label5.Name = "Label5"
+        Me.Label5.Size = New System.Drawing.Size(119, 13)
+        Me.Label5.TabIndex = 33
+        Me.Label5.Text = "Pulley Gear Efficiency : "
+        '
+        'txtPulleyGearRatio
+        '
+        Me.txtPulleyGearRatio.Location = New System.Drawing.Point(346, 105)
+        Me.txtPulleyGearRatio.Name = "txtPulleyGearRatio"
+        Me.txtPulleyGearRatio.Size = New System.Drawing.Size(72, 20)
+        Me.txtPulleyGearRatio.TabIndex = 32
+        '
+        'txtPulleyGearEfficiency
+        '
+        Me.txtPulleyGearEfficiency.Location = New System.Drawing.Point(136, 105)
+        Me.txtPulleyGearEfficiency.Name = "txtPulleyGearEfficiency"
+        Me.txtPulleyGearEfficiency.Size = New System.Drawing.Size(76, 20)
+        Me.txtPulleyGearEfficiency.TabIndex = 31
+        '
+        'tabListItems
+        '
+        Me.tabListItems.Controls.Add(Me.pnlListItems)
+        Me.tabListItems.Location = New System.Drawing.Point(4, 22)
+        Me.tabListItems.Name = "tabListItems"
+        Me.tabListItems.Padding = New System.Windows.Forms.Padding(3)
+        Me.tabListItems.Size = New System.Drawing.Size(497, 361)
+        Me.tabListItems.TabIndex = 1
+        Me.tabListItems.Text = "ListItems"
+        Me.tabListItems.UseVisualStyleBackColor = True
+        '
+        'pnlListItems
+        '
+        Me.pnlListItems.Controls.Add(Me.dgvInputs)
+        Me.pnlListItems.Controls.Add(Me.btnConsumerRemove)
+        Me.pnlListItems.Controls.Add(Me.btnConsumerAdd)
+        Me.pnlListItems.Location = New System.Drawing.Point(19, 31)
+        Me.pnlListItems.Name = "pnlListItems"
+        Me.pnlListItems.Size = New System.Drawing.Size(452, 324)
+        Me.pnlListItems.TabIndex = 35
+        '
+        'dgvInputs
+        '
+        Me.dgvInputs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        Me.dgvInputs.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.ItemName, Me.ItemValue})
+        Me.dgvInputs.Location = New System.Drawing.Point(3, 42)
+        Me.dgvInputs.Name = "dgvInputs"
+        Me.dgvInputs.Size = New System.Drawing.Size(432, 268)
+        Me.dgvInputs.TabIndex = 31
+        '
+        'ItemName
+        '
+        Me.ItemName.HeaderText = "ItemName"
+        Me.ItemName.Name = "ItemName"
+        Me.ItemName.Width = 289
+        '
+        'ItemValue
+        '
+        Me.ItemValue.HeaderText = "ItemValue"
+        Me.ItemValue.Name = "ItemValue"
+        '
+        'btnConsumerRemove
+        '
+        Me.btnConsumerRemove.Enabled = False
+        Me.btnConsumerRemove.Image = Global.VECTO.My.Resources.Resources.minus_circle_icon
+        Me.btnConsumerRemove.Location = New System.Drawing.Point(406, 13)
+        Me.btnConsumerRemove.Name = "btnConsumerRemove"
+        Me.btnConsumerRemove.Size = New System.Drawing.Size(29, 23)
+        Me.btnConsumerRemove.TabIndex = 34
+        Me.btnConsumerRemove.UseVisualStyleBackColor = True
+        '
+        'btnConsumerAdd
+        '
+        Me.btnConsumerAdd.Image = Global.VECTO.My.Resources.Resources.plus_circle_icon
+        Me.btnConsumerAdd.Location = New System.Drawing.Point(353, 13)
+        Me.btnConsumerAdd.Name = "btnConsumerAdd"
+        Me.btnConsumerAdd.Size = New System.Drawing.Size(29, 23)
+        Me.btnConsumerAdd.TabIndex = 33
+        Me.btnConsumerAdd.UseVisualStyleBackColor = True
+        '
+        'tabTechnologies
+        '
+        Me.tabTechnologies.Controls.Add(Me.PnTech)
+        Me.tabTechnologies.Controls.Add(Me.LVTech)
+        Me.tabTechnologies.Location = New System.Drawing.Point(4, 22)
+        Me.tabTechnologies.Name = "tabTechnologies"
+        Me.tabTechnologies.Size = New System.Drawing.Size(497, 361)
+        Me.tabTechnologies.TabIndex = 2
+        Me.tabTechnologies.Text = "Technologies"
+        Me.tabTechnologies.UseVisualStyleBackColor = True
+        '
+        'TableLayoutPanel1
+        '
+        Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+        Me.TableLayoutPanel1.ColumnCount = 2
+        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
+        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
+        Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
+        Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
+        Me.TableLayoutPanel1.Location = New System.Drawing.Point(385, 440)
+        Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
+        Me.TableLayoutPanel1.RowCount = 1
+        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
+        Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 29)
+        Me.TableLayoutPanel1.TabIndex = 25
+        '
+        'F_VEH_AuxDlog
+        '
+        Me.AcceptButton = Me.OK_Button
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.CancelButton = Me.Cancel_Button
+        Me.ClientSize = New System.Drawing.Size(543, 481)
+        Me.Controls.Add(Me.Tabs)
+        Me.Controls.Add(Me.TableLayoutPanel1)
+        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
+        Me.MaximizeBox = False
+        Me.MinimizeBox = False
+        Me.Name = "F_VEH_AuxDlog"
+        Me.ShowInTaskbar = False
+        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
+        Me.Text = "Auxiliary"
+        Me.PnTech.ResumeLayout(False)
+        Me.PnTech.PerformLayout()
+        Me.Tabs.ResumeLayout(False)
+        Me.tabMain.ResumeLayout(False)
+        Me.PnFile.ResumeLayout(False)
+        Me.PnFile.PerformLayout()
+        Me.tabListItems.ResumeLayout(False)
+        Me.pnlListItems.ResumeLayout(False)
+        CType(Me.dgvInputs, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.tabTechnologies.ResumeLayout(False)
+        Me.TableLayoutPanel1.ResumeLayout(False)
+        Me.ResumeLayout(False)
+
+    End Sub
+    Friend WithEvents OK_Button As System.Windows.Forms.Button
+    Friend WithEvents Cancel_Button As System.Windows.Forms.Button
+    Friend WithEvents Label1 As System.Windows.Forms.Label
+    Friend WithEvents Label2 As System.Windows.Forms.Label
+    Friend WithEvents Label3 As System.Windows.Forms.Label
+    Friend WithEvents TbID As System.Windows.Forms.TextBox
+    Friend WithEvents TbPath As System.Windows.Forms.TextBox
+    Friend WithEvents BtBrowse As System.Windows.Forms.Button
+    Friend WithEvents CbType As System.Windows.Forms.ComboBox
+    Friend WithEvents LbIDhelp As System.Windows.Forms.Label
+    Friend WithEvents Label4 As System.Windows.Forms.Label
+    Friend WithEvents CbTech As System.Windows.Forms.ComboBox
+    Friend WithEvents PnTech As System.Windows.Forms.Panel
+    Friend WithEvents LVTech As System.Windows.Forms.ListView
+    Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
+    Friend WithEvents Tabs As System.Windows.Forms.TabControl
+    Friend WithEvents tabMain As System.Windows.Forms.TabPage
+    Friend WithEvents tabListItems As System.Windows.Forms.TabPage
+    Friend WithEvents btnConsumerRemove As System.Windows.Forms.Button
+    Friend WithEvents btnConsumerAdd As System.Windows.Forms.Button
+    Friend WithEvents dgvInputs As System.Windows.Forms.DataGridView
+    Friend WithEvents ItemName As System.Windows.Forms.DataGridViewTextBoxColumn
+    Friend WithEvents ItemValue As System.Windows.Forms.DataGridViewTextBoxColumn
+    Friend WithEvents tabTechnologies As System.Windows.Forms.TabPage
+    Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
+    Friend WithEvents PnFile As System.Windows.Forms.Panel
+    Friend WithEvents Label6 As System.Windows.Forms.Label
+    Friend WithEvents Label5 As System.Windows.Forms.Label
+    Friend WithEvents txtPulleyGearRatio As System.Windows.Forms.TextBox
+    Friend WithEvents txtPulleyGearEfficiency As System.Windows.Forms.TextBox
+    Friend WithEvents pnlListItems As System.Windows.Forms.Panel
+
+End Class
diff --git a/VECTO/GUI/F_VEH_AuxDlog.resx b/VECTO/GUI/F_VEH_AuxDlog.resx
index 29dcb1b3a353ba227f65e11fbe3d6f0766e84292..d666c55242dcdb49020fcb5f9dc97802ecd652c1 100644
--- a/VECTO/GUI/F_VEH_AuxDlog.resx
+++ b/VECTO/GUI/F_VEH_AuxDlog.resx
@@ -1,120 +1,126 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="ItemName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ItemValue.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>
\ No newline at end of file
diff --git a/VECTO/GUI/F_VEH_AuxDlog.vb b/VECTO/GUI/F_VEH_AuxDlog.vb
index ffacf1a89472d32df7bf6039089fb265a9ad5511..068a2ba1f820f54776a087be151a238edda48e60 100644
--- a/VECTO/GUI/F_VEH_AuxDlog.vb
+++ b/VECTO/GUI/F_VEH_AuxDlog.vb
@@ -1,198 +1,387 @@
-' Copyright 2014 European Union.
-' Licensed under the EUPL (the 'Licence');
-'
-' * You may not use this work except in compliance with the Licence.
-' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
-' * Unless required by applicable law or agreed to in writing,
-'   software distributed under the Licence is distributed on an "AS IS" basis,
-'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-'
-' See the LICENSE.txt for the specific language governing permissions and limitations.
-Imports System.Windows.Forms
-Imports System.Collections.Generic
-
-''' <summary>
-''' Aux Config Editor (Job Editor sub-dialog)
-''' </summary>
-''' <remarks></remarks>
-Public Class F_VEH_AuxDlog
-
-    Public VehPath As String = ""
-
-    'New instance
-    Public Sub New()
-
-        ' Dieser Aufruf ist für den Designer erforderlich.
-        InitializeComponent()
-
-        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
-        Me.CbType.Items.Add("Fan")
-        Me.CbType.Items.Add("Steering pump")
-        Me.CbType.Items.Add("HVAC")
-        Me.CbType.Items.Add("Electric System")
-
-        Me.PnFile.Enabled = Not Cfg.DeclMode
-        Me.PnTech.Enabled = Cfg.DeclMode
-
-
-    End Sub
-
-    'Initialise form
-    Private Sub F_VEH_AuxDlog_Load(sender As Object, e As System.EventArgs) Handles Me.Load
-        Me.Text = CbType.Text
-    End Sub
-
-    'Set generic values for Declaration mode
-    Private Sub DeclInit()
-        Dim txt As String
-        Dim kv As KeyValuePair(Of String, Dictionary(Of tMission, Single))
-
-        If Not Cfg.DeclMode Then
-            Me.LVTech.Visible = False
-            Me.Height = 220
-            Exit Sub
-        End If
-
-        Me.CbTech.Items.Clear()
-
-        Select Case TbID.Text
-            Case sKey.AUX.Fan
-                For Each txt In Declaration.AuxTechs(tAux.Fan)
-                    Me.CbTech.Items.Add(txt)
-                Next
-
-            Case sKey.AUX.SteerPump
-                For Each txt In Declaration.AuxTechs(tAux.SteerPump)
-                    Me.CbTech.Items.Add(txt)
-                Next
-
-            Case sKey.AUX.HVAC
-                For Each txt In Declaration.AuxTechs(tAux.HVAC)
-                    Me.CbTech.Items.Add(txt)
-                Next
-                Me.CbTech.SelectedIndex = 0
-
-            Case sKey.AUX.ElecSys
-                For Each txt In Declaration.AuxTechs(tAux.ElectricSys)
-                    Me.CbTech.Items.Add(txt)
-                Next
-                Me.CbTech.SelectedIndex = 0
-
-
-            Case Else    'sKey.AUX.PneumSys
-                For Each txt In Declaration.AuxTechs(tAux.PneumSys)
-                    Me.CbTech.Items.Add(txt)
-                Next
-                Me.CbTech.SelectedIndex = 0
-
-        End Select
-
-
-        If TbID.Text = sKey.AUX.ElecSys Then
-
-            Me.LVTech.Items.Clear()
-            For Each kv In Declaration.AuxESpower
-                Me.LVTech.Items.Add(kv.Key)
-            Next
-            Me.LVTech.Visible = True
-
-            Me.Height = 457
-
-        Else
-
-            Me.LVTech.Visible = False
-            Me.Height = 220
-
-        End If
-
-    End Sub
-
-    'Save and close
-    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
-        Me.DialogResult = System.Windows.Forms.DialogResult.OK
-        Me.Close()
-    End Sub
-
-    'Cancel
-    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
-        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
-        Me.Close()
-    End Sub
-
-    'Close form. Check if form is complete and valid
-    Private Sub F_VEH_AuxDlog_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
-        If e.CloseReason <> CloseReason.WindowsShutDown And Me.DialogResult <> Windows.Forms.DialogResult.Cancel Then
-
-            If Trim(Me.TbID.Text) = "" Or Trim(Me.CbType.Text) = "" Then
-                MsgBox("Form is incomplete!", MsgBoxStyle.Critical)
-                e.Cancel = True
-            End If
-
-            If Me.TbID.Text.Contains(",") Or Me.CbType.Text.Contains(",") Or Me.TbPath.Text.Contains(",") Then
-                MsgBox("',' is no valid character!", MsgBoxStyle.Critical)
-                e.Cancel = True
-            End If
-
-            If Cfg.DeclMode Then
-
-                If Me.CbTech.Text = "" Then
-                    MsgBox("Form is incomplete!", MsgBoxStyle.Critical)
-                    e.Cancel = True
-                End If
-
-            Else
-
-                If Trim(Me.TbPath.Text) = "" Then
-                    MsgBox("Form is incomplete!", MsgBoxStyle.Critical)
-                    e.Cancel = True
-                End If
-
-            End If
-
-        End If
-    End Sub
-
-    'Browse for .vaux files
-    Private Sub BtBrowse_Click(sender As System.Object, e As System.EventArgs) Handles BtBrowse.Click
-        If fbAUX.OpenDialog(fFileRepl(Me.TbPath.Text, VehPath)) Then Me.TbPath.Text = fFileWoDir(fbAUX.Files(0), VehPath)
-    End Sub
-
-    'Update ID when Aux Type was changed
-    Private Sub CbType_TextChanged(sender As Object, e As System.EventArgs) Handles CbType.TextChanged
-
-        If Me.CbType.Text = "" Then
-            Me.TbID.Text = ""
-        Else
-            If Cfg.DeclMode Then
-                Select Case Me.CbType.SelectedIndex
-                    Case 0
-                        Me.TbID.Text = sKey.AUX.Fan
-                    Case 1
-                        Me.TbID.Text = sKey.AUX.SteerPump
-
-                    Case Else '2
-                        Me.TbID.Text = sKey.AUX.HVAC
-
-                End Select
-            Else
-                Me.TbID.Text = Trim(UCase(Me.CbType.Text.Substring(0, CInt(Math.Min(Me.CbType.Text.Length, 3)))))
-            End If
-        End If
-
-    End Sub
-
-    'Update help label if ID was changed
-    Private Sub TbID_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbID.TextChanged
-
-        DeclInit()
-
-        If Trim(Me.TbID.Text) = "" Or Cfg.DeclMode Then
-            Me.LbIDhelp.Text = ""
-        Else
-            Me.LbIDhelp.Text = "Header in Driving cycle: <AUX_" & Trim(Me.TbID.Text) & ">"
-        End If
-
-    End Sub
-
-
-End Class
+' Copyright 2014 European Union.
+' Licensed under the EUPL (the 'Licence');
+'
+' * You may not use this work except in compliance with the Licence.
+' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
+' * Unless required by applicable law or agreed to in writing,
+'   software distributed under the Licence is distributed on an "AS IS" basis,
+'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+'
+' See the LICENSE.txt for the specific language governing permissions and limitations.
+Imports System.Windows.Forms
+Imports System.Collections.Generic
+Imports VectoAuxiliaries.Hvac
+
+''' <summary>
+''' Aux Config Editor (Job Editor sub-dialog)
+''' </summary>
+''' <remarks></remarks>
+Public Class F_VEH_AuxDlog
+
+    Public VehPath As String = ""
+
+    Public Property ListItems As New Dictionary(Of String, Single)
+
+
+    'New instance
+    Public Sub New()
+
+        ' Dieser Aufruf ist für den Designer erforderlich.
+        InitializeComponent()
+
+        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
+        Me.CbType.Items.Add("Fan")
+        Me.CbType.Items.Add("Steering pump")
+        Me.CbType.Items.Add("HVAC")
+        Me.CbType.Items.Add("Electric System")
+
+        Me.PnFile.Enabled = Not Cfg.DeclMode
+        Me.PnTech.Enabled = Cfg.DeclMode
+
+
+    End Sub
+
+    'Initialise form
+    Private Sub F_VEH_AuxDlog_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+        Me.Text = CbType.Text
+    End Sub
+
+
+    'Set generic values for Declaration mode
+    Private Sub DeclInit()
+        Dim txt As String
+        Dim kv As KeyValuePair(Of String, Dictionary(Of tMission, Single))
+
+        Me.CbTech.Items.Clear()
+
+        'Added this section to enable or disable the new controls for Post file version 2 - TB 25/9/14
+        Tabs.TabPages.Clear()
+        Tabs.TabPages.Add(tabMain)
+
+        Select Case TbID.Text
+
+            Case sKey.AUX.ElecSys.ToString()
+                tabListItems.Text = "Electrical Consumers"
+                Tabs.TabPages.Add(tabListItems)
+
+            Case sKey.AUX.PneumSys.ToString()
+                tabListItems.Text = "Pneumatic Consumers"
+                Tabs.TabPages.Add(tabListItems)
+
+            Case sKey.AUX.HVAC.ToString()
+                tabListItems.Text = "Map Inputs"
+                Tabs.TabPages.Add(tabListItems)
+
+            Case sKey.AUX.Fan
+                Tabs.TabPages.Add(tabTechnologies)
+
+            Case sKey.AUX.SteerPump
+                Tabs.TabPages.Add(tabTechnologies)
+
+        End Select
+
+        Select Case TbID.Text
+            Case sKey.AUX.Fan
+                For Each txt In Declaration.AuxTechs(tAux.Fan)
+                    Me.CbTech.Items.Add(txt)
+                Next
+
+            Case sKey.AUX.SteerPump
+                For Each txt In Declaration.AuxTechs(tAux.SteerPump)
+                    Me.CbTech.Items.Add(txt)
+                Next
+
+            Case sKey.AUX.HVAC
+                For Each txt In Declaration.AuxTechs(tAux.HVAC)
+                    Me.CbTech.Items.Add(txt)
+                Next
+                Me.CbTech.SelectedIndex = 0
+
+            Case sKey.AUX.ElecSys
+                For Each txt In Declaration.AuxTechs(tAux.ElectricSys)
+                    Me.CbTech.Items.Add(txt)
+                Next
+                Me.CbTech.SelectedIndex = 0
+
+
+            Case sKey.AUX.PneumSys
+                For Each txt In Declaration.AuxTechs(tAux.PneumSys)
+                    Me.CbTech.Items.Add(txt)
+                Next
+                Me.CbTech.SelectedIndex = 0
+
+        End Select
+
+
+        If TbID.Text = sKey.AUX.ElecSys Then
+
+            Me.LVTech.Items.Clear()
+            For Each kv In Declaration.AuxESpower
+                Me.LVTech.Items.Add(kv.Key)
+            Next
+            Me.LVTech.Visible = True
+
+            'TB Removed for newer design of existing form 25/9/14
+            '  Me.Height = 457
+
+        Else
+
+            Me.LVTech.Visible = False
+            'TB Removed for newer design of existing form 25/9/14
+            ' Me.Height = 220
+
+        End If
+
+    End Sub
+
+    'Save and close
+    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
+        Me.DialogResult = System.Windows.Forms.DialogResult.OK
+        Me.Close()
+    End Sub
+
+    'Cancel
+    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
+        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
+        Me.Close()
+    End Sub
+
+    'Close form. Check if form is complete and valid
+    Private Sub F_VEH_AuxDlog_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
+        If e.CloseReason <> CloseReason.WindowsShutDown And Me.DialogResult <> Windows.Forms.DialogResult.Cancel Then
+
+            If Trim(Me.TbID.Text) = "" Or Trim(Me.CbType.Text) = "" Then
+                MsgBox("Form is incomplete!", MsgBoxStyle.Critical)
+                e.Cancel = True
+            End If
+
+            If Me.TbID.Text.Contains(",") Or Me.CbType.Text.Contains(",") Or Me.TbPath.Text.Contains(",") Then
+                MsgBox("',' is no valid character!", MsgBoxStyle.Critical)
+                e.Cancel = True
+            End If
+
+            If Cfg.DeclMode Then
+
+                'Old Tech only seems to apply to electricals 
+                If Me.CbTech.Text = "" AndAlso sKey.AUX.ElecSys.ToString() = TbID.Text Then
+                    MsgBox("Form is incomplete!", MsgBoxStyle.Critical)
+                    e.Cancel = True
+                End If
+
+            Else
+
+                'Engineering Mode
+                If Trim(Me.TbPath.Text) = "" Then
+                    MsgBox("Form is incomplete!", MsgBoxStyle.Critical)
+                    e.Cancel = True
+                End If
+
+                'Determin specific Validation based on type
+                Select Case TbID.Text
+
+                    Case sKey.AUX.HVAC
+                        e.Cancel = Not ValidateHVAC()
+
+
+
+                End Select
+
+
+
+            End If
+
+        End If
+    End Sub
+
+    ''' <summary>
+    ''' HVAC VALIDATION
+    ''' </summary>
+    ''' <param name="message">Returns a string with any errors</param>
+    ''' <returns></returns>
+    ''' <remarks></remarks>
+    Private Function ValidateHVAC() As Boolean
+
+        Dim message As String = String.Empty
+
+        'Validate Pulley
+        If Not ValidatePulley(message) Then
+            MessageBox.Show(message)
+            Return False
+        End If
+
+        'Validate Inputs
+        If Not ValidateHVACInputs(message) Then
+            MessageBox.Show(message)
+            Return False
+        End If
+
+        Return True
+
+    End Function
+
+    ''' <summary>
+    ''' HVAC and Alternators use pulleys, this routine checks them
+    ''' </summary>
+    ''' <param name="message"></param>
+    ''' <returns></returns>
+    ''' <remarks></remarks>
+    Private Function ValidatePulley(ByRef message As String) As Boolean
+
+        Dim pulleyEfficiency As String = txtPulleyGearEfficiency.Text.Trim
+        Dim pulleyGearRatio As String = txtPulleyGearRatio.Text.Trim
+
+        'Values present
+        If (pulleyEfficiency.Length = 0) OrElse (pulleyGearRatio.Length = 0) Then
+            message = "Please fill in the pulley values in the main tab."
+            Return False
+        End If
+
+        'Values numeric
+        If Not IsNumeric(pulleyEfficiency) OrElse Not IsNumeric(pulleyGearRatio) Then
+            message = "One of the pulley values on the main tab is not a numeric value."
+            Return False
+        End If
+
+        'Value Ranges
+        Dim efficiencyValue As Single = CType(pulleyEfficiency, Single)
+        Dim gearRatio As Single = CType(pulleyGearRatio, Single)
+
+        Const TooLowRatio As Single = 0.0
+        Const TooHighRatio As Single = 6.0
+        Const TooLowEfficiency As Single = 0
+        Const TooHighEfficiency As Single = 1
+
+        'Efficiency check
+        If (efficiencyValue <= TooLowEfficiency) OrElse (efficiencyValue >= TooHighEfficiency) Then
+            message = "Efficiency value must be greater than 0 and less than 1"
+            Return False
+        End If
+
+        'Ratio Check
+        If (gearRatio <= TooLowRatio) OrElse (gearRatio >= TooHighRatio) Then
+            message = "Pulley gear ratio value must be greater than 0 and less than 6"
+            Return False
+        End If
+
+        message = String.Empty
+        Return True
+
+    End Function
+
+    ''' <summary>
+    ''' HVAC Require the correct number of inputs, for this we need to instantiate the HVACLoad Demand
+    ''' Using the HVACMap lookup Map File 
+    ''' </summary>
+    ''' <param name="message"></param>
+    ''' <returns></returns>
+    ''' <remarks></remarks>
+    Private Function ValidateHVACInputs(ByRef message As String) As Boolean
+
+        'Validate Number of inputs
+        If dgvInputs.Rows.Count < 2 Then
+            message = "No Inputs are available please select the lookup map on the Main tab"
+            Return False
+        End If
+
+        Return True
+
+    End Function
+
+    'Browse for .vaux files
+    Private Sub BtBrowse_Click(sender As System.Object, e As System.EventArgs) Handles BtBrowse.Click
+
+
+        If fbAUX.OpenDialog(fFileRepl(Me.TbPath.Text, VehPath)) Then Me.TbPath.Text = fFileWoDir(fbAUX.Files(0), VehPath)
+
+        If (TbID.Text = sKey.AUX.HVAC AndAlso Me.TbPath.Text.Length <> 0) Then
+            Dim frmHVAC As New VectoAuxiliaries.UI.F_HVAC(Me.TbPath.Text)
+
+            'If we have results then populate the inputs tab
+            If (frmHVAC.ShowDialog() = Windows.Forms.DialogResult.OK) Then
+
+                dgvInputs.Rows.Clear()
+
+                ListItems.Clear()
+
+                For Each item As KeyValuePair(Of String, String) In frmHVAC.Inputs
+
+                    Dim row As DataGridViewRow = dgvInputs.Rows(dgvInputs.Rows.Add())
+                    row.Cells(0).Value = item.Key
+                    row.Cells(1).Value = item.Value
+
+
+                    ListItems.Add(item.Key, item.Value)
+
+                Next
+
+ 
+            End If
+
+
+        End If
+
+
+    End Sub
+
+    'Update ID when Aux Type was changed
+    Private Sub CbType_TextChanged(sender As Object, e As System.EventArgs) Handles CbType.TextChanged
+
+        If Me.CbType.Text = "" Then
+            Me.TbID.Text = ""
+        Else
+            If Cfg.DeclMode Then
+                Select Case Me.CbType.SelectedIndex
+                    Case 0
+                        Me.TbID.Text = sKey.AUX.Fan
+                    Case 1
+                        Me.TbID.Text = sKey.AUX.SteerPump
+
+                    Case Else '2
+                        Me.TbID.Text = sKey.AUX.HVAC
+                End Select
+            Else
+                Me.TbID.Text = Trim(UCase(Me.CbType.Text.Substring(0, CInt(Math.Min(Me.CbType.Text.Length, 3)))))
+            End If
+        End If
+
+
+
+
+    End Sub
+
+    'Update help label if ID was changed
+    Private Sub TbID_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbID.TextChanged
+
+        DeclInit()
+
+        If Trim(Me.TbID.Text) = "" Or Cfg.DeclMode Then
+            Me.LbIDhelp.Text = ""
+        Else
+            Me.LbIDhelp.Text = "Header in Driving cycle: <AUX_" & Trim(Me.TbID.Text) & ">"
+        End If
+
+    End Sub
+
+
+    Private Sub btnConsumerAdd_Click(sender As Object, e As EventArgs) Handles btnConsumerAdd.Click
+
+    End Sub
+
+
+    Public Sub ClearAllValues(Optional clearTypes As Boolean = False)
+
+        If (clearTypes) Then
+            Me.CbType.SelectedIndex = -1
+            Me.CbType.Text = ""
+            Me.TbID.Text = ""
+        End If
+
+        Me.TbPath.Text = ""
+        Me.txtPulleyGearEfficiency.Text = String.Empty
+        Me.txtPulleyGearRatio.Text = String.Empty
+        Me.dgvInputs.ClearSelection()
+        Me.LVTech.Clear()
+
+    End Sub
+
+End Class
diff --git a/VECTO/Input Files/cVECTO.vb b/VECTO/Input Files/cVECTO.vb
index f34ba3b0249152af9044124fd37f344c37b7c99f..60186ceda9dce982b653e455bd64f85277114b2d 100644
--- a/VECTO/Input Files/cVECTO.vb	
+++ b/VECTO/Input Files/cVECTO.vb	
@@ -1,835 +1,855 @@
-' Copyright 2014 European Union.
-' Licensed under the EUPL (the 'Licence');
-'
-' * You may not use this work except in compliance with the Licence.
-' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
-' * Unless required by applicable law or agreed to in writing,
-'   software distributed under the Licence is distributed on an "AS IS" basis,
-'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-'
-' See the LICENSE.txt for the specific language governing permissions and limitations.
-
-Imports System.Collections.Generic
-
-Public Class cVECTO
-
-    Private Const FormatVersion As Short = 2
-    Private FileVersion As Short
-
-    Private sFilePath As String
-
-    Private MyPath As String
-
-    'Input parameters
-    Private stPathVEH As cSubPath
-    Private stPathENG As cSubPath
-    Private stPathGBX As cSubPath
-
-    Private boStartStop As Boolean
-    Private siStStV As Single
-    Private siStStT As Single
-    Public StStDelay As Integer
-
-    Private stDesMaxFile As cSubPath
-    Private laDesV As List(Of Single)
-    Private laDesMax As List(Of Single)
-    Private laDesMin As List(Of Single)
-    Private DesMaxDim As Integer
-
-    Public AuxPaths As Dictionary(Of String, cAuxEntry)
-    Public AuxRefs As Dictionary(Of String, cAux)          'Alle Nebenverbraucher die in der Veh-Datei UND im Zyklus definiert sind
-    Public AuxDef As Boolean                               'True wenn ein oder mehrere Nebenverbraucher definiert sind
-    Public EStechs As List(Of String)
-
-    Public CycleFiles As List(Of cSubPath)
-
-    Public EngOnly As Boolean
-
-    Public a_lookahead As Single
-    Public vMin As Single
-    Public vMinLA As Single
-    Public LookAheadOn As Boolean
-    Public OverSpeedOn As Boolean
-    Public OverSpeed As Single
-    Public UnderSpeed As Single
-    Public EcoRollOn As Boolean
-
-    Private MyFileList As List(Of String)
-
-    Public SavedInDeclMode As Boolean
-
-
-    Public Class cAuxEntry
-        Public Type As String
-        Public Path As cSubPath
-        Public TechStr As String = ""
-
-        Public Sub New()
-            Path = New cSubPath
-        End Sub
-
-    End Class
-
-    Public Function CreateFileList() As Boolean
-        Dim Aux0 As cAuxEntry
-        Dim sb As cSubPath
-        Dim str As String
-
-        MyFileList = New List(Of String)
-
-        '.vecto
-        MyFileList.Add(Me.sFilePath)
-
-        'Veh
-        If Not Me.EngOnly Then
-            MyFileList.Add(Me.PathVEH)
-
-            If Not VEH.CreateFileList Then Return False
-            For Each str In VEH.FileList
-                MyFileList.Add(str)
-            Next
-        End If
-
-        'Eng
-        MyFileList.Add(Me.PathENG)
-
-        If Not ENG.CreateFileList Then Return False
-        For Each str In ENG.FileList
-            MyFileList.Add(str)
-        Next
-
-        If Not Me.EngOnly Then
-
-            'Gbx
-            MyFileList.Add(Me.PathGBX)
-
-            If Not GBX.CreateFileList Then Return False
-            For Each str In GBX.FileList
-                MyFileList.Add(str)
-            Next
-
-            'Aux
-            If AuxDef And Not Cfg.DeclMode Then
-                For Each Aux0 In Me.AuxPaths.Values
-                    MyFileList.Add(Aux0.Path.FullPath)
-                Next
-            End If
-
-            '.vacc
-            MyFileList.Add(Me.stDesMaxFile.FullPath)
-
-        End If
-
-        'Cycles
-        For Each sb In Me.CycleFiles
-            MyFileList.Add(sb.FullPath)
-        Next
-
-
-        Return True
-
-    End Function
-
-    Public Sub New()
-
-        MyPath = ""
-        sFilePath = ""
-
-        stPathVEH = New cSubPath
-        stPathENG = New cSubPath
-        stPathGBX = New cSubPath
-
-        stDesMaxFile = New cSubPath
-
-        laDesV = New List(Of Single)
-        laDesMax = New List(Of Single)
-        laDesMin = New List(Of Single)
-
-        AuxPaths = New Dictionary(Of String, cAuxEntry)
-        AuxRefs = New Dictionary(Of String, cAux)
-        AuxDef = False
-        EStechs = New List(Of String)
-
-        CycleFiles = New List(Of cSubPath)
-
-    End Sub
-
-    Public Function SaveFile() As Boolean
-        Dim AuxEntryKV As KeyValuePair(Of String, cAuxEntry)
-        'Dim s As String
-        Dim sb As cSubPath
-        Dim JSON As New cJSON
-        Dim ls As List(Of Object)
-        Dim dic As Dictionary(Of String, Object)
-        Dim dic0 As Dictionary(Of String, Object)
-
-        'Header
-        dic = New Dictionary(Of String, Object)
-        dic.Add("CreatedBy", Lic.LicString & " (" & Lic.GUID & ")")
-        dic.Add("Date", Now.ToString)
-        dic.Add("AppVersion", VECTOvers)
-        dic.Add("FileVersion", FormatVersion)
-        JSON.Content.Add("Header", dic)
-
-        'Body
-        dic0 = New Dictionary(Of String, Object)
-
-        dic0.Add("SavedInDeclMode", Cfg.DeclMode)
-        SavedInDeclMode = Cfg.DeclMode
-
-        'Main Files
-        dic0.Add("VehicleFile", stPathVEH.PathOrDummy)
-        dic0.Add("EngineFile", stPathENG.PathOrDummy)
-        dic0.Add("GearboxFile", stPathGBX.PathOrDummy)
-
-        'Cycles
-        If CycleFiles.Count > 0 Then
-            ls = New List(Of Object)
-            For Each sb In CycleFiles
-                ls.Add(sb.PathOrDummy)
-            Next
-            dic0.Add("Cycles", ls)
-        End If
-
-        'Aux
-        If AuxPaths.Count > 0 Then
-            ls = New List(Of Object)
-            For Each AuxEntryKV In AuxPaths
-                dic = New Dictionary(Of String, Object)
-                dic.Add("ID", Trim(UCase(AuxEntryKV.Key)))
-                dic.Add("Type", AuxEntryKV.Value.Type)
-                dic.Add("Path", AuxEntryKV.Value.Path.PathOrDummy)
-                dic.Add("Technology", AuxEntryKV.Value.TechStr)
-
-                If AuxEntryKV.Key = sKey.AUX.ElecSys Then
-                    dic.Add("TechList", EStechs)
-                End If
-
-                ls.Add(dic)
-            Next
-            dic0.Add("Aux", ls)
-        End If
-
-        'VACC
-        dic0.Add("VACC", stDesMaxFile.PathOrDummy)
-
-        'EngineOnlyMode
-        dic0.Add("EngineOnlyMode", EngOnly)
-
-        'Start Stop
-        dic = New Dictionary(Of String, Object)
-        dic.Add("Enabled", boStartStop)
-        dic.Add("MaxSpeed", siStStV)
-        dic.Add("MinTime", siStStT)
-        dic.Add("Delay", StStDelay)
-        dic0.Add("StartStop", dic)
-
-        'LAC
-        dic = New Dictionary(Of String, Object)
-        dic.Add("Enabled", LookAheadOn)
-        dic.Add("Dec", a_lookahead)
-        dic.Add("MinSpeed", vMinLA)
-        dic0.Add("LAC", dic)
-
-        'Overspeed / EcoRoll
-        dic = New Dictionary(Of String, Object)
-        If EcoRollOn Then
-            dic.Add("Mode", "EcoRoll")
-        ElseIf OverSpeedOn Then
-            dic.Add("Mode", "OverSpeed")
-        Else
-            dic.Add("Mode", "Off")
-        End If
-        dic.Add("MinSpeed", vMin)
-        dic.Add("OverSpeed", OverSpeed)
-        dic.Add("UnderSpeed", UnderSpeed)
-        dic0.Add("OverSpeedEcoRoll", dic)
-
-
-        JSON.Content.Add("Body", dic0)
-
-        Return JSON.WriteFile(sFilePath)
-
-    End Function
-
-    Public Function ReadFile() As Boolean
-        Dim AuxEntry As cAuxEntry
-        Dim AuxID As String
-        Dim MsgSrc As String
-        Dim SubPath As cSubPath
-        Dim JSON As New cJSON
-        Dim str As String
-        Dim dic As Object
-
-        MsgSrc = "Main/ReadInp/GEN"
-
-        SetDefault()
-
-        If Not JSON.ReadFile(sFilePath) Then Return False
-
-        Try
-
-            FileVersion = JSON.Content("Header")("FileVersion")
-
-            If FileVersion > 1 Then
-                SavedInDeclMode = JSON.Content("Body")("SavedInDeclMode")
-            Else
-                SavedInDeclMode = Cfg.DeclMode
-            End If
-
-            If Not JSON.Content("Body")("VehicleFile") Is Nothing Then stPathVEH.Init(MyPath, JSON.Content("Body")("VehicleFile"))
-
-            stPathENG.Init(MyPath, JSON.Content("Body")("EngineFile"))
-
-            If Not JSON.Content("Body")("GearboxFile") Is Nothing Then stPathGBX.Init(MyPath, JSON.Content("Body")("GearboxFile"))
-
-            If Not JSON.Content("Body")("Cycles") Is Nothing Then
-                For Each str In JSON.Content("Body")("Cycles")
-                    SubPath = New cSubPath
-                    SubPath.Init(MyPath, str)
-                    CycleFiles.Add(SubPath)
-                Next
-            End If
-
-            If Not JSON.Content("Body")("Aux") Is Nothing Then
-                For Each dic In JSON.Content("Body")("Aux")
-
-                    AuxID = UCase(Trim(dic("ID").ToString))
-
-                    If AuxPaths.ContainsKey(AuxID) Then
-                        WorkerMsg(tMsgID.Err, "Multiple definitions of the same auxiliary type (" & AuxID & ")!", MsgSrc)
-                        Return False
-                    End If
-
-                    AuxEntry = New cAuxEntry
-
-                    AuxEntry.Type = dic("Type")
-                    AuxEntry.Path.Init(MyPath, dic("Path"))
-
-                    If Not dic("Technology") Is Nothing Then AuxEntry.TechStr = dic("Technology")
-
-                    AuxPaths.Add(AuxID, AuxEntry)
-
-                    AuxDef = True
-
-                    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
-
-                Next
-            End If
-
-            If Not JSON.Content("Body")("VACC") Is Nothing Then stDesMaxFile.Init(MyPath, JSON.Content("Body")("VACC"))
-
-            EngOnly = JSON.Content("Body")("EngineOnlyMode")
-
-            If Not JSON.Content("Body")("StartStop") Is Nothing Then
-                dic = JSON.Content("Body")("StartStop")
-                boStartStop = dic("Enabled")
-                siStStV = dic("MaxSpeed")
-                siStStT = dic("MinTime")
-                StStDelay = dic("Delay")
-            Else
-                boStartStop = False
-            End If
-
-            If Not JSON.Content("Body")("LAC") Is Nothing Then
-                dic = JSON.Content("Body")("LAC")
-                LookAheadOn = dic("Enabled")
-                a_lookahead = dic("Dec")
-                vMinLA = dic("MinSpeed")
-            Else
-                LookAheadOn = False
-            End If
-
-            If Not JSON.Content("Body")("OverSpeedEcoRoll") Is Nothing Then
-
-                dic = JSON.Content("Body")("OverSpeedEcoRoll")
-
-                Select Case UCase(dic("Mode").ToString).Trim
-                    Case "ECOROLL"
-                        OverSpeedOn = False
-                        EcoRollOn = True
-
-                    Case "OVERSPEED"
-                        OverSpeedOn = True
-                        EcoRollOn = False
-
-                    Case "OFF"
-                        OverSpeedOn = False
-                        EcoRollOn = False
-
-                    Case Else
-                        WorkerMsg(tMsgID.Err, "Value '" & dic("Mode") & "' is not valid for OverSpeedEcoRoll/Mode!", MsgSrc)
-                        Return False
-                End Select
-
-                vMin = dic("MinSpeed")
-                OverSpeed = dic("OverSpeed")
-                If Not dic("UnderSpeed") Is Nothing Then UnderSpeed = dic("UnderSpeed")
-
-            Else
-                OverSpeedOn = False
-                EcoRollOn = False
-            End If
-
-        Catch ex As Exception
-            WorkerMsg(tMsgID.Err, "Failed to read VECTO file! " & ex.Message, MsgSrc)
-            Return False
-        End Try
-
-
-        Return True
-
-
-    End Function
-
-    Private Sub SetDefault()
-        boStartStop = False
-        siStStV = 5
-        siStStT = 5
-        StStDelay = 0
-        FileVersion = 0
-
-        stPathVEH.Clear()
-        stPathENG.Clear()
-        CycleFiles.Clear()
-        stPathGBX.Clear()
-
-        stDesMaxFile.Clear()
-        laDesV.Clear()
-        laDesMax.Clear()
-        laDesMin.Clear()
-        DesMaxDim = -1
-
-        AuxPaths.Clear()
-        AuxRefs.Clear()
-        AuxDef = False
-        EStechs.Clear()
-
-        EngOnly = False
-
-        a_lookahead = 0
-        vMin = 0
-        LookAheadOn = True
-        OverSpeedOn = False
-        EcoRollOn = False
-        OverSpeed = 0
-        UnderSpeed = 0
-        vMinLA = 0
-
-        SavedInDeclMode = False
-
-    End Sub
-
-    Public Function DeclInit() As Boolean
-
-        Dim cl As List(Of String)
-        Dim s As String
-        Dim SubPath As cSubPath
-        Dim MsgSrc As String
-
-        MsgSrc = "VECTO/DeclInit"
-
-        EngOnly = False
-
-        CycleFiles.Clear()
-
-        cl = Declaration.SegRef.GetCycles
-
-        For Each s In cl
-            SubPath = New cSubPath
-            SubPath.Init(MyPath, s)
-            CycleFiles.Add(SubPath)
-        Next
-
-        stDesMaxFile.Init(MyPath, Declaration.SegRef.VACCfile)
-
-        siStStV = cDeclaration.SSspeed
-        siStStT = cDeclaration.SStime
-        StStDelay = cDeclaration.SSdelay
-
-        If Not EcoRollOn Then OverSpeedOn = True
-
-        OverSpeed = cDeclaration.Overspeed
-        UnderSpeed = cDeclaration.Underspeed
-        vMin = cDeclaration.ECvmin
-
-        LookAheadOn = True
-        a_lookahead = cDeclaration.LACa
-        vMinLA = cDeclaration.LACvmin
-
-        'No need to check Aux (AuxDef). Will be checked in cDeclaration.CalcInitLoad
-
-        Return True
-
-    End Function
-
-    'This Sub reads those Input-files that do not have their own class, etc.
-    Public Function Init() As Boolean
-        Dim file As cFile_V3
-        Dim line As String()
-
-        Dim MsgSrc As String
-
-        MsgSrc = "VECTO/Init"
-
-        If Not EngOnly Then
-
-            file = New cFile_V3
-
-            If Not file.OpenRead(stDesMaxFile.FullPath) Then
-                WorkerMsg(tMsgID.Err, "Can't read .vacc file (" & stDesMaxFile.FullPath & ")", MsgSrc)
-                Return False
-            End If
-
-            'Skip Header
-            file.ReadLine()
-
-            laDesV.Clear()
-            laDesMax.Clear()
-            laDesMin.Clear()
-            DesMaxDim = -1
-            Try
-
-                Do While Not file.EndOfFile
-
-                    DesMaxDim += 1
-
-                    line = file.ReadLine
-
-                    laDesV.Add(CSng(line(0)) / 3.6)   'km/h => m/s !!!!
-                    laDesMax.Add(CSng(line(1)))
-                    laDesMin.Add(CSng(line(2)))
-
-                Loop
-
-            Catch ex As Exception
-
-                file.Close()
-                WorkerMsg(tMsgID.Err, "Error in .vacc file. " & ex.Message & " (" & stDesMaxFile.FullPath & ")", MsgSrc, stDesMaxFile.FullPath)
-                Return False
-
-            End Try
-
-            file.Close()
-
-        End If
-
-        Return True
-
-    End Function
-
-#Region "Aux"
-
-    Public Function AuxInit() As Boolean
-
-        Dim Aux0 As cAux
-        Dim AuxPathKV As KeyValuePair(Of String, cAuxEntry)
-        Dim DRIauxcheck As New Dictionary(Of String, Boolean)
-        Dim AuxID As String
-
-        Dim MsgSrc As String
-
-        MsgSrc = "VEH/AuxInit"
-
-        AuxRefs = New Dictionary(Of String, cAux)
-
-        If Cfg.DeclMode Then
-
-            For Each AuxPathKV In AuxPaths
-                AuxRefs.Add(AuxPathKV.Key, Nothing)
-            Next
-
-            Return True
-
-        End If
-
-
-        If DRI.AuxDef Xor AuxDef Then
-
-            If AuxDef Then
-                WorkerMsg(tMsgID.Err, "No auxiliary input defined in driving cycle!", MsgSrc)
-                Return False
-            Else
-                WorkerMsg(tMsgID.Warn, "No auxiliary defined in vehicle file! Psupply input will be ignored!", MsgSrc)
-                Return True
-            End If
-
-        End If
-
-        If Not (DRI.AuxDef Or AuxDef) Then Return True
-
-
-        For Each AuxID In DRI.AuxComponents.Keys
-            DRIauxcheck.Add(AuxID, False)
-        Next
-
-        For Each AuxPathKV In AuxPaths
-
-            MsgSrc = "VEH/AuxInit/" & AuxPathKV.Key
-
-            If Not DRI.AuxComponents.ContainsKey(AuxPathKV.Key) Then
-                WorkerMsg(tMsgID.Err, "No Psupply input defined in driving cycle for auxiliary '" & AuxPathKV.Key & "'!", MsgSrc)
-                Return False
-            End If
-
-            Aux0 = New cAux
-            Aux0.Filepath = AuxPathKV.Value.Path.FullPath
-
-            If Not Aux0.Readfile Then
-                'Notificationin ReadFile()
-                Return False
-            End If
-
-            AuxRefs.Add(AuxPathKV.Key, Aux0)
-
-            DRIauxcheck(AuxPathKV.Key) = True
-
-        Next
-
-        MsgSrc = "VEH/AuxInit"
-
-        For Each AuxID In DRI.AuxComponents.Keys
-            If Not DRIauxcheck(AuxID) Then WorkerMsg(tMsgID.Warn, "Auxiliary '" & AuxID & "' not found! Psupply input will be ignored!", MsgSrc)
-        Next
-
-        Return True
-
-    End Function
-
-    Public Function Paux(ByVal AuxID As String, ByVal t As Integer, ByVal nU As Single) As Single
-        Dim Psupply As Single
-        Dim Px As Single
-        Dim Aux0 As cAux
-
-        Dim MsgSrc As String
-
-        MsgSrc = "VEH/Paux"
-
-        If Cfg.DeclMode Then Return Declaration.AuxPower(AuxID)
-
-        If AuxDef Then
-
-            Aux0 = AuxRefs(AuxID)
-
-            Psupply = DRI.AuxComponents(AuxID)(t)
-
-            If Psupply < 0 Then GoTo lbAuxError
-
-            Px = Aux0.Paux(nU, Psupply)
-
-            If Px < 0 Then GoTo lbAuxError
-
-            Return Px
-
-        Else
-
-            Return 0
-
-        End If
-
-
-lbAuxError:
-        MODdata.ModErrors.AuxNegative = AuxID
-        Return 0
-
-
-    End Function
-
-    Public Function PauxSum(ByVal t As Integer, ByVal nU As Single) As Single
-        Dim sum As Single
-        Dim AuxID As String
-
-        Dim MsgSrc As String
-
-        MsgSrc = "VEH/Paux"
-
-        If AuxDef Then
-
-            sum = 0
-
-            For Each AuxID In AuxRefs.Keys
-
-                sum += Paux(AuxID, t, nU)
-
-            Next
-
-            Return sum
-
-        Else
-
-            Return 0
-
-        End If
-
-    End Function
-
-#End Region
-
-
-#Region "Properties"
-
-    Public ReadOnly Property FileList As List(Of String)
-        Get
-            Return MyFileList
-        End Get
-    End Property
-
-
-    Public Property FilePath() As String
-        Get
-            Return sFilePath
-        End Get
-        Set(ByVal value As String)
-            sFilePath = value
-            If sFilePath = "" Then
-                MyPath = ""
-            Else
-                MyPath = IO.Path.GetDirectoryName(sFilePath) & "\"
-            End If
-        End Set
-    End Property
-
-
-    Public Property PathVEH(Optional ByVal Original As Boolean = False) As String
-        Get
-            If Original Then
-                Return stPathVEH.OriginalPath
-            Else
-                Return stPathVEH.FullPath
-            End If
-        End Get
-        Set(ByVal value As String)
-            stPathVEH.Init(MyPath, value)
-        End Set
-    End Property
-
-    Public Property PathENG(Optional ByVal Original As Boolean = False) As String
-        Get
-            If Original Then
-                Return stPathENG.OriginalPath
-            Else
-                Return stPathENG.FullPath
-            End If
-        End Get
-        Set(ByVal value As String)
-            stPathENG.Init(MyPath, value)
-        End Set
-    End Property
-
-    Public Property PathGBX(Optional ByVal Original As Boolean = False) As String
-        Get
-            If Original Then
-                Return stPathGBX.OriginalPath
-            Else
-                Return stPathGBX.FullPath
-            End If
-        End Get
-        Set(ByVal value As String)
-            stPathGBX.Init(MyPath, value)
-        End Set
-    End Property
-
-
-    Public Property StartStop() As Boolean
-        Get
-            Return boStartStop
-        End Get
-        Set(ByVal value As Boolean)
-            boStartStop = value
-        End Set
-    End Property
-
-    Public Property StStV() As Single
-        Get
-            Return siStStV
-        End Get
-        Set(ByVal value As Single)
-            siStStV = value
-        End Set
-    End Property
-
-    Public Property StStT() As Single
-        Get
-            Return siStStT
-        End Get
-        Set(ByVal value As Single)
-            siStStT = value
-        End Set
-    End Property
-
-    Public Property DesMaxFile(Optional ByVal Original As Boolean = False) As String
-        Get
-            If Original Then
-                Return stDesMaxFile.OriginalPath
-            Else
-                Return stDesMaxFile.FullPath
-            End If
-        End Get
-        Set(ByVal value As String)
-            stDesMaxFile.Init(MyPath, value)
-        End Set
-    End Property
-
-#End Region
-
-    Public Function aDesMax(ByVal v As Single) As Single
-        Dim i As Int32
-
-        'Extrapolation for x < x(1)
-        If laDesV(0) >= v Then
-            If laDesV(0) > v Then MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]"
-            i = 1
-            GoTo lbInt
-        End If
-
-        i = 0
-        Do While laDesV(i) < v And i < DesMaxDim
-            i += 1
-        Loop
-
-        'Extrapolation for x > x(imax)
-        If laDesV(i) < v Then
-            MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]"
-        End If
-
-lbInt:
-        'Interpolation
-        Return (v - laDesV(i - 1)) * (laDesMax(i) - laDesMax(i - 1)) / (laDesV(i) - laDesV(i - 1)) + laDesMax(i - 1)
-
-    End Function
-
-    Public Function aDesMin(ByVal v As Single) As Single
-        Dim i As Int32
-
-        'Extrapolation for x < x(1)
-        If laDesV(0) >= v Then
-            If laDesV(0) > v Then MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]"
-            i = 1
-            GoTo lbInt
-        End If
-
-        i = 0
-        Do While laDesV(i) < v And i < DesMaxDim
-            i += 1
-        Loop
-
-        'Extrapolation for x > x(imax)
-        If laDesV(i) < v Then
-            MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]"
-        End If
-
-lbInt:
-        'Interpolation
-        Return (v - laDesV(i - 1)) * (laDesMin(i) - laDesMin(i - 1)) / (laDesV(i) - laDesV(i - 1)) + laDesMin(i - 1)
-
-    End Function
-
-
-End Class
-
+' Copyright 2014 European Union.
+' Licensed under the EUPL (the 'Licence');
+'
+' * You may not use this work except in compliance with the Licence.
+' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
+' * Unless required by applicable law or agreed to in writing,
+'   software distributed under the Licence is distributed on an "AS IS" basis,
+'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+'
+' See the LICENSE.txt for the specific language governing permissions and limitations.
+
+Imports VectoAuxiliaries.ElectricalConsumers
+
+Imports System.Collections.Generic
+
+Public Class cVECTO
+
+    Private Const FormatVersion As Short = 2
+    Private FileVersion As Short
+
+    Private sFilePath As String
+
+    Private MyPath As String
+
+    'Input parameters
+    Private stPathVEH As cSubPath
+    Private stPathENG As cSubPath
+    Private stPathGBX As cSubPath
+
+    Private boStartStop As Boolean
+    Private siStStV As Single
+    Private siStStT As Single
+    Public StStDelay As Integer
+
+    Private stDesMaxFile As cSubPath
+    Private laDesV As List(Of Single)
+    Private laDesMax As List(Of Single)
+    Private laDesMin As List(Of Single)
+    Private DesMaxDim As Integer
+
+    Public AuxPaths As Dictionary(Of String, cAuxEntry)
+    Public AuxRefs As Dictionary(Of String, cAux)          'Alle Nebenverbraucher die in der Veh-Datei UND im Zyklus definiert sind
+    Public AuxDef As Boolean                               'True wenn ein oder mehrere Nebenverbraucher definiert sind
+    Public EStechs As List(Of String)
+
+    Public CycleFiles As List(Of cSubPath)
+
+    Public EngOnly As Boolean
+
+    Public a_lookahead As Single
+    Public vMin As Single
+    Public vMinLA As Single
+    Public LookAheadOn As Boolean
+    Public OverSpeedOn As Boolean
+    Public OverSpeed As Single
+    Public UnderSpeed As Single
+    Public EcoRollOn As Boolean
+
+    Private MyFileList As List(Of String)
+
+    Public SavedInDeclMode As Boolean
+
+
+
+
+    Public Function CreateFileList() As Boolean
+        Dim Aux0 As cAuxEntry
+        Dim sb As cSubPath
+        Dim str As String
+
+        MyFileList = New List(Of String)
+
+        '.vecto
+        MyFileList.Add(Me.sFilePath)
+
+        'Veh
+        If Not Me.EngOnly Then
+            MyFileList.Add(Me.PathVEH)
+
+            If Not VEH.CreateFileList Then Return False
+            For Each str In VEH.FileList
+                MyFileList.Add(str)
+            Next
+        End If
+
+        'Eng
+        MyFileList.Add(Me.PathENG)
+
+        If Not ENG.CreateFileList Then Return False
+        For Each str In ENG.FileList
+            MyFileList.Add(str)
+        Next
+
+        If Not Me.EngOnly Then
+
+            'Gbx
+            MyFileList.Add(Me.PathGBX)
+
+            If Not GBX.CreateFileList Then Return False
+            For Each str In GBX.FileList
+                MyFileList.Add(str)
+            Next
+
+            'Aux
+            If AuxDef And Not Cfg.DeclMode Then
+                For Each Aux0 In Me.AuxPaths.Values
+                    MyFileList.Add(Aux0.Path.FullPath)
+                Next
+            End If
+
+            '.vacc
+            MyFileList.Add(Me.stDesMaxFile.FullPath)
+
+        End If
+
+        'Cycles
+        For Each sb In Me.CycleFiles
+            MyFileList.Add(sb.FullPath)
+        Next
+
+
+        Return True
+
+    End Function
+
+    Public Sub New()
+
+        MyPath = ""
+        sFilePath = ""
+
+        stPathVEH = New cSubPath
+        stPathENG = New cSubPath
+        stPathGBX = New cSubPath
+
+        stDesMaxFile = New cSubPath
+
+        laDesV = New List(Of Single)
+        laDesMax = New List(Of Single)
+        laDesMin = New List(Of Single)
+
+        AuxPaths = New Dictionary(Of String, cAuxEntry)
+        AuxRefs = New Dictionary(Of String, cAux)
+        AuxDef = False
+        EStechs = New List(Of String)
+
+        CycleFiles = New List(Of cSubPath)
+
+    End Sub
+
+    Public Function SaveFile() As Boolean
+        Dim AuxEntryKV As KeyValuePair(Of String, cAuxEntry)
+        'Dim s As String
+        Dim sb As cSubPath
+        Dim JSON As New cJSON
+        Dim ls As List(Of Object)
+        Dim dic As Dictionary(Of String, Object)
+        Dim dic0 As Dictionary(Of String, Object)
+
+        'Header
+        dic = New Dictionary(Of String, Object)
+        dic.Add("CreatedBy", Lic.LicString & " (" & Lic.GUID & ")")
+        dic.Add("Date", Now.ToString)
+        dic.Add("AppVersion", VECTOvers)
+        dic.Add("FileVersion", FormatVersion)
+        JSON.Content.Add("Header", dic)
+
+        'Body
+        dic0 = New Dictionary(Of String, Object)
+
+        dic0.Add("SavedInDeclMode", Cfg.DeclMode)
+        SavedInDeclMode = Cfg.DeclMode
+
+        'Main Files
+        dic0.Add("VehicleFile", stPathVEH.PathOrDummy)
+        dic0.Add("EngineFile", stPathENG.PathOrDummy)
+        dic0.Add("GearboxFile", stPathGBX.PathOrDummy)
+
+        'Cycles
+        If CycleFiles.Count > 0 Then
+            ls = New List(Of Object)
+            For Each sb In CycleFiles
+                ls.Add(sb.PathOrDummy)
+            Next
+            dic0.Add("Cycles", ls)
+        End If
+
+        'Limited Information regarding Auxillaries under 2.0.4-Beta release, 
+
+        'Aux
+        If AuxPaths.Count > 0 Then
+            ls = New List(Of Object)
+            For Each AuxEntryKV In AuxPaths
+                dic = New Dictionary(Of String, Object)
+                dic.Add("ID", Trim(UCase(AuxEntryKV.Key)))
+                dic.Add("Type", AuxEntryKV.Value.Type)
+                dic.Add("Path", AuxEntryKV.Value.Path.PathOrDummy)
+                dic.Add("Technology", AuxEntryKV.Value.TechStr)
+
+        'TB 29/9/2014 - Augmentation of Auxillary information to be stored in the configuration file post 2.0.4-Beta release
+
+                'TODO - TB BIG CHANGE HERE ELECTRICAL SYSTEM 
+                If AuxEntryKV.Key = sKey.AUX.ElecSys Then
+                    dic.Add("PulleyGearEfficiencyES", AuxEntryKV.Value.PulleyGearEfficiencyES)
+                    dic.Add("PulleyGearRatioES", AuxEntryKV.Value.PulleyGearRatioES)
+                    dic.Add("TechList", EStechs)
+                    dic.Add("ConsumersES", AuxEntryKV.Value.ConsumerListES)
+                End If
+
+                'TODO - TB BIG CHANGE HERE ( HVAC SYSTEM )
+                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)
+                End If
+
+                'TODO - TB BIG CHANGE HERE ( PNEUMATIC SYSTEM )
+                If AuxEntryKV.Key = sKey.AUX.PneumSys Then
+                    dic.Add("PulleyGearEfficiencyPS", AuxEntryKV.Value.PulleyGearEfficiencyPS)
+                    dic.Add("PulleyGearRatioPS", AuxEntryKV.Value.PulleyGearRatioPS)
+                    dic.Add("ConsumersPS", AuxEntryKV.Value.ConsumerListPS)
+
+                End If
+
+                ls.Add(dic)
+            Next
+            dic0.Add("Aux", ls)
+        End If
+
+        'VACC
+        dic0.Add("VACC", stDesMaxFile.PathOrDummy)
+
+        'EngineOnlyMode
+        dic0.Add("EngineOnlyMode", EngOnly)
+
+        'Start Stop
+        dic = New Dictionary(Of String, Object)
+        dic.Add("Enabled", boStartStop)
+        dic.Add("MaxSpeed", siStStV)
+        dic.Add("MinTime", siStStT)
+        dic.Add("Delay", StStDelay)
+        dic0.Add("StartStop", dic)
+
+        'LAC
+        dic = New Dictionary(Of String, Object)
+        dic.Add("Enabled", LookAheadOn)
+        dic.Add("Dec", a_lookahead)
+        dic.Add("MinSpeed", vMinLA)
+        dic0.Add("LAC", dic)
+
+        'Overspeed / EcoRoll
+        dic = New Dictionary(Of String, Object)
+        If EcoRollOn Then
+            dic.Add("Mode", "EcoRoll")
+        ElseIf OverSpeedOn Then
+            dic.Add("Mode", "OverSpeed")
+        Else
+            dic.Add("Mode", "Off")
+        End If
+        dic.Add("MinSpeed", vMin)
+        dic.Add("OverSpeed", OverSpeed)
+        dic.Add("UnderSpeed", UnderSpeed)
+        dic0.Add("OverSpeedEcoRoll", dic)
+
+
+        JSON.Content.Add("Body", dic0)
+
+        Return JSON.WriteFile(sFilePath)
+
+    End Function
+
+    Public Function ReadFile() As Boolean
+        Dim AuxEntry As cAuxEntry
+        Dim AuxID As String
+        Dim MsgSrc As String
+        Dim SubPath As cSubPath
+        Dim JSON As New cJSON
+        Dim str As String
+        Dim dic As Object
+
+        MsgSrc = "Main/ReadInp/GEN"
+
+        SetDefault()
+
+        If Not JSON.ReadFile(sFilePath) Then Return False
+
+        Try
+
+            FileVersion = JSON.Content("Header")("FileVersion")
+
+            If FileVersion > 1 Then
+                SavedInDeclMode = JSON.Content("Body")("SavedInDeclMode")
+            Else
+                SavedInDeclMode = Cfg.DeclMode
+            End If
+
+            If Not JSON.Content("Body")("VehicleFile") Is Nothing Then stPathVEH.Init(MyPath, JSON.Content("Body")("VehicleFile"))
+
+            stPathENG.Init(MyPath, JSON.Content("Body")("EngineFile"))
+
+            If Not JSON.Content("Body")("GearboxFile") Is Nothing Then stPathGBX.Init(MyPath, JSON.Content("Body")("GearboxFile"))
+
+            If Not JSON.Content("Body")("Cycles") Is Nothing Then
+                For Each str In JSON.Content("Body")("Cycles")
+                    SubPath = New cSubPath
+                    SubPath.Init(MyPath, str)
+                    CycleFiles.Add(SubPath)
+                Next
+            End If
+
+            If Not JSON.Content("Body")("Aux") Is Nothing Then
+                For Each dic In JSON.Content("Body")("Aux")
+
+                    AuxID = UCase(Trim(dic("ID").ToString))
+
+                    If AuxPaths.ContainsKey(AuxID) Then
+                        WorkerMsg(tMsgID.Err, "Multiple definitions of the same auxiliary type (" & AuxID & ")!", MsgSrc)
+                        Return False
+                    End If
+
+                    AuxEntry = New cAuxEntry
+
+                    AuxEntry.Type = dic("Type")
+                    AuxEntry.Path.Init(MyPath, dic("Path"))
+
+
+                    If Not dic("Technology") Is Nothing Then AuxEntry.TechStr = dic("Technology")
+
+                    AuxPaths.Add(AuxID, AuxEntry)
+
+                    AuxDef = True
+
+                    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
+
+                    'TB 29/9/2014 Here is where we read the Auxilliary Augmented Properties where they appear.
+                    '
+
+                Next
+            End If
+
+            If Not JSON.Content("Body")("VACC") Is Nothing Then stDesMaxFile.Init(MyPath, JSON.Content("Body")("VACC"))
+
+            EngOnly = JSON.Content("Body")("EngineOnlyMode")
+
+            If Not JSON.Content("Body")("StartStop") Is Nothing Then
+                dic = JSON.Content("Body")("StartStop")
+                boStartStop = dic("Enabled")
+                siStStV = dic("MaxSpeed")
+                siStStT = dic("MinTime")
+                StStDelay = dic("Delay")
+            Else
+                boStartStop = False
+            End If
+
+            If Not JSON.Content("Body")("LAC") Is Nothing Then
+                dic = JSON.Content("Body")("LAC")
+                LookAheadOn = dic("Enabled")
+                a_lookahead = dic("Dec")
+                vMinLA = dic("MinSpeed")
+            Else
+                LookAheadOn = False
+            End If
+
+            If Not JSON.Content("Body")("OverSpeedEcoRoll") Is Nothing Then
+
+                dic = JSON.Content("Body")("OverSpeedEcoRoll")
+
+                Select Case UCase(dic("Mode").ToString).Trim
+                    Case "ECOROLL"
+                        OverSpeedOn = False
+                        EcoRollOn = True
+
+                    Case "OVERSPEED"
+                        OverSpeedOn = True
+                        EcoRollOn = False
+
+                    Case "OFF"
+                        OverSpeedOn = False
+                        EcoRollOn = False
+
+                    Case Else
+                        WorkerMsg(tMsgID.Err, "Value '" & dic("Mode") & "' is not valid for OverSpeedEcoRoll/Mode!", MsgSrc)
+                        Return False
+                End Select
+
+                vMin = dic("MinSpeed")
+                OverSpeed = dic("OverSpeed")
+                If Not dic("UnderSpeed") Is Nothing Then UnderSpeed = dic("UnderSpeed")
+
+            Else
+                OverSpeedOn = False
+                EcoRollOn = False
+            End If
+
+        Catch ex As Exception
+            WorkerMsg(tMsgID.Err, "Failed to read VECTO file! " & ex.Message, MsgSrc)
+            Return False
+        End Try
+
+
+        Return True
+
+
+    End Function
+
+    Private Sub SetDefault()
+        boStartStop = False
+        siStStV = 5
+        siStStT = 5
+        StStDelay = 0
+        FileVersion = 0
+
+        stPathVEH.Clear()
+        stPathENG.Clear()
+        CycleFiles.Clear()
+        stPathGBX.Clear()
+
+        stDesMaxFile.Clear()
+        laDesV.Clear()
+        laDesMax.Clear()
+        laDesMin.Clear()
+        DesMaxDim = -1
+
+        AuxPaths.Clear()
+        AuxRefs.Clear()
+        AuxDef = False
+        EStechs.Clear()
+
+        EngOnly = False
+
+        a_lookahead = 0
+        vMin = 0
+        LookAheadOn = True
+        OverSpeedOn = False
+        EcoRollOn = False
+        OverSpeed = 0
+        UnderSpeed = 0
+        vMinLA = 0
+
+        SavedInDeclMode = False
+
+    End Sub
+
+    Public Function DeclInit() As Boolean
+
+        Dim cl As List(Of String)
+        Dim s As String
+        Dim SubPath As cSubPath
+        Dim MsgSrc As String
+
+        MsgSrc = "VECTO/DeclInit"
+
+        EngOnly = False
+
+        CycleFiles.Clear()
+
+        cl = Declaration.SegRef.GetCycles
+
+        For Each s In cl
+            SubPath = New cSubPath
+            SubPath.Init(MyPath, s)
+            CycleFiles.Add(SubPath)
+        Next
+
+        stDesMaxFile.Init(MyPath, Declaration.SegRef.VACCfile)
+
+        siStStV = cDeclaration.SSspeed
+        siStStT = cDeclaration.SStime
+        StStDelay = cDeclaration.SSdelay
+
+        If Not EcoRollOn Then OverSpeedOn = True
+
+        OverSpeed = cDeclaration.Overspeed
+        UnderSpeed = cDeclaration.Underspeed
+        vMin = cDeclaration.ECvmin
+
+        LookAheadOn = True
+        a_lookahead = cDeclaration.LACa
+        vMinLA = cDeclaration.LACvmin
+
+        'No need to check Aux (AuxDef). Will be checked in cDeclaration.CalcInitLoad
+
+        Return True
+
+    End Function
+
+    'This Sub reads those Input-files that do not have their own class, etc.
+    Public Function Init() As Boolean
+        Dim file As cFile_V3
+        Dim line As String()
+
+        Dim MsgSrc As String
+
+        MsgSrc = "VECTO/Init"
+
+        If Not EngOnly Then
+
+            file = New cFile_V3
+
+            If Not file.OpenRead(stDesMaxFile.FullPath) Then
+                WorkerMsg(tMsgID.Err, "Can't read .vacc file (" & stDesMaxFile.FullPath & ")", MsgSrc)
+                Return False
+            End If
+
+            'Skip Header
+            file.ReadLine()
+
+            laDesV.Clear()
+            laDesMax.Clear()
+            laDesMin.Clear()
+            DesMaxDim = -1
+            Try
+
+                Do While Not file.EndOfFile
+
+                    DesMaxDim += 1
+
+                    line = file.ReadLine
+
+                    laDesV.Add(CSng(line(0)) / 3.6)   'km/h => m/s !!!!
+                    laDesMax.Add(CSng(line(1)))
+                    laDesMin.Add(CSng(line(2)))
+
+                Loop
+
+            Catch ex As Exception
+
+                file.Close()
+                WorkerMsg(tMsgID.Err, "Error in .vacc file. " & ex.Message & " (" & stDesMaxFile.FullPath & ")", MsgSrc, stDesMaxFile.FullPath)
+                Return False
+
+            End Try
+
+            file.Close()
+
+        End If
+
+        Return True
+
+    End Function
+
+#Region "Aux"
+
+    Public Function AuxInit() As Boolean
+
+        Dim Aux0 As cAux
+        Dim AuxPathKV As KeyValuePair(Of String, cAuxEntry)
+        Dim DRIauxcheck As New Dictionary(Of String, Boolean)
+        Dim AuxID As String
+
+        Dim MsgSrc As String
+
+        MsgSrc = "VEH/AuxInit"
+
+        AuxRefs = New Dictionary(Of String, cAux)
+
+        If Cfg.DeclMode Then
+
+            For Each AuxPathKV In AuxPaths
+                AuxRefs.Add(AuxPathKV.Key, Nothing)
+            Next
+
+            Return True
+
+        End If
+
+
+        If DRI.AuxDef Xor AuxDef Then
+
+            If AuxDef Then
+                WorkerMsg(tMsgID.Err, "No auxiliary input defined in driving cycle!", MsgSrc)
+                Return False
+            Else
+                WorkerMsg(tMsgID.Warn, "No auxiliary defined in vehicle file! Psupply input will be ignored!", MsgSrc)
+                Return True
+            End If
+
+        End If
+
+        If Not (DRI.AuxDef Or AuxDef) Then Return True
+
+
+        For Each AuxID In DRI.AuxComponents.Keys
+            DRIauxcheck.Add(AuxID, False)
+        Next
+
+        For Each AuxPathKV In AuxPaths
+
+            MsgSrc = "VEH/AuxInit/" & AuxPathKV.Key
+
+            If Not DRI.AuxComponents.ContainsKey(AuxPathKV.Key) Then
+                WorkerMsg(tMsgID.Err, "No Psupply input defined in driving cycle for auxiliary '" & AuxPathKV.Key & "'!", MsgSrc)
+                Return False
+            End If
+
+            Aux0 = New cAux
+            Aux0.Filepath = AuxPathKV.Value.Path.FullPath
+
+            If Not Aux0.Readfile Then
+                'Notificationin ReadFile()
+                Return False
+            End If
+
+            AuxRefs.Add(AuxPathKV.Key, Aux0)
+
+            DRIauxcheck(AuxPathKV.Key) = True
+
+        Next
+
+        MsgSrc = "VEH/AuxInit"
+
+        For Each AuxID In DRI.AuxComponents.Keys
+            If Not DRIauxcheck(AuxID) Then WorkerMsg(tMsgID.Warn, "Auxiliary '" & AuxID & "' not found! Psupply input will be ignored!", MsgSrc)
+        Next
+
+        Return True
+
+    End Function
+
+    Public Function Paux(ByVal AuxID As String, ByVal t As Integer, ByVal nU As Single) As Single
+        Dim Psupply As Single
+        Dim Px As Single
+        Dim Aux0 As cAux
+
+        Dim MsgSrc As String
+
+        MsgSrc = "VEH/Paux"
+
+        If Cfg.DeclMode Then Return Declaration.AuxPower(AuxID)
+
+        If AuxDef Then
+
+            Aux0 = AuxRefs(AuxID)
+
+            Psupply = DRI.AuxComponents(AuxID)(t)
+
+            If Psupply < 0 Then GoTo lbAuxError
+
+            Px = Aux0.Paux(nU, Psupply)
+
+            If Px < 0 Then GoTo lbAuxError
+
+            Return Px
+
+        Else
+
+            Return 0
+
+        End If
+
+
+lbAuxError:
+        MODdata.ModErrors.AuxNegative = AuxID
+        Return 0
+
+
+    End Function
+
+    Public Function PauxSum(ByVal t As Integer, ByVal nU As Single) As Single
+        Dim sum As Single
+        Dim AuxID As String
+
+        Dim MsgSrc As String
+
+        MsgSrc = "VEH/Paux"
+
+        If AuxDef Then
+
+            sum = 0
+
+            For Each AuxID In AuxRefs.Keys
+
+                sum += Paux(AuxID, t, nU)
+
+            Next
+
+            Return sum
+
+        Else
+
+            Return 0
+
+        End If
+
+    End Function
+
+#End Region
+
+
+#Region "Properties"
+
+    Public ReadOnly Property FileList As List(Of String)
+        Get
+            Return MyFileList
+        End Get
+    End Property
+
+
+    Public Property FilePath() As String
+        Get
+            Return sFilePath
+        End Get
+        Set(ByVal value As String)
+            sFilePath = value
+            If sFilePath = "" Then
+                MyPath = ""
+            Else
+                MyPath = IO.Path.GetDirectoryName(sFilePath) & "\"
+            End If
+        End Set
+    End Property
+
+
+    Public Property PathVEH(Optional ByVal Original As Boolean = False) As String
+        Get
+            If Original Then
+                Return stPathVEH.OriginalPath
+            Else
+                Return stPathVEH.FullPath
+            End If
+        End Get
+        Set(ByVal value As String)
+            stPathVEH.Init(MyPath, value)
+        End Set
+    End Property
+
+    Public Property PathENG(Optional ByVal Original As Boolean = False) As String
+        Get
+            If Original Then
+                Return stPathENG.OriginalPath
+            Else
+                Return stPathENG.FullPath
+            End If
+        End Get
+        Set(ByVal value As String)
+            stPathENG.Init(MyPath, value)
+        End Set
+    End Property
+
+    Public Property PathGBX(Optional ByVal Original As Boolean = False) As String
+        Get
+            If Original Then
+                Return stPathGBX.OriginalPath
+            Else
+                Return stPathGBX.FullPath
+            End If
+        End Get
+        Set(ByVal value As String)
+            stPathGBX.Init(MyPath, value)
+        End Set
+    End Property
+
+
+    Public Property StartStop() As Boolean
+        Get
+            Return boStartStop
+        End Get
+        Set(ByVal value As Boolean)
+            boStartStop = value
+        End Set
+    End Property
+
+    Public Property StStV() As Single
+        Get
+            Return siStStV
+        End Get
+        Set(ByVal value As Single)
+            siStStV = value
+        End Set
+    End Property
+
+    Public Property StStT() As Single
+        Get
+            Return siStStT
+        End Get
+        Set(ByVal value As Single)
+            siStStT = value
+        End Set
+    End Property
+
+    Public Property DesMaxFile(Optional ByVal Original As Boolean = False) As String
+        Get
+            If Original Then
+                Return stDesMaxFile.OriginalPath
+            Else
+                Return stDesMaxFile.FullPath
+            End If
+        End Get
+        Set(ByVal value As String)
+            stDesMaxFile.Init(MyPath, value)
+        End Set
+    End Property
+
+#End Region
+
+    Public Function aDesMax(ByVal v As Single) As Single
+        Dim i As Int32
+
+        'Extrapolation for x < x(1)
+        If laDesV(0) >= v Then
+            If laDesV(0) > v Then MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]"
+            i = 1
+            GoTo lbInt
+        End If
+
+        i = 0
+        Do While laDesV(i) < v And i < DesMaxDim
+            i += 1
+        Loop
+
+        'Extrapolation for x > x(imax)
+        If laDesV(i) < v Then
+            MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]"
+        End If
+
+lbInt:
+        'Interpolation
+        Return (v - laDesV(i - 1)) * (laDesMax(i) - laDesMax(i - 1)) / (laDesV(i) - laDesV(i - 1)) + laDesMax(i - 1)
+
+    End Function
+
+    Public Function aDesMin(ByVal v As Single) As Single
+        Dim i As Int32
+
+        'Extrapolation for x < x(1)
+        If laDesV(0) >= v Then
+            If laDesV(0) > v Then MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]"
+            i = 1
+            GoTo lbInt
+        End If
+
+        i = 0
+        Do While laDesV(i) < v And i < DesMaxDim
+            i += 1
+        Loop
+
+        'Extrapolation for x > x(imax)
+        If laDesV(i) < v Then
+            MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]"
+        End If
+
+lbInt:
+        'Interpolation
+        Return (v - laDesV(i - 1)) * (laDesMin(i) - laDesMin(i - 1)) / (laDesV(i) - laDesV(i - 1)) + laDesMin(i - 1)
+
+    End Function
+
+
+End Class
+