aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-05-26 17:03:25 +0300
committerAvi Levkovich <avi@twine-s.com>2020-05-26 17:03:25 +0300
commitfd326204404ee0932ea465efcdd41e21fd7f2b49 (patch)
treeffb38ac74dc86490a8581539cba7094452cb6ed6 /Software/Visual_Studio/PPC/Modules
parentf0fc1abe6628c903d2e58dcd1b1a88ef43d45057 (diff)
parent7102ed21905bc52c6aee506e919992ce1f98f641 (diff)
downloadTango-fd326204404ee0932ea465efcdd41e21fd7f2b49.tar.gz
Tango-fd326204404ee0932ea465efcdd41e21fd7f2b49.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ImportJobView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs17
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs111
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.pngbin2174 -> 4125 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.pngbin1752 -> 3018 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj8
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs16
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml14
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationIntent.cs4
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs41
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml67
11 files changed, 214 insertions, 66 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ImportJobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ImportJobView.xaml
index ac27cc00d..da51bba27 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ImportJobView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ImportJobView.xaml
@@ -18,7 +18,7 @@
<TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">IMPORT JOB</TextBlock>
<TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">A job file has been selected from the storage device. press 'IMPORT' to add the job to your job list.</TextBlock>
- <touch:TouchCheckBox IsChecked="{Binding ImportAndEdit}" Margin="40 50 0 0">Edit this job after import</touch:TouchCheckBox>
+ <touch:TouchCheckBox IsChecked="{Binding ImportAndEdit}" Margin="40 50 0 0" Visibility="Collapsed">Edit this job after import</touch:TouchCheckBox>
</StackPanel>
</DockPanel>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
index 03cd5bfff..b4a30cb39 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
@@ -9,6 +9,7 @@ using Tango.Integration.Operation;
using Tango.PMR.Printing;
using Tango.PPC.Common;
using Tango.PPC.Common.Navigation;
+using Tango.PPC.Common.Notifications;
using Tango.PPC.Jobs.AppBarItems;
using Tango.PPC.Jobs.AppButtons;
using Tango.PPC.Jobs.Dialogs;
@@ -25,6 +26,7 @@ namespace Tango.PPC.Jobs.ViewModels
{
private StopPrintingButton _stop_job_btn;
private JobHandler _handler;
+ private JobProgressAppBarItem _appBarItem;
#region Properties
@@ -142,9 +144,10 @@ namespace Tango.PPC.Jobs.ViewModels
if (MachineProvider.MachineOperator.IsPrinting && _handler != null && !_handler.IsCanceled)
{
- NotificationProvider.PushAppBarItem<JobProgressAppBarItem>().Pressed += (_, __) =>
+ _appBarItem = NotificationProvider.PushAppBarItem<JobProgressAppBarItem>();
+ _appBarItem.Pressed += (_, __) =>
{
- NotificationProvider.CurrentAppBarItem.Close();
+ _appBarItem?.Close();
NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView));
};
}
@@ -159,10 +162,7 @@ namespace Tango.PPC.Jobs.ViewModels
IsDisplayJobOutline = false;
- if (NotificationProvider.HasAppBarItem && NotificationProvider.CurrentAppBarItem is JobProgressAppBarItem)
- {
- NotificationProvider.CurrentAppBarItem.Close();
- }
+ _appBarItem?.Close();
if (_handler != null && !_handler.Status.IsFailed)
{
@@ -232,10 +232,7 @@ namespace Tango.PPC.Jobs.ViewModels
_stop_job_btn.Pop();
}
- if (NotificationProvider.HasAppBarItem && NotificationProvider.CurrentAppBarItem is JobProgressAppBarItem)
- {
- NotificationProvider.CurrentAppBarItem.Close();
- }
+ _appBarItem?.Close();
if (_handler != null)
{
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
index f9029ed8c..c41a9ef5d 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
@@ -38,6 +38,7 @@ using Tango.PPC.Jobs.ViewContracts;
using Tango.Core.ExtensionMethods;
using Tango.PPC.Common.Synchronization;
using Tango.PPC.Jobs.NotificationItems;
+using Tango.PPC.Storage.Models;
namespace Tango.PPC.Jobs.ViewModels
{
@@ -763,37 +764,64 @@ namespace Tango.PPC.Jobs.ViewModels
var selected_job = SelectedJobs.FirstOrDefault();
if (selected_job == null) return;
+ var selectedJobs = SelectedJobs.ToList();
+
ClearSelection();
var result = await NavigationManager.
NavigateForResult<StorageModule,
Storage.Views.MainView, ExplorerFileItem,
- Storage.Models.StorageNavigationRequest>(
- new Storage.Models.StorageNavigationRequest()
+ StorageNavigationRequest>(
+ new StorageNavigationRequest()
{
- Intent = Storage.Models.StorageNavigationIntent.SaveFile,
+ Intent = selectedJobs.Count == 1 ? StorageNavigationIntent.SaveFile : StorageNavigationIntent.SaveFiles,
DefaultFileName = selected_job.Name,
Filter = ExplorerFileDefinition.Job.Extension,
- Title = "Save Job File",
+ Title = selectedJobs.Count == 1 ? "Save Job File" : "Save Job Files",
});
if (result != null)
{
- try
+ if (selectedJobs.Count == 1)
{
- var jobFile = await selected_job.ToJobFile();
+ try
+ {
+ var jobFile = await selected_job.ToJobFile();
- using (FileStream fs = new FileStream(result.Path + ExplorerFileDefinition.Job.Extension, FileMode.Create))
+ using (FileStream fs = new FileStream(result.Path + ExplorerFileDefinition.Job.Extension, FileMode.Create))
+ {
+ jobFile.WriteTo(fs);
+ }
+
+ await NotificationProvider.ShowSuccess("Job saved successfully.");
+ }
+ catch (Exception ex)
{
- jobFile.WriteTo(fs);
+ LogManager.Log(ex, $"Error saving job {selected_job.Name} to file.");
+ await NotificationProvider.ShowError($"An error occurred while trying to save the job.\n{ex.Message}");
}
-
- await NotificationProvider.ShowSuccess("Job saved successfully.");
}
- catch (Exception ex)
+ else
{
- LogManager.Log(ex, $"Error saving job {selected_job.Name} to file.");
- await NotificationProvider.ShowError($"An error occurred while trying to save the job.\n{ex.Message}");
+ foreach (var job in selectedJobs)
+ {
+ try
+ {
+ var jobFile = await job.ToJobFile();
+
+ using (FileStream fs = new FileStream(Path.Combine(result.Path, jobFile.Name) + ExplorerFileDefinition.Job.Extension, FileMode.Create))
+ {
+ jobFile.WriteTo(fs);
+ }
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error saving job {job.Name} to file.");
+ await NotificationProvider.ShowError($"An error occurred while trying to save the job.\n{ex.Message}");
+ }
+ }
+
+ await NotificationProvider.ShowSuccess("Jobs saved successfully.");
}
}
}
@@ -802,7 +830,7 @@ namespace Tango.PPC.Jobs.ViewModels
#region Handle Job File Loading From Storage
- private async void HandleJobFileLoaded(ExplorerFileItem jobFile)
+ private async void HandleJobFileLoaded(List<ExplorerFileItem> jobFiles)
{
var vm = await NotificationProvider.ShowDialog<ImportJobViewVM>();
@@ -810,30 +838,35 @@ namespace Tango.PPC.Jobs.ViewModels
{
using (ObservablesContext jobContext = ObservablesContext.CreateDefault())
{
- try
+ foreach (var jobFile in jobFiles)
{
- JobFile jFile = JobFile.Parser.ParseFrom(File.ReadAllBytes(jobFile.Path));
- var job = await Job.FromJobFile(jFile, MachineProvider.Machine.Guid, AuthenticationProvider.CurrentUser.Guid);
- job.JobSource = JobSource.Local;
- jobContext.Jobs.Add(job);
- await jobContext.SaveChangesAsync();
- LoadJobs(() =>
+ try
{
- if (vm.ImportAndEdit)
- {
- var postJob = Jobs.SingleOrDefault(x => x.Guid == job.Guid);
- if (postJob != null)
- {
- SelectJob(postJob, true);
- }
- }
- });
+ JobFile jFile = JobFile.Parser.ParseFrom(File.ReadAllBytes(jobFile.Path));
+ var job = await Job.FromJobFile(jFile, MachineProvider.Machine.Guid, AuthenticationProvider.CurrentUser.Guid);
+ job.JobSource = JobSource.Local;
+ jobContext.Jobs.Add(job);
+ await jobContext.SaveChangesAsync();
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error occurred while trying to import job from file {jobFile.Path}.");
+ await NotificationProvider.ShowError($"An error occurred while trying to import the selected job file.\n{ex.Message}");
+ }
}
- catch (Exception ex)
+
+ LoadJobs(() =>
{
- LogManager.Log(ex, $"Error occurred while trying to import job from file {jobFile.Path}.");
- await NotificationProvider.ShowError($"An error occurred while trying to import the selected job file.\n{ex.Message}");
- }
+ //Editing of a job is currently deprecated due to enabling multiple job imports.
+ //if (vm.ImportAndEdit)
+ //{
+ // var postJob = Jobs.SingleOrDefault(x => x.Guid == job.Guid);
+ // if (postJob != null)
+ // {
+ // SelectJob(postJob, true);
+ // }
+ //}
+ });
}
}
}
@@ -842,8 +875,10 @@ namespace Tango.PPC.Jobs.ViewModels
#region Handle TCC File Loading From Storage
- private async void HandleColorProfileFileLoaded(ExplorerFileItem tccFile)
+ private async void HandleColorProfileFileLoaded(List<ExplorerFileItem> tccFiles)
{
+ var tccFile = tccFiles.FirstOrDefault();
+
try
{
DetectionColorFile tcc = DetectionColorFile.Parser.ParseFrom(File.ReadAllBytes(tccFile.Path));
@@ -872,8 +907,10 @@ namespace Tango.PPC.Jobs.ViewModels
#region Handle Pulse TWN Loading From Storage
- private async void HandlePulseFileLoaded(ExplorerFileItem twnFile)
+ private async void HandlePulseFileLoaded(List<ExplorerFileItem> twnFiles)
{
+ var twnFile = twnFiles.FirstOrDefault();
+
TwnFile twn = TwnFile.FromFile(twnFile.Path);
BitmapSource preview = twn.Thumbnail.ToBitmapSource();
@@ -907,7 +944,7 @@ namespace Tango.PPC.Jobs.ViewModels
NotificationProvider.ShowSuccess("Your job list is now synchronized.");
});
};
- item.Closed += (_, __) =>
+ item.Closed += (_, __) =>
{
_isJobsSynchronizationNotificationActive = false;
};
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png
index d65b8f793..17c3225ed 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png
index c42abf56e..b4ed45d1e 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj
index 94dcf8247..7e5c52725 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj
@@ -281,17 +281,19 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Images\cl-full.png" />
- <Resource Include="Images\cone-empty.png" />
- <Resource Include="Images\cone-full.png" />
<Resource Include="Images\l-full.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\head_cleaning.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\cone-empty.png" />
+ <Resource Include="Images\cone-full.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs
index 4bd63e9a6..f613d6f43 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs
@@ -56,6 +56,21 @@ namespace Tango.PPC.Maintenance.ViewModels
set { _totalDyeMeters = value; RaisePropertyChangedAuto(); }
}
+ private SpoolState _spoolState;
+ public SpoolState SpoolState
+ {
+ get { return _spoolState; }
+ set
+ {
+ if (_spoolState != value)
+ {
+ _spoolState = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+
public RelayCommand ExportLogsCommand { get; set; }
public OpenCloseDyeingHeadCommand OpenCloseDyeingHeadCommand { get; set; }
@@ -105,6 +120,7 @@ namespace Tango.PPC.Maintenance.ViewModels
{
UpdateMidTankLevels(status);
OverallTemperature.Temperature = status.OverallTemperature;
+ SpoolState = status.SpoolState;
InvalidateRelayCommands();
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml
index f49bdebe4..acbda9daa 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml
@@ -155,10 +155,22 @@
</ItemsControl>
</Grid>
- <!--<Image Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Source="../Images/cone-full.png" Margin="30"></Image>-->
+ <Image Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15" RenderOptions.BitmapScalingMode="Fant">
+ <Image.Style>
+ <Style TargetType="Image">
+ <Setter Property="Source" Value="../Images/cone-empty.png"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding SpoolState}" Value="Present">
+ <Setter Property="Source" Value="../Images/cone-full.png"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Image.Style>
+ </Image>
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Temperature</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Inks</TextBlock>
+ <TextBlock Grid.Column="2" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Cone</TextBlock>
</Grid>
</StackPanel>
</StackPanel>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationIntent.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationIntent.cs
index 2c2a7f10d..3ec14cc6f 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationIntent.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationIntent.cs
@@ -9,6 +9,8 @@ namespace Tango.PPC.Storage.Models
public enum StorageNavigationIntent
{
LoadFile,
- SaveFile
+ LoadFiles,
+ SaveFile,
+ SaveFiles
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs
index 8c166379e..b9d59334c 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -70,16 +71,21 @@ namespace Tango.PPC.Storage.ViewModels
set { _displayItems = value; RaisePropertyChangedAuto(); }
}
-
public RelayCommand<ExplorerFileItem> FileSelectedCommand { get; set; }
+ public ObservableCollection<ExplorerFileItem> SelectedItems { get; set; }
+
public RelayCommand SaveCommand { get; set; }
+ public RelayCommand OpenCommand { get; set; }
+
public MainViewVM()
{
+ SelectedItems = new ObservableCollection<ExplorerFileItem>();
FileSelectedCommand = new RelayCommand<ExplorerFileItem>(OnFileSelected);
- SaveCommand = new RelayCommand(OnSaveCommand, (x) => !String.IsNullOrWhiteSpace(FileName));
- Request = new StorageNavigationRequest();
+ SaveCommand = new RelayCommand(OnSaveCommand, (x) => !String.IsNullOrWhiteSpace(FileName) || Request.Intent == StorageNavigationIntent.SaveFiles);
+ Request = new StorageNavigationRequest() { Intent = StorageNavigationIntent.LoadFiles };
+ OpenCommand = new RelayCommand(OnOpenCommand, () => Request.Intent == StorageNavigationIntent.LoadFiles);
}
public override void OnApplicationStarted()
@@ -128,7 +134,7 @@ namespace Tango.PPC.Storage.ViewModels
base.OnNavigatedFrom();
DisplayItems = false;
Request = null;
- Request = new StorageNavigationRequest();
+ Request = new StorageNavigationRequest() { Intent = StorageNavigationIntent.LoadFiles };
}
/// <summary>
@@ -184,7 +190,14 @@ namespace Tango.PPC.Storage.ViewModels
_selectedItem = fileItem;
_allow_exit = true;
await NavigationManager.NavigateBack();
- StorageProvider.SubmitFileSelection(fileItem);
+ StorageProvider.SubmitFileSelection(new List<ExplorerFileItem>() { fileItem });
+ }
+
+ private async void OnOpenCommand()
+ {
+ _allow_exit = true;
+ await NavigationManager.NavigateBack();
+ StorageProvider.SubmitFileSelection(SelectedItems.ToList());
}
public ExplorerFileItem GetNavigationResult()
@@ -200,10 +213,22 @@ namespace Tango.PPC.Storage.ViewModels
private void OnSaveCommand()
{
_allow_exit = true;
- _selectedItem = new ExplorerFileItem()
+
+ if (Request.Intent == StorageNavigationIntent.SaveFile)
+ {
+ _selectedItem = new ExplorerFileItem()
+ {
+ Path = CurrentPath + "\\" + FileName,
+ };
+ }
+ else if (Request.Intent == StorageNavigationIntent.SaveFiles)
{
- Path = CurrentPath + "\\" + FileName,
- };
+ _selectedItem = new ExplorerFileItem()
+ {
+ Path = CurrentPath,
+ };
+ }
+
NavigationManager.NavigateBack();
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml
index 25538a525..e8d402d89 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml
@@ -16,7 +16,7 @@
<UserControl.InputBindings>
<KeyBinding Key="Return" Command="{Binding SaveCommand}"></KeyBinding>
</UserControl.InputBindings>
-
+
<Grid>
<Grid Background="{StaticResource TangoMidBackgroundBrush}">
<Grid.RowDefinitions>
@@ -32,8 +32,54 @@
</Border>
<Grid Margin="10" Grid.Row="1">
<DockPanel>
-
- <Grid DockPanel.Dock="Top" Visibility="{Binding Request.Intent,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter=SaveFile}">
+ <Grid DockPanel.Dock="Top">
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding Request.Intent}" Value="LoadFiles" />
+ <Condition Binding="{Binding ElementName=explorer,Path=IsMultiSelecting}" Value="True" />
+ </MultiDataTrigger.Conditions>
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </MultiDataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
+ <Border BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" Padding="20">
+ <StackPanel>
+ <DockPanel Margin="0 0 0 0">
+ <touch:TouchButton Command="{Binding OpenCommand}" Margin="20 0 0 0" Height="55" Width="200" Style="{StaticResource TangoHollowButton}" CornerRadius="25" DockPanel.Dock="Right">
+ <touch:TouchButton.Content>
+ OPEN
+ </touch:TouchButton.Content>
+ </touch:TouchButton>
+ <Grid>
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}">
+ <Run Text="{Binding SelectedItems.Count,Mode=OneWay}"></Run>
+ <Run>files selected</Run>
+ </TextBlock>
+ </Grid>
+ </DockPanel>
+ </StackPanel>
+ </Border>
+ </Grid>
+
+ <Grid DockPanel.Dock="Top">
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Request.Intent}" Value="SaveFile">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Request.Intent}" Value="SaveFiles">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
<Border BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" Padding="20">
<StackPanel>
<TextBlock Text="{Binding Request.Title}" FontSize="{StaticResource TangoHeaderFontSize}"></TextBlock>
@@ -43,20 +89,31 @@
SAVE
</touch:TouchButton.Content>
</touch:TouchButton>
- <touch:TouchTextBox x:Name="txtFileName" KeyboardAction="Go" FocusSelectionMode="SelectAll" VerticalAlignment="Bottom" Text="{Binding FileName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
+ <Grid>
+ <touch:TouchTextBox x:Name="txtFileName" Visibility="{Binding Request.Intent,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter=SaveFile}" KeyboardAction="Go" FocusSelectionMode="SelectAll" VerticalAlignment="Bottom" Text="{Binding FileName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Visibility="{Binding Request.Intent,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter=SaveFiles}">Select destination folder</TextBlock>
+ </Grid>
</DockPanel>
</StackPanel>
</Border>
</Grid>
- <explorer:ExplorerControl x:Name="explorer" CurrentPath="{Binding CurrentPath,Mode=TwoWay}" FileSelectedCommand="{Binding FileSelectedCommand}" Filter="{Binding Request.Filter}" Visibility="{Binding DisplayItems,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <explorer:ExplorerControl x:Name="explorer" CurrentPath="{Binding CurrentPath,Mode=TwoWay}" SelectedItems="{Binding SelectedItems}" FileSelectedCommand="{Binding FileSelectedCommand}" Filter="{Binding Request.Filter}" Visibility="{Binding DisplayItems,Converter={StaticResource BooleanToVisibilityConverter}}">
<explorer:ExplorerControl.Style>
<Style TargetType="explorer:ExplorerControl" BasedOn="{StaticResource {x:Type explorer:ExplorerControl}}">
<Setter Property="EnableFileSelection" Value="True"></Setter>
+ <Setter Property="EnableMultiSelect" Value="False"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Request.Intent}" Value="SaveFile">
<Setter Property="EnableFileSelection" Value="False"></Setter>
</DataTrigger>
+ <DataTrigger Binding="{Binding Request.Intent}" Value="LoadFiles">
+ <Setter Property="EnableFileSelection" Value="True"></Setter>
+ <Setter Property="EnableMultiSelect" Value="True"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Request.Intent}" Value="LoadFile">
+ <Setter Property="EnableFileSelection" Value="False"></Setter>
+ </DataTrigger>
</Style.Triggers>
</Style>
</explorer:ExplorerControl.Style>