Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit fc5a7567 authored by Franz KOBER josef's avatar Franz KOBER josef
Browse files

added about vecto view, fixed xml view error for PIF xml files

parent d46fee70
No related branches found
No related tags found
No related merge requests found
Showing
with 259 additions and 70 deletions
using System;
using System.Globalization;
using System.Windows.Controls;
using System.Windows.Data;
namespace VECTO3GUI.Helper.Converter
{
public class JobEntrySelectedConverter : IValueConverter
{
#region Implementation of IValueConverter
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//var jobEntry = (ViewModel.Impl.JobEntry)((ListViewItem)value)?.Content;
//return jobEntry != null && jobEntry.Selected;
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
#endregion
}
}
......@@ -57,7 +57,8 @@
<MenuItem Header="Help" VerticalAlignment="Center">
<MenuItem Header="About Vecto"/>
<MenuItem Header="About Vecto"
Command="{Binding CurrentViewModel.AboutViewCommand}"/>
</MenuItem>
</Menu>
......
VECTO3GUI/Resources/JRC-About.png

15.4 KiB

VECTO3GUI/Resources/VECTO-About.png

31.8 KiB

......@@ -41,6 +41,11 @@
<views:JobEditView/>
</DataTemplate>
<DataTemplate DataType="{x:Type impl:AboutViewModel}">
<views:AboutView/>
</DataTemplate>
<!--<DataTemplate DataType="{x:Type impl:CompleteVehicleBusJobViewModel}">
<views:JobEditView/>
</DataTemplate>-->
......
......@@ -147,6 +147,7 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
......@@ -227,6 +228,7 @@
<Compile Include="ViewModel\Adapter\Declaration\TyreDeclarationAdapter.cs" />
<Compile Include="ViewModel\Adapter\Declaration\VehicleDeclarationAdapter.cs" />
<Compile Include="ViewModel\Adapter\IAdapterFactory.cs" />
<Compile Include="ViewModel\Impl\AboutViewModel.cs" />
<Compile Include="ViewModel\Impl\AbstractBusJobViewModel.cs" />
<Compile Include="ViewModel\Impl\AbstractComponentViewModel.cs" />
<Compile Include="ViewModel\Impl\AbstractJobViewModel.cs" />
......@@ -296,6 +298,9 @@
<Compile Include="ViewModel\Interfaces\SteeringPumpEntry.cs" />
<Compile Include="ViewModel\Interfaces\TorqueConverterCharacteristics.cs" />
<Compile Include="ViewModel\Interfaces\TorqueEntry.cs" />
<Compile Include="Views\AboutView.xaml.cs">
<DependentUpon>AboutView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\BusJobView.xaml.cs">
<DependentUpon>BusJobView.xaml</DependentUpon>
</Compile>
......@@ -435,7 +440,6 @@
</Compile>
<Compile Include="Helper\Converter\BaseConverter.cs" />
<Compile Include="Helper\DataContextBaseExtension.cs" />
<Compile Include="Helper\Converter\JobEntrySelectedConverter.cs" />
<Compile Include="Helper\SIUnit.cs" />
<Compile Include="Helper\Converter\SIValueConverter.cs" />
<Compile Include="Helper\Converter\VehicleClassConverter.cs" />
......@@ -455,6 +459,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\AboutView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\BusJobView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......@@ -674,6 +682,12 @@
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\VECTO-About.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\JRC-About.png" />
</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.
......

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using VECTO3GUI.Util;
namespace VECTO3GUI.ViewModel.Impl
{
public class AboutViewModel : ObservableObject
{
#region Members
private ICommand _euplLinkClickedCommand;
private ICommand _mailClickedCommand;
private ICommand _jrcPicClickedCommand;
#endregion
#region Properties
public string EUPLLink { get; set; }
public string JRCMail { get; set; }
public string JRCPic { get; set; }
#endregion
public AboutViewModel()
{
EUPLLink = "https://joinup.ec.europa.eu/community/eupl/og_page/eupl";
JRCMail = "mailto:jrc-vecto@ec.europa.eu";
JRCPic = "http://ec.europa.eu/dgs/jrc/index.cfm";
}
#region Commands
public ICommand EUPLLinkClickedCommand
{
get
{
return _euplLinkClickedCommand ?? (_euplLinkClickedCommand = new RelayCommand(DoLinkClickedCommand));
}
}
private void DoLinkClickedCommand()
{
Process.Start(EUPLLink);
}
public ICommand MailClickedCommand
{
get { return _mailClickedCommand ?? (_mailClickedCommand = new RelayCommand(DoMailClickedCommand)); }
}
private void DoMailClickedCommand()
{
Process.Start(JRCMail);
}
public ICommand JrcPicClickedCommand
{
get { return _jrcPicClickedCommand ?? (_jrcPicClickedCommand = new RelayCommand(DoJrcPicClickedCommand)); }
}
private void DoJrcPicClickedCommand()
{
Process.Start(JRCPic);
}
#endregion
}
}
......@@ -228,8 +228,8 @@ namespace VECTO3GUI.ViewModel.Impl
Header = new JobHeader {
JobType = JobType,
FileVersion = JobType.GetJobTypeNumberByJobType(),
AppVersion = "unknown",
CreatedBy = "unknown",
AppVersion = JobEntry.APP_VERSION,
CreatedBy = Environment.UserName,
Date = DateTime.UtcNow
}
};
......
......@@ -67,6 +67,8 @@ namespace VECTO3GUI.ViewModel.Impl
public class JobEntry : ObservableObject
{
public const string APP_VERSION = "VECTO3GUI";
private JobHeader _header;
private JobBody _body;
private bool _selected;
......
......@@ -6,11 +6,9 @@ using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
using System.Xml;
using System.Xml.Linq;
......@@ -70,7 +68,6 @@ namespace VECTO3GUI.ViewModel.Impl
private ICommand _editCompletedFileCommand;
private ICommand _moveJobUpCommand;
private ICommand _moveJobDownCommand;
private ICommand _startSimulationCommand;
private ICommand _openInFolderCommand;
private ICommand _doubleClickCommand;
private ICommand _runSimulationCommand;
......@@ -87,6 +84,7 @@ namespace VECTO3GUI.ViewModel.Impl
private string _outputDirectory;
private ICommand _browseOutputDirectory;
private bool _writeModelData;
private ICommand _aboutViewCommand;
#endregion
......@@ -327,7 +325,7 @@ namespace VECTO3GUI.ViewModel.Impl
get { return _writeModelData; }
set { SetProperty(ref _writeModelData, value); }
}
private void DoBrowseOutputDirectory()
{
var filePath = FileDialogHelper.ShowSelectFilesDialog(false, FileDialogHelper.JobFilter);
......@@ -409,10 +407,10 @@ namespace VECTO3GUI.ViewModel.Impl
{
return _editCompletedFileCommand ??
(_editCompletedFileCommand =
new RelayCommand<JobEntry>(DoEditCompletedFile, CanEditCompletdFile));
new RelayCommand<JobEntry>(DoEditCompletedFile, CanEditCompletedFile));
}
}
private bool CanEditCompletdFile(JobEntry jobEntry)
private bool CanEditCompletedFile(JobEntry jobEntry)
{
return jobEntry != null &&
(IsJobEntry(jobEntry) || jobEntry.Header.JobType == JobType.CompletedXml);
......@@ -468,9 +466,10 @@ namespace VECTO3GUI.ViewModel.Impl
{
xmlViewModel = new XMLViewModel(SelectedJobEntry.JobEntryFilePath);
}
else if (IsJobFile(_selectedJobEntry.JobEntryFilePath))
xmlViewModel = new XMLViewModel(
SelectedJobEntry.GetAbsoluteFilePath(SelectedJobEntry.Body.PrimaryVehicle));
else if (IsJobFile(_selectedJobEntry.JobEntryFilePath)) {
var filePath = SelectedJobEntry.Body.PrimaryVehicle ?? SelectedJobEntry.Body.PrimaryVehicleResults;
xmlViewModel = new XMLViewModel(SelectedJobEntry.GetAbsoluteFilePath(filePath));
}
break;
case JobFileType.CompletedBusFile:
xmlViewModel = new XMLViewModel(
......@@ -613,17 +612,6 @@ namespace VECTO3GUI.ViewModel.Impl
_jobs.Move(index, index + 1);
}
public ICommand StartSimulation
{
get { return _startSimulationCommand ?? (_startSimulationCommand = new RelayCommand(DoStartSimulationCommand)); }
}
private void DoStartSimulationCommand()
{
}
public ICommand OpenInFolder
{
get { return _openInFolderCommand ?? (_openInFolderCommand = new RelayCommand<JobEntry>(DoOpenInFolderCommand)); }
......@@ -640,6 +628,19 @@ namespace VECTO3GUI.ViewModel.Impl
}
}
public ICommand AboutViewCommand
{
get { return _aboutViewCommand ?? (_aboutViewCommand = new RelayCommand(DoAboutViewCommand)); }
}
private void DoAboutViewCommand()
{
var viewModel = new AboutViewModel();
var window = OutputWindowHelper.CreateOutputWindow(Kernel, viewModel, "About VECTO", 507, 395, ResizeMode.NoResize);
window.Show();
}
#endregion
private object GetBusJobViewModel(JobType jobType, JobEntry jobEntry = null)
......
......@@ -16,7 +16,6 @@ namespace VECTO3GUI.ViewModel.Interfaces
ICommand RemoveAllJobs { get; }
ICommand MoveJobUp { get; }
ICommand MoveJobDown { get; }
ICommand StartSimulation { get; }
ICommand EditJob { get; }
ICommand EditCompletedFile { get; }
ICommand CreateNewJob { get; }
......@@ -36,5 +35,6 @@ namespace VECTO3GUI.ViewModel.Interfaces
string OutputDirectory { get; set; }
ICommand BrowseOutputDirectory { get; }
bool WriteModelData { get; set; }
ICommand AboutViewCommand { get; }
}
}
<UserControl x:Class="VECTO3GUI.Views.AboutView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VECTO3GUI.Views"
mc:Ignorable="d"
d:DesignHeight="395" d:DesignWidth="507">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5"/>
<ColumnDefinition/>
<ColumnDefinition Width="5"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column ="1">
<Grid.RowDefinitions>
<RowDefinition Height="10"/>
<RowDefinition/>
<RowDefinition Height="35"/>
<RowDefinition Height="115"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Image HorizontalAlignment="Center" VerticalAlignment="Center">
<Image.Source>
<BitmapImage UriSource="../Resources/VECTO-About.png"/>
</Image.Source>
</Image>
</Grid>
<Grid Grid.Row="2" Margin="0,5,0,0">
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="5,0,0,0">
<TextBlock>
<Hyperlink NavigateUri="{Binding EUPLLink}" Command="{Binding EUPLLinkClickedCommand}">
<TextBlock Text="VECTO is licensed under EUPL 1.1+"/>
</Hyperlink>
</TextBlock>
<TextBlock Text="Copyright © 2012-2019 European Union"/>
</StackPanel>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="10,30,0,0" >
<StackPanel Orientation="Vertical" HorizontalAlignment="Left">
<TextBlock Text="Developed on behalf of the"/>
<TextBlock Text="European Commission DG CLIMA" Margin="20,0,0,0"/>
</StackPanel>
</Grid>
<Grid Grid.Column="1">
<Button Command="{Binding JrcPicClickedCommand}">
<Button.Template>
<ControlTemplate>
<Image HorizontalAlignment="Center" VerticalAlignment="Center">
<Image.Source>
<BitmapImage UriSource="../Resources/JRC-About.png"/>
</Image.Source>
</Image>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</Grid>
<Grid Grid.Row="4">
<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
<TextBlock Text="Support Contact:"/>
<TextBlock Margin="5,0,0,0">
<Hyperlink NavigateUri="{Binding JRCMail}" Command="{Binding MailClickedCommand}" >
<TextBlock Text="jrc-vecto@ec.europa.eu"/>
</Hyperlink>
</TextBlock>
</StackPanel>
</Grid>
</Grid>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VECTO3GUI.Views
{
/// <summary>
/// Interaction logic for AboutView.xaml
/// </summary>
public partial class AboutView : UserControl
{
public AboutView()
{
InitializeComponent();
}
}
}
......@@ -92,36 +92,36 @@
<DataGrid.Resources>
<ContextMenu x:Key="RowMenu">
<MenuItem Header="{Binding DataContext.FirstContextMenu, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
Command="{Binding DataContext.OpenJob, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding Source={x:Static impl:JobFileType.PrimaryBusFile}}"
Visibility="{Binding DataContext.VisibilityFirstView, Converter={converter:BoolVisibilityConverter},
RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
Command="{Binding DataContext.OpenJob, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding Source={x:Static impl:JobFileType.PrimaryBusFile}}"
Visibility="{Binding DataContext.VisibilityFirstView, Converter={converter:BoolVisibilityConverter},
RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
<MenuItem Header="View Completed Bus File"
Command="{Binding DataContext.OpenJob, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding Source={x:Static impl:JobFileType.CompletedBusFile}}"
Visibility="{Binding DataContext.VisibilitySecView, Converter={converter:BoolVisibilityConverter},
RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
Command="{Binding DataContext.OpenJob, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding Source={x:Static impl:JobFileType.CompletedBusFile}}"
Visibility="{Binding DataContext.VisibilitySecView, Converter={converter:BoolVisibilityConverter},
RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
<Separator HorizontalAlignment="Stretch" Background="Gray"/>
<MenuItem Header="Edit Job"
Command="{Binding DataContext.EditJob, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding DataContext.SelectedJobEntry, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
Command="{Binding DataContext.EditJob, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding DataContext.SelectedJobEntry, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
<MenuItem Header="Edit Completed File"
Command="{Binding DataContext.EditCompletedFile, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding DataContext.SelectedJobEntry, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
Command="{Binding DataContext.EditCompletedFile, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding DataContext.SelectedJobEntry, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
<Separator HorizontalAlignment="Stretch" Background="Gray"/>
<MenuItem Header="Show In Folder"
Command="{Binding DataContext.OpenInFolder, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding DataContext.SelectedJobEntry, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
Command="{Binding DataContext.OpenInFolder, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding DataContext.SelectedJobEntry, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
<Separator HorizontalAlignment="Stretch" Background="Gray"/>
<MenuItem Header="Remove Job"
Command="{Binding DataContext.RemoveJob, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding DataContext.SelectedJobEntry, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
Command="{Binding DataContext.RemoveJob, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"
CommandParameter="{Binding DataContext.SelectedJobEntry, RelativeSource={RelativeSource AncestorType=views:JoblistView}}"/>
</ContextMenu>
</DataGrid.Resources>
......@@ -130,11 +130,11 @@
<MenuItem Header="Add Job" Command="{Binding AddJob}"/>
<Separator HorizontalAlignment="Stretch" Background="Gray"/>
<MenuItem Header="Create Single Bus Job"
Command="{Binding AddBusJob}" CommandParameter="{Binding Source={x:Static impl:JobType.SingleBusJob}}"/>
Command="{Binding AddBusJob}" CommandParameter="{Binding Source={x:Static impl:JobType.SingleBusJob}}"/>
<MenuItem Header="Create Completed Bus Job"
Command="{Binding AddBusJob}" CommandParameter="{Binding Source={x:Static impl:JobType.CompletedBusJob}}"/>
Command="{Binding AddBusJob}" CommandParameter="{Binding Source={x:Static impl:JobType.CompletedBusJob}}"/>
<MenuItem Header="Create Completed XML"
Command="{Binding CreateNewJob}"/>
Command="{Binding CreateNewJob}"/>
<Separator HorizontalAlignment="Stretch" Background="Gray"/>
<MenuItem Header="Remove All" Command="{Binding RemoveAllJobs}"/>
</ContextMenu>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment