Skip to content

Add ability for python measurement services to have multiple user interface files #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
run: poetry run ni-python-styleguide lint
- name: MyPy Static Analysis
run: poetry run mypy -p ni_measurement_service --show-error-codes -v
- name: MyPy Static Analysis on examples
run: poetry run mypy -p examples --show-error-codes -v
- name: MyPy Static Analysis ni_measurement_generator
run: poetry run mypy -p ni_measurement_generator --show-error-codes -v

checks-nimg:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@
"""

import logging
import os
import pathlib
import sys

import click
import nidaqmx

import ni_measurement_service as nims


measurement_info = nims.MeasurementInfo(
display_name="DAQmx Analog Input Measurement(Py)",
version="0.1.0.0",
measurement_type="DAQmx Analog Input",
product_type="DAQ",
ui_file_path=os.path.join(
os.path.dirname(os.path.abspath(__file__)), "DAQmxAnalogInputMeasurement.measui"
),
ui_file_type=nims.UIFileType.MeasurementUI,
ui_file_paths=[pathlib.Path(__file__).resolve().parent / "DAQmxAnalogInputMeasurement.measui"],
)

service_info = nims.ServiceInfo(
Expand Down
9 changes: 4 additions & 5 deletions examples/dc_measurement_labviewUI/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

import logging
import os
import pathlib
import sys
import time

Expand All @@ -16,16 +16,14 @@

import ni_measurement_service as nims


NIDCPOWER_WAIT_FOR_EVENT_TIMEOUT_ERROR_CODE = -1074116059

measurement_info = nims.MeasurementInfo(
display_name="DCMeasurement(Py_VI)",
version="0.1.0.0",
measurement_type="DC",
product_type="ADC",
ui_file_path=os.path.join(os.path.dirname(os.path.abspath(__file__)), "DCMeasurementUI.vi"),
ui_file_type=nims.UIFileType.LabVIEW,
ui_file_paths=[pathlib.Path(__file__).resolve().parent / "DCMeasurementUI.vi"],
)

service_info = nims.ServiceInfo(
Expand Down Expand Up @@ -64,6 +62,8 @@ def measure(
# User Logic :
print("Executing DCMeasurement(Py)")

pending_cancellation = False

def cancel_callback():
print("Canceling DCMeasurement(Py)")
session_to_abort = session
Expand All @@ -72,7 +72,6 @@ def cancel_callback():
pending_cancellation = True
session_to_abort.abort()

pending_cancellation = False
dc_measurement_service.context.add_cancel_callback(cancel_callback)
time_remaining = dc_measurement_service.context.time_remaining()

Expand Down
9 changes: 4 additions & 5 deletions examples/dc_measurement_measurementUI/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

import logging
import os
import pathlib
import sys
import time

Expand All @@ -16,16 +16,14 @@

import ni_measurement_service as nims


NIDCPOWER_WAIT_FOR_EVENT_TIMEOUT_ERROR_CODE = -1074116059

measurement_info = nims.MeasurementInfo(
display_name="DCMeasurement(Py)",
version="0.1.0.0",
measurement_type="DC",
product_type="ADC",
ui_file_path=os.path.join(os.path.dirname(os.path.abspath(__file__)), "DCMeasurement.measui"),
ui_file_type=nims.UIFileType.MeasurementUI,
ui_file_paths=[pathlib.Path(__file__).resolve().parent / "DCMeasurement.measui"],
)

service_info = nims.ServiceInfo(
Expand Down Expand Up @@ -64,6 +62,8 @@ def measure(
# User Logic :
print("Executing DCMeasurement(Py)")

pending_cancellation = False

def cancel_callback():
print("Canceling DCMeasurement(Py)")
session_to_abort = session
Expand All @@ -72,7 +72,6 @@ def cancel_callback():
pending_cancellation = True
session_to_abort.abort()

pending_cancellation = False
dc_measurement_service.context.add_cancel_callback(cancel_callback)
time_remaining = dc_measurement_service.context.time_remaining()

Expand Down
74 changes: 74 additions & 0 deletions examples/sample_measurement/SampleAllParameters.measui
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<SourceFile Checksum="A57B8C1FB0CA4651FC717888881510FB10BF4A85863767E6C66DD9EBCBDC6EB720E8571B5CA988BD5C1DCD56BAB1D44EE6CB4393E6DA2CF071C0D725FEA38906" Timestamp="1D8E0B6108103BE" xmlns="http://www.ni.com/PlatformFramework">
<SourceModelFeatureSet>
<ParsableNamespace AssemblyFileVersion="9.7.0.1018" FeatureSetName="Configuration Based Software Core" Name="http://www.ni.com/ConfigurationBasedSoftware.Core" OldestCompatibleVersion="6.3.0.49152" Version="6.3.0.49152" />
<ParsableNamespace AssemblyFileVersion="9.7.0.1018" FeatureSetName="LabVIEW Controls" Name="http://www.ni.com/Controls.LabVIEW.Design" OldestCompatibleVersion="8.1.0.49152" Version="8.1.0.49152" />
<ParsableNamespace AssemblyFileVersion="23.0.0.1018" FeatureSetName="InstrumentStudio Measurement UI" Name="http://www.ni.com/InstrumentFramework/ScreenDocument" OldestCompatibleVersion="22.1.0.0" Version="22.1.0.0" />
<ParsableNamespace AssemblyFileVersion="9.7.0.1018" FeatureSetName="Editor" Name="http://www.ni.com/PanelCommon" OldestCompatibleVersion="6.1.0.0" Version="6.1.0.49152" />
<ParsableNamespace AssemblyFileVersion="9.7.0.1018" FeatureSetName="Editor" Name="http://www.ni.com/PlatformFramework" OldestCompatibleVersion="8.1.0.49152" Version="8.1.0.49152" />
<ApplicationVersionInfo Build="23.0.0.1018" Name="Measurement UI Editor" Version="23.0.0.1018" />
</SourceModelFeatureSet>
<Screen ClientId="{abd0ec1b-8a8a-46a1-9b11-1bcb569d1849}" Id="20c496a981bb4f73bea9d243756baab5" ServiceClass="SampleMeasurement_Python" xmlns="http://www.ni.com/InstrumentFramework/ScreenDocument">
<ScreenSurface BackgroundColor="[SMSolidColorBrush]#00ffffff" Height="[float]445" Id="c47bc3494c0244bab74b59853ae5087f" Left="[float]0" PanelSizeMode="Fixed" Top="[float]0" Width="[float]1094" xmlns="http://www.ni.com/ConfigurationBasedSoftware.Core">
<ChannelNumericText AdaptsToType="[bool]True" BaseName="[string]Numeric" Channel="[string]Configuration/Float In" Enabled="[bool]True" Height="[float]24" Id="ac8d5d6abc13430eba5b9b5008242f2e" Interval="[float]1" Label="[UIModel]b16b7fdf2cd2444aaba612c28dff288c" Left="[float]31" Top="[float]36" UnitAnnotation="[string]" ValueFormatter="[string]DisplayFormat=Automatic:Digits=5:DigitDisplayType=SignificantDigits:MinimumFieldWidth=0:AlwaysShowSign=False:ShowThousandsSeparator=False" ValueType="[Type]Single" Width="[float]160" />
<Label Height="[float]16" Id="b16b7fdf2cd2444aaba612c28dff288c" LabelOwner="[UIModel]ac8d5d6abc13430eba5b9b5008242f2e" Left="[float]31" Text="[string]Float In" Top="[float]16" Width="[float]40" xmlns="http://www.ni.com/PanelCommon" />
<ChannelCheckBox BaseName="[string]Checkbox" Channel="[string]Configuration/Bool In" Content="[string]Off/On" Enabled="[bool]True" Height="[float]16" Id="50072f6dacfc4f4cbbcf875d6d8483cd" Label="[UIModel]72b5606765b48f6a03e01d0505d78c9" Left="[float]31" MinHeight="[float]16" MinWidth="[float]16" Top="[float]91" Width="[float]59" />
<Label Height="[float]16" Id="72b5606765b48f6a03e01d0505d78c9" LabelOwner="[UIModel]50072f6dacfc4f4cbbcf875d6d8483cd" Left="[float]31" Text="[string]Bool In" Top="[float]71" Width="[float]38" xmlns="http://www.ni.com/PanelCommon" />
<ChannelStringControl AcceptsReturn="[bool]False" BaseName="[string]String" Channel="[string]Configuration/String In" Enabled="[bool]True" Height="[float]24" HorizontalScrollBarVisibility="[ScrollBarVisibility]Hidden" Id="344fe1d909e0448ca0923ced1bcdcb12" Label="[UIModel]4b4dcad2a0248e58564c645943b0c7f" Left="[float]31" Text="[string]" Top="[float]138" VerticalScrollBarVisibility="[ScrollBarVisibility]Auto" Width="[float]160" />
<Label Height="[float]16" Id="4b4dcad2a0248e58564c645943b0c7f" LabelOwner="[UIModel]344fe1d909e0448ca0923ced1bcdcb12" Left="[float]31" Text="[string]String In" Top="[float]118" Width="[float]44" xmlns="http://www.ni.com/PanelCommon" />
<ChannelArrayViewer AdaptsToType="[bool]True" ArrayElement="[UIModel]4e1d7f76fed3408c879928fcf2039e63" BaseName="[string]Numeric Array Input" Channel="[string]Configuration/Double Array In" Columns="[int]1" Dimensions="[int]1" Enabled="[bool]True" Height="[float]120" Id="2d88c55ec56e4ee58ddb2acd0bee73b0" IndexVisibility="[Visibility]Collapsed" Label="[UIModel]3d3aa154901d4d738857fa48bddcef45" Left="[float]30" Orientation="[SMOrientation]Vertical" Rows="[int]4" Top="[float]201" VerticalScrollBarVisibility="[ScrollBarVisibility]Visible" Width="[float]162">
<p.DefaultElementValue>0x0</p.DefaultElementValue>
<ChannelArrayNumericText BaseName="[string]Numeric" Height="[float]24" Id="4e1d7f76fed3408c879928fcf2039e63" UnitAnnotation="[string]" ValueFormatter="[string]LV:G5" ValueType="[Type]Double" Width="[float]129" />
</ChannelArrayViewer>
<Label Height="[float]16" Id="3d3aa154901d4d738857fa48bddcef45" LabelOwner="[UIModel]2d88c55ec56e4ee58ddb2acd0bee73b0" Left="[float]30" Text="[string]Double Array In" Top="[float]181" Width="[float]84" xmlns="http://www.ni.com/PanelCommon" />
<ChannelNumericText AdaptsToType="[bool]True" BaseName="[string]Numeric" Channel="[string]Output/Float out" Height="[float]24" Id="560b0851e24b4be1957fc505ed62f5db" Interval="[float]1" IsReadOnly="[bool]True" Label="[UIModel]a73c7bd96aae4a3792867b1f471247cc" Left="[float]239" Top="[float]36" UnitAnnotation="[string]" ValueFormatter="[string]DisplayFormat=Automatic:Digits=5:DigitDisplayType=SignificantDigits:MinimumFieldWidth=0:AlwaysShowSign=False:ShowThousandsSeparator=False" ValueType="[Type]Single" Width="[float]160" />
<Label Height="[float]16" Id="a73c7bd96aae4a3792867b1f471247cc" LabelOwner="[UIModel]560b0851e24b4be1957fc505ed62f5db" Left="[float]239" Text="[string]Float out" Top="[float]16" Width="[float]48" xmlns="http://www.ni.com/PanelCommon" />
<ChannelLED BaseName="[string]Round LED" Channel="[string]Output/Bool out" ContentVisibility="[Visibility]Collapsed" FalseBackground="[SMSolidColorBrush]#ffe0e0e0" FalseContent="[string]Off" Height="[float]20" Id="529587ea90ea4255aec8f53606bc99b9" IsReadOnly="[bool]True" Label="[UIModel]aff1aad914904ce6a6fb6756cba2c866" Left="[float]239" MinHeight="[float]20" MinWidth="[float]20" Shape="[LEDShape]Round" Top="[float]91" TrueContent="[string]On" Width="[float]20" />
<Label Height="[float]16" Id="aff1aad914904ce6a6fb6756cba2c866" LabelOwner="[UIModel]529587ea90ea4255aec8f53606bc99b9" Left="[float]239" Text="[string]Bool out" Top="[float]71" Width="[float]46" xmlns="http://www.ni.com/PanelCommon" />
<ChannelStringControl AcceptsReturn="[bool]False" BaseName="[string]String" Channel="[string]Output/String out" Height="[float]24" HorizontalScrollBarVisibility="[ScrollBarVisibility]Hidden" Id="fa35489e33a34b0183b746fffa2ced9d" IsReadOnly="[bool]True" Label="[UIModel]94b2b204aefb4bc7b509f1c49eae0c18" Left="[float]239" Top="[float]138" VerticalScrollBarVisibility="[ScrollBarVisibility]Auto" Width="[float]160" />
<Label Height="[float]16" Id="94b2b204aefb4bc7b509f1c49eae0c18" LabelOwner="[UIModel]fa35489e33a34b0183b746fffa2ced9d" Left="[float]239" Text="[string]String out" Top="[float]118" Width="[float]52" xmlns="http://www.ni.com/PanelCommon" />
<ChannelArrayViewer AdaptsToType="[bool]True" ArrayElement="[UIModel]9845cec681cb4828a587b9fd395fa78c" BaseName="[string]Numeric Array Output" Channel="[string]Output/Double Array out" Columns="[int]1" Dimensions="[int]1" Height="[float]120" Id="13707da33a16404e92bf506121dc2dbc" IndexVisibility="[Visibility]Collapsed" Label="[UIModel]4d641544433e4a3ab6f691b85e44d2d2" Left="[float]239" Orientation="[SMOrientation]Vertical" Rows="[int]4" Top="[float]201" VerticalScrollBarVisibility="[ScrollBarVisibility]Visible" Width="[float]160">
<p.DefaultElementValue>0x0</p.DefaultElementValue>
<ChannelArrayNumericText BaseName="[string]Numeric" Height="[float]24" Id="9845cec681cb4828a587b9fd395fa78c" IsReadOnly="[bool]True" UnitAnnotation="[string]" ValueFormatter="[string]LV:G5" ValueType="[Type]Double" Width="[float]128" />
</ChannelArrayViewer>
<Label Height="[float]16" Id="4d641544433e4a3ab6f691b85e44d2d2" LabelOwner="[UIModel]13707da33a16404e92bf506121dc2dbc" Left="[float]239" Text="[string]Double Array out" Top="[float]181" Width="[float]91" xmlns="http://www.ni.com/PanelCommon" />
<ArrayGraph Background="[SMSolidColorBrush]#00000000" BaseName="[string]Array Graph" Height="[float]300" Id="7a4e3733e44a4251a517215af2e6fb34" Label="[UIModel]7d653a1b8e82474fa5957187f74dc876" Left="[float]431" MinWidth="[float]230" PlotAreaMargin="[SMThickness]37,26,7,27" PreferIndexData="[bool]False" RenderMode="[RenderMode]Hardware" SuppressScaleLayout="[bool]False" Top="[float]21" Width="[float]500">
<ArrayGraphAxis Adjuster="[RangeAdjuster]FitExactly" Id="c0565cae4648f2ba4df1ea58a2f8a7" Label="[string]Index" LabelVisibility="[SMVisibility]Collapsed" MajorDivisions="[UIModel]9ade996a17d43088b767857a7664a57" MinorTickVisibility="[SMVisibility]Collapsed" Orientation="[SMOrientation]Horizontal" Range="[IRange]0, 3, System.Double" ValueType="[Type]Double">
<RangeLabeledDivisions Id="9ade996a17d43088b767857a7664a57" xmlns="http://www.ni.com/Controls.LabVIEW.Design">
<p.LabelPresenter Format="G6" />
</RangeLabeledDivisions>
</ArrayGraphAxis>
<ArrayGraphAxis Adjuster="[RangeAdjuster]FitExactly" Id="f1a87538e8e24c2ea11b7444cf2b6963" Label="[string]Value" LabelVisibility="[SMVisibility]Collapsed" MajorDivisions="[UIModel]967427c1936f4c0183152fa54f00f391" Orientation="[SMOrientation]Vertical" Range="[IRange]-2.8, 3.3, System.Double" ValueType="[Type]Double">
<RangeLabeledDivisions Id="967427c1936f4c0183152fa54f00f391" xmlns="http://www.ni.com/Controls.LabVIEW.Design">
<p.LabelPresenter Format="G6" />
</RangeLabeledDivisions>
</ArrayGraphAxis>
<HmiGraphPlot Channel="[string]Output/Double Array out" HorizontalScale="[UIModel]c0565cae4648f2ba4df1ea58a2f8a7" Id="effebee353c5439d83f900e31d3c5f4c" IsDefaultPlot="[bool]False" Label="[string]Double Array out" VerticalScale="[UIModel]f1a87538e8e24c2ea11b7444cf2b6963">
<PlotRenderer Id="bfa8cdd706b74f828a1194a5a99a9eb0" LineStroke="[SMSolidColorBrush]#ffea4225" LineThickness="[double]1" xmlns="http://www.ni.com/Controls.LabVIEW.Design" />
</HmiGraphPlot>
</ArrayGraph>
<HmiChartPlotLegend Graph="[UIModel]7a4e3733e44a4251a517215af2e6fb34" Height="[float]28" Id="b58e6580121b48e499f7b93e9a6128b6" Left="[float]938" Top="[float]21" />
<HmiChartCursorLegend Graph="[UIModel]7a4e3733e44a4251a517215af2e6fb34" Height="[float]80" Id="1f4572e884ce4422a72a6baf1873193b" Left="[float]436" MinHeight="[float]80" Top="[float]350" Visible="[bool]False" Width="[float]316" />
<HmiChartScaleLegend Graph="[UIModel]7a4e3733e44a4251a517215af2e6fb34" Height="[float]52" Id="3538db2f6302464287a98c35d89afaec" Left="[float]856" Top="[float]328" Visible="[bool]False" />
<ArrayGraphTools BackgroundColor="[SMSolidColorBrush]#fff7f7f7" Graph="[UIModel]7a4e3733e44a4251a517215af2e6fb34" Height="[float]26" Id="2fc284fd64c54336a9d723d588aa3c81" Left="[float]777" OffsetX="[float]346" OffsetY="[float]0" Top="[float]21" Width="[float]122">
<ComposableButton BackingCanDelete="[bool]False" BaseName="[string]Horizontal Zoom" BorderBrush="[SMSolidColorBrush]#00ffffff" Content="[UIModel]12620252458a45539a315d2d4bec982d" Enabled="[bool]True" FalseBackground="[SMSolidColorBrush]#00ffffff" Height="[float]22" Id="274c723135754d628924a47608d1ec3b" IsMomentary="[bool]False" Label="[UIModel]8ea2460bf8db46ba8c06406d1cd4c9ec" Left="[float]2" PartName="[string]PART_ZoomHorizontalButton" Top="[float]2" Value="[bool]False" Width="[float]28">
<Image BaseName="[string]Image" Id="12620252458a45539a315d2d4bec982d" Left="[float]0" Source="[string]pack://application:,,,/NationalInstruments.Hmi.Core;component/Resources/ZoomHorizontal.png" Stretch="[SMStretch]Uniform" Top="[float]0" xmlns="http://www.ni.com/PlatformFramework" />
</ComposableButton>
<ComposableButton BackingCanDelete="[bool]False" BaseName="[string]Vertical Zoom" BorderBrush="[SMSolidColorBrush]#00ffffff" Content="[UIModel]afdf326007b54e9793e1285c559607c3" Enabled="[bool]True" FalseBackground="[SMSolidColorBrush]#00ffffff" Height="[float]22" Id="46d7f2b09d4e4cf8b79a9293f146695e" IsMomentary="[bool]False" Label="[UIModel]4928ee82548e4f1fae6550b6164aee6e" Left="[float]32" PartName="[string]PART_ZoomVerticalButton" Top="[float]2" Value="[bool]False" Width="[float]28">
<Image BaseName="[string]Image" Id="afdf326007b54e9793e1285c559607c3" Left="[float]0" Source="[string]pack://application:,,,/NationalInstruments.Hmi.Core;component/Resources/ZoomVertical.png" Stretch="[SMStretch]Uniform" Top="[float]0" xmlns="http://www.ni.com/PlatformFramework" />
</ComposableButton>
<ComposableButton BackingCanDelete="[bool]False" BaseName="[string]Pan" BorderBrush="[SMSolidColorBrush]#00ffffff" Content="[UIModel]e079820be0cc4cf5baecf45947d92817" Enabled="[bool]True" FalseBackground="[SMSolidColorBrush]#00ffffff" Height="[float]22" Id="30d2367b849e446789f0ebae1a3b8b5c" IsMomentary="[bool]False" Label="[UIModel]5a4b5477a8784afcb3536bf327d4857d" Left="[float]62" PartName="[string]PART_PanButton" Top="[float]2" Value="[bool]False" Width="[float]28">
<Image BaseName="[string]Image" Id="e079820be0cc4cf5baecf45947d92817" Left="[float]0" Source="[string]pack://application:,,,/NationalInstruments.Hmi.Core;component/Resources/ZoomPan.png" Stretch="[SMStretch]Uniform" Top="[float]0" xmlns="http://www.ni.com/PlatformFramework" />
</ComposableButton>
<ComposableButton BackingCanDelete="[bool]False" BaseName="[string]Reset" BorderBrush="[SMSolidColorBrush]#00ffffff" Content="[UIModel]826a35475724f97b30fbe6b5a2d8e00" Enabled="[bool]True" FalseBackground="[SMSolidColorBrush]#00ffffff" Height="[float]22" Id="7791599dec5e40c98da2dc1dff8203f7" IsMomentary="[bool]True" Label="[UIModel]5fdaffd604954eab8c40eece223bace6" Left="[float]92" PartName="[string]PART_ResetButton" Top="[float]2" Value="[bool]False" Width="[float]28">
<Image BaseName="[string]Image" Id="826a35475724f97b30fbe6b5a2d8e00" Left="[float]0" Source="[string]pack://application:,,,/NationalInstruments.Hmi.Core;component/Resources/ZoomExtents.png" Stretch="[SMStretch]Uniform" Top="[float]0" xmlns="http://www.ni.com/PlatformFramework" />
</ComposableButton>
<Label Id="8ea2460bf8db46ba8c06406d1cd4c9ec" LabelOwner="[UIModel]274c723135754d628924a47608d1ec3b" Left="[float]2" Text="[string]Horizontal Zoom" Top="[float]-18" Visible="[bool]False" xmlns="http://www.ni.com/PanelCommon" />
<Label Id="4928ee82548e4f1fae6550b6164aee6e" LabelOwner="[UIModel]46d7f2b09d4e4cf8b79a9293f146695e" Left="[float]32" Text="[string]Vertical Zoom" Top="[float]-18" Visible="[bool]False" xmlns="http://www.ni.com/PanelCommon" />
<Label Id="5a4b5477a8784afcb3536bf327d4857d" LabelOwner="[UIModel]30d2367b849e446789f0ebae1a3b8b5c" Left="[float]62" Text="[string]Pan" Top="[float]-18" Visible="[bool]False" xmlns="http://www.ni.com/PanelCommon" />
<Label Id="5fdaffd604954eab8c40eece223bace6" LabelOwner="[UIModel]7791599dec5e40c98da2dc1dff8203f7" Left="[float]92" Text="[string]Reset" Top="[float]-18" Visible="[bool]False" xmlns="http://www.ni.com/PanelCommon" />
</ArrayGraphTools>
<Label Height="[float]16" Id="7d653a1b8e82474fa5957187f74dc876" LabelOwner="[UIModel]7a4e3733e44a4251a517215af2e6fb34" Left="[float]431" Text="[string]Double Array out" Top="[float]1" Width="[float]91" xmlns="http://www.ni.com/PanelCommon" />
</ScreenSurface>
</Screen>
</SourceFile>
9 changes: 5 additions & 4 deletions examples/sample_measurement/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

"""
import logging
import os
import pathlib
import sys

import click
Expand All @@ -16,9 +16,10 @@
version="0.1.0.0",
measurement_type="Sample",
product_type="Sample",
ui_file_path=os.path.join(
os.path.dirname(os.path.abspath(__file__)), "SampleMeasurement.measui"
),
ui_file_paths=[
pathlib.Path(__file__).resolve().parent / "SampleMeasurement.measui",
pathlib.Path(__file__).resolve().parent / "SampleAllParameters.measui",
],
)

service_info = nims.ServiceInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def _render_template(template_name: str, **template_args) -> str:
except: # noqa: E722
print(exceptions.text_error_template().render())

return ""


def _create_file(template_name: str, file_name: str, directory_out, **template_args) -> str:
output_file = pathlib.Path(directory_out) / file_name
Expand All @@ -28,6 +30,8 @@ def _create_file(template_name: str, file_name: str, directory_out, **template_a
with output_file.open("w") as fout:
fout.write(output)

return ""


def _create_bat(directory_out):
output_file = pathlib.Path(directory_out) / "start.bat"
Expand Down
Loading