From 1240d124f83ce2118b4001b17b5e82d13d4c54eb Mon Sep 17 00:00:00 2001 From: Alex Almanza Date: Wed, 14 Oct 2026 12:55:53 -0500 Subject: [PATCH 1/6] Add identification info configuration and util to apply information to SML process and sensor descriptions --- .../api/processing/ProcessConfig.java | 7 +- .../api/sensor/IdentificationInfo.java | 34 ++++++ .../sensorhub/api/sensor/SensorConfig.java | 4 + .../processing/AbstractProcessModule.java | 5 + .../impl/sensor/AbstractSensorModule.java | 18 +++ .../utils/IdentificationInfoUtils.java | 105 ++++++++++++++++++ .../impl/sensor/TestIdentificationInfo.java | 44 ++++++++ 7 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 sensorhub-core/src/main/java/org/sensorhub/api/sensor/IdentificationInfo.java create mode 100644 sensorhub-core/src/main/java/org/sensorhub/utils/IdentificationInfoUtils.java create mode 100644 sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java diff --git a/sensorhub-core/src/main/java/org/sensorhub/api/processing/ProcessConfig.java b/sensorhub-core/src/main/java/org/sensorhub/api/processing/ProcessConfig.java index 19be9b8a2..63515d919 100644 --- a/sensorhub-core/src/main/java/org/sensorhub/api/processing/ProcessConfig.java +++ b/sensorhub-core/src/main/java/org/sensorhub/api/processing/ProcessConfig.java @@ -14,7 +14,9 @@ package org.sensorhub.api.processing; +import org.sensorhub.api.config.DisplayInfo; import org.sensorhub.api.module.ModuleConfig; +import org.sensorhub.api.sensor.IdentificationInfo; /** @@ -27,5 +29,8 @@ */ public class ProcessConfig extends ModuleConfig { - + + @DisplayInfo(label = "Identification Info", desc="Information used to uniquely identify this system and its responsible parties") + public IdentificationInfo identificationInfo; + } diff --git a/sensorhub-core/src/main/java/org/sensorhub/api/sensor/IdentificationInfo.java b/sensorhub-core/src/main/java/org/sensorhub/api/sensor/IdentificationInfo.java new file mode 100644 index 000000000..14616df39 --- /dev/null +++ b/sensorhub-core/src/main/java/org/sensorhub/api/sensor/IdentificationInfo.java @@ -0,0 +1,34 @@ +/***************************** BEGIN LICENSE BLOCK *************************** + + The contents of this file are subject to the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one + at http://mozilla.org/MPL/2.0/. + + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the License. + + Copyright (C) 2026 GeoRobotix Innovative Research, LLC. All Rights Reserved. + + ******************************* END LICENSE BLOCK ***************************/ + +package org.sensorhub.api.sensor; + +import org.sensorhub.api.config.DisplayInfo; +import org.vast.util.ResponsibleParty; + +import java.util.Collection; + +public class IdentificationInfo { + + @DisplayInfo.Required + @DisplayInfo(label = "System UID", desc = "Overrides this resource's system UID") + public String systemUID; + + @DisplayInfo(label = "System Kind UID", desc = "Optional field overrides this resource's system kind/type UID") + public String systemKindUID; + + @DisplayInfo(label = "Responsible Parties", desc = "Contact/business information of system/device operators") + public Collection responsibleParties; + +} diff --git a/sensorhub-core/src/main/java/org/sensorhub/api/sensor/SensorConfig.java b/sensorhub-core/src/main/java/org/sensorhub/api/sensor/SensorConfig.java index 33b2cea9c..126fd7206 100644 --- a/sensorhub-core/src/main/java/org/sensorhub/api/sensor/SensorConfig.java +++ b/sensorhub-core/src/main/java/org/sensorhub/api/sensor/SensorConfig.java @@ -39,6 +39,10 @@ public class SensorConfig extends ModuleConfig @DisplayInfo(desc="Time at which the SensorML description was last updated") public Date lastUpdated = new Date(); + + + @DisplayInfo(label = "Identification Info", desc="Information used to uniquely identify this system and its responsible parties") + public IdentificationInfo identificationInfo; /** diff --git a/sensorhub-core/src/main/java/org/sensorhub/impl/processing/AbstractProcessModule.java b/sensorhub-core/src/main/java/org/sensorhub/impl/processing/AbstractProcessModule.java index faa1fd215..18be4b8d3 100644 --- a/sensorhub-core/src/main/java/org/sensorhub/impl/processing/AbstractProcessModule.java +++ b/sensorhub-core/src/main/java/org/sensorhub/impl/processing/AbstractProcessModule.java @@ -18,6 +18,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.concurrent.ExecutionException; + import net.opengis.sensorml.v20.AbstractProcess; import net.opengis.swe.v20.DataComponent; import org.sensorhub.api.command.IStreamingControlInterface; @@ -30,6 +31,7 @@ import org.sensorhub.api.system.ISystemGroupDriver; import org.sensorhub.api.utils.OshAsserts; import org.sensorhub.impl.module.AbstractModule; +import org.sensorhub.utils.IdentificationInfoUtils; import org.vast.ogc.gml.IFeature; @@ -104,6 +106,9 @@ protected void afterInit() throws SensorHubException { if (processDescription == null) throw new IllegalStateException("No process description created during init"); + + IdentificationInfoUtils.apply(config.identificationInfo, processDescription); + OshAsserts.checkValidUID(processDescription.getUniqueIdentifier()); if (inputs.isEmpty() && outputs.isEmpty()) diff --git a/sensorhub-core/src/main/java/org/sensorhub/impl/sensor/AbstractSensorModule.java b/sensorhub-core/src/main/java/org/sensorhub/impl/sensor/AbstractSensorModule.java index 0b84e5979..cb42e562e 100644 --- a/sensorhub-core/src/main/java/org/sensorhub/impl/sensor/AbstractSensorModule.java +++ b/sensorhub-core/src/main/java/org/sensorhub/impl/sensor/AbstractSensorModule.java @@ -52,6 +52,7 @@ import org.sensorhub.api.sensor.SensorException; import org.sensorhub.api.utils.OshAsserts; import org.sensorhub.impl.module.AbstractModule; +import org.sensorhub.utils.IdentificationInfoUtils; import org.sensorhub.utils.MsgUtils; import org.vast.ogc.gml.IFeature; import org.vast.ogc.om.SamplingPoint; @@ -165,6 +166,13 @@ protected void afterInit() throws SensorHubException this.randomUniqueID = true; } + if (config.identificationInfo != null) + { + OshAsserts.checkValidUID(config.identificationInfo.systemUID); + this.uniqueID = config.identificationInfo.systemUID; + this.randomUniqueID = false; + } + // set last description update time if provided in config if (config.lastUpdated != null) this.lastUpdatedSensorDescription = config.lastUpdated.getTime(); @@ -203,6 +211,14 @@ protected void afterInit() throws SensorHubException addOrientationOutput(Double.NaN); } + if (config.identificationInfo != null) + { + synchronized (sensorDescLock) + { + IdentificationInfoUtils.apply(config.identificationInfo, getCurrentDescription()); + } + } + super.afterInit(); } @@ -543,6 +559,8 @@ protected void updateSensorDescription() if (!sensorDescription.isSetIdentifier()) sensorDescription.setUniqueIdentifier(uniqueID); + IdentificationInfoUtils.apply(config.identificationInfo, sensorDescription); + // name & description sensorDescription.setDefinition(SWEConstants.DEF_SENSOR); if (sensorDescription.getName() == null && config.name != null) diff --git a/sensorhub-core/src/main/java/org/sensorhub/utils/IdentificationInfoUtils.java b/sensorhub-core/src/main/java/org/sensorhub/utils/IdentificationInfoUtils.java new file mode 100644 index 000000000..b768469fc --- /dev/null +++ b/sensorhub-core/src/main/java/org/sensorhub/utils/IdentificationInfoUtils.java @@ -0,0 +1,105 @@ +/***************************** BEGIN LICENSE BLOCK *************************** + + The contents of this file are subject to the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one + at http://mozilla.org/MPL/2.0/. + + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the License. + + Copyright (C) 2026 GeoRobotix Innovative Research, LLC. All Rights Reserved. + + ******************************* END LICENSE BLOCK ***************************/ + +package org.sensorhub.utils; + +import net.opengis.gml.v32.impl.ReferenceImpl; +import net.opengis.sensorml.v20.AbstractProcess; +import net.opengis.sensorml.v20.impl.ContactListImpl; +import org.isotc211.v2005.gco.impl.CodeListValueImpl; +import org.isotc211.v2005.gmd.impl.CIAddressImpl; +import org.isotc211.v2005.gmd.impl.CIContactImpl; +import org.isotc211.v2005.gmd.impl.CIOnlineResourceImpl; +import org.isotc211.v2005.gmd.impl.CIResponsiblePartyImpl; +import org.isotc211.v2005.gmd.impl.CITelephoneImpl; +import org.sensorhub.api.sensor.IdentificationInfo; +import org.sensorhub.api.utils.OshAsserts; + + +/** Applies configured identification overrides to SensorML descriptions. */ +public final class IdentificationInfoUtils +{ + private IdentificationInfoUtils() + { + } + + + public static void apply(IdentificationInfo info, AbstractProcess description) + { + if (info == null) + return; + + OshAsserts.checkValidUID(info.systemUID); + description.setUniqueIdentifier(info.systemUID); + if (info.systemKindUID != null && !info.systemKindUID.isBlank()) + { + OshAsserts.checkValidUID(info.systemKindUID); + description.setTypeOf(new ReferenceImpl(info.systemKindUID)); + } + + if (info.responsibleParties == null || info.responsibleParties.isEmpty()) + return; + + var contacts = new ContactListImpl(); + for (var party : info.responsibleParties) + { + var contact = new CIResponsiblePartyImpl(); + contact.setIndividualName(party.getIndividualName()); + contact.setOrganisationName(party.getOrganizationName()); + contact.setPositionName(party.getPositionName()); + if (party.getRole() != null) + { + var role = new CodeListValueImpl(party.getRole()); + role.setCodeList(party.getRoleCodeList()); + role.setCodeListValue(party.getRole()); + contact.setRole(role); + } + + if (party.hasContactInfo()) + { + var details = new CIContactImpl(); + contact.setContactInfo(details); + details.setHoursOfService(party.getHoursOfService()); + details.setContactInstructions(party.getContactInstructions()); + if (party.hasAddress()) + { + var address = new CIAddressImpl(); + address.getDeliveryPointList().addAll(party.getDeliveryPoints()); + address.setCity(party.getCity()); + address.setAdministrativeArea(party.getAdministrativeArea()); + address.setPostalCode(party.getPostalCode()); + address.setCountry(party.getCountry()); + address.getElectronicMailAddressList().addAll(party.getEmails()); + details.setAddress(address); + } + if (!party.getVoiceNumbers().isEmpty() || !party.getFaxNumbers().isEmpty()) + { + var phone = new CITelephoneImpl(); + phone.getVoiceList().addAll(party.getVoiceNumbers()); + phone.getFacsimileList().addAll(party.getFaxNumbers()); + details.setPhone(phone); + } + if (party.getWebsite() != null) + { + var website = new CIOnlineResourceImpl(); + website.setLinkage(party.getWebsite()); + details.setOnlineResource(website); + } + } + contacts.addContact(contact); + } + description.getContactsList().clear(); + description.addContacts(contacts); + } +} diff --git a/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java b/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java new file mode 100644 index 000000000..f8f7efc92 --- /dev/null +++ b/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java @@ -0,0 +1,44 @@ +package org.sensorhub.impl.sensor; + +import static org.junit.Assert.*; +import java.util.List; +import org.junit.Test; +import org.sensorhub.api.sensor.IdentificationInfo; +import org.sensorhub.api.sensor.SensorConfig; +import org.vast.util.ResponsibleParty; + +public class TestIdentificationInfo +{ + @Test + public void overridesSurviveDescriptionRegeneration() throws Exception + { + var config = new SensorConfig(); + config.identificationInfo = new IdentificationInfo(); + config.identificationInfo.systemUID = "urn:test:configured"; + config.identificationInfo.systemKindUID = "urn:test:kind"; + var party = new ResponsibleParty(); + party.setOrganizationName("Operator"); + party.getEmails().addAll(List.of("first@example.org", "second@example.org")); + party.getVoiceNumbers().addAll(List.of("123", "456")); + party.setWebsite("https://example.org"); + config.identificationInfo.responsibleParties = List.of(party); + + var sensor = new FakeSensor(); + sensor.init(config); + assertEquals(config.identificationInfo.systemUID, sensor.getUniqueIdentifier()); + assertFalse(sensor.randomUniqueID); + for (int i = 0; i < 2; i++) + { + var description = sensor.getCurrentDescription(); + assertEquals(sensor.getUniqueIdentifier(), description.getUniqueIdentifier()); + assertEquals(config.identificationInfo.systemKindUID, description.getTypeOf().getHref()); + assertEquals(1, description.getContactsList().size()); + var contact = description.getContactsList().get(0).getContactList().get(0); + assertEquals("Operator", contact.getOrganisationName()); + assertEquals(party.getEmails(), contact.getContactInfo().getAddress().getElectronicMailAddressList()); + assertEquals(party.getVoiceNumbers(), contact.getContactInfo().getPhone().getVoiceList()); + assertEquals(party.getWebsite(), contact.getContactInfo().getOnlineResource().getLinkage()); + sensor.updateSensorDescription(); + } + } +} From c3abcba2d6816df69443a6f1ab6edf3ac110cc45 Mon Sep 17 00:00:00 2001 From: Alex Almanza Date: Wed, 14 Oct 2026 13:27:12 -0500 Subject: [PATCH 2/6] Fix XML CIContact serialization issue and existing UI issue related to viewing protected List fields that have public getters --- .../utils/IdentificationInfoUtils.java | 7 ++-- .../impl/sensor/TestIdentificationInfo.java | 26 ++++++++++++++ .../org/sensorhub/ui/data/MyBeanItem.java | 25 +++++++++++++ .../data/TestResponsiblePartyProperties.java | 36 +++++++++++++++++++ 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 sensorhub-webui-core/src/test/java/org/sensorhub/ui/data/TestResponsiblePartyProperties.java diff --git a/sensorhub-core/src/main/java/org/sensorhub/utils/IdentificationInfoUtils.java b/sensorhub-core/src/main/java/org/sensorhub/utils/IdentificationInfoUtils.java index b768469fc..1a51a4375 100644 --- a/sensorhub-core/src/main/java/org/sensorhub/utils/IdentificationInfoUtils.java +++ b/sensorhub-core/src/main/java/org/sensorhub/utils/IdentificationInfoUtils.java @@ -58,10 +58,13 @@ public static void apply(IdentificationInfo info, AbstractProcess description) contact.setIndividualName(party.getIndividualName()); contact.setOrganisationName(party.getOrganizationName()); contact.setPositionName(party.getPositionName()); - if (party.getRole() != null) + if (party.getRole() != null && !party.getRole().isBlank()) { var role = new CodeListValueImpl(party.getRole()); - role.setCodeList(party.getRoleCodeList()); + var codeList = party.getRoleCodeList(); + role.setCodeList(codeList == null || codeList.isBlank() + ? "http://www.isotc211.org/2005/resources/codeList.xml#CI_RoleCode" + : codeList); role.setCodeListValue(party.getRole()); contact.setRole(role); } diff --git a/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java b/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java index f8f7efc92..5854a3916 100644 --- a/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java +++ b/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java @@ -41,4 +41,30 @@ public void overridesSurviveDescriptionRegeneration() throws Exception sensor.updateSensorDescription(); } } + @Test + public void rolesSerializeWithOptionalCodeList() throws Exception + { + for (String codeList : new String[] {null, "", "urn:test:roles"}) + { + var info = new IdentificationInfo(); + info.systemUID = "urn:test:configured"; + var party = new ResponsibleParty(); + party.setRole("operator"); + party.setRoleCodeList(codeList); + info.responsibleParties = List.of(party); + var description = new org.vast.sensorML.PhysicalSystemImpl(); + org.sensorhub.utils.IdentificationInfoUtils.apply(info, description); + + var output = new java.io.StringWriter(); + var writer = new com.ctc.wstx.stax.WstxOutputFactory().createXMLStreamWriter(output); + var bindings = new org.vast.sensorML.SMLStaxBindings(); + bindings.setNamespacePrefixes(writer); + bindings.declareNamespacesOnRootElement(); + bindings.writeDescribedObject(writer, description); + writer.close(); + assertTrue(output.toString().contains("codeListValue=\"operator\"")); + assertTrue(output.toString().contains(codeList == null || codeList.isBlank() + ? "codeList.xml#CI_RoleCode" : codeList)); + } + } } diff --git a/sensorhub-webui-core/src/main/java/org/sensorhub/ui/data/MyBeanItem.java b/sensorhub-webui-core/src/main/java/org/sensorhub/ui/data/MyBeanItem.java index 496cdb40c..ed593fc33 100644 --- a/sensorhub-webui-core/src/main/java/org/sensorhub/ui/data/MyBeanItem.java +++ b/sensorhub-webui-core/src/main/java/org/sensorhub/ui/data/MyBeanItem.java @@ -162,6 +162,31 @@ protected void addMethodProperties(String prefix, Object bean) String fullName = prefix + prop.getName(); + // Getter-backed collections need the same list editor as public fields. + // In particular, live collections often have no setter. + Field field = fieldMap.get(prop.getName()); + if (Collection.class.isAssignableFrom(prop.getPropertyType()) && prop.getReadMethod() != null + && field.getGenericType() instanceof ParameterizedType) + { + var listType = (ParameterizedType)field.getGenericType(); + if (listType.getActualTypeArguments()[0] instanceof Class) + { + try + { + field.setAccessible(true); + var list = (Collection)prop.getReadMethod().invoke(bean); + var elementType = (Class)listType.getActualTypeArguments()[0]; + var container = new MyBeanItemContainer(list, elementType, fullName + PROP_SEPARATOR); + addItemProperty(fullName, new ContainerProperty(bean, field, container)); + continue; + } + catch (ReflectiveOperationException e) + { + throw new IllegalStateException("Cannot access property " + fullName, e); + } + } + } + //System.out.println(prop.getName() + ", get=" + prop.getReadMethod() + ", set=" + prop.getWriteMethod() + ", hidden=" + prop.isHidden()); addItemProperty(fullName, new MethodProperty(prop.getPropertyType(), bean, prop.getReadMethod(), prop.getWriteMethod())); } diff --git a/sensorhub-webui-core/src/test/java/org/sensorhub/ui/data/TestResponsiblePartyProperties.java b/sensorhub-webui-core/src/test/java/org/sensorhub/ui/data/TestResponsiblePartyProperties.java new file mode 100644 index 000000000..470e76f5e --- /dev/null +++ b/sensorhub-webui-core/src/test/java/org/sensorhub/ui/data/TestResponsiblePartyProperties.java @@ -0,0 +1,36 @@ +package org.sensorhub.ui.data; + +import static org.junit.Assert.*; +import java.util.List; +import org.junit.Test; +import org.vast.util.ResponsibleParty; + +public class TestResponsiblePartyProperties +{ + @Test + @SuppressWarnings("unchecked") + public void contactListsAreEditableAndCommitted() + { + var party = new ResponsibleParty(); + var lists = List.of(party.getEmails(), party.getVoiceNumbers(), + party.getFaxNumbers(), party.getDeliveryPoints()); + var names = List.of("emails", "voiceNumbers", "faxNumbers", "deliveryPoints"); + lists.forEach(list -> list.add("old")); + var item = new MyBeanItem<>(party, "contact."); + for (int i = 0; i < names.size(); i++) + { + var property = item.getItemProperty("contact." + names.get(i)); + assertTrue(property instanceof ContainerProperty); + var listProperty = (ContainerProperty)property; + var container = listProperty.getValue(); + assertEquals(String.class, container.getBeanType()); + assertEquals(1, container.size()); + container.removeAllItems(); + container.addBean("first"); + container.addBean("second"); + listProperty.setValue(container); + assertEquals(List.of("first", "second"), lists.get(i)); + } + assertNotNull(item.getItemProperty("contact.organizationName")); + } +} From bcd05b33f519ce9f7c40f7d065f2e0bf6ca52257 Mon Sep 17 00:00:00 2001 From: Alex Almanza Date: Wed, 14 Oct 2026 13:29:37 -0500 Subject: [PATCH 3/6] Add license header to test class --- .../impl/sensor/TestIdentificationInfo.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java b/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java index 5854a3916..aae3d3f81 100644 --- a/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java +++ b/sensorhub-core/src/test/java/org/sensorhub/impl/sensor/TestIdentificationInfo.java @@ -1,3 +1,17 @@ +/***************************** BEGIN LICENSE BLOCK *************************** + + The contents of this file are subject to the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one + at http://mozilla.org/MPL/2.0/. + + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the License. + + Copyright (C) 2026 GeoRobotix Innovative Research, LLC. All Rights Reserved. + + ******************************* END LICENSE BLOCK ***************************/ + package org.sensorhub.impl.sensor; import static org.junit.Assert.*; From fed5d28cf6528a02a92b2bb48d18b8ebd69119d4 Mon Sep 17 00:00:00 2001 From: Alex Almanza Date: Wed, 14 Oct 2026 13:30:57 -0500 Subject: [PATCH 4/6] Emphasize responsible party can also be tech support for device --- .../main/java/org/sensorhub/api/sensor/IdentificationInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensorhub-core/src/main/java/org/sensorhub/api/sensor/IdentificationInfo.java b/sensorhub-core/src/main/java/org/sensorhub/api/sensor/IdentificationInfo.java index 14616df39..48a615cc9 100644 --- a/sensorhub-core/src/main/java/org/sensorhub/api/sensor/IdentificationInfo.java +++ b/sensorhub-core/src/main/java/org/sensorhub/api/sensor/IdentificationInfo.java @@ -28,7 +28,7 @@ public class IdentificationInfo { @DisplayInfo(label = "System Kind UID", desc = "Optional field overrides this resource's system kind/type UID") public String systemKindUID; - @DisplayInfo(label = "Responsible Parties", desc = "Contact/business information of system/device operators") + @DisplayInfo(label = "Responsible Parties", desc = "Contact/business information of system/device operators and technical support") public Collection responsibleParties; } From 100f2d1043fb5675ffdd041eb692666a81333f56 Mon Sep 17 00:00:00 2001 From: Alex Almanza Date: Wed, 14 Oct 2026 13:32:58 -0500 Subject: [PATCH 5/6] Add license header to UI test --- .../ui/data/TestResponsiblePartyProperties.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sensorhub-webui-core/src/test/java/org/sensorhub/ui/data/TestResponsiblePartyProperties.java b/sensorhub-webui-core/src/test/java/org/sensorhub/ui/data/TestResponsiblePartyProperties.java index 470e76f5e..34401f702 100644 --- a/sensorhub-webui-core/src/test/java/org/sensorhub/ui/data/TestResponsiblePartyProperties.java +++ b/sensorhub-webui-core/src/test/java/org/sensorhub/ui/data/TestResponsiblePartyProperties.java @@ -1,3 +1,17 @@ +/***************************** BEGIN LICENSE BLOCK *************************** + + The contents of this file are subject to the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one + at http://mozilla.org/MPL/2.0/. + + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the License. + + Copyright (C) 2026 GeoRobotix Innovative Research, LLC. All Rights Reserved. + + ******************************* END LICENSE BLOCK ***************************/ + package org.sensorhub.ui.data; import static org.junit.Assert.*; From 00a35ca869610494b9499cd2924ce9dfd6d2431a Mon Sep 17 00:00:00 2001 From: Alex Almanza Date: Wed, 4 Nov 2026 11:13:15 -0600 Subject: [PATCH 6/6] Update AbstractSensorModule based on comments --- .../impl/sensor/AbstractSensorModule.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/sensorhub-core/src/main/java/org/sensorhub/impl/sensor/AbstractSensorModule.java b/sensorhub-core/src/main/java/org/sensorhub/impl/sensor/AbstractSensorModule.java index cb42e562e..a8c8d884f 100644 --- a/sensorhub-core/src/main/java/org/sensorhub/impl/sensor/AbstractSensorModule.java +++ b/sensorhub-core/src/main/java/org/sensorhub/impl/sensor/AbstractSensorModule.java @@ -152,10 +152,17 @@ protected void beforeInit() throws SensorHubException @Override protected void afterInit() throws SensorHubException { + // override unique ID using identification info if not + if (config.identificationInfo != null) + { + OshAsserts.checkValidUID(config.identificationInfo.systemUID); + this.uniqueID = config.identificationInfo.systemUID; + this.randomUniqueID = false; + } // generate random unique ID in case sensor driver hasn't generate one // if a random UUID has already been generated, it will be restored by // loadState() method that is called after init() - if (this.uniqueID == null) + else if (this.uniqueID == null) { String uuid = UUID.randomUUID().toString(); this.uniqueID = UUID_URI_PREFIX + uuid; @@ -165,13 +172,6 @@ protected void afterInit() throws SensorHubException this.randomUniqueID = true; } - - if (config.identificationInfo != null) - { - OshAsserts.checkValidUID(config.identificationInfo.systemUID); - this.uniqueID = config.identificationInfo.systemUID; - this.randomUniqueID = false; - } // set last description update time if provided in config if (config.lastUpdated != null) @@ -210,14 +210,6 @@ protected void afterInit() throws SensorHubException if (orientationOutput == null) addOrientationOutput(Double.NaN); } - - if (config.identificationInfo != null) - { - synchronized (sensorDescLock) - { - IdentificationInfoUtils.apply(config.identificationInfo, getCurrentDescription()); - } - } super.afterInit(); }