[WMX3] 4.SetDeviceName and GetAllDevices

主要功能为设定/取得连线到WMX3Engine的设备或者是软体所设定的名称

使用方法

设定
//需接续在CreateDevice之后wmxApi.SetDeviceName(_DeviceName);
取得
新增 wmx_DeviceProperty 类别
public class wmx_DeviceProperty{    public uint Id { set; get; }    public string Name { set; get; }    public wmx_DeviceProperty(uint Id, string Name)    {        this.Id = Id;        this.Name = Name;    }}

之后再把需要的资料都放进List中

List<wmx_DeviceProperty> Temp = new List<wmx_DeviceProperty>();DevicesInfo devicesInfo = new DevicesInfo();wmxApi.GetAllDevices(ref devicesInfo);uint _Count = devicesInfo.Count;for(uint index = 0;index < _Count; index++){    Temp.Add(new wmx_DeviceProperty(devicesInfo.Devices[index].Id,    devicesInfo.Devices[index].Name)); }

DevicesInfo中也包含着CreateDevice时设定的DeviceType,Time依照需求加入wmx_DeviceProperty中即可

结果
http://img2.58codes.com/2024/20134736B0aBqybONE.png

也可以利用WMX3ConsoleApp中选择Help->Devices
http://img2.58codes.com/2024/20134736FnTp85EH4k.png


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章