Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
37886f7
ui: a bit of cleanup
Aug 20, 2025
08cbc20
ui: select the channels. no functionality
Aug 20, 2025
5c13a8d
aligning the checkbox with the channel names
Aug 26, 2025
f2c47d3
ui: formatting changes
Aug 26, 2025
419463e
ui: very bad way to select channels and enable the ones we want
Aug 26, 2025
aca4cfe
graph data almost fixed. still an error at 0 and very slow to start t…
Aug 26, 2025
c2e447e
ui: some changes to the data processing
Aug 26, 2025
23b9eb7
ui: almost able to show multiple channels
Aug 26, 2025
04e2f17
ui: little error checks changes
Aug 27, 2025
6d605b5
wip
Aug 27, 2025
d22862f
ui: multiple channels kinda work
Aug 27, 2025
8e1332f
ui: chagned the StartAcquisition logic a bit
Aug 27, 2025
270a5dc
using primary constructor
Aug 27, 2025
9895ecb
light clean up
Aug 27, 2025
aaec0ad
again: multiple channels kinda work
Aug 27, 2025
f9461a9
ui: only first time selecting channels do all get shown in ui
Aug 27, 2025
e696a54
ui: still not really working
Aug 27, 2025
fb73320
wip
Sep 1, 2025
1b91c7c
wip
Sep 3, 2025
5f9cd49
wip
Sep 3, 2025
67a2e46
fixed channel identification so its unique for every channel
Sep 3, 2025
d4aa974
chaned it so the graph doesnt get deleted when acquisition stops
Sep 3, 2025
26ceca0
improved the number of channelinfo calculations
Sep 3, 2025
653bb12
made the acquisition async
Sep 3, 2025
184c5ba
fixed some errors and crashes
Sep 3, 2025
fb234a5
Refactor AcquisitionManager for async disposal
Sep 3, 2025
d754a45
wip
Sep 8, 2025
ca92e00
added servives, but they dont do anything
Sep 8, 2025
1f508ac
fixed some warnings
Sep 8, 2025
3e22ca4
tried to make it faster
Sep 8, 2025
3cfb8ea
a bit ai generated optimization
Sep 8, 2025
535ae05
Revert "a bit ai generated optimization"
Sep 9, 2025
65c879a
removed debug statements
Sep 9, 2025
dfeb2b5
toggling theme
Sep 24, 2025
779869e
digital meter
Sep 24, 2025
0efa6ec
affix buttons to the top
Sep 24, 2025
6bf7d2e
get only analog and digital channels in the channel list
Sep 24, 2025
a0d991d
trying to optimize a bit
Sep 29, 2025
0eb14e1
scottplot demo
Sep 29, 2025
871a4be
changed graph to scottplot
Sep 29, 2025
7ab2dd3
wip
Sep 29, 2025
924e469
display kind of works
Sep 29, 2025
6bb4549
graph works, mostly
Sep 29, 2025
bd70b4f
added alert pop up box
Sep 29, 2025
8ce4c27
some more pop ups
Sep 29, 2025
e719834
right clock context menu for channels
Sep 29, 2025
ff968ff
wip
Sep 29, 2025
9009585
smalle changes to the circular buffer
Sep 30, 2025
5d8e837
used data streamer from scottplot
Sep 30, 2025
6f78681
add prelimiary ai comments
Sep 30, 2025
b5d39b2
removed the y axis max and min
Sep 30, 2025
a359902
performance changes
Sep 30, 2025
20625bc
some more comments
Sep 30, 2025
9a2f320
more comments
Sep 30, 2025
eeba77b
made the digitalmeters a bit nicer
Oct 6, 2025
c39d71c
changed view to scrollLeft()
Oct 6, 2025
51054eb
Add new logos and update app manifest
Oct 6, 2025
0c340c1
Refactor acquisition property error handling
Oct 6, 2025
de24fe9
added comments for the Board class
Oct 6, 2025
da08dab
added comments for the BoardPropertiesModel class
Oct 6, 2025
56423a0
removed unneeded members
Oct 6, 2025
5d42a7a
added comments to the Channel class
Oct 6, 2025
3873b6b
removed unneeded class
Oct 6, 2025
826aa22
added comments for the ChannelMode class
Oct 6, 2025
341846b
added comments for CircularBuffer
Oct 6, 2025
6b9eba4
fixed typo
Oct 6, 2025
a3f3868
added comments for DigitalMeter
Oct 6, 2025
d9da7e5
added comments to the Enclosure class
Oct 6, 2025
369ce9a
added comments for ScanDescriptorDecoder
Oct 6, 2025
c80bde1
added comments to MainPage.xaml
Oct 6, 2025
e66df31
Update window size, improve null handling, and refactor code
Oct 6, 2025
625fbaa
data streamer simplyfication
Oct 7, 2025
f6133ee
reduced to samples to display
Oct 7, 2025
16b6444
readded the locking
Oct 7, 2025
480b1fc
smalle changes
Oct 7, 2025
fcbcf8b
Refactor SamplesAppendedEventArgs constructor
Oct 13, 2025
f7689bd
added digital channel functionality
Oct 13, 2025
85daee0
trying to fix the performanace by not calling the mainthread as often
Oct 13, 2025
9875ced
performance improvements
Oct 13, 2025
4e31e54
wip
Oct 14, 2025
95bb0b9
some more debug statements
Oct 14, 2025
06c90a7
no more safety
Oct 14, 2025
04a5ac3
Refactor sample handling to use new Sample struct
Oct 27, 2025
ba511df
a bit of cleanup
Oct 27, 2025
70f13de
Refactor acquisition process in AcquisitionManager.cs
Oct 27, 2025
49aa276
Update acquisition properties and improve logging
Oct 27, 2025
fe484fc
replaced data streamer with data logger
Oct 27, 2025
18dde35
Improve data handling in MainPage.xaml.cs
Oct 27, 2025
824f8e9
Add ElapsedSeconds to Sample and update plotting logic
Oct 27, 2025
26ea756
removed comments
Oct 27, 2025
c196b66
Refactor StartAcquisitionAsync method signatures
Oct 27, 2025
a4cee50
Refactor MainViewModel and update MainPage methods
Oct 27, 2025
9420a01
Optimize ConvertSamplesToXYArrays for performance
Oct 27, 2025
707c8ba
Optimize sample management and simplify plot handling
Oct 27, 2025
693ce3b
Enforce maximum selectable channels limit
Oct 28, 2025
602fb1d
Enhance data logging and axis management in MainPage
Oct 28, 2025
9231c64
added channel legends
Oct 28, 2025
a7b336b
changed the window size
Nov 10, 2025
e528791
clear the samples q so the old data wont be accidentally added
Nov 10, 2025
b3bce04
increased the viewport for smoother scrolling
Nov 10, 2025
9823254
removed ai generated comments
Nov 10, 2025
1b532bd
deleted ai generated comments
Nov 10, 2025
37f7998
removed ai generated comments
Nov 10, 2025
4a0f0ac
mode options kinda work
Nov 10, 2025
50fd814
i guess options work
Nov 10, 2025
7348461
code cleanup
Nov 10, 2025
df21a67
more robust mode handling i think
Nov 11, 2025
c20a173
removed channel current value
Nov 11, 2025
4d90e03
open a new window when clicking on the channel
Nov 11, 2025
04d00c6
unit from enum to string
Nov 11, 2025
2a09df9
first channel details window draft
Nov 11, 2025
875e8a8
now can toggle selected
Nov 11, 2025
71309af
wip
Nov 11, 2025
d129660
wip
Nov 11, 2025
a73192d
ugly, but works
Nov 11, 2025
49bc33b
cleanup
Nov 11, 2025
35edd1d
removed unneeded command
Nov 11, 2025
f6d293c
removed ai generated comments
Nov 11, 2025
8efb45c
cleanup
Nov 11, 2025
8a88f5e
namespace changes
Nov 11, 2025
97e6fbf
warning fixes
Nov 11, 2025
33fc36d
made the plot lines thinner
Nov 17, 2025
8d3e2c8
crooshair kinda works
Nov 17, 2025
00cbbcb
label kinda works
Nov 17, 2025
e2cb16b
working, but now i also need to take the y into account
Nov 17, 2025
a91f2c0
i guess it works
Nov 17, 2025
326d510
vertical line when locked
Nov 17, 2025
c9269de
crosshair rendering
Nov 17, 2025
4ba8c2a
some changes
Nov 17, 2025
fb6fc18
moved POCO around
Nov 17, 2025
64aab5b
removed DMA class
Nov 17, 2025
13b9143
Refactor Board and related classes for improved clarity
Nov 18, 2025
0ef4148
theme change of plot
Nov 18, 2025
9b89cd3
Refactor namespaces and improve code structure
Nov 18, 2025
2e592fb
small changes
Dec 1, 2025
c7ea2c5
added better listing of boards and channels in the UI
Dec 1, 2025
5b8986e
formatting changes
Dec 1, 2025
4cd4bd7
removed manually setting colors
Dec 1, 2025
d61d51f
removed unneeded fields
Dec 1, 2025
9cf9a2c
more property scanning
Dec 1, 2025
d8c2d8f
drop down menu for trigger and clock
Dec 2, 2025
ccd5345
Refactor acquisition management and buffer settings
Dec 2, 2025
6758fe1
alert if acquisition is running
Dec 2, 2025
cd54038
deploying?
Dec 2, 2025
ea90644
Remove refresh functionality from ChannelDetailViewModel
Dec 2, 2025
77d6021
minor changes
Dec 2, 2025
833637c
Refactor data models to use records and required properties
Dec 9, 2025
6d174ef
added a boolean to check if the property is available
Dec 9, 2025
16e7e97
fixed the sample rate
Dec 9, 2025
505b649
reverted the fps
Dec 9, 2025
cd7638e
changes to the start and stop
Dec 15, 2025
c9add38
Refactor MainPage.xaml.cs for improved functionality
Dec 15, 2025
dcca7c9
wip
Dec 22, 2025
0ad9f94
Add ResolutionAI support to Board and related classes
Dec 22, 2025
b1f40cc
Refactor board settings management and UI interactions
Dec 22, 2025
e079f6f
only set isaquiring true if acquisition actually starts
Dec 23, 2025
d0b2e66
increase window size
Dec 23, 2025
636bcbf
kinda works with nexdaq
Jan 12, 2026
e1efb0f
sampling rate error
Jan 13, 2026
da190ff
more robust sample rate
Jan 13, 2026
d09ea9f
wip
Jan 19, 2026
2162db7
cnt increments, but the data is wrong
Jan 19, 2026
3b1a685
reset polling rate
Jan 26, 2026
1559f9b
added api checks to the buffer class
Jan 26, 2026
da7d4c0
hopeful changes to the acquisition manager
Jan 26, 2026
bda27bb
guess it works better now
Jan 26, 2026
2a53c43
wip
Jan 26, 2026
356a4a9
it works, but not nicely
Jan 26, 2026
87a099c
small changes
Jan 26, 2026
e501af8
seems to work fine now
Jan 26, 2026
ecd31fe
small readabilty changes
Jan 26, 2026
3259cdc
refactoring
Jan 26, 2026
c8829ba
pulling apart the channels
Jan 26, 2026
59bff2b
formatting
Jan 26, 2026
de54063
using XDocument instead of a Navigator.
Jan 27, 2026
e0a1f6e
killed ResolutionAI
Jan 27, 2026
b4377ae
removed unneeded functions
Jan 27, 2026
10d9dc0
a bit more useful functions
Jan 27, 2026
dc291cb
deleted unused classes
Jan 27, 2026
e84abd5
moved circularbuffer into AcquisitionManager
Jan 27, 2026
d0d574d
minor changes
Jan 27, 2026
48a560c
small improvements
Jan 27, 2026
4d1b03a
resolutionAI kinda works again
Jan 27, 2026
efb4b24
formatting
Jan 27, 2026
565f215
i think implemented the resolution into the data acquisition
Jan 27, 2026
1cd09ad
error handling
Feb 2, 2026
b96061e
whitespace changes
Feb 4, 2026
e5855cd
reformatted the recorder graph
Feb 9, 2026
910fdd1
more refactoring
Feb 9, 2026
66811a1
white-space changes
Feb 9, 2026
9fdfcdc
formatting changes
Feb 9, 2026
8dfd223
misc
Feb 9, 2026
80dbcf1
first implementation of the calc functionality
Feb 11, 2026
6826030
fixed some errors that happened during reformatting
Feb 11, 2026
999e121
added span to the two marker
Feb 11, 2026
afc7ead
fixed new span appearing after new markers are set
Feb 16, 2026
fd3b009
log now scrolls with new text, and span gets correctly removed
Feb 17, 2026
1874533
making the markers moveable
Feb 17, 2026
e0a574c
markers appear at at 1/3 and 2/3
Feb 17, 2026
28c0cf1
fixed, crosshair visible at the start
Feb 17, 2026
7b1555b
i think cleaned up the graph following a bit
Feb 17, 2026
095d6f6
unsubscribing from events
Feb 17, 2026
144a0cb
made hardware class, and some small fixes
Feb 17, 2026
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
25 changes: 13 additions & 12 deletions app/TRION-SDK-UI/TRION-SDK-UI.WinUI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using WinRT.Interop; // For WindowNative
using Microsoft.UI; // For WindowId
using System.Linq; // For FirstOrDefault

namespace TRION_SDK_UI.WinUI
{
Expand All @@ -19,18 +17,21 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
{
base.OnLaunched(args);

// Get the first MAUI window and its native WinUI window
var mauiWindow = Microsoft.Maui.Controls.Application.Current.Windows.FirstOrDefault();
var nativeWindow = mauiWindow?.Handler?.PlatformView as Microsoft.UI.Xaml.Window;

if (nativeWindow is not null)
var app = Microsoft.Maui.Controls.Application.Current;
if (app != null && app.Windows.Count > 0)
{
var hwnd = WindowNative.GetWindowHandle(nativeWindow);
var windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hwnd);
var appWindow = AppWindow.GetFromWindowId(windowId);
var mauiWindow = app.Windows[0];
var nativeWindow = mauiWindow?.Handler?.PlatformView as Microsoft.UI.Xaml.Window;

if (nativeWindow is not null)
{
var hwnd = WindowNative.GetWindowHandle(nativeWindow);
var windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hwnd);
var appWindow = AppWindow.GetFromWindowId(windowId);

// Set your desired window size here
appWindow.Resize(new Windows.Graphics.SizeInt32 { Width = 1200, Height = 800 });
// Set your desired window size here
appWindow.Resize(new Windows.Graphics.SizeInt32 { Width = 1200, Height = 800 });
}
}
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions app/TRION-SDK-UI/TRION-SDK-UI.WinUI/Assets/Images/appicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions app/TRION-SDK-UI/TRION-SDK-UI.WinUI/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using LiveChartsCore.SkiaSharpView.Maui;
using ScottPlot.Maui;
using SkiaSharp.Views.Maui.Controls.Hosting;

namespace TRION_SDK_UI.WinUI
Expand All @@ -12,9 +13,10 @@ public static MauiApp CreateMauiApp()
builder
.UseSharedMauiApp()
.UseLiveCharts()
.UseSkiaSharp();
.UseSkiaSharp()
.UseScottPlot();

return builder.Build();
}
}
}
}
5 changes: 3 additions & 2 deletions app/TRION-SDK-UI/TRION-SDK-UI.WinUI/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="TRION-SDK-UI"
Description="TRION-SDK-UI"
Description="Example for a Trion SDK GUI application"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
<uap:LockScreen Notification="badge" BadgeLogo="Assets\BadgeLogo.png"/>
</uap:VisualElements>
</Application>
</Applications>
Expand Down
15 changes: 15 additions & 0 deletions app/TRION-SDK-UI/TRION-SDK-UI.WinUI/TRION-SDK-UI.WinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,27 @@
<!-- We do not want XAML files to be processed as .NET MAUI XAML, but rather WinUI XAML. -->
<EnableDefaultMauiItems>false</EnableDefaultMauiItems>
</PropertyGroup>

<PropertyGroup>
<PublishReadyToRun>true</PublishReadyToRun>
<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
<AppxPackageSigningEnabled>False</AppxPackageSigningEnabled>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Never</AppxBundle>
<AppInstallerUri>C:\development</AppInstallerUri>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LiveChartsCore.SkiaSharpView.Maui" Version="2.0.0-rc5.4" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="ScottPlot" Version="5.0.56" />
<PackageReference Include="ScottPlot.Maui" Version="5.0.56" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions app/TRION-SDK-UI/TRION-SDK-UI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Global
{EB895243-61D5-493C-A564-B326347D06B6}.Debug|Any CPU.Deploy.0 = Debug|x64
{EB895243-61D5-493C-A564-B326347D06B6}.Release|Any CPU.ActiveCfg = Release|x64
{EB895243-61D5-493C-A564-B326347D06B6}.Release|Any CPU.Build.0 = Release|x64
{EB895243-61D5-493C-A564-B326347D06B6}.Release|Any CPU.Deploy.0 = Release|x64
{5586FAB3-D546-2C14-0B8C-DFE03B46CAE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5586FAB3-D546-2C14-0B8C-DFE03B46CAE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5586FAB3-D546-2C14-0B8C-DFE03B46CAE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
11 changes: 8 additions & 3 deletions app/TRION-SDK-UI/TRION-SDK-UI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Trion;

namespace TRION_SDK_UI
namespace TRION_SDK_UI
{
public partial class App : Application
{
Expand All @@ -9,5 +7,12 @@ public App()
InitializeComponent();
MainPage = new AppShell();
}
protected override Window CreateWindow(IActivationState? activationState)
{
var window = base.CreateWindow(activationState);
window.Width = 1600;
window.Height = 900;
return window;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
using System;
using System.Globalization;
using Microsoft.Maui.Controls;
using TRION_SDK_UI.Models; // Adjust namespace if needed
using TRION_SDK_UI.Models;

namespace TRION_SDK_UI.Converters
{
public class ChannelToStringConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
var channel = value as Channel;
if (channel == null)
if (value is not Channel channel)
return string.Empty;
return $"Board {channel.BoardID} - {channel.Name}";
return $"{channel.BoardName} - {channel.Name}";
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
Expand Down
31 changes: 31 additions & 0 deletions app/TRION-SDK-UI/TRION-SDK-UI/Models/AnalogChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Trion;
using TrionApiUtils;

namespace TRION_SDK_UI.Models
{
public class AnalogChannel : Channel
{
public AnalogChannel()
{
Type = ChannelType.Analog;
}

public override void Activate()
{
string target = GetTargetName();
TrionError error;

error = TrionApi.DeWeSetParamStruct(target, "Used", "True");
Utils.CheckErrorCode(error, $"Failed to activate channel {Name} on board {BoardID}");

error = TrionApi.DeWeSetParamStruct(target, "Mode", Mode.Name);
Utils.CheckErrorCode(error, $"Failed to set mode {Mode.Name} for channel {Name} on board {BoardID}");

if (!string.IsNullOrEmpty(Range))
{
error = TrionApi.DeWeSetParamStruct(target, "Range", $"{Range} {Unit}");
Utils.CheckErrorCode(error, $"Failed to set range for channel {Name} on board {BoardID}");
}
}
}
}
Loading