for 合并
This commit is contained in:
@ -220,7 +220,45 @@ pub fn readformport_iris(commanid: serde_json::Value, wait_time_json: serde_json
|
||||
println!("read data: {}", str);
|
||||
return str.to_string();
|
||||
}
|
||||
pub fn set_weave_coeff_iris(specnumber: i32, a0: f64, a1: f64, a2: f64, a3: f64) -> String {
|
||||
logtorust(format!(
|
||||
"set_weave_coeff_iris specnumber:{} a0:{} a1:{} a2:{} a3:{}",
|
||||
specnumber, a0, a1, a2, a3
|
||||
));
|
||||
// 新建一个serde_json对象
|
||||
/*
|
||||
{
|
||||
"command": "set_bochangxishu",
|
||||
"bochangxishu": {
|
||||
"a0": -1.08988798e-09,
|
||||
"a1": -5.32620063e-05,
|
||||
"a2": 0.441532,
|
||||
"a3": 348.5026,
|
||||
"b0": -1.2597071e-9,
|
||||
"b1": -0.000053,
|
||||
"b2": 0.440609,
|
||||
"b3": 48.3989
|
||||
}
|
||||
}
|
||||
*/
|
||||
let mut data = serde_json::Map::new();
|
||||
data.insert("command".to_string(), serde_json::Value::String("set_bochangxishu".to_string()));
|
||||
let mut bochangxishu = serde_json::Map::new();
|
||||
bochangxishu.insert("a0".to_string(), serde_json::Value::from(a0));
|
||||
bochangxishu.insert("a1".to_string(), serde_json::Value::from(a1));
|
||||
bochangxishu.insert("a2".to_string(), serde_json::Value::from(a2));
|
||||
bochangxishu.insert("a3".to_string(), serde_json::Value::from(a3));
|
||||
bochangxishu.insert("b0".to_string(), serde_json::Value::from(a0));
|
||||
bochangxishu.insert("b1".to_string(), serde_json::Value::from(a1));
|
||||
bochangxishu.insert("b2".to_string(), serde_json::Value::from(a2));
|
||||
bochangxishu.insert("b3".to_string(), serde_json::Value::from(a3));
|
||||
data.insert("bochangxishu".to_string(), serde_json::Value::Object(bochangxishu));
|
||||
let data = serde_json::Value::Object(data);
|
||||
let resut= sendtoport_andgetreturn_iris(data, serde_json::Value::String("json".to_string()));
|
||||
println!("set_weave_coeff_iris result: {:?}", resut.as_ref().unwrap().content);
|
||||
|
||||
"OK".to_string()
|
||||
}
|
||||
|
||||
pub fn sendtoport_andgetreturn_iris(
|
||||
data: serde_json::Value,
|
||||
|
||||
Reference in New Issue
Block a user