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

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

Merge branch 'feature/VECTO-1410-multistage-tool-buses' of...

Merge branch 'feature/VECTO-1410-multistage-tool-buses' of git+ssh://129.27.107.191:2211/vecto-dev into feature_IVT/VECTO-1410-multistage-tool-buses
parents 89cccbe1 62913b94
Branches
Tags
No related merge requests found
Showing
with 622 additions and 75 deletions
......@@ -42,6 +42,14 @@
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
......@@ -17,7 +17,6 @@ namespace VECTO3GUI2020
{
private IKernel container;
private IKernel multiStageChildContainer;
protected override void OnStartup(StartupEventArgs e)
{
......@@ -55,19 +54,10 @@ namespace VECTO3GUI2020
private void ConfigureMainWindow()
{
//Windows to test controls
//var testwindow = container.Get<Test>();
//testwindow.Show();
var mainwindow = container.Get<MainWindow>();
this.MainWindow = mainwindow;
Application.Current.MainWindow = mainwindow;
this.MainWindow.Show();
}
}
......
......@@ -120,9 +120,9 @@ namespace VECTO3GUI2020.Helper
return MessageBox.Show(messageBoxText, caption, button, icon);
}
public MessageBoxResult ShowMessageBox(string messageBoxTest, string caption)
public MessageBoxResult ShowMessageBox(string messageBoxText, string caption)
{
return MessageBox.Show(messageBoxTest, caption);
return MessageBox.Show(messageBoxText, caption);
}
public string SaveToDialog(string initialDirectory, string filter)
......@@ -205,10 +205,10 @@ namespace VECTO3GUI2020.Helper
/// <summary>
/// Displays a messagebox
/// </summary>
/// <param name="messageBoxTest"></param>
/// <param name="messageBoxText"></param>
/// <param name="caption"></param>
/// <returns></returns>
MessageBoxResult ShowMessageBox(string messageBoxTest, string caption);
MessageBoxResult ShowMessageBox(string messageBoxText, string caption);
string SaveToDialog(string initialDirectory = null, string filter = "All files (*.*|*.*");
......
using System;
using System.Collections.ObjectModel;
using System.Linq;
using TUGraz.VectoCommon.Models;
using VECTO3GUI2020.Annotations;
namespace VECTO3GUI2020.Helper
{
using System.Runtime.CompilerServices;
internal static class EnumHelper
{
private static ObservableCollection<T> GetValuesAsObservableCollection<T, TInput>(bool exclude,
params TInput[] items)
where TInput : System.Enum
where T : System.Enum
{
var values = Enum.GetValues(typeof(TInput)).Cast<TInput>().ToList().Where(e => {
var contains = items.Contains(e);
var result = contains;
if (exclude) {
result = !contains;
}
return result;
});
return new ObservableCollection<T>(values.Cast<T>());
}
public static ObservableCollection<T> GetValuesAsObservableCollectionIncluding<T, TInput>(params TInput[] items)
where TInput : System.Enum
where T : System.Enum
{
return GetValuesAsObservableCollection<T, TInput>(false, items);
}
public static ObservableCollection<T> GetValuesAsObservableCollectionExcluding<T, TInput>(params TInput[] items)
where TInput : System.Enum
where T : System.Enum
{
return GetValuesAsObservableCollection<T, TInput>(true, items);
}
}
}
\ No newline at end of file
namespace VECTO3GUI2020.Helper
{
public class Extension
{
}
}
\ No newline at end of file
......@@ -7,11 +7,12 @@
xmlns:Implementation="clr-namespace:VECTO3GUI2020.ViewModel.Implementation" d:DataContext="{d:DesignInstance Type=Implementation:MainWindowViewModel}" x:Class="VECTO3GUI2020.MainWindow"
mc:Ignorable="d"
Title="Vecto" Height="450" Width="820"
WindowStartupLocation="CenterScreen">
WindowStartupLocation="CenterScreen"
AutomationProperties.Name="MainWindow">
<Grid>
<Grid x:Name="Grid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
......@@ -23,7 +24,7 @@
<Grid Grid.Row="0">
<StackPanel Orientation="Vertical">
<Menu IsMainMenu="True">
<Menu x:Name="menu" IsMainMenu="True">
<MenuItem Header="File" VerticalAlignment="Stretch">
<MenuItem Header="Settings" Command="{Binding OpenSettings}"/>
<MenuItem Header="New File" Command="{Binding NewInterimFile}"/>
......@@ -38,7 +39,7 @@
</Grid>
<Grid Grid.Row="2" Margin="0,0,0,0">
<ContentControl Content="{Binding CurrentViewModelBottom}"/>
<ContentControl Name="ContentControlBottom" Content="{Binding CurrentViewModelBottom}"/>
</Grid>
</Grid>
......
......@@ -16,6 +16,8 @@ namespace VECTO3GUI2020.Ninject
{
Bind<IDocumentViewModel>().To<DeclarationJobViewModel>().Named(XmlDocumentType.DeclarationJobData.ToString());
Bind<IDocumentViewModel>().To<MultiStageJobViewModel_v0_1>()
.Named(XmlDocumentType.MultistageOutputData.ToString());
//Bind<IDocumentViewModel>().To<MultistageJobViewModel>().Named(XmlDocumentType.MultistageOutputData.ToString());
//Bind<IDocumentViewModel>().To<DeclarationTrailerJobDocumentViewModel>().Named(XmlDocumentType.DeclarationTrailerJobData.ToString());
......
......@@ -12,10 +12,8 @@ namespace VECTO3GUI2020.Ninject
public interface IMultistageDependencies
{
Lazy<IDialogHelper> DialogHelperLazy { get; }
Lazy<IXMLInputDataReader> InputDataReaderLazy { get; }
IDialogHelper DialogHelper { get; }
IXMLInputDataReader InputDataReader { get; }
IDeclarationInjectFactory InjectFactory { get; }
IComponentViewModelFactory ComponentViewModelFactory { get; }
......
......@@ -17,10 +17,6 @@ namespace VECTO3GUI2020.Ninject
public IDialogHelper DialogHelper => _dialogHelper.Value;
private readonly Lazy<IXMLInputDataReader> _inputDataReader;
public Lazy<IXMLInputDataReader> InputDataReaderLazy => _inputDataReader;
public IXMLInputDataReader InputDataReader => _inputDataReader.Value;
//private readonly Lazy<XMLValidator> _xmlValidator = new Lazy<XMLValidator>(() => {return });
//public Lazy<XMLValidator> XMLValidatorLazy => _xmlValidator;
//public XMLValidator XMLValidator => _xmlValidator.Value;
......@@ -37,14 +33,12 @@ namespace VECTO3GUI2020.Ninject
private readonly Lazy<IComponentViewModelFactory> _componentViewModelFactory;
public MultistageLazyDependencies(
Lazy<IDialogHelper> dialogHelper,
Lazy<IXMLInputDataReader> inputDataReader,
Lazy<IDeclarationInjectFactory> injectFactory,
Lazy<IComponentViewModelFactory> componentViewModelFactory,
Lazy<IXMLWriterFactory> xmlWriterFactory,
Lazy<IMultiStageViewModelFactory> viewModelFactory)
{
_dialogHelper = dialogHelper;
_inputDataReader = inputDataReader;
_componentViewModelFactory = componentViewModelFactory;
_injectFactory = injectFactory;
_xmlWriterFactory = xmlWriterFactory;
......
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
......@@ -13,6 +14,7 @@ using System.Windows;
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: InternalsVisibleTo("Vecto3GUI2020Test")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
......
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VECTO3GUI2020.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class BusStrings {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal BusStrings() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VECTO3GUI2020.Properties.BusStrings", typeof(BusStrings).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Airdrag Area 0.
/// </summary>
public static string AirdragArea0 {
get {
return ResourceManager.GetString("AirdragArea0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ATP Eco Roll Release Lockup Clutch.
/// </summary>
public static string ATEcoRollReleaseLockupClutch {
get {
return ResourceManager.GetString("ATEcoRollReleaseLockupClutch", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Compressor Drive.
/// </summary>
public static string CompressorDrive {
get {
return ResourceManager.GetString("CompressorDrive", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Corrected Actual Mass.
/// </summary>
public static string CurbmassChassis {
get {
return ResourceManager.GetString("CurbmassChassis", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Eco Roll Type.
/// </summary>
public static string EcoRollTypeNullable {
get {
return ResourceManager.GetString("EcoRollTypeNullable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Engine Stop Start.
/// </summary>
public static string EngineStopStartNullable {
get {
return ResourceManager.GetString("EngineStopStartNullable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Entrance Height.
/// </summary>
public static string EntranceHeightInMm {
get {
return ResourceManager.GetString("EntranceHeightInMm", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tech. Perm. Max. Laden Mass.
/// </summary>
public static string GrossVehicleMassRating {
get {
return ResourceManager.GetString("GrossVehicleMassRating", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Height.
/// </summary>
public static string HeightInMm {
get {
return ResourceManager.GetString("HeightInMm", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Legislative Category.
/// </summary>
public static string LegislativeClass {
get {
return ResourceManager.GetString("LegislativeClass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Length.
/// </summary>
public static string LengthInMm {
get {
return ResourceManager.GetString("LengthInMm", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Manufacturer.
/// </summary>
public static string Manufacturer {
get {
return ResourceManager.GetString("Manufacturer", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Predictive Cruise Control.
/// </summary>
public static string PredictiveCruiseControlNullable {
get {
return ResourceManager.GetString("PredictiveCruiseControlNullable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ng Tank System.
/// </summary>
public static string TankSystem {
get {
return ResourceManager.GetString("TankSystem", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Transferred Airdrag Area.
/// </summary>
public static string TransferredAirDragArea {
get {
return ResourceManager.GetString("TransferredAirDragArea", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bodywork Code.
/// </summary>
public static string VehicleCode {
get {
return ResourceManager.GetString("VehicleCode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Width.
/// </summary>
public static string WidthInMm {
get {
return ResourceManager.GetString("WidthInMm", resourceCulture);
}
}
}
}
<?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>
<data name="AirdragArea0" xml:space="preserve">
<value>Airdrag Area 0</value>
</data>
<data name="ATEcoRollReleaseLockupClutch" xml:space="preserve">
<value>ATP Eco Roll Release Lockup Clutch</value>
</data>
<data name="CompressorDrive" xml:space="preserve">
<value>Compressor Drive</value>
</data>
<data name="CurbmassChassis" xml:space="preserve">
<value>Corrected Actual Mass</value>
</data>
<data name="EcoRollTypeNullable" xml:space="preserve">
<value>Eco Roll Type</value>
</data>
<data name="EngineStopStartNullable" xml:space="preserve">
<value>Engine Stop Start</value>
</data>
<data name="EntranceHeightInMm" xml:space="preserve">
<value>Entrance Height</value>
</data>
<data name="GrossVehicleMassRating" xml:space="preserve">
<value>Tech. Perm. Max. Laden Mass</value>
</data>
<data name="HeightInMm" xml:space="preserve">
<value>Height</value>
</data>
<data name="LegislativeClass" xml:space="preserve">
<value>Legislative Category</value>
</data>
<data name="LengthInMm" xml:space="preserve">
<value>Length</value>
</data>
<data name="Manufacturer" xml:space="preserve">
<value>Manufacturer</value>
</data>
<data name="PredictiveCruiseControlNullable" xml:space="preserve">
<value>Predictive Cruise Control</value>
</data>
<data name="TankSystem" xml:space="preserve">
<value>Ng Tank System</value>
</data>
<data name="TransferredAirDragArea" xml:space="preserve">
<value>Transferred Airdrag Area</value>
</data>
<data name="VehicleCode" xml:space="preserve">
<value>Bodywork Code</value>
</data>
<data name="WidthInMm" xml:space="preserve">
<value>Width</value>
</data>
</root>
\ No newline at end of file
......@@ -97,7 +97,7 @@ namespace VECTO3GUI2020.Properties {
}
/// <summary>
/// Looks up a localized string similar to Heater Power.
/// Looks up a localized string similar to Auxiliary Heater Power.
/// </summary>
public static string AuxHeaterPower {
get {
......
......@@ -233,7 +233,7 @@
<value>Air Electric Heater</value>
</data>
<data name="AuxHeaterPower" xml:space="preserve">
<value>Heater Power</value>
<value>Auxiliary Heater Power</value>
</data>
<data name="BrakelightsLED" xml:space="preserve">
<value>Brake Lights LED</value>
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:helper="clr-namespace:VECTO3GUI2020.Helper">
xmlns:helper="clr-namespace:VECTO3GUI2020.Helper"
xmlns:properties="clr-namespace:VECTO3GUI2020.Properties"
xmlns:resources="clr-namespace:System.Resources;assembly=mscorlib">
<ObjectDataProvider x:Key="milimeterDummy"
ObjectType="{x:Type helper:ConvertedSIDummyCreator}"
MethodName="CreateMillimeterDummy"/>
<ObjectDataProvider x:Key="BusStringResourceManager" ObjectType="{x:Type resources:ResourceManager}" ObjectInstance="{x:Static properties:BusStrings.ResourceManager}"/>
</ResourceDictionary>
\ No newline at end of file
......@@ -12,28 +12,28 @@
xmlns:componentimpl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components"
xmlns:componentviews="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components"
xmlns:multistageimpl="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation">
<DataTemplate DataType="{x:Type impl:JobListViewModel}">
<DataTemplate x:Shared="False" DataType="{x:Type impl:JobListViewModel}">
<views:JobListView />
</DataTemplate>
<DataTemplate DataType="{x:Type impl:MessageViewModel}">
<DataTemplate x:Shared="False" DataType="{x:Type impl:MessageViewModel}">
<views:MessageView />
</DataTemplate>
<DataTemplate DataType="{x:Type impl:MainWindowViewModel}">
<DataTemplate x:Shared="False" DataType="{x:Type impl:MainWindowViewModel}">
<local:MainWindow />
</DataTemplate>
<DataTemplate DataType="{x:Type impl:SettingsViewModel}">
<DataTemplate x:Shared="False" DataType="{x:Type impl:SettingsViewModel}">
<views:SettingsView/>
</DataTemplate>
<DataTemplate DataType="{x:Type jobeditimpl:DeclarationJobEditViewModel_v1_0}">
<DataTemplate x:Shared="False" DataType="{x:Type jobeditimpl:DeclarationJobEditViewModel_v1_0}">
<jobeditviews:DeclarationJobEditView/>
</DataTemplate>
<DataTemplate DataType="{x:Type jobeditimpl:DeclarationJobEditViewModel_v2_0}">
<DataTemplate x:Shared="False" DataType="{x:Type jobeditimpl:DeclarationJobEditViewModel_v2_0}">
<jobeditviews:DeclarationJobEditView/>
</DataTemplate>
......@@ -199,27 +199,27 @@
</DataTemplate>
<!--#region Multistage -->
<DataTemplate DataType="{x:Type multistageimpl:NewMultiStageJobViewModel}">
<DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:NewMultiStageJobViewModel}">
<multistageviews:NewMultistageFileView/>
</DataTemplate>
<DataTemplate DataType="{x:Type multistageimpl:ManufacturingStageViewModel_v0_1}">
<DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:ManufacturingStageViewModel_v0_1}">
<multistageviews:ManufacturingStageView></multistageviews:ManufacturingStageView>
</DataTemplate>
<DataTemplate DataType="{x:Type multistageimpl:DeclarationInterimStageBusVehicleViewModel_v2_8}">
<DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:DeclarationInterimStageBusVehicleViewModel_v2_8}">
<multistageviews:VehicleView_v2_8/>
</DataTemplate>
<DataTemplate DataType="{x:Type multistageimpl:MultiStageJobViewModel_v0_1}">
<DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:MultiStageJobViewModel_v0_1}">
<multistageviews:MultiStageView/>
</DataTemplate>
<DataTemplate DataType="{x:Type multistageimpl:MultistageAirdragViewModel}">
<DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:MultistageAirdragViewModel}">
<multistageviews:MultistageAirDragView/>
</DataTemplate>
<DataTemplate DataType="{x:Type multistageimpl:MultistageAuxiliariesViewModel}">
<DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:MultistageAuxiliariesViewModel}">
<multistageviews:ManufacturingStageAuxiliariesView/>
</DataTemplate>
<!--#endregion-->
......
......@@ -240,8 +240,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation
_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_NumberPassengersLowerDeck, _inputData.NumberOfPassengersLowerDeck));
_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_NumberPassengersUpperDeck, _inputData.NumberOfPassengersUpperDeck));
_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_VehicleCode, _inputData.VehicleCode.ToXMLFormat()));
_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, _inputData.VehicleCode.ToXMLFormat()));
_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry));
......@@ -257,7 +256,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation
? _inputData.DoorDriveTechnology.ToXMLFormat()
: null));
_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_DeclarationType, _inputData.VehicleDeclarationType));
_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleDeclarationType, _inputData.VehicleDeclarationType));
if (_inputData.ADAS != null) {
var adasNamespace = XMLNamespaces.V23;
......
......@@ -59,11 +59,17 @@
<Reference Include="InteractiveDataDisplay.WPF, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\InteractiveDataDisplay.WPF.1.0.0\lib\net452\InteractiveDataDisplay.WPF.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Maps.MapControl.WPF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Maps.MapControl.WPF.1.0.0.3\lib\net40-Client\Microsoft.Maps.MapControl.WPF.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Toolkit.Mvvm, Version=7.0.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Toolkit.Mvvm.7.0.2\lib\netstandard2.0\Microsoft.Toolkit.Mvvm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
......@@ -82,8 +88,22 @@
</Reference>
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.5.0.0\lib\net472\System.Reactive.dll</HintPath>
</Reference>
......@@ -137,7 +157,7 @@
<Compile Include="Helper\Converter\XToBoolConverter.cs" />
<Compile Include="Helper\DoubleValidation.cs" />
<Compile Include="Helper\Exceptions.cs" />
<Compile Include="Helper\Extension.cs" />
<Compile Include="Helper\EnumHelper.cs" />
<Compile Include="Helper\IWindowHelper.cs" />
<Compile Include="Helper\DialogHelper.cs" />
<Compile Include="Helper\WindowHelper.cs" />
......@@ -148,6 +168,11 @@
<Compile Include="Ninject\MultistageLazyDependencies.cs" />
<Compile Include="Ninject\MultistageModule.cs" />
<Compile Include="Properties\Annotations.cs" />
<Compile Include="Properties\BusStrings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>BusStrings.resx</DependentUpon>
</Compile>
<Compile Include="Test.xaml.cs">
<DependentUpon>Test.xaml</DependentUpon>
</Compile>
......@@ -634,6 +659,10 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\BusStrings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>BusStrings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
......
......@@ -4,13 +4,19 @@ using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using Microsoft.Toolkit.Mvvm.Input;
using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCore.InputData.FileIO.XML;
using TUGraz.VectoCore.Utils;
using VECTO3GUI2020.Annotations;
using VECTO3GUI2020.Helper;
using VECTO3GUI2020.Model.Interfaces;
using VECTO3GUI2020.Properties;
using VECTO3GUI2020.Util;
using VECTO3GUI2020.ViewModel.Implementation.Common;
using VECTO3GUI2020.ViewModel.Interfaces;
using VECTO3GUI2020.ViewModel.Interfaces.Document;
......@@ -18,6 +24,7 @@ using VECTO3GUI2020.ViewModel.MultiStage.Implementation;
using VECTO3GUI2020.ViewModel.MultiStage.Interfaces;
using VECTO3GUI2020.Views;
using IDocumentViewModel = VECTO3GUI2020.ViewModel.Interfaces.Document.IDocumentViewModel;
using RelayCommand = VECTO3GUI2020.Util.RelayCommand;
namespace VECTO3GUI2020.ViewModel.Implementation
{
......@@ -43,6 +50,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
private BackgroundWorker fileReadingBackgroundWorker;
private ObservableCollection<IDocumentViewModel> _jobs = new ObservableCollection<IDocumentViewModel>();
public ObservableCollection<IDocumentViewModel> Jobs{ get => _jobs; set => SetProperty(ref _jobs, value);}
......@@ -51,17 +59,24 @@ namespace VECTO3GUI2020.ViewModel.Implementation
private IDocumentViewModelFactory _documentViewModelFactory;
private ICommand _newMultiStageFileCommand;
private IMultiStageViewModelFactory _multiStageViewModelFactory;
private IAsyncRelayCommand _addJobAsync;
private readonly IXMLInputDataReader _inputDataReader;
#endregion
public JobListViewModel()
{
InitFileBackGroundWorker();
}
public JobListViewModel(IDocumentViewModelFactory documentViewModelFactory,
IXMLInputDataReader inputDataReader,
IDialogHelper dialogHelper,
IWindowHelper windowHelper,
IMultiStageViewModelFactory multiStageViewModelFactory) : this()
......@@ -69,6 +84,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
_documentViewModelFactory = documentViewModelFactory;
_dialogHelper = dialogHelper;
_windowHelper = windowHelper;
_inputDataReader = inputDataReader;
_multiStageViewModelFactory = multiStageViewModelFactory;
}
......@@ -78,13 +94,22 @@ namespace VECTO3GUI2020.ViewModel.Implementation
{
fileReadingBackgroundWorker = new BackgroundWorker
{
WorkerReportsProgress = false
WorkerReportsProgress = true
};
fileReadingBackgroundWorker.DoWork += fileworker_DoWork;
fileReadingBackgroundWorker.ProgressChanged += fileworker_ProgressChanged;
fileReadingBackgroundWorker.RunWorkerCompleted += fileworker_RunWorkerCompleted;
}
private void fileworker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
Debug.WriteLine(e.ProgressPercentage);
}
public void JobDataGrid_OnDrop(object sender, DragEventArgs e)
{
throw new System.NotImplementedException();
}
......@@ -104,6 +129,62 @@ namespace VECTO3GUI2020.ViewModel.Implementation
_windowHelper.ShowWindow(_multiStageViewModelFactory.GetNewMultistageJobViewModel());
}
public IAsyncRelayCommand AddJobAsyncCommand
{
get
{
return _addJobAsync ?? new AsyncRelayCommand(AddJobExecuteAsync
, () => true);
}
}
private async Task<IDocumentViewModel> AddJobExecuteAsync()
{
var fileName = _dialogHelper.OpenXMLFileDialog();
if (fileName != null) {
return await AddJobAsync(fileName);
}
return null;
}
public async Task<IDocumentViewModel> AddJobAsync(string fileName)
{
if (fileName != null) {
try {
var result = await LoadFileAsync(fileName);
Jobs.Add(result);
return result;
} catch (Exception e) {
var errorString = "";
errorString = $"{fileName}\n";
errorString += e.Message;
_dialogHelper.ShowMessageBox(errorString, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
return null;
}
private Task<IDocumentViewModel> LoadFileAsync([NotNull] string fileName)
{
var xElement = new System.Xml.XmlDocument();
xElement.Load(fileName);
var documentType = XMLHelper.GetDocumentType(xElement?.DocumentElement?.LocalName);
if (documentType == XmlDocumentType.MultistageOutputData) {
var inputDataProvider = _inputDataReader.Create(fileName) as IMultistageBusInputDataProvider;
return Task.FromResult(_multiStageViewModelFactory.GetMultiStageJobViewModel(inputDataProvider) as IDocumentViewModel);
} else {
throw new VectoXMLException($"{documentType.ToString()} not supported");
}
return null;
}
public ICommand AddJob
{
......@@ -121,11 +202,12 @@ namespace VECTO3GUI2020.ViewModel.Implementation
private void AddJobExecute()
{
//Another possibility is to use IsAsync true property of Binding.
IsLoading = true;
var filename = _dialogHelper.OpenXMLFileDialog();
if (filename != null)
{
fileReadingBackgroundWorker.RunWorkerAsync(filename);
LoadJob(filename);
}
else
{
......@@ -133,12 +215,17 @@ namespace VECTO3GUI2020.ViewModel.Implementation
}
}
public void LoadJob([NotNull] string fileName)
{
fileReadingBackgroundWorker.RunWorkerAsync(fileName);
}
public ICommand EditJob
{
get
{
return _editJobCommand ?? new RelayCommand<IJobViewModel>(EditJobExecute,
return _editJobCommand ?? new Util.RelayCommand<IJobViewModel>(EditJobExecute,
(IJobViewModel jobentry) =>
{
return (jobentry != null);
......@@ -163,7 +250,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
{
get
{
return _viewXMLCommand ?? new RelayCommand<IJobViewModel>(ViewXMLFileExecute,
return _viewXMLCommand ?? new Util.RelayCommand<IJobViewModel>(ViewXMLFileExecute,
(IJobViewModel jobentry) =>
{
return (jobentry != null);
......@@ -192,7 +279,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
{
get
{
return _removeJobCommand ?? new RelayCommand<IDocumentViewModel>(RemoveJobExecute, (IDocumentViewModel jobentry) =>
return _removeJobCommand ?? new Util.RelayCommand<IDocumentViewModel>(RemoveJobExecute, (IDocumentViewModel jobentry) =>
{
return (jobentry != null);
});
......@@ -217,7 +304,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
{
get
{
return _moveJobUpCommand ?? new RelayCommand<IDocumentViewModel>(MoveJobUpExecute, (IDocumentViewModel jobentry) =>
return _moveJobUpCommand ?? new Util.RelayCommand<IDocumentViewModel>(MoveJobUpExecute, (IDocumentViewModel jobentry) =>
{
return (jobentry != null && Jobs.Count > 1 && Jobs.IndexOf(jobentry) != 0);
});
......@@ -243,7 +330,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
{
get
{
return _moveJobDownCommand ?? new RelayCommand<IDocumentViewModel>(MoveJobDownExecute, (IDocumentViewModel jobentry) =>
return _moveJobDownCommand ?? new Util.RelayCommand<IDocumentViewModel>(MoveJobDownExecute, (IDocumentViewModel jobentry) =>
{
return (jobentry != null && Jobs.Count > 1 && Jobs.IndexOf(jobentry) != Jobs.Count - 1);
});
......@@ -276,12 +363,11 @@ namespace VECTO3GUI2020.ViewModel.Implementation
string filename = e.Argument as string;
Debug.Assert(filename != null);
//TODO: update usage of GetDocumentType;
//Loading the file
try
{
var xElement = new System.Xml.XmlDocument();
xElement.Load(filename);
var documentType = XMLHelper.GetDocumentType(xElement?.DocumentElement?.LocalName);
if (documentType == null)
{
......@@ -290,6 +376,9 @@ namespace VECTO3GUI2020.ViewModel.Implementation
return;
}
var result = _documentViewModelFactory.CreateDocumentViewModel((XmlDocumentType)documentType, filename);
e.Result = result;
}
......@@ -300,10 +389,6 @@ namespace VECTO3GUI2020.ViewModel.Implementation
}
}
void fileworker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
}
void fileworker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
......
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Windows.Input;
using VECTO3GUI2020.Model.Interfaces;
using VECTO3GUI2020.ViewModel.Interfaces.Document;
......@@ -11,5 +12,6 @@ namespace VECTO3GUI2020.ViewModel.Interfaces
ICommand EditJob { get; }
ObservableCollection<IDocumentViewModel> Jobs { get; }
ICommand NewManufacturingStageFile { get; }
Task<IDocumentViewModel> AddJobAsync(string fileName);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment