├── PropertyServer.Plugin
├── .gitignore
├── PropertyServer
│ ├── properties.png
│ ├── properties.xcf
│ ├── Settings
│ │ ├── GeneralSettings.cs
│ │ └── LogLevelSetting.cs
│ ├── Ui
│ │ ├── RepairShakeItWindow.xaml.cs
│ │ ├── IpPortValidationRule.cs
│ │ ├── Converters.cs
│ │ ├── SettingsControl.xaml.cs
│ │ ├── RepairShakeItViewModel.cs
│ │ ├── SettingsViewModel.cs
│ │ ├── SettingsControl.xaml
│ │ └── RepairShakeItWindow.xaml
│ ├── ShakeIt
│ │ ├── TreeElement.cs
│ │ ├── GroupContainer.cs
│ │ ├── Profile.cs
│ │ ├── Converter.cs
│ │ ├── EffectsContainerCollector.cs
│ │ ├── EffectsContainerBase.cs
│ │ └── ShakeItAccessor.cs
│ ├── AutoUpdate
│ │ ├── GitHubVersionInfo.cs
│ │ └── AutoUpdater.cs
│ ├── ISimHub.cs
│ ├── RawDataManager.cs
│ ├── Comm
│ │ ├── Server.cs
│ │ └── Client.cs
│ ├── Property
│ │ ├── PropertySource.cs
│ │ ├── PropertyAccessor.cs
│ │ └── SimHubProperty.cs
│ ├── SubscriptionManager.cs
│ └── PropertyServerPlugin.cs
├── packages.config
├── ComputedProperties
│ ├── IScriptValidator.cs
│ ├── Ui
│ │ ├── PerformanceWindow.xaml.cs
│ │ ├── PerformanceWindow.xaml
│ │ ├── EditScriptWindow.xaml.cs
│ │ ├── ComputedPropertiesViewModel.cs
│ │ ├── ComputedPropertiesControl.xaml
│ │ ├── EditScriptWindow.xaml
│ │ ├── ComputedPropertiesControl.xaml.cs
│ │ └── EditScriptWindowViewModel.cs
│ ├── Performance
│ │ ├── PerfData.cs
│ │ └── PerfToken.cs
│ ├── IComputedPropertiesManager.cs
│ ├── PluginManagerAccessor.cs
│ └── ScriptData.cs
├── PreCommon
│ └── Ui
│ │ ├── IconResources
│ │ ├── InfoRounded.svg
│ │ ├── ErrorRounded.svg
│ │ ├── DeleteRounded.svg
│ │ ├── CalculateOutlined.svg
│ │ └── Calculate.svg
│ │ ├── Util
│ │ ├── Converters.cs
│ │ ├── RelayCommand.cs
│ │ └── ObservableObject.cs
│ │ └── IconResources.xaml
├── Properties
│ ├── Resources.Designer.cs
│ └── Resources.resx
└── PropertyServer.Plugin.csproj
├── .gitignore
├── doc
├── ComputedProperties
│ ├── Split-RPMs.png
│ ├── ETS2-Retarder.png
│ ├── Control-Mapping.png
│ ├── Performance-Window.png
│ ├── Examples
│ │ ├── ETS2 - Fuel Time.js
│ │ └── ETS2 - Light Stage.js
│ └── ComputedProperties.adoc
├── PropertyServer
│ └── Repair-ShakeIt.png
├── SvgToWpf.adoc
├── Building.adoc
└── Release.adoc
├── Directory.Build.props
├── version.json
├── copyApiFromSimHub.bat
├── deploy.bat
├── scripts
└── CopyToSimHub.ps1
├── SimHubPropertyServer.sln
├── .run
└── SimHubWPF.exe.run.xml
├── README.adoc
└── COPYING.LESSER
/PropertyServer.Plugin/.gitignore:
--------------------------------------------------------------------------------
1 | /bin
2 | /obj
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.idea
2 | /*.DotSettings.user
3 | /.vs
4 |
5 | /packages
6 | /bin
7 | /obj
8 |
9 | /SimHub
10 |
--------------------------------------------------------------------------------
/doc/ComputedProperties/Split-RPMs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pre-martin/SimHubPropertyServer/HEAD/doc/ComputedProperties/Split-RPMs.png
--------------------------------------------------------------------------------
/doc/PropertyServer/Repair-ShakeIt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pre-martin/SimHubPropertyServer/HEAD/doc/PropertyServer/Repair-ShakeIt.png
--------------------------------------------------------------------------------
/doc/ComputedProperties/ETS2-Retarder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pre-martin/SimHubPropertyServer/HEAD/doc/ComputedProperties/ETS2-Retarder.png
--------------------------------------------------------------------------------
/doc/ComputedProperties/Control-Mapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pre-martin/SimHubPropertyServer/HEAD/doc/ComputedProperties/Control-Mapping.png
--------------------------------------------------------------------------------
/doc/ComputedProperties/Performance-Window.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pre-martin/SimHubPropertyServer/HEAD/doc/ComputedProperties/Performance-Window.png
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PropertyServer/properties.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pre-martin/SimHubPropertyServer/HEAD/PropertyServer.Plugin/PropertyServer/properties.png
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PropertyServer/properties.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pre-martin/SimHubPropertyServer/HEAD/PropertyServer.Plugin/PropertyServer/properties.xcf
--------------------------------------------------------------------------------
/PropertyServer.Plugin/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/doc/SvgToWpf.adoc:
--------------------------------------------------------------------------------
1 | = SVG to WPF
2 |
3 | . Create a valid SVG file
4 | . Open the SVG file in InkScape
5 | . "Save as" - Select "*.xaml"
6 | . Export with
7 | ** "WPF"
8 | ** "DrawingImage"
9 | ** "DynamicResource"
10 | . Move data to `IconResources.xaml`
11 |
12 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/ComputedProperties/IScriptValidator.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | namespace SimHub.Plugins.ComputedProperties
5 | {
6 | public interface IScriptValidator
7 | {
8 | void ValidateScript(string script);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PreCommon/Ui/IconResources/InfoRounded.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PreCommon/Ui/IconResources/ErrorRounded.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | all
6 | 3.5.119
7 |
8 |
9 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/ComputedProperties/Ui/PerformanceWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | namespace SimHub.Plugins.ComputedProperties.Ui
5 | {
6 | public partial class PerformanceWindow
7 | {
8 | public PerformanceWindow()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PreCommon/Ui/IconResources/DeleteRounded.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PreCommon/Ui/IconResources/CalculateOutlined.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/version.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
3 | "version": "1.13",
4 | "publicReleaseRefSpec": [
5 | "^refs/heads/main$",
6 | "^refs/heads/release/v\\d+(?:\\.\\d+)?$"
7 | ],
8 | "cloudBuild": {
9 | "buildNumber": {
10 | "enabled": true
11 | }
12 | },
13 | "release": {
14 | "branchName": "release/v{version}"
15 | }
16 | }
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PreCommon/Ui/IconResources/Calculate.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PropertyServer/Settings/GeneralSettings.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | using Newtonsoft.Json;
5 | using Newtonsoft.Json.Converters;
6 |
7 | namespace SimHub.Plugins.PropertyServer.Settings
8 | {
9 | public class GeneralSettings
10 | {
11 | public int Port { get; set; } = 18082;
12 |
13 | [JsonConverter(typeof(StringEnumConverter))]
14 | public LogLevelSetting LogLevel { get; set; } = LogLevelSetting.Info;
15 | }
16 | }
--------------------------------------------------------------------------------
/PropertyServer.Plugin/ComputedProperties/Performance/PerfData.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | namespace SimHub.Plugins.ComputedProperties.Performance
5 | {
6 | ///
7 | /// Collects performance data.
8 | ///
9 | public class PerfData
10 | {
11 | public int Calls { get; set; }
12 | public int Skipped { get; set; }
13 | public double Time { get; set; }
14 | public double Duration => Calls == 0 ? 0 : Time / Calls;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/copyApiFromSimHub.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | set SIMHUB_DIR=\Games\SimHub
4 |
5 | del /q SimHub\*
6 |
7 | copy "%SIMHUB_DIR%\SimHub.Plugins.dll" SimHub
8 | copy "%SIMHUB_DIR%\GameReaderCommon.dll" SimHub
9 | copy "%SIMHUB_DIR%\log4net.dll" SimHub
10 | copy "%SIMHUB_DIR%\Newtonsoft.Json.dll" SimHub
11 | copy "%SIMHUB_DIR%\MahApps.Metro.dll" SimHub
12 | copy "%SIMHUB_DIR%\MahApps.Metro.SimpleChildWindow.dll" SimHub
13 |
14 | copy "%SIMHUB_DIR%\Jint.dll" SimHub
15 | copy "%SIMHUB_DIR%\Acornima.dll" SimHub
16 | copy "%SIMHUB_DIR%\ICSharpCode.AvalonEdit.dll" SimHub
17 |
--------------------------------------------------------------------------------
/doc/Building.adoc:
--------------------------------------------------------------------------------
1 | = Building
2 |
3 | . The project requires .NET Framework 4.8, because SimHub is built with this framework.
4 | . Copy required DLLs from SimHub to the local directory `SimHub` (see `copyApiFromSimHub.bat`):
5 | - SimHub.Plugins.dll
6 | - GameReaderCommon.dll
7 | - log4net.dll
8 | - Newtonsoft.Json.dll
9 | - MahApps.Metro.dll
10 | - MahApps.Metro.SimpleChildWindow.dll
11 | - Jint.dll
12 | - Acornima.dll
13 | - ICSharpCode.AvalonEdit.dll
14 | . Restore NuGet packages: +
15 | `msbuild -t:restore -p:Platform="Any CPU" -p:RestorePackagesConfig=true`
16 | . Build the project: +
17 | `msbuild -p:Platform="Any CPU" -p:Configuration=Release`
18 |
--------------------------------------------------------------------------------
/deploy.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | setlocal
3 |
4 | rem Script to deploy locally.
5 | rem If SimHub is started with admin privileges, the script has to be started as admin, too.
6 |
7 | set CONFIG=Release
8 | if "%1%" == "debug" set CONFIG=Debug
9 |
10 | echo.
11 | echo Building for configuration: %CONFIG%
12 | echo.
13 |
14 | "C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\amd64\MSBuild.exe" -p:Configuration=%CONFIG% SimHubPropertyServer.sln
15 | if %errorlevel% neq 0 exit /b 1
16 |
17 | taskkill /im SimHubWPF.exe /t /f
18 | timeout /t 1
19 |
20 | copy /y PropertyServer.Plugin\bin\%CONFIG%\PropertyServer.dll \Games\SimHub\
21 |
22 | start /d \Games\SimHub SimHubWPF.exe
23 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PropertyServer/Ui/RepairShakeItWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | using System.Windows;
5 | using SimHub.Plugins.PropertyServer.ShakeIt;
6 |
7 | namespace SimHub.Plugins.PropertyServer.Ui
8 | {
9 | public partial class RepairShakeItWindow
10 | {
11 | public RepairShakeItWindow()
12 | {
13 | InitializeComponent();
14 |
15 | var shakeItBassAccessor = new ShakeItAccessor();
16 | ((RepairShakeItViewModel)DataContext).ShakeItAccessor = shakeItBassAccessor;
17 | }
18 |
19 | private void CloseButton_Click(object sender, RoutedEventArgs e)
20 | {
21 | Close(null);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PropertyServer/Settings/LogLevelSetting.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | using log4net.Core;
5 |
6 | namespace SimHub.Plugins.PropertyServer.Settings
7 | {
8 | public enum LogLevelSetting
9 | {
10 | Debug,
11 | Info
12 | }
13 |
14 | public static class LogLevelSettingEx
15 | {
16 | public static Level ToLog4Net(this LogLevelSetting setting)
17 | {
18 | switch (setting)
19 | {
20 | case LogLevelSetting.Debug:
21 | return Level.Debug;
22 | case LogLevelSetting.Info:
23 | return Level.Info;
24 | default:
25 | return Level.Info;
26 | }
27 | }
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PropertyServer/ShakeIt/TreeElement.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2023 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | namespace SimHub.Plugins.PropertyServer.ShakeIt
5 | {
6 | ///
7 | /// This class describes an element in a tree structure.
8 | ///
9 | public abstract class TreeElement
10 | {
11 | protected TreeElement(TreeElement parent)
12 | {
13 | Parent = parent;
14 | }
15 |
16 | ///
17 | /// Parent of this element or null if this element is at the root.
18 | ///
19 | public TreeElement Parent { get; }
20 |
21 | ///
22 | /// Returns the name of this element, including all names of all parent elements.
23 | ///
24 | public abstract string RecursiveName { get; }
25 | }
26 | }
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PreCommon/Ui/Util/Converters.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | using System;
5 | using System.Globalization;
6 | using System.Windows;
7 | using System.Windows.Data;
8 |
9 | namespace SimHub.Plugins.PreCommon.Ui.Util
10 | {
11 | public class BooleanToVisibilityConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | var boolValue = value != null && (bool)value;
16 | boolValue = (parameter != null && parameter.ToString().ToLower() == "negate") ? !boolValue : boolValue;
17 | return boolValue ? Visibility.Visible : Visibility.Collapsed;
18 | }
19 |
20 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
21 | {
22 | throw new NotImplementedException();
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/scripts/CopyToSimHub.ps1:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 Martin Renner
2 | # LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | # Include as "Before launch" task into IDE. For example:
5 | # - Tool: pwsh
6 | # - Args: -NoProfile -File "$ProjectFileDir$/scripts/CopyToSimHub.ps1" -Configuration "$ConfigurationName$"
7 |
8 | param(
9 | [string]$Configuration = "Debug",
10 | [string]$TargetDir = "/Games/SimHub"
11 | )
12 |
13 | $ErrorActionPreference = "Stop"
14 |
15 | $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
16 | $ProjectDir = (Get-Item $ScriptDir).Parent
17 | $SourceDll = Join-Path $ProjectDir "PropertyServer.Plugin/bin/$Configuration/PropertyServer.dll"
18 |
19 | if (-not (Test-Path $TargetDir)) {
20 | Write-Host "Target directory $TargetDir does not exist."
21 | Exit 1
22 | }
23 |
24 | try {
25 | Copy-Item -Path $SourceDll -Destination $TargetDir -Force
26 | Write-Host "Copied $SourceDll to $TargetDir"
27 | }
28 | catch {
29 | Write-Error $_
30 | Exit 1
31 | }
32 |
33 | Exit 0
34 |
--------------------------------------------------------------------------------
/doc/ComputedProperties/Examples/ETS2 - Fuel Time.js:
--------------------------------------------------------------------------------
1 | // v1 Calculates the estimated time remaining until the fuel tank is empty based on current speed and fuel range.
2 |
3 | const FUEL_TIME_PROP = 'ComputedPropertiesPlugin.ETS2.FuelTimeRemaining';
4 |
5 | function init() {
6 | createProperty(FUEL_TIME_PROP);
7 | subscribe('DataCorePlugin.GameRawData.TruckValues.CurrentValues.DashboardValues.FuelValue.Range', 'calculateFuelTime');
8 | }
9 |
10 | function calculateFuelTime() {
11 | // Math.floor() to avoid an excessivly high update frequency
12 | const fuelDistance = Math.floor(getPropertyValue('DataCorePlugin.GameRawData.TruckValues.CurrentValues.DashboardValues.FuelValue.Range'));
13 | var speed = Math.floor(getPropertyValue('SpeedKmh'));
14 | speed = roundUpToFive(speed); // Reduce oscillation by rounding up in increments of 5 (65, 70, 75, 80, ...)
15 | if (speed < 30) speed = 30;
16 |
17 | const fuelTime = fuelDistance / speed;
18 |
19 | setPropertyValue(FUEL_TIME_PROP, fuelTime);
20 | }
21 |
22 | const roundUpToFive = (num) => Math.ceil(num / 5) * 5;
23 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PropertyServer/Ui/IpPortValidationRule.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | using System.Globalization;
5 | using System.Text.RegularExpressions;
6 | using System.Windows.Controls;
7 |
8 | namespace SimHub.Plugins.PropertyServer.Ui
9 | {
10 | public class IpPortValidationRule : ValidationRule
11 | {
12 | // regex to match:
13 | // - 1 to 4 digit inputs (may start with 1-9)
14 | // - 5 digit inputs (may start with 1-5)
15 | // - special cases for 65, 655 and 6553
16 | private readonly Regex _portRegex =
17 | new Regex("^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$");
18 |
19 |
20 | public override ValidationResult Validate(object value, CultureInfo cultureInfo)
21 | {
22 | return _portRegex.IsMatch(value as string ?? string.Empty)
23 | ? new ValidationResult(true, null)
24 | : new ValidationResult(false, "Only 1 to 65535 is valid");
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/PropertyServer.Plugin/ComputedProperties/Performance/PerfToken.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | using System;
5 | using System.Diagnostics;
6 |
7 | namespace SimHub.Plugins.ComputedProperties.Performance
8 | {
9 | ///
10 | /// Simple helper to measure performance data. Can be used in a using directive, which starts the stopwatch.
11 | /// The stopwatch will be stopped, when the using context is exited.
12 | ///
13 | public class PerfToken : IDisposable
14 | {
15 | private readonly Stopwatch _stopwatch;
16 | private readonly PerfData _perfData;
17 |
18 | public PerfToken(PerfData perfData)
19 | {
20 | _stopwatch = Stopwatch.StartNew();
21 | _perfData = perfData;
22 | }
23 |
24 | public void Dispose()
25 | {
26 | _stopwatch.Stop();
27 | var ms = _stopwatch.Elapsed.TotalMilliseconds;
28 | _perfData.Calls++;
29 | _perfData.Time += _stopwatch.Elapsed.TotalMilliseconds;
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/PropertyServer.Plugin/PreCommon/Ui/Util/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | using System;
5 | using System.Windows.Input;
6 |
7 | namespace SimHub.Plugins.PreCommon.Ui.Util
8 | {
9 | public class RelayCommand : ICommand
10 | {
11 | private readonly Action _execute;
12 | private readonly Predicate _canExecute;
13 |
14 | public RelayCommand(Action execute) : this(null, execute)
15 | {
16 | }
17 |
18 | public RelayCommand(Predicate canExecute, Action execute)
19 | {
20 | _canExecute = canExecute;
21 | _execute = execute;
22 | }
23 |
24 | public bool CanExecute(object parameter)
25 | {
26 | return _canExecute?.Invoke((T)parameter) ?? true;
27 | }
28 |
29 | public void Execute(object parameter)
30 | {
31 | _execute((T)parameter);
32 | }
33 |
34 | public event EventHandler CanExecuteChanged
35 | {
36 | add => CommandManager.RequerySuggested += value;
37 | remove => CommandManager.RequerySuggested -= value;
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/SimHubPropertyServer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.3.32929.385
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PropertyServer.Plugin", "PropertyServer.Plugin\PropertyServer.Plugin.csproj", "{B3A7DBD0-917C-4FF1-9AAB-D3DC6ED29AE2}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {B3A7DBD0-917C-4FF1-9AAB-D3DC6ED29AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {B3A7DBD0-917C-4FF1-9AAB-D3DC6ED29AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {B3A7DBD0-917C-4FF1-9AAB-D3DC6ED29AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {B3A7DBD0-917C-4FF1-9AAB-D3DC6ED29AE2}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {9DEB1B20-2193-479A-9EA4-40EDF63A2982}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/PropertyServer.Plugin/ComputedProperties/IComputedPropertiesManager.cs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 Martin Renner
2 | // LGPL-3.0-or-later (see file COPYING and COPYING.LESSER)
3 |
4 | using System;
5 | using Jint;
6 |
7 | namespace SimHub.Plugins.ComputedProperties
8 | {
9 | public interface IComputedPropertiesManager
10 | {
11 | object GetPropertyValue(string propertyName);
12 | object GetRawData();
13 | void CreateProperty(string propertyName);
14 | void SetPropertyValue(string propertyName, object value);
15 | void StartRole(string roleName);
16 | void StopRole(string roleName);
17 | void TriggerInputPress(string inputName);
18 | void TriggerInputRelease(string inputName);
19 |
20 | void PrepareEngine(
21 | Engine engine,
22 | Func