diff --git a/Documentation/User Manual Source/Release Notes Vecto3.x.pdf b/Documentation/User Manual Source/Release Notes Vecto3.x.pdf index 3b35b41552810331d09908464256ec31159f8fa9..a69695a461e0c27709a9d1a520645789e7ec1554 100644 Binary files a/Documentation/User Manual Source/Release Notes Vecto3.x.pdf and b/Documentation/User Manual Source/Release Notes Vecto3.x.pdf differ diff --git a/VECTO3GUI2020/Model/Multistage/JSONJob.cs b/VECTO3GUI2020/Model/Multistage/JSONJob.cs index fd1068f01b00d4b6ce5be9218614d45650a611b1..1723874b6863d0788df3bf603abfbca0cd858263 100644 --- a/VECTO3GUI2020/Model/Multistage/JSONJob.cs +++ b/VECTO3GUI2020/Model/Multistage/JSONJob.cs @@ -73,6 +73,7 @@ namespace VECTO3GUI2020.Model.Multistage private string _interimStep; private string _primaryVehicle; private bool _completed; + private bool _runSimulation; public string PrimaryVehicle { @@ -91,5 +92,11 @@ namespace VECTO3GUI2020.Model.Multistage get => _completed; set => SetProperty(ref _completed, value); } + + public bool RunSimulation + { + get => _runSimulation; + set => SetProperty(ref _runSimulation, value); + } } } \ No newline at end of file diff --git a/VECTO3GUI2020/VECTO3GUI2020.csproj b/VECTO3GUI2020/VECTO3GUI2020.csproj index 18d782fc1c1cb320d7614e5c801606fcee556289..0659efb3d7d736d2b94a0ea813cc362fe5216b06 100644 --- a/VECTO3GUI2020/VECTO3GUI2020.csproj +++ b/VECTO3GUI2020/VECTO3GUI2020.csproj @@ -23,6 +23,9 @@ <PropertyGroup Condition="('$(Configuration)' == 'MockupRelease') Or ('$(Configuration)' == 'MockupDebug')"> <DefineConstants>$(DefineConstants);MOCKUP</DefineConstants> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='MockupDebug|net60-windows|AnyCPU'"> + <DebugType>full</DebugType> + </PropertyGroup> <ItemGroup> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" /> @@ -110,9 +113,7 @@ <Target Name="RemoveDuplicateAnalyzers" BeforeTargets="CoreCompile"> <RemoveDuplicates Inputs="@(Analyzer)"> - <Output - TaskParameter="Filtered" - ItemName="FilteredAnalyzer"/> + <Output TaskParameter="Filtered" ItemName="FilteredAnalyzer" /> </RemoveDuplicates> <ItemGroup> diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs index 8a0b2deffa9de83d13120c3d9dfb2508d506d8c1..f1217cbed0bcf4a96faed06ca18997f2a595e97d 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs @@ -66,6 +66,14 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set => SetProperty(ref _completed, value); } + private bool _runSimulation; + + public bool RunSimulation + { + get => _runSimulation; + set => SetProperty(ref _runSimulation, value); + } + #region Labeling private string _vifType; @@ -96,7 +104,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation _additionalJobInfo = additionalJobInfo; SetupBackingStorage(); additionalJobInfo.SetParent(this); - + UpdateTitleAndDocumentName(); (this as INotifyPropertyChanged).PropertyChanged += CreateVifViewModel_PropertyChanged; @@ -106,7 +114,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { _backingStorage = new BackingStorage<CreateVifViewModel>(this, nameof(this.PrimaryInputPath), - nameof(this.StageInputPath)); + nameof(this.StageInputPath), nameof(RunSimulation)); _backingStorage.PropertyChanged += (object s, PropertyChangedEventArgs e) => { OnPropertyChanged(nameof(UnsavedChanges)); }; @@ -141,7 +149,9 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation IAdditionalJobInfoViewModel additionalJobInfo) : this(dialogHelper, inputDataReader, additionalJobInfo) { _completed = completed; - } + _runSimulation = completed; + UpdateTitleAndDocumentName(); + } private void SetInputData(IInputDataProvider inputData) @@ -163,7 +173,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } - Completed = inputDataProvider.Completed ?? false; + Completed = inputDataProvider?.Completed ?? false; + RunSimulation = inputDataProvider?.SimulateResultingVIF ?? false; DataSource = inputData.DataSource; UpdateTitleAndDocumentName(); @@ -292,7 +303,9 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation }, Body = new JSONJobBody() { PrimaryVehicle = PathHelper.GetRelativePath(path, PrimaryInputPath), - InterimStep = PathHelper.GetRelativePath(path, StageInputPath) + InterimStep = PathHelper.GetRelativePath(path, StageInputPath), + Completed = Completed, + RunSimulation = RunSimulation, } }; diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs index 250aff162fa57b7b9c5786b0ea6c1b47a7306bb2..927bc5a5224181604489e9d607d881fa03f20bc3 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs @@ -200,7 +200,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation writer = new FileOutputVIFWriter(outputFile, numberOfManufacturingStages); } - var inputData = new XMLDeclarationVIFInputData(vifData.MultistageJobInputData, vifData.VehicleInputData); + var inputData = new XMLDeclarationVIFInputData(vifData.MultistageJobInputData, vifData.VehicleInputData, false); var factory = _simFactoryFactory.Factory(ExecutionMode.Declaration, inputData, writer, null, null); @@ -365,6 +365,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public IMultistepBusInputDataProvider MultistageJobInputData => this; + public bool SimulateResultingVIF => throw new NotImplementedException(); #endregion diff --git a/VECTO3GUI2020/Views/Multistage/CreateVifView.xaml b/VECTO3GUI2020/Views/Multistage/CreateVifView.xaml index 5be0ce48930362fcca7628109545f2fe13338a98..fdfeab02870f99c7aaeabfe2ac4bbc8a723d81ba 100644 --- a/VECTO3GUI2020/Views/Multistage/CreateVifView.xaml +++ b/VECTO3GUI2020/Views/Multistage/CreateVifView.xaml @@ -23,6 +23,7 @@ <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> + <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Label Style="{DynamicResource LabelStyle1}">Select Primary Input</Label> @@ -45,6 +46,11 @@ <Button DockPanel.Dock="Right" Command="{Binding RemoveStageInputCommand}" ContentTemplate="{StaticResource TrashIcon}" Width="30" Padding="4" Margin="4"/> <customControls:FilePicker DockPanel.Dock="Left" Text="{Binding StageInputPath}" Command="{Binding SelectCompletedInputFileCommand}" /> </DockPanel> + <Label Grid.Row="4" DockPanel.Dock="Left" Style="{DynamicResource LabelStyle1}" Visibility="{Binding Completed, Converter={StaticResource BooleanToVisibilityConverter}}">Simulate Resulting VIF</Label> + <CheckBox Grid.Row="4" HorizontalAlignment="Right" IsChecked="{Binding RunSimulation, Mode=TwoWay}" IsEnabled="True" IsThreeState="False" Visibility="{Binding Completed, Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center" Padding="4"></CheckBox> + + + </Grid> <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right"> <Button Width="100" Style="{StaticResource MultiStageButtonStyle1}" Command="{Binding SaveJobAsCommand}">Save Job as ...</Button> diff --git a/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs b/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs index 96a6089f3b762cabfed412fcba165038f3cc98cc..8fe0e1977dd98ed312ec05cdf69fa375386d12fc 100644 --- a/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs +++ b/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs @@ -98,6 +98,8 @@ namespace TUGraz.VectoCommon.InputData { IDeclarationInputDataProvider PrimaryVehicle { get; } IVehicleDeclarationInputData StageInputData { get; } + + bool SimulateResultingVIF { get; } } @@ -125,6 +127,7 @@ namespace TUGraz.VectoCommon.InputData { IVehicleDeclarationInputData VehicleInputData { get; } IMultistepBusInputDataProvider MultistageJobInputData { get; } + bool SimulateResultingVIF { get; } } } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index cb1d9668c0c121abf7171690cccda88dea71c927..b1f3ad145575a2237b3fde99f13fd2bf790f5286 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -1017,6 +1017,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON private readonly IXMLInputDataReader _xmlInputReader; protected internal string PrimaryInputDataFile; protected internal string CompletedInputDataFile; + protected internal bool RunSimulation; public JSONInputDataCompletedBusFactorMethodV7(JObject data, string filename, bool tolerateMissing = false) : base( data, filename, tolerateMissing) @@ -1026,6 +1027,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON PrimaryInputDataFile = Path.Combine(BasePath, Body.GetEx<string>("PrimaryVehicleResults")); CompletedInputDataFile = Path.Combine(BasePath, Body.GetEx<string>("CompletedVehicle")); + RunSimulation = Body.GetEx<bool>(JsonKeys.BUS_RunSimulation); + //PrimaryVehicle = CreateReader(primaryInputData); @@ -1072,6 +1075,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON public IVehicleDeclarationInputData VehicleInputData => Vehicle; public IMultistepBusInputDataProvider MultistageJobInputData => PrimaryVehicleData; + public bool SimulateResultingVIF => RunSimulation; + #endregion } @@ -1212,9 +1217,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON : null; + public bool SimulateResultingVIF => _simulateResultingVif; private bool? _completed; + private bool _simulateResultingVif; public bool? Completed { @@ -1232,6 +1239,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON _primaryVehicleInputDataPath = Body.GetEx<string>(JsonKeys.PrimaryVehicle); _primaryVehicleInputDataPath = PathHelper.GetAbsolutePath(filename, _primaryVehicleInputDataPath); + _simulateResultingVif = Body.GetEx<bool>(JsonKeys.BUS_RunSimulation); _stageInputDataPath = Body.GetEx<string>(JsonKeys.InterimStep); _stageInputDataPath = PathHelper.GetAbsolutePath(filename, _stageInputDataPath); _completed = Body.GetValueOrDefault<bool>(JsonKeys.Completed); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs index 8d45c71e4fbc6da601b81b3d401d7d8685dcdc80..6970ca1c2dfa1e1fcab036c424795e69a16cdc2b 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs @@ -222,16 +222,23 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private readonly IVehicleDeclarationInputData _vehicleInput; public XMLDeclarationVIFInputData(IMultistepBusInputDataProvider multistageJobInputData, - IVehicleDeclarationInputData vehicleInput) + IVehicleDeclarationInputData vehicleInput) : this(multistageJobInputData, vehicleInput, false) { } + + public XMLDeclarationVIFInputData(IMultistepBusInputDataProvider multistageJobInputData, + IVehicleDeclarationInputData vehicleInput, bool runSimulation) { _multistageJobInputData = multistageJobInputData; _vehicleInput = vehicleInput; + _simulateResultingVif = runSimulation; } public IVehicleDeclarationInputData VehicleInputData => _vehicleInput; public IMultistepBusInputDataProvider MultistageJobInputData => _multistageJobInputData; + private readonly bool _simulateResultingVif; + bool IMultistageVIFInputData.SimulateResultingVIF => _simulateResultingVif; + public DataSource DataSource { get; } } diff --git a/VectoCore/VectoCore/JsonKeys.Designer.cs b/VectoCore/VectoCore/JsonKeys.Designer.cs index 62ae58c6222f7ef7d2a7e7e7c5efb4582399f3af..2920ff7eedba8af3a186a9ee81881785f014a8c5 100644 --- a/VectoCore/VectoCore/JsonKeys.Designer.cs +++ b/VectoCore/VectoCore/JsonKeys.Designer.cs @@ -69,6 +69,15 @@ namespace TUGraz.VectoCore { } } + /// <summary> + /// Looks up a localized string similar to RunSimulation. + /// </summary> + internal static string BUS_RunSimulation { + get { + return ResourceManager.GetString("BUS_RunSimulation", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Completed. /// </summary> diff --git a/VectoCore/VectoCore/JsonKeys.resx b/VectoCore/VectoCore/JsonKeys.resx index 04560f85bea6e606998446aeebf62bd79aff605c..ea3d993adcf2ed1492bb780021e799e173ef55e6 100644 --- a/VectoCore/VectoCore/JsonKeys.resx +++ b/VectoCore/VectoCore/JsonKeys.resx @@ -483,4 +483,7 @@ <data name="JsonHeader_Date" xml:space="preserve"> <value>Date</value> </data> +<data name="BUS_RunSimulation" xml:space="preserve"> + <value>RunSimulation</value> +</data> </root> \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/IFollowUpSimulatorFactoryCreator.cs b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/IFollowUpSimulatorFactoryCreator.cs index 0187e3d88f5cba46819d752fa86be834d94581d1..8389d72c48b82112bee2b7cafa42eccbe44f6c3f 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/IFollowUpSimulatorFactoryCreator.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/IFollowUpSimulatorFactoryCreator.cs @@ -86,7 +86,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory Debug.Assert(primaryInputData != null); var stageInputData = _originalStageInputData.StageInputData; - var nextStageInput = new XMLDeclarationVIFInputData(primaryInputData, stageInputData); + var nextStageInput = new XMLDeclarationVIFInputData(primaryInputData, stageInputData, _originalStageInputData.SimulateResultingVIF); var manStagesCount = nextStageInput.MultistageJobInputData.JobInputData.ManufacturingStages?.Count ?? -1; @@ -132,9 +132,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory } public override ISimulatorFactory GetNextFactory() { + if (!_originalInputData.SimulateResultingVIF) { + return null; + } var output = _xmlInputDataReader.CreateDeclaration( XmlReader.Create(CurrentStageOutputDataWriter.MultistageXmlReport.ToString().ToStream())) as IMultistepBusInputDataProvider; - var nextStageInput = new XMLDeclarationVIFInputData(output, null); + var nextStageInput = new XMLDeclarationVIFInputData(output, null, true); return _simulatorFactoryFactory.Factory(ExecutionMode.Declaration, nextStageInput, CurrentStageOutputDataWriter, null, null, _validate); diff --git a/VectoMockup/VectoMockupTest/MockUpVectoTest.cs b/VectoMockup/VectoMockupTest/MockUpVectoTest.cs index 08d4feac5ee0ef2db3ba182d3bcd5a73a0e75b3d..6f4893ba6d7e5bf8bf8442ffda8c391072056300 100644 --- a/VectoMockup/VectoMockupTest/MockUpVectoTest.cs +++ b/VectoMockup/VectoMockupTest/MockUpVectoTest.cs @@ -684,7 +684,8 @@ namespace VectoMockupTest }; var body = new Dictionary<string, object>() { { "PrimaryVehicleResults", Path.GetRelativePath(subDirectory, Path.GetFullPath(vif)) }, - { "CompletedVehicle", Path.GetRelativePath(subDirectory, Path.GetFullPath(completeBusInput)) } + { "CompletedVehicle", Path.GetRelativePath(subDirectory, Path.GetFullPath(completeBusInput)) }, + { "RunSimulation", true} }; var json = new Dictionary<string, object>() { {"Header", header},