-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Features] Adding tag format to Industrial Simulator (#55)
## Purpose We have a customer scenario where the payloads come like this: ```json { "timestamp": "2023-12-18T07:08:51.9706158Z", "messageType": "ua-deltaframe", "payload": { "ns=2;s=MyTag.Automatic": { "SourceTimestamp": "2023-12-18T07:08:51.5575029Z", "Value": true }, "ns=2;s=MyTag.Counter": { "SourceTimestamp": "2023-12-18T07:08:52.0515453Z", "Value": 223 } }, "dataSetWriterName": "SomeName", "sequenceNumber": 9149 } ``` As you can notice the tag uses a very different format of the default one. It also uses only the site number (ex. ns=2) and tag name (not the id). The Industrial Simulator is perfect for what we need, but this is a small gap. This PR introduces a way to format the tag, while preserving the default format if such property is not added. You can configure the tag with the idTemplate (optional) property, ex. ```yaml sites: - name: 2 mqttVersion: v5 assetCount: 1 tags: - id: GoodCounter idTemplate: "ns=%s;s=AreaName.MachineName.Counter.%s" configuration: x count: 1 ``` It also fixes a couple of small issues: * Fixes a typo in the way to build the app, where is missing a folder. * Uses a parameter for the image owner, this way I could test it in a fork. ## Does this introduce a breaking change? <!-- Mark one with an "x". --> ``` [ ] Yes [x] No ``` ## Pull Request Type What kind of change does this Pull Request introduce? <!-- Please check the one that applies to this PR using "x". --> ``` [ ] Bugfix [x] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Documentation content changes [ ] Other... Please describe: ``` ## How to Test ``` go build -o ./bin/industrial-data-simulator ./cmd ./bin/industrial-data-simulator < config.yml ```
- Loading branch information
1 parent
68a8e08
commit 4344e61
Showing
4 changed files
with
33 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters