aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.pngbin0 -> 568 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.pngbin0 -> 457 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs44
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml13
10 files changed, 80 insertions, 23 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs
index 377d02d81..f43405085 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs
@@ -15,11 +15,12 @@ namespace Tango.PPC.UI.Converters
{
try
{
- if (values.Count() == 2)
+ if (values.Count() == 3)
{
double length = System.Convert.ToDouble(values[0]);
bool forOneSpool = System.Convert.ToBoolean(values[1]);
- var totalBy4Spools = (double)length*4;// spools ;
+ int number_of_spools = System.Convert.ToInt16(values[2]);
+ var totalBy4Spools = (double)length* number_of_spools;
if (forOneSpool)
{
return (double)totalBy4Spools / 4;
@@ -27,14 +28,15 @@ namespace Tango.PPC.UI.Converters
return totalBy4Spools;
}
- if (values.Count() == 3)
+ if (values.Count() == 4)
{
double length = System.Convert.ToDouble(values[0]);
bool forOneSpool = System.Convert.ToBoolean(values[1]);
double currentProgresslength = System.Convert.ToDouble(values[2]) ;
+ int number_of_spools = System.Convert.ToInt16(values[3]);
- var totalBy4Spools = (double)length * 4;
- var currentProgressBy4Spools = (double)currentProgresslength * 4 ;
+ var totalBy4Spools = (double)length * number_of_spools;
+ var currentProgressBy4Spools = (double)currentProgresslength * number_of_spools;
int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools;
var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs
index d0cc8284e..66303ab27 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs
@@ -14,11 +14,11 @@ namespace Tango.PPC.UI.Converters
{
try
{
- if (values.Count() == 1)//may be added count of spools
+ if (values.Count() == 2)//may be added count of spools
{
int CurrentUnit = System.Convert.ToInt16(values[0]);
-
- var totalBy4Spools = (double)CurrentUnit * 4;// spools ;
+ int number_of_spools = System.Convert.ToInt16(values[1]);
+ var totalBy4Spools = (double)CurrentUnit * number_of_spools;
return totalBy4Spools.ToString();
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs
index f451fe0d9..7ffb1e8a7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs
@@ -16,12 +16,13 @@ namespace Tango.PPC.UI.Converters
{
try
{
- if (values.Count() == 3)
+ if (values.Count() == 4)
{
double length = System.Convert.ToDouble(values[0]);
bool forOneSpool = System.Convert.ToBoolean(values[1]);
double coef = System.Convert.ToDouble(values[2]);
- var totalBy4Spools = (double)length * 4;// spools ;
+ int number_of_spools = System.Convert.ToInt16(values[3]);
+ var totalBy4Spools = (double)length * number_of_spools;
var weight = ((double)totalBy4Spools * coef) / (1000);//(g)
if (forOneSpool)
@@ -31,15 +32,16 @@ namespace Tango.PPC.UI.Converters
return weight;
}
- if (values.Count() == 4)
+ if (values.Count() == 5)
{
double length = System.Convert.ToDouble(values[0]);
bool forOneSpool = System.Convert.ToBoolean(values[1]);
double currentProgresslength = System.Convert.ToDouble(values[2]);
double coef = System.Convert.ToDouble(values[3]);
+ int number_of_spools = System.Convert.ToInt16(values[4]);
- var totalBy4Spools = (double)length * 4;
- var currentProgressBy4Spools = (double)currentProgresslength * 4;
+ var totalBy4Spools = (double)length * number_of_spools;
+ var currentProgressBy4Spools = (double)currentProgresslength * number_of_spools;
int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools;
var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png
new file mode 100644
index 000000000..519f570fc
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png
new file mode 100644
index 000000000..5510f1006
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
index a0fba3632..8f65f225b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
@@ -646,6 +646,8 @@
<Resource Include="Images\Overview Icons\temperature.png" />
<Resource Include="Images\screw.png" />
<Resource Include="Images\Menu\AppPower_image.png" />
+ <Resource Include="Images\Menu\updateDB.png" />
+ <Resource Include="Images\Menu\updateVersion.png" />
<Content Include="Intro.wmv" />
<Content Include="Manifests\release.xml" />
<Content Include="Manifests\debug.xml" />
@@ -991,7 +993,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir)
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
<Import Project="..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets" Condition="Exists('..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets')" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
index 17b676499..56314414a 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
@@ -14,8 +14,10 @@ using Tango.Integration.Operation;
using Tango.PMR.IFS;
using Tango.PPC.Common;
using Tango.PPC.Common.Connection;
+using Tango.PPC.Common.MachineUpdate;
using Tango.PPC.Common.Modules;
using Tango.PPC.Common.Navigation;
+using Tango.PPC.Common.Web;
using Tango.PPC.UI.Dialogs;
using Tango.PPC.UI.Views;
using Tango.PPC.UI.ViewsContracts;
@@ -39,6 +41,9 @@ namespace Tango.PPC.UI.ViewModels
[TangoInject]
public IPPCModuleLoader ModuleLoader { get; set; }
+ [TangoInject]
+ public IMachineUpdateManager MachineUpdateManager { get; set; }
+
#region Classes
public class CartridgeModel : ExtendedObject
@@ -230,6 +235,26 @@ namespace Tango.PPC.UI.ViewModels
set { _currentDateTime = value; RaisePropertyChangedAuto(); }
}
+ private bool _enableDBUpdate;
+ /// <summary>
+ /// Gets or sets a value indicating whether to automatically check for new application updates.
+ /// </summary>
+ public bool EnableDBUpdate
+ {
+ get { return _enableDBUpdate; }
+ set { _enableDBUpdate = value; RaisePropertyChangedAuto(); }
+ }
+
+ private bool _enableVersionUpdate;
+ /// <summary>
+ /// Gets or sets a value indicating whether to automatically check for new application updates.
+ /// </summary>
+ public bool EnableVersionUpdate
+ {
+ get { return _enableVersionUpdate; }
+ set { _enableVersionUpdate = value; RaisePropertyChangedAuto(); }
+ }
+
#endregion
#region Commands
@@ -327,6 +352,8 @@ namespace Tango.PPC.UI.ViewModels
_date_timer.Interval = TimeSpan.FromSeconds(1);
_date_timer.Tick += _date_timer_Tick;
_date_timer.Start();
+
+ _enableDBUpdate = _enableVersionUpdate = false;
}
#endregion
@@ -564,6 +591,22 @@ namespace Tango.PPC.UI.ViewModels
MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged;
}
+ private void MachineUpdateManager_UpdateAvailable(object sender, CheckForUpdateResponse e)
+ {
+ EnableVersionUpdate = false;
+ EnableDBUpdate = false;
+
+ if(e.IsUpdateAvailable)
+ {
+ EnableVersionUpdate = true;
+ return;
+ }
+ else if (e.IsDatabaseUpdateAvailable)
+ {
+ EnableDBUpdate = true;
+ }
+ }
+
private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e)
{
if (Cartridges == null)
@@ -618,6 +661,7 @@ namespace Tango.PPC.UI.ViewModels
{
base.OnApplicationReady();
MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged;
+ MachineUpdateManager.UpdateAvailable += MachineUpdateManager_UpdateAvailable;
}
private void MachineOperator_StatusChanged(object sender, MachineStatuses e)
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml
index 049f2268d..62538d9d6 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml
@@ -119,7 +119,9 @@
<touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="10 0" Height="45" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="/Images/Menu/update.png" VerticalAlignment="Center" Width="20" Height="20"></Image>
- <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light">Update</TextBlock>
+ <TextBlock VerticalAlignment="Center" Margin="20 0 20 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light">Update</TextBlock>
+ <Image Margin="30 0 0 0" Source="/Images/Menu/updateDB.png" VerticalAlignment="Center" Width="16" Height="16" HorizontalAlignment="Right" Visibility="{Binding EnableDBUpdate, Converter={StaticResource BooleanToVisibilityConverter}}" SnapsToDevicePixels="True"></Image>
+ <Image Margin="30 0 0 0" Source="/Images/Menu/updateVersion.png" VerticalAlignment="Center" Width="16" Height="16" HorizontalAlignment="Right" Visibility="{Binding EnableVersionUpdate, Converter={StaticResource BooleanToVisibilityConverter}}" SnapsToDevicePixels="True"></Image>
</StackPanel>
</touch:TouchButton>
</Border>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
index 3664e3997..1196a2c0e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -177,7 +177,7 @@
</Border.Style>
<Grid>
<Grid.RowDefinitions>
- <RowDefinition Height="1.4*"/>
+ <RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
@@ -196,16 +196,16 @@
</UniformGrid>
</Grid>
- <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="25 0" Opacity="0.3" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" />
+ <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="25 0" Opacity="0.3" StrokeThickness="2" Stroke="{StaticResource TangoDividerBrush}" />
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="188*"/>
<ColumnDefinition Width="261*"/>
</Grid.ColumnDefinitions>
- <Image Source="/Images/power-tablet.png" Margin="30" />
+ <Image Source="/Images/power-tablet.png" Margin="30" VerticalAlignment="Center" />
- <touch:TouchButton Command="{Binding RestartApplicationCommand}" Grid.Column="1" Style="{StaticResource PowerButton}">Restart</touch:TouchButton>
+ <touch:TouchButton Command="{Binding RestartApplicationCommand}" Grid.Column="1" Style="{StaticResource PowerButton}" VerticalAlignment="Center">Restart</touch:TouchButton>
</Grid>
</Grid>
</Border>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
index 0436cdab6..f9338b813 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
@@ -558,7 +558,7 @@
<Image Source="../Images/Job Issues/spools.png" Stretch="None" VerticalAlignment="Top"/>
<StackPanel Orientation="Vertical" Margin="15 0 0 0">
<TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Spools</TextBlock>
- <TextBlock Text="{Binding Job.Spools, TargetNullValue='-', FallbackValue='-'}" FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></TextBlock>
+ <TextBlock Text="{Binding Job.NumberOfSpools, TargetNullValue='-', FallbackValue='-'}" FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></TextBlock>
</StackPanel>
</StackPanel>
</UniformGrid>
@@ -650,6 +650,7 @@
<Binding Path="RunningJobStatus.TotalProgressMinusSettingUp" />
<Binding Path="IsSpoolView"/>
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" />
+ <Binding Path="Job.NumberOfSpools"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -659,6 +660,7 @@
<MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="#,0" TargetNullValue='-' FallbackValue='0' Mode="OneWay">
<Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/>
<Binding Path="IsSpoolView"/>
+ <Binding Path="Job.NumberOfSpools"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -673,6 +675,7 @@
<Binding Path="IsSpoolView"/>
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" />
<Binding Path="Job.GramPerLength" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -683,6 +686,7 @@
<Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/>
<Binding Path="IsSpoolView"/>
<Binding Path="Job.GramPerLength" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -792,7 +796,7 @@
<TextBlock.Text>
<MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0" TargetNullValue='-' FallbackValue='-' Mode="OneWay">
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/>
- <Binding Path="Job.Spools" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -807,7 +811,7 @@
<MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay">
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/>
<Binding Path="Job.GramPerLength" Mode="OneWay"/>
- <Binding Path="Job.Spools" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -830,6 +834,7 @@
<Setter.Value>
<MultiBinding Converter="{StaticResource ProgressUnitSpoolConverter}" TargetNullValue='-' FallbackValue='-' >
<Binding Path="RunningJobStatus.CurrentUnit" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</Setter.Value>
</Setter>
@@ -1019,7 +1024,7 @@
<TextBlock.Text>
<MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay">
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/>
- <Binding Path="Job.Spools" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>