aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2021-04-07 10:56:23 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2021-04-07 10:56:23 +0300
commit02fe464c0fc173404771e0e61c5ac0db2a1813d3 (patch)
tree644a088e83e0c5ecad5278c755db89d1e65bede7
parent302f706666622cade696eeb024763821536660c4 (diff)
downloadTango-02fe464c0fc173404771e0e61c5ac0db2a1813d3.tar.gz
Tango-02fe464c0fc173404771e0e61c5ac0db2a1813d3.zip
Several bug fixes.
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogView.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs38
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml4
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs8
-rw-r--r--Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs11
-rw-r--r--Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj6
-rw-r--r--Software/Visual_Studio/Tango.WebRTC/WebRtcClient.cs7
9 files changed, 50 insertions, 34 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogView.xaml
index 55c11ce8a..be82a8748 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogView.xaml
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogView.xaml
@@ -38,12 +38,12 @@
<materialDesign:PackIcon Opacity="0.5" Kind="LightningBolt" Width="24" Height="24" Foreground="{StaticResource FSE_EmulatorBrush}" />
<StackPanel Margin="10 0 0 0">
<TextBlock>
- <Run FontWeight="SemiBold">#</Run><Run FontWeight="SemiBold" Text="{Binding Code}"></Run>
+ <Run FontWeight="SemiBold">#</Run><Run FontWeight="SemiBold" Text="{Binding Code,Mode=OneWay}"></Run>
<Run></Run>
<Run></Run>
- <Run Text="{Binding Name}"></Run>
+ <Run Text="{Binding Name,Mode=OneWay}"></Run>
<LineBreak/>
- <Run Text="{Binding Converter={StaticResource EventTypeTitleConverter}}" FontSize="{StaticResource FSE_SmallerFontSize}" Foreground="{StaticResource FSE_GrayBrush}"></Run>
+ <Run Text="{Binding Converter={StaticResource EventTypeTitleConverter},Mode=OneWay}" FontSize="{StaticResource FSE_SmallerFontSize}" Foreground="{StaticResource FSE_GrayBrush}"></Run>
</TextBlock>
</StackPanel>
</DockPanel>
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 96d8582a7..35e27c834 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
@@ -2234,23 +2234,37 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
if (_notification.ShowQuestion("Are you sure you want to delete the selected jobs?"))
{
- var jobsToReport = SelectedJobs.Select(x => JobDTO.FromObservable(x)).ToList();
-
- LogManager.Log(String.Format("Removing {0} jobs...", SelectedJobs.Count));
- SelectedJobs.ToList().ForEach(x =>
+ try
{
- x.Delete(_machineDbContext);
- });
+ IsFree = false;
+
+ var jobsToReport = SelectedJobs.Select(x => JobDTO.FromObservable(x)).ToList();
- using (_notification.PushTaskItem("Removing selected jobs..."))
+ LogManager.Log(String.Format("Removing {0} jobs...", SelectedJobs.Count));
+ SelectedJobs.ToList().ForEach(x =>
+ {
+ x.Delete(_machineDbContext);
+ });
+
+ using (_notification.PushTaskItem("Removing selected jobs..."))
+ {
+ LogManager.Log("Saving selected machine to database...");
+ await SelectedMachine.SaveAsync(_machineDbContext);
+ }
+
+ foreach (var job in jobsToReport)
+ {
+ _actionLogManager.InsertLog(ActionLogType.JobDeleted, AuthenticationProvider.CurrentUser, job.Name, job, "Job deleted using Machine Studio.", true);
+ }
+ }
+ catch (Exception ex)
{
- LogManager.Log("Saving selected machine to database...");
- await SelectedMachine.SaveAsync(_machineDbContext);
+ LogManager.Log(ex, "Error removing the selected job.");
+ _notification.ShowError($"Error removing the selected job.\n{ex.FlattenMessage()}");
}
-
- foreach (var job in jobsToReport)
+ finally
{
- _actionLogManager.InsertLog(ActionLogType.JobDeleted, AuthenticationProvider.CurrentUser, job.Name, job, "Job deleted using Machine Studio.", true);
+ IsFree = true;
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
index a3d2dbd68..ce632539e 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
@@ -28,7 +28,7 @@
<converters:BooleanInverseConverter x:Key="BooleanInverseConverter" />
</UserControl.Resources>
- <Grid>
+ <Grid IsEnabled="{Binding IsFree}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="600"/>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml
index a2fce41d1..099637601 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml
@@ -25,7 +25,7 @@
<Grid Margin="20">
<DockPanel>
- <Grid DockPanel.Dock="Top">
+ <Grid DockPanel.Dock="Top" Panel.ZIndex="200">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Command="{Binding BackToRmlsCommand}">
<materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="{StaticResource DarkGrayBrush200}" ToolTip="Back to RML list" />
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml
index 128a93548..586325515 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml
@@ -30,7 +30,8 @@
<TextBlock Margin="0 30 100 0" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="{StaticResource TangoTitleFontSize}">Please select the desired color catalog and press 'create'.</TextBlock>
</StackPanel>
- <touch:TouchStaticListBox Margin="20" VerticalAlignment="Center" HorizontalAlignment="Center" Width="480" ItemsSource="{Binding Catalogs}" SelectedItem="{Binding SelectedCatalog,Mode=TwoWay}">
+ <touch:LightTouchScrollViewer Margin="0 20 0 0">
+ <touch:TouchStaticListBox Margin="20 0 20 20" HorizontalAlignment="Center" Width="480" ItemsSource="{Binding Catalogs}" SelectedItem="{Binding SelectedCatalog,Mode=TwoWay}">
<touch:TouchStaticListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
@@ -61,6 +62,7 @@
</DataTemplate>
</touch:TouchStaticListBox.ItemTemplate>
</touch:TouchStaticListBox>
+ </touch:LightTouchScrollViewer>
</DockPanel>
</Grid>
</UserControl>
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 965747856..8d5bd284d 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
@@ -168,14 +168,6 @@ namespace Tango.PPC.Jobs.ViewModels
/// <param name="e">The <see cref="PrintingEventArgs"/> instance containing the event data.</param>
private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e)
{
- if (_handler != null)
- {
- _handler.StatusChanged -= JobHandler_StatusChanged;
- _handler.SpoolChangeRequired -= JobHandler_SpoolChangeRequired;
- _handler.Stopped -= JobHandler_Stopped;
- _handler.CanCancelChanged -= JobHandler_CanCancelChanged;
- }
-
_handler = e.JobHandler;
Job = e.Job;
e.JobHandler.StatusChanged += JobHandler_StatusChanged;
diff --git a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs
index 320891c61..6f9f8a354 100644
--- a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs
+++ b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs
@@ -13,7 +13,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Threading;
using Tango.Core;
using Tango.Core.EventArguments;
-
+using Tango.Logging;
namespace Tango.DragAndDrop
{
@@ -554,7 +554,14 @@ namespace Tango.DragAndDrop
else
{
DragEnded?.Invoke(_currentDragedElement, _currentDragedElement);
- DropDraggable();
+ try
+ {
+ DropDraggable();
+ }
+ catch (Exception ex)
+ {
+ LogManager.Default.Log(ex, "Error on drop draggable.");
+ }
}
}
diff --git a/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj b/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj
index 074b494c7..e60f07d4d 100644
--- a/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj
+++ b/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj
@@ -104,11 +104,15 @@
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\Tango.Logging\Tango.Logging.csproj">
+ <Project>{BC932DBD-7CDB-488C-99E4-F02CF441F55E}</Project>
+ <Name>Tango.Logging</Name>
+ </ProjectReference>
</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>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/Software/Visual_Studio/Tango.WebRTC/WebRtcClient.cs b/Software/Visual_Studio/Tango.WebRTC/WebRtcClient.cs
index cb4cf174a..19f82b063 100644
--- a/Software/Visual_Studio/Tango.WebRTC/WebRtcClient.cs
+++ b/Software/Visual_Studio/Tango.WebRTC/WebRtcClient.cs
@@ -181,6 +181,7 @@ namespace Tango.WebRTC
if (!_conductor.InitializePeerConnection())
{
completion.SetException(new ApplicationException("Error initializing peer connection."));
+ return;
}
_conductor.CreateDataChannel(DataChannelName);
@@ -201,21 +202,17 @@ namespace Tango.WebRTC
catch (Exception ex)
{
completion.SetException(ex);
+ return;
}
IsInitialized = true;
completion.SetResult(true);
- //Stopwatch watch = new Stopwatch();
- //watch.Start();
-
while (!_isDisposed)
{
- //watch.Restart();
_conductor.ProcessMessages(1000);
Thread.Sleep(10);
- //Thread.Sleep(Math.Max(10, (int)watch.ElapsedMilliseconds));
}
IsInitialized = false;