Explorar el Código

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

reconfiguration
pry hace 3 meses
padre
commit
fd36927a15
Se han modificado 2 ficheros con 19 adiciones y 1 borrados
  1. +16
    -1
      BPASmartClient.Academy/Model/HistorySqlite.cs
  2. +3
    -0
      BPASmartClient.Academy/View/HistoryChartView.xaml.cs

+ 16
- 1
BPASmartClient.Academy/Model/HistorySqlite.cs Ver fichero

@@ -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 Ver fichero

@@ -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));


Cargando…
Cancelar
Guardar