代码调整

main
xiaoguo 2 years ago
parent 657d21133b
commit 57654071fa

Binary file not shown.

@ -71,7 +71,7 @@ namespace PVDEMCS.Devices.Impl
/// </summary> /// </summary>
public bool IsRun public bool IsRun
{ {
get { return IsRun; } get { return isRun; }
} }
/// <summary> /// <summary>

@ -84,22 +84,31 @@ namespace PVDEMCS.Devices.Impl
{ {
foreach (var item in monitors) foreach (var item in monitors)
{ {
var task = item.StartAsync(); var task = item.StopAsync();
} }
} }
private void TaskRun() private void TaskRun()
{ {
Task.Run(() => Task.Run(() =>
{ {
while (true) while (true)
{ {
lock (lockObj) foreach (var item in monitors)
{ {
RunEquipmentRecord(); var task = item.StopAsync();
Thread.Sleep(1000);
} }
Thread.Sleep(5000);
}
});
Task.Run(() =>
{
while (true)
{
RunEquipmentRecord();
Thread.Sleep(1000);
} }
}); });
@ -108,12 +117,9 @@ namespace PVDEMCS.Devices.Impl
{ {
while (true) while (true)
{ {
lock (lockObj1) RunEquipmentRecordTotal();
{
RunEquipmentRecordTotal();
Thread.Sleep(1000 * 60); Thread.Sleep(1000 * 60);
}
} }
}); });
} }

@ -7,6 +7,13 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile> <GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Remove="Common\Configuration\**" />
<Content Remove="Common\Configuration\**" />
<EmbeddedResource Remove="Common\Configuration\**" />
<None Remove="Common\Configuration\**" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Autofac" Version="7.1.0" /> <PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" /> <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
@ -26,8 +33,4 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Common\Configuration\" />
</ItemGroup>
</Project> </Project>

Loading…
Cancel
Save