Skip to content

Commit

Permalink
Changed period poll registers and new version.
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxTes committed Apr 29, 2021
1 parent e8f534e commit 1a79476
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.Extensions.Logging;
using NModbus;
using NModbus.Logging;
using NModbus.Serial;
using SmartThermo.Services.DeviceConnector.Enums;
using SmartThermo.Services.DeviceConnector.Extensions;
Expand Down Expand Up @@ -28,8 +27,8 @@ public class DeviceConnector : IDeviceConnector

#region Const

private const int TimeStart = 3;
private const int TimePeriod = 3;
private const int TimeStart = 1;
private const int TimePeriod = 10;

#endregion

Expand Down Expand Up @@ -193,15 +192,11 @@ private async void OnTimer(object state)
RegistersRequested?.Invoke(this, result);
}

private void StartTimer()
{
_timer.Change(TimeSpan.FromSeconds(TimeStart), TimeSpan.FromSeconds(TimePeriod));
}
private void StartTimer()
=> _timer.Change(TimeSpan.FromSeconds(TimeStart), TimeSpan.FromSeconds(TimePeriod));

private void StopTimer()
{
_timer.Change(Timeout.Infinite, Timeout.Infinite);
}
private void StopTimer()
=> _timer.Change(Timeout.Infinite, Timeout.Infinite);

#endregion
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using SmartThermo.Services.DeviceConnector.Enums;
using SmartThermo.Services.DeviceConnector.Extensions;
using SmartThermo.Services.DeviceConnector.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using SmartThermo.Services.DeviceConnector.Extensions;

namespace SmartThermo.Services.DeviceConnector
{
Expand Down
2 changes: 1 addition & 1 deletion src/SmartThermo/Dialogs/Views/AboutDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Grid>
<ui:SimpleStackPanel Width="320" Spacing="16">
<TextBlock Style="{DynamicResource TitleTextBlockStyle}">SmartThermo</TextBlock>
<TextBlock>Версия прошивки - 0.5.2</TextBlock>
<TextBlock>Версия прошивки - 0.5.3</TextBlock>
<TextBlock TextWrapping="WrapWithOverflow">SmartThermo - это ПО для контроля, мониторинга и записи данных с датчиков температуры.</TextBlock>
</ui:SimpleStackPanel>
</Grid>
Expand Down
6 changes: 3 additions & 3 deletions src/SmartThermo/SmartThermo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<UseWPF>true</UseWPF>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AssemblyVersion>0.5.2.0</AssemblyVersion>
<FileVersion>0.5.2.0</FileVersion>
<Version>0.5.2</Version>
<AssemblyVersion>0.5.3.0</AssemblyVersion>
<FileVersion>0.5.3.0</FileVersion>
<Version>0.5.3</Version>
<SatelliteResourceLanguages>ru-RU</SatelliteResourceLanguages>
</PropertyGroup>

Expand Down

0 comments on commit 1a79476

Please sign in to comment.