Commit 51cd801d by 鲁志-悦动

把倒计时框放到时间下面,修复倒计时框不动的缺陷

parent d00627f4
...@@ -809,7 +809,7 @@ ...@@ -809,7 +809,7 @@
</b:Interaction.Triggers> </b:Interaction.Triggers>
</TextBox> </TextBox>
<TextBox <!--<TextBox
Width="30" Width="30"
Background="Yellow" Background="Yellow"
BorderBrush="Red" BorderBrush="Red"
...@@ -818,7 +818,7 @@ ...@@ -818,7 +818,7 @@
Foreground="Black" Foreground="Black"
IsEnabled="False" IsEnabled="False"
Style="{StaticResource TextBoxStyle}" Style="{StaticResource TextBoxStyle}"
Text="{Binding AutoSendCount, Mode=TwoWay}" /> Text="{Binding AutoSendCount, Mode=TwoWay}" />-->
<!--<ListBox <!--<ListBox
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
...@@ -1535,6 +1535,22 @@ ...@@ -1535,6 +1535,22 @@
VideoBorderBrush="Yellow" /> VideoBorderBrush="Yellow" />
</Grid> </Grid>
<TextBox
Grid.Row="2"
Grid.ColumnSpan="2"
Width="45"
Height="45"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Background="Yellow"
BorderBrush="Red"
BorderThickness="2"
FontSize="30"
Foreground="Black"
IsEnabled="False"
Style="{StaticResource TextBoxStyle}"
Text="{Binding AutoSendCount, Mode=TwoWay}" />
<!--<Canvas <!--<Canvas
Grid.Row="2" Grid.Row="2"
Width="740" Width="740"
......
...@@ -271,10 +271,14 @@ namespace VIZ.FGOUT.Module ...@@ -271,10 +271,14 @@ namespace VIZ.FGOUT.Module
private void AutoSendIntervalTimeChanged(AutoSendModel model) private void AutoSendIntervalTimeChanged(AutoSendModel model)
{ {
_tempAutoSendCount = AutoSendCount = AutoSendIntervalTime - 1; WPFHelper.BeginInvoke(() =>
{
AutoSendCount = AutoSendIntervalTime;
//_tempAutoSendCount = AutoSendCount = AutoSendIntervalTime - 1;
//AutoSendCount = (model.Interval / 1000); //AutoSendCount = (model.Interval / 1000);
_autoSend_Timer.Stop(); _autoSend_Timer.Stop();
_autoSend_Timer.Start(); _autoSend_Timer.Start();
});
//WPFHelper.BeginInvoke(() => //WPFHelper.BeginInvoke(() =>
//{ //{
...@@ -435,9 +439,9 @@ namespace VIZ.FGOUT.Module ...@@ -435,9 +439,9 @@ namespace VIZ.FGOUT.Module
try try
{ {
//UIDispatcher = DispatcherHelper.CheckBeginInvokeOnUI; //UIDispatcher = DispatcherHelper.CheckBeginInvokeOnUI;
DispatcherHelper.UIDispatcher.InvokeAsync(() => //DispatcherHelper.UIDispatcher.InvokeAsync(() =>
//Application.Current.Dispatcher.BeginInvoke(new Action(() => //Application.Current.Dispatcher.BeginInvoke(new Action(() =>
//WPFHelper.BeginInvoke(() => WPFHelper.BeginInvoke(() =>
{ {
if (AutoSendCount == 0) if (AutoSendCount == 0)
{ {
...@@ -452,10 +456,10 @@ namespace VIZ.FGOUT.Module ...@@ -452,10 +456,10 @@ namespace VIZ.FGOUT.Module
else else
{ {
//1 //1
//AutoSendCount--; AutoSendCount--;
//this.RaisePropertyChanged(nameof(AutoSendCount)); //this.RaisePropertyChanged(nameof(AutoSendCount));
//2 //2
AutoSendCount -= 1; //AutoSendCount -= 1;
} }
//}); //});
//})); //}));
...@@ -1506,6 +1510,8 @@ namespace VIZ.FGOUT.Module ...@@ -1506,6 +1510,8 @@ namespace VIZ.FGOUT.Module
//TimeCountActVisibility = Visibility.Collapsed; //TimeCountActVisibility = Visibility.Collapsed;
//TimeCountDefaultVisibility = Visibility.Visible; //TimeCountDefaultVisibility = Visibility.Visible;
AutoSendCount = AutoSendIntervalTime;
} }
#endregion #endregion
......
...@@ -22,6 +22,9 @@ namespace VIZ.FGOUT.Module ...@@ -22,6 +22,9 @@ namespace VIZ.FGOUT.Module
/// <param name="msg"></param> /// <param name="msg"></param>
private void OnAlgorithmMessage__start_end(AlgorithmMessage__start_end msg) private void OnAlgorithmMessage__start_end(AlgorithmMessage__start_end msg)
{ {
if (msg.end == -1) return;
if (this.ViewKey != NDIViewKeys.CAM_1) return;
var config = ApplicationDomainEx.LiteDbContext.AlgorithmSaveMatImage.FindAll().FirstOrDefault(); var config = ApplicationDomainEx.LiteDbContext.AlgorithmSaveMatImage.FindAll().FirstOrDefault();
if (config == null) if (config == null)
config = new AlgorithmSaveMatImage(); config = new AlgorithmSaveMatImage();
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DE7CD6F0DEC5D61678C9DDBA502287984A8FCC40AA63AE92E37A79EA4BBB958B" #pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "54735C6DF9304DF1892FA35EF7D9D5B4D53628D9B6994590A46ED491D9FDA26E"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DE7CD6F0DEC5D61678C9DDBA502287984A8FCC40AA63AE92E37A79EA4BBB958B" #pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "54735C6DF9304DF1892FA35EF7D9D5B4D53628D9B6994590A46ED491D9FDA26E"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs 
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;;
......
...@@ -55,5 +55,5 @@ using System.Windows; ...@@ -55,5 +55,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5.0")] [assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.5.0")] [assembly: AssemblyFileVersion("1.0.6.0")]
...@@ -4,6 +4,7 @@ using System.Diagnostics; ...@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Framework.Domain; using VIZ.Framework.Domain;
...@@ -26,7 +27,7 @@ namespace VIZ.Framework.Common ...@@ -26,7 +27,7 @@ namespace VIZ.Framework.Common
{ {
ApplicationDomain.ObjectPoolManager.Add($"CountdownDisplayControl__{Guid.NewGuid()}", this); ApplicationDomain.ObjectPoolManager.Add($"CountdownDisplayControl__{Guid.NewGuid()}", this);
this.Loaded += TimeDisplayControl_Loaded; //this.Loaded += TimeDisplayControl_Loaded;
} }
/// <summary> /// <summary>
...@@ -64,6 +65,14 @@ namespace VIZ.Framework.Common ...@@ -64,6 +65,14 @@ namespace VIZ.Framework.Common
this.updateTask = Task.Run(this.update); this.updateTask = Task.Run(this.update);
} }
private void TimeDisplayControl_Loaded()
{
if (this.updateTask != null) return;
this.updateTaskInfo = new TaskInfo();
this.updateTask = Task.Run(this.update);
}
public int NumText public int NumText
{ {
get { return (int)GetValue(NumTextProperty); } get { return (int)GetValue(NumTextProperty); }
...@@ -81,6 +90,28 @@ namespace VIZ.Framework.Common ...@@ -81,6 +90,28 @@ namespace VIZ.Framework.Common
public static readonly DependencyProperty TempNumTextProperty = public static readonly DependencyProperty TempNumTextProperty =
DependencyProperty.Register(nameof(TempNumText), typeof(int), typeof(CountdownDisplayControl)); DependencyProperty.Register(nameof(TempNumText), typeof(int), typeof(CountdownDisplayControl));
#region IsUpdate
public static readonly DependencyProperty IsUpdateProperty =
DependencyProperty.Register(nameof(IsUpdate), typeof(bool), typeof(CountdownDisplayControl), new PropertyMetadata(true, OnIsUpdateChanged));
public bool IsUpdate
{
get => (bool)GetValue(IsEnabledProperty);
set => SetValue(IsEnabledProperty, value);
}
static void OnIsUpdateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
{
((CountdownDisplayControl)sender).IsUpdateChanged(args);
}
protected void IsUpdateChanged(DependencyPropertyChangedEventArgs e)
{
if ((bool)e.NewValue)
{
this.TimeDisplayControl_Loaded();
}
}
#endregion
/// <summary> /// <summary>
/// 更新 /// 更新
/// </summary> /// </summary>
...@@ -88,16 +119,20 @@ namespace VIZ.Framework.Common ...@@ -88,16 +119,20 @@ namespace VIZ.Framework.Common
private void update() private void update()
{ {
TaskInfo info = this.updateTaskInfo; TaskInfo info = this.updateTaskInfo;
if (info == null) if (info == null) return;
return;
while (!info.IsCancel) while (!info.IsCancel)
{ {
WPFHelper.BeginInvoke(() => if (NumText == 0)
{ {
if (NumText == 1) //NumText = TempNumText + 1;
NumText = TempNumText + 1; this.Dispose();
}
NumText--; NumText--;
WPFHelper.BeginInvoke(() =>
{
this.Text = NumText.ToString(); this.Text = NumText.ToString();
}); });
......
 //------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}
C:\Projects\FGOUT\VIZ.Framework\VIZ.Framework.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs 
FC:\Projects\FGOUT\VIZ.Framework\VIZ.Framework.Common\MessageBox\MessageBoxEx.xaml;; FC:\Projects\FGOUT\VIZ.Framework\VIZ.Framework.Common\MessageBox\MessageBoxEx.xaml;;
FC:\Projects\FGOUT\VIZ.Framework\VIZ.Framework.Common\MessageBox\MessageBoxExWindow.xaml;; FC:\Projects\FGOUT\VIZ.Framework\VIZ.Framework.Common\MessageBox\MessageBoxExWindow.xaml;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment