aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-04-24 14:01:40 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-04-24 14:01:40 +0300
commitafca405892ace809c498c010a2d4484bec5adf11 (patch)
treee3a1640a7ff89ecc0d246287a4281efe616f5715
parent636ad730569dfef1a4ee04c8d716d510bcc47ee1 (diff)
downloadTango-afca405892ace809c498c010a2d4484bec5adf11.tar.gz
Tango-afca405892ace809c498c010a2d4484bec5adf11.zip
Implemented USB adapter finalizer.
Added exception logging for USB adapter disconnection error. Added Volume color space icon to PPC. Implemented KeepAlive suppression on StorageAPI. Suppressed KeepAlive when uploading job. Implemented keep alive skipping when arrived responses queue is busy.
-rw-r--r--Software/DB/PPC/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/PPC/Tango_log.ldfbin53673984 -> 53673984 bytes
-rw-r--r--Software/DB/TCC/TCC.mdfbin8388608 -> 8388608 bytes
-rw-r--r--Software/DB/TCC/TCC_log.ldfbin8388608 -> 8388608 bytes
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin22675456 -> 22675456 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs22
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToImageConverter.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/volume.pngbin0 -> 1857 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj5
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml17
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs9
-rw-r--r--Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs2
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs3
-rw-r--r--Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs81
-rw-r--r--Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs28
-rw-r--r--Software/Visual_Studio/Tango.Transport/TransporterBase.cs9
21 files changed, 169 insertions, 18 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf
index b41adb74f..bf9a9caf8 100644
--- a/Software/DB/PPC/Tango.mdf
+++ b/Software/DB/PPC/Tango.mdf
Binary files differ
diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf
index 2c244f90c..ddbaac9a2 100644
--- a/Software/DB/PPC/Tango_log.ldf
+++ b/Software/DB/PPC/Tango_log.ldf
Binary files differ
diff --git a/Software/DB/TCC/TCC.mdf b/Software/DB/TCC/TCC.mdf
index f5902c028..9a07550ca 100644
--- a/Software/DB/TCC/TCC.mdf
+++ b/Software/DB/TCC/TCC.mdf
Binary files differ
diff --git a/Software/DB/TCC/TCC_log.ldf b/Software/DB/TCC/TCC_log.ldf
index c47eeefb7..6463bbdf7 100644
--- a/Software/DB/TCC/TCC_log.ldf
+++ b/Software/DB/TCC/TCC_log.ldf
Binary files differ
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index 548dda3df..8a4044ddb 100644
--- a/Software/DB/Tango.mdf
+++ b/Software/DB/Tango.mdf
Binary files differ
diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf
index 550ccbeae..842b98d81 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index 4d8ec954e..e03c64a54 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -1307,6 +1307,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// </summary>
private async void StartJob(Func<Job, JobHandler> resumeFunc = null)
{
+ SettingsManager.Default.Save();
+
LogManager.Log(String.Format("Starting job {0}...", ActiveJob.Name));
if (MachineOperator == null || MachineOperator.State != TransportComponentState.Connected)
{
@@ -1766,6 +1768,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
InvalidateRelayCommands();
_disable_gamut_check = false;
+
+ _settings.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null;
+ _settings.LastSelectedJobGuid = SelectedMachineJob != null ? SelectedMachineJob.Guid : null;
+
+ _settings.Save();
});
SegmentsCollectionView = CollectionViewSource.GetDefaultView(ActiveJob.Segments);
@@ -2003,6 +2010,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
SelectedSegments.ToList().ForEach(x =>
{
+ if (ActiveJob.Segments.Count == 1)
+ {
+ _notification.ShowInfo("A job must contain at least one segment.");
+ return;
+ }
ActiveJob.Segments.Remove(x);
x.DefferedDelete(_activeJobDbContext);
});
@@ -2130,12 +2142,17 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
if (SelectedBrushStop != null && SelectedSegment != null)
{
- if (_notification.ShowQuestion("Are you sure you want to delete the selected colors?"))
+ if (_notification.ShowQuestion("Are you sure you want to delete the selected brush stops?"))
{
LogManager.Log(String.Format("Removing {0} brush stops...", SelectedBrushStops.Count));
SelectedBrushStops.ToList().ForEach(x =>
{
+ if (SelectedSegment.BrushStops.Count == 1)
+ {
+ _notification.ShowInfo("A job segment must contain at least one brush stop.");
+ return;
+ }
SelectedSegment.BrushStops.Remove(x);
x.DefferedDelete(_activeJobDbContext);
});
@@ -2422,8 +2439,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
public override void OnShuttingDown()
{
- _settings.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null;
- _settings.LastSelectedJobGuid = SelectedMachineJob != null ? SelectedMachineJob.Guid : null;
+
}
#endregion
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
index eff1f2521..e50641d8d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
@@ -4,5 +4,5 @@ using System.Runtime.InteropServices;
[assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyTitle("Tango - Machine Studio")]
-[assembly: AssemblyVersion("4.0.11.0")]
+[assembly: AssemblyVersion("4.0.12.0")]
[assembly: ComVisible(false)] \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToImageConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToImageConverter.cs
index a74a87d28..c2790ee6d 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToImageConverter.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToImageConverter.cs
@@ -26,6 +26,8 @@ namespace Tango.PPC.Jobs.Converters
return ResourceHelper.GetImageFromResources("Images/NewJob/lab.png");
case ColorSpaces.Twine:
return ResourceHelper.GetImageFromResources("Images/NewJob/twine.png");
+ case ColorSpaces.Volume:
+ return ResourceHelper.GetImageFromResources("Images/NewJob/volume.png");
default:
return ResourceHelper.GetImageFromResources("Images/NewJob/coats.png");
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/volume.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/volume.png
new file mode 100644
index 000000000..434e704ca
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/volume.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj
index 5b7e97c93..6e61e9330 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj
@@ -406,10 +406,13 @@
<ItemGroup>
<Resource Include="Images\jobs.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\NewJob\volume.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.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
index 75c4e9578..0f8434663 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
@@ -531,6 +531,23 @@
</UniformGrid>
</StackPanel>
+ <StackPanel>
+ <StackPanel.Style>
+ <Style TargetType="StackPanel" BasedOn="{StaticResource Level2Container}">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </StackPanel.Style>
+ <DockPanel Margin="0 0 10 0">
+ <TextBlock Text="Repetitions:" VerticalAlignment="Bottom"></TextBlock>
+ <touch:TouchNumericTextBox Width="200" HorizontalAlignment="Left" Margin="20 0 0 0" Value="{Binding Job.NumberOfUnits}" Minimum="1" Maximum="10000" JoggingFactor="0.01" />
+ </DockPanel>
+ </StackPanel>
+
<!--<DockPanel Style="{StaticResource Level2Container}">
<TextBlock Text="Color Catalog/Space:" VerticalAlignment="Center"></TextBlock>
<touch:TouchComboBox Margin="20 0 0 0" ItemsSource="{Binding ColorSpaces}" SelectedItem="{Binding Job.ColorSpace}" DisplayMemberPath="Name" Title="Select Color Catalog/Space" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml
index 8a90b03a0..7e5ca7507 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml
@@ -18,8 +18,8 @@
<touch:TouchButton Command="{Binding OKCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">OK</touch:TouchButton>
</StackPanel>
<DockPanel>
- <touch:TouchIcon Foreground="{StaticResource TangoErrorBrush}" Icon="Lock" VerticalAlignment="Top" Height="70"></touch:TouchIcon>
- <StackPanel Margin="10 0 0 0">
+ <touch:TouchIcon Foreground="{StaticResource TangoErrorBrush}" Icon="Lock" VerticalAlignment="Top" Height="65"></touch:TouchIcon>
+ <StackPanel Margin="20 0 0 0">
<TextBlock FontSize="{StaticResource TangoHeaderFontSize}">Screen Locked</TextBlock>
<TextBlock Margin="0 10 0 0" TextWrapping="Wrap">Please enter the password to unlock the screen.</TextBlock>
<touch:TouchTextBox x:Name="txtPassword" Margin="0 30 40 0" IsPassword="True" KeyboardAction="Go" Text="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
index 1550e97e1..ef2b8aeee 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -367,6 +367,7 @@ namespace Tango.PPC.UI.PPCApplication
if (_screenLockTimer != null)
{
_screenLockTimer.Dispose();
+ _screenLockTimer = null;
}
if (settings.EnableLockScreen)
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
index a0db99ffb..1f4f36e0b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
@@ -8,4 +8,4 @@ using System.Windows;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tango PPC Application")]
-[assembly: AssemblyVersion("1.0.9.0")]
+[assembly: AssemblyVersion("1.0.10.0")]
diff --git a/Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs b/Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs
index f16e7739c..eda115047 100644
--- a/Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs
+++ b/Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs
@@ -33,9 +33,12 @@ namespace Tango.Core.Threading
/// <param name="action">The action.</param>
public void ResetReplace(Action action)
{
- _timer.Stop();
- _action = action;
- _timer.Start();
+ if (_timer != null)
+ {
+ _timer.Stop();
+ _action = action;
+ _timer.Start();
+ }
}
private void _timer_Elapsed(object sender, ElapsedEventArgs e)
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs
index 2f63ca3b3..b84942643 100644
--- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs
+++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Diagnostics;
using System.Globalization;
using System.IO.Ports;
using System.Linq;
@@ -130,6 +131,7 @@ namespace Tango.Integration.ExternalBridge
/// <summary>
/// TCP discovery thread method.
/// </summary>
+ [DebuggerStepThrough]
private void TcpDiscoveryThreadMethod()
{
while (IsStarted)
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index 4f7c4c619..ea3e6b8a0 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -1457,6 +1457,9 @@ namespace Tango.Integration.Operation
var storage = CreateStorageManager();
+ //Suppress keep alive while job uploads.
+ storage.SuppressKeepAliveWhileFileUploads = true;
+
var storageInfo = await storage.GetStorageDrive();
var root_folder = await storage.GetRootFolder();
diff --git a/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs b/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs
index 6f04cd0f3..623e331d0 100644
--- a/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs
+++ b/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs
@@ -32,6 +32,9 @@ namespace Tango.Integration.Storage
}
private StorageFolder _currentFolder;
+ /// <summary>
+ /// Gets or sets the current folder.
+ /// </summary>
public StorageFolder CurrentFolder
{
get { return _currentFolder; }
@@ -39,12 +42,20 @@ namespace Tango.Integration.Storage
}
private StorageDrive _storageDrive;
+ /// <summary>
+ /// Gets or sets the storage drive.
+ /// </summary>
public StorageDrive StorageDrive
{
get { return _storageDrive; }
set { _storageDrive = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Gets or sets a value indicating whether to disable the transporter keep alive mechanism while a file is being uploaded.
+ /// </summary>
+ public bool SuppressKeepAliveWhileFileUploads { get; set; }
+
#endregion
#region Constructor
@@ -107,6 +118,12 @@ namespace Tango.Integration.Storage
#endregion
+ #region Public Methods
+
+ /// <summary>
+ /// Gets the storage drive information.
+ /// </summary>
+ /// <returns></returns>
public async Task<StorageDrive> GetStorageDrive()
{
EnsureTransporter();
@@ -134,6 +151,10 @@ namespace Tango.Integration.Storage
return StorageDrive;
}
+ /// <summary>
+ /// Gets the root folder of the current storage driver.
+ /// </summary>
+ /// <returns></returns>
public Task<StorageFolder> GetRootFolder()
{
return GetFolder(new StorageFolder()
@@ -142,11 +163,21 @@ namespace Tango.Integration.Storage
});
}
+ /// <summary>
+ /// Gets the specified folder information.
+ /// </summary>
+ /// <param name="folder">The folder.</param>
+ /// <returns></returns>
public Task<StorageFolder> GetFolder(StorageFolder folder)
{
return GetFolder(folder.Path);
}
+ /// <summary>
+ /// Gets the specified path folder information.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns></returns>
public async Task<StorageFolder> GetFolder(String path)
{
EnsureTransporter();
@@ -201,6 +232,13 @@ namespace Tango.Integration.Storage
return sf;
}
+ /// <summary>
+ /// Uploads the specified file stream to the specified destination path.
+ /// Returns a file handler for keeping track on the upload progress.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="stream">The stream.</param>
+ /// <returns></returns>
public async Task<StorageFileHandler> UploadFile(String path, Stream stream)
{
FileUploadRequest request = new FileUploadRequest();
@@ -226,8 +264,15 @@ namespace Tango.Integration.Storage
ThreadFactory.StartNew(() =>
{
+ bool oldKeepAlive = _transporter.UseKeepAlive;
+
try
{
+ if (SuppressKeepAliveWhileFileUploads)
+ {
+ _transporter.UseKeepAlive = false;
+ }
+
while (stream.Position < stream.Length)
{
if (!canceled)
@@ -267,23 +312,36 @@ namespace Tango.Integration.Storage
{
handler.RaiseFailed(ex);
}
+ finally
+ {
+ if (SuppressKeepAliveWhileFileUploads)
+ {
+ _transporter.UseKeepAlive = oldKeepAlive;
+ }
+ }
});
return handler;
}
+ /// <summary>
+ /// Uploads the specified file stream to the specified destination path.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="stream">The stream.</param>
+ /// <returns></returns>
public async Task UploadFileSync(String path, Stream stream)
{
TaskCompletionSource<object> source = new TaskCompletionSource<object>();
var handler = await UploadFile(path, stream);
- handler.Completed += (_, __) =>
+ handler.Completed += (_, __) =>
{
source.SetResult(true);
};
- handler.Failed += (_, ex) =>
+ handler.Failed += (_, ex) =>
{
source.SetException(ex);
};
@@ -291,6 +349,13 @@ namespace Tango.Integration.Storage
await source.Task;
}
+ /// <summary>
+ /// Downloads the specified storage file to the specified stream.
+ /// Returns a file handler for keeping track on the download progress.
+ /// </summary>
+ /// <param name="file">The file.</param>
+ /// <param name="stream">The stream.</param>
+ /// <returns></returns>
public async Task<StorageFileHandler> DownloadFile(StorageFile file, Stream stream)
{
FileDownloadRequest request = new FileDownloadRequest();
@@ -359,6 +424,11 @@ namespace Tango.Integration.Storage
return handler;
}
+ /// <summary>
+ /// Deletes the specified storage item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <returns></returns>
public async Task DeleteItem(StorageItem item)
{
await _transporter.SendRequest<DeleteRequest, DeleteResponse>(new DeleteRequest()
@@ -368,6 +438,11 @@ namespace Tango.Integration.Storage
});
}
+ /// <summary>
+ /// Creates a new folder on the specified destination path.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns></returns>
public async Task CreateFolder(String path)
{
await _transporter.SendRequest<CreateRequest, CreateResponse>(new CreateRequest()
@@ -376,5 +451,7 @@ namespace Tango.Integration.Storage
Attribute = FileAttribute.Directory,
});
}
+
+ #endregion
}
}
diff --git a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs
index f00347c8d..1c21723c8 100644
--- a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs
+++ b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs
@@ -153,7 +153,10 @@ namespace Tango.Transport.Adapters
State = TransportComponentState.Disconnected;
LogManager.Log("USB adapter disconnected.");
}
- catch { }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Could not close serial port on " + Address + ".");
+ }
}
catch (Exception ex)
@@ -167,7 +170,7 @@ namespace Tango.Transport.Adapters
}
});
- TimeoutTask.StartNew(() =>
+ TimeoutTask.StartNew(() =>
{
if (!source.Task.IsCompleted)
@@ -202,7 +205,7 @@ namespace Tango.Transport.Adapters
}
catch (Exception ex)
{
- OnFailed(LogManager.Log(ex));
+ OnFailed(LogManager.Log(ex, "Error writing to the serial port."));
}
}
@@ -244,7 +247,24 @@ namespace Tango.Transport.Adapters
}
catch (Exception ex)
{
- LogManager.Log(ex, "Error occurred while trying to read from serial port.");
+ LogManager.Log(ex, "Error occurred while trying to read from the serial port.");
+ }
+ }
+
+ /// <summary>
+ /// Finalizes an instance of the <see cref="UsbTransportAdapter"/> class.
+ /// </summary>
+ ~UsbTransportAdapter()
+ {
+ if (_serialPort != null)
+ {
+ try
+ {
+ LogManager.Log("Finalizing USB transport adapter.");
+ _serialPort.Close();
+ _serialPort.Dispose();
+ }
+ catch { }
}
}
}
diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
index c1a13ce26..008c0759a 100644
--- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
+++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
@@ -1093,7 +1093,14 @@ namespace Tango.Transport
if (UseKeepAlive)
{
- var response = SendRequest<KeepAliveRequest, KeepAliveResponse>(new KeepAliveRequest(), TimeSpan.FromSeconds(2)).Result;
+ if (_arrivedResponses.Count == 0)
+ {
+ var response = SendRequest<KeepAliveRequest, KeepAliveResponse>(new KeepAliveRequest(), TimeSpan.FromSeconds(2)).Result;
+ }
+ else
+ {
+ LogManager.Log("Keep alive request was skipped due to busy response queue.", LogCategory.Debug);
+ }
}
}
catch (Exception ex) when (ex is TimeoutException || ex is AggregateException)