Commit 51cd801d by 鲁志-悦动

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

parent d00627f4
......@@ -809,7 +809,7 @@
</b:Interaction.Triggers>
</TextBox>
<TextBox
<!--<TextBox
Width="30"
Background="Yellow"
BorderBrush="Red"
......@@ -818,7 +818,7 @@
Foreground="Black"
IsEnabled="False"
Style="{StaticResource TextBoxStyle}"
Text="{Binding AutoSendCount, Mode=TwoWay}" />
Text="{Binding AutoSendCount, Mode=TwoWay}" />-->
<!--<ListBox
HorizontalAlignment="Stretch"
......@@ -1535,6 +1535,22 @@
VideoBorderBrush="Yellow" />
</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
Grid.Row="2"
Width="740"
......
......@@ -271,10 +271,14 @@ namespace VIZ.FGOUT.Module
private void AutoSendIntervalTimeChanged(AutoSendModel model)
{
_tempAutoSendCount = AutoSendCount = AutoSendIntervalTime - 1;
WPFHelper.BeginInvoke(() =>
{
AutoSendCount = AutoSendIntervalTime;
//_tempAutoSendCount = AutoSendCount = AutoSendIntervalTime - 1;
//AutoSendCount = (model.Interval / 1000);
_autoSend_Timer.Stop();
_autoSend_Timer.Start();
});
//WPFHelper.BeginInvoke(() =>
//{
......@@ -435,9 +439,9 @@ namespace VIZ.FGOUT.Module
try
{
//UIDispatcher = DispatcherHelper.CheckBeginInvokeOnUI;
DispatcherHelper.UIDispatcher.InvokeAsync(() =>
//DispatcherHelper.UIDispatcher.InvokeAsync(() =>
//Application.Current.Dispatcher.BeginInvoke(new Action(() =>
//WPFHelper.BeginInvoke(() =>
WPFHelper.BeginInvoke(() =>
{
if (AutoSendCount == 0)
{
......@@ -452,10 +456,10 @@ namespace VIZ.FGOUT.Module
else
{
//1
//AutoSendCount--;
AutoSendCount--;
//this.RaisePropertyChanged(nameof(AutoSendCount));
//2
AutoSendCount -= 1;
//AutoSendCount -= 1;
}
//});
//}));
......@@ -1506,6 +1510,8 @@ namespace VIZ.FGOUT.Module
//TimeCountActVisibility = Visibility.Collapsed;
//TimeCountDefaultVisibility = Visibility.Visible;
AutoSendCount = AutoSendIntervalTime;
}
#endregion
......
......@@ -22,6 +22,9 @@ namespace VIZ.FGOUT.Module
/// <param name="msg"></param>
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();
if (config == null)
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>
// 此代码由工具生成。
......
#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>
// 此代码由工具生成。
......
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\NDIPreviewView\View\NDIPreviewView.xaml;;
......
......@@ -55,5 +55,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
......@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using VIZ.Framework.Core;
using VIZ.Framework.Domain;
......@@ -26,7 +27,7 @@ namespace VIZ.Framework.Common
{
ApplicationDomain.ObjectPoolManager.Add($"CountdownDisplayControl__{Guid.NewGuid()}", this);
this.Loaded += TimeDisplayControl_Loaded;
//this.Loaded += TimeDisplayControl_Loaded;
}
/// <summary>
......@@ -64,6 +65,14 @@ namespace VIZ.Framework.Common
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
{
get { return (int)GetValue(NumTextProperty); }
......@@ -81,6 +90,28 @@ namespace VIZ.Framework.Common
public static readonly DependencyProperty TempNumTextProperty =
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>
......@@ -88,16 +119,20 @@ namespace VIZ.Framework.Common
private void update()
{
TaskInfo info = this.updateTaskInfo;
if (info == null)
return;
if (info == null) return;
while (!info.IsCancel)
{
WPFHelper.BeginInvoke(() =>
if (NumText == 0)
{
if (NumText == 1)
NumText = TempNumText + 1;
//NumText = TempNumText + 1;
this.Dispose();
}
NumText--;
WPFHelper.BeginInvoke(() =>
{
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\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