You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

using ConsoleTest.Test.AutoWeight;
using ConsoleTest.Util;
using System;
using System.Text.RegularExpressions;
namespace ConsoleTest
{
public class Program
{
private static void Main(string[] args)
{
EnvUtil.InitWorkDirectory();
EnvUtil.AddDllPath(EnvUtil.CombinePath(EnvUtil.GetWorkDirectory(), "dll"));
//AutoWeightTest();
//OtherTests();
//PTZApi.Test.TestPtzApi();
Console.ReadLine();
}
private static void TempTest(string tempBuf)
{
string[] splitBufArray = tempBuf.Split('\r');
foreach (var item in splitBufArray)
{
if (item.Length != 16) { continue; }
Console.WriteLine($"item:{item}");
MatchCollection mc = Regex.Matches(tempBuf, @"(\d+)");
Console.WriteLine($"mc:{mc}, count:{mc.Count}");
for (int i = 0; i < mc.Count; i++)
{
Console.Write($"{i}:{mc[i].Value}");
}
Console.WriteLine();
if (mc.Count != 3) { continue; }
string weightArg = mc[1].Value;
decimal weight = CommonUtil.WeightStrToDec(weightArg) / 1000;
string unit = "t";
Console.WriteLine($"weight:{weight}{unit}");
break;
}
}
private static void AutoWeightTest()
{
try
{
//WeightTest.TestZhuHai();
//WeightTest.TestHuiZhou();
//LedTest.Test();
//LightTest.Test();
PosTest.Test();
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
}
private static void OtherTest()
{
Test.OtherTest.ConfigTest();
}
}
}