ni / niveristand-embedded-data-logger-custom-device

VeriStand embedded data logger custom device
MIT License
3 stars 9 forks source link

Extract scripting API for configuring log file page #52

Closed rtzoeller closed 2 years ago

rtzoeller commented 2 years ago

What does this Pull Request accomplish?

Extract an unpolished API for manipulating the system definition, mostly limited in scope to the settings on the log file page.

Why should this Pull Request be merged?

This is the first step towards a full scripting API, and I'd like to get input before progressing further.

What testing has been done?

Hand testing of the custom device in VeriStand. Unit tests pass.

niveristand-diff-bot commented 2 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Embedded Data Logger Engine.lvlib--Asynchronous Logging Loop.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Engine.lvlib--Asynchronous%20Logging%20Loop.vi.png)
Embedded Data Logger Engine.lvlib--Get Data Log File Settings.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Engine.lvlib--Get%20Data%20Log%20File%20Settings.vi.png)
Embedded Data Logger Scripting.lvlib--Add Log File.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Add%20Log%20File.vi.png)
Embedded Data Logger Scripting.lvlib--Build Data Log Archive Path.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Build%20Data%20Log%20Archive%20Path.vi.png)
Embedded Data Logger Scripting.lvlib--Build Data Log File Path.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Build%20Data%20Log%20File%20Path.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Archive Location.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Archive%20Location.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Auto Open.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Auto%20Open.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Location.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Location.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Pretrigger Logging.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Pretrigger%20Logging.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Segmenting.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Segmenting.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Use Time for X-Axis for Continuous Acquisitions.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Use%20Time%20for%20X-Axis%20for%20Continuous%20Acquisitions.vi.png)
Embedded Data Logger Scripting.lvlib--Initialize Embedded Data Logger Custom Device.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Initialize%20Embedded%20Data%20Logger%20Custom%20Device.vi.png)
Embedded Data Logger Scripting.lvlib--Rename Log File.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Rename%20Log%20File.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Archive Location.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Archive%20Location.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Auto Open.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Auto%20Open.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Location.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Location.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Pretrigger Logging.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Pretrigger%20Logging.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Segmenting by Size.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Segmenting%20by%20Size.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Segmenting by Time.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Segmenting%20by%20Time.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Use Time for X-Axis for Continuous Acquisitions.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Use%20Time%20for%20X-Axis%20for%20Continuous%20Acquisitions.vi.png)
Embedded Data Logger System Explorer.lvlib--ActionVIOnSave (File).vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20System%20Explorer.lvlib--ActionVIOnSave%20(File).vi.png)
Embedded Data Logger System Explorer.lvlib--Add Log File RTM.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20System%20Explorer.lvlib--Add%20Log%20File%20RTM.vi.png)
Embedded Data Logger System Explorer.lvlib--File Page.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20System%20Explorer.lvlib--File%20Page.vi.png)
Embedded Data Logger System Explorer.lvlib--Initialization VI.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20System%20Explorer.lvlib--Initialization%20VI.vi.png)
Embedded Data Logger System Explorer.lvlib--Main Page.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-27/17%3A37%3A00/Embedded%20Data%20Logger%20System%20Explorer.lvlib--Main%20Page.vi.png)
rtzoeller commented 2 years ago
  • [ ] Add Log File.vi - Will use of the Value Table VI hit the same issue that we saw in MIL-STD-1553, where it doesn't work correctly offline? image

Yes, it will. This change has mostly been about reorganizing property accessors, and I haven't actually run the scripting API from outside VeriStand to identify these issues (with the assumption that they all should be trivially fixable later).

  • [ ] Add Log File.vi has inaccurate text on the icon.

Good catch. This was previously an action VI, and there is additional cleanup required as well, such as pulling the INI file handling out of this VI and back into the action VI.

  • [ ] I'm not crazy about using the string array for the path in Get/Set Log File Archive Location. This seems to stem from the way the UI handles relative paths. Because they chose to do this, the property in System Explorer is saved as an array, so I get why we're using the array parts. But, as a user of a scripting API, really all I care about is the path. I know this is the unpolished version, so we can probably leave this, but we might want to consider changing it in the future to just use the file path, and then provide a VI in the System Explorer library to turn it back into what System Explorer needs. This does add unnecessary conversions back and forth between the path and the array, but it just seems really weird for me to set an array of pieces when all I want to do is script a path.

I debated this for a while. The issue is that LabVIEW does a poor job representing file paths for platforms other than the active one.

This makes it difficult to script Linux file paths in a reasonable way if we use path types. Consequently, I think using an array of strings is probably the option that minimizes unexpected behavior. If we decide to polish and ship this API later, we can always wrap these entrypoints and do the conversion automatically.

It's also an issue in the UI, and I'd like to address the UI portion on a Prime Day at some point.

niveristand-diff-bot commented 2 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Embedded Data Logger Engine.lvlib--Asynchronous Logging Loop.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Engine.lvlib--Asynchronous%20Logging%20Loop.vi.png)
Embedded Data Logger Engine.lvlib--Get Data Log File Settings.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Engine.lvlib--Get%20Data%20Log%20File%20Settings.vi.png)
Embedded Data Logger Scripting.lvlib--Add Log File.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Add%20Log%20File.vi.png)
Embedded Data Logger Scripting.lvlib--Build Data Log Archive Path.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Build%20Data%20Log%20Archive%20Path.vi.png)
Embedded Data Logger Scripting.lvlib--Build Data Log File Path.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Build%20Data%20Log%20File%20Path.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Archive Location.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Archive%20Location.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Auto Open.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Auto%20Open.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Location.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Location.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Pretrigger Logging.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Pretrigger%20Logging.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Segmenting.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Segmenting.vi.png)
Embedded Data Logger Scripting.lvlib--Get Log File Use Time for X-Axis for Continuous Acquisitions.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Get%20Log%20File%20Use%20Time%20for%20X-Axis%20for%20Continuous%20Acquisitions.vi.png)
Embedded Data Logger Scripting.lvlib--Initialize Embedded Data Logger Custom Device.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Initialize%20Embedded%20Data%20Logger%20Custom%20Device.vi.png)
Embedded Data Logger Scripting.lvlib--Rename Log File.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Rename%20Log%20File.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Archive Location.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Archive%20Location.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Auto Open.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Auto%20Open.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Location.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Location.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Pretrigger Logging.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Pretrigger%20Logging.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Segmenting by Size.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Segmenting%20by%20Size.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Segmenting by Time.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Segmenting%20by%20Time.vi.png)
Embedded Data Logger Scripting.lvlib--Set Log File Use Time for X-Axis for Continuous Acquisitions.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20Scripting.lvlib--Set%20Log%20File%20Use%20Time%20for%20X-Axis%20for%20Continuous%20Acquisitions.vi.png)
Embedded Data Logger System Explorer.lvlib--ActionVIOnSave (File).vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20System%20Explorer.lvlib--ActionVIOnSave%20(File).vi.png)
Embedded Data Logger System Explorer.lvlib--Add Log File RTM.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20System%20Explorer.lvlib--Add%20Log%20File%20RTM.vi.png)
Embedded Data Logger System Explorer.lvlib--File Page.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20System%20Explorer.lvlib--File%20Page.vi.png)
Embedded Data Logger System Explorer.lvlib--Initialization VI.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20System%20Explorer.lvlib--Initialization%20VI.vi.png)
Embedded Data Logger System Explorer.lvlib--Main Page.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-embedded-data-logger-custom-device/PR-52/2021-10-28/15%3A18%3A10/Embedded%20Data%20Logger%20System%20Explorer.lvlib--Main%20Page.vi.png)