Skip to content

Commit

Permalink
N2K Autopilot rudder gauge sensor emitting inverted values (#426)
Browse files Browse the repository at this point in the history
Fixes #169
  • Loading branch information
godind authored Jun 12, 2024
1 parent cbb2df9 commit 5ee3dd6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# V 2.11.0
## New features
* Autopilot invert rudder angle support and matching Display tab widget Option
# V 2.10.1
## Fixes
* Values jumping between sources. Fixes #420
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mxtommy/kip",
"version": "2.10.1",
"version": "2.11.0",
"description": "An advanced and versatile marine instrumentation package to display Signal K data.",
"license": "MIT",
"author": {
Expand Down
4 changes: 3 additions & 1 deletion src/app/core/interfaces/widgets-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ export interface IWidgetSvcConfig {
/** Used by wind Widget: enable/disable sailSetup UI feature */
sailSetupEnable?: boolean;

/** Used by multiple gauge Widget */
/** Used by autopilot Widget to autostart the AP widget */
autoStart?: boolean;
/** Used by autopilot Widget to invert rudder angle value */
invertRudder?: boolean;

/** Used by historical data Widget: Set the data conversion format. !!! Do not use for other Widget !!! */
convertUnitTo?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
[dateTimezone]="dateTimezoneToControl">
</display-datetime-options>

<!-- AP gauge stuff -->
<mat-checkbox class="fields" *ngIf="(widgetConfig.invertRudder !== undefined)"
name="invertRudder"
formControlName="invertRudder">
Invert Rudder angle
</mat-checkbox>

<!-- sail gauge stuff -->
<mat-checkbox class="fields" *ngIf="(widgetConfig.laylineEnable !== undefined)"
name="laylineEnable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export class WidgetAutopilotComponent extends BaseWidgetComponent implements OnI
},
barColor: 'accent', // theme palette to select
autoStart: false,
invertRudder: true,
enableTimeout: false,
dataTimeout: 5
};
Expand Down Expand Up @@ -271,7 +272,7 @@ export class WidgetAutopilotComponent extends BaseWidgetComponent implements OnI
if (newValue.data.value === null) {
this.currentRudder = 0;
} else {
this.currentRudder = newValue.data.value;
this.currentRudder = this.widgetProperties.config.invertRudder ? -newValue.data.value : newValue.data.value;
}
}
);
Expand Down

0 comments on commit 5ee3dd6

Please sign in to comment.