|
|
@@ -88,6 +88,14 @@ namespace TeamAAS_VP.Services
|
|
|
var protocol = new SerialPortProtocol(config.SerialPortConfig);
|
|
|
return new KCSLightController(id, protocol, config.ChannelCount,config);
|
|
|
});
|
|
|
+ // 注册KCS控制器工厂
|
|
|
+ RegisterControllerFactory(LightModel.KCS_KDC3_24V300W_8T, (id, config) =>
|
|
|
+ {
|
|
|
+ if (config == null) throw new ArgumentNullException(nameof(config));
|
|
|
+ // 使用配置里的串口配置创建协议实现,再创建控制器实例
|
|
|
+ var protocol = new SerialPortProtocol(config.SerialPortConfig);
|
|
|
+ return new KCSLightController(id, protocol, config.ChannelCount, config);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/// <summary>
|