Browse Source

Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration

reconfiguration
pry 1 month ago
parent
commit
fd36927a15
2 changed files with 19 additions and 1 deletions
  1. +16
    -1
      BPASmartClient.Academy/Model/HistorySqlite.cs
  2. +3
    -0
      BPASmartClient.Academy/View/HistoryChartView.xaml.cs

+ 16
- 1
BPASmartClient.Academy/Model/HistorySqlite.cs View File

@@ -103,7 +103,22 @@ namespace BPASmartClient.Academy.Model
{
try
{
return Db.Queryable<SaveData>().Where(o => o.Name == Name).ToList();
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"AccessFile\\DB\\data{DateString}.db");
if (File.Exists(path))
{
Db = new SqlSugarScope(new ConnectionConfig()
{
ConnectionString = $"Data Source = {path}",
DbType = DbType.Sqlite,
IsAutoCloseConnection = true,
});
return Db.Queryable<SaveData>().Where(o => o.Name == Name).ToList();
}
else
{
return null;
}
}
catch (Exception)
{


+ 3
- 0
BPASmartClient.Academy/View/HistoryChartView.xaml.cs View File

@@ -47,6 +47,7 @@ namespace BPASmartClient.Academy.View
List<DataPoint> twValues = new List<DataPoint>();
List<DataPoint> tvValues = new List<DataPoint>();
List<DataPoint> tmValues = new List<DataPoint>();
HistorySqlite.GetInstance.DateString = recipeChart.CreateTime.ToString("yyyy-MM-dd");
HistorySqlite.GetInstance.SelectName(recipeChart.Name).ForEach(t =>
{
twValues.Add(new DataPoint(DateTimeAxis.ToDouble(t.Date), t.TempWok));
@@ -75,6 +76,7 @@ namespace BPASmartClient.Academy.View
OxyPlot.Series.LineSeries line_4 = new OxyPlot.Series.LineSeries() { LineStyle = LineStyle.Solid, Title = "配料罐转速", MarkerFill = OxyColor.FromRgb(110, 79, 79), MarkerSize = 2, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };
List<DataPoint> m101 = new List<DataPoint>();
List<DataPoint> m102 = new List<DataPoint>();
HistorySqlite.GetInstance.DateString = recipeChart.CreateTime.ToString("yyyy-MM-dd");
HistorySqlite.GetInstance.SelectName(recipeChart.Name).ForEach(t =>
{
m101.Add(new DataPoint(DateTimeAxis.ToDouble(t.Date), t.M101_Speed));
@@ -98,6 +100,7 @@ namespace BPASmartClient.Academy.View
plotModel = new PlotModel() { Title = "冷却水罐重量曲线" };
List<DataPoint> ww = new List<DataPoint>();
OxyPlot.Series.LineSeries line_5 = new OxyPlot.Series.LineSeries() { Title = "冷却水罐重量", Color = OxyColor.FromRgb(0, 0, 0), LineStyle = LineStyle.Solid, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };
HistorySqlite.GetInstance.DateString = recipeChart.CreateTime.ToString("yyyy-MM-dd");
HistorySqlite.GetInstance.SelectName(recipeChart.Name).ForEach(t =>
{
ww.Add(new DataPoint(DateTimeAxis.ToDouble(t.Date), t.WeightWok));


Loading…
Cancel
Save