物联网:CR1000X采集器数据透传

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace CyberWin.Trade.Agriculture.BjtnjyR1000Convert.DataTrans
{
   public  class Cl_campbellscicr1000
    {
        
        public static void sensorHandller(string dataSrcPath)
        {
            if(dataSrcPath.IndexOf("Hourly") > 0){
                sensorHourHandller(dataSrcPath);
            }
        }
        public static void sensorHourHandller(string dataSrcPath)
        {
            DataTable dt= Cl_CyberWin_CsvFileReader.ReadCSV(dataSrcPath, 1);

            DataRow dr_cr1000_数据 = dt.Rows[3];

            string cr1000_session = dr_cr1000_数据["RECORD"].ToString();
            string cr1000_datetime = dr_cr1000_数据["TIMESTAMP"].ToString();

            //空气湿度
            string cr1000_air_rh = dr_cr1000_数据["EncRH"].ToString();

            //空气温度
            string cr1000_air_wd = dr_cr1000_数据["AirTC_Avg"].ToString();

            //土壤水分
            string cr1000_soil_rh = dr_cr1000_数据["VW_Avg"].ToString();

            //土壤温度
            string cr1000_soil_wd = dr_cr1000_数据["T107_C_Avg"].ToString();

            //太阳辐射
            string cr1000_sun_fs = dr_cr1000_数据["SlrW_Avg"].ToString();

            //风速
            string cr1000_wind_speed = dr_cr1000_数据["WS_ms_Avg"].ToString();

            //降雨量
            string cr1000_rain_mm = dr_cr1000_数据["Rain_mm_Tot"].ToString();

            //风向
            string cr1000_wind_dir = "0";// dr_cr1000_数据["TIMESTAMP"].ToString();

            //数据打包
            Cl_CyberWn_Sensor_Packager cl_数据打包 = new Cl_CyberWn_Sensor_Packager();


            cl_数据打包.data_seeion = cr1000_session;
            cl_数据打包.data_time = cr1000_datetime;
            cl_数据打包.sensor_airHumidity = cr1000_air_rh;
            cl_数据打包.sensor_airTemperature = cr1000_air_wd;
            cl_数据打包.sensor_light_radiation = cr1000_sun_fs.CWPD_ToInt32();
            cl_数据打包.sensor_soilMoisture = cr1000_soil_rh;
            cl_数据打包.sensor_soilTemperature = cr1000_soil_wd;
            cl_数据打包.sensor_windDirection = cr1000_wind_dir;
            cl_数据打包.sensor_windSpeed = cr1000_wind_speed;
            cl_数据打包.sensor_rainfall = cr1000_rain_mm;

            cl_数据打包.company_token = "dcbb";
            cl_数据打包.hard_no = "abcdefabccaa";

           string 传感器数据= cl_数据打包.cwpd_ToPackageString();

            Cl_cyberwin_dataSender cl_数据发送器 = new Cl_cyberwin_dataSender();
            cl_数据发送器._Conn();
            cl_数据发送器.ClientSendMsg(传感器数据);







        }
    }
}

 

你可能感兴趣的:(windows,内核,物联网)