42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class CVT_JSON
|
|
{
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 把JointData 转化成 JointList
|
|
/// 2021.3.29
|
|
/// </summary>
|
|
/// <param name="craftPlayData_Joint"></param>
|
|
/// <returns></returns>
|
|
public static List<double[]> JointDataToJointList(string craftPlayData_Joint)
|
|
{
|
|
List<double[]> jSqlList = new List<double[]>();
|
|
foreach (JToken jJointFramesRows in (JArray)JsonConvert.DeserializeObject(craftPlayData_Joint))
|
|
jSqlList.Add(new double[] {
|
|
Convert.ToDouble(jJointFramesRows["j1"]),
|
|
Convert.ToDouble(jJointFramesRows["j2"]),
|
|
Convert.ToDouble(jJointFramesRows["j3"]),
|
|
Convert.ToDouble(jJointFramesRows["j4"]),
|
|
Convert.ToDouble(jJointFramesRows["j5"]),
|
|
Convert.ToDouble(jJointFramesRows["j6"])});
|
|
return jSqlList;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|