From 63078a3a4971d2590b44c02abfba738f9318b61d Mon Sep 17 00:00:00 2001
From: "VKMTHD\\franzjosefkober" <franz.josef.kober@ivt.tugraz.at>
Date: Tue, 28 Apr 2020 15:36:50 +0200
Subject: [PATCH] added edit component File, added to load  airdrag data from
 xml file

---
 VECTO3GUI/Helper/XmlComponentReaderHelper.cs  | 37 +++++++++
 VECTO3GUI/Helper/XmlReaderHelper.cs           | 41 ++++++++++
 VECTO3GUI/MainWindow.xaml                     | 10 ++-
 .../TempDataObject/AirdragComponentData.cs    |  1 +
 VECTO3GUI/Resources/AirdragLoadTestFile.xml   | 25 ++++++
 VECTO3GUI/VECTO3GUI.csproj                    |  6 +-
 .../ViewModel/Impl/AbstractBusJobViewModel.cs |  2 +-
 VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs  | 78 +++++++++++++------
 VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs  | 54 +++++++++++--
 .../ViewModel/Interfaces/IAirdragViewModel.cs |  4 +
 .../ViewModel/Interfaces/IJoblistViewModel.cs |  1 +
 .../Declaration/AirdragDeclarationView.xaml   | 11 +--
 .../Declaration/CompleteVehicleBusView.xaml   |  5 +-
 VECTO3GUI/Views/JoblistView.xaml              |  8 +-
 14 files changed, 241 insertions(+), 42 deletions(-)
 create mode 100644 VECTO3GUI/Helper/XmlComponentReaderHelper.cs
 create mode 100644 VECTO3GUI/Helper/XmlReaderHelper.cs
 create mode 100644 VECTO3GUI/Resources/AirdragLoadTestFile.xml

diff --git a/VECTO3GUI/Helper/XmlComponentReaderHelper.cs b/VECTO3GUI/Helper/XmlComponentReaderHelper.cs
new file mode 100644
index 0000000000..5f61461418
--- /dev/null
+++ b/VECTO3GUI/Helper/XmlComponentReaderHelper.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml;
+using TUGraz.VectoCommon.InputData;
+using TUGraz.VectoCommon.Resources;
+using TUGraz.VectoCommon.Utils;
+using TUGraz.VectoCore.InputData.FileIO.XML.Common;
+using VECTO3GUI.Model.TempDataObject;
+
+namespace VECTO3GUI.Helper
+{
+	public class XmlComponentReaderHelper : AbstractXMLType
+	{
+		public XmlComponentReaderHelper(XmlNode node) : base(node) { }
+		
+		public AirdragComponentData GetAirdragComponentData()
+		{
+			if (!ElementExists(XMLNames.Component_AirDrag))
+				return null;
+
+			return new AirdragComponentData {
+				Manufacturer =  GetString(XMLNames.Component_Manufacturer),
+				Model = GetString(XMLNames.Component_Model),
+				CertificationNumber = GetString(XMLNames.Component_CertificationNumber),
+				Date = DateTime.Parse(GetString(XMLNames.Component_Date)).ToUniversalTime(),
+				AppVersion = GetString(XMLNames.Component_AppVersion),
+				CdxA_0 = GetDouble("CdxA_0").SI<SquareMeter>(),
+				TransferredCdxA = GetDouble("TransferredCdxA").SI<SquareMeter>(),
+				DeclaredCdxA = GetDouble(XMLNames.AirDrag_DeclaredCdxA).SI<SquareMeter>(),
+				DigestValue = new DigestData(GetNode(XMLNames.DI_Signature))
+			};
+		}
+	}
+}
diff --git a/VECTO3GUI/Helper/XmlReaderHelper.cs b/VECTO3GUI/Helper/XmlReaderHelper.cs
new file mode 100644
index 0000000000..960d6ffb0e
--- /dev/null
+++ b/VECTO3GUI/Helper/XmlReaderHelper.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml;
+using Castle.Core.Internal;
+using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
+using TUGraz.VectoCommon.Resources;
+
+namespace VECTO3GUI.Helper
+{
+	public static class XmlReaderHelper
+	{
+		public static XmlDocument ReadXmlDocument(string filePath)
+		{
+			if (filePath.IsNullOrEmpty())
+				return null;
+
+			var xmlDocument = new XmlDocument();
+			
+			using (var reader = new XmlTextReader(filePath)) {
+				xmlDocument.Load(reader);	
+			}
+
+			return xmlDocument;
+		}
+
+
+		public static XmlNodeList GetComponentNodes(XmlDocument xmlDocument, string parentNode, string nodeName)
+		{
+			if (xmlDocument == null || parentNode.IsNullOrEmpty() || nodeName.IsNullOrEmpty())
+				return null;
+
+			return xmlDocument.SelectNodes($"//*[local-name()='{parentNode}']//*[local-name()='{nodeName}']");
+		}
+
+		
+
+	}
+}
diff --git a/VECTO3GUI/MainWindow.xaml b/VECTO3GUI/MainWindow.xaml
index 90013c8361..3ce384cae5 100644
--- a/VECTO3GUI/MainWindow.xaml
+++ b/VECTO3GUI/MainWindow.xaml
@@ -7,6 +7,7 @@
         xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces"
         xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
         xmlns:impl="clr-namespace:VECTO3GUI.ViewModel.Impl"
+        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
         mc:Ignorable="d"
         Title="{Binding Version}" Height="515.36" Width="972.48" WindowStartupLocation="CenterScreen"
         d:DataContext="{d:DesignInstance Type=impl:MainWindowViewModel, IsDesignTimeCreatable=False}">
@@ -22,7 +23,7 @@
             <StackPanel Orientation="Vertical">
 
                 <Menu IsMainMenu="True" Style="{DynamicResource MetroMenu}">
-                    <MenuItem Header="File">
+                    <MenuItem Header="File" VerticalAlignment="Center">
                         <MenuItem Header="New" Style="{DynamicResource MetroMenuItem}" Margin="0"
                                   Command="{Binding CurrentViewModel.CreateNewJob}"/>
                         <MenuItem Header="Edit" Style="{DynamicResource MetroMenuItem}" Margin="0" 
@@ -37,7 +38,10 @@
 
 
 
-                    <MenuItem Header="Tools">
+                    <MenuItem Header="Tools" VerticalAlignment="Center">
+                        <!--<MenuItem.Icon>
+                            <iconPacks:PackIconModern Width="15" Height="15" Kind="Tools" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Green" />
+                        </MenuItem.Icon>-->
                         <MenuItem Header="Single Bus Job"
                                   Command="{Binding CurrentViewModel.AddBusJob}" CommandParameter="{Binding Source={x:Static impl:JobType.SingleBusJob}}"/>
                         <MenuItem Header="Completed Bus Job"
@@ -49,7 +53,7 @@
                     </MenuItem>
 
 
-                    <MenuItem Header="Help">
+                    <MenuItem Header="Help" VerticalAlignment="Center">
                         <MenuItem Header="User Manual"/>
                         <MenuItem Header="About Vecto"/>
                         <MenuItem Header="Relase Notes"/>
diff --git a/VECTO3GUI/Model/TempDataObject/AirdragComponentData.cs b/VECTO3GUI/Model/TempDataObject/AirdragComponentData.cs
index dc8b32e9ca..ef0153e65d 100644
--- a/VECTO3GUI/Model/TempDataObject/AirdragComponentData.cs
+++ b/VECTO3GUI/Model/TempDataObject/AirdragComponentData.cs
@@ -27,6 +27,7 @@ namespace VECTO3GUI.Model.TempDataObject
 
 		#endregion
 
+		public AirdragComponentData(){}
 
 		public AirdragComponentData(IAirdragViewModel viewModel , bool defaultValues)
 		{
diff --git a/VECTO3GUI/Resources/AirdragLoadTestFile.xml b/VECTO3GUI/Resources/AirdragLoadTestFile.xml
new file mode 100644
index 0000000000..3baab2fa60
--- /dev/null
+++ b/VECTO3GUI/Resources/AirdragLoadTestFile.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v1.0" xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v1.0 https://webgate.ec.europa.eu/CITnet/svn/VECTO/trunk/Share/XML/XSD/VectoComponent.xsd">
+    <tns:AirDrag>
+        <Data id="TestAirDrag1234" xsi:type="AirDragDataDeclarationType">
+            <Manufacturer>Test AirDrag Manufacturer</Manufacturer>
+            <Model>Test AirDrag Model</Model>
+            <CertificationNumber>e12*0815/8051*2020/05E0000*66</CertificationNumber>
+            <Date>2020-04-28T09:16:15.1270795Z</Date>
+            <AppVersion>Vecto AirDrag Test Load</AppVersion>
+            <CdxA_0>6.12</CdxA_0>
+            <TransferredCdxA>7.12</TransferredCdxA>
+            <DeclaredCdxA>8.12</DeclaredCdxA>
+        </Data>
+        <Signature>
+            <di:Reference URI="#TestAirDrag1234">
+                <di:Transforms>
+                    <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" />
+                    <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+                </di:Transforms>
+                <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
+                <di:DigestValue>Yd3UDJ/zKPhsmPadJeC4Ez/q7o3G82Zbq3mX3tSqLDw=</di:DigestValue>
+            </di:Reference>
+        </Signature>
+    </tns:AirDrag>
+</tns:VectoInputDeclaration>
\ No newline at end of file
diff --git a/VECTO3GUI/VECTO3GUI.csproj b/VECTO3GUI/VECTO3GUI.csproj
index 085ca6576d..15f1eec02d 100644
--- a/VECTO3GUI/VECTO3GUI.csproj
+++ b/VECTO3GUI/VECTO3GUI.csproj
@@ -171,6 +171,8 @@
     <Compile Include="Helper\Converter\SaveButtonLabelConverter.cs" />
     <Compile Include="Helper\SerializeHelper.cs" />
     <Compile Include="Helper\ViewModelBase.cs" />
+    <Compile Include="Helper\XmlComponentReaderHelper.cs" />
+    <Compile Include="Helper\XmlReaderHelper.cs" />
     <Compile Include="Model\InterfacesImpl.cs" />
     <Compile Include="Model\JobListModel.cs" />
     <Compile Include="Model\SettingsModel.cs" />
@@ -623,7 +625,9 @@
       <Name>VectoCore</Name>
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup />
+  <ItemGroup>
+    <Resource Include="Resources\AirdragLoadTestFile.xml" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/VECTO3GUI/ViewModel/Impl/AbstractBusJobViewModel.cs b/VECTO3GUI/ViewModel/Impl/AbstractBusJobViewModel.cs
index 46899ef52c..4f02db72d0 100644
--- a/VECTO3GUI/ViewModel/Impl/AbstractBusJobViewModel.cs
+++ b/VECTO3GUI/ViewModel/Impl/AbstractBusJobViewModel.cs
@@ -148,7 +148,7 @@ namespace VECTO3GUI.ViewModel.Impl
 		private void SetJobEntryData(JobEntry jobEntry)
 		{
 			FirstFilePath = jobEntry.FirstFilePath;
-			SecondFilePath = jobEntry.FirstFilePath;
+			SecondFilePath = jobEntry.SecondFilePath;
 		}
 
 		protected abstract void SetFirstFileLabel();
diff --git a/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs b/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs
index 20504eda8d..f56514918a 100644
--- a/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs
+++ b/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs
@@ -1,15 +1,13 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Windows.Forms;
 using System.Windows.Input;
-using System.Xml;
+using Castle.Core.Internal;
 using Ninject;
+using TUGraz.VectoCommon.Hashing;
 using TUGraz.VectoCommon.InputData;
+using TUGraz.VectoCommon.Resources;
 using TUGraz.VectoCommon.Utils;
-using TUGraz.VectoCore.InputData.FileIO.XML;
-using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader;
-using TUGraz.VectoCore.Utils;
 using VECTO3GUI.Helper;
 using VECTO3GUI.Model.TempDataObject;
 using VECTO3GUI.Util;
@@ -65,7 +63,10 @@ namespace VECTO3GUI.ViewModel.Impl
 		private IAirdragDeclarationInputData _airdragData;
 		private AirdragComponentData _componentData;
 		private bool _isEditable;
-		
+		private bool _useMeasurementData;
+		private bool _noAirdragData;
+
+
 		private ICommand _airdragConfig;
 		private ICommand _loadFileCommand;
 
@@ -126,7 +127,6 @@ namespace VECTO3GUI.ViewModel.Impl
 			{
 				if (!SetProperty(ref _date, value))
 					return;
-
 				IsDataChanged(_date, _componentData);
 			}
 		}
@@ -138,9 +138,7 @@ namespace VECTO3GUI.ViewModel.Impl
 			{
 				if (!SetProperty(ref _declaredCdxA, value))
 					return;
-
 				IsDataChanged(_declaredCdxA, _componentData);
-				SetAirdragArea(_airdragData);
 			}
 		}
 
@@ -165,13 +163,27 @@ namespace VECTO3GUI.ViewModel.Impl
 			set { SetProperty(ref _isEditable, value); }
 		}
 
+		public bool UseMeasurementData
+		{
+			get { return _useMeasurementData; }
+			set { SetProperty(ref _useMeasurementData, value); }
+		}
+
+		public bool NoAirdragData
+		{
+			get { return _noAirdragData; }
+			set { SetProperty(ref _noAirdragData, value); }
+		}
+
 
 		protected override void InputDataChanged()
 		{
 			var inputData = JobViewModel.InputDataProvider as IDeclarationInputDataProvider;
 			_airdragData = inputData?.JobInputData.Vehicle.Components.AirdragInputData;
 			SetAirdragValues(_airdragData);
-			IsEditable = true;
+			UseMeasurementData = _airdragData != null;
+			NoAirdragData = !UseMeasurementData;
+			IsEditable = false;
 		}
 
 		private void SetAirdragValues(IAirdragDeclarationInputData airdrag)
@@ -188,7 +200,9 @@ namespace VECTO3GUI.ViewModel.Impl
 			CertificationNumber = airdrag.CertificationNumber;
 			Date = airdrag.Date;
 			AppVersion = airdrag.AppVersion;
-			SetAirdragArea(airdrag);
+			DeclaredCdxA = airdrag.AirDragArea;
+			CdxA_0 = DeclaredCdxA;
+			TransferredCdxA = DeclaredCdxA;
 			DigestValue = airdrag.DigestValue;
 
 			_componentData = new AirdragComponentData(this);
@@ -207,7 +221,7 @@ namespace VECTO3GUI.ViewModel.Impl
 
 		private void DoAirdragConfig(AirdragConfig config)
 		{
-			IsEditable = config == AirdragConfig.UseMeasurementData;
+			
 		}
 
 
@@ -221,25 +235,17 @@ namespace VECTO3GUI.ViewModel.Impl
 
 		private bool CanLoadFile()
 		{
-			return IsEditable;
+			return UseMeasurementData;
 		}
 
 		private void DoLoadFile()
 		{
 			var filePath = FileDialogHelper.ShowSelectFilesDialog(false)?.FirstOrDefault();
-			ReadSelectedXml(null);
+			ReadSelectedXml(filePath);
 		}
 		#endregion
 
 
-
-		private void SetAirdragArea(IAirdragDeclarationInputData airdrag)
-		{
-			DeclaredCdxA = airdrag.AirDragArea;
-			CdxA_0 = DeclaredCdxA;
-			TransferredCdxA = DeclaredCdxA;
-		}
-
 		public override void ResetComponentData()
 		{
 			_componentData.ResetToComponentValues(this);
@@ -254,8 +260,34 @@ namespace VECTO3GUI.ViewModel.Impl
 
 		private void ReadSelectedXml(string filePath)
 		{
-			if (filePath == null)
+			if (filePath.IsNullOrEmpty())
 				return;
+			
+			var xmlDocument = XmlReaderHelper.ReadXmlDocument(filePath);
+			var nodes = XmlReaderHelper.GetComponentNodes(xmlDocument,
+				XMLNames.VectoInputDeclaration, VectoComponents.Airdrag.XMLElementName());
+
+			if(nodes.IsNullOrEmpty())
+				return;
+
+			var compReader = new XmlComponentReaderHelper(nodes[0].ParentNode);
+			SetLoadedAirdragData(compReader.GetAirdragComponentData());
+		}
+
+		private void SetLoadedAirdragData(AirdragComponentData airdrag)
+		{
+			if (airdrag == null)
+				return;
+
+			Model = airdrag.Model;
+			Manufacturer = airdrag.Manufacturer;
+			CertificationNumber = airdrag.CertificationNumber;
+			Date = airdrag.Date;
+			AppVersion = airdrag.AppVersion;
+			DeclaredCdxA = airdrag.DeclaredCdxA;
+			CdxA_0 = airdrag.CdxA_0;
+			TransferredCdxA = airdrag.TransferredCdxA;
+			DigestValue = airdrag.DigestValue;
 		}
 	}
 }
diff --git a/VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs b/VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs
index 2af40f7d06..603d7aeea1 100644
--- a/VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs
+++ b/VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs
@@ -7,7 +7,10 @@ using System.IO;
 using System.Linq;
 using System.Windows;
 using System.Windows.Input;
+using System.Xml;
 using Ninject;
+using TUGraz.VectoCommon.InputData;
+using TUGraz.VectoCore.InputData.FileIO.XML;
 using VECTO3GUI.Util;
 using VECTO3GUI.ViewModel.Interfaces;
 using VECTO3GUI.Helper;
@@ -43,6 +46,7 @@ namespace VECTO3GUI.ViewModel.Impl
 		private ICommand _exitCommand;
 		private ICommand _exitMainCommand;
 		private ICommand _addBusJobCommand;
+		private ICommand _editCompletedFileCommand;
 
 		#endregion
 
@@ -143,6 +147,31 @@ namespace VECTO3GUI.ViewModel.Impl
 			}
 		}
 
+		public ICommand EditCompletedFile
+		{
+			get
+			{
+				return _editCompletedFileCommand ??
+						(_editCompletedFileCommand =
+							new RelayCommand<JobEntry>(DoEditCompletedFile, CanEditCompletdFile));
+			}
+		}
+
+		private bool CanEditCompletdFile(JobEntry jobEntry)
+		{
+			return jobEntry != null;
+		}
+
+		private void DoEditCompletedFile(JobEntry jobEntry)
+		{
+			var viewModel = ReadCompletedXmlFile(jobEntry);
+			if (viewModel == null)
+				return;
+
+			var window = OutputWindowHelper.CreateOutputWindow(Kernel, viewModel);
+			window.Show();
+		}
+
 		private bool CanEditJob(JobEntry jobEntry)
 		{
 			return jobEntry != null;
@@ -231,7 +260,6 @@ namespace VECTO3GUI.ViewModel.Impl
 			var window = OutputWindowHelper.CreateOutputWindow(Kernel, viewModel, "Settings", 440, 200,
 				ResizeMode.NoResize);
 			window.ShowDialog();
-
 		}
 
 		public ICommand ExitMainCommand
@@ -271,10 +299,7 @@ namespace VECTO3GUI.ViewModel.Impl
 
 
 		#endregion
-
-
-
-
+		
 		private object GetBusJobViewModel(JobType jobType, JobEntry jobEntry = null)
 		{
 			var currentJobType = jobEntry?.JobType ?? jobType;
@@ -320,6 +345,25 @@ namespace VECTO3GUI.ViewModel.Impl
 		{
 			SerializeHelper.SerializeToFile(jobEntry.JobEntryFilePath, jobEntry);
 		}
+
+		private IJobEditViewModel ReadCompletedXmlFile(JobEntry jobEntry)
+		{
+			var xmlInputReader = Kernel.Get<IXMLInputDataReader>();
+			using (var reader = XmlReader.Create(jobEntry.SecondFilePath)) {
+				var readerResult = xmlInputReader.Create(reader) as IDeclarationInputDataProvider;
+				return CreateCompleteBusVehicleViewModel(readerResult);
+			}
+		}
+
+		private IJobEditViewModel CreateCompleteBusVehicleViewModel(IDeclarationInputDataProvider dataProvider)
+		{
+			_messages.Add(new MessageEntry
+			{
+				Message = "Edit File"
+			});
+			return dataProvider == null ? null : new CompleteVehicleBusJobViewModel(Kernel, dataProvider);
+		}
+
 		//private IJobEditViewModel ReadJob(string jobFile)
 		//{
 		//	if (jobFile == null)
diff --git a/VECTO3GUI/ViewModel/Interfaces/IAirdragViewModel.cs b/VECTO3GUI/ViewModel/Interfaces/IAirdragViewModel.cs
index c018b15fb8..f85fd276dd 100644
--- a/VECTO3GUI/ViewModel/Interfaces/IAirdragViewModel.cs
+++ b/VECTO3GUI/ViewModel/Interfaces/IAirdragViewModel.cs
@@ -8,6 +8,10 @@ namespace VECTO3GUI.ViewModel.Interfaces
 	{
 		IAirdragDeclarationInputData ModelData { get; }
 		bool IsEditable { get; }
+
+		bool NoAirdragData { get; }
+		bool UseMeasurementData { get; }
+
 		ICommand LoadFileCommand { get; }
 		ICommand AirdragConfigCommand { get; }
 
diff --git a/VECTO3GUI/ViewModel/Interfaces/IJoblistViewModel.cs b/VECTO3GUI/ViewModel/Interfaces/IJoblistViewModel.cs
index 7b1707d00b..076af7ee9f 100644
--- a/VECTO3GUI/ViewModel/Interfaces/IJoblistViewModel.cs
+++ b/VECTO3GUI/ViewModel/Interfaces/IJoblistViewModel.cs
@@ -17,6 +17,7 @@ namespace VECTO3GUI.ViewModel.Interfaces
 		ICommand MoveJobDown { get; }
 		ICommand StartSimulation { get; }
 		ICommand EditJob { get; }
+		ICommand EditCompletedFile { get; }
 		ICommand JobEntrySetActive { get; }
 		ICommand CreateNewJob { get; }
 		ICommand OpenJob { get; }
diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml
index 009760e99d..9998c574ad 100644
--- a/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml
+++ b/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml
@@ -32,12 +32,13 @@
             <StackPanel Orientation="Vertical">
                 <RadioButton GroupName="AirdragConfig" Margin="5"
                              Content="{Binding Source={x:Static impl:AirdragConfig.WithoutAirdrag}, Converter={converter:EnumConverter}}"
-                             Command="{Binding AirdragConfigCommand}" CommandParameter="{Binding Source={x:Static impl:AirdragConfig.WithoutAirdrag}}"/>
+                             Command="{Binding AirdragConfigCommand}" CommandParameter="{Binding Source={x:Static impl:AirdragConfig.WithoutAirdrag}}"
+                             IsChecked="{Binding NoAirdragData}"/>
                 
                 <RadioButton GroupName="AirdragConfig" Margin="5"
                              Content="{Binding Source={x:Static impl:AirdragConfig.UseMeasurementData}, Converter={converter:EnumConverter}}"
                              Command="{Binding AirdragConfigCommand}" CommandParameter="{ Binding Source={x:Static impl:AirdragConfig.UseMeasurementData}}"
-                             IsChecked="{Binding IsEditable}"/>
+                             IsChecked="{Binding UseMeasurementData}"/>
 
                 <StackPanel Orientation="Horizontal" Margin="30,10,10,10">
                     <Label Content="Load Component File:"/>
@@ -51,18 +52,18 @@
         </GroupBox>
 
         <GroupBox Header="Aridrag Data"  Width="500" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="1" Height="250" VerticalAlignment="Top"
-                  Visibility="{Binding IsEditable, Converter={converter:BoolVisibilityConverter}}">
+                  Visibility="{Binding UseMeasurementData, Converter={converter:BoolVisibilityConverter}}">
 
 
             <StackPanel Orientation="Vertical" Width="450" HorizontalAlignment="Left" Grid.IsSharedSizeScope="True">
 
                 <customControls:VectoParameterControl 
                     Caption="Manufacturer" Unit="" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth"
-                    Value="{Binding Manufacturer}" IsEnabled="{Binding IsEditable}" />
+                    Value="{Binding Manufacturer}" IsEnabled="{Binding IsEditable, UpdateSourceTrigger=PropertyChanged}" />
 
                 <customControls:VectoParameterControl
                     Caption="Model" Unit="" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth"
-                    Value="{Binding Model}" IsEnabled="{Binding IsEditable}" />
+                    Value="{Binding Model}" IsEnabled="{Binding IsEditable, UpdateSourceTrigger=PropertyChanged}" />
 
                 <!-- <mah:DateTimePicker  -->
                 <!--     SelectedDate="{Binding Date}"  -->
diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml
index 2c4a680441..4ea7973e75 100644
--- a/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml
+++ b/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml
@@ -40,9 +40,10 @@
                     <customControls:VectoParameterControl
                         Caption="VIN" Unit="" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth"
                         Value="{Binding VIN}" />
-                    <customControls:VectoParameterControl
+
+                    <!--<customControls:VectoParameterControl
                         Caption="Date" Unit="" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth"
-                        Value="{Binding Date}" />
+                        Value="{Binding Date}" />-->
 
                     <customControls:ComboParameter
                         Caption="Legislative Class"
diff --git a/VECTO3GUI/Views/JoblistView.xaml b/VECTO3GUI/Views/JoblistView.xaml
index c5a0f7b54c..6822016183 100644
--- a/VECTO3GUI/Views/JoblistView.xaml
+++ b/VECTO3GUI/Views/JoblistView.xaml
@@ -22,7 +22,7 @@
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="80"/>
             <ColumnDefinition/>
-            <ColumnDefinition Width="80"/>
+            <ColumnDefinition Width="150"/>
         </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
             <RowDefinition Height="30"/>
@@ -84,10 +84,14 @@
 
         <Grid Grid.Row="1" Grid.Column="2" Margin="0,0,10,0">
             <StackPanel Orientation="Vertical" Margin="0,30,0,0">
-                <Button Margin="0,5,0,0" Content="Edit Job" 
+                <Button Margin="0,5,0,0" Content="Edit Job" Width="110"
                         Command="{Binding EditJob}"
                         CommandParameter="{Binding ElementName=JobList, Path=SelectedItem}"/>
 
+                <Button Margin="0,5,0,0" Content="Edit Completed File" Width="110" 
+                        Command="{Binding EditCompletedFile}"
+                        CommandParameter="{Binding ElementName=JobList, Path=SelectedItem}" />
+                
 
                 <!--<Button Margin="0,5,0,0" Command="{Binding AddBusJob}" Content="Add Bus Job"/>
                 <Button Margin="0,5,0,0" Command="{Binding EditJob}" Content="Edit File" />
-- 
GitLab