Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

gui fixes and started with completed and singel bus job

parent 1fed69ea
No related branches found
No related tags found
No related merge requests found
Showing
with 229 additions and 17 deletions
......@@ -201,6 +201,7 @@
<Compile Include="ViewModel\Impl\AxlegearViewModel.cs" />
<Compile Include="ViewModel\Impl\AxlesViewModel.cs" />
<Compile Include="ViewModel\Impl\AxleViewModel.cs" />
<Compile Include="ViewModel\Impl\BusJobViewModel.cs" />
<Compile Include="ViewModel\Impl\CompleteVehicleBusJobViewModel.cs" />
<Compile Include="ViewModel\Impl\CompleteVehicleBusViewModel.cs" />
<Compile Include="ViewModel\Impl\CyclesViewModel.cs" />
......@@ -211,6 +212,7 @@
<Compile Include="ViewModel\Impl\JobEntry.cs" />
<Compile Include="ViewModel\Impl\JoblistViewModel.cs" />
<Compile Include="ViewModel\Impl\MainWindowViewModel.cs" />
<Compile Include="ViewModel\Impl\MessageEntry.cs" />
<Compile Include="ViewModel\Impl\NoneViewModel.cs" />
<Compile Include="ViewModel\Impl\ObservableObject.cs" />
<Compile Include="ViewModel\Impl\OutputWindowViewModel.cs" />
......@@ -256,6 +258,9 @@
<Compile Include="ViewModel\Interfaces\SteeringPumpEntry.cs" />
<Compile Include="ViewModel\Interfaces\TorqueConverterCharacteristics.cs" />
<Compile Include="ViewModel\Interfaces\TorqueEntry.cs" />
<Compile Include="Views\BusJobView.xaml.cs">
<DependentUpon>BusJobView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ComponentViews\Declaration\AirdragDeclarationView.xaml.cs">
<DependentUpon>AirdragDeclarationView.xaml</DependentUpon>
</Compile>
......@@ -409,6 +414,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\BusJobView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ComponentViews\Declaration\AirdragDeclarationView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VECTO3GUI.ViewModel.Impl
{
public class BusJobViewModel : ObservableObject
{
}
}
......@@ -234,6 +234,7 @@ namespace VECTO3GUI.ViewModel.Impl
public AllowedEntry<VehicleCode>[] AllowedVehicleCodes { get; private set; }
public AllowedEntry<FloorType>[] AllowedFloorTypes { get; private set; }
public AllowedEntry<ConsumerTechnology>[] AllowedConsumerTechnologies { get; private set; }
public AllowedEntry<RegistrationClass>[] AllowedRegisteredClasses { get; private set; }
#endregion
......@@ -288,11 +289,19 @@ namespace VECTO3GUI.ViewModel.Impl
AllowedVehicleCodes = Enum.GetValues(typeof(VehicleCode)).Cast<VehicleCode>()
.Select(vc => AllowedEntry.Create(vc, vc.GetLabel())).ToArray();
AllowedFloorTypes = Enum.GetValues(typeof(FloorType)).Cast<FloorType>()
.Select(ft => AllowedEntry.Create(ft, ft.GetLabel())).ToArray();
var highFloor = AllowedEntry.Create(FloorType.HighFloor, FloorType.HighFloor.GetLabel());
var lowFloor = AllowedEntry.Create(FloorType.LowFloor, FloorType.LowFloor.GetLabel());
AllowedFloorTypes = new []{ highFloor, lowFloor };
AllowedConsumerTechnologies = Enum.GetValues(typeof(ConsumerTechnology)).Cast<ConsumerTechnology>()
.Select(sc => AllowedEntry.Create(sc, sc.GetLabel())).ToArray();
AllowedRegisteredClasses = Enum.GetValues(typeof(RegistrationClass)).Cast<RegistrationClass>()
.Select(vc => AllowedEntry.Create(vc, vc.GetLabel())).ToArray();
AllowedRegisteredClasses =
AllowedRegisteredClasses.Where(val => val.Value != RegistrationClass.unknown).ToArray();
}
#endregion
......
......@@ -21,6 +21,7 @@ using VECTO3GUI.Util;
using VECTO3GUI.ViewModel.Interfaces;
using System.Xml;
using System.Xml.Linq;
using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
using VECTO3GUI.Helper;
......@@ -35,6 +36,7 @@ namespace VECTO3GUI.ViewModel.Impl
#region Members
protected readonly ObservableCollection<JobEntry> _jobs = new ObservableCollection<JobEntry>();
protected readonly ObservableCollection<MessageEntry> _messages = new ObservableCollection<MessageEntry>();
private readonly SettingsModel _settings;
private JobEntry _selectedJobEntry;
......@@ -53,6 +55,7 @@ namespace VECTO3GUI.ViewModel.Impl
private ICommand _openSettingsCommand;
private ICommand _exitCommand;
private ICommand _exitMainCommand;
private ICommand _addBusJobCommand;
#endregion
......@@ -69,6 +72,11 @@ namespace VECTO3GUI.ViewModel.Impl
get { return _jobs; }
}
public ObservableCollection<MessageEntry> Messages
{
get { return _messages; }
}
#endregion
......@@ -205,8 +213,7 @@ namespace VECTO3GUI.ViewModel.Impl
{
get
{
return _addJobCommand ??
(_addJobCommand = new RelayCommand(DoAddJob));
return _addJobCommand ?? (_addJobCommand = new RelayCommand(DoAddJob));
}
}
private void DoAddJob()
......@@ -253,6 +260,22 @@ namespace VECTO3GUI.ViewModel.Impl
window?.Close();
}
public ICommand AddBusJob
{
get
{
return _addBusJobCommand ??
(_addBusJobCommand = new RelayCommand(DoAddBusJobCommand));
}
}
private void DoAddBusJobCommand()
{
var viewModel = new BusJobViewModel();
var window = OutputWindowHelper.CreateOutputWindow(Kernel, viewModel, "Create Bus Job");
window.ShowDialog();
}
public ICommand MoveJobUp { get { return new RelayCommand(() => { }, () => false); } }
public ICommand MoveJobDown { get { return new RelayCommand(() => { }, () => false); } }
......@@ -301,6 +324,11 @@ namespace VECTO3GUI.ViewModel.Impl
private IJobEditViewModel CreateCompleteBusVehicleViewModel(IDeclarationInputDataProvider dataProvider)
{
_messages.Add(new MessageEntry {
Message = "Edit File"
});
return dataProvider == null ? null : new CompleteVehicleBusJobViewModel(Kernel, dataProvider);
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VECTO3GUI.ViewModel.Impl
{
public class MessageEntry : ObservableObject
{
private string _message;
private DateTime _time;
private string _source;
public string Message
{
get { return _message; }
set { SetProperty(ref _message, value); }
}
public DateTime Time
{
get { return _time; }
set { SetProperty(ref _time, value); }
}
public string Source
{
get { return _source; }
set { SetProperty(ref _source, value); }
}
}
}
......@@ -12,5 +12,6 @@ namespace VECTO3GUI.ViewModel.Interfaces
AllowedEntry<VehicleCode>[] AllowedVehicleCodes { get; }
AllowedEntry<FloorType>[] AllowedFloorTypes { get; }
AllowedEntry<ConsumerTechnology>[] AllowedConsumerTechnologies { get; }
AllowedEntry<RegistrationClass>[] AllowedRegisteredClasses { get; }
}
}
......@@ -7,6 +7,8 @@ namespace VECTO3GUI.ViewModel.Interfaces
public interface IJoblistViewModel : IMainView
{
ObservableCollection<JobEntry> Jobs { get; }
ObservableCollection<MessageEntry> Messages { get; }
ICommand AddBusJob { get; }
ICommand AddJob { get; }
ICommand RemoveJob { get; }
ICommand RemoveAllJobs { get; }
......
<UserControl x:Class="VECTO3GUI.Views.BusJobView"
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="200" d:DesignWidth="440">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" >
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<ComboBox DataContext="{Binding }"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="Default Save Path Location: " Margin="5,0,0,0"/>
<TextBox Width="200" Margin="0,0,5,0" IsReadOnly="True" IsReadOnlyCaretVisible="True"
Text="{Binding SavePathFolder}"/>
<Button Content="..." Width="30"
Command="{Binding OpenSaveFolderCommand}"
CommandParameter="{Binding SavePathFolder}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock Text="Default XML-Files Location: " Margin="5,0,0,0"/>
<TextBox Width="200" Margin="0,0,5,0" IsReadOnly="True" IsReadOnlyCaretVisible="True"
Text="{Binding XMLFilePath}"/>
<Button Content="..." Width="30"
Command="{Binding OpenXMLFolderCommand}"
CommandParameter="{Binding XMLFilePath}"/>
</StackPanel>
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="Reset" HorizontalAlignment="Left" Width="80" Margin="10,0,0,0"
Command="{Binding ResetCommand}"/>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
<Button Content="Save" HorizontalAlignment="Right" Margin="5,0,0,0" VerticalAlignment="Center" Width="70"
Command="{Binding SaveCommand}"/>
<Button Content="Cancel" HorizontalAlignment="Right" Margin="5,0,10,0" Width="70"
Command="{Binding CancelCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
</StackPanel>
</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 BusJobView.xaml
/// </summary>
public partial class BusJobView : UserControl
{
public BusJobView()
{
InitializeComponent();
}
}
}
......@@ -50,7 +50,7 @@
<DataGrid x:Name="AlternatorDataGrid" AutoGenerateColumns="False" ColumnWidth="*" IsReadOnly="False" CanUserAddRows="False" VerticalAlignment="Top"
HeadersVisibility="All" RowHeaderWidth="10" Height="150" Margin="0,10,0,0"
HeadersVisibility="All" RowHeaderWidth="10" Height="150" Margin="0,10,0,0" BorderThickness="1"
ItemsSource="{Binding AlternatorTechnologies}">
<DataGrid.Resources>
......
......@@ -9,7 +9,7 @@
xmlns:helper="clr-namespace:VECTO3GUI.Helper"
xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="500">
d:DesignHeight="800" d:DesignWidth="500">
<d:PrimaryVehicleBusView.DataContext>
<x:Type Type="interfaces:ICompleteVehicleBusViewModel" />
......@@ -27,8 +27,8 @@
<RowDefinition/>
</Grid.RowDefinitions>
<GroupBox Header="Vehicle Data" Grid.Row="1" Grid.Column="1" Width="420" HorizontalAlignment="Left">
<StackPanel Orientation="Vertical" Width="400" HorizontalAlignment="Left" Grid.IsSharedSizeScope="True">
<GroupBox Header="Vehicle Data" Grid.Row="1" Grid.Column="1" Width="420" Height="650" HorizontalAlignment="Left" VerticalAlignment="Top">
<StackPanel Orientation="Vertical" Width="400" HorizontalAlignment="Left" Grid.IsSharedSizeScope="True" VerticalAlignment="Center">
<StackPanel Orientation="Vertical" DockPanel.Dock="Top" Grid.IsSharedSizeScope="True">
<customControls:VectoParameterControl
......@@ -50,9 +50,16 @@
Value="{Binding LegislativeClass}"
AllowedValues="{Binding AllowedLegislativeClasses}" />
<customControls:VectoParameterControl
<!--<customControls:VectoParameterControl
Caption="Registered Class" Unit="" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth"
Value="{Binding RegisteredClass}" />
Value="{Binding RegisteredClass}"/>-->
<customControls:ComboParameter
Caption="Vehicle Code"
CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth"
Value="{Binding RegisteredClass}"
AllowedValues="{Binding AllowedRegisteredClasses}" />
<customControls:ComboParameter
Caption="Vehicle Code"
......
......@@ -26,6 +26,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
......@@ -73,12 +74,27 @@
<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" Command="{Binding AddBusJob}" Content="Add Bus Job"/>
<Button Margin="0,5,0,0" Command="{Binding EditJob}" Content="Edit File" />
<Button Margin="0,5,0,0" Command="{Binding CreateNewJob}" Content="New File" />
<Button Margin="0,5,0,0" Command="{Binding RemoveJob}" Content="Remove File" />
</StackPanel>
</Grid>
<Grid Grid.Row="2" Grid.ColumnSpan="3" Margin="10,20,20,10">
<DataGrid ItemsSource="{Binding Messages}" BorderThickness="1" CanUserAddRows="False" AutoGenerateColumns="False" SelectionUnit="FullRow"
IsReadOnly="True" HeadersVisibility="All" RowHeaderWidth="5">
<DataGrid.Columns>
<DataGridTextColumn Header="Message" Binding="{Binding Message}" Width="*" />
<DataGridTextColumn Header="Time" Binding="{Binding Time}" Width="130" />
<DataGridTextColumn Header="Source" Binding="{Binding Source}" Width="150" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid>
......
......@@ -26,7 +26,18 @@
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<ContentControl Content="{Binding ViewModel}" />
</Grid>
<Grid Grid.Row="1">
<StatusBar/>
</Grid>
</Grid>
</mah:MetroWindow>
......@@ -15,19 +15,15 @@ namespace TUGraz.VectoCommon.BusAuxiliaries {
{
switch (self)
{
case FloorType.Unknown:
return "Unknown";
case FloorType.SemiLowFloor:
case FloorType.LowFloor:
return "Low Floor";
case FloorType.HighFloor:
return "High Floor";
case FloorType.SemiLowFloor:
return "Semi Low Floor";
default:
throw new ArgumentOutOfRangeException(nameof(self), self, null);
return "Unknown";
}
}
}
}
\ No newline at end of file
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