public async Task TestConvert() { var path = GetFile("ETS5_ImportTest"); var p = new EtsProjectParser().ParseEtsFile(path); var knxInterface = CreateNodeInstance(KnxIpDriverFactory.KnxGatway); var nodes = await EtsProjectToNodeConverter.ConvertToNodeInstances(Factory, p, knxInterface); Assert.True(nodes.Count > 0); }
public override async Task <IList <NodeInstance> > Import(string fileName) { //if (!DriverContext.LicenseContract.IsFeatureLicensed(EtsImportFeauterName)) //{ // throw new LicenseInvalidException($"KNX.LICENSE.{EtsImportFeauterName.ToUpper()}"); //} var file = Path.Combine(Path.GetTempPath(), fileName); if (!File.Exists(file)) { throw new FileNotFoundException(); } var project = new EtsProjectParser().ParseEtsFile(file, GroupAddressStyle.ThreeLevel); return(await EtsProjectToNodeConverter.ConvertToNodeInstances(DriverContext.NodeTemplateFactory, project, DriverContext.NodeInstance)); }