Skip to content

Commit 20728fb

Browse files
author
Georgy Levchenko
committed
Refactoring.
1 parent 987cde1 commit 20728fb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Modules/SmartThermo.Modules.Analytics/ViewModels/AnalyticsWindowViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public class AnalyticsWindowViewModel : RegionViewModelBase
2929
private readonly List<SignalPlotXYConst<double, double>> _signalPlotXyConst = new List<SignalPlotXYConst<double, double>>();
3030
private readonly List<int> _groupSensorId = new List<int>();
3131
private readonly Timer _timer;
32-
33-
private List<Color> _colors = new List<Color>()
32+
private readonly List<Color> _colors = new List<Color>()
3433
{
3534
Color.FromArgb(0x00, 0x3f, 0x5c),
3635
Color.FromArgb(0x44, 0x4e, 0x86),
@@ -39,6 +38,7 @@ public class AnalyticsWindowViewModel : RegionViewModelBase
3938
Color.FromArgb(0xff, 0x6e, 0x54),
4039
Color.FromArgb(0xff, 0xa6, 0x00)
4140
};
41+
4242
private WpfPlot _plotControl;
4343
private Plot _plot;
4444
private VLine _vLine;
@@ -237,7 +237,7 @@ private async Task GetSensorDataAsync()
237237
var result = getItemsTask.Result;
238238

239239
var dateTime = result.Select(x => x.DataTime.ToOADate()).ToArray();
240-
DateLegend = result[0].DataTime.ToString();
240+
DateLegend = result[0].DataTime.ToString(CultureInfo.CurrentCulture);
241241

242242
LegendItems.Clear();
243243
LegendValueItems.Clear();
@@ -396,15 +396,15 @@ private void PlotControl_MouseMove(object sender, MouseEventArgs e)
396396

397397
var (mouseCoordsX, _) = PlotControl.GetMouseCoordinates();
398398
_legendValueItems.Clear();
399-
for (int i = 0; i < LegendItems.Count; i++)
399+
for (var i = 0; i < LegendItems.Count; i++)
400400
{
401401
var data = _signalPlotXyConst[i].GetPointNearestX(mouseCoordsX).y;
402402
_legendValueItems.Add((int)data);
403403
}
404404

405405
var result = _signalPlotXyConst[0].GetPointNearestX(mouseCoordsX).x;
406406
_vLine.X = result;
407-
DateLegend = DateTime.FromOADate(result).ToString();
407+
DateLegend = DateTime.FromOADate(result).ToString(CultureInfo.CurrentCulture);
408408

409409
_isUpdateChart = true;
410410
PlotControl.Render();

0 commit comments

Comments
 (0)