Commit 2e633d23 by liulongfei

项目还原

parent 72a43a9c
...@@ -203,6 +203,22 @@ ...@@ -203,6 +203,22 @@
<Compile Include="VideoControl\Control\Plugin\ManualCorrection\ManualCorrectionPlugin.cs" /> <Compile Include="VideoControl\Control\Plugin\ManualCorrection\ManualCorrectionPlugin.cs" />
<Compile Include="VideoControl\Recording\VideoControlRecordingFrame.cs" /> <Compile Include="VideoControl\Recording\VideoControlRecordingFrame.cs" />
<Compile Include="VideoControl\Recording\VideoControlRecording.cs" /> <Compile Include="VideoControl\Recording\VideoControlRecording.cs" />
<Compile Include="VideoControl\Stream\BMDStream\BMDStream.cs" />
<Compile Include="VideoControl\Stream\BMDStream\BMDStreamOption.cs" />
<Compile Include="VideoControl\Stream\BMDStream\BMDStreamTaskBase.cs" />
<Compile Include="VideoControl\Stream\BMDStream\BMDStreamTaskNames.cs" />
<Compile Include="VideoControl\Stream\BMDStream\BMDStreamVideoFrame.cs" />
<Compile Include="VideoControl\Stream\BMDStream\Task\BMDStreamExecuteVideoTask.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\Core\DeckLinkDeviceNotification.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\Core\DeckLinkInputDevice.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\Core\DeckLinkManager.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\Core\DeckLinkVideoFrame.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\DeckLinkStream.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\DeckLinkStreamOption.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\DeckLinkStreamTaskBase.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\DeckLinkStreamTaskNames.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\DeckLinkStreamVideoFrame.cs" />
<Compile Include="VideoControl\Stream\DeckLinkStream\Task\DeckLinkStreamExecuteVideoTask.cs" />
<Compile Include="VideoControl\Sync\IVideoControlSync.cs" /> <Compile Include="VideoControl\Sync\IVideoControlSync.cs" />
<Compile Include="VideoControl\Sync\VideoControlSyncEventArgs.cs" /> <Compile Include="VideoControl\Sync\VideoControlSyncEventArgs.cs" />
<Compile Include="VideoControl\Sync\VideoControlSyncQueue.cs" /> <Compile Include="VideoControl\Sync\VideoControlSyncQueue.cs" />
...@@ -305,5 +321,16 @@ ...@@ -305,5 +321,16 @@
<ItemGroup> <ItemGroup>
<Folder Include="VideoControl\Widgets\" /> <Folder Include="VideoControl\Widgets\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<COMReference Include="DeckLinkAPI">
<Guid>{D864517A-EDD5-466D-867D-C819F1C052BB}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using log4net;
namespace VIZ.Framework.Common
{
/// <summary>
/// 板卡流
/// </summary>
public class BMDStream : VideoStreamBase<BMDStreamOption>
{
/// <summary>
/// 日志
/// </summary>
private readonly static ILog log = LogManager.GetLogger(typeof(BMDStream));
/// <summary>
/// NDI流
/// </summary>
/// <param name="option">设置</param>
public BMDStream(BMDStreamOption option)
: base(option)
{
// 处理视频帧任务
this.TaskDic.Add(BMDStreamTaskNames.EXECUTE_VIDEO, new BMDStreamExecuteVideoTask(this));
}
/* ========================================================================================================= */
/* === Const === */
/* ========================================================================================================= */
/// <summary>
/// 视频接收回调
/// </summary>
/// <param name="name">名称</param>
/// <param name="data">视频帧数据 BGRA 8bit</param>
/// <param name="width">视频宽度</param>
/// <param name="height">视频高度</param>
public delegate void SendVideoCallBack(string name, IntPtr data, int width, int height);
/// <summary>
/// 测试回调
/// </summary>
/// <param name="name">名称</param>
public delegate void TestCallBack(string name);
/// <summary>
/// 初始化板卡
/// </summary>
/// <param name="callback">接收视频回调</param>
/// <returns></returns>
[DllImport("libSDIPackage.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool InitBMD(SendVideoCallBack callback);
/// <summary>
/// 测试
/// </summary>
/// <param name="callback">回调</param>
[DllImport("libSDIPackage.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void Test(TestCallBack callback);
/* ========================================================================================================= */
/* === Property === */
/* ========================================================================================================= */
/* ========================================================================================================= */
/* === Internal Field === */
/* ========================================================================================================= */
/* ========================================================================================================= */
/* === Field === */
/* ========================================================================================================= */
/// <summary>
/// 任务池
/// </summary>
private Dictionary<BMDStreamTaskNames, BMDStreamTaskBase> TaskDic = new Dictionary<BMDStreamTaskNames, BMDStreamTaskBase>();
/* ========================================================================================================= */
/* === Function === */
/* ========================================================================================================= */
/// <summary>
/// 开始
/// </summary>
public void Start()
{
// 启动NDI视频帧处理任务
this.TaskDic[BMDStreamTaskNames.EXECUTE_VIDEO].Start();
// 初始化板卡
InitBMD(new SendVideoCallBack(this.ExecuteSendVideoCallBack));
}
/// <summary>
/// 停止
/// </summary>
public void Stop()
{
// 停止所有任务
foreach (var task in this.TaskDic.Values)
{
task.Stop();
}
// TODO: 停止板卡
}
/// <summary>
/// 销毁
/// </summary>
public override void Dispose()
{
this.Stop();
}
/// <summary>
/// 执行视频帧接收回调函数
/// </summary>
/// <param name="name">名称</param>
/// <param name="data">视频帧数据 BGRA 8bit</param>
/// <param name="width">视频宽度</param>
/// <param name="height">视频高度</param>
private void ExecuteSendVideoCallBack(string name, IntPtr data, int width, int height)
{
try
{
BMDStreamVideoFrame videoFrame = new BMDStreamVideoFrame();
videoFrame.Width = width;
videoFrame.Height = height;
videoFrame.Length = width * height * 4;
//videoFrame.TimeStamp =
videoFrame.DataStream = new SharpDX.DataStream(videoFrame.Length, true, true);
unsafe
{
Buffer.MemoryCopy(data.ToPointer(), videoFrame.DataStream.DataPointer.ToPointer(), videoFrame.Length, videoFrame.Length);
}
this.VideoFrameQueue.Enqueue(videoFrame);
Thread.Sleep(10);
}
catch (Exception ex)
{
log.Error(ex);
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// 板卡流参数
/// </summary>
public class BMDStreamOption : VideoStreamOptionBase
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// 板卡流
/// </summary>
public abstract class BMDStreamTaskBase : VideoStreamTaskBase
{
/// <summary>
/// 板卡流
/// </summary>
/// <param name="stream">板卡流</param>
public BMDStreamTaskBase(BMDStream stream)
{
this.Stream = stream;
}
/// <summary>
/// 任务名称
/// </summary>
public abstract BMDStreamTaskNames Name { get; }
/// <summary>
/// 板卡流
/// </summary>
public BMDStream Stream { get; private set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// NDI流任务名称
/// </summary>
public enum BMDStreamTaskNames
{
/// <summary>
/// 接收视频
/// </summary>
RECV_VIDEO,
/// <summary>
/// 处理视频帧
/// </summary>
EXECUTE_VIDEO
}
}
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// 板卡视频帧
/// </summary>
public class BMDStreamVideoFrame : VideoFrameBase
{
/// <summary>
/// 板卡视频帧
/// </summary>
public BMDStreamVideoFrame()
{ }
/// <summary>
/// 板卡视频帧
/// </summary>
/// <param name="color">颜色</param>
public BMDStreamVideoFrame(Scalar color) : base(color)
{ }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using NewTek;
namespace VIZ.Framework.Common
{
/// <summary>
/// 处理板卡视频帧任务
/// </summary>
public class BMDStreamExecuteVideoTask : BMDStreamTaskBase
{
/// <summary>
/// 处理板卡视频帧任务
/// </summary>
/// <param name="stream">板卡流</param>
public BMDStreamExecuteVideoTask(BMDStream stream) : base(stream)
{
}
/// <summary>
/// 任务名称
/// </summary>
public override BMDStreamTaskNames Name => BMDStreamTaskNames.EXECUTE_VIDEO;
/// <summary>
/// 执行
/// </summary>
protected override void Execute()
{
while (this.IsStarted)
{
if (this.Stream.VideoFrameQueue.Count <= this.Stream.Option.DelayFrame)
{
Thread.Sleep(2);
continue;
}
if (!this.Stream.VideoFrameQueue.TryDequeue(out IVideoFrame frame))
{
continue;
}
// 触发视频帧处理事件
this.Stream.TriggerExecuteVideoFrame(frame);
Thread.Sleep(10);
}
}
}
}
using System;
using System.Diagnostics;
using DeckLinkAPI;
namespace VIZ.Framework.Common
{
public class DeckLinkDiscoveryEventArgs : EventArgs
{
public readonly IDeckLink deckLink;
public DeckLinkDiscoveryEventArgs(IDeckLink deckLink)
{
this.deckLink = deckLink;
}
}
public class DeckLinkDeviceNotification : IDeckLinkDeviceNotificationCallback
{
private IDeckLinkDiscovery deviceDiscover;
public event EventHandler<DeckLinkDiscoveryEventArgs> deviceArrived;
public event EventHandler<DeckLinkDiscoveryEventArgs> deviceRemoved;
public DeckLinkDeviceNotification()
{
deviceDiscover = new CDeckLinkDiscovery();
deviceDiscover.InstallDeviceNotifications(this);
}
~DeckLinkDeviceNotification()
{
deviceDiscover.UninstallDeviceNotifications();
}
void IDeckLinkDeviceNotificationCallback.DeckLinkDeviceArrived(IDeckLink deckLinkDevice)
{
string deckLinkModelName;
deckLinkDevice.GetModelName(out deckLinkModelName);
Debug.WriteLine("Device arrived " + deckLinkModelName);
var handler = deviceArrived;
if (handler != null)
{
handler.Invoke(this, new DeckLinkDiscoveryEventArgs(deckLinkDevice));
}
}
void IDeckLinkDeviceNotificationCallback.DeckLinkDeviceRemoved(IDeckLink deckLinkDevice)
{
string deckLinkModelName;
deckLinkDevice.GetModelName(out deckLinkModelName);
Debug.WriteLine("Device removed " + deckLinkModelName);
var handler = deviceRemoved;
if (handler != null)
{
handler.Invoke(this, new DeckLinkDiscoveryEventArgs(deckLinkDevice));
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using DeckLinkAPI;
using log4net;
using VIZ.Framework.Core;
namespace VIZ.Framework.Common
{
/// <summary>
/// DeckLink 管理器任务项
/// </summary>
public class DeckLinkManagerTaskItem
{
/// <summary>
/// 行为
/// </summary>
public Action Action { get; set; }
/// <summary>
/// 异常
/// </summary>
public Exception Exception { get; set; }
/// <summary>
/// 是否处理完成
/// </summary>
public bool IsFinished { get; set; }
/// <summary>
/// 重置事件
/// </summary>
public ManualResetEvent ResetEvent { get; set; }
/// <summary>
/// 超时时间
/// </summary>
public TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds(5);
}
/// <summary>
/// DeckLink 管理器
/// </summary>
public static class DeckLinkManager
{
/// <summary>
/// 日志
/// </summary>
private readonly static ILog log = LogManager.GetLogger(typeof(DeckLinkManager));
/// <summary>
/// 设备发现
/// </summary>
public static DeckLinkDeviceNotification DeviceNotification { get; private set; }
/// <summary>
/// 设备信息集合
/// </summary>
public static List<DeckLinkInputDevice> DeckLinks { get; private set; } = new List<DeckLinkInputDevice>();
/// <summary>
/// DeckLink主线程
/// </summary>
private static Thread DeckLinkMainThread;
/// <summary>
/// DeckLink主线程信息
/// </summary>
private static TaskInfo DeckLinkMainThreadInfo;
/// <summary>
/// 任务队列
/// </summary>
private static ConcurrentQueue<DeckLinkManagerTaskItem> TaskQueue = new ConcurrentQueue<DeckLinkManagerTaskItem>();
/// <summary>
/// 开始执行
/// </summary>
/// <param name="action">行为</param>
public static void BeginInvoke(Action action)
{
DeckLinkManagerTaskItem task = new DeckLinkManagerTaskItem();
task.Action = action;
TaskQueue.Enqueue(task);
}
/// <summary>
/// 执行
/// </summary>
/// <param name="action">行为</param>
public static void Invoke(Action action)
{
DeckLinkManagerTaskItem task = new DeckLinkManagerTaskItem();
task.Action = action;
task.ResetEvent = new ManualResetEvent(false);
TaskQueue.Enqueue(task);
task.ResetEvent.WaitOne(task.Timeout);
}
/// <summary>
/// 初始化
/// </summary>
public static void Init()
{
DeckLinkMainThreadInfo = new TaskInfo();
DeckLinkMainThread = new Thread(ExecuteDeckLinkMainThread);
DeckLinkMainThread.SetApartmentState(ApartmentState.MTA);
DeckLinkMainThread.Start(DeckLinkMainThreadInfo);
Invoke(() =>
{
DeviceNotification = new DeckLinkDeviceNotification();
DeviceNotification.deviceArrived += DeviceNotification_deviceArrived;
DeviceNotification.deviceRemoved += DeviceNotification_deviceRemoved;
});
}
/// <summary>
/// 销毁
/// </summary>
public static void Dispose()
{
if (DeviceNotification != null)
{
DeviceNotification.deviceArrived -= DeviceNotification_deviceArrived;
DeviceNotification.deviceRemoved -= DeviceNotification_deviceRemoved;
DeviceNotification = null;
}
if (DeckLinkMainThreadInfo != null)
{
DeckLinkMainThreadInfo.IsCancel = true;
DeckLinkMainThreadInfo = null;
}
}
/// <summary>
/// 执行DeckLink主线程
/// </summary>
/// <param name="obj">参数</param>
[MTAThread]
private static void ExecuteDeckLinkMainThread(object obj)
{
try
{
TaskInfo info = obj as TaskInfo;
while (!info.IsCancel)
{
while (TaskQueue.Count > 0)
{
if (!TaskQueue.TryDequeue(out DeckLinkManagerTaskItem task))
{
Thread.Sleep(100);
continue;
}
try
{
task.Action();
task.ResetEvent?.Set();
}
catch (Exception ex)
{
log.Error(ex);
}
finally
{
task.IsFinished = true;
}
}
Thread.Sleep(100);
}
}
catch (Exception ex)
{
log.Error(ex);
}
}
/// <summary>
/// 设备发现
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private static void DeviceNotification_deviceArrived(object sender, DeckLinkDiscoveryEventArgs e)
{
lock (DeckLinks)
{
DeckLinks.Add(new DeckLinkInputDevice(e.deckLink));
}
}
/// <summary>
/// 设备移除
/// </summary>
private static void DeviceNotification_deviceRemoved(object sender, DeckLinkDiscoveryEventArgs e)
{
lock (DeckLinks)
{
DeckLinkInputDevice device = DeckLinks.FirstOrDefault(p => p.DeckLinkInput == e.deckLink);
if (device != null)
{
DeckLinks.Remove(device);
}
}
}
}
}
using DeckLinkAPI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// DeckLink视频帧
/// </summary>
public class DeckLinkVideoFrame : IDeckLinkVideoFrame
{
/// <summary>
/// 宽度
/// </summary>
public int Width { get; private set; }
/// <summary>
/// 高度
/// </summary>
public int Height { get; private set; }
/// <summary>
/// 标记
/// </summary>
public _BMDFrameFlags Flags{ get; private set; }
/// <summary>
/// 数据长度
/// </summary>
public int BufferBytes { get; private set; }
/// <summary>
/// 数据地址
/// </summary>
public IntPtr Buffer { get; private set; }
/// <summary>
/// DeckLink视频帧数据
/// </summary>
/// <param name="width">宽度</param>
/// <param name="height">高度</param>
/// <param name="flags">标记</param>
public DeckLinkVideoFrame(int width, int height, _BMDFrameFlags flags)
{
this.Width = width;
this.Height = height;
this.Flags = flags;
this.BufferBytes = width * height * 4;
// Allocate pixel buffer from unmanaged memory
this.Buffer = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(this.BufferBytes);
// Inform runtime of large unmanaged memory allocation for scheduling garbage collection
System.GC.AddMemoryPressure(this.BufferBytes);
}
~DeckLinkVideoFrame()
{
// Free pixel buffer from unmanaged memory
if (this.Buffer != IntPtr.Zero)
{
System.Runtime.InteropServices.Marshal.FreeCoTaskMem(this.Buffer);
System.GC.RemoveMemoryPressure(this.BufferBytes);
this.Buffer = IntPtr.Zero;
}
}
public int GetWidth()
{
return this.Width;
}
public int GetHeight()
{
return this.Height;
}
public int GetRowBytes()
{
return this.Width * 4;
}
public void GetBytes(out IntPtr buffer)
{
buffer = this.Buffer;
}
public _BMDFrameFlags GetFlags()
{
return this.Flags;
}
public _BMDPixelFormat GetPixelFormat()
{
return _BMDPixelFormat.bmdFormat8BitBGRA;
}
// Dummy implementations of remaining methods
void IDeckLinkVideoFrame.GetAncillaryData(out IDeckLinkVideoFrameAncillary ancillary)
{
throw new NotImplementedException();
}
void IDeckLinkVideoFrame.GetTimecode(_BMDTimecodeFormat format, out IDeckLinkTimecode timecode)
{
throw new NotImplementedException();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using log4net;
using DeckLinkAPI;
using System.Windows.Markup;
namespace VIZ.Framework.Common
{
/// <summary>
/// DeckLink流
/// </summary>
public class DeckLinkStream : VideoStreamBase<DeckLinkStreamOption>
{
/// <summary>
/// 日志
/// </summary>
private readonly static ILog log = LogManager.GetLogger(typeof(DeckLinkStream));
/// <summary>
/// DeckLink流
/// </summary>
/// <param name="device">DeckLink设备</param>
/// <param name="option">设置</param>
public DeckLinkStream(DeckLinkInputDevice device, DeckLinkStreamOption option)
: base(option)
{
// 处理视频帧任务
this.TaskDic.Add(DeckLinkStreamTaskNames.EXECUTE_VIDEO, new DeckLinkStreamExecuteVideoTask(this));
DeckLinkManager.Invoke(() =>
{
this.Conversion = new CDeckLinkVideoConversion();
this.Device = device;
});
}
/* ========================================================================================================= */
/* === Const === */
/* ========================================================================================================= */
/* ========================================================================================================= */
/* === Property === */
/* ========================================================================================================= */
/// <summary>
/// 是否正在捕获
/// </summary>
public bool IsCapturing { get; private set; }
/// <summary>
/// DeckLink设备
/// </summary>
internal DeckLinkInputDevice Device;
/// <summary>
///
/// </summary>
internal IDeckLinkVideoConversion Conversion;
/* ========================================================================================================= */
/* === Internal Field === */
/* ========================================================================================================= */
/* ========================================================================================================= */
/* === Field === */
/* ========================================================================================================= */
/// <summary>
/// 任务池
/// </summary>
private Dictionary<DeckLinkStreamTaskNames, DeckLinkStreamTaskBase> TaskDic = new Dictionary<DeckLinkStreamTaskNames, DeckLinkStreamTaskBase>();
/* ========================================================================================================= */
/* === Function === */
/* ========================================================================================================= */
/// <summary>
/// 开始
/// </summary>
public void Start()
{
// 启动NDI视频帧处理任务
this.TaskDic[DeckLinkStreamTaskNames.EXECUTE_VIDEO].Start();
DeckLinkManager.Invoke(() =>
{
this.Device.VideoFrameArrivedHandler += Device_VideoFrameArrivedHandler;
this.Device.StartCapture();
this.IsCapturing = true;
});
}
/// <summary>
/// 停止
/// </summary>
public void Stop()
{
if (!this.IsCapturing)
return;
// 停止所有任务
foreach (var task in this.TaskDic.Values)
{
task.Stop();
}
DeckLinkManager.Invoke(() =>
{
this.Device.VideoFrameArrivedHandler -= Device_VideoFrameArrivedHandler;
this.Device.StopCapture();
this.IsCapturing = false;
});
}
/// <summary>
/// 销毁
/// </summary>
public override void Dispose()
{
this.Stop();
}
/// <summary>
/// 处理视频帧
/// </summary>
private void Device_VideoFrameArrivedHandler(object sender, DeckLinkVideoFrameArrivedEventArgs e)
{
try
{
int width = e.videoFrame.GetWidth();
int height = e.videoFrame.GetHeight();
_BMDFrameFlags flags = e.videoFrame.GetFlags();
DeckLinkVideoFrame frame = new DeckLinkVideoFrame(width, height, flags);
this.Conversion.ConvertFrame(e.videoFrame, frame);
DeckLinkStreamVideoFrame videoFrame = new DeckLinkStreamVideoFrame();
videoFrame.Width = width;
videoFrame.Height = height;
videoFrame.Length = width * height * 4;
//videoFrame.TimeStamp =
videoFrame.DataStream = new SharpDX.DataStream(videoFrame.Length, true, true);
unsafe
{
Buffer.MemoryCopy(frame.Buffer.ToPointer(), videoFrame.DataStream.DataPointer.ToPointer(), videoFrame.Length, videoFrame.Length);
}
this.VideoFrameQueue.Enqueue(videoFrame);
}
catch (Exception ex)
{
log.Error(ex);
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// DeckLink流参数
/// </summary>
public class DeckLinkStreamOption : VideoStreamOptionBase
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// DeckLink流任务基类
/// </summary>
public abstract class DeckLinkStreamTaskBase : VideoStreamTaskBase
{
/// <summary>
/// DeckLink流任务基类
/// </summary>
/// <param name="stream">板卡流</param>
public DeckLinkStreamTaskBase(DeckLinkStream stream)
{
this.Stream = stream;
}
/// <summary>
/// 任务名称
/// </summary>
public abstract DeckLinkStreamTaskNames Name { get; }
/// <summary>
/// DeckLink流
/// </summary>
public DeckLinkStream Stream { get; private set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// DeckLink流任务名称
/// </summary>
public enum DeckLinkStreamTaskNames
{
/// <summary>
/// 接收视频
/// </summary>
RECV_VIDEO,
/// <summary>
/// 处理视频帧
/// </summary>
EXECUTE_VIDEO
}
}
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Common
{
/// <summary>
/// DeckLink视频帧
/// </summary>
public class DeckLinkStreamVideoFrame : VideoFrameBase
{
/// <summary>
/// DeckLink视频帧
/// </summary>
public DeckLinkStreamVideoFrame()
{ }
/// <summary>
/// DeckLink视频帧
/// </summary>
/// <param name="color">颜色</param>
public DeckLinkStreamVideoFrame(Scalar color) : base(color)
{ }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using NewTek;
namespace VIZ.Framework.Common
{
/// <summary>
/// 处理DeckLink视频帧任务
/// </summary>
public class DeckLinkStreamExecuteVideoTask : DeckLinkStreamTaskBase
{
/// <summary>
/// 处理DeckLink视频帧任务
/// </summary>
/// <param name="stream">DeckLink流</param>
public DeckLinkStreamExecuteVideoTask(DeckLinkStream stream) : base(stream)
{
}
/// <summary>
/// 任务名称
/// </summary>
public override DeckLinkStreamTaskNames Name => DeckLinkStreamTaskNames.EXECUTE_VIDEO;
/// <summary>
/// 执行
/// </summary>
protected override void Execute()
{
while (this.IsStarted)
{
if (this.Stream.VideoFrameQueue.Count <= this.Stream.Option.DelayFrame)
{
Thread.Sleep(2);
continue;
}
if (!this.Stream.VideoFrameQueue.TryDequeue(out IVideoFrame frame))
{
continue;
}
// 触发视频帧处理事件
this.Stream.TriggerExecuteVideoFrame(frame);
Thread.Sleep(10);
}
}
}
}
#include "Test.h"
/*
* @ 初始化3D鼠标
* @ hWnd: 窗口句柄
* @ Return: 是否初始化完成
*/
BOOL Test_CallBack(void(*func)(unsigned char* p))
{
func((unsigned char*)"hello word");
return TRUE;
}
\ No newline at end of file
#pragma once
#include <Windows.h>
extern "C" {
/// <summary>
/// Իص
/// </summary>
/// <returns>Ƿעɹ</returns>
__declspec(dllexport) BOOL Test_CallBack(void(*func)(unsigned char* p));
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<ProjectGuid>{d1aa6399-2000-42ba-a577-d50bc5fca393}</ProjectGuid> <ProjectGuid>{3c45130c-941c-4980-b524-d91b10163f4c}</ProjectGuid>
<RootNamespace>VIZFrameworkCoreNavigation3D</RootNamespace> <RootNamespace>VIZFrameworkCoreExpand</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
...@@ -40,13 +40,13 @@ ...@@ -40,13 +40,13 @@
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
...@@ -104,13 +104,10 @@ ...@@ -104,13 +104,10 @@
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>E:\Projects\VIZ.Framework\VIZ.Framework.Core.Navigation3D\Inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>E:\Projects\VIZ.Framework\VIZ.Framework.Core.Navigation3D\Lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>siapp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
...@@ -121,23 +118,19 @@ ...@@ -121,23 +118,19 @@
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>E:\Projects\VIZ.Framework\VIZ.Framework.Core.Navigation3D\Inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>E:\Projects\VIZ.Framework\VIZ.Framework.Core.Navigation3D\Lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>siapp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Navigation3D.h" /> <ClInclude Include="Test.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="Navigation3D.cpp" /> <ClCompile Include="Test.cpp" />
<ClCompile Include="window_test.cpp" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
......
<?xml version="1.0" encoding="utf-8"?>
...@@ -15,15 +15,12 @@ ...@@ -15,15 +15,12 @@
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Navigation3D.h"> <ClInclude Include="Test.h">
<Filter>头文件</Filter> <Filter>头文件</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="Navigation3D.cpp"> <ClCompile Include="Test.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="window_test.cpp">
<Filter>源文件</Filter> <Filter>源文件</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
......
/* SiCfg.h -- Configuration Saving Functions Header File
/* SiCfg.h -- Configuration Saving Functions Header File
*
* These functions are used to save and retrieve application configuration info
* in the registry.
*
* Strings are TCHARs. The defaut library is built with WCHARs. Src code is provided
* to rebuild it with ANSI chars if your application uses chars.
*
* Anything can be saved because everything is a string.
*
* We suggest that the following conventions be used:
*
* appName is the name of the application (e.g., "GUISync_SDK")
* modeName is the name of the application mode (e.g., "Sketch")
* configName is the name the user gives to the specific configuration, or a default,
* (e.g., "Electrical",
* "Mechanical 1",
* "Steve 1",
* "Small Assembly Work")
* settingName can optionally indicate the 3Dconnexion device # and the parameter name:
* (e.g., "29_Button 4" is SpacePilot button number 4,
* "Button 4" is a device independent button 4)
* settingValue should indicate the command source and a value that is assigned to this button (or whatever):
* (e.g., "D_23" means Driver function 23,
* "D_-3" means Driver macro 3,
* A_1005 means Application function 1005
* )
*/
SpwReturnValue SiCfgSaveSetting( const TCHAR *appName, const TCHAR *modeName, const TCHAR *configName, const TCHAR *settingName, const TCHAR *settingValue );
SpwReturnValue SiCfgGetSetting( const TCHAR *appName, const TCHAR *modeName, const TCHAR *configName, const TCHAR *settingName, TCHAR *settingValue, SPWuint32 *pmaxValueLen );
SpwReturnValue SiCfgGetModes( const TCHAR *appName, TCHAR *modeName, SPWuint32 *pmaxNameLen );
SpwReturnValue SiCfgGetModesNext( const TCHAR *appName, TCHAR *modeName, SPWuint32 *pmaxNameLen );
SpwReturnValue SiCfgGetNames( const TCHAR *appName, const TCHAR *modeName, TCHAR *configName, SPWuint32 *pmaxNameLen );
SpwReturnValue SiCfgGetNamesNext( const TCHAR *appName, const TCHAR *modeName, TCHAR *configName, SPWuint32 *pmaxNameLen );
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
* V3DCMD.h -- Virtual 3D Commands
*
* enums for all current V3DCMDs
* These are functions that all applications should respond to if they are
* at all applicable. These cmds are generated from any number of places
* including hard and soft buttons. They don't necessarily represent a
* hardware button
*
* Written: January 2013
* Original author: Jim Wick
*
*----------------------------------------------------------------------
*
* Copyright (c) 2013-2015 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*/
#ifndef _V3DCMD_H_
#define _V3DCMD_H_
static char v3DCMDCvsId[]="(C) 2013-2015 3Dconnexion: $Id: V3DCMD.h 11750 2015-09-08 13:58:59Z jwick $";
/*
* Constants
*/
/*
* Virtual 3D Commands
*
* These function numbers will never change, but the list will be amended as more
* V3DCMDs are created.
* For use with SI_CMD_EVENT.
* Most of these don't have a separate press and release of these events.
* Some keys do have press and release (Esc, Shift, Ctrl) as expected of keyboard keys.
*/
typedef enum
{
V3DCMD_NOOP = 0,
V3DCMD_MENU_OPTIONS = 1,
V3DCMD_VIEW_FIT = 2,
V3DCMD_VIEW_TOP = 3,
V3DCMD_VIEW_LEFT = 4,
V3DCMD_VIEW_RIGHT = 5,
V3DCMD_VIEW_FRONT = 6,
V3DCMD_VIEW_BOTTOM = 7,
V3DCMD_VIEW_BACK = 8,
V3DCMD_VIEW_ROLLCW = 9,
V3DCMD_VIEW_ROLLCCW = 10,
V3DCMD_VIEW_ISO1 = 11,
V3DCMD_VIEW_ISO2 = 12,
V3DCMD_KEY_F1 = 13,
V3DCMD_KEY_F2 = 14,
V3DCMD_KEY_F3 = 15,
V3DCMD_KEY_F4 = 16,
V3DCMD_KEY_F5 = 17,
V3DCMD_KEY_F6 = 18,
V3DCMD_KEY_F7 = 19,
V3DCMD_KEY_F8 = 20,
V3DCMD_KEY_F9 = 21,
V3DCMD_KEY_F10 = 22,
V3DCMD_KEY_F11 = 23,
V3DCMD_KEY_F12 = 24,
V3DCMD_KEY_ESC = 25,
V3DCMD_KEY_ALT = 26,
V3DCMD_KEY_SHIFT = 27,
V3DCMD_KEY_CTRL = 28,
V3DCMD_FILTER_ROTATE = 29,
V3DCMD_FILTER_PANZOOM= 30,
V3DCMD_FILTER_DOMINANT=31,
V3DCMD_SCALE_PLUS = 32,
V3DCMD_SCALE_MINUS = 33,
V3DCMD_VIEW_SPINCW = 34,
V3DCMD_VIEW_SPINCCW = 35,
V3DCMD_VIEW_TILTCW = 36,
V3DCMD_VIEW_TILTCCW = 37,
V3DCMD_MENU_POPUP = 38,
V3DCMD_MENU_BUTTONMAPPINGEDITOR = 39,
V3DCMD_MENU_ADVANCEDSETTINGSEDITOR = 40,
V3DCMD_MOTIONMACRO_ZOOM = 41,
V3DCMD_MOTIONMACRO_ZOOMOUT_CURSORTOCENTER = 42,
V3DCMD_MOTIONMACRO_ZOOMIN_CURSORTOCENTER = 43,
V3DCMD_MOTIONMACRO_ZOOMOUT_CENTERTOCENTER = 44,
V3DCMD_MOTIONMACRO_ZOOMIN_CENTERTOCENTER = 45,
V3DCMD_MOTIONMACRO_ZOOMOUT_CURSORTOCURSOR = 46,
V3DCMD_MOTIONMACRO_ZOOMIN_CURSORTOCURSOR = 47,
V3DCMD_VIEW_QZ_IN = 48,
V3DCMD_VIEW_QZ_OUT = 49,
V3DCMD_KEY_ENTER = 50,
V3DCMD_KEY_DELETE = 51,
V3DCMD_KEY_F13 = 52,
V3DCMD_KEY_F14 = 53,
V3DCMD_KEY_F15 = 54,
V3DCMD_KEY_F16 = 55,
V3DCMD_KEY_F17 = 56,
V3DCMD_KEY_F18 = 57,
V3DCMD_KEY_F19 = 58,
V3DCMD_KEY_F20 = 59,
V3DCMD_KEY_F21 = 60,
V3DCMD_KEY_F22 = 61,
V3DCMD_KEY_F23 = 62,
V3DCMD_KEY_F24 = 63,
V3DCMD_KEY_F25 = 64,
V3DCMD_KEY_F26 = 65,
V3DCMD_KEY_F27 = 66,
V3DCMD_KEY_F28 = 67,
V3DCMD_KEY_F29 = 68,
V3DCMD_KEY_F30 = 69,
V3DCMD_KEY_F31 = 70,
V3DCMD_KEY_F32 = 71,
V3DCMD_KEY_F33 = 72,
V3DCMD_KEY_F34 = 73,
V3DCMD_KEY_F35 = 74,
V3DCMD_KEY_F36 = 75,
V3DCMD_VIEW_1 = 76,
V3DCMD_VIEW_2 = 77,
V3DCMD_VIEW_3 = 78,
V3DCMD_VIEW_4 = 79,
V3DCMD_VIEW_5 = 80,
V3DCMD_VIEW_6 = 81,
V3DCMD_VIEW_7 = 82,
V3DCMD_VIEW_8 = 83,
V3DCMD_VIEW_9 = 84,
V3DCMD_VIEW_10 = 85,
V3DCMD_VIEW_11 = 86,
V3DCMD_VIEW_12 = 87,
V3DCMD_VIEW_13 = 88,
V3DCMD_VIEW_14 = 89,
V3DCMD_VIEW_15 = 90,
V3DCMD_VIEW_16 = 91,
V3DCMD_VIEW_17 = 92,
V3DCMD_VIEW_18 = 93,
V3DCMD_VIEW_19 = 94,
V3DCMD_VIEW_20 = 95,
V3DCMD_VIEW_21 = 96,
V3DCMD_VIEW_22 = 97,
V3DCMD_VIEW_23 = 98,
V3DCMD_VIEW_24 = 99,
V3DCMD_VIEW_25 = 100,
V3DCMD_VIEW_26 = 101,
V3DCMD_VIEW_27 = 102,
V3DCMD_VIEW_28 = 103,
V3DCMD_VIEW_29 = 104,
V3DCMD_VIEW_30 = 105,
V3DCMD_VIEW_31 = 106,
V3DCMD_VIEW_32 = 107,
V3DCMD_VIEW_33 = 108,
V3DCMD_VIEW_34 = 109,
V3DCMD_VIEW_35 = 110,
V3DCMD_VIEW_36 = 111,
V3DCMD_SAVE_VIEW_1 = 112,
V3DCMD_SAVE_VIEW_2 = 113,
V3DCMD_SAVE_VIEW_3 = 114,
V3DCMD_SAVE_VIEW_4 = 115,
V3DCMD_SAVE_VIEW_5 = 116,
V3DCMD_SAVE_VIEW_6 = 117,
V3DCMD_SAVE_VIEW_7 = 118,
V3DCMD_SAVE_VIEW_8 = 119,
V3DCMD_SAVE_VIEW_9 = 120,
V3DCMD_SAVE_VIEW_10 = 121,
V3DCMD_SAVE_VIEW_11 = 122,
V3DCMD_SAVE_VIEW_12 = 123,
V3DCMD_SAVE_VIEW_13 = 124,
V3DCMD_SAVE_VIEW_14 = 125,
V3DCMD_SAVE_VIEW_15 = 126,
V3DCMD_SAVE_VIEW_16 = 127,
V3DCMD_SAVE_VIEW_17 = 128,
V3DCMD_SAVE_VIEW_18 = 129,
V3DCMD_SAVE_VIEW_19 = 130,
V3DCMD_SAVE_VIEW_20 = 131,
V3DCMD_SAVE_VIEW_21 = 132,
V3DCMD_SAVE_VIEW_22 = 133,
V3DCMD_SAVE_VIEW_23 = 134,
V3DCMD_SAVE_VIEW_24 = 135,
V3DCMD_SAVE_VIEW_25 = 136,
V3DCMD_SAVE_VIEW_26 = 137,
V3DCMD_SAVE_VIEW_27 = 138,
V3DCMD_SAVE_VIEW_28 = 139,
V3DCMD_SAVE_VIEW_29 = 140,
V3DCMD_SAVE_VIEW_30 = 141,
V3DCMD_SAVE_VIEW_31 = 142,
V3DCMD_SAVE_VIEW_32 = 143,
V3DCMD_SAVE_VIEW_33 = 144,
V3DCMD_SAVE_VIEW_34 = 145,
V3DCMD_SAVE_VIEW_35 = 146,
V3DCMD_SAVE_VIEW_36 = 147,
V3DCMD_KEY_TAB = 148,
V3DCMD_KEY_SPACE = 149,
V3DCMD_MENU_1 = 150,
V3DCMD_MENU_2 = 151,
V3DCMD_MENU_3 = 152,
V3DCMD_MENU_4 = 153,
V3DCMD_MENU_5 = 154,
V3DCMD_MENU_6 = 155,
V3DCMD_MENU_7 = 156,
V3DCMD_MENU_8 = 157,
V3DCMD_MENU_9 = 158,
V3DCMD_MENU_10 = 159,
V3DCMD_MENU_11 = 160,
V3DCMD_MENU_12 = 161,
V3DCMD_MENU_13 = 162,
V3DCMD_MENU_14 = 163,
V3DCMD_MENU_15 = 164,
V3DCMD_MENU_16 = 165,
/* Add here as needed. Don't change any values that may be in use */
} V3DCMD;
#endif /* _V3DCMD_H_ */
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
* V3DKey.h -- Virtual 3D Keys
*
* enums for all current V3DKeys
*
* Written: January 2013
* Original author: Jim Wick
*
*----------------------------------------------------------------------
*
* Copyright notice:
* Copyright (c) 2013-2015 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*/
#ifndef _V3DKey_H_
#define _V3DKey_H_
static char v3DKeyCvsId[]="(C) 2013-2015 3Dconnexion: $Id: V3DKey.h 11750 2015-09-08 13:58:59Z jwick $";
/*
* Virtual 3D Keys
*
* Functions that refer to hardware keys use these constants to identify the keys.
* These represent hardware buttons on devices that have them.
* If a hardware device doesn't have a key, it won't produce the event.
* Not all hardware devices have all keys but any key that does exist is
* in this enum. If new hardware keys are added in the future, a new constant will
* be created for it.
*
* SI_BUTTON_PRESS_EVENT and SI_BUTTON_RELEASE_EVENT events identify the hardware
* keys that generated the events through V3DKeys (Virtual 3D Mouse Keys).
* These will represent the actual hardware key pressed unless the user did
* something clever in his xml file.
*/
/* This enum is replicated in virtualkeys.hpp. Reflect any changest there. */
typedef enum
{
V3DK_INVALID = 0,
V3DK_MENU = 1,
V3DK_FIT = 2,
V3DK_TOP = 3,
V3DK_LEFT = 4,
V3DK_RIGHT = 5,
V3DK_FRONT = 6,
V3DK_BOTTOM = 7,
V3DK_BACK = 8,
V3DK_ROLL_CW = 9,
V3DK_ROLL_CCW = 10,
V3DK_ISO1 = 11,
V3DK_ISO2 = 12,
V3DK_1 = 13,
V3DK_2 = 14,
V3DK_3 = 15,
V3DK_4 = 16,
V3DK_5 = 17,
V3DK_6 = 18,
V3DK_7 = 19,
V3DK_8 = 20,
V3DK_9 = 21,
V3DK_10 = 22,
V3DK_ESC = 23,
V3DK_ALT = 24,
V3DK_SHIFT = 25,
V3DK_CTRL = 26,
V3DK_ROTATE = 27,
V3DK_PANZOOM = 28,
V3DK_DOMINANT = 29,
V3DK_PLUS = 30,
V3DK_MINUS = 31,
V3DK_SPIN_CW = 32,
V3DK_SPIN_CCW = 33,
V3DK_TILT_CW = 34,
V3DK_TILT_CCW = 35,
V3DK_ENTER = 36,
V3DK_DELETE = 37,
V3DK_RESERVED0 = 38,
V3DK_RESERVED1 = 39,
V3DK_RESERVED2 = 40,
V3DK_F1 = 41,
V3DK_F2 = 42,
V3DK_F3 = 43,
V3DK_F4 = 44,
V3DK_F5 = 45,
V3DK_F6 = 46,
V3DK_F7 = 47,
V3DK_F8 = 48,
V3DK_F9 = 49,
V3DK_F10 = 50,
V3DK_F11 = 51,
V3DK_F12 = 52,
V3DK_F13 = 53,
V3DK_F14 = 54,
V3DK_F15 = 55,
V3DK_F16 = 56,
V3DK_F17 = 57,
V3DK_F18 = 58,
V3DK_F19 = 59,
V3DK_F20 = 60,
V3DK_F21 = 61,
V3DK_F22 = 62,
V3DK_F23 = 63,
V3DK_F24 = 64,
V3DK_F25 = 65,
V3DK_F26 = 66,
V3DK_F27 = 67,
V3DK_F28 = 68,
V3DK_F29 = 69,
V3DK_F30 = 70,
V3DK_F31 = 71,
V3DK_F32 = 72,
V3DK_F33 = 73,
V3DK_F34 = 74,
V3DK_F35 = 75,
V3DK_F36 = 76,
V3DK_11 = 77,
V3DK_12 = 78,
V3DK_13 = 79,
V3DK_14 = 80,
V3DK_15 = 81,
V3DK_16 = 82,
V3DK_17 = 83,
V3DK_18 = 84,
V3DK_19 = 85,
V3DK_20 = 86,
V3DK_21 = 87,
V3DK_22 = 88,
V3DK_23 = 89,
V3DK_24 = 90,
V3DK_25 = 91,
V3DK_26 = 92,
V3DK_27 = 93,
V3DK_28 = 94,
V3DK_29 = 95,
V3DK_30 = 96,
V3DK_31 = 97,
V3DK_32 = 98,
V3DK_33 = 99,
V3DK_34 = 100,
V3DK_35 = 101,
V3DK_36 = 102,
V3DK_VIEW_1 = 103,
V3DK_VIEW_2 = 104,
V3DK_VIEW_3 = 105,
V3DK_VIEW_4 = 106,
V3DK_VIEW_5 = 107,
V3DK_VIEW_6 = 108,
V3DK_VIEW_7 = 109,
V3DK_VIEW_8 = 110,
V3DK_VIEW_9 = 111,
V3DK_VIEW_10 = 112,
V3DK_VIEW_11 = 113,
V3DK_VIEW_12 = 114,
V3DK_VIEW_13 = 115,
V3DK_VIEW_14 = 116,
V3DK_VIEW_15 = 117,
V3DK_VIEW_16 = 118,
V3DK_VIEW_17 = 119,
V3DK_VIEW_18 = 120,
V3DK_VIEW_19 = 121,
V3DK_VIEW_20 = 122,
V3DK_VIEW_21 = 123,
V3DK_VIEW_22 = 124,
V3DK_VIEW_23 = 125,
V3DK_VIEW_24 = 126,
V3DK_VIEW_25 = 127,
V3DK_VIEW_26 = 128,
V3DK_VIEW_27 = 129,
V3DK_VIEW_28 = 130,
V3DK_VIEW_29 = 131,
V3DK_VIEW_30 = 132,
V3DK_VIEW_31 = 133,
V3DK_VIEW_32 = 134,
V3DK_VIEW_33 = 135,
V3DK_VIEW_34 = 136,
V3DK_VIEW_35 = 137,
V3DK_VIEW_36 = 138,
V3DK_SAVE_VIEW_1 = 139,
V3DK_SAVE_VIEW_2 = 140,
V3DK_SAVE_VIEW_3 = 141,
V3DK_SAVE_VIEW_4 = 142,
V3DK_SAVE_VIEW_5 = 143,
V3DK_SAVE_VIEW_6 = 144,
V3DK_SAVE_VIEW_7 = 145,
V3DK_SAVE_VIEW_8 = 146,
V3DK_SAVE_VIEW_9 = 147,
V3DK_SAVE_VIEW_10= 148,
V3DK_SAVE_VIEW_11= 149,
V3DK_SAVE_VIEW_12= 150,
V3DK_SAVE_VIEW_13= 151,
V3DK_SAVE_VIEW_14= 152,
V3DK_SAVE_VIEW_15= 153,
V3DK_SAVE_VIEW_16= 154,
V3DK_SAVE_VIEW_17= 155,
V3DK_SAVE_VIEW_18= 156,
V3DK_SAVE_VIEW_19= 157,
V3DK_SAVE_VIEW_20= 158,
V3DK_SAVE_VIEW_21= 159,
V3DK_SAVE_VIEW_22= 160,
V3DK_SAVE_VIEW_23= 161,
V3DK_SAVE_VIEW_24= 162,
V3DK_SAVE_VIEW_25= 163,
V3DK_SAVE_VIEW_26= 164,
V3DK_SAVE_VIEW_27= 165,
V3DK_SAVE_VIEW_28= 166,
V3DK_SAVE_VIEW_29= 167,
V3DK_SAVE_VIEW_30= 168,
V3DK_SAVE_VIEW_31= 169,
V3DK_SAVE_VIEW_32= 170,
V3DK_SAVE_VIEW_33= 171,
V3DK_SAVE_VIEW_34= 172,
V3DK_SAVE_VIEW_35= 173,
V3DK_SAVE_VIEW_36= 174,
V3DK_TAB = 175,
V3DK_SPACE = 176,
V3DK_MENU_1 = 177,
V3DK_MENU_2 = 178,
V3DK_MENU_3 = 179,
V3DK_MENU_4 = 180,
V3DK_MENU_5 = 181,
V3DK_MENU_6 = 182,
V3DK_MENU_7 = 183,
V3DK_MENU_8 = 184,
V3DK_MENU_9 = 185,
V3DK_MENU_10 = 186,
V3DK_MENU_11 = 187,
V3DK_MENU_12 = 188,
V3DK_MENU_13 = 189,
V3DK_MENU_14 = 190,
V3DK_MENU_15 = 191,
V3DK_MENU_16 = 192,
/* add more here as needed - don't change value of anything that may already be used */
V3DK_USER = 0x10000
} V3DKey;
#endif /* _V3DKey_H_ */
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
* siDefines.h -- 3DxWare input library defines and enums
*
* 3DxWare iInput library constants, no data structures
*
*----------------------------------------------------------------------
*
* Copyright (c) 2012-2018 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*/
#ifndef _SIDEFINES_H_
#define _SIDEFINES_H_
static char siDefinesCvsId[] = "(C) 2012-2018 3Dconnexion: $Id: siDefines.h 14752 2018-02-19 11:17:27Z jwick $";
/*
* UI modes
*/
#define SI_UI_ALL_CONTROLS 0xffffffffL
#define SI_UI_NO_CONTROLS 0x00000000L
/*
* Device types and classes
*/
typedef enum
{
SI_ALL_TYPES = -1,
SI_UNKNOWN_DEVICE = 0,
SI_SPACEBALL_2003 = 1,
SI_SPACEBALL_3003 = 2,
SI_SPACE_CONTROLLER = 3,
SI_SPACEEXPLORER = 4,
SI_SPACENAVIGATOR_FOR_NOTEBOOKS = 5,
SI_SPACENAVIGATOR = 6,
SI_SPACEBALL_2003A = 7,
SI_SPACEBALL_2003B = 8,
SI_SPACEBALL_2003C = 9,
SI_SPACEBALL_3003A = 10,
SI_SPACEBALL_3003B = 11,
SI_SPACEBALL_3003C = 12,
SI_SPACEBALL_4000 = 13,
SI_SPACEMOUSE_CLASSIC = 14,
SI_SPACEMOUSE_PLUS = 15,
SI_SPACEMOUSE_XT = 16,
SI_CYBERMAN = 17,
SI_CADMAN = 18,
SI_SPACEMOUSE_CLASSIC_PROMO = 19,
SI_SERIAL_CADMAN = 20,
SI_SPACEBALL_5000 = 21,
SI_TEST_NO_DEVICE = 22,
SI_3DX_KEYBOARD_BLACK = 23,
SI_3DX_KEYBOARD_WHITE = 24,
SI_TRAVELER = 25,
SI_TRAVELER1 = 26,
SI_SPACEBALL_5000A = 27,
SI_SPACEDRAGON = 28,
SI_SPACEPILOT = 29,
SI_MB = 30,
SI_SPACEPILOT_PRO = 0xc629,
SI_SPACEMOUSE_PRO = 0xc62b,
SI_SPACEMOUSE_TOUCH = 0xc62c,
SI_SPACEMOUSE_WIRELESS = 0xc62e,
SI_SPACEMOUSE_WIRELESS_NR = 0xc62f,
SI_SPACEMOUSE_PRO_WIRELESS = 0xc631,
SI_SPACEMOUSE_PRO_WIRELESS_NR = 0xc632,
SI_SPACEMOUSE_ENTERPRISE = 0xc633,
SI_SPACEMOUSE_COMPACT = 0xc635,
SI_SPACEMOUSE_MODULE = 0xc636,
SI_CADMOUSE = 0xc650,
SI_CADMOUSE_WIRELESS = 0xc651,
SI_UNIVERSAL_RECEIVER = 0xc652,
SI_UNIVERSAL_RECEIVER_SLOT = 0xf652,
SI_SCOUT = 0xc660
} SiDevType;
typedef enum
{
SI_CLASS_UNKNOWN = 0,
SI_CLASS_3DMOUSE = 1,
SI_CLASS_2DMOUSE = 2,
SI_CLASS_WIRELESS_RECEIVER = 3,
SI_CLASS_UNIVERSAL_WIRELESS_RECEIVER = 4,
SI_CLASS_KEYBOARD = 5,
SI_CLASS_JOYSTICK = 6,
SI_CLASS_VRGLASSES = 7,
SI_CLASS_MONITOR = 8,
SI_CLASS_TRACKER = 9,
SI_CLASS_EYETRACKER = 10,
} SiDevClass;
typedef enum
{
SI_CONNECTION_UNKNOWN = 0,
SI_CONNECTION_USB = 1, // USB cable
SI_CONNECTION_BT = 2, // BlueTooth
SI_CONNECTION_UR = 3, // Multi-device UniversalReceiver
SI_CONNECTION_NR = 4, // Dedicated single device NanoReceiver
SI_CONNECTION_WIRELESS = 5 // Generic wireless connection, e.g., WLAN
} SiDevConnection;
typedef enum
{
SI_ACTIVESTATE_UNKNOWN = 0,
SI_ACTIVESTATE_PAIREDANDSEENDATA = 1,
SI_ACTIVESTATE_PAIREDBUTNODATA = 2,
SI_ACTIVESTATE_USBCONNECTED = 3,
SI_ACTIVESTATE_USBDISCONNECTED = 4,
} SiDevActiveState;
typedef enum
{
SI_HINT_UNKNOWN = 0,
SI_HINT_SDKVERSION = 1,
SI_HINT_DRIVERVERSION = 2,
SI_HINT_USESV3DCMDS = 3,
SI_HINT_TEST_BOOL = 4, // These are just for testing
SI_HINT_TEST_INT = 5,
SI_HINT_TEST_FLOAT = 6,
SI_HINT_TEST_STRING = 7,
SI_HINT_USES3DXINPUT = 8,
SI_HINT_USESNAVLIB = 9,
SI_HINT_USESFILESYNC = 10,
} SiHintEnum;
/*
* Data retrieval mode, SI_POLL is not currently supported.
*/
#define SI_EVENT 0x0001
#define SI_POLL 0x0002
#define SI_NEUTERED 0x0004 // A connection that doesn't get events
#define SI_FOCUSTAIL 0x0008 // Last to get chosen for events
/*
* Get event flags
*/
#define SI_AVERAGE_EVENTS 0x0001
/*
* This is an INTERNAL flag used by the polling mechanism, user applications
* should NOT send this flag.
*/
#define SI_POLLED_REQUEST 0x0100
/*
* 3DxWare event types
*/
typedef enum
{
SI_BUTTON_EVENT = 1,
SI_MOTION_EVENT,
SI_COMBO_EVENT, /* Not implemented */
SI_ZERO_EVENT,
SI_EXCEPTION_EVENT, /* Driver use only */
SI_OUT_OF_BAND, /* Driver use only */
SI_ORIENTATION_EVENT, /* Driver use only */
SI_KEYBOARD_EVENT, /* Driver use only */
SI_LPFK_EVENT, /* Driver use only */
SI_APP_EVENT, /* Application functions */
SI_SYNC_EVENT, /* GUI synchronization events */
SI_BUTTON_PRESS_EVENT, /* Single button events (replace SI_BUTTON_EVENT) */
SI_BUTTON_RELEASE_EVENT, /* Single button events (replace SI_BUTTON_EVENT) */
SI_DEVICE_CHANGE_EVENT, /* Connect or disconnect device events */
SI_MOUSE_EVENT, /* Driver use only */
SI_JOYSTICK_EVENT, /* Driver use only */
SI_CMD_EVENT, /* V3DCMD_ events */
SI_MOTION_HID_EVENT, /* Motion event in HID nomenclature order */
SI_SETTING_CHANGED_EVENT,/* One or more smart ui settings have changed */
SI_RECONNECT_EVENT /* Occurs if the driver reconnects to the application */
} SiEventType;
/*
* SI_DEVICE_CHANGE_EVENT type
*/
typedef enum
{
SI_DEVICE_CHANGE_CONNECT,
SI_DEVICE_CHANGE_DISCONNECT
} SiDeviceChangeType;
/*
* SI_KEYBOARD_EVENT type
*/
typedef enum
{
SI_KEYBOARD_EVENT_KEYPRESS,
SI_KEYBOARD_EVENT_KEYRELEASE
} SiKeyboardEventType;
/*
* Motion data offsets
*/
#define SI_TX 0 /* Translation X value */
#define SI_TY 1 /* Translation Y value */
#define SI_TZ 2 /* Translation Z value */
#define SI_RX 3 /* Rotation X value */
#define SI_RY 4 /* Rotation Y value */
#define SI_RZ 5 /* Rotation Z value */
/*
* Reserved buttons
*/
#define SI_RESET_DEVICE_BIT 0x00000001L
#define SI_APP_FIT_BIT 0x80000000L
#define SI_APP_DIALOG_BIT 0x40000000L
#define SI_RESET_DEVICE_BUTTON 0
#define SI_APP_FIT_BUTTON 31
#define SI_APP_DIALOG_BUTTON 30
#define SI_APP_POPUPMENU_BUTTON 29
/*
* Miscellaneous
*/
#define SI_END_ARGS 0
#define SI_NO_HANDLE ((SiHdl) NULL)
#define SI_ALL_HANDLES ((SiHdl) NULL)
#define SI_ANY_HANDLE ((SiHdl) NULL)
#define SI_NO_TRANSCTL ((SiTransCtl) NULL)
#define SI_NO_MASK ((SiTypeMask *) NULL)
#define SI_ANY_DEVICE -1
#define SI_NOTIFICATION_DEVICE 0
#define SI_NO_DEVICE -1
#define SI_NO_TYPE -1
#define SI_NO_LIST -1
#define SI_NO_BUTTON -1
#define SI_STRSIZE 128
#define SI_MAXBUF 128
#define SI_MAXPORTNAME 260
#define SI_MAXPATH 512
#define SI_MAXAPPCMDID 500
#define SI_KEY_MAXBUF 5120
typedef enum
{
SI_LEFT = 0,
SI_RIGHT
} SiOrientation;
/*
SiMessageBox styles and behavior
*/
#define SI_MB_VIEW_SAVED 0x0001
#define SI_MB_HOLD_TO_SAVE 0x0002
#endif /* _SIDEFINES_H_ */
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
* siSync.h -- 3DxWare GUI Synchronization header
*
* Written: September 2004
* Author: Jim Wick
*
*----------------------------------------------------------------------
*
* Copyright notice:
* Copyright (c) 1998-2015 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*/
#ifndef _SISYNC_H_
#define _SISYNC_H_
#include "siSyncDefines.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
int state; /* VURZYX (Tx = LSB (& 1<<0) */
} SiSyncAxesState;
/*
* Private / implementation structures
*
* We suggest you leave these hidden and use the accessor functions rather than
* directly accessing the structures.
*/
#include "siSyncPriv.h"
/*
* Accessor Function headers
*/
SPWuint32 SiSyncGetSize(SiSyncPacket p);
void SiSyncSetSize(SiSyncPacket *p, SPWuint32 size);
SPWuint32 SiSyncGetHashCode(SiSyncPacket p);
void SiSyncSetHashCode(SiSyncPacket *p, SPWuint32 hashCode);
SiSyncOpCode SiSyncGetOpCode(SiSyncPacket p);
void SiSyncSetOpCode(SiSyncPacket *p, SPWuint32 opCode);
SiSyncItemCode SiSyncGetItemCode(SiSyncPacket p);
void SiSyncSetItemCode(SiSyncPacket *p, SPWuint32 itemCode);
#ifdef __cplusplus
}
#endif
#endif /* _SI_SYNC_H_ */
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
* siSyncPriv.h -- 3DxWare GUI Synchronization Private header
*
* Written: June 2005-2013
* Author: Jim Wick
*
*----------------------------------------------------------------------
*
* (c) Copyright 1998-2015 3Dconnexion. All rights reserved.
* Permission to use, copy, modify, and distribute this software for all
* purposes and without fees is hereby granted provided that this copyright
* notice appears in all copies. Permission to modify this software is granted
* and 3Dconnexion will support such modifications only is said modifications are
* approved by 3Dconnexion.
*
*/
#ifndef _SISYNCPRIV_H_
#define _SISYNCPRIV_H_
/*
* All packets start with the same fields.
* Many packets have data following the itemCode.
*/
typedef struct /* Sync Packet */
{
SPWuint32 size; /* total packet size */
SPWuint32 hashCode; /* Hash code that syncs a question with an answer */
SiSyncOpCode opCode; /* OpCode */
SiSyncItemCode itemCode; /* itemCode */
/* There will, generally, be more data starting here.
* There will not be any pointers, the data will be in here.
*/
} SiSyncPacketHeader;
/*
* I've enumerated all the possible packets here, not because they are all different,
* but mostly just for documentation. So the developer knows what parameters are
* expected with which packet type.
*/
typedef struct { SiSyncPacketHeader h; } SiSyncGetVersionPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 major; SPWint32 minor; } SiSyncSetVersionPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncCommandQueryPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncCommandSaveConfigPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetNumberOfFunctionsPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 n; } SiSyncSetNumberOfFunctionsPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; } SiSyncGetFunctionPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; SPWint32 n; WCHAR name[1];} SiSyncSetFunctionPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; } SiSyncGetButtonAssignmentPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; SPWint32 n; } SiSyncSetButtonAssignmentPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; SPWint32 n; } SiSyncSetButtonAssignmentAbsolutePacket;
typedef struct { SiSyncPacketHeader h; V3DKey v; SiAppCmdID a; } SiSyncSetButtonAssignmentV3DKeyPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; WCHAR name[1]; } SiSyncSetButtonNamePacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; } SiSyncGetAxisLabelPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; WCHAR name[1]; } SiSyncSetAxisLabelPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetOrientationPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 a[6]; } SiSyncSetOrientationPacket;
typedef struct { SiSyncPacketHeader h; SiSyncFilter i; } SiSyncGetFilterPacket;
typedef struct { SiSyncPacketHeader h; SiSyncFilter i; SiSyncFilterValue v; } SiSyncSetFilterPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetAxesStatePacket;
typedef struct { SiSyncPacketHeader h; SiSyncAxesState a; } SiSyncSetAxesStatePacket;
typedef struct { SiSyncPacketHeader h; SPWint32 duration; WCHAR s[1]; } SiSyncSetInfoLinePacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleOverallPacket;
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleOverallPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleTxPacket;
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleTxPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleTyPacket;
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleTyPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleTzPacket;
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleTzPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleRxPacket;
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleRxPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleRyPacket;
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleRyPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleRzPacket;
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleRzPacket;
typedef struct { SiSyncPacketHeader h; SiSyncAbsFunctionNumber i; } SiSyncAbsFunctionPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 i; SPWbool state; } SiSyncSetButtonStatePacket;
typedef struct { SiSyncPacketHeader h; SPWbool bSuspendOrResume; } SiSyncSuspendFileWritingPacket;
typedef struct { SiSyncPacketHeader h; SPWint32 buttonNumber; SPWbool press; } SiSyncInjectButtonEventPacket;
typedef struct { SiSyncPacketHeader h; SPWbool press; WCHAR actionID[1]; } SiSyncInvokeActionIDPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncCreateButtonBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncDeleteButtonBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncSetCurrentButtonBankPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncPreviousButtonBankPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncNextButtonBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; SPWuint32 maxNameLen; } SiSyncGetCurrentButtonBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncCreateAxisBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncDeleteAxisBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncSetCurrentAxisBankPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncPreviousAxisBankPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncNextAxisBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; SPWuint32 maxNameLen; } SiSyncGetCurrentAxisBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncCreateApplicationBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncDeleteApplicationBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; } SiSyncSetCurrentApplicationBankPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncPreviousApplicationBankPacket;
typedef struct { SiSyncPacketHeader h; } SiSyncNextApplicationBankPacket;
typedef struct { SiSyncPacketHeader h; WCHAR bankName[1]; SPWuint32 maxNameLen; } SiSyncGetCurrentApplicationBankPacket;
typedef struct { SiSyncPacketHeader h; SPWuint32 syncID; } SiSyncSetGrabSyncIDPacket;
typedef struct { SiSyncPacketHeader h; SPWuint32 syncID; } SiSyncSetSyncIDPacket;
// Turn off "nonstandard extension used : nameless struct/union" warning
#pragma warning ( disable : 4201 )
typedef struct
{
union
{
SiSyncPacketHeader h;
SiSyncGetVersionPacket gv;
SiSyncSetVersionPacket sv;
SiSyncCommandQueryPacket cq;
SiSyncCommandSaveConfigPacket cs;
SiSyncGetNumberOfFunctionsPacket gnf;
SiSyncSetNumberOfFunctionsPacket snf;
SiSyncGetFunctionPacket gf;
SiSyncSetFunctionPacket sf;
SiSyncGetButtonAssignmentPacket gba;
SiSyncSetButtonAssignmentPacket sba;
SiSyncSetButtonAssignmentAbsolutePacket sbaa;
SiSyncSetButtonAssignmentV3DKeyPacket sbav;
SiSyncSetButtonNamePacket sbn;
SiSyncGetAxisLabelPacket ga;
SiSyncSetAxisLabelPacket sa;
SiSyncGetOrientationPacket go;
SiSyncSetOrientationPacket so;
SiSyncGetFilterPacket gfi;
SiSyncSetFilterPacket sfi;
SiSyncGetAxesStatePacket gas;
SiSyncSetAxesStatePacket sas;
SiSyncSetInfoLinePacket si;
SiSyncGetScaleOverallPacket gso;
SiSyncSetScaleOverallPacket sso;
SiSyncGetScaleTxPacket gtx;
SiSyncSetScaleTxPacket stx;
SiSyncGetScaleTyPacket gty;
SiSyncSetScaleTyPacket sty;
SiSyncGetScaleTzPacket gtz;
SiSyncSetScaleTzPacket stz;
SiSyncGetScaleRxPacket grx;
SiSyncSetScaleRxPacket srx;
SiSyncGetScaleRyPacket gry;
SiSyncSetScaleRyPacket sry;
SiSyncGetScaleRzPacket grz;
SiSyncSetScaleRzPacket srz;
SiSyncAbsFunctionPacket absf;
SiSyncSetButtonStatePacket sbs;
SiSyncSuspendFileWritingPacket sfw;
SiSyncInjectButtonEventPacket ibe;
SiSyncInvokeActionIDPacket ia;
SiSyncCreateButtonBankPacket cbb;
SiSyncDeleteButtonBankPacket dbb;
SiSyncSetCurrentButtonBankPacket scbb;
SiSyncPreviousButtonBankPacket pbb;
SiSyncNextButtonBankPacket nbb;
SiSyncGetCurrentButtonBankPacket gcbb;
SiSyncCreateAxisBankPacket cab;
SiSyncDeleteAxisBankPacket dab;
SiSyncSetCurrentAxisBankPacket scab;
SiSyncPreviousAxisBankPacket pab;
SiSyncNextAxisBankPacket nab;
SiSyncGetCurrentAxisBankPacket gcab;
SiSyncCreateApplicationBankPacket cappb;
SiSyncDeleteApplicationBankPacket dappb;
SiSyncSetCurrentApplicationBankPacket scappb;
SiSyncPreviousApplicationBankPacket pappb;
SiSyncNextApplicationBankPacket nappb;
SiSyncGetCurrentApplicationBankPacket gcappb;
SiSyncSetGrabSyncIDPacket sgsid;
SiSyncSetSyncIDPacket ssid;
};
} SiSyncPacket;
// Turn warning back on
#pragma warning ( default : 4201 )
#endif /* _SI_SYNCPRIV_H_ */
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
*
* siapp.h -- Si static library interface header file
*
* Contains function headers and type definitions for siapp.c.
*
*-----------------------------------------------------------------------------
*
* Copyright (c) 2013-2015 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*/
#ifndef SIAPP_H
#define SIAPP_H
static char SiAppCvsId[] = "(C) 1998-2018 3Dconnexion: $Id: siapp.h 14646 2018-01-04 15:08:23Z jwick $";
#ifdef __cplusplus
extern "C" {
#endif
/* externally used functions */
enum SpwRetVal SiInitialize(void);
SPWbool SiIsInitialized(void);
void SiTerminate(void);
int SiGetNumDevices(void);
SiDevID SiDeviceIndex(int idx);
int SiDispatch(SiHdl hdl, const SiGetEventData *pData, const SiSpwEvent *pEvent, const SiSpwHandlers *pDHandlers);
void SiOpenWinInit(SiOpenData *pData, HWND hWnd);
SiHdl SiOpen(const char *pAppName, SiDevID devID, const SiTypeMask *pTMask, int mode, const SiOpenData *pData);
SiHdl SiOpenPort(const char *pAppName, const SiDevPort *pPort, int mode, const SiOpenData *pData);
enum SpwRetVal SiClose(SiHdl hdl);
void SiGetEventWinInit(SiGetEventData *pData, UINT msg, WPARAM wParam, LPARAM lParam);
enum SpwRetVal SiGetEvent(SiHdl hdl, int flags, const SiGetEventData *pData, SiSpwEvent *pEvent);
enum SpwRetVal SiPeekEvent(SiHdl hdl, int flags, const SiGetEventData *pData, SiSpwEvent *pEvent);
enum SpwRetVal SiBeep(SiHdl hdl, const char *string);
enum SpwRetVal SiSetLEDs(SiHdl hdl, SPWuint32 mask);
enum SpwRetVal SiRezero(SiHdl hdl);
enum SpwRetVal SiGrabDevice(SiHdl hdl, SPWbool exclusive);
enum SpwRetVal SiReleaseDevice(SiHdl hdl);
int SiButtonPressed(const SiSpwEvent *pEvent);
int SiButtonReleased(const SiSpwEvent *pEvent);
enum SpwRetVal SiSetUiMode(SiHdl hdl, SPWuint32 mode);
enum SpwRetVal SiSetTypeMask(SiTypeMask *pTMask, int type1, ...);
enum SpwRetVal SiGetDevicePort(SiHdl hdl, SiDevPort *pPort);
enum SpwRetVal SiGetDriverInfo(SiVerInfo *pInfo);
void SiGetLibraryInfo(SiVerInfo *pInfo);
enum SpwRetVal SiGetDeviceInfo(SiHdl hdl, SiDevInfo *pInfo);
char * SpwErrorString(enum SpwRetVal val);
enum SpwRetVal SiSyncSendQuery(SiHdl hdl);
enum SpwRetVal SiSyncGetVersion(SiHdl hdl, SPWuint32 *pmajor, SPWuint32 *pminor);
enum SpwRetVal SiSyncGetNumberOfFunctions(SiHdl hdl, SPWuint32 *pnumberOfFunctions);
enum SpwRetVal SiSyncGetFunction(SiHdl hdl, SPWuint32 index, SPWint32 *pabsoluteFunctionNumber, WCHAR name[], SPWuint32 *pmaxNameLen);
enum SpwRetVal SiSyncGetButtonAssignment(SiHdl hdl, SPWuint32 buttonNumber, SPWint32 *passignedFunctionIndex);
enum SpwRetVal SiSyncSetButtonAssignment(SiHdl hdl, SPWuint32 buttonNumber, SPWint32 functionIndex);
enum SpwRetVal SiSyncSetButtonAssignmentAbsolute(SiHdl hdl, SPWuint32 buttonNumber, SPWint32 absoluteFunctionNumber);
enum SpwRetVal SiSyncSetButtonAssignmentV3DKey(SiHdl hdl, V3DKey v3dkey, SiAppCmdID appCmdId);
enum SpwRetVal SiSyncSetButtonName(SiHdl hdl, SPWuint32 buttonNumber, const WCHAR name[]);
enum SpwRetVal SiSyncGetAxisLabel(SiHdl hdl, SPWuint32 axisNumber, WCHAR name[], SPWuint32 *pmaxNameLen);
enum SpwRetVal SiSyncSetAxisLabel(SiHdl hdl, SPWuint32 axisNumber, const WCHAR name[]);
enum SpwRetVal SiSyncGetOrientation(SiHdl hdl, SPWint32 axes[6]);
enum SpwRetVal SiSyncSetOrientation(SiHdl hdl, const SPWint32 axes[6]);
enum SpwRetVal SiSyncGetFilter(SiHdl hdl, SiSyncFilter i, SiSyncFilterValue *pv);
enum SpwRetVal SiSyncSetFilter(SiHdl hdl, SiSyncFilter i, SiSyncFilterValue v);
enum SpwRetVal SiSyncGetAxesState(SiHdl hdl, SiSyncAxesState *pa);
enum SpwRetVal SiSyncSetAxesState(SiHdl hdl, SiSyncAxesState a);
enum SpwRetVal SiSyncSetInfoLine(SiHdl hdl, SPWint32 duration, const WCHAR text[]);
enum SpwRetVal SiSyncGetScaleOverall(SiHdl hdl, SPWfloat32 *pv);
enum SpwRetVal SiSyncSetScaleOverall(SiHdl hdl, SPWfloat32 v);
enum SpwRetVal SiSyncGetScaleTx(SiHdl hdl, SPWfloat32 *pv);
enum SpwRetVal SiSyncSetScaleTx(SiHdl hdl, SPWfloat32 v);
enum SpwRetVal SiSyncGetScaleTy(SiHdl hdl, SPWfloat32 *pv);
enum SpwRetVal SiSyncSetScaleTy(SiHdl hdl, SPWfloat32 v);
enum SpwRetVal SiSyncGetScaleTz(SiHdl hdl, SPWfloat32 *pv);
enum SpwRetVal SiSyncSetScaleTz(SiHdl hdl, SPWfloat32 v);
enum SpwRetVal SiSyncGetScaleRx(SiHdl hdl, SPWfloat32 *pv);
enum SpwRetVal SiSyncSetScaleRx(SiHdl hdl, SPWfloat32 v);
enum SpwRetVal SiSyncGetScaleRy(SiHdl hdl, SPWfloat32 *pv);
enum SpwRetVal SiSyncSetScaleRy(SiHdl hdl, SPWfloat32 v);
enum SpwRetVal SiSyncGetScaleRz(SiHdl hdl, SPWfloat32 *pv);
enum SpwRetVal SiSyncSetScaleRz(SiHdl hdl, SPWfloat32 v);
enum SpwRetVal SiSyncInvokeAbsoluteFunction(SiHdl hdl, SiSyncAbsFunctionNumber i);
enum SpwRetVal SiSyncSetButtonState(SiHdl hdl, SPWuint32 buttonNumber, SiSyncButtonState state);
enum SpwRetVal SiGetButtonName(SiHdl hdl, SPWuint32 buttonNumber, SiButtonName *pname);
enum SpwRetVal SiGetButtonV3DK(SiHdl hdl, SPWuint32 buttonNumber, SPWuint32 *pV3DK);
enum SpwRetVal SiGetButtonNameV3DK(SiHdl hdl, SPWuint32 V3DK, SiButtonName *pname);
enum SpwRetVal SiGetDeviceName(SiHdl hdl, SiDeviceName *pname);
enum SpwRetVal SiGetDeviceImageFileName(SiHdl hdl, char name[], SPWuint32 *pmaxNameLen);
HICON SiGetCompanyIcon(void);
enum SpwRetVal SiGetCompanyLogoFileName(char name[], SPWuint32 *pmaxNameLen);
enum SpwRetVal SiSyncSuspendFileWriting(SiHdl hdl);
enum SpwRetVal SiSyncResumeFileWriting(SiHdl hdl);
void *SiGetConnectionID(SiHdl hdl);
enum SpwRetVal SiSyncInvokeActionID(SPWuint32 hashCode, SPWbool press, const WCHAR actionID[]);
enum SpwRetVal SiSyncCreateButtonBank(SiHdl hdl, const WCHAR bankName[]);
enum SpwRetVal SiSyncDeleteButtonBank(SiHdl hdl, const WCHAR bankName[]);
enum SpwRetVal SiSyncSetCurrentButtonBank(SiHdl hdl, const WCHAR bankName[]);
enum SpwRetVal SiSyncPreviousButtonBank(SiHdl hdl);
enum SpwRetVal SiSyncNextButtonBank(SiHdl hdl);
enum SpwRetVal SiSyncGetCurrentButtonBank(SiHdl hdl, WCHAR bankName[], SPWuint32 *pmaxBankNameLen);
enum SpwRetVal SiSyncSetGrabSyncID(SiHdl hdl, SPWuint32 syncID);
enum SpwRetVal SiSyncSetSyncID(SiHdl hdl, SPWuint32 syncID);
SPWint32 SiMessageBox(HWND hwnd, const WCHAR message[], const WCHAR caption[], SPWuint32 message_type);
void SiOpenWinInitEx(SiOpenDataEx *pData, HWND hWnd);
void SiOpenWinAddHintBoolEnum(SiOpenDataEx *pData, SiHintEnum hint, SPWbool value);
void SiOpenWinAddHintIntEnum(SiOpenDataEx *pData, SiHintEnum hint, SPWint32 value);
void SiOpenWinAddHintFloatEnum(SiOpenDataEx *pData, SiHintEnum hint, SPWfloat32 value);
void SiOpenWinAddHintStringEnum(SiOpenDataEx *pData, SiHintEnum hint, WCHAR *value);
void SiOpenWinAddHintBool(SiOpenDataEx *pData, WCHAR *hint, SPWbool value);
void SiOpenWinAddHintInt(SiOpenDataEx *pData, WCHAR *hint, SPWint32 value);
void SiOpenWinAddHintFloat(SiOpenDataEx *pData, WCHAR *hint, SPWfloat32 value);
void SiOpenWinAddHintString(SiOpenDataEx *pData, WCHAR *hint, WCHAR *value);
SiHdl SiOpenEx(const WCHAR *pAppName, SiDevID devID, const SiTypeMask *pTMask, int mode, const SiOpenDataEx *pData);
SiHdl SiOpenPortEx(const WCHAR *pAppName, const SiDevPort *pPort, int mode, const SiOpenDataEx *pData);
#ifdef __cplusplus
}
#endif
#endif /* #ifndef SIAPP_H */
#ifndef siappcmd_H_INCLUDED_
#ifndef siappcmd_H_INCLUDED_
#define siappcmd_H_INCLUDED_
/* siappcmd.h */
/*
* Copyright notice:
* (c) 2013-2016 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit and this file is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*/
/************************************************************************************
* File History
*
* $Id: siappcmd.h 13306 2016-08-18 19:00:54Z ngomes $
*
*/
/************************************************************************************
* File Description:
This 3Dconnexion application extension is a set of methods that allows users to
press buttons on a 3dconnexion device to invoke arbitrary actions.
A 3dconnexion utility is responsible for supporting user customization of 3D Input
device buttons. The application is responsible for passing application action
information to the 3dconnexion library, and for invoking actions identified by the
3dconnexion application extension.
The application invokes the following library functions.
SiAppCmdWriteActionSet
The application calls this function to write a context sensitive set of actions
to the 3dconnexion library. The action set is passed as a tree consisting of
categories and actions. An application may have either only one set of actions
through the whole life time of the application, or may change the set of actions
depending on the current working environment or context.
SiAppCmdActivateActionSet
The application calls this function immediately after enabling an action set,
passing the id for an action tree previously written to the 3dconnexion library.
If the application enables a new action set, it will also need to write the whole
action tree (using SiAppCmdWriteActions) to the 3dconnexion library.
Data structures are described in siappcmd_types.h
The functions are described in detail below.
***********************************************************************************************/
#include <si.h>
#include <siappcmd_types.h>
#ifdef __cplusplus
extern "C" {
#endif
/*------------------------------------+---------------------------------------
SiAppCmdWriteActionSet
SiAppCmdWriteActionSet is invoked by the application to communicate a set of actions
(application commands) to the 3Dconnexion library. The library caches the action information
to support user customization of action-button mappings.
The application must pass the entire action tree on each invocation of SiAppCmdWriteActionSet
for a particular environment or context.
Parameters:
Sihdl - active 3dware connection
SiActionNode_t* - action_tree (memory owned by the function caller)
Result:
SPW_NO_ERROR
SI_BAD_HANDLE
--------------------------------------+-------------------------------------*/
#pragma warning (push)
#pragma warning (disable : 4995)
enum SpwRetVal SiAppCmdWriteActionSet(SiHdl hdl, const SiActionNode_t *action_tree);
#pragma warning (pop)
#pragma deprecated(SiAppCmdWriteActionSet)
/*------------------------------------+---------------------------------------
SiAppCmdWriteActions
SiAppCmdWriteActions is invoked by the application to communicate a set of actions
(application commands) to the 3Dconnexion library. The library caches the action information
to support user customization of action-button mappings.
The application must pass the entire action tree on each invocation of SiAppCmdWriteActionSet
for a particular environment or context.
Parameters:
Sihdl - active 3dware connection
SiActionNodeEx_t* - action_tree (memory owned by the function caller)
Result:
SPW_NO_ERROR
SI_BAD_HANDLE
--------------------------------------+-------------------------------------*/
enum SpwRetVal SiAppCmdWriteActions(SiHdl hdl, const SiActionNodeEx_t *action_tree);
/*------------------------------------+---------------------------------------
SiAppCmdWriteActionImages
SiAppCmdWriteActionImages is invoked by the application to communicate the images
associated with application commands to the 3Dconnexion library. The library caches
the image information to support user customization of action-button mappings.
Parameters:
Sihdl - active 3dware connection
SiImage_t[] - array of images
SPWuint32 - the number of elements in the image array
Result:
SPW_NO_ERROR
SI_BAD_HANDLE
--------------------------------------+-------------------------------------*/
enum SpwRetVal SiAppCmdWriteActionImages(SiHdl hdl, const SiImage_t images[], SPWuint32 image_count);
/*------------------------------------+---------------------------------------
SiAppCmdActivateActionSet
SiAppCmdActivateActionSet is invoked by the application after enabling an action set.
The action tree passed in consists of a single action set node identifying the
the action set.
The function activates the action set named in the id.
Parameters:
Sihdl - active 3dware connection
char* - action set id (memory owned by the function caller)
Result:
SPW_NO_ERROR
SI_BAD_HANDLE
SI_BAD_VALUE
--------------------------------------+-------------------------------------*/
enum SpwRetVal SiAppCmdActivateActionSet(SiHdl hdl, const char *action_set_id);
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* siappcmd_H_INCLUDED_ */
#ifndef siappcmd_types_H_INCLUDED_
#ifndef siappcmd_types_H_INCLUDED_
#define siappcmd_types_H_INCLUDED_
/* siappcmd_types.h */
/*
* Copyright notice:
* (c) 2013-2016 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit and this file is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*/
/************************************************************************************
* File History
*
* $Id: siappcmd_types.h 14470 2017-09-26 06:37:48Z mbonk $
*
* 11/05/15 MSB Added size and description fields to SiActionNode_t.
* This will break the compilation as the size field needs setting and the
* type field has moved.
*/
/************************************************************************************
* File Description:
This header file describes the variable types used in the 3dconnexion interface
that allows a user to assign an arbitrary action to a 3dconnexion device button.
Data structures are described in detail below.
***********************************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_MSC_VER) && (_MSC_VER<1600)
typedef unsigned __int32 uint32_t;
typedef unsigned __int8 uint8_t;
#if _WIN64
typedef unsigned __int64 uintptr_t;
#else
typedef unsigned int uintptr_t;
#endif
#else
#include <stdint.h>
#endif
typedef enum siActionNodeType_e
{
SI_ACTIONSET_NODE = 0
, SI_CATEGORY_NODE
, SI_ACTION_NODE
} SiActionNodeType_t;
/*------------------------------------+---------------------------------------
SiActionNodeEx_t
The application passes a pointer to a structure of type SiActionNodeEx_t to
the function SiAppCmdWriteActionSet
A set of actions is composed of a linked list of SiActionNodeEx_t structures.
Sibling nodes are linked by the next field of the structure and child nodes
by the children field. The root node of the tree represents the name of the
action set while the leaf nodes of the tree represent the actions that can be
assigned to buttons and invoked by the user. The intermediate nodes represent
categories and sub-categories for the actions. An example of this would be the
menu item structure in a menu bar. The menus in the menu bar would be
represented by the SiActionNodeEx_t structures with type SI_CATEGORY_NODE pointed
to by each successively linked next field and the first menu item of each menu
represented by the structure pointed to by their child fields (the rest of the
menu items in each menu would again be linked by the next fields).
size
The size field must always be the byte size of siActionNodeEx_s
type
The type field specifies one of the following values.
SI_ACTIONSET_NODE
SI_CATEGORY_NODE
SI_ACTION_NODE
The root node (and only the root node) of the tree always has type
SI_ACTIONSET_NODE. Only the leaf nodes of the tree have type SI_ACTION_NODE.
All intermediate nodes have type SI_CATEGORY_NODE.
id
The id field specifies a UTF8 string identifier for the action set,
category, or action represented by the node. The field is always non-NULL.
This string needs to remain constant across application sessions and more
or less constant across application releases. The id is used by the
application to identify an action.
label
The label field specifies a UTF8 localized/internationalized name
for the action set, category, or action represented by the node. The label
field can be NULL for the root and intermediate category nodes that are not
explicitly presented to users. All leaf (action) and intermediate nodes
containing leaf nodes have non-NULL labels. If the application only has a
single action tree set, then the label of the root (context) node can also
be NULL.
description
The description field specifies a UTF8 localized/internationalized tooltip
for the action set, category, or action represented by the node. The description
field can be NULL for the root and intermediate category nodes that are not
explicitly presented to users. Leaf (action) nodes should have non-NULL descriptions.
--------------------------------------+-------------------------------------*/
#if __clang__
__attribute__((deprecated))
#elif _MSC_VER
#pragma deprecated(SiActionNode_t)
#endif
typedef struct siActionNode_s
{
struct siActionNode_s *next;
struct siActionNode_s *children;
const char *id;
const char *label;
SiActionNodeType_t type;
} SiActionNode_t;
typedef struct siActionNodeEx_s
{
uint32_t size;
SiActionNodeType_t type;
struct siActionNodeEx_s *next;
struct siActionNodeEx_s *children;
const char *id;
const char *label;
const char *description;
} SiActionNodeEx_t;
/*------------------------------------+---------------------------------------
SiImage_t
The application passes a pointer to an array of type SiImage_t to
the function SiAppCmdWriteActionImages
size
The size field specifies the size of the SiImage_t type in bytes.
id
The id field specifies a UTF8 string identifier for the image. The field
is always non-NULL. This string needs to remain constant across application
sessions and more or less constant across application releases.
The id is used by the application to identify the image. To associate an
image with a command the id needs to be identical to the value of the
SiActionNodeEx_t::id of the action.
siImageData_s::size
The siImageData_s::size field specifies the size of the data pointed to
by the siImageData_s::data field in bytes.
siImageData_s::data
The image field contains a pointer to the image. The image may be in coded
in any recognizable format.
--------------------------------------+-------------------------------------*/
typedef enum eSiImageType {
e_none = 0
, e_image_file
, e_resource_file
, e_image
} SiImageType_t;
struct siResource_s {
const char *file_name;
const char *id;
const char *type;
uint32_t index;
};
struct siImageFile_s {
const char *file_name;
uint32_t index;
};
struct siImageData_s {
const uint8_t *data;
uintptr_t size;
uint32_t index;
};
typedef struct siImage_s
{
uint32_t size;
SiImageType_t type;
const char *id;
union {
struct siResource_s resource;
struct siImageFile_s file;
struct siImageData_s image;
};
} SiImage_t;
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* siappcmd_types_H_INCLUDED_ */
\ No newline at end of file
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
* spwdata.h -- datatypes
*
*
* This contains the only acceptable type definitions for 3Dconnexion
* products. Needs more work.
*
*----------------------------------------------------------------------
*
* Copyright notice:
* Copyright (c) 1996-2015 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*----------------------------------------------------------------------
*
* 10/27/15 Added 64bit definitions for non ms-compilers
*/
#ifndef SPWDATA_H
#define SPWDATA_H
static char spwdataCvsId[] = "(C) 1996-2015 3Dconnexion: $Id: spwdata.h 11976 2015-10-27 10:51:11Z mbonk $";
#if defined (_MSC_VER)
typedef __int64 SPWint64;
#else
typedef int64_t SPWint64;
#endif
typedef long SPWint32;
typedef short SPWint16;
typedef char SPWint8;
typedef long SPWbool;
#if defined (_MSC_VER)
typedef unsigned __int64 SPWuint64;
#else
typedef uint64_t SPWuint64;
#endif
typedef unsigned long SPWuint32;
typedef unsigned short SPWuint16;
typedef unsigned char SPWuint8;
typedef float SPWfloat32;
typedef double SPWfloat64;
#endif /* SPWDATA_H */
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
* spwerror.h -- 3DxWare function return values
*
* This file contains all the 3Dconnexion standard error return
* return values for functions
*
*----------------------------------------------------------------------
*
* Copyright (c) 1996-2015 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*
*/
#ifndef _SPWERROR_H_
#define _SPWERROR_H_
static char spwerrorCvsId[]="(C) 1996-2015 3Dconnexion: $Id: spwerror.h 11571 2015-07-15 08:19:31Z jwick $";
enum SpwRetVal /* Error return values. */
{
SPW_NO_ERROR, /* No error. */
SPW_ERROR, /* Error -- function failed. */
SI_BAD_HANDLE, /* Invalid 3DxWare handle. */
SI_BAD_ID, /* Invalid device ID. */
SI_BAD_VALUE, /* Invalid argument value. */
SI_IS_EVENT, /* Event is a 3DxWare event. */
SI_SKIP_EVENT, /* Skip this 3DxWare event. */
SI_NOT_EVENT, /* Event is not a 3DxWare event. */
SI_NO_DRIVER, /* 3DxWare driver is not running. */
SI_NO_RESPONSE, /* 3DxWare driver is not responding. */
SI_UNSUPPORTED, /* The function is unsupported by this version. */
SI_UNINITIALIZED, /* 3DxWare input library is uninitialized. */
SI_WRONG_DRIVER, /* Driver is incorrect for this 3DxWare version. */
SI_INTERNAL_ERROR, /* Internal 3DxWare error. */
SI_BAD_PROTOCOL, /* The transport protocol is unknown. */
SI_OUT_OF_MEMORY, /* Unable to malloc space required. */
SPW_DLL_LOAD_ERROR, /* Could not load siapp dlls */
SI_NOT_OPEN, /* 3D mouse device not open */
SI_ITEM_NOT_FOUND, /* Item not found */
SI_UNSUPPORTED_DEVICE, /* The device is not supported */
SI_NOT_ENOUGH_MEMORY, /* Not enough memory (but not a malloc problem) */
SI_SYNC_WRONG_HASHCODE, /* Wrong hash code sent to a Sync function */
SI_INCOMPATIBLE_PROTOCOL_MIX, /* Attempt to mix MWM and S80 protocol in invalid way */
SI_DISABLED /* Functionality is currently disabled */
};
typedef enum SpwRetVal SpwReturnValue;
#endif /* _SPWERROR_H_ */
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
* spwmacro.h -- cpp macros we ALWAYS use.
*
* $Id: spwmacro.h 11091 2015-01-09 11:02:45Z jwick $
*
* We always seem to use the same macros.
* This is the place we define them.
*
*----------------------------------------------------------------------
*/
/*
* Copyright notice:
* Copyright (c) 1998-2015 3Dconnexion. All rights reserved.
*
* This file and source code are an integral part of the "3Dconnexion
* Software Developer Kit", including all accompanying documentation,
* and is protected by intellectual property laws. All use of the
* 3Dconnexion Software Developer Kit is subject to the License
* Agreement found in the "LicenseAgreementSDK.txt" file.
* All rights not expressly granted by 3Dconnexion are reserved.
*/
#ifndef SPWMACRO_H
#define SPWMACRO_H
#define SPW_FALSE (0)
#define SPW_TRUE (!SPW_FALSE)
#define SPW_MAX(a,b) (((a)>(b))?(a):(b))
#define SPW_MIN(a,b) (((a)<(b))?(a):(b))
#define SPW_ABS(a) (((a)<0)?(-(a)):(a))
#define SPW_SIGN(a) ((a)>=0?1:-1)
#define SPW_BIND(min,n,max) (SPW_MIN((max),SPW_MAX((min),(n))))
#define SPW_NUM_ELEMENTS_IN(a) (sizeof(a)/sizeof((a)[0]))
#define SPW_PI 3.14159265358979324f
#define SPW_DEG_TO_RAD(d) ((d)*SPW_PI/180.0f)
#define SPW_RAD_TO_DEG(r) ((r)*180.0f/SPW_PI)
#define SPW_LENGTH_OF(a) (sizeof(a)/sizeof((a)[0]))
#define SPW_END_OF(a) (&(a)[SPW_LENGTH_OF(a)-1])
#define SPW_SQ(a) ((a)*(a))
#define SPW_ABSDIFF(a, b) (fabs((double) (a) - (b)))
#endif
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
*
* spwmath.h: SpaceWare Math Library public definitions
*
* $Id: spwmath.h 9452 2013-10-07 10:20:47Z jwick $
*
*-----------------------------------------------------------------------------
*
*/
#ifndef SPW_MATH_H
#define SPW_MATH_H
#define SPW_MATH_MAJOR 3
#define SPW_MATH_MINOR 0
#define SPW_MATH_UPDATE 0
#define SPW_MATH_BUILD 7
#define SPW_MATH_VERSION "MATH version 3.0"
#define SPW_MATH_DATE "March 27, 1998"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef EXPORT_FUNCTIONS
#define DLL_EXPORT __declspec(dllexport)
#define CALL_TYPE __stdcall
#else
#define DLL_EXPORT
#define CALL_TYPE __stdcall
#endif
/* PUBLIC VARIABLES & DEFINES */
#if !defined(__GL_GL_H__) && !defined(SPW_NO_MATRIX)
typedef float Matrix[4][4];
#endif
DLL_EXPORT void SPW_ArbitraryAxisToMatrix (Matrix, const float[3], float);
DLL_EXPORT int SPW_CompareMatrices (const Matrix, const Matrix);
DLL_EXPORT float SPW_DotProduct (const float [3], const float [3]);
DLL_EXPORT float SPW_GetMatrixScale (const Matrix);
DLL_EXPORT void SPW_InvertMatrix (Matrix, const Matrix);
DLL_EXPORT void SPW_LookAtUpVectorToMatrix (Matrix, const float [3], const float [3],
const float [3]);
DLL_EXPORT void SPW_MatrixToArbitraryAxis (float [3], float *, const Matrix);
DLL_EXPORT float SPW_MatrixDeterminant (const Matrix);
DLL_EXPORT void SPW_MatrixToLookAtUpVector (float [3], float [3], float [3],
const Matrix);
DLL_EXPORT void SPW_Mult44x44 (Matrix, const Matrix, const Matrix);
DLL_EXPORT void SPW_MultFull14x44 (float [3], const float [3], const Matrix);
DLL_EXPORT void SPW_Mult14x44 (float [3], const float [3], const Matrix);
DLL_EXPORT void SPW_Mult33x33 (Matrix, const Matrix, const Matrix);
DLL_EXPORT void SPW_Mult13x33 (float [3], const float [3], const Matrix);
DLL_EXPORT int SPW_OrthoNormMatrix (Matrix);
DLL_EXPORT float SPW_VectorLength (const float [3]);
DLL_EXPORT void SPW_TransposeMatrix (Matrix, const Matrix);
DLL_EXPORT void SPW_CopyMatrix (Matrix, const Matrix);
DLL_EXPORT void SPW_ScaleMatrix (Matrix, const Matrix, float);
DLL_EXPORT void SPW_GetTranslationMatrix (Matrix, const Matrix);
DLL_EXPORT void SPW_InitializeMatrix (Matrix, float, float, float, float,
float, float, float, float,
float, float, float, float,
float, float, float, float);
DLL_EXPORT void SPW_MakeIdentityMatrix (Matrix);
DLL_EXPORT void SPW_NormalizeVector (float [3], float [3]);
DLL_EXPORT void SPW_CrossProduct (float [3], const float [3], const float [3]);
DLL_EXPORT void SPW_PrintMatrix (const char *, const Matrix);
DLL_EXPORT void SPW_PrintVector (const char *, const float [3]);
DLL_EXPORT void SPW_PrintSpaceballData (const char *, const float [7]);
DLL_EXPORT void SPW_HighValuePassFilter (float *, int);
#ifdef __cplusplus
}
#endif
#endif /* SPW_MATH_H */
#include "Navigation3D.h"
#include "Navigation3D.h"
#include <exception>
/// <summary>
/// 全局初始化3D鼠标
/// </summary>
void three_mouse_global_init()
{
try
{
ZeroMemory(device_datas, sizeof(device_datas));
}
catch (const std::exception&)
{
}
}
/// <summary>
/// 销毁3D鼠标
/// </summary>
void three_mouse_global_dispose()
{
try
{
SiTerminate();
}
catch (const std::exception&)
{
}
}
/// <summary>
/// 获取3D鼠标个数
/// </summary>
/// <returns>3D鼠标个数</returns>
int three_mouse_get_device_number()
{
try
{
return SiGetNumDevices();
}
catch (const std::exception&)
{
return -1;
}
}
/// <summary>
/// 打开3D鼠标设备
/// </summary>
/// <param name="hWnd">窗口句柄</param>
/// <param name="id">编号</param>
/// <returns>3D鼠标数据</returns>
ThreeDDeviceData* three_mouse_open_device(HWND hWnd, int id)
{
try
{
if (SiInitialize() == SPW_DLL_LOAD_ERROR) //init the 3DxWare input library
{
return NULL;
}
ThreeDDeviceData* device_data = new ThreeDDeviceData();
ZeroMemory(device_data, sizeof(ThreeDDeviceData));
device_data->id = id;
SiOpenData oData;
SiOpenWinInit(&oData, hWnd);
device_data->device = SiOpen("Navigation3D00", id, SI_NO_MASK, SI_EVENT, &oData);
if (device_data->device == NULL)
{
delete device_data;
SiTerminate();
return NULL;
}
SiGrabDevice(device_data->device, TRUE);
device_data->WM_3DMOUSE = RegisterWindowMessage(L"SpaceWareMessage00");
device_datas[id] = device_data;
return NULL;
}
catch (const std::exception&)
{
return NULL;
}
}
/// <summary>
/// 处理3D鼠标消息
/// </summary>
/// <param name="id">设备编号</param>
/// <param name="wParam">窗口消息</param>
/// <param name="lParam">窗口消息</param>
/// <returns>3D鼠标数据</returns>
ThreeDMouseData* three_mouse_on_message(int id, WPARAM wParam, LPARAM lParam)
{
try
{
if (id == 0 || id > 100)
return NULL;
ThreeDDeviceData* device_data = device_datas[id];
if (device_data == NULL)
return NULL;
ThreeDMouseData* data = new ThreeDMouseData();
data->result = 0;
data->tx = 0;
data->ty = 0;
data->tz = 0;
data->rx = 0;
data->ry = 0;
data->rz = 0;
SiSpwEvent Event; /* 3DxWare Event */
SiGetEventData EData; /* 3DxWare Event Data */
/* init Window platform specific data for a call to SiGetEvent */
SiGetEventWinInit(&EData, device_data->WM_3DMOUSE, wParam, lParam);
/* check whether msg was a 3D mouse event and process it */
if (SiGetEvent(device_data->device, 0, &EData, &Event) == SI_IS_EVENT)
{
switch (Event.type)
{
case SI_MOTION_EVENT:
data->result = 1;
data->tx = Event.u.spwData.mData[SI_TX];
data->ty = Event.u.spwData.mData[SI_TY];
data->tz = Event.u.spwData.mData[SI_TZ];
data->rx = Event.u.spwData.mData[SI_RX];
data->ry = Event.u.spwData.mData[SI_RY];
data->rz = Event.u.spwData.mData[SI_RZ];
break;
case SI_ZERO_EVENT:
data->result = 1;
data->tx = 0;
data->ty = 0;
data->tz = 0;
data->rx = 0;
data->ry = 0;
data->rz = 0;
break;
case SI_BUTTON_EVENT:
break;
} /* end switch */
} /* end SiGetEvent */
return (data);
}
catch (const std::exception&)
{
return NULL;
}
}
/// <summary>
/// 销毁3D鼠标指针
/// </summary>
/// <param name="ptr">指针</param>
void three_mouse_dispose_ptr(void* ptr)
{
try
{
delete ptr;
}
catch (const std::exception&)
{
}
}
\ No newline at end of file
#pragma once
#pragma once
#include <Windows.h>
#include <si.h>
#include <siapp.h>
extern "C" {
/// <summary>
/// 3D鼠标设备数据
/// </summary>
__declspec(dllimport) typedef struct
{
/// <summary>
/// 设备编号
/// </summary>
int id;
/// <summary>
/// 3D鼠标设备
/// </summary>
SiHdl device;
/// <summary>
/// 3D鼠标消息
/// </summary>
int WM_3DMOUSE;
} ThreeDDeviceData;
/// <summary>
/// 3D鼠标数据
/// </summary>
__declspec(dllimport) typedef struct
{
/// <summary>
/// 返回值为1时成功获取到3D鼠标数据
/// </summary>
long result;
/// <summary>
/// TX 值
/// </summary>
long tx;
/// <summary>
/// TY 值
/// </summary>
long ty;
/// <summary>
/// TZ 值
/// </summary>
long tz;
/// <summary>
/// RX 值
/// </summary>
long rx;
/// <summary>
/// RY 值
/// </summary>
long ry;
/// <summary>
/// RZ 值
/// </summary>
long rz;
/// <summary>
/// 事件
/// </summary>
long si_event;
} ThreeDMouseData;
/// <summary>
/// 设备数据信息
/// </summary>
ThreeDDeviceData* device_datas[20];
/// <summary>
/// 全局初始化3D鼠标
/// </summary>
__declspec(dllimport) void three_mouse_global_init();
/// <summary>
/// 全局销毁3D鼠标
/// </summary>
__declspec(dllimport) void three_mouse_global_dispose();
/// <summary>
/// 获取3D鼠标个数
/// </summary>
/// <returns>3D鼠标个数</returns>
__declspec(dllimport) int three_mouse_get_device_number();
/// <summary>
/// 打开3D鼠标设备
/// </summary>
/// <param name="hWnd">窗口句柄</param>
/// <param name="id">编号</param>
/// <returns>3D鼠标数据</returns>
__declspec(dllimport) ThreeDDeviceData* three_mouse_open_device(HWND hWnd, int id);
/// <summary>
/// 处理3D鼠标消息
/// </summary>
/// <param name="id">设备编号</param>
/// <param name="wParam">窗口消息</param>
/// <param name="lParam">窗口消息</param>
/// <returns>3D鼠标数据</returns>
__declspec(dllimport) ThreeDMouseData* three_mouse_on_message(int id, WPARAM wParam, LPARAM lParam);
/// <summary>
/// 销毁3D鼠标指针
/// </summary>
/// <param name="ptr">指针</param>
__declspec(dllimport) void three_mouse_dispose_ptr(void* ptr);
}
\ No newline at end of file
#include <windows.h>
#include <windows.h>
#include "Navigation3D.h"
#include <iostream>
using namespace std;
//声明函数
LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
//主函数WinMain()
int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine, _In_ int nShowCmd)
{
//窗口类名
TCHAR cls_name[] = TEXT("3DMouseTest");
//设计窗口类
WNDCLASSEX wce = { 0 };
wce.cbSize = sizeof(WNDCLASSEX); //结构体大小
wce.style = CS_HREDRAW | CS_VREDRAW; //大小改变,水平和垂直重绘
wce.lpfnWndProc = WindowProc; //窗口回调函数地址
wce.cbClsExtra = 0; //类的附加数据
wce.cbWndExtra = 0; //窗口的附加数据
wce.hInstance = hInstance; //应用程序实例句柄
wce.hIcon = LoadIcon(NULL, IDI_APPLICATION); //大图标
wce.hIconSm = wce.hIcon; //小图标
wce.hCursor = LoadCursor(NULL, IDC_ARROW); //光标
wce.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); //背景色
wce.lpszMenuName = NULL; //菜单
wce.lpszClassName = cls_name; //窗口类的名称
//注册窗口类
//ATOM nres = RegisterClassEx(&wce);
if (FALSE == RegisterClassEx(&wce))
return 1;
//创建窗口
HWND hWnd = CreateWindowEx(
WS_EX_APPWINDOW, //窗口的扩展样式
cls_name, //窗口类名
TEXT("3DMouseTest"), //窗口标题
WS_OVERLAPPEDWINDOW, //窗口风格样式
200, 120, 600, 400, //窗口x,y,宽度,高度
NULL, //父窗口句柄
NULL, //菜单句柄
hInstance, //应用程序实例句柄
NULL); //附加数据
//回调函数要写上默认的处理DefWindowProc,不然创建失败
if (!hWnd)
return 1;
//显示,更新窗口
ShowWindow(hWnd, SW_SHOW);
UpdateWindow(hWnd);
//添加加速键表
HACCEL hAccel = NULL;
/*::LoadAccelerators(hInstance,MAKEINTRESOURCE(IDR_ACCELERATOR1);*/
// =======================================================================
// 初始化3D鼠标
three_mouse_global_init();
three_mouse_open_device(hWnd, 1);
// =======================================================================
//消息循环
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(hWnd, hAccel, &msg))//有加速键表时用这,没有就不用
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
// =======================================================================
// 销毁3D鼠标
three_mouse_global_dispose();
// =======================================================================
return 0;
}
//窗口消息处理函数
LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
ThreeDMouseData* mouse_data = three_mouse_on_message(1, wParam, lParam);
if (mouse_data != NULL && mouse_data->result == TRUE)
{
}
switch (uMsg)
{
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default: break;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
\ No newline at end of file
...@@ -92,8 +92,6 @@ ...@@ -92,8 +92,6 @@
<Compile Include="Core\Converter\Bool2SolidColorBrushConverter.cs" /> <Compile Include="Core\Converter\Bool2SolidColorBrushConverter.cs" />
<Compile Include="Core\Converter\Color2SolidColorBrushConverter.cs" /> <Compile Include="Core\Converter\Color2SolidColorBrushConverter.cs" />
<Compile Include="Core\Converter\StringAppendConverter.cs" /> <Compile Include="Core\Converter\StringAppendConverter.cs" />
<Compile Include="Core\Debug\DebugDomain.cs" />
<Compile Include="Core\Debug\DebugMessage.cs" />
<Compile Include="Core\Enum\EnumHelper.cs" /> <Compile Include="Core\Enum\EnumHelper.cs" />
<Compile Include="Core\Enum\EnumModel.cs" /> <Compile Include="Core\Enum\EnumModel.cs" />
<Compile Include="Core\Helper\ByteHelper.cs" /> <Compile Include="Core\Helper\ByteHelper.cs" />
......
using log4net;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Management;
using VIZ.Framework.Core;
using VIZ.Framework.Connection;
using VIZ.Framework.Module;
using System.Reflection;
using VIZ.Framework.Domain;
namespace VIZ.Framework.Module
{
/// <summary>
/// 应用程序启动 -- 调试窗口
/// </summary>
public class AppSetup_DebugWindow : AppSetupBase
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(AppSetup_DebugWindow));
/// <summary>
/// 描述
/// </summary>
public override string Detail { get; } = "应用程序启动 -- 调试窗口";
/// <summary>
/// 调试窗口
/// </summary>
private DebugWindow DebugWindow;
/// <summary>
/// 执行启动
/// </summary>
/// <param name="context">应用程序启动上下文</param>
/// <returns>是否成功执行</returns>
public override bool Setup(AppSetupContext context)
{
if (ApplicationDomain.IS_DEBUG)
{
WPFHelper.BeginInvoke(() =>
{
this.DebugWindow = new DebugWindow();
this.DebugWindow.Show();
});
}
return true;
}
/// <summary>
/// 执行关闭
/// </summary>
/// <param name="context">应用程序启动上下文</param>
public override void Shutdown(AppSetupContext context)
{
WPFHelper.BeginInvoke(() =>
{
if (this.DebugWindow != null)
{
this.DebugWindow.Close();
}
});
}
}
}
...@@ -77,20 +77,12 @@ ...@@ -77,20 +77,12 @@
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Debug\DebugWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Generic.xaml"> <Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Debug\DebugViewModel.cs" />
<Compile Include="Debug\DebugWindow.xaml.cs">
<DependentUpon>DebugWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
...@@ -109,7 +101,6 @@ ...@@ -109,7 +101,6 @@
<Compile Include="Setup\AppSetupContext.cs" /> <Compile Include="Setup\AppSetupContext.cs" />
<Compile Include="Setup\IAppSetup.cs" /> <Compile Include="Setup\IAppSetup.cs" />
<Compile Include="Setup\Message\AppShutDownMessage.cs" /> <Compile Include="Setup\Message\AppShutDownMessage.cs" />
<Compile Include="Setup\Provider\Load\AppSetup_DebugWindow.cs" />
<Compile Include="Setup\Provider\Setup\AppSetup_ObjectPool.cs" /> <Compile Include="Setup\Provider\Setup\AppSetup_ObjectPool.cs" />
<Compile Include="Setup\Provider\Setup\AppSetup_ApplicationSafe.cs" /> <Compile Include="Setup\Provider\Setup\AppSetup_ApplicationSafe.cs" />
<Compile Include="Setup\Provider\Setup\AppSetup_Helper.cs" /> <Compile Include="Setup\Provider\Setup\AppSetup_Helper.cs" />
......
...@@ -56,6 +56,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VIZ.Framework.Core.Navigati ...@@ -56,6 +56,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VIZ.Framework.Core.Navigati
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Framework.TimeSliceTool", "VIZ.Framework.TimeSliceTool\VIZ.Framework.TimeSliceTool.csproj", "{CB5A6164-8937-49B0-9E01-29D96D4CE0EA}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Framework.TimeSliceTool", "VIZ.Framework.TimeSliceTool\VIZ.Framework.TimeSliceTool.csproj", "{CB5A6164-8937-49B0-9E01-29D96D4CE0EA}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VIZ.Framework.Core.Expand", "VIZ.Framework.Core.Expand\VIZ.Framework.Core.Expand.vcxproj", "{3C45130C-941C-4980-B524-D91B10163F4C}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -234,6 +236,18 @@ Global ...@@ -234,6 +236,18 @@ Global
{CB5A6164-8937-49B0-9E01-29D96D4CE0EA}.Release|x64.Build.0 = Release|Any CPU {CB5A6164-8937-49B0-9E01-29D96D4CE0EA}.Release|x64.Build.0 = Release|Any CPU
{CB5A6164-8937-49B0-9E01-29D96D4CE0EA}.Release|x86.ActiveCfg = Release|Any CPU {CB5A6164-8937-49B0-9E01-29D96D4CE0EA}.Release|x86.ActiveCfg = Release|Any CPU
{CB5A6164-8937-49B0-9E01-29D96D4CE0EA}.Release|x86.Build.0 = Release|Any CPU {CB5A6164-8937-49B0-9E01-29D96D4CE0EA}.Release|x86.Build.0 = Release|Any CPU
{3C45130C-941C-4980-B524-D91B10163F4C}.Debug|Any CPU.ActiveCfg = Debug|x64
{3C45130C-941C-4980-B524-D91B10163F4C}.Debug|Any CPU.Build.0 = Debug|x64
{3C45130C-941C-4980-B524-D91B10163F4C}.Debug|x64.ActiveCfg = Debug|x64
{3C45130C-941C-4980-B524-D91B10163F4C}.Debug|x64.Build.0 = Debug|x64
{3C45130C-941C-4980-B524-D91B10163F4C}.Debug|x86.ActiveCfg = Debug|Win32
{3C45130C-941C-4980-B524-D91B10163F4C}.Debug|x86.Build.0 = Debug|Win32
{3C45130C-941C-4980-B524-D91B10163F4C}.Release|Any CPU.ActiveCfg = Release|x64
{3C45130C-941C-4980-B524-D91B10163F4C}.Release|Any CPU.Build.0 = Release|x64
{3C45130C-941C-4980-B524-D91B10163F4C}.Release|x64.ActiveCfg = Release|x64
{3C45130C-941C-4980-B524-D91B10163F4C}.Release|x64.Build.0 = Release|x64
{3C45130C-941C-4980-B524-D91B10163F4C}.Release|x86.ActiveCfg = Release|Win32
{3C45130C-941C-4980-B524-D91B10163F4C}.Release|x86.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -253,6 +267,7 @@ Global ...@@ -253,6 +267,7 @@ Global
{6B864E7B-164B-4B1E-B7D6-1563D824F567} = {4E1CA052-91A6-401D-9F07-4973231A33FB} {6B864E7B-164B-4B1E-B7D6-1563D824F567} = {4E1CA052-91A6-401D-9F07-4973231A33FB}
{D1AA6399-2000-42BA-A577-D50BC5FCA393} = {2F6173AD-2376-4F42-B852-10E3DBD394EE} {D1AA6399-2000-42BA-A577-D50BC5FCA393} = {2F6173AD-2376-4F42-B852-10E3DBD394EE}
{CB5A6164-8937-49B0-9E01-29D96D4CE0EA} = {4E1CA052-91A6-401D-9F07-4973231A33FB} {CB5A6164-8937-49B0-9E01-29D96D4CE0EA} = {4E1CA052-91A6-401D-9F07-4973231A33FB}
{3C45130C-941C-4980-B524-D91B10163F4C} = {2F6173AD-2376-4F42-B852-10E3DBD394EE}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4C56D4BA-4B41-4AB8-836F-9997506EA9AC} SolutionGuid = {4C56D4BA-4B41-4AB8-836F-9997506EA9AC}
......
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