aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-02-20 11:39:04 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-02-20 11:39:04 +0200
commit57a828b4d11ab8274053ee035c8de8014ddd4ca1 (patch)
treec88e63b5e9019fe67cc3be451e46fbe57efc4a35 /Software/Visual_Studio/MachineStudio/Modules
parent2d55102532afaccc447c8a28ded8ccb93437683b (diff)
parentd6e2772dd98e6880de14ea12be0ef53bae24f763 (diff)
downloadTango-57a828b4d11ab8274053ee035c8de8014ddd4ca1.tar.gz
Tango-57a828b4d11ab8274053ee035c8de8014ddd4ca1.zip
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs10
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml3
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml15
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs281
18 files changed, 228 insertions, 133 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml
index 977ab865a..0a63e6423 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml
@@ -19,7 +19,7 @@
<Grid DockPanel.Dock="Top">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Command="{Binding BackToDispensersCommand}">
- <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="#202020" ToolTip="Back to RML list" />
+ <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="{StaticResource DarkGrayBrush200}" ToolTip="Back to RML list" />
</Button>
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="34">
<Run>DISPENSER</Run>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml
index 18921e2da..3a7eaa802 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml
@@ -230,10 +230,10 @@
</DockPanel>
</Border>
</Grid>
- <Border Grid.Row="1" Grid.Column="1" Margin="40 0 10 10" IsEnabled="{Binding IsFree}" BorderThickness="1 0 1 1 " BorderBrush="{StaticResource LightGrayBrush100}" >
+ <Border Grid.Row="1" Grid.Column="1" Margin="40 0 10 10" IsEnabled="{Binding IsFree}" BorderThickness="1 0 1 1 " BorderBrush="{StaticResource LightGrayBrush100}" Background="{StaticResource TransparentBackgroundBrush}">
<DockPanel >
- <TextBlock DockPanel.Dock="Top" Height="40" Text="{Binding DifferenceObject.Name, Mode=OneWay}" VerticalAlignment="Center" Padding="5" FontSize="18" HorizontalAlignment="Center"></TextBlock>
- <TreeView x:Name="treeView" ItemsSource="{Binding DifferenceObject.Children, Mode=OneWay}" Background="{StaticResource TransparentBackgroundBrush}" >
+ <TextBlock DockPanel.Dock="Top" Height="40" Text="{Binding DifferenceObject.Name, Mode=OneWay}" VerticalAlignment="Center" Padding="5" FontSize="18" HorizontalAlignment="Center" ></TextBlock>
+ <TreeView x:Name="treeView" ItemsSource="{Binding DifferenceObject.Children, Mode=OneWay}" >
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem" BasedOn="{StaticResource {x:Type TreeViewItem}}">
<Setter Property="Template">
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml
index ded1acb2d..5a49c93d3 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml
@@ -13,7 +13,7 @@
xmlns:global="clr-namespace:Tango.MachineStudio.Catalogs"
xmlns:local="clr-namespace:Tango.MachineStudio.Catalogs.Views"
mc:Ignorable="d"
- d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" Foreground="#232323" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
+ d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" Foreground="{StaticResource DarkGrayBrush200}" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<UserControl.Resources>
<converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
@@ -51,7 +51,7 @@
<Grid DockPanel.Dock="Top">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Command="{Binding BackToCatalogsCommand}">
- <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="#202020" ToolTip="Back to RML list" />
+ <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="{StaticResource DarkGrayBrush200}" ToolTip="Back to RML list" />
</Button>
<TextBlock Text="{Binding ActiveCatalog.Name}" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="34"></TextBlock>
</StackPanel>
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 a641c87b6..efbcaf5ad 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
@@ -1448,8 +1448,6 @@ namespace Tango.MachineStudio.Developer.ViewModels
IsJobRunning = true;
ShowJobStatus = true;
- _eventLogger.Log(String.Format("Job '{0}' started...", ActiveJob.Name));
-
JobHandler.StatusChanged += (x, status) =>
{
if (IsJobRunning)
@@ -1469,25 +1467,21 @@ namespace Tango.MachineStudio.Developer.ViewModels
if (!segment.IsInterSegment)
{
_speech.SpeakInfo(String.Format("Segment {0} Started.", segment.SegmentIndex));
- _eventLogger.Log(String.Format("Segment {0} Started.", segment.SegmentIndex) + Environment.NewLine + segment.ToJsonString());
}
else
{
_speech.SpeakInfo(String.Format("Inter Segment Started."));
- _eventLogger.Log("Inter Segment Started.");
}
};
JobHandler.UnitCompleted += (x, unit) =>
{
_speech.SpeakInfo(String.Format("{0} Units Completed.", unit + 1));
- _eventLogger.Log(String.Format("{0} Units Completed.", unit + 1));
};
JobHandler.Failed += (x, ex) =>
{
LogManager.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name));
- _eventLogger.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name));
SetJobFailed();
InvokeUI(() =>
@@ -1501,13 +1495,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
_speech.SpeakInfo("Finalizing job...");
LogManager.Log(String.Format("Finalizing job {0}.", RunningJob.Name));
- _eventLogger.Log(String.Format("Finalizing job {0}.", RunningJob.Name));
};
JobHandler.Completed += (x, e) =>
{
LogManager.Log(String.Format("Job {0} has completed.", RunningJob.Name));
- _eventLogger.Log(String.Format("Job {0} has completed.", RunningJob.Name));
SetJobCompleted();
StopRecordingIfInProgress();
};
@@ -1521,7 +1513,6 @@ namespace Tango.MachineStudio.Developer.ViewModels
}
LogManager.Log(String.Format("Job {0} has been canceled.", RunningJob.Name));
- _eventLogger.Log(String.Format("Job {0} has been canceled.", RunningJob.Name));
StopRecordingIfInProgress();
//Finally Canceled..
};
@@ -1539,7 +1530,6 @@ namespace Tango.MachineStudio.Developer.ViewModels
catch (Exception ex)
{
LogManager.Log(ex);
- _eventLogger.Log(ex, "An error occurred while starting the job.");
_notification.ShowError("An error occurred while starting the job. " + Environment.NewLine + ex.Message);
SetJobFailed();
StopRecordingIfInProgress();
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
index 47cb41522..bf8eddd91 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
@@ -28,7 +28,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
mc:Ignorable="d"
- d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" x:Name="control">
+ d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}"
+ DataContext="{x:Static global:ViewModelLocator.MainViewVM}" x:Name="control">
<UserControl.Resources>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml
index e79fd0ad2..e87609b88 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml
@@ -10,7 +10,7 @@
xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views"
mc:Ignorable="d"
- Height="500" Width="800" Background="{StaticResource MainWindow.Background}" d:DataContext="{d:DesignInstance Type=vm:LogDetailsViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}">
+ Height="500" Width="800" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:LogDetailsViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}">
<UserControl.Resources>
<converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml
index 9eb099a9e..f720a0237 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml
@@ -22,24 +22,19 @@
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<localConverters:StringToFirstLineConverter x:Key="StringToFirstLineConverter" />
- <LinearGradientBrush x:Key="infoBrush" StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="White"/>
- <GradientStop Color="#FFBFBFBF" Offset="1"/>
- </LinearGradientBrush>
-
<LinearGradientBrush x:Key="warningBrush" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#FFFF8C57"/>
- <GradientStop Color="White" Offset="1"/>
+ <GradientStop Color="{StaticResource whiteColor}" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="errorBrush" StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="{StaticResource RedBrush100}"/>
+ <GradientStop Color="#FFFF5151"/>
<GradientStop Color="#FFD9D9" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="criticalBrush" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="Red"/>
- <GradientStop Color="White" Offset="1"/>
+ <GradientStop Color="{StaticResource whiteColor}" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="hoverBrush" StartPoint="0.5,0" EndPoint="0.5,1">
@@ -69,7 +64,7 @@
</Grid>
<ScrollViewer x:Name="scroll_channels" Grid.Column="0" Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
- <ItemsControl ItemsSource="{Binding TimelineEventGroups}" Margin="0 0 0 0" Background="#FCFCFC" VerticalAlignment="Top">
+ <ItemsControl ItemsSource="{Binding TimelineEventGroups}" Margin="0 0 0 0" Background="{StaticResource MainWindow.Background}" VerticalAlignment="Top">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
@@ -148,7 +143,7 @@
</Border.Style>
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="SemiBold" Text="{Binding EventType.Name}" Height="14" FontSize="11"></TextBlock>
- <TextBlock Margin="10 0 0 0" Text="{Binding Description,Converter={StaticResource StringToFirstLineConverter}}" Height="14" FontSize="11"></TextBlock>
+ <TextBlock Margin="10 0 0 0" Text="{Binding Description,Converter={StaticResource StringToFirstLineConverter}}" Height="14" FontSize="11" Foreground="{StaticResource Dialog.Foreground}"></TextBlock>
</StackPanel>
</Border>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml
index 417dfbc0b..0640b846e 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml
@@ -9,7 +9,7 @@
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views"
mc:Ignorable="d"
- d:DesignHeight="400" d:DesignWidth="700" Height="460" Width="750" Background="{StaticResource WhiteBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:MachineCreationDialogVM, IsDesignTimeCreatable=False}">
+ d:DesignHeight="400" d:DesignWidth="700" Height="460" Width="750" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:MachineCreationDialogVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource Dialog.Foreground}">
<UserControl.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></converters:BooleanToVisibilityConverter>
@@ -72,7 +72,7 @@
<StackPanel Margin="20 10 0 0" Visibility="{Binding IsNewMachine,Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock FontSize="10">Dispenser max nl/cm</TextBlock>
- <mahapps:NumericUpDown Minimum="0" StringFormat="0.00" Maximum="10" InterceptMouseWheel="True" Value="{Binding DispenserFactor,Mode=TwoWay}" HorizontalContentAlignment="Left" Width="95" HorizontalAlignment="Left" BorderThickness="0 0 0 1" Margin="0 2 0 0" HideUpDownButtons="True" HasDecimals="True"></mahapps:NumericUpDown>
+ <mahapps:NumericUpDown Minimum="0" StringFormat="0.00" Maximum="10" InterceptMouseWheel="True" Value="{Binding DispenserFactor,Mode=TwoWay}" HorizontalContentAlignment="Left" Width="95" HorizontalAlignment="Left" BorderThickness="0 0 0 1" Margin="0 2 0 0" HideUpDownButtons="True" HasDecimals="True" Background="Transparent"></mahapps:NumericUpDown>
</StackPanel>
</StackPanel>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml
index 524dd79c5..dae945940 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml
@@ -56,8 +56,8 @@
</i:Interaction.Triggers>
</visuals:AnalogSwitch>
- <Border Background="{StaticResource DarkGrayBrush}" Margin="8" CornerRadius="3" Padding="5" Grid.Column="1">
- <Grid>
+ <Border Background="#1B1B1B" Margin="8" CornerRadius="3" Padding="5" Grid.Column="1">
+ <Grid >
<mahapps:NumericUpDown Style="{x:Null}" InterceptMouseWheel="True" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Right" HideUpDownButtons="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" HasDecimals="True" Minimum="0" Maximum="10000" Padding="0" Value="{Binding HardwareBlower.Voltage,FallbackValue='0.0',Mode=TwoWay}" VerticalAlignment="Center" FontSize="44" FontFamily="{StaticResource digital-7}" Foreground="#FFD400" Margin="0 0 16 0">
<mahapps:NumericUpDown.Resources>
<Style TargetType="TextBox">
@@ -72,7 +72,7 @@
<Button Style="{x:Null}" Grid.Column="2" Margin="8" Cursor="Hand" Command="{Binding SetCommand}">
<Button.Template>
<ControlTemplate TargetType="Button">
- <Grid Background="{StaticResource GrayBrush280}">
+ <Grid Background="#3E3E3E">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Gainsboro" FontSize="16" FontWeight="SemiBold">SET</TextBlock>
</Grid>
<ControlTemplate.Triggers>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml
index 27530ab10..e71f7e1e0 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml
@@ -86,7 +86,7 @@
<RowDefinition Height="70*"/>
<RowDefinition Height="90*"/>
</Grid.RowDefinitions>
- <Border Background="{StaticResource DarkGrayBrush}" Margin="0 3 0 0" CornerRadius="3" Padding="5">
+ <Border Background="#1B1B1B" Margin="0 3 0 0" CornerRadius="3" Padding="5">
<Grid>
<TextBlock Text="{Binding EffectiveValue,StringFormat=0.0,FallbackValue='0.0'}" Foreground="#FF6F78" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="44" FontFamily="{StaticResource digital-7}" Margin="0 0 12 0">
@@ -95,7 +95,7 @@
</Grid>
</Border>
- <Border Background="{StaticResource DarkGrayBrush}" Grid.Row="1" Margin="0 10 0 0" CornerRadius="3" Padding="5">
+ <Border Background="#1B1B1B" Grid.Row="1" Margin="0 10 0 0" CornerRadius="3" Padding="5">
<Grid>
<mahapps:NumericUpDown Style="{x:Null}" InterceptMouseWheel="True" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Right" HideUpDownButtons="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" StringFormat="0.0" HasDecimals="True" Minimum="{Binding ElementName=fader,Path=Minimum}" Maximum="{Binding ElementName=fader,Path=Maximum}" Padding="0" Value="{Binding Value,Mode=TwoWay,StringFormat=0.0,FallbackValue=0.0}" VerticalAlignment="Center" FontSize="44" FontFamily="{StaticResource digital-7}" Foreground="#FFD400" Margin="0 0 12 0">
<mahapps:NumericUpDown.Resources>
@@ -111,7 +111,7 @@
<Button Style="{x:Null}" Grid.Row="2" VerticalAlignment="Bottom" Height="60" Cursor="Hand" Command="{Binding SetCommand}">
<Button.Template>
<ControlTemplate TargetType="Button">
- <Grid Background="{StaticResource GrayBrush280}">
+ <Grid Background="#1B1B1B">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Gainsboro" FontSize="16" FontWeight="SemiBold">SET</TextBlock>
</Grid>
<ControlTemplate.Triggers>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml
index 90e18d43e..e0da8aa03 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml
@@ -170,7 +170,7 @@
</Grid>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -65 0">
- <Border Background="{StaticResource DarkGrayBrush}" CornerRadius="3" Padding="3">
+ <Border Background="#1B1B1B" CornerRadius="3" Padding="3">
<mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="{StaticResource RedBrush400}" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown>
</Border>
<visuals:Knob Width="50" Height="50" TicksHighlightBrush="{StaticResource RedBrush400}" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml
index 190b4d3c8..ffeb1f134 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml
@@ -48,7 +48,7 @@
</Grid>
<Grid Grid.Row="1">
- <Border Background="{StaticResource DarkGrayBrush}" Margin="0 3 0 0" CornerRadius="3" Padding="5">
+ <Border Background="#1B1B1B" Margin="0 3 0 0" CornerRadius="3" Padding="5">
<Grid>
<TextBlock Text="{Binding HeaterState.CurrentValue,StringFormat=0.00,FallbackValue='0.00'}" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="80" FontFamily="{StaticResource digital-7}" Margin="0 0 12 0">
<TextBlock.Style>
@@ -75,7 +75,7 @@
<Image Source="../Images/temperature.png" Margin="0 10 20 10" RenderOptions.BitmapScalingMode="Fant"></Image>
- <Border Background="{StaticResource DarkGrayBrush}" Margin="0 3 0 0" CornerRadius="3" Padding="5" Grid.Column="1">
+ <Border Background="#1B1B1B" Margin="0 3 0 0" CornerRadius="3" Padding="5" Grid.Column="1">
<Grid>
<mahapps:NumericUpDown x:Name="txtSetPoint" InterceptMouseWheel="True" IsHitTestVisible="{Binding IsEditing}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Right" HideUpDownButtons="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" HasDecimals="True" Minimum="0" Maximum="400" Padding="0" Value="{Binding SetPoint,FallbackValue='0.0',Mode=TwoWay}" VerticalAlignment="Center" FontSize="44" FontFamily="{StaticResource digital-7}" Foreground="#FFD400" Margin="0 0 12 0">
<mahapps:NumericUpDown.Resources>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml
index 5165e9819..b57db3d3f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml
@@ -43,7 +43,7 @@
<!--Content-->
<Grid>
- <Border Padding="10" BorderThickness="1" BorderBrush="{StaticResource DarkGrayBrush}" Background="#88FFFFFF" CornerRadius="5">
+ <Border Padding="10" BorderThickness="1" BorderBrush="{StaticResource DarkGrayBrush}" Background="{StaticResource TransparentBackgroundBrush}" CornerRadius="5">
<DockPanel>
<TextBox Foreground="{StaticResource DarkGrayBrush}" FontSize="14" DockPanel.Dock="Top" Text="{Binding Job.Name}"></TextBox>
<ItemsControl Margin="0 10 0 0" DockPanel.Dock="Top" ItemsSource="{Binding BrushStop.LiquidVolumes}" VerticalAlignment="Center">
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml
index 7c3728d1e..77cccaf8f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml
@@ -154,7 +154,7 @@
</Viewbox>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -65 5">
- <Border Background="{StaticResource DarkGrayBrush}" CornerRadius="3" Padding="3">
+ <Border Background="#1B1B1B" CornerRadius="3" Padding="3">
<mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="{StaticResource RedBrush400}" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown>
</Border>
<visuals:Knob Width="50" Height="50" TicksHighlightBrush="{StaticResource RedBrush400}" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml
index 3c4373097..b86f52688 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml
@@ -57,8 +57,8 @@
<Grid Margin="0 2" Focusable="False" Background="Transparent" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessParametersDropped" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=editors:ParameterizedEditor},Path=DraggingSurface}">
<ContentControl Focusable="False">
<DockPanel Focusable="False">
- <TextBlock Focusable="False" Width="150" FontSize="12" Foreground="{StaticResource DarkGrayBrush}" DockPanel.Dock="Left" IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}"></TextBlock>
- <mahapps:NumericUpDown FontSize="14" Minimum="0" Margin="0 0 5 0" HorizontalContentAlignment="Left" HideUpDownButtons="True" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}" Background="#6EFFFFFF"></mahapps:NumericUpDown>
+ <TextBlock Focusable="False" Width="150" FontSize="12" Foreground="#1B1B1B" DockPanel.Dock="Left" IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}"></TextBlock>
+ <mahapps:NumericUpDown FontSize="14" Minimum="0" Margin="0 0 5 0" HorizontalContentAlignment="Left" HideUpDownButtons="True" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}" Background="{StaticResource TransparentBackgroundBrush600}"></mahapps:NumericUpDown>
</DockPanel>
</ContentControl>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml
index ac440ad64..d59a8ddbb 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml
@@ -68,7 +68,7 @@
</Viewbox>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -65 5">
- <Border Background="{StaticResource DarkGrayBrush}" CornerRadius="3" Padding="3">
+ <Border Background="#1B1B1B" CornerRadius="3" Padding="3">
<mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="{StaticResource RedBrush400}" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown>
</Border>
<visuals:Knob Width="50" Height="50" TicksHighlightBrush="{StaticResource RedBrush400}" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml
index 59b9fa2af..20e4b46ff 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml
@@ -46,7 +46,7 @@
<Button Margin="8" Cursor="Hand" Command="{Binding SetCommand}" CommandParameter="{Binding TechValve.State1}">
<Button.Style>
<Style TargetType="Button">
- <Setter Property="Background" Value="{StaticResource GrayBrush280}"></Setter>
+ <Setter Property="Background" Value="#3E3E3E"></Setter>
<Setter Property="IsEnabled" Value="True"></Setter>
</Style>
</Button.Style>
@@ -80,7 +80,7 @@
</Button.Template>
</Button>
- <Border Background="{StaticResource DarkGrayBrush}" Margin="8" CornerRadius="3" Padding="5" Grid.Column="1">
+ <Border Background="#1B1B1B" Margin="8" CornerRadius="3" Padding="5" Grid.Column="1">
<StackPanel>
<TextBlock FontFamily="{StaticResource digital-7}" Text="Valve Controller" FontSize="13" Foreground="#E94A4A" HorizontalAlignment="Center"></TextBlock>
<Image Source="../Images/valve.png" RenderOptions.BitmapScalingMode="Fant" Margin="10" Stretch="Uniform" Height="36" />
@@ -90,7 +90,7 @@
<Button Margin="8" Cursor="Hand" Grid.Column="2" Command="{Binding SetCommand}" CommandParameter="{Binding TechValve.State2}">
<Button.Style>
<Style TargetType="Button">
- <Setter Property="Background" Value="{StaticResource GrayBrush280}"></Setter>
+ <Setter Property="Background" Value="#3E3E3E"></Setter>
<Setter Property="IsEnabled" Value="True"></Setter>
</Style>
</Button.Style>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
index ac54a714a..4205e5246 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
@@ -116,6 +116,8 @@ namespace Tango.MachineStudio.Technician.ViewModels
{
_selectedTab.IsSelected = true;
}
+
+ EnableRenderingForSelectedTabGraphs();
}
}
@@ -499,7 +501,11 @@ namespace Tango.MachineStudio.Technician.ViewModels
if (prop != null)
{
var points = GetDataArray(techMonitor, prop.GetValue(data.Monitors));
- sr.PushData(points, delta_base, delta);
+
+ if (points.Count > 0)
+ {
+ sr.PushData(points, delta_base, delta);
+ }
}
}
@@ -512,15 +518,20 @@ namespace Tango.MachineStudio.Technician.ViewModels
if (prop != null)
{
var points = GetDataMatrix(techMonitor, prop.GetValue(data.Monitors));
- mr.PushData(points, delta_base, delta);
+ if (points.Count > 0)
+ {
+ mr.PushData(points, delta_base, delta);
+ }
}
}
lock (_elementsLock)
{
var elements = Tabs.SelectMany(x => x.Elements).ToList();
+ var selectedTabElements = SelectedTab.Elements.ToList();
- foreach (var item in elements.Select(x => x.HostedElement as TechItem))
+ //Can be updated only when visible
+ foreach (var item in selectedTabElements.Select(x => x.HostedElement as TechItem))
{
if (item.GetType() == typeof(MonitorItem))
{
@@ -550,7 +561,79 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
}
- else if (item.GetType() == typeof(SingleGraphItem))
+ else if (item.GetType() == typeof(DigitalOutItem))
+ {
+ DigitalOutItem digitalOutItem = item as DigitalOutItem;
+
+ var digitalPin = data.DigitalInterfaceStates.SingleOrDefault(x => x.InterfaceIO == (InterfaceIOs)digitalOutItem.TechIo.Code);
+
+ if (digitalPin != null)
+ {
+ digitalOutItem.EffectiveValue = digitalPin.Value;
+ }
+ }
+ else if (item.GetType() == typeof(DigitalInItem))
+ {
+ DigitalInItem digitalInItem = item as DigitalInItem;
+
+ var digitalPin = data.DigitalInterfaceStates.SingleOrDefault(x => x.InterfaceIO == (InterfaceIOs)digitalInItem.TechIo.Code);
+
+ if (digitalPin != null)
+ {
+ digitalInItem.Value = digitalPin.Value;
+ }
+ }
+ else if (item.GetType() == typeof(HeaterItem))
+ {
+ HeaterItem heaterItem = item as HeaterItem;
+
+ var heaterState = data.HeatersStates.SingleOrDefault(x => x.HeaterType == (HeaterType)heaterItem.TechHeater.Code);
+
+ if (heaterState != null)
+ {
+ heaterItem.HeaterState = heaterState;
+ }
+ }
+ else if (item.GetType() == typeof(ValveItem))
+ {
+ ValveItem valveItem = item as ValveItem;
+
+ var valveState = data.ValvesStates.SingleOrDefault(x => x.ValveType == (ValveType)valveItem.TechValve.Code);
+
+ if (valveState != null)
+ {
+ valveItem.EffectiveState = valveState.State;
+ }
+ }
+ else if (item.GetType() == typeof(BlowerItem))
+ {
+ BlowerItem blowerItem = item as BlowerItem;
+
+ if (data.Monitors.BlowerVoltage.Count > 0)
+ {
+ blowerItem.EffectiveActive = data.Monitors.BlowerVoltage.Last() > 0;
+ }
+ }
+ else if (item.GetType() == typeof(ControllerItem))
+ {
+ ControllerItem controllerItem = item as ControllerItem;
+
+ if (DateTime.Now > controllerItem.LastUpdateTime.AddMilliseconds(controllerItem.UpdateInterval))
+ {
+ var componentState = data.ComponentsStates.SingleOrDefault(x => (int)x.Component == controllerItem.TechController.Code);
+
+ if (componentState != null)
+ {
+ controllerItem.EffectiveValue = componentState.Value;
+ }
+ }
+ }
+ }
+
+ //Must be updated all the time.
+ foreach (var item in elements.Select(x => x.HostedElement as TechItem))
+ {
+ if (item.GetType() == typeof(SingleGraphItem))
{
SingleGraphItem graphItem = item as SingleGraphItem;
@@ -564,20 +647,23 @@ namespace Tango.MachineStudio.Technician.ViewModels
{
var points = GetDataArray(graphItem.TechMonitor, prop.GetValue(data.Monitors));
- List<TimeSpanDataPoint> times = new List<TimeSpanDataPoint>();
- var dPoints = points.Select(x => new DoubleDataPoint(x)).ToList();
-
- for (int i = 0; i < points.Count; i++)
+ if (points.Count > 0)
{
- times.Add(delta_base.Add(TimeSpan.FromMilliseconds((delta_mili / points.Count) * i)));
- }
+ List<TimeSpanDataPoint> times = new List<TimeSpanDataPoint>();
+ var dPoints = points.Select(x => new DoubleDataPoint(x)).ToList();
- controller.PushData(times, dPoints);
+ for (int i = 0; i < points.Count; i++)
+ {
+ times.Add(delta_base.Add(TimeSpan.FromMilliseconds((delta_mili / points.Count) * i)));
+ }
- var _graph_recording = _single_graphs_recordings.SingleOrDefault(x => x.Tag == graphItem);
- if (_graph_recording != null)
- {
- _graph_recording.PushData(points, delta_base, delta);
+ controller.PushData(times, dPoints);
+
+ var _graph_recording = _single_graphs_recordings.SingleOrDefault(x => x.Tag == graphItem);
+ if (_graph_recording != null)
+ {
+ _graph_recording.PushData(points, delta_base, delta);
+ }
}
}
}
@@ -640,70 +726,82 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
}
- else if (item.GetType() == typeof(DigitalOutItem))
- {
- DigitalOutItem digitalOutItem = item as DigitalOutItem;
+ }
+ }
+ }
- var digitalPin = data.DigitalInterfaceStates.SingleOrDefault(x => x.InterfaceIO == (InterfaceIOs)digitalOutItem.TechIo.Code);
+ #endregion
- if (digitalPin != null)
- {
- digitalOutItem.EffectiveValue = digitalPin.Value;
- }
- }
- else if (item.GetType() == typeof(DigitalInItem))
- {
- DigitalInItem digitalInItem = item as DigitalInItem;
+ #region Private Methods
- var digitalPin = data.DigitalInterfaceStates.SingleOrDefault(x => x.InterfaceIO == (InterfaceIOs)digitalInItem.TechIo.Code);
+ private void EnableRenderingForSelectedTabGraphs()
+ {
+ if (SelectedTab != null)
+ {
+ lock (_elementsLock)
+ {
+ var elements = Tabs.SelectMany(x => x.Elements).ToList();
- if (digitalPin != null)
- {
- digitalInItem.Value = digitalPin.Value;
- }
- }
- else if (item.GetType() == typeof(HeaterItem))
+ foreach (var element in elements)
{
- HeaterItem heaterItem = item as HeaterItem;
+ if (SelectedTab.Elements.Contains(element))
+ {
+ var item = element.HostedElement as TechItem;
- var heaterState = data.HeatersStates.SingleOrDefault(x => x.HeaterType == (HeaterType)heaterItem.TechHeater.Code);
+ if (item != null)
+ {
+ if (item.GetType() == typeof(SingleGraphItem))
+ {
+ SingleGraphItem graphItem = item as SingleGraphItem;
- if (heaterState != null)
- {
- heaterItem.HeaterState = heaterState;
- }
- }
- else if (item.GetType() == typeof(ValveItem))
- {
- ValveItem valveItem = item as ValveItem;
+ TechGraphController controller = null;
- var valveState = data.ValvesStates.SingleOrDefault(x => x.ValveType == (ValveType)valveItem.TechValve.Code);
+ if (_singleControllers.TryGetValue(graphItem, out controller))
+ {
+ controller.DisableRendering = false;
+ }
+ }
+ else if (item.GetType() == typeof(MultiGraphItem))
+ {
+ MultiGraphItem graphItem = item as MultiGraphItem;
- if (valveState != null)
- {
- valveItem.EffectiveState = valveState.State;
- }
- }
- else if (item.GetType() == typeof(BlowerItem))
- {
- BlowerItem blowerItem = item as BlowerItem;
+ TechGraphController controller = null;
- if (data.Monitors.BlowerVoltage.Count > 0)
- {
- blowerItem.EffectiveActive = data.Monitors.BlowerVoltage.Last() > 0;
+ if (_multiControllers.TryGetValue(graphItem, out controller))
+ {
+ controller.DisableRendering = false;
+ }
+ }
+ }
}
- }
- else if (item.GetType() == typeof(ControllerItem))
- {
- ControllerItem controllerItem = item as ControllerItem;
-
- if (DateTime.Now > controllerItem.LastUpdateTime.AddMilliseconds(controllerItem.UpdateInterval))
+ else
{
- var componentState = data.ComponentsStates.SingleOrDefault(x => (int)x.Component == controllerItem.TechController.Code);
+ var item = element.HostedElement as TechItem;
- if (componentState != null)
+ if (item != null)
{
- controllerItem.EffectiveValue = componentState.Value;
+ if (item.GetType() == typeof(SingleGraphItem))
+ {
+ SingleGraphItem graphItem = item as SingleGraphItem;
+
+ TechGraphController controller = null;
+
+ if (_singleControllers.TryGetValue(graphItem, out controller))
+ {
+ controller.DisableRendering = true;
+ }
+ }
+ else if (item.GetType() == typeof(MultiGraphItem))
+ {
+ MultiGraphItem graphItem = item as MultiGraphItem;
+
+ TechGraphController controller = null;
+
+ if (_multiControllers.TryGetValue(graphItem, out controller))
+ {
+ controller.DisableRendering = true;
+ }
+ }
}
}
}
@@ -711,10 +809,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
- #endregion
-
- #region Private Methods
-
/// <summary>
/// Gets the last data point from a protobuf repeated field.
/// </summary>
@@ -1271,7 +1365,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
catch (Exception ex)
{
LogManager.Log(ex, String.Format("Error executing technician set valve state command on '{0}'.", item.TechName));
- _eventLogger.Log(ex, String.Format("Error executing technician set valve state command on '{0}'.", item.TechName));
}
};
}
@@ -1292,7 +1385,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
catch (Exception ex)
{
LogManager.Log(ex, $"Error executing SetBlowerState command for blower {item.HardwareBlower.HardwareBlowerType.Name}.");
- _eventLogger.Log(ex, $"Error executing SetBlowerState command for blower {item.HardwareBlower.HardwareBlowerType.Name}.");
}
};
}
@@ -1313,7 +1405,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
catch (Exception ex)
{
LogManager.Log(ex, $"Error executing SetHeaterState command for heater {item.TechHeater.Name}.");
- _eventLogger.Log(ex, $"Error executing SetHeaterState command for heater {item.TechHeater.Name}.");
}
};
}
@@ -1410,7 +1501,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
item.HomingProgress = 0;
item.HomingMaximumProgress = 0;
LogManager.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName));
- _eventLogger.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName));
}
};
}
@@ -1508,7 +1598,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
item.HomingProgress = 0;
item.HomingMaximumProgress = 0;
LogManager.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName));
- _eventLogger.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName));
}
};
}
@@ -1662,7 +1751,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
catch (Exception ex)
{
LogManager.Log(ex, String.Format(String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName)));
- _eventLogger.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName));
}
};
}
@@ -1746,7 +1834,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
catch (Exception ex)
{
LogManager.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName));
- _eventLogger.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName));
}
};
}
@@ -1767,7 +1854,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
catch (Exception ex)
{
LogManager.Log(ex, String.Format("Error executing technician set digital out command on '{0}'.", item.TechName));
- _eventLogger.Log(ex, String.Format("Error executing technician set digital out command on '{0}'.", item.TechName));
}
};
}
@@ -1792,7 +1878,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
catch (Exception ex)
{
LogManager.Log(ex, String.Format("Error executing technician set value component command on '{0}'.", item.TechName));
- _eventLogger.Log(ex, String.Format("Error executing technician set value component command on '{0}'.", item.TechName));
}
};
}
@@ -1818,7 +1903,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
catch (Exception ex)
{
String msg = "Error uploading process parameters:" + Environment.NewLine + parameters.ToJsonString();
- _eventLogger.Log(ex, msg);
LogManager.Log(ex, msg);
_notification.ShowError("Could not upload process parameters." + Environment.NewLine + ex.Message);
}
@@ -2117,16 +2201,41 @@ namespace Tango.MachineStudio.Technician.ViewModels
{
var to_remove = Tabs.ToList();
- if (AddNewTab())
+ var name = _notification.ShowTextInput("Enter project name", "Project Name", "untitled");
+
+ if (String.IsNullOrWhiteSpace(name))
{
- _singleControllers.Clear();
- _multiControllers.Clear();
+ return;
+ }
- foreach (var tab in to_remove)
- {
- Tabs.Remove(tab);
- }
+ SaveFileDialog dlg = new SaveFileDialog();
+ dlg.Title = "Select Technician Project Location";
+ dlg.Filter = "Technician Project File|*.tpf";
+ dlg.DefaultExt = ".tpf";
+ dlg.FileName = name;
+
+ if (!dlg.ShowDialog().Value)
+ {
+ return;
+ }
+
+ _singleControllers.Clear();
+ _multiControllers.Clear();
+ _multi_graph_recordings.Clear();
+ _multi_monitors_recordings.Clear();
+ _single_graphs_recordings.Clear();
+ _single_monitors_recordings.Clear();
+
+ foreach (var tab in to_remove)
+ {
+ Tabs.Remove(tab);
}
+
+ AddNewTab(name);
+
+ _lastTechProjectFile = dlg.FileName;
+ File.AppendAllText(_lastTechProjectFile, "");
+ SaveProject();
}
/// <summary>