1404 lines
56 KiB
C#
1404 lines
56 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using LiveCharts;
|
|
using LiveCharts.Defaults;
|
|
using LiveCharts.Wpf;
|
|
using MySqlConnector;
|
|
using 垂直剖面动态观测系统.Model;
|
|
|
|
namespace 垂直剖面动态观测系统.DataAccess
|
|
{
|
|
//用于对数据库的操作
|
|
public class LocalDataAccess
|
|
{
|
|
private static LocalDataAccess instance;
|
|
public LocalDataAccess() { }
|
|
public static LocalDataAccess GetInstance()
|
|
{
|
|
return instance ?? (instance = new LocalDataAccess());
|
|
}
|
|
|
|
List<CourseSeriesModel> cModelList = new List<CourseSeriesModel>();
|
|
|
|
//创建数据库相关的连接变量
|
|
MySqlConnection conn;
|
|
MySqlCommand comm;
|
|
MySqlDataAdapter adapter;
|
|
|
|
//统一的数据库操作完成的结束方法
|
|
private void Dispose()
|
|
{
|
|
if (adapter != null)
|
|
{
|
|
adapter.Dispose();
|
|
adapter = null;
|
|
}
|
|
if (comm != null)
|
|
{
|
|
comm.Dispose();
|
|
comm = null;
|
|
}
|
|
if (conn != null)
|
|
{
|
|
conn.Close();
|
|
conn.Dispose();
|
|
conn = null;
|
|
}
|
|
}
|
|
|
|
//统一的全局数据库连接
|
|
private bool DBConnection()
|
|
{
|
|
//从资源文件中获取名字为“db”的数据库连接信息
|
|
string connStr = ConfigurationManager.ConnectionStrings["db"].ToString();
|
|
if (conn == null)
|
|
conn = new MySqlConnection(connStr);
|
|
try
|
|
{
|
|
conn.Open();
|
|
return true;
|
|
}
|
|
catch (Exception)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
public void write(string sql)
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
MySqlCommand t1 = new MySqlCommand(sql, conn);
|
|
try
|
|
{
|
|
if (t1.ExecuteNonQuery() > 0)
|
|
{
|
|
// Console.WriteLine("数据插入成功了!");
|
|
}
|
|
}
|
|
catch (Exception err)
|
|
{
|
|
Console.WriteLine(err.Message);
|
|
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 首页传感器数据传输
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<CourseSeriesModel> GetCoursePlayRecord()
|
|
{
|
|
try
|
|
{
|
|
cModelList.Clear();
|
|
//进行数据库连接
|
|
if (DBConnection())
|
|
{
|
|
//系统环境参数
|
|
enviroment();
|
|
//浮标ADCP传感器
|
|
Buoy_sensor_adcpModel();
|
|
//浮标姿态传感器
|
|
//buoy_sensor_attitude();
|
|
//浮标中其他传感器
|
|
buoy_sensor_oth();
|
|
//接驳盒ADCP传感器
|
|
conbox_sensor_adcp();
|
|
//接驳盒其他传感器
|
|
conbox_sensor_oth();
|
|
//潜标ADCP传感器
|
|
Lattarget_sensor_adcp300();
|
|
//潜标中其他传感器
|
|
Lattarget_sensor_oth();
|
|
}
|
|
return cModelList;
|
|
}
|
|
catch (Exception err)
|
|
{
|
|
Console.WriteLine(err.Message);
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public GPSModel GetGPS()
|
|
{
|
|
string sql = "select * from gps ORDER BY datetime DESC LIMIT 1";
|
|
GPSModel gps = new GPSModel();
|
|
if (DBConnection())
|
|
{
|
|
comm = new MySqlCommand(sql,conn);
|
|
MySqlDataReader read = comm.ExecuteReader();
|
|
while (read.Read())
|
|
{
|
|
gps.datetime_Sensor = DateTime.Parse(read["datetime_Sensor"].ToString());
|
|
gps.JD = float.Parse(read["JD"].ToString());
|
|
gps.WD = float.Parse(read["WD"].ToString());
|
|
}
|
|
read.Close();
|
|
}
|
|
this.Dispose();
|
|
return gps;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 接驳盒其他传感器
|
|
/// </summary>
|
|
public void conbox_sensor_oth()
|
|
{
|
|
//sql语句 @user_name与@pwd为待添加的字符
|
|
string sql = @"select * from Conbox_sensor_othModel ORDER BY datetime DESC LIMIT 1";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
|
|
string courseId = "";
|
|
CourseSeriesModel cModel = null;
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
string tempId = dr.Field<int>("id").ToString();
|
|
if (courseId != tempId)
|
|
{
|
|
courseId = tempId;
|
|
cModel = new CourseSeriesModel();
|
|
cModelList.Add(cModel);
|
|
|
|
cModel.CourseName = "接驳盒其他传感器";
|
|
cModel.SeriesList = new System.Collections.ObjectModel.ObservableCollection<SeriesModel>();
|
|
}
|
|
if (cModel != null)
|
|
{
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CH4_压力值",
|
|
CurrentValue = dr.Field<float>("CH4_Pre") + " " + "μatm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CH4_甲烷浓度",
|
|
CurrentValue = dr.Field<float>("CH4_Con") + " " + "ppm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CO2_压力值",
|
|
CurrentValue = dr.Field<float>("CO2_Pre") + " " + "μatm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CO2_甲烷浓度",
|
|
CurrentValue = dr.Field<float>("CO2_Con") + " " + "ppm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "METS_Methane",
|
|
CurrentValue = dr.Field<float>("METS_Meth") + " " + "μatm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "METS_温度",
|
|
CurrentValue = dr.Field<float>("METS_Tem") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_温度",
|
|
CurrentValue = dr.Field<float>("CTD_Tem") + " " + "摄氏度",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_电导率",
|
|
CurrentValue = dr.Field<float>("CTD_Con") + " " + "s/m",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_压力",
|
|
CurrentValue = dr.Field<float>("CTD_Pre") + " " + "dbar",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "倾角传感器x方向",
|
|
CurrentValue = dr.Field<float>("Angle_sensor_x") + " " + "°",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "倾角传感器y方向",
|
|
CurrentValue = dr.Field<float>("Angle_sensor_y") + " " + "°",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "倾角传感器z方向",
|
|
CurrentValue = dr.Field<float>("Angle_sensor_z") + " " + "°",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD叶绿素",
|
|
CurrentValue = dr.Field<float>("CTD_YLS") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD浊度",
|
|
CurrentValue = dr.Field<float>("CTD_ZD") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_溶解氧",
|
|
CurrentValue = dr.Field<float>("CTD_Rjy") + " " + "mg/L",
|
|
});
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 潜标ADCP传感器
|
|
/// </summary>
|
|
public void Lattarget_sensor_adcp300()
|
|
{
|
|
//sql语句 @user_name与@pwd为待添加的字符
|
|
string sql = @"select * from lattarget_sensor_adcp300model ORDER BY datetime DESC LIMIT 1";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
|
|
string courseId = "";
|
|
CourseSeriesModel cModel = null;
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
string tempId = dr.Field<int>("id").ToString();
|
|
if (courseId != tempId)
|
|
{
|
|
courseId = tempId;
|
|
cModel = new CourseSeriesModel();
|
|
cModelList.Add(cModel);
|
|
|
|
cModel.CourseName = "潜标ADCP传感器";
|
|
cModel.SeriesList = new System.Collections.ObjectModel.ObservableCollection<SeriesModel>();
|
|
}
|
|
|
|
if (cModel != null)
|
|
{
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "压力",
|
|
CurrentValue = dr.Field<int>("Adcp_Pre") + " " + "μatm",
|
|
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "压缩比",
|
|
CurrentValue = dr.Field<int>("Adcp_Ysb") + " " + "%",
|
|
});
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 浮标ADCP传感器
|
|
/// </summary>
|
|
public void Buoy_sensor_adcpModel()
|
|
{
|
|
//sql语句 @user_name与@pwd为待添加的字符
|
|
string sql = @"select * from Buoy_sensor_adcpModel ORDER BY datetime DESC LIMIT 1";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
|
|
string courseId = "";
|
|
CourseSeriesModel cModel = null;
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
string tempId = dr.Field<int>("id").ToString();
|
|
if (courseId != tempId)
|
|
{
|
|
courseId = tempId;
|
|
cModel = new CourseSeriesModel();
|
|
cModelList.Add(cModel);
|
|
|
|
cModel.CourseName = "浮标ADCP传感器";
|
|
cModel.SeriesList = new System.Collections.ObjectModel.ObservableCollection<SeriesModel>();
|
|
}
|
|
|
|
if (cModel != null)
|
|
{
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "压力",
|
|
CurrentValue = dr.Field<int>("Adcp_Pre") + " " + "μatm",
|
|
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "压缩比",
|
|
CurrentValue = dr.Field<int>("Adcp_Ysb") + " " + "%",
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 浮标姿态传感器
|
|
/// </summary>
|
|
public void buoy_sensor_attitude()
|
|
{
|
|
//sql语句 @user_name与@pwd为待添加的字符
|
|
string sql = @"select * from buoy_sensor_attitudemodel ORDER BY datetime DESC LIMIT 1";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
|
|
string courseId = "";
|
|
CourseSeriesModel cModel = null;
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
string tempId = dr.Field<int>("id").ToString();
|
|
if (courseId != tempId)
|
|
{
|
|
courseId = tempId;
|
|
cModel = new CourseSeriesModel();
|
|
cModelList.Add(cModel);
|
|
|
|
cModel.CourseName = "浮标姿态传感器";
|
|
cModel.SeriesList = new System.Collections.ObjectModel.ObservableCollection<SeriesModel>();
|
|
}
|
|
|
|
if (cModel != null)
|
|
{
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "压力",
|
|
// CurrentValue = dr.Field<string>("Adcp_Pre"),
|
|
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 接驳盒ADCP传感器
|
|
/// </summary>
|
|
public void conbox_sensor_adcp()
|
|
{
|
|
//sql语句 @user_name与@pwd为待添加的字符
|
|
string sql = @"select * from conbox_sensor_adcpModel ORDER BY datetime DESC LIMIT 1";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
|
|
string courseId = "";
|
|
CourseSeriesModel cModel = null;
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
string tempId = dr.Field<int>("id").ToString();
|
|
if (courseId != tempId)
|
|
{
|
|
courseId = tempId;
|
|
cModel = new CourseSeriesModel();
|
|
cModelList.Add(cModel);
|
|
|
|
cModel.CourseName = "接驳盒ADCP传感器";
|
|
cModel.SeriesList = new System.Collections.ObjectModel.ObservableCollection<SeriesModel>();
|
|
}
|
|
|
|
if (cModel != null)
|
|
{
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "压力",
|
|
CurrentValue = dr.Field<int>("Adcp_Pre") + " " + "μatm",
|
|
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "压缩比",
|
|
CurrentValue = dr.Field<int>("Adcp_Ysb") + " " + "%",
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 系统环境参数
|
|
/// </summary>
|
|
public void enviroment()
|
|
{
|
|
//sql语句 @user_name与@pwd为待添加的字符
|
|
string sql = @"select * from enviroment_model ORDER BY datetime DESC LIMIT 1";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
|
|
string courseId = "";
|
|
CourseSeriesModel cModel = null;
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
string tempId = dr.Field<int>("id").ToString();
|
|
if (courseId != tempId)
|
|
{
|
|
courseId = tempId;
|
|
cModel = new CourseSeriesModel();
|
|
cModelList.Add(cModel);
|
|
|
|
cModel.CourseName = "系统环境参数";
|
|
cModel.SeriesList = new System.Collections.ObjectModel.ObservableCollection<SeriesModel>();
|
|
}
|
|
|
|
if (cModel != null)
|
|
{
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "浮标温度",
|
|
CurrentValue = dr.Field<float>("FB_Tem") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "浮标湿度",
|
|
CurrentValue = dr.Field<float>("FB_Hum") + " " + "%",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "24V输入电压",
|
|
CurrentValue = dr.Field<float>("FB_Vol_24_in") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "24V输入电流",
|
|
CurrentValue = dr.Field<float>("FB_Cur_24_in") + " " + "A",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "48V输出电压",
|
|
CurrentValue = dr.Field<float>("FB_Vol_48_out") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "95V输出电压",
|
|
CurrentValue = dr.Field<float>("FB_Vol_95_out") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "潜标温度1",
|
|
CurrentValue = dr.Field<float>("QB_Tem1") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "潜标温度2",
|
|
CurrentValue = dr.Field<float>("QB_Tem2") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "潜标湿度",
|
|
CurrentValue = dr.Field<float>("QB_Hum") + " " + "%",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "潜标漏水",
|
|
CurrentValue = dr.Field<float>("QB_Leak") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "接驳盒温度1",
|
|
CurrentValue = dr.Field<float>("JBH_Tem1") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "接驳盒温度2",
|
|
CurrentValue = dr.Field<float>("JBH_Tem2") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "接驳盒湿度",
|
|
CurrentValue = dr.Field<float>("JBH_Hum") + " " + "%",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "接驳盒漏水",
|
|
CurrentValue = dr.Field<float>("JBH_Leak") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "接驳盒24V 1",
|
|
CurrentValue = dr.Field<float>("JBH_Vol_24V_out") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "接驳盒24V 2",
|
|
CurrentValue = dr.Field<float>("JBH_Cur_24V_out") + " " + "V",
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 浮标中其他传感器
|
|
/// </summary>
|
|
public void buoy_sensor_oth()
|
|
{
|
|
//sql语句 @user_name与@pwd为待添加的字符
|
|
string sql = @"select * from Buoy_sensor_othModel ORDER BY datetime DESC LIMIT 1";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
|
|
string courseId = "";
|
|
CourseSeriesModel cModel = null;
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
string tempId = dr.Field<int>("id").ToString();
|
|
if (courseId != tempId)
|
|
{
|
|
courseId = tempId;
|
|
cModel = new CourseSeriesModel();
|
|
cModelList.Add(cModel);
|
|
|
|
cModel.CourseName = "浮标中其他传感器";
|
|
cModel.SeriesList = new System.Collections.ObjectModel.ObservableCollection<SeriesModel>();
|
|
}
|
|
|
|
if (cModel != null)
|
|
{
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CH4_压力值",
|
|
CurrentValue = dr.Field<float>("CH4_Pre") + " " + "μatm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CH4_甲烷浓度",
|
|
CurrentValue = dr.Field<float>("CH4_Con") + " " + "ppm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CO2_压力值",
|
|
CurrentValue = dr.Field<float>("CO2_Pre") + " " + "μatm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CO2_甲烷浓度",
|
|
CurrentValue = dr.Field<float>("CO2_Con") + " " + "ppm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "METS_Methane",
|
|
CurrentValue = dr.Field<float>("METS_Meth") + " " + "μatm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "METS_温度",
|
|
CurrentValue = dr.Field<float>("METS_Tem") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "气象_温度",
|
|
CurrentValue = dr.Field<float>("Air_Tem") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "气象_湿度",
|
|
CurrentValue = dr.Field<float>("Air_Hum") + " " + "%",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "气象_大气压",
|
|
CurrentValue = dr.Field<float>("Air_Pre") + " " + "Pa",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "气象_风向",
|
|
CurrentValue = dr.Field<float>("Wind_Dir") + "°",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "气象_风速",
|
|
CurrentValue = dr.Field<float>("Wind_Speed") + " " + "m/s",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "气象_最大风速",
|
|
CurrentValue = dr.Field<float>("Wind_Speed_Max") + " " + "m/s",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "气象_辐照度",
|
|
CurrentValue = dr.Field<float>("Fzd") + " ",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "气象_雨量",
|
|
CurrentValue = dr.Field<float>("RainFall") + " " + "inches",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "走航甲烷ch4_dry",
|
|
CurrentValue = dr.Field<float>("Go_sailing_CH4_Dry") + " " + "ppm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "走航甲烷h2o",
|
|
CurrentValue = dr.Field<float>("Go_sailing_CH4_H2O") + " " + "ppm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "走航甲烷 C2H6",
|
|
CurrentValue = dr.Field<float>("Go_sailing_CH4_C2H6") + " " + "ppb",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "温度",
|
|
CurrentValue = dr.Field<float>("Tem") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "湿度",
|
|
CurrentValue = dr.Field<float>("Hum") + " " + "%",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "24V电池输入电压",
|
|
CurrentValue = dr.Field<float>("Vol_24_in") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "24V电池输入电流",
|
|
CurrentValue = dr.Field<float>("Cur_24_in") + " " + "A",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "48V输出电压",
|
|
CurrentValue = dr.Field<float>("Vol_48_out") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "95V输出电压",
|
|
CurrentValue = dr.Field<float>("Vol_95_out") + " " + "V",
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 潜标中其他传感器
|
|
/// </summary>
|
|
public void Lattarget_sensor_oth()
|
|
{
|
|
//sql语句 @user_name与@pwd为待添加的字符
|
|
string sql = @"select * from Lattarget_sensor_othModel ORDER BY datetime DESC LIMIT 1";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
|
|
string courseId = "";
|
|
CourseSeriesModel cModel = null;
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
string tempId = dr.Field<int>("id").ToString();
|
|
if (courseId != tempId)
|
|
{
|
|
courseId = tempId;
|
|
cModel = new CourseSeriesModel();
|
|
cModelList.Add(cModel);
|
|
|
|
cModel.CourseName = "潜标中其他传感器";
|
|
cModel.SeriesList = new System.Collections.ObjectModel.ObservableCollection<SeriesModel>();
|
|
}
|
|
|
|
if (cModel != null)
|
|
{
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CO2_压力值",
|
|
CurrentValue = dr.Field<float>("CO2_Pre") + " " + "μatm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CO2_甲烷浓度",
|
|
CurrentValue = dr.Field<float>("CO2_Con") + " " + "ppm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "METS_Methane",
|
|
CurrentValue = dr.Field<float>("METS_Meth") + " " + "μatm",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "METS_温度",
|
|
CurrentValue = dr.Field<float>("METS_Tem") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_温度",
|
|
CurrentValue = dr.Field<float>("CTD_Tem") + " " + "℃",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_电导率",
|
|
CurrentValue = dr.Field<float>("CTD_Con") + " " + "s/m",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_压力",
|
|
CurrentValue = dr.Field<float>("CTD_Pre") + " " + "dbar",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD叶绿素",
|
|
CurrentValue = dr.Field<float>("CTD_YLS") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD浊度",
|
|
CurrentValue = dr.Field<float>("CTD_ZD") + " " + "V",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_溶解氧",
|
|
CurrentValue = dr.Field<float>("CTD_Rjy") + " " + "mg/L",
|
|
});
|
|
cModel.SeriesList.Add(new SeriesModel
|
|
{
|
|
SeriesName = "CTD_溶解氧电压",
|
|
CurrentValue = dr.Field<float>("CTD_Rjy_Vol") + " " + "V",
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
public List<Enviroment_Model> Enviroment_Models_List()
|
|
{
|
|
try
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
List<Enviroment_Model> enviroment_Models = new List<Enviroment_Model>();
|
|
string sql = @"select * from enviroment_model ORDER BY datetime DESC LIMIT 48";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
enviroment_Models.Add(new Enviroment_Model
|
|
{
|
|
Datetime = dr.Field<DateTime>("datetime"),
|
|
FB_Tem = dr.Field<float>("FB_Tem"),
|
|
FB_Hum = dr.Field<float>("FB_Hum"),
|
|
FB_Vol_24_in = dr.Field<float>("FB_Vol_24_in"),
|
|
FB_Cur_24_in = dr.Field<float>("FB_Cur_24_in"),
|
|
FB_Vol_48_out = dr.Field<float>("FB_Vol_48_out"),
|
|
FB_Vol_95_out = dr.Field<float>("FB_Vol_95_out"),
|
|
QB_Tem1 = dr.Field<float>("QB_Tem1"),
|
|
QB_Tem2 = dr.Field<float>("QB_Tem2"),
|
|
QB_Hum = dr.Field<float>("QB_Hum"),
|
|
QB_Leak = dr.Field<float>("QB_Leak"),
|
|
JBH_Tem1 = dr.Field<float>("JBH_Tem1"),
|
|
JBH_Tem2 = dr.Field<float>("JBH_Tem2"),
|
|
JBH_Hum = dr.Field<float>("JBH_Hum"),
|
|
JBH_Leak = dr.Field<float>("JBH_Leak"),
|
|
JBH_Vol_24V_out = dr.Field<float>("JBH_Vol_24V_out"),
|
|
JBH_Cur_24V_out = dr.Field<float>("JBH_Cur_24V_out"),
|
|
|
|
});
|
|
}
|
|
|
|
return enviroment_Models;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
|
|
public List<Buoy_sensor_adcpModel> Buoy_sensor_adcpModel_List()
|
|
{
|
|
try
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
List<Buoy_sensor_adcpModel> buoy_Sensor_AdcpModels = new List<Buoy_sensor_adcpModel>();
|
|
string sql = @"select * from buoy_sensor_adcpmodel ORDER BY datetime DESC LIMIT 48";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
buoy_Sensor_AdcpModels.Add(new Buoy_sensor_adcpModel
|
|
{
|
|
datetime_Sensor = dr.Field<DateTime>("datetime_Sensor"),
|
|
Adcp_Pre = dr.Field<int>("Adcp_Pre"),
|
|
Adcp_Ysb = dr.Field<int>("Adcp_Ysb"),
|
|
|
|
});
|
|
}
|
|
|
|
return buoy_Sensor_AdcpModels;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public List<Buoy_sensor_othModel> Buoy_sensor_othModel_List()
|
|
{
|
|
try
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
List<Buoy_sensor_othModel> buoy_sensor_othModel = new List<Buoy_sensor_othModel>();
|
|
string sql = @"select * from buoy_sensor_othmodel ORDER BY datetime DESC LIMIT 48";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
buoy_sensor_othModel.Add(new Buoy_sensor_othModel
|
|
{
|
|
datetime_Sensor = dr.Field<DateTime>("datetime_Sensor"),
|
|
CH4_Pre = dr.Field<float>("CH4_Pre"),
|
|
CH4_Con = dr.Field<float>("CH4_Con"),
|
|
CO2_Pre = dr.Field<float>("CO2_Pre"),
|
|
CO2_Con = dr.Field<float>("CO2_Con"),
|
|
METS_Meth = dr.Field<float>("METS_Meth"),
|
|
METS_Tem = dr.Field<float>("METS_Tem"),
|
|
Air_Tem = dr.Field<float>("Air_Tem"),
|
|
Air_Hum = dr.Field<float>("Air_Hum"),
|
|
Air_Pre = dr.Field<float>("Air_Pre"),
|
|
Wind_Dir = dr.Field<float>("Wind_Dir"),
|
|
Wind_Speed = dr.Field<float>("Wind_Speed"),
|
|
Wind_Speed_Max = dr.Field<float>("Wind_Speed_Max"),
|
|
Fzd = dr.Field<float>("Fzd"),
|
|
RainFall = dr.Field<float>("RainFall"),
|
|
Go_sailing_CH4_Dry = dr.Field<float>("Go_sailing_CH4_Dry"),
|
|
Go_sailing_CH4_H2O = dr.Field<float>("Go_sailing_CH4_H2O"),
|
|
Go_sailing_CH4_C2H6 = dr.Field<float>("Go_sailing_CH4_C2H6"),
|
|
Tem = dr.Field<float>("Tem"),
|
|
Hum = dr.Field<float>("Hum"),
|
|
Vol_24_in = dr.Field<float>("Vol_24_in"),
|
|
Cur_24_in = dr.Field<float>("Cur_24_in"),
|
|
Vol_48_out = dr.Field<float>("Vol_48_out"),
|
|
Vol_95_out = dr.Field<float>("Vol_95_out"),
|
|
|
|
});
|
|
}
|
|
|
|
return buoy_sensor_othModel;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public List<Conbox_sensor_adcpModel> Conbox_sensor_adcpModel_List()
|
|
{
|
|
try
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
List<Conbox_sensor_adcpModel> conbox_Sensor_AdcpModels = new List<Conbox_sensor_adcpModel>();
|
|
string sql = @"select * from conbox_sensor_adcpmodel ORDER BY datetime DESC LIMIT 48";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
conbox_Sensor_AdcpModels.Add(new Conbox_sensor_adcpModel
|
|
{
|
|
datetime_Sensor = dr.Field<DateTime>("datetime_Sensor"),
|
|
Adcp_Pre = dr.Field<int>("Adcp_Pre"),
|
|
Adcp_Ysb = dr.Field<int>("Adcp_Ysb"),
|
|
|
|
});
|
|
}
|
|
|
|
return conbox_Sensor_AdcpModels;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public List<Conbox_sensor_othModel> Conbox_sensor_othModel_List()
|
|
{
|
|
try
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
List<Conbox_sensor_othModel> conbox_Sensor_OthModels = new List<Conbox_sensor_othModel>();
|
|
string sql = @"select * from conbox_sensor_othmodel ORDER BY datetime DESC LIMIT 48";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
conbox_Sensor_OthModels.Add(new Conbox_sensor_othModel
|
|
{
|
|
datetime_Sensor = dr.Field<DateTime>("datetime_Sensor"),
|
|
CH4_Pre = dr.Field<float>("CH4_Pre"),
|
|
CH4_Con = dr.Field<float>("CH4_Con"),
|
|
CO2_Pre = dr.Field<float>("CO2_Pre"),
|
|
CO2_Con = dr.Field<float>("CO2_Con"),
|
|
METS_Meth = dr.Field<float>("METS_Meth"),
|
|
METS_Tem = dr.Field<float>("METS_Tem"),
|
|
CTD_Tem = dr.Field<float>("CTD_Tem"),
|
|
CTD_Con = dr.Field<float>("CTD_Con"),
|
|
CTD_Pre = dr.Field<float>("CTD_Pre"),
|
|
Angle_sensor_x = dr.Field<float>("Angle_sensor_x"),
|
|
Angle_sensor_y = dr.Field<float>("Angle_sensor_y"),
|
|
Angle_sensor_z = dr.Field<float>("Angle_sensor_z"),
|
|
CTD_YLS = dr.Field<float>("CTD_YLS"),
|
|
CTD_ZD = dr.Field<float>("CTD_ZD"),
|
|
CTD_Rjy = dr.Field<float>("CTD_Rjy")
|
|
|
|
});
|
|
}
|
|
|
|
return conbox_Sensor_OthModels;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public List<Lattarget_sensor_adcp300Model> Lattarget_sensor_adcp300Model_List()
|
|
{
|
|
try
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
List<Lattarget_sensor_adcp300Model> lattarget_Sensor_Adcp300Models = new List<Lattarget_sensor_adcp300Model>();
|
|
string sql = @"select * from lattarget_sensor_adcp300model ORDER BY datetime DESC LIMIT 48";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
lattarget_Sensor_Adcp300Models.Add(new Lattarget_sensor_adcp300Model
|
|
{
|
|
datetime_Sensor = dr.Field<DateTime>("datetime_Sensor"),
|
|
Adcp_Pre = dr.Field<int>("Adcp_Pre"),
|
|
Adcp_Ysb = dr.Field<int>("Adcp_Ysb"),
|
|
|
|
});
|
|
}
|
|
|
|
return lattarget_Sensor_Adcp300Models;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public List<Lattarget_sensor_othModel> Lattarget_sensor_othModel_List()
|
|
{
|
|
try
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
List<Lattarget_sensor_othModel> lattarget_Sensor_OthModels = new List<Lattarget_sensor_othModel>();
|
|
string sql = @"select * from lattarget_sensor_othmodel ORDER BY datetime DESC LIMIT 48";
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
lattarget_Sensor_OthModels.Add(new Lattarget_sensor_othModel
|
|
{
|
|
datetime_Sensor = dr.Field<DateTime>("datetime_Sensor"),
|
|
CO2_Pre = dr.Field<float>("CO2_Pre"),
|
|
CO2_Con = dr.Field<float>("CO2_Con"),
|
|
METS_Meth = dr.Field<float>("METS_Meth"),
|
|
METS_Tem = dr.Field<float>("METS_Tem"),
|
|
CTD_Tem = dr.Field<float>("CTD_Tem"),
|
|
CTD_Con = dr.Field<float>("CTD_Con"),
|
|
CTD_Pre = dr.Field<float>("CTD_Pre"),
|
|
CTD_YLS = dr.Field<float>("CTD_YLS"),
|
|
CTD_ZD = dr.Field<float>("CTD_ZD"),
|
|
CTD_Rjy = dr.Field<float>("CTD_Rjy"),
|
|
CTD_Rjy_Vol = dr.Field<float>("CTD_Rjy_Vol"),
|
|
Angle_sensor_x = dr.Field<float>("Angle_sensor_x"),
|
|
Angle_sensor_y = dr.Field<float>("Angle_sensor_y"),
|
|
Angle_sensor_z = dr.Field<float>("Angle_sensor_z"),
|
|
|
|
});
|
|
}
|
|
|
|
return lattarget_Sensor_OthModels;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public Para_Model GetParaDate(string name, string pass, string starttime, string endtime)
|
|
{
|
|
try
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
Para_Model para_Model = new Para_Model();
|
|
string sql = "";
|
|
if (starttime == null && endtime == null)
|
|
{
|
|
sql = @"select datetime," + name + " from " + pass + " ORDER BY datetime DESC LIMIT 48";
|
|
}
|
|
else
|
|
{
|
|
sql = @"select datetime," + name + " from " + pass + " WHERE datetime > '" + starttime + "' AND datetime < '" + endtime + "';";
|
|
}
|
|
adapter = new MySqlDataAdapter(sql, conn);
|
|
|
|
//创建一个DataTable用于接收数据库中的数据
|
|
DataTable table = new DataTable();
|
|
int count = adapter.Fill(table);
|
|
//遍历一下
|
|
foreach (DataRow dr in table.AsEnumerable())
|
|
{
|
|
para_Model.DateTime.Add(dr.Field<DateTime>("datetime").ToString());
|
|
para_Model.Para_LC.Add(dr.Field<float>(name));
|
|
para_Model.Para.Add(dr.Field<float>(name));
|
|
}
|
|
return para_Model;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
this.Dispose();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public Para_LimitModel GetLimitModel()
|
|
{
|
|
if (DBConnection())
|
|
{
|
|
List<Para_LimitModel> list = new List<Para_LimitModel>();
|
|
string sql = "select * from Para_Limit";
|
|
MySqlCommand cmd = new MySqlCommand(sql, conn);
|
|
try
|
|
{
|
|
MySqlDataReader reader = cmd.ExecuteReader();
|
|
while (reader.Read())
|
|
{
|
|
list.Add(new Para_LimitModel()
|
|
{
|
|
Para_Name = reader["Para_Name"].ToString(),
|
|
Min = Convert.ToInt32(reader["Min"]),
|
|
Max = Convert.ToInt32(reader["Max"])
|
|
}); ;
|
|
}
|
|
reader.Close();
|
|
conn.Close();
|
|
|
|
Para_LimitModel para_LimitModel = new Para_LimitModel();
|
|
foreach (Para_LimitModel item in list)
|
|
{
|
|
if (item.Para_Name == "Tem")
|
|
{
|
|
para_LimitModel.Tem_Min = item.Min;
|
|
para_LimitModel.Tem_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Hum")
|
|
{
|
|
para_LimitModel.Hum_Min = item.Min;
|
|
para_LimitModel.Hum_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Vol_24")
|
|
{
|
|
para_LimitModel.Vol_24_Min = item.Min;
|
|
para_LimitModel.Vol_24_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Cur_24")
|
|
{
|
|
para_LimitModel.Cur_24_Min = item.Min;
|
|
para_LimitModel.Cur_24_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Vol_48")
|
|
{
|
|
para_LimitModel.Vol_48_Min = item.Min;
|
|
para_LimitModel.Vol_48_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Vol_95")
|
|
{
|
|
para_LimitModel.Vol_95_Min = item.Min;
|
|
para_LimitModel.Vol_95_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CH4_YL")
|
|
{
|
|
para_LimitModel.CH4_YL_Min = item.Min;
|
|
para_LimitModel.CH4_YL_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CH4_ND")
|
|
{
|
|
para_LimitModel.CH4_ND_Min = item.Min;
|
|
para_LimitModel.CH4_ND_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CO2_YL")
|
|
{
|
|
para_LimitModel.CO2_YL_Min = item.Min;
|
|
para_LimitModel.CO2_YL_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CO2_ND")
|
|
{
|
|
para_LimitModel.CO2_ND_Min = item.Min;
|
|
para_LimitModel.CO2_ND_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CH4_DRY")
|
|
{
|
|
para_LimitModel.CH4_DRY_Min = item.Min;
|
|
para_LimitModel.CH4_DRY_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "C2H6")
|
|
{
|
|
para_LimitModel.C2H6_Min = item.Min;
|
|
para_LimitModel.C2H6_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "H2O")
|
|
{
|
|
para_LimitModel.H2O_Min = item.Min;
|
|
para_LimitModel.H2O_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Air_Tem")
|
|
{
|
|
para_LimitModel.Air_Tem_Min = item.Min;
|
|
para_LimitModel.Air_Tem_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Air_Hum")
|
|
{
|
|
para_LimitModel.Air_Hum_Min = item.Min;
|
|
para_LimitModel.Air_Hum_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Air_Pre")
|
|
{
|
|
para_LimitModel.Air_Pre_Min = item.Min;
|
|
para_LimitModel.Air_Pre_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Air_Dir")
|
|
{
|
|
para_LimitModel.Air_Dir_Min = item.Min;
|
|
para_LimitModel.Air_Dir_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Air_Speed")
|
|
{
|
|
para_LimitModel.Air_Speed_Min = item.Min;
|
|
para_LimitModel.Air_Speed_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Air_Speed_Max")
|
|
{
|
|
para_LimitModel.Air_Speed_Max_Min = item.Min;
|
|
para_LimitModel.Air_Speed_Max_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "FZD")
|
|
{
|
|
para_LimitModel.FZD_Min = item.Min;
|
|
para_LimitModel.FZD_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Rainfall")
|
|
{
|
|
para_LimitModel.Rainfall_Min = item.Min;
|
|
para_LimitModel.Rainfall_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "ADCP_Pre")
|
|
{
|
|
para_LimitModel.ADCP_Pre_Min = item.Min;
|
|
para_LimitModel.ADCP_Pre_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "ADCP_YSB")
|
|
{
|
|
para_LimitModel.ADCP_YSB_Min = item.Min;
|
|
para_LimitModel.ADCP_YSB_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Leak")
|
|
{
|
|
para_LimitModel.Leak_Min = item.Min;
|
|
para_LimitModel.Leak_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Mets_Me")
|
|
{
|
|
para_LimitModel.Mets_Me_Min = item.Min;
|
|
para_LimitModel.Mets_Me_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Mets_Tem")
|
|
{
|
|
para_LimitModel.Mets_Tem_Min = item.Min;
|
|
para_LimitModel.Mets_Tem_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CTD_Tem")
|
|
{
|
|
para_LimitModel.CTD_Tem_Min = item.Min;
|
|
para_LimitModel.CTD_Tem_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CTD_Pre")
|
|
{
|
|
para_LimitModel.CTD_Pre_Min = item.Min;
|
|
para_LimitModel.CTD_Pre_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CTD_ZD")
|
|
{
|
|
para_LimitModel.CTD_ZD_Min = item.Min;
|
|
para_LimitModel.CTD_ZD_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CTD_DDL")
|
|
{
|
|
para_LimitModel.CTD_DDL_Min = item.Min;
|
|
para_LimitModel.CTD_DDL_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CTD_YLS")
|
|
{
|
|
para_LimitModel.CTD_YLS_Min = item.Min;
|
|
para_LimitModel.CTD_YLS_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CTD_RJY")
|
|
{
|
|
para_LimitModel.CTD_RJY_Min = item.Min;
|
|
para_LimitModel.CTD_RJY_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "CTD_RJY_VOL")
|
|
{
|
|
para_LimitModel.CTD_RJY_VOL_Min = item.Min;
|
|
para_LimitModel.CTD_RJY_VOL_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Ati_X")
|
|
{
|
|
para_LimitModel.Ati_X_Min = item.Min;
|
|
para_LimitModel.Ati_X_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Ati_Y")
|
|
{
|
|
para_LimitModel.Ati_Y_Min = item.Min;
|
|
para_LimitModel.Ati_Y_Max = item.Max;
|
|
}
|
|
if (item.Para_Name == "Ati_Z")
|
|
{
|
|
para_LimitModel.Ati_Z_Min = item.Min;
|
|
para_LimitModel.Ati_Z_Max = item.Max;
|
|
}
|
|
}
|
|
|
|
return para_LimitModel;
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|