diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-19 19:10:55 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-19 19:10:55 +0200 |
| commit | 10e1892e2ff3620d5111c3b8e5c9eea5baa08a1a (patch) | |
| tree | c5a2f02332896ed2b5972abde7d6abfb50565500 /Software/Visual_Studio | |
| parent | e17d15cb372dbae9a11c09d76f8ca14265f40334 (diff) | |
| download | Tango-10e1892e2ff3620d5111c3b8e5c9eea5baa08a1a.tar.gz Tango-10e1892e2ff3620d5111c3b8e5c9eea5baa08a1a.zip | |
Implemented some improvements for PPC.
Diffstat (limited to 'Software/Visual_Studio')
7 files changed, 28 insertions, 48 deletions
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 a7062d036..9a977ad35 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 @@ -385,7 +385,7 @@ <controls:TableGrid RowHeight="50"> <TextBlock>Job name:</TextBlock> - <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> + <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" FocusSelectionMode="SelectAll" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> <TextBlock>Customer:</TextBlock> <touch:TouchAutoComplete Text="{Binding CustomersFilter}" ItemsSource="{Binding Customers}" SelectedItem="{Binding Job.Customer}" DisplayMemberPath="Name" AutoCompleteProvider="{Binding CustomersAutoCompleteProvider}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> 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 edc7cce52..364ca8ee7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs @@ -26,9 +26,6 @@ namespace Tango.PPC.UI /// </summary> public partial class MainWindow : Window { - private String _technician_mode_buffer; - private Viewbox viewBox; - public static MainWindow Instance { get; private set; } public MainWindow() @@ -37,8 +34,6 @@ namespace Tango.PPC.UI InitializeComponent(); - _technician_mode_buffer = String.Empty; - bool has_touch = false; #if !DESKTOP @@ -91,34 +86,5 @@ namespace Tango.PPC.UI { TangoIOC.Default.GetInstance<IPPCApplicationManager>().ShutDown(); } - - protected override void OnPreviewKeyDown(System.Windows.Input.KeyEventArgs e) - { - base.OnPreviewKeyDown(e); - - try - { - _technician_mode_buffer += Char.Parse(e.Key.ToString()); - } - catch{} - - if (e.Key == Key.Return || e.Key == Key.Tab) - { - if (_technician_mode_buffer.ToLower().Contains("ENTERTECHNICIAN".ToLower())) - { - _technician_mode_buffer = String.Empty; - TangoIOC.Default.GetInstance<IPPCApplicationManager>().EnterTechnicianMode(); - e.Handled = true; - } - else if (_technician_mode_buffer.ToLower().Contains("EXITTECHNICIAN".ToLower())) - { - _technician_mode_buffer = String.Empty; - TangoIOC.Default.GetInstance<IPPCApplicationManager>().ExitTechnicianMode(); - e.Handled = true; - } - - _technician_mode_buffer = String.Empty; - } - } } } 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 43b0cc047..4b5874907 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -161,11 +161,13 @@ namespace Tango.PPC.UI.PPCApplication //Start watchdog _watchdogServer = new WatchDogServer(Application.Current.Dispatcher); - +#if RELEASE + if (settings.EnableWatchDog) { _watchdogServer.Start(); } +#endif LogManager.Log("Reading Core settings..."); var coreSettings = SettingsManager.Default.GetOrCreate<CoreSettings>(); 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 f40bfa7de..1891139e9 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 @@ -509,7 +509,7 @@ del "$(TargetDir)firmware_package.tfp"</PostBuildEvent> </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> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> + <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />--> </requestedPrivileges> </security> </trustInfo> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs index 76e99ff88..6f8297a5e 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -20,6 +21,7 @@ namespace Tango.Touch.Controls public class TouchTextBox : TouchInput { private TextBox _text_box; + private DateTime _lost_focus_time; public String Text { @@ -82,10 +84,17 @@ namespace Tango.Touch.Controls _text_box = GetTemplateChild("PART_TextBox") as TextBox; _text_box.GotFocus += _text_box_GotFocus; + _text_box.LostFocus += _text_box_LostFocus; + this.RegisterForPreviewMouseOrTouchUp(OnMouseOrTouchUp); } + private void _text_box_LostFocus(object sender, RoutedEventArgs e) + { + _lost_focus_time = DateTime.Now; + } + private void OnMouseOrTouchUp(object sender, MouseOrTouchEventArgs e) { if (TapCommand != null) @@ -96,15 +105,18 @@ namespace Tango.Touch.Controls private async void _text_box_GotFocus(object sender, RoutedEventArgs e) { - await Task.Delay(50); - - if (FocusSelectionMode == FocusSelectionMode.SelectAll) - { - _text_box.SelectAll(); - } - else if (FocusSelectionMode == FocusSelectionMode.ScrollToEnd) + if (DateTime.Now > _lost_focus_time.AddMilliseconds(200)) { - _text_box.CaretIndex = _text_box.Text.Length; + await Task.Delay(50); + + if (FocusSelectionMode == FocusSelectionMode.SelectAll) + { + _text_box.SelectAll(); + } + else if (FocusSelectionMode == FocusSelectionMode.ScrollToEnd) + { + _text_box.CaretIndex = _text_box.Text.Length; + } } } diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs index 7f4641a89..cddb289f1 100644 --- a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs +++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs @@ -127,7 +127,7 @@ namespace Tango.Touch.Keyboard DateTime _last = _instance._lastFocusTime; - await Task.Delay(100); + await Task.Delay(300); if (_last == _instance._lastFocusTime) { @@ -305,7 +305,7 @@ namespace Tango.Touch.Keyboard private void OnMouseDown(object sender, MouseOrTouchEventArgs e) { - if (e.Source == _content_presenter && IsOpened) + if (e.OriginalSource.GetType().Name != "TextBoxView" && e.Source == _content_presenter && IsOpened) { IsOpened = false; } |
