aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-08 17:55:46 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-08 17:55:46 +0300
commit36d1edb4f9cc4fbd9c134d3b387bcfec05424537 (patch)
tree4f780184ad9d41c0ab84637116c06bcff4c1cb67 /Software/Visual_Studio/PPC
parenta2cf6c8d62083a63ee193a1cd206ab345368b242 (diff)
downloadTango-36d1edb4f9cc4fbd9c134d3b387bcfec05424537.tar.gz
Tango-36d1edb4f9cc4fbd9c134d3b387bcfec05424537.zip
Doing some work on PPC + Mirta integration.
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs48
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj13
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs17
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml21
8 files changed, 62 insertions, 54 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
index 260670e08..039c01771 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
@@ -221,7 +221,7 @@ namespace Tango.PPC.Jobs.ViewModels
foreach (var stop in brushStops)
{
- //stop.IsOutOfGamut = TangoColorConverter.IsOutOfGamut(stop);
+ stop.IsOutOfGamut = TangoColorConverter.IsOutOfGamut(stop);
}
}
}
@@ -445,10 +445,10 @@ namespace Tango.PPC.Jobs.ViewModels
SpoolTypes = await _db.SpoolTypes.ToListAsync();
Customers = await _db.Customers.Where(x => x.OrganizationGuid == ApplicationManager.Machine.OrganizationGuid).ToListAsync();
- //if (!_check_gamut_thread.IsAlive)
- //{
- // _check_gamut_thread.Start();
- //}
+ if (!_check_gamut_thread.IsAlive)
+ {
+ _check_gamut_thread.Start();
+ }
//Job.Segments.ReloadAsyncIdle((current, total) =>
//{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs
index b20e93ff9..36779c571 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
@@ -23,39 +24,11 @@ namespace Tango.PPC.Common.Controls
public partial class AsyncAdornerControl : ContentControl
{
private bool _loaded;
-
- public enum GWL
- {
- ExStyle = -20
- }
-
- public enum WS_EX
- {
- Transparent = 0x20,
- Layered = 0x80000
- }
-
- public enum LWA
- {
- ColorKey = 0x1,
- Alpha = 0x2
- }
-
- [DllImport("user32.dll", EntryPoint = "GetWindowLong")]
- public static extern int GetWindowLong(IntPtr hWnd, GWL nIndex);
-
- [DllImport("user32.dll", EntryPoint = "SetWindowLong")]
- public static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, int dwNewLong);
-
- [DllImport("user32.dll", EntryPoint = "SetLayeredWindowAttributes")]
- public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, byte alpha, LWA dwFlags);
-
private Window _window;
public AsyncAdornerControl()
{
Loaded += AsyncAdornerControl_Loaded;
- LayoutUpdated += AsyncAdornerControl_LayoutUpdated;
IsVisibleChanged += AsyncAdornerControl_IsVisibleChanged;
}
@@ -71,11 +44,6 @@ namespace Tango.PPC.Common.Controls
}
}
- private void AsyncAdornerControl_LayoutUpdated(object sender, EventArgs e)
- {
- SyncBounds();
- }
-
public Type ViewType
{
get { return (Type)GetValue(ViewTypeProperty); }
@@ -94,6 +62,8 @@ namespace Tango.PPC.Common.Controls
{
if (!this.IsInDesignMode())
{
+ var startTime = Process.GetCurrentProcess().StartTime;
+
if (_loaded) return;
_loaded = true;
@@ -111,6 +81,11 @@ namespace Tango.PPC.Common.Controls
Thread thread = new Thread(() =>
{
+ if (DateTime.Now < startTime.AddSeconds(5))
+ {
+ Thread.Sleep(5000);
+ }
+
_window = new Window();
_window.WindowStyle = WindowStyle.None;
_window.ResizeMode = ResizeMode.NoResize;
@@ -129,8 +104,6 @@ namespace Tango.PPC.Common.Controls
_window.ShowActivated = false;
- //FrameworkElement element = Activator.CreateInstance(type) as FrameworkElement;
-
var cloned = FrameworkElementSerializer.Deserialize(xaml);
cloned.DataContext = dc;
@@ -138,11 +111,6 @@ namespace Tango.PPC.Common.Controls
_window.Show();
- int wl = GetWindowLong(handle, GWL.ExStyle);
- wl = wl | 0x80000 | 0x20;
- SetWindowLong(handle, GWL.ExStyle, wl);
- SetLayeredWindowAttributes(handle, 0, 128, LWA.Alpha);
-
SyncBounds();
System.Windows.Threading.Dispatcher.Run();
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs
index f2a90a454..6df09856e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs
@@ -39,7 +39,8 @@ namespace Tango.PPC.Common.Controls
{
InitializeComponent();
- Loaded += TwineCatalogControl_Loaded;
+ list.ApplyTemplate();
+ list.Loaded += TwineCatalogControl_Loaded;
DataContextChanged += (x, y) =>
{
_catalog = DataContext as Catalog;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
index ca26b7761..181c05145 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
@@ -37,7 +37,7 @@ namespace Tango.PPC.UI
WindowStyle = WindowStyle.None;
ResizeMode = ResizeMode.NoResize;
WindowStartupLocation = WindowStartupLocation.Manual;
- Topmost = true; // sure?
+ Topmost = false; // sure?
var screens = System.Windows.Forms.Screen.AllScreens;
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 eaf53b993..4f6221144 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
@@ -316,6 +316,11 @@
<Link>DB\Tango.mdf</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="..\..\..\DB\PPC\Tango_log.ldf">
+ <Link>DB\Tango_log.ldf</Link>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <DependentUpon>Tango.mdf</DependentUpon>
+ </Content>
<Content Include="..\..\Build\Debug\Tango.ColorLib.dll">
<Link>Tango.ColorLib.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -375,6 +380,12 @@ RD /S /Q "$(TargetDir)zh-Hant\"
RD /S /Q "$(TargetDir)bg\"
RD /S /Q "$(TargetDir)bn-BD\"
RD /S /Q "$(TargetDir)nb-NO\"
-RD /S /Q "$(TargetDir)pt-BR\"</PostBuildEvent>
+RD /S /Q "$(TargetDir)pt-BR\"
+
+copy /Y "$(SolutionDir)Referenced Assemblies\mscoree.dll" "$(TargetDir)"
+copy /Y "$(SolutionDir)Referenced Assemblies\msvcp140d.dll" "$(TargetDir)"
+copy /Y "$(SolutionDir)Referenced Assemblies\ucrtbased.dll" "$(TargetDir)"
+copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140.dll" "$(TargetDir)"
+copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
index 293435d0b..dd54873ce 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
@@ -8,6 +8,7 @@ using Tango.PPC.Common;
using Tango.PPC.Common.Navigation;
using SimpleValidator.Extensions;
using System.ComponentModel.DataAnnotations;
+using Tango.SharedUI.Helpers;
namespace Tango.PPC.UI.ViewModels
{
@@ -32,6 +33,17 @@ namespace Tango.PPC.UI.ViewModels
set { _password = value; RaisePropertyChangedAuto(); }
}
+ private bool _isLoading;
+ /// <summary>
+ /// Gets or sets a value indicating whether the application is busy with loading modules.
+ /// </summary>
+ public bool IsLoading
+ {
+ get { return _isLoading; }
+ set { _isLoading = value; RaisePropertyChangedAuto(); }
+ }
+
+
public LoginViewVM()
{
LoginCommand = new RelayCommand(Login);
@@ -49,10 +61,14 @@ namespace Tango.PPC.UI.ViewModels
{
if (Validate())
{
+ IsLoading = true;
+ UIHelper.DoEvents();
+
var user = AuthenticationProvider.Login(Email, Password);
if (user == null)
{
+ IsLoading = false;
NotificationProvider.ShowWarning("Email or password are incorrect.");
}
@@ -60,6 +76,7 @@ namespace Tango.PPC.UI.ViewModels
{
await Task.Delay(500);
await NavigationManager.NavigateTo(NavigationView.HomeModule);
+ IsLoading = false;
};
}
}
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 7d170d04f..621bfabdb 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -129,7 +129,7 @@
</commonControls:AsyncAdornerControl.Style>
<Grid>
<StackPanel Orientation="Horizontal">
- <touch:TouchBusyIndicator Width="50" Height="50" IsIndeterminate="True" />
+ <touch:TouchBusyIndicator Width="50" Height="50" IsIndeterminate="{Binding NotificationProvider.IsInGlobalBusyState}" />
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20" Text="{Binding NotificationProvider.GlobalBusyMessage}"></TextBlock>
</StackPanel>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml
index 6fbf713e9..74bb85e7d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml
@@ -5,6 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
xmlns:global="clr-namespace:Tango.PPC.UI"
+ xmlns:controls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
xmlns:local="clr-namespace:Tango.PPC.UI.Views"
@@ -16,14 +17,24 @@
<TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Login to your account</TextBlock>
<StackPanel Margin="0 60 0 0">
- <touch:TouchTextBox Text="{Binding Email,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" Watermark="Email" KeyboardMode="Email" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=keyboardContainer}" />
- <touch:TouchTextBox Text="{Binding Password,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" IsPassword="True" Margin="0 40 0 0" Watermark="Password" KeyboardMode="AlphaNumeric" KeyboardAction="Go" KeyboardContainer="{Binding ElementName=keyboardContainer}" />
+ <StackPanel Visibility="{Binding IsLoading,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <touch:TouchTextBox Text="{Binding Email,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" Watermark="Email" KeyboardMode="Email" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=keyboardContainer}" />
+ <touch:TouchTextBox Text="{Binding Password,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" IsPassword="True" Margin="0 40 0 0" Watermark="Password" KeyboardMode="AlphaNumeric" KeyboardAction="Go" KeyboardContainer="{Binding ElementName=keyboardContainer}" />
- <touch:TouchCheckBox Margin="0 30 0 0">Keep me logged in.</touch:TouchCheckBox>
+ <touch:TouchCheckBox Margin="0 30 0 0">Keep me logged in.</touch:TouchCheckBox>
- <touch:TouchButton Height="60" Margin="0 30 0 0" CornerRadius="3" IsDefault="True" DelayCommand="{Binding LoginCommand}" DelayCommandDuration="00:00:0.2">LOGIN</touch:TouchButton>
+ <touch:TouchButton Height="60" Margin="0 30 0 0" CornerRadius="3" IsDefault="True" DelayCommand="{Binding LoginCommand}" DelayCommandDuration="00:00:0.4">LOGIN</touch:TouchButton>
- <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Forgot password?</TextBlock>
+ <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Forgot password?</TextBlock>
+ </StackPanel>
+ <StackPanel>
+ <controls:AsyncAdornerControl Height="130" Visibility="{Binding IsLoading,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <StackPanel>
+ <touch:TouchBusyIndicator IsIndeterminate="{Binding IsLoading}" Width="80" Height="80" />
+ <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoTitleFontSize}">Logging in...</TextBlock>
+ </StackPanel>
+ </controls:AsyncAdornerControl>
+ </StackPanel>
</StackPanel>
</StackPanel>
</Grid>