Commit 889ad032 by 鲁志-悦动

缓存帧给到CAM_3 Replay窗口功能实现

parent e90e9aa0
......@@ -30,15 +30,4 @@ namespace VIZ.FGOUT.Connection
/// </summary>
public VideoData data { get; set; }
}
/// <summary>
/// Replay状态
/// </summary>
//public enum ReplayStatus
//{
// Stop,
// PreStart,
// Start,
// ReStart
//}
}
......@@ -200,7 +200,7 @@
Maximum="{Binding SliderMaxValue, Mode=TwoWay}"
TickFrequency="1"
TickPlacement="BottomRight"
Visibility="{Binding SliderVisibility, Mode=TwoWay}"
Visibility="{Binding SliderVisibility}"
Value="{Binding SliderValue, Mode=TwoWay}">
<b:Interaction.Triggers>
<b:EventTrigger EventName="ValueChanged">
......@@ -916,14 +916,17 @@
MouseLeftButtonDown="cam1_MouseLeftButtonDown"
NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_1}"
VideoBorderBrush="#46AFA0" />
<local:NDIView
x:Name="cam3"
<Grid
Grid.Row="3"
Grid.Column="0"
Margin="10"
IsHiddenSetting="True"
NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_3}" />
Visibility="{Binding SliderVisibility}">
<local:NDIView
x:Name="cam3"
Margin="10"
IsHiddenSetting="True"
NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_3}" />
</Grid>
<StackPanel Grid.Row="1" Grid.Column="1">
<Button
......
......@@ -306,10 +306,6 @@
<Border
x:Name="Border"
Background="White"
KeyDown="Border_OnKeyDown"
KeyUp="Border_OnKeyUp"
PreviewKeyDown="Border_OnPreviewKeyDown"
PreviewKeyUp="Border_OnPreviewKeyUp"
PreviewMouseLeftButtonDown="Border_MouseLeftButtonDown"
PreviewMouseLeftButtonUp="Border_MouseLeftButtonUp"
PreviewMouseMove="Border_MouseMove"
......
......@@ -517,25 +517,5 @@ namespace VIZ.FGOUT.Module
//}
polygon = null;
}
private void Border_OnPreviewKeyDown(object sender, KeyEventArgs e)
{
throw new System.NotImplementedException();
}
private void Border_OnKeyDown(object sender, KeyEventArgs e)
{
throw new System.NotImplementedException();
}
private void Border_OnKeyUp(object sender, KeyEventArgs e)
{
throw new System.NotImplementedException();
}
private void Border_OnPreviewKeyUp(object sender, KeyEventArgs e)
{
throw new System.NotImplementedException();
}
}
}
......@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using VIZ.FGOUT.Connection;
using VIZ.FGOUT.Domain;
using VIZ.FGOUT.Storage;
......@@ -152,22 +153,29 @@ namespace VIZ.FGOUT.Module
if (view == null)
return;
//不能这么判断,会崩,要用WPFHelper.Invoke这个
//if (view.NDIKey == NDIViewKeys.CAM_3)
//{
//}
//Replay
if (view.vm.IsReplay)
{
if (view.vm.IsSliderValueChanged)
{
Queue<MatExtend> buffer = _frameBuffer.GetFrames();
//Queue<Mat> buffer = _frameBuffer.GetFrames();
//Queue<DataStreamExtend> buffer = _frameBuffer.GetFrames();
if (buffer.Count > 0)
{
var index = view.vm.SliderValue;
//if (index >= 150) index = 149;
if (index >= 500) index = 499;
if ((buffer.Count - 1) >= index)
{
var dse = buffer.ElementAt(index);
#region 注释的代码
//缓存策略2
//将低分辨率的Mat对象转换为DataStream
//byte[] lowResolutionData = new byte[dse.Width * dse.Height * 4];
......@@ -183,6 +191,8 @@ namespace VIZ.FGOUT.Module
//之前的逻辑好奇怪,时间戳也要保存到队列的,不能用当前的时间戳
//dsExtend.TimeStamp = NDIViewModel.ReplayTimeStamp = e.Frame.TimeStamp;
#endregion
var lowResolutionData = new byte[dse.Mat.Width * dse.Mat.Height * 4];
var newLength = lowResolutionData.Length;
Marshal.Copy(dse.Mat.Data, lowResolutionData, 0, newLength);
......@@ -196,9 +206,13 @@ namespace VIZ.FGOUT.Module
};
dsExtend.DataStream.Write(lowResolutionData, 0, newLength);
dsExtend.DataStream.Position = 0;
// 更新画面
view.video.UpdateVideoFrame(dsExtend, true);
// Replay更新画面
WPFHelper.Invoke(() =>
{
var view3 = this.FindChild<NDIView>(Application.Current.MainWindow, "cam3");
view3.video.UpdateVideoFrame(dsExtend, true);
});
//view.video.UpdateVideoFrame(dse, true);
}
}
......@@ -206,6 +220,8 @@ namespace VIZ.FGOUT.Module
}
else
{
#region 注释的代码
//缓存策略1
//dsExtend.DataStream = DeepCloneDataStream(e.Frame.DataStream);
//dsExtend.Width = e.Frame.Width;
......@@ -213,6 +229,8 @@ namespace VIZ.FGOUT.Module
//dsExtend.TimeStamp = e.Frame.TimeStamp;
//_frameBuffer.AddFrame(dsExtend);
#endregion
//缓存策略2
// 将视频帧转换为Mat对象
//var t1 = DateTime.Now;
......@@ -221,7 +239,7 @@ namespace VIZ.FGOUT.Module
// 将帧缩放到低分辨率
var resizedFrame = new Mat();
//Cv2.Resize(mat, resizedFrame, new Size(mat.Width / 4 , mat.Height / 4));
Cv2.Resize(mat, resizedFrame, new Size(mat.Width, mat.Height));
Cv2.Resize(mat, resizedFrame, new OpenCvSharp.Size(mat.Width, mat.Height));
//时间戳获取
timecode = e.Frame.TimeStamp;
//_frameBuffer.AddFrame(resizedFrame);
......@@ -229,6 +247,8 @@ namespace VIZ.FGOUT.Module
// 释放视频帧资源
mat.Dispose();
#region 注释的代码
//原始帧直接放到队列
//var mat = new Mat(e.Frame.Height, e.Frame.Width, MatType.CV_8UC4, e.Frame.DataStream.DataPointer);
//_frameBuffer.AddFrame(mat);
......@@ -256,43 +276,46 @@ namespace VIZ.FGOUT.Module
//dsExtend.TimeStamp = NDIViewModel.ReplayTimeStamp = e.Frame.TimeStamp;
//view.video.UpdateVideoFrame(dsExtend);
// 更新画面
view.video.UpdateVideoFrame(e.Frame);
#endregion
}
// 更新画面
view.video.UpdateVideoFrame(e.Frame);
// 更新手动裁切框
// 仅手动模式下处理 & 居中模式下处理 & 需要进行裁切时才处理
if ((this.StrategyMode == AlgorithmStrategyMode.center_mode || this.StrategyMode == AlgorithmStrategyMode.manual_mode) && this.IsUseClip)
this.UpdateClipBoxWithManualAndCenter();
// 获取将要发送的裁切数据, 无论什么模式均要发送
Navigation3DSmoothWithSavitzkyGolayResult sendValue = this.ManualController.GetSavitzkyGolayValue(e.Frame.TimeStamp, this.ClipBoxX + ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH / 2);
// 如果当前模式为手动模式或居中模式且处于接收裁切信号状态,并且需要进行裁切,那么发送手动裁切信号 && this.ViewStatus == NDIViewStatus.CropRoi
if (e.Frame != null && this.IsUseClip
&& (this.StrategyMode == AlgorithmStrategyMode.center_mode || this.StrategyMode == AlgorithmStrategyMode.manual_mode))
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(this.ViewKey);
if (manager == null)
return;
List<int> roi = this.GetManulRoi();
// 向算法发送裁切框
if (this.StrategyMode == AlgorithmStrategyMode.center_mode)
AlgorithmSender.CenterMode(manager, this.ID, this.ViewConfig.IsSendToCrop, roi, this.AlgorithmConfig.SmoothCoeff);
else if (this.StrategyMode == AlgorithmStrategyMode.manual_mode)
AlgorithmSender.ManualMode(manager, this.ID, this.ViewConfig.IsSendToCrop, roi, this.AlgorithmConfig.SmoothCoeff);
// 在需要发送裁切框时
//if (this.viewConfig.IsSendToCrop)
//{
// UdpEndpointManager manager_clip = ConnectionManager.UdpConnection.GetEndpointManager($"{this.ViewKey}__CLIP");
// if (manager_clip != null)
// {
// ClipSender.CropRoi(manager_clip, 0, this.GetManulRoi((int)sendValue.Value), ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH, e.Frame.Height, sendValue.TimeCode);
// }
//}
}
// 更新手动裁切框
// 仅手动模式下处理 & 居中模式下处理 & 需要进行裁切时才处理
if ((this.StrategyMode == AlgorithmStrategyMode.center_mode || this.StrategyMode == AlgorithmStrategyMode.manual_mode) && this.IsUseClip)
this.UpdateClipBoxWithManualAndCenter();
// 获取将要发送的裁切数据, 无论什么模式均要发送
Navigation3DSmoothWithSavitzkyGolayResult sendValue = this.ManualController.GetSavitzkyGolayValue(e.Frame.TimeStamp, this.ClipBoxX + ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH / 2);
// 如果当前模式为手动模式或居中模式且处于接收裁切信号状态,并且需要进行裁切,那么发送手动裁切信号 && this.ViewStatus == NDIViewStatus.CropRoi
if (e.Frame != null && this.IsUseClip
&& (this.StrategyMode == AlgorithmStrategyMode.center_mode || this.StrategyMode == AlgorithmStrategyMode.manual_mode))
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(this.ViewKey);
if (manager == null)
return;
List<int> roi = this.GetManulRoi();
// 向算法发送裁切框
if (this.StrategyMode == AlgorithmStrategyMode.center_mode)
AlgorithmSender.CenterMode(manager, this.ID, this.ViewConfig.IsSendToCrop, roi, this.AlgorithmConfig.SmoothCoeff);
else if (this.StrategyMode == AlgorithmStrategyMode.manual_mode)
AlgorithmSender.ManualMode(manager, this.ID, this.ViewConfig.IsSendToCrop, roi, this.AlgorithmConfig.SmoothCoeff);
// 在需要发送裁切框时
//if (this.viewConfig.IsSendToCrop)
//{
// UdpEndpointManager manager_clip = ConnectionManager.UdpConnection.GetEndpointManager($"{this.ViewKey}__CLIP");
// if (manager_clip != null)
// {
// ClipSender.CropRoi(manager_clip, 0, this.GetManulRoi((int)sendValue.Value), ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH, e.Frame.Height, sendValue.TimeCode);
// }
//}
// 统计裁切FPS
this.ClipFPS.CalcFps();
}
......
......@@ -237,98 +237,6 @@ namespace VIZ.FGOUT.Module
MessageBoxEx.ShowDialog("Replay Start OK.");
}
//CleanPlaceModel cpModel = new CleanPlaceModel { CleanPlace = true };
/// <summary>
/// 处理算法初始化完成消息
/// 把在message里的方法拿过来试一下
/// </summary>
/// <param name="msg">消息</param>
//private void OnAlgorithmMessage__checked_ok(AlgorithmMessage__checked_ok msg)
//{
// // 算法ID与视图绑定一一对应
// if (msg.AlgorithmID != this.ID)
// return;
// // 执行初始化完成
// if (!this.AlgorithmControllerDic.TryGetValue(this.StrategyType, out IAlgorithmController controller))
// return;
// // 初始化算法
// controller.InitAlgorithm();
// if (!this.IsUseClip)
// {
// this.ViewStatus = NDIViewStatus.CropRoi;
// controller.ChangeNoMode();
// }
// else
// {
// // 根据当前模式处理
// switch (this.StrategyMode)
// {
// //case AlgorithmStrategyMode.center_mode:
// // controller.ChangeCenterMode();
// // this.ViewStatus = NDIViewStatus.CropRoi;
// // break;
// case AlgorithmStrategyMode.manual_mode:
// controller.ChangeManualMode();
// this.ViewStatus = NDIViewStatus.CropRoi;
// break;
// case AlgorithmStrategyMode.auto_mode:
// controller.CheckOk();
// break;
// }
// }
// //清除开始、结束、无效位置标记
// this.CleanPlace(cpModel);
// //目前来看这段代码没起作用
// SystemConfig config = ApplicationDomainEx.LiteDbContext.SystemConfig.FindAll().FirstOrDefault();
// if (this.ViewKey == NDIViewKeys.CAM_1)
// {
// // 是否显示目标裁切框
// this.IsShowAlgorithmTargetBox = config.IsShowAlgorithmTargetBox;
// SetPlaceNewConfig setPlaceNewConfig =
// ApplicationDomainEx.LiteDbContext.SetPlaceNewConfig.FindOne(p =>
// p.SportCode == this.viewConfig.GameName);
// if (setPlaceNewConfig == null) return;
// NDIView view = this.GetView<NDIView>();
// if (view == null)
// return;
// if (setPlaceNewConfig.StartPlace.Count > 0)
// {
// view.polygonsStart = setPlaceNewConfig.StartPlace;
// foreach (var points in setPlaceNewConfig.StartPlace)
// AddPoints(view, points, Brushes.Blue);
// }
// if (setPlaceNewConfig.EndPlace.Count > 0)
// {
// view.polygonsEnd = setPlaceNewConfig.EndPlace;
// foreach (var points in setPlaceNewConfig.EndPlace)
// AddPoints(view, points, Brushes.Green);
// }
// if (setPlaceNewConfig.InvlidPlace.Count > 0)
// {
// view.rectsInvalid = setPlaceNewConfig.InvlidPlace;
// foreach (var points in setPlaceNewConfig.InvlidPlace)
// AddRects(view, points, Brushes.Red);
// }
// }
// //====================================================================
// // CODE: SYSTEM_LOG | 记录日志
// //====================================================================
// // 记录日志: 算法初始化完成
// string system_log = string.Format(SystemLogStringFormats.ALGORITHM_CHECKED_OK, this.StrategyType.GetDescription(), this.ViewKey);
// ApplicationDomainEx.CsvContext.AppendSystemLog(this.ViewKey, this.DisplayName, system_log);
// //====================================================================
//}
private void UESetting(UESettingModel ueSettingModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
......
......@@ -42,7 +42,7 @@ namespace VIZ.FGOUT.Module
this.InitData(NDIViewKeys.CAM_1);
this.InitData(NDIViewKeys.CAM_2);
//this.InitData(NDIViewKeys.CAM_3);
this.InitData(NDIViewKeys.CAM_3);
//this.InitData(NDIViewKeys.CAM_4);
return true;
}
......
......@@ -90,7 +90,7 @@ namespace VIZ.FGOUT.Module
VideoStreamManager.Get<NDIStream>(ServiceKeys.CAM_1)?.Dispose();
VideoStreamManager.Get<NDIStream>(ServiceKeys.CAM_2)?.Dispose();
//VideoStreamManager.Get<NDIStream>(ServiceKeys.CAM_3)?.Dispose();
VideoStreamManager.Get<NDIStream>(ServiceKeys.CAM_3)?.Dispose();
//VideoStreamManager.Get<NDIStream>(ServiceKeys.CAM_4)?.Dispose();
}
}
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "28509F9D91F5A23399E667A1F5BE360C922E1FEAAA4CD5088F5422F106107D5F"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5AF01E6CDCAAA9BAF5ACE6770F4F3A0D5B77D1414CE9039D69C9FAEE8A4891DD"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -82,7 +82,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 921 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 924 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam3;
......@@ -90,7 +90,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 968 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 971 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "28509F9D91F5A23399E667A1F5BE360C922E1FEAAA4CD5088F5422F106107D5F"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5AF01E6CDCAAA9BAF5ACE6770F4F3A0D5B77D1414CE9039D69C9FAEE8A4891DD"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -82,7 +82,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 921 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 924 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam3;
......@@ -90,7 +90,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 968 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 971 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......
#pragma checksum "..\..\..\..\..\NDIView\View\NDIView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "FD917AFD468A76D70D8AFF41694507D1906B6931E0C04B739524F9FD6AB674CF"
#pragma checksum "..\..\..\..\..\NDIView\View\NDIView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "10D3B59B06037EA036639900A7AA9D066CB2339D77995FC1F9E6159EEC9031B7"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -68,7 +68,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 327 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 323 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.Framework.Common.VideoControl video;
......@@ -76,7 +76,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 333 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 329 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Canvas canvas1;
......@@ -84,7 +84,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 418 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 414 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button _Setting_;
......@@ -92,7 +92,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 439 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 435 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button _RestartBtn_;
......@@ -100,7 +100,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 453 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 449 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button _StopBtn_;
......@@ -144,48 +144,24 @@ namespace VIZ.FGOUT.Module {
this.Border = ((System.Windows.Controls.Border)(target));
#line 309 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.KeyDown += new System.Windows.Input.KeyEventHandler(this.Border_OnKeyDown);
#line default
#line hidden
#line 310 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.KeyUp += new System.Windows.Input.KeyEventHandler(this.Border_OnKeyUp);
#line default
#line hidden
#line 311 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.Border_OnPreviewKeyDown);
#line default
#line hidden
#line 312 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewKeyUp += new System.Windows.Input.KeyEventHandler(this.Border_OnPreviewKeyUp);
#line default
#line hidden
#line 313 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Border_MouseLeftButtonDown);
#line default
#line hidden
#line 314 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 310 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Border_MouseLeftButtonUp);
#line default
#line hidden
#line 315 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 311 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseMove += new System.Windows.Input.MouseEventHandler(this.Border_MouseMove);
#line default
#line hidden
#line 316 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 312 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Border_OnPreviewMouseRightButtonDown);
#line default
......
#pragma checksum "..\..\..\..\..\NDIView\View\NDIView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "FD917AFD468A76D70D8AFF41694507D1906B6931E0C04B739524F9FD6AB674CF"
#pragma checksum "..\..\..\..\..\NDIView\View\NDIView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "10D3B59B06037EA036639900A7AA9D066CB2339D77995FC1F9E6159EEC9031B7"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -68,7 +68,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 327 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 323 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.Framework.Common.VideoControl video;
......@@ -76,7 +76,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 333 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 329 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Canvas canvas1;
......@@ -84,7 +84,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 418 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 414 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button _Setting_;
......@@ -92,7 +92,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 439 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 435 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button _RestartBtn_;
......@@ -100,7 +100,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 453 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 449 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button _StopBtn_;
......@@ -144,48 +144,24 @@ namespace VIZ.FGOUT.Module {
this.Border = ((System.Windows.Controls.Border)(target));
#line 309 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.KeyDown += new System.Windows.Input.KeyEventHandler(this.Border_OnKeyDown);
#line default
#line hidden
#line 310 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.KeyUp += new System.Windows.Input.KeyEventHandler(this.Border_OnKeyUp);
#line default
#line hidden
#line 311 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.Border_OnPreviewKeyDown);
#line default
#line hidden
#line 312 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewKeyUp += new System.Windows.Input.KeyEventHandler(this.Border_OnPreviewKeyUp);
#line default
#line hidden
#line 313 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Border_MouseLeftButtonDown);
#line default
#line hidden
#line 314 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 310 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Border_MouseLeftButtonUp);
#line default
#line hidden
#line 315 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 311 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseMove += new System.Windows.Input.MouseEventHandler(this.Border_MouseMove);
#line default
#line hidden
#line 316 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 312 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Border_OnPreviewMouseRightButtonDown);
#line default
......
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;;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NewTek;
using NewTek;
namespace VIZ.Framework.Common
{
......
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharpDX.Mathematics.Interop;
namespace VIZ.Framework.Common
{
......
//------------------------------------------------------------------------------
// <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;;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace VIZ.Framework.Core
{
......@@ -40,6 +36,28 @@ namespace VIZ.Framework.Core
}
/// <summary>
/// 搜索指定名称的子元素
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="obj"></param>
/// <param name="name"></param>
/// <returns></returns>
public T FindChild<T>(DependencyObject obj, string name) where T : FrameworkElement
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
{
DependencyObject child = VisualTreeHelper.GetChild(obj, i);
if (child != null && child is T && (child as T).Name.Equals(name))
return (T)child;
T childOfChild = FindChild<T>(child, name);
if (childOfChild != null)
return childOfChild;
}
return null;
}
/// <summary>
/// 获取窗口
/// </summary>
/// <returns>窗口</returns>
......
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