public AssetAdministrationShellDescriptor(IAssetAdministrationShell aas, IEnumerable <IEndpoint> endpoints) : this(endpoints) { this.Identification = aas.Identification; this.Administration = aas.Administration; this.IdShort = aas.IdShort; this.Description = aas.Description; this.Asset = aas.Asset; }
public IActionResult PutAssetAdministrationShell([FromBody] IAssetAdministrationShell aas) { if (aas == null) { return(ResultHandling.NullResult(nameof(aas))); } var result = CreateAssetAdministrationShell(aas); return(result.CreateActionResult(CrudOperation.Create)); }
public IResult <IAssetAdministrationShell> RetrieveAssetAdministrationShell(string aasId) { IAssetAdministrationShellServiceProvider serviceProvider = GetAssetAdministrationShellServiceProvider(aasId); if (serviceProvider != null && serviceProvider.GetBinding() != null) { IAssetAdministrationShell binding = serviceProvider.GetBinding(); return(new Result <IAssetAdministrationShell>(true, binding)); } return(new Result <IAssetAdministrationShell>(false, new NotFoundMessage("Asset Administration Shell Service Provider"))); }
public IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas) { if (string.IsNullOrEmpty(aasId)) { return(new Result <IAssetAdministrationShell>(new ArgumentNullException(nameof(aasId)))); } if (aas == null) { return(new Result <IAssetAdministrationShell>(new ArgumentNullException(nameof(aas)))); } return(CreateAssetAdministrationShell(aas)); }
public IEnumerable <IAssetAdministrationShell> GetBinding() { IEnumerable <IAssetAdministrationShellServiceProvider> serviceProviders = GetAssetAdministrationShellServiceProviders(); List <IAssetAdministrationShell> assetAdministrationShells = new List <IAssetAdministrationShell>(); foreach (var serviceProvider in serviceProviders) { IAssetAdministrationShell binding = serviceProvider.GetBinding(); assetAdministrationShells.Add(binding); } return(assetAdministrationShells); }
public static void RegisterAASX(string registry, string server, string aasxFolder) { RegistryClientSettings settings = new RegistryClientSettings(); settings.RegistryConfig.RegistryUrl = "http://" + registry; RegistryClient registryClient = new RegistryClient(settings); string[] aasxFiles = Directory.GetFiles(aasxFolder, "*.aasx"); foreach (var aasxFile in aasxFiles) { Package package = Package.Open(aasxFile, FileMode.Open, FileAccess.Read); using (AASX aasx = new AASX(package)) { AssetAdministrationShellEnvironment environment = aasx.GetEnvironment(); IAssetAdministrationShell aas = environment?.AssetAdministrationShells[0]; if (aas != null) { AssetAdministrationShellDescriptor shellDescriptor = new AssetAdministrationShellDescriptor(aas, new List <HttpEndpoint>() { //Hier die entsprechende IP-Adresse der Verwaltungsschale eintragen, die du bereits gestartet hast new HttpEndpoint("http://" + server + "/aas/" + aas.IdShort + "/complete") }); foreach (var submodel in aas.Submodels) { if (submodel != null) { SubmodelDescriptor submodelDescriptor = new SubmodelDescriptor(submodel, new List <HttpEndpoint>() { //Hier die entsprechende IP-Adresse der Verwaltungsschale oder des sich selbst-hostenden Teilmodells eintragen //In diesem Beispiel hostet die VWS das Teilmodell new HttpEndpoint("http://" + server + "/aas/" + aas.IdShort + "/submodels/" + submodel.IdShort + "/table") }); shellDescriptor.SubmodelDescriptors.Create(submodelDescriptor); } } Console.WriteLine("Register AAS: {0} {1}", aas.IdShort, aas.Identification.Id); registryClient.CreateAssetAdministrationShell(shellDescriptor); } else { Console.WriteLine("Can not register AASX: {0}", aasxFile); } } } Console.WriteLine("View registry on http://{0}/ui", registry); Console.WriteLine(); }
public void AddAssetAdministrationShell(IAssetAdministrationShell aas) { AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = new AssetAdministrationShellDescriptor(aas, Endpoints.ToList()); if (aas.Submodels?.Count > 0) { foreach (var submodel in aas.Submodels) { assetAdministrationShellDescriptor.SubmodelDescriptors.Create(new SubmodelDescriptor(submodel, Endpoints.ToList())); } } AssetAdministrationShellDescriptors.Create(assetAdministrationShellDescriptor); }
public static IAssetAdministrationShellServiceProvider CreateServiceProvider(this IAssetAdministrationShell aas, bool includeSubmodels) { InternalAssetAdministationShellServiceProvider sp = new InternalAssetAdministationShellServiceProvider(aas); if (includeSubmodels && aas.Submodels?.Count > 0) { foreach (var submodel in aas.Submodels) { var submodelSp = submodel.CreateServiceProvider(); sp.RegisterSubmodelServiceProvider(submodel.IdShort, submodelSp); } } return(sp); }
public void AddAssetAdministationShell(IAssetAdministrationShell aas) { AssetAdministrationShells.Add(aas); Assets.Add(aas.Asset); if (aas.Submodels?.Count > 0) { Submodels.AddRange(aas.Submodels); foreach (var submodel in aas.Submodels) { ExtractAndClearConceptDescriptions(submodel.SubmodelElements); ExtractSupplementalFiles(submodel.SubmodelElements); ResetConstraints(submodel.SubmodelElements); DeleteEvents(submodel.SubmodelElements); } } }
public IResult <IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas) { if (aas == null) { return(new Result <IAssetAdministrationShell>(new ArgumentNullException(nameof(aas)))); } RegisterAssetAdministrationShellServiceProvider(aas.IdShort, aas.CreateServiceProvider(true)); IAssetAdministrationShellServiceProvider serviceProvider = GetAssetAdministrationShellServiceProvider(aas.IdShort); if (serviceProvider != null && serviceProvider.GetBinding() != null) { return(new Result <IAssetAdministrationShell>(true, serviceProvider.GetBinding())); } else { return(new Result <IAssetAdministrationShell>(false, new Message(MessageType.Error, "Could not retrieve Asset Administration Shell Service Provider"))); } }
public async Task <IResult> UpdateAssetAdministrationShellAsync(string aasId, IAssetAdministrationShell aas) { var request = CreateJsonContentRequest(GetUri(SHELL, aasId), HttpMethod.Put, aas); var response = await SendRequestAsync(request); return(await EvaluateResponseAsync(response, response.Entity)); }
public virtual void BindTo(IAssetAdministrationShell element) { AssetAdministrationShell = element; ServiceDescriptor = ServiceDescriptor ?? new AssetAdministrationShellDescriptor(element, null); }
public IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas) { return(repository.UpdateAssetAdministrationShell(aasId, aas)); }
public IResult <IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas) { return(repository.CreateAssetAdministrationShell(aas)); }
public AssetAdministrationShellServiceProvider(IAssetAdministrationShell assetAdministrationShell) { BindTo(assetAdministrationShell); }
public void BindTo(IAssetAdministrationShell element) { assetAdministrationShellServiceProvider.BindTo(element); }
public async Task <IResult <IAssetAdministrationShell> > CreateAssetAdministrationShellAsync(IAssetAdministrationShell aas) { var request = CreateJsonContentRequest(GetUri(SHELL), HttpMethod.Post, aas); var response = await SendRequestAsync(request); return(await EvaluateResponseAsync <IAssetAdministrationShell>(response, response.Entity)); }
internal InternalAssetAdministationShellServiceProvider(IAssetAdministrationShell aas) : base(aas) { AssetAdministrationShell = aas; }