运动错误事件触发上层;回家功能移植到 ishomed函数中;对 EF3版本号读取测试;

This commit is contained in:
zhengxuan.zhang
2024-02-27 16:31:47 +08:00
parent e086e9cea3
commit 7bcf86d55f
23 changed files with 65 additions and 50 deletions
+24 -23
View File
@@ -43,33 +43,34 @@ namespace HSI_SEVENOCEAN_EF1_CsTest
Console.WriteLine("Motion.Startup:{0}", rStatus);
//5 获取EF3固件版本号,待测试
//var EF3Version = new byte[20];
//IntPtr intPtrEF3Version = Marshal.StringToHGlobalAnsi("");
//rStatus = Interface.MotionGetFirewareVerion(intPtrEF3Version);
//Console.WriteLine("Interface.MotionGetFirewareVerion: {0}", rStatus);
//Marshal.Copy(intPtrEF3Version, EF3Version, 0, EF3Version.Length);
//Console.WriteLine("EF3 FirewareVerion Version: {0}", Encoding.UTF8.GetString(EF3Version));
var EF3Version = new byte[20];
IntPtr intPtrEF3Version = Marshal.StringToHGlobalAnsi("");
rStatus = Interface.MotionGetFirewareVerion(intPtrEF3Version);
Console.WriteLine("Interface.MotionGetFirewareVerion: {0}", rStatus);
Marshal.Copy(intPtrEF3Version, EF3Version, 0, EF3Version.Length);
Console.WriteLine("EF3 FirewareVerion Version: {0}", Encoding.UTF8.GetString(EF3Version));
#region
//启动扫描
Motion.DCCScanStart();
//扫描中
Thread.Sleep(10000);
//扫描结束
Motion.DCCScanStop();
////启动扫描
//Motion.DCCScanStart();
//获取扫描结果
var dataCache = Marshal.AllocHGlobal(1000);
var pointCount = 0;
var data = new byte[1000];
Motion.GetPositionXyzCache(dataCache, ref pointCount);
Console.WriteLine("pointCount = " + pointCount);
Marshal.Copy(dataCache, data, 0, pointCount);
////扫描中
//Thread.Sleep(10000);
//打印扫描点
for (var i = 0; i < pointCount; i++) Console.WriteLine("Hex:{0} {1:X}", i, data[i]);
////扫描结束
//Motion.DCCScanStop();
////获取扫描结果
//var dataCache = Marshal.AllocHGlobal(1000);
//var pointCount = 0;
//var data = new byte[1000];
//Motion.GetPositionXyzCache(dataCache, ref pointCount);
//Console.WriteLine("pointCount = " + pointCount);
//Marshal.Copy(dataCache, data, 0, pointCount);
////打印扫描点
//for (var i = 0; i < pointCount; i++) Console.WriteLine("Hex:{0} {1:X}", i, data[i]);
#endregion
@@ -78,7 +79,7 @@ namespace HSI_SEVENOCEAN_EF1_CsTest
rStatus = Motion.IsHomed(ref bHomed);
Console.WriteLine("Motion.IsHomed:{0}", rStatus);
var bexit = false;
var SpeedGear = 0.2;
var SpeedGear = 0.3;
var dPos = new double[3];
do
{