Skip to content

Commit 9a401e5

Browse files
authored
Add ability for python measurement services to have multiple user interface files (#102)
* Change ui_file_path(str) to ui_file_paths(list). Building and test passing. * Update generator to have ui_file_paths (multiple) * Give sample measurement two .measui files and update the test * Add the second .measui that is referenced by the sample measurement * Fix lint and test errors * Fix a couple more lint errors * Fix lint error * PR feedback. Absolute paths * Use list[str] and from __future__ import annotations to fix static analysis. * Updating examples and template to use pathlib * Run style guide * Change to str instead of path. Run static analysis on the examples. Fix static analysis errors. * Use List[Path]. Fix lint errors * Fix static analysis errors and lint errors. * Fix black errors and attempt to fix PR part that runs SA on the ni-measurement-generator * Fix lint errors * Run SA on ni_measurement_generator * Pass empty list. Fix missing return errors
1 parent c77fa40 commit 9a401e5

File tree

13 files changed

+123
-40
lines changed

13 files changed

+123
-40
lines changed

.github/workflows/PR.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ jobs:
4242
run: poetry run ni-python-styleguide lint
4343
- name: MyPy Static Analysis
4444
run: poetry run mypy -p ni_measurement_service --show-error-codes -v
45+
- name: MyPy Static Analysis on examples
46+
run: poetry run mypy -p examples --show-error-codes -v
47+
- name: MyPy Static Analysis ni_measurement_generator
48+
run: poetry run mypy -p ni_measurement_generator --show-error-codes -v
4549

4650
checks-nimg:
4751
runs-on: ubuntu-latest

examples/daqmx_analog_input_measurement_measurementUI/measurement.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,20 @@
55
"""
66

77
import logging
8-
import os
8+
import pathlib
99
import sys
1010

1111
import click
1212
import nidaqmx
1313

1414
import ni_measurement_service as nims
1515

16-
1716
measurement_info = nims.MeasurementInfo(
1817
display_name="DAQmx Analog Input Measurement(Py)",
1918
version="0.1.0.0",
2019
measurement_type="DAQmx Analog Input",
2120
product_type="DAQ",
22-
ui_file_path=os.path.join(
23-
os.path.dirname(os.path.abspath(__file__)), "DAQmxAnalogInputMeasurement.measui"
24-
),
25-
ui_file_type=nims.UIFileType.MeasurementUI,
21+
ui_file_paths=[pathlib.Path(__file__).resolve().parent / "DAQmxAnalogInputMeasurement.measui"],
2622
)
2723

2824
service_info = nims.ServiceInfo(

examples/dc_measurement_labviewUI/measurement.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
import logging
8-
import os
8+
import pathlib
99
import sys
1010
import time
1111

@@ -16,16 +16,14 @@
1616

1717
import ni_measurement_service as nims
1818

19-
2019
NIDCPOWER_WAIT_FOR_EVENT_TIMEOUT_ERROR_CODE = -1074116059
2120

2221
measurement_info = nims.MeasurementInfo(
2322
display_name="DCMeasurement(Py_VI)",
2423
version="0.1.0.0",
2524
measurement_type="DC",
2625
product_type="ADC",
27-
ui_file_path=os.path.join(os.path.dirname(os.path.abspath(__file__)), "DCMeasurementUI.vi"),
28-
ui_file_type=nims.UIFileType.LabVIEW,
26+
ui_file_paths=[pathlib.Path(__file__).resolve().parent / "DCMeasurementUI.vi"],
2927
)
3028

3129
service_info = nims.ServiceInfo(
@@ -64,6 +62,8 @@ def measure(
6462
# User Logic :
6563
print("Executing DCMeasurement(Py)")
6664

65+
pending_cancellation = False
66+
6767
def cancel_callback():
6868
print("Canceling DCMeasurement(Py)")
6969
session_to_abort = session
@@ -72,7 +72,6 @@ def cancel_callback():
7272
pending_cancellation = True
7373
session_to_abort.abort()
7474

75-
pending_cancellation = False
7675
dc_measurement_service.context.add_cancel_callback(cancel_callback)
7776
time_remaining = dc_measurement_service.context.time_remaining()
7877

examples/dc_measurement_measurementUI/measurement.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
import logging
8-
import os
8+
import pathlib
99
import sys
1010
import time
1111

@@ -16,16 +16,14 @@
1616

1717
import ni_measurement_service as nims
1818

19-
2019
NIDCPOWER_WAIT_FOR_EVENT_TIMEOUT_ERROR_CODE = -1074116059
2120

2221
measurement_info = nims.MeasurementInfo(
2322
display_name="DCMeasurement(Py)",
2423
version="0.1.0.0",
2524
measurement_type="DC",
2625
product_type="ADC",
27-
ui_file_path=os.path.join(os.path.dirname(os.path.abspath(__file__)), "DCMeasurement.measui"),
28-
ui_file_type=nims.UIFileType.MeasurementUI,
26+
ui_file_paths=[pathlib.Path(__file__).resolve().parent / "DCMeasurement.measui"],
2927
)
3028

3129
service_info = nims.ServiceInfo(
@@ -64,6 +62,8 @@ def measure(
6462
# User Logic :
6563
print("Executing DCMeasurement(Py)")
6664

65+
pending_cancellation = False
66+
6767
def cancel_callback():
6868
print("Canceling DCMeasurement(Py)")
6969
session_to_abort = session
@@ -72,7 +72,6 @@ def cancel_callback():
7272
pending_cancellation = True
7373
session_to_abort.abort()
7474

75-
pending_cancellation = False
7675
dc_measurement_service.context.add_cancel_callback(cancel_callback)
7776
time_remaining = dc_measurement_service.context.time_remaining()
7877

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<SourceFile Checksum="A57B8C1FB0CA4651FC717888881510FB10BF4A85863767E6C66DD9EBCBDC6EB720E8571B5CA988BD5C1DCD56BAB1D44EE6CB4393E6DA2CF071C0D725FEA38906" Timestamp="1D8E0B6108103BE" xmlns="http://www.ni.com/PlatformFramework">
3+
<SourceModelFeatureSet>
4+
<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" />
5+
<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" />
6+
<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" />
7+
<ParsableNamespace AssemblyFileVersion="9.7.0.1018" FeatureSetName="Editor" Name="http://www.ni.com/PanelCommon" OldestCompatibleVersion="6.1.0.0" Version="6.1.0.49152" />
8+
<ParsableNamespace AssemblyFileVersion="9.7.0.1018" FeatureSetName="Editor" Name="http://www.ni.com/PlatformFramework" OldestCompatibleVersion="8.1.0.49152" Version="8.1.0.49152" />
9+
<ApplicationVersionInfo Build="23.0.0.1018" Name="Measurement UI Editor" Version="23.0.0.1018" />
10+
</SourceModelFeatureSet>
11+
<Screen ClientId="{abd0ec1b-8a8a-46a1-9b11-1bcb569d1849}" Id="20c496a981bb4f73bea9d243756baab5" ServiceClass="SampleMeasurement_Python" xmlns="http://www.ni.com/InstrumentFramework/ScreenDocument">
12+
<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">
13+
<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" />
14+
<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" />
15+
<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" />
16+
<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" />
17+
<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" />
18+
<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" />
19+
<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">
20+
<p.DefaultElementValue>0x0</p.DefaultElementValue>
21+
<ChannelArrayNumericText BaseName="[string]Numeric" Height="[float]24" Id="4e1d7f76fed3408c879928fcf2039e63" UnitAnnotation="[string]" ValueFormatter="[string]LV:G5" ValueType="[Type]Double" Width="[float]129" />
22+
</ChannelArrayViewer>
23+
<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" />
24+
<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" />
25+
<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" />
26+
<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" />
27+
<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" />
28+
<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" />
29+
<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" />
30+
<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">
31+
<p.DefaultElementValue>0x0</p.DefaultElementValue>
32+
<ChannelArrayNumericText BaseName="[string]Numeric" Height="[float]24" Id="9845cec681cb4828a587b9fd395fa78c" IsReadOnly="[bool]True" UnitAnnotation="[string]" ValueFormatter="[string]LV:G5" ValueType="[Type]Double" Width="[float]128" />
33+
</ChannelArrayViewer>
34+
<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" />
35+
<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">
36+
<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">
37+
<RangeLabeledDivisions Id="9ade996a17d43088b767857a7664a57" xmlns="http://www.ni.com/Controls.LabVIEW.Design">
38+
<p.LabelPresenter Format="G6" />
39+
</RangeLabeledDivisions>
40+
</ArrayGraphAxis>
41+
<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">
42+
<RangeLabeledDivisions Id="967427c1936f4c0183152fa54f00f391" xmlns="http://www.ni.com/Controls.LabVIEW.Design">
43+
<p.LabelPresenter Format="G6" />
44+
</RangeLabeledDivisions>
45+
</ArrayGraphAxis>
46+
<HmiGraphPlot Channel="[string]Output/Double Array out" HorizontalScale="[UIModel]c0565cae4648f2ba4df1ea58a2f8a7" Id="effebee353c5439d83f900e31d3c5f4c" IsDefaultPlot="[bool]False" Label="[string]Double Array out" VerticalScale="[UIModel]f1a87538e8e24c2ea11b7444cf2b6963">
47+
<PlotRenderer Id="bfa8cdd706b74f828a1194a5a99a9eb0" LineStroke="[SMSolidColorBrush]#ffea4225" LineThickness="[double]1" xmlns="http://www.ni.com/Controls.LabVIEW.Design" />
48+
</HmiGraphPlot>
49+
</ArrayGraph>
50+
<HmiChartPlotLegend Graph="[UIModel]7a4e3733e44a4251a517215af2e6fb34" Height="[float]28" Id="b58e6580121b48e499f7b93e9a6128b6" Left="[float]938" Top="[float]21" />
51+
<HmiChartCursorLegend Graph="[UIModel]7a4e3733e44a4251a517215af2e6fb34" Height="[float]80" Id="1f4572e884ce4422a72a6baf1873193b" Left="[float]436" MinHeight="[float]80" Top="[float]350" Visible="[bool]False" Width="[float]316" />
52+
<HmiChartScaleLegend Graph="[UIModel]7a4e3733e44a4251a517215af2e6fb34" Height="[float]52" Id="3538db2f6302464287a98c35d89afaec" Left="[float]856" Top="[float]328" Visible="[bool]False" />
53+
<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">
54+
<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">
55+
<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" />
56+
</ComposableButton>
57+
<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">
58+
<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" />
59+
</ComposableButton>
60+
<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">
61+
<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" />
62+
</ComposableButton>
63+
<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">
64+
<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" />
65+
</ComposableButton>
66+
<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" />
67+
<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" />
68+
<Label Id="5a4b5477a8784afcb3536bf327d4857d" LabelOwner="[UIModel]30d2367b849e446789f0ebae1a3b8b5c" Left="[float]62" Text="[string]Pan" Top="[float]-18" Visible="[bool]False" xmlns="http://www.ni.com/PanelCommon" />
69+
<Label Id="5fdaffd604954eab8c40eece223bace6" LabelOwner="[UIModel]7791599dec5e40c98da2dc1dff8203f7" Left="[float]92" Text="[string]Reset" Top="[float]-18" Visible="[bool]False" xmlns="http://www.ni.com/PanelCommon" />
70+
</ArrayGraphTools>
71+
<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" />
72+
</ScreenSurface>
73+
</Screen>
74+
</SourceFile>

examples/sample_measurement/measurement.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
"""
66
import logging
7-
import os
7+
import pathlib
88
import sys
99

1010
import click
@@ -16,9 +16,10 @@
1616
version="0.1.0.0",
1717
measurement_type="Sample",
1818
product_type="Sample",
19-
ui_file_path=os.path.join(
20-
os.path.dirname(os.path.abspath(__file__)), "SampleMeasurement.measui"
21-
),
19+
ui_file_paths=[
20+
pathlib.Path(__file__).resolve().parent / "SampleMeasurement.measui",
21+
pathlib.Path(__file__).resolve().parent / "SampleAllParameters.measui",
22+
],
2223
)
2324

2425
service_info = nims.ServiceInfo(

ni_measurement_generator/ni_measurement_generator/template.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def _render_template(template_name: str, **template_args) -> str:
1919
except: # noqa: E722
2020
print(exceptions.text_error_template().render())
2121

22+
return ""
23+
2224

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

33+
return ""
34+
3135

3236
def _create_bat(directory_out):
3337
output_file = pathlib.Path(directory_out) / "start.bat"

0 commit comments

Comments
 (0)