|
|
@ -129,78 +129,75 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
|
|
|
|
public CurveDiagramViewModel() |
|
|
|
{ |
|
|
|
|
|
|
|
Curve(CurveDiagram.Curve); |
|
|
|
Curve(CurveDiagram.mode, CurveDiagram.mac, CurveDiagram.starT, CurveDiagram.endT, CurveDiagram.Curve); |
|
|
|
} |
|
|
|
public static void Curve(string SYSWorkNumder) |
|
|
|
public static void Curve(bool mode, string m, string s, string e, string w) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(SYSWorkNumder)) |
|
|
|
if (mode) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(w)) return; |
|
|
|
SQLiteHelpers = new SQLiteHelper(ChartAdress); //数据库连接路径
|
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
CDB = SQLiteHelpers.ExecuteDataSet("select * from Chart where WorkOrder = '" + SYSWorkNumder + "'order by Time", null).Tables[0]; |
|
|
|
CDB = SQLiteHelpers.ExecuteDataSet("select * from Chart where WorkOrder = '" + w + "'order by Time", null).Tables[0]; |
|
|
|
SQLiteHelpers.Close(); |
|
|
|
CDB_Count = CDB.Rows.Count; |
|
|
|
|
|
|
|
var MTT_items = new List<DateTimePoint>(); |
|
|
|
var MTL_items = new List<DateTimePoint>(); |
|
|
|
var MTH_items = new List<DateTimePoint>(); |
|
|
|
var MST_items = new List<DateTimePoint>(); |
|
|
|
var MUT_items = new List<DateTimePoint>(); |
|
|
|
var STTA_items = new List<DateTimePoint>(); |
|
|
|
var STLA_items = new List<DateTimePoint>(); |
|
|
|
var STTB_items = new List<DateTimePoint>(); |
|
|
|
var STLB_items = new List<DateTimePoint>(); |
|
|
|
var STTC_items = new List<DateTimePoint>(); |
|
|
|
var STLC_items = new List<DateTimePoint>(); |
|
|
|
for (var i = 0; i < CDB_Count; i++) |
|
|
|
{ |
|
|
|
DateTime TIME = Convert.ToDateTime(CDB.Rows[i].Field<string>("Time")); |
|
|
|
MTT_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTT"))); |
|
|
|
MTL_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTL"))); |
|
|
|
MTH_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTH"))); |
|
|
|
MST_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MST"))); |
|
|
|
MUT_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MUT"))); |
|
|
|
if (MainWindowViewModel.SYS_AT1 == 1) |
|
|
|
{ |
|
|
|
STTA_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTA"))); |
|
|
|
STLA_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLA"))); |
|
|
|
} |
|
|
|
if (MainWindowViewModel.SYS_AT2 == 1) |
|
|
|
{ |
|
|
|
STTB_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTB"))); |
|
|
|
STLB_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLB"))); |
|
|
|
} |
|
|
|
if (MainWindowViewModel.SYS_AT3 == 1) |
|
|
|
{ |
|
|
|
STTC_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTC"))); |
|
|
|
STLC_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLC"))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(m)) return; |
|
|
|
if (string.IsNullOrEmpty(s)) return; |
|
|
|
if (string.IsNullOrEmpty(e)) return; |
|
|
|
SQLiteHelpers = new SQLiteHelper(ChartAdress); //数据库连接路径
|
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
CDB = SQLiteHelpers.ExecuteDataSet("select * from Chart where Machine = '" + m + "'" + |
|
|
|
" and Time > '" + s + "' and Time < '" + e + "' order by Time", null).Tables[0]; |
|
|
|
SQLiteHelpers.Close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
MTT_values = new ObservableCollection<DateTimePoint>(MTT_items); |
|
|
|
MTL_values = new ObservableCollection<DateTimePoint>(MTL_items); |
|
|
|
MTH_values = new ObservableCollection<DateTimePoint>(MTH_items); |
|
|
|
MST_values = new ObservableCollection<DateTimePoint>(MST_items); |
|
|
|
MUT_values = new ObservableCollection<DateTimePoint>(MUT_items); |
|
|
|
if (MainWindowViewModel.SYS_AT1 == 1) |
|
|
|
{ |
|
|
|
STTA_values = new ObservableCollection<DateTimePoint>(STTA_items); |
|
|
|
STLA_values = new ObservableCollection<DateTimePoint>(STLA_items); |
|
|
|
} |
|
|
|
if (MainWindowViewModel.SYS_AT2 == 1) |
|
|
|
{ |
|
|
|
STTB_values = new ObservableCollection<DateTimePoint>(STTB_items); |
|
|
|
STLB_values = new ObservableCollection<DateTimePoint>(STLB_items); |
|
|
|
} |
|
|
|
if (MainWindowViewModel.SYS_AT3 == 1) |
|
|
|
{ |
|
|
|
STTC_values = new ObservableCollection<DateTimePoint>(STTC_items); |
|
|
|
STLC_values = new ObservableCollection<DateTimePoint>(STLC_items); |
|
|
|
} |
|
|
|
CDB_Count = CDB.Rows.Count; |
|
|
|
var MTT_items = new List<DateTimePoint>(); |
|
|
|
var MTL_items = new List<DateTimePoint>(); |
|
|
|
var MTH_items = new List<DateTimePoint>(); |
|
|
|
var MST_items = new List<DateTimePoint>(); |
|
|
|
var MUT_items = new List<DateTimePoint>(); |
|
|
|
var STTA_items = new List<DateTimePoint>(); |
|
|
|
var STLA_items = new List<DateTimePoint>(); |
|
|
|
var STTB_items = new List<DateTimePoint>(); |
|
|
|
var STLB_items = new List<DateTimePoint>(); |
|
|
|
var STTC_items = new List<DateTimePoint>(); |
|
|
|
var STLC_items = new List<DateTimePoint>(); |
|
|
|
for (var i = 0; i < CDB_Count; i++) |
|
|
|
{ |
|
|
|
DateTime TIME = Convert.ToDateTime(CDB.Rows[i].Field<string>("Time")); |
|
|
|
MTT_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTT"))); |
|
|
|
MTL_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTL"))); |
|
|
|
MTH_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTH"))); |
|
|
|
MST_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MST"))); |
|
|
|
MUT_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MUT"))); |
|
|
|
STTA_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTA"))); |
|
|
|
STLA_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLA"))); |
|
|
|
STTB_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTB"))); |
|
|
|
STLB_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLB"))); |
|
|
|
STTC_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTC"))); |
|
|
|
STLC_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLC"))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Series = new ISeries[] |
|
|
|
{ |
|
|
|
MTT_values = new ObservableCollection<DateTimePoint>(MTT_items); |
|
|
|
MTL_values = new ObservableCollection<DateTimePoint>(MTL_items); |
|
|
|
MTH_values = new ObservableCollection<DateTimePoint>(MTH_items); |
|
|
|
MST_values = new ObservableCollection<DateTimePoint>(MST_items); |
|
|
|
MUT_values = new ObservableCollection<DateTimePoint>(MUT_items); |
|
|
|
STTA_values = new ObservableCollection<DateTimePoint>(STTA_items); |
|
|
|
STLA_values = new ObservableCollection<DateTimePoint>(STLA_items); |
|
|
|
STTB_values = new ObservableCollection<DateTimePoint>(STTB_items); |
|
|
|
STLB_values = new ObservableCollection<DateTimePoint>(STLB_items); |
|
|
|
STTC_values = new ObservableCollection<DateTimePoint>(STTC_items); |
|
|
|
STLC_values = new ObservableCollection<DateTimePoint>(STLC_items); |
|
|
|
|
|
|
|
Series = new ISeries[] |
|
|
|
{ |
|
|
|
new LineSeries<DateTimePoint> |
|
|
|
{ |
|
|
|
Name = Properties.Resources.MasterCylinder +"PH", |
|
|
@ -247,7 +244,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
}, //缸底
|
|
|
|
new LineSeries<DateTimePoint> |
|
|
|
{ |
|
|
|
Name = Properties.Resources.Temperature +"3("+Resources.Medicine + Resources.Tank +"1)", |
|
|
|
Name = Properties.Resources.Temperature +"3("+Resources.attached + Resources.Tank +"1)", |
|
|
|
Values = STTA_values, |
|
|
|
Stroke = new SolidColorPaint(s_blue_1, 2), |
|
|
|
GeometrySize = 0, |
|
|
@ -258,7 +255,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
}, //附缸1
|
|
|
|
new LineSeries<DateTimePoint> |
|
|
|
{ |
|
|
|
Name = Properties.Resources.Temperature +"4("+Resources.Medicine + Resources.Tank +"2)", |
|
|
|
Name = Properties.Resources.Temperature +"4("+Resources.attached + Resources.Tank +"2)", |
|
|
|
Values = STTB_values, |
|
|
|
Stroke = new SolidColorPaint(s_blue_2, 2), |
|
|
|
GeometrySize = 0, |
|
|
@ -269,7 +266,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
}, //附缸2
|
|
|
|
new LineSeries<DateTimePoint> |
|
|
|
{ |
|
|
|
Name = Properties.Resources.Temperature +"5("+Resources.Medicine + Resources.Tank +"3)", |
|
|
|
Name = Properties.Resources.Temperature +"5("+Resources.attached + Resources.Tank +"3)", |
|
|
|
Values = STTC_values, |
|
|
|
Stroke = new SolidColorPaint(s_blue_3, 2), |
|
|
|
GeometrySize = 0, |
|
|
@ -291,7 +288,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
}, //主缸液位
|
|
|
|
new LineSeries<DateTimePoint> |
|
|
|
{ |
|
|
|
Name = Properties.Resources.WaterLevel +"("+Resources.Medicine + Resources.Tank +"1)", |
|
|
|
Name = Properties.Resources.WaterLevel +"("+Resources.attached + Resources.Tank +"1)", |
|
|
|
Values = STLA_values, |
|
|
|
Stroke = new SolidColorPaint(s_red_1, 2), |
|
|
|
GeometrySize = 0, |
|
|
@ -302,7 +299,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
}, //附缸1液位
|
|
|
|
new LineSeries<DateTimePoint> |
|
|
|
{ |
|
|
|
Name = Properties.Resources.WaterLevel +"("+Resources.Medicine + Resources.Tank +"2)", |
|
|
|
Name = Properties.Resources.WaterLevel +"("+Resources.attached + Resources.Tank +"2)", |
|
|
|
Values = STLB_values, |
|
|
|
Stroke = new SolidColorPaint(s_red_2, 2), |
|
|
|
GeometrySize = 0, |
|
|
@ -313,7 +310,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
}, //附缸2液位
|
|
|
|
new LineSeries<DateTimePoint> |
|
|
|
{ |
|
|
|
Name = Properties.Resources.WaterLevel +"("+Resources.Medicine + Resources.Tank +"3)", |
|
|
|
Name = Properties.Resources.WaterLevel +"("+Resources.attached + Resources.Tank +"3)", |
|
|
|
Values = STLC_values, |
|
|
|
Stroke = new SolidColorPaint(s_red_3, 2), |
|
|
|
GeometrySize = 0, |
|
|
@ -322,9 +319,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
LineSmoothness = 0, |
|
|
|
ScalesYAt = 1, |
|
|
|
}, //附缸3 液位
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|