解决了uaserver初始化失败的问题
This commit is contained in:
parent
724c46a9f1
commit
cb00bed893
Binary file not shown.
@ -73,14 +73,14 @@ namespace IoTGateway
|
|||||||
|
|
||||||
|
|
||||||
services.AddHostedService<IoTBackgroundService>();
|
services.AddHostedService<IoTBackgroundService>();
|
||||||
services.AddSingleton<UAService>();
|
|
||||||
services.AddSingleton<DeviceService>();
|
services.AddSingleton<DeviceService>();
|
||||||
services.AddSingleton<DrvierService>();
|
services.AddSingleton<DrvierService>();
|
||||||
|
services.AddSingleton<UAService>();
|
||||||
services.AddSingleton<MyMqttClient>();
|
services.AddSingleton<MyMqttClient>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IOptionsMonitor<Configs> configs, UAService uAService, DeviceService deviceService)
|
public void Configure(IApplicationBuilder app, IOptionsMonitor<Configs> configs, DeviceService deviceService)
|
||||||
{
|
{
|
||||||
IconFontsHelper.GenerateIconFont();
|
IconFontsHelper.GenerateIconFont();
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace Plugin
|
|||||||
private DBTypeEnum DBType = IoTBackgroundService.DBType;
|
private DBTypeEnum DBType = IoTBackgroundService.DBType;
|
||||||
private Interpreter interpreter = new();
|
private Interpreter interpreter = new();
|
||||||
|
|
||||||
public DeviceService(IConfiguration ConfigRoot, DrvierService drvierManager, MyMqttClient myMqttClient, IMqttServer mqttServer)
|
public DeviceService(IConfiguration ConfigRoot, DrvierService drvierManager, MyMqttClient myMqttClient, UAService uAService, IMqttServer mqttServer )
|
||||||
{
|
{
|
||||||
_DrvierManager = drvierManager;
|
_DrvierManager = drvierManager;
|
||||||
_MyMqttClient = myMqttClient;
|
_MyMqttClient = myMqttClient;
|
||||||
|
@ -2777,11 +2777,11 @@ namespace Quickstarts.ReferenceServer
|
|||||||
#region IoTGatewayDevice
|
#region IoTGatewayDevice
|
||||||
using (var DC = new DataContext(IoTBackgroundService.connnectSetting, IoTBackgroundService.DBType))
|
using (var DC = new DataContext(IoTBackgroundService.connnectSetting, IoTBackgroundService.DBType))
|
||||||
{
|
{
|
||||||
foreach (var group in DC.Set<Device>().Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Group).OrderBy(x => x.Index))
|
foreach (var group in DC.Set<Device>().AsNoTracking().Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Group).OrderBy(x => x.Index).ToList())
|
||||||
{
|
{
|
||||||
FolderState deviceGroupFolder = CreateFolder(root, group.DeviceName, group.DeviceName);
|
FolderState deviceGroupFolder = CreateFolder(root, group.DeviceName, group.DeviceName);
|
||||||
|
|
||||||
foreach (var device in DC.Set<Device>().Where(x => x.ParentId == group.ID).Include(x => x.DeviceVariables).Include(x => x.DeviceConfigs).OrderBy(x => x.Index))
|
foreach (var device in DC.Set<Device>().AsNoTracking().Where(x => x.ParentId == group.ID).Include(x => x.DeviceVariables).Include(x => x.DeviceConfigs).OrderBy(x => x.Index).ToList())
|
||||||
{
|
{
|
||||||
FolderState staticFolder = CreateFolder(deviceGroupFolder, device.DeviceName, device.DeviceName);
|
FolderState staticFolder = CreateFolder(deviceGroupFolder, device.DeviceName, device.DeviceName);
|
||||||
foreach (var variable in device.DeviceVariables)
|
foreach (var variable in device.DeviceVariables)
|
||||||
|
Loading…
Reference in New Issue
Block a user