mirror of
https://gitee.com/iioter/iotgateway.git
synced 2024-11-29 18:28:09 +08:00
驱动程序集自动获取不可修改
This commit is contained in:
parent
71390bc3a6
commit
f218dfc738
@ -36,6 +36,13 @@ namespace IoTGateway.ViewModel.BasicData.DriverVMs
|
||||
|
||||
public override void DoEdit(bool updateAllFields = false)
|
||||
{
|
||||
var DriverService = Wtm.ServiceProvider.GetService(typeof(DriverService)) as DriverService;
|
||||
Entity.AssembleName = DriverService.GetAssembleNameByFileName(Entity.FileName);
|
||||
if (string.IsNullOrEmpty(Entity.AssembleName))
|
||||
{
|
||||
MSD.AddModelError("", "程序集获取失败");
|
||||
return;
|
||||
}
|
||||
base.DoEdit(updateAllFields);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.DriverName" />
|
||||
<wt:textbox field="Entity.FileName" />
|
||||
<wt:textbox field="Entity.AssembleName" />
|
||||
<wt:display field="Entity.AssembleName" />
|
||||
<wt:textbox field="Entity.AuthorizesNum" />
|
||||
</wt:row>
|
||||
<wt:hidden field="Entity.ID" />
|
||||
|
@ -82,9 +82,9 @@ namespace Plugin
|
||||
{
|
||||
var systemManage = dc.Set<SystemConfig>().FirstOrDefault();
|
||||
var driver = DrvierManager.DriverInfos
|
||||
.SingleOrDefault(x => x.Type.FullName == device.Driver.AssembleName);
|
||||
.SingleOrDefault(x => x.Type.FullName == device.Driver?.AssembleName);
|
||||
if (driver == null)
|
||||
_logger.LogError($"找不到设备:[{device.DeviceName}]的驱动:[{device.Driver.AssembleName}]");
|
||||
_logger.LogError($"找不到设备:[{device.DeviceName}]的驱动:[{device.Driver?.AssembleName}]");
|
||||
else
|
||||
{
|
||||
var settings = dc.Set<DeviceConfig>().Where(x => x.DeviceId == device.ID).AsNoTracking()
|
||||
|
Loading…
Reference in New Issue
Block a user