Ejemplo n.º 1
0
        public static void parseJson(string jsonStr, MachineParam machineParam)
        {

            JsonData data = JsonMapper.ToObject(jsonStr);
            machineParam.measure_param.forcing_bendi_measure_time = data["measure_param"]["forcing_bendi_measure_time"].ToString();
            machineParam.measure_param.alarm_factor = data["measure_param"]["alarm_factor"].ToString();
            machineParam.measure_param.alarm_recover_time = data["measure_param"]["alarm_recover_time"].ToString();
            machineParam.measure_param.alarm_threshold = data["measure_param"]["alarm_threshold"].ToString();
            machineParam.measure_param.bendi_measure_smooth_factor = data["measure_param"]["bendi_measure_smooth_factor"].ToString();
            machineParam.measure_param.high_bendi_threshold = data["measure_param"]["high_bendi_threshold"].ToString();
            machineParam.measure_param.low_bendi_threshold = data["measure_param"]["low_bendi_threshold"].ToString();
            machineParam.measure_param.measure_time = data["measure_param"]["measure_time"].ToString();
            machineParam.measure_param.pedestrian_shield_factor = data["measure_param"]["pedestrian_shield_factor"].ToString();
            machineParam.measure_param.radio_measure_smooth_factor = data["measure_param"]["radio_measure_smooth_factor"].ToString();
            machineParam.measure_param.severe_alarm_factor = data["measure_param"]["severe_alarm_factor"].ToString();
            machineParam.measure_param.severe_alarm_threshold = data["measure_param"]["severe_alarm_threshold"].ToString();
            machineParam.channel_settings["0"] = data["channel_settings"][0]["value"].ToString();
            machineParam.channel_settings["1"] = data["channel_settings"][1]["value"].ToString();
            machineParam.channel_settings["2"] = data["channel_settings"][2]["value"].ToString();
            machineParam.channel_settings["3"] = data["channel_settings"][3]["value"].ToString();
            machineParam.channel_settings["4"] = data["channel_settings"][4]["value"].ToString();
            machineParam.channel_settings["5"] = data["channel_settings"][5]["value"].ToString();
            machineParam.channel_settings["6"] = data["channel_settings"][6]["value"].ToString();
            machineParam.running_status.device_status = data["running_status"]["device_status"].ToString();
            machineParam.running_status.ip_address = data["running_status"]["ip_address"].ToString();
            machineParam.running_status.alarm_mod = data["running_status"]["alarm_mod"].ToString();   
        }
Ejemplo n.º 2
0
 public static string generateWriteParamJson(MachineParam machineParam)
 {       
     string retStr = JsonMapper.ToJson(machineParam);
     return retStr;
 }