Skip to content
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
115 changes: 44 additions & 71 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,119 +1,92 @@
# Changelog for angular

## [Unreleased](https://github.com/modbus2mqtt/angular/tree/HEAD)
## [v0.12.19](https://github.com/volkmarnissen/angular/tree/v0.12.19) (2025-01-16)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.20...HEAD)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.18...v0.12.19)

**Merged pull requests:**
## [v0.12.18](https://github.com/volkmarnissen/angular/tree/v0.12.18) (2025-01-15)

- Update Changelog [\#10](https://github.com/modbus2mqtt/angular/pull/10) ([volkmarnissen](https://github.com/volkmarnissen))
- \[bug\]Modbus Error Handling, Slave Specification Detection, TCP RTU bridge, Fixes [\#9](https://github.com/modbus2mqtt/angular/pull/9) ([volkmarnissen](https://github.com/volkmarnissen))
- \[bug\]Modbus Error Handling, Slave Specification Detection, TCP RTU bridge, Fixes [\#8](https://github.com/modbus2mqtt/angular/pull/8) ([volkmarnissen](https://github.com/volkmarnissen))
- Angular TcpBridge Fix [\#7](https://github.com/modbus2mqtt/angular/pull/7) ([volkmarnissen](https://github.com/volkmarnissen))
- \[bug\]Modbus Error Handling, Slave Specification Detection, TCP RTU bridge, Fixes [\#6](https://github.com/modbus2mqtt/angular/pull/6) ([volkmarnissen](https://github.com/volkmarnissen))
- Modbus Error Handling and Monitoring [\#5](https://github.com/modbus2mqtt/angular/pull/5) ([volkmarnissen](https://github.com/volkmarnissen))
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.17...v0.12.18)

## [v0.12.20](https://github.com/modbus2mqtt/angular/tree/v0.12.20) (2025-04-14)
## [v0.12.17](https://github.com/volkmarnissen/angular/tree/v0.12.17) (2025-01-02)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.19...v0.12.20)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.16...v0.12.17)

**Merged pull requests:**
## [v0.12.16](https://github.com/volkmarnissen/angular/tree/v0.12.16) (2024-12-31)

- Please update me [\#4](https://github.com/modbus2mqtt/angular/pull/4) ([volkmarnissen](https://github.com/volkmarnissen))
- Fixed package-lock.json [\#3](https://github.com/modbus2mqtt/angular/pull/3) ([volkmarnissen](https://github.com/volkmarnissen))
- Adding support for discrete inputs [\#2](https://github.com/modbus2mqtt/angular/pull/2) ([arturmietek](https://github.com/arturmietek))
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.15...v0.12.16)

## [v0.12.19](https://github.com/modbus2mqtt/angular/tree/v0.12.19) (2025-01-16)
## [v0.12.15](https://github.com/volkmarnissen/angular/tree/v0.12.15) (2024-12-30)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.18...v0.12.19)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.14...v0.12.15)

## [v0.12.18](https://github.com/modbus2mqtt/angular/tree/v0.12.18) (2025-01-15)
## [v0.12.14](https://github.com/volkmarnissen/angular/tree/v0.12.14) (2024-12-30)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.17...v0.12.18)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/0.12.14...v0.12.14)

## [v0.12.17](https://github.com/modbus2mqtt/angular/tree/v0.12.17) (2025-01-02)
## [0.12.14](https://github.com/volkmarnissen/angular/tree/0.12.14) (2024-12-13)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.16...v0.12.17)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.13...0.12.14)

**Merged pull requests:**
## [v0.12.13](https://github.com/volkmarnissen/angular/tree/v0.12.13) (2024-12-13)

- Adding signed int 32 and unsigned int 32 options to number format [\#1](https://github.com/modbus2mqtt/angular/pull/1) ([arturmietek](https://github.com/arturmietek))
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.12...v0.12.13)

## [v0.12.16](https://github.com/modbus2mqtt/angular/tree/v0.12.16) (2024-12-31)
## [v0.12.12](https://github.com/volkmarnissen/angular/tree/v0.12.12) (2024-12-11)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.15...v0.12.16)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.11...v0.12.12)

## [v0.12.15](https://github.com/modbus2mqtt/angular/tree/v0.12.15) (2024-12-30)
## [v0.12.11](https://github.com/volkmarnissen/angular/tree/v0.12.11) (2024-11-22)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.14...v0.12.15)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.10...v0.12.11)

## [v0.12.14](https://github.com/modbus2mqtt/angular/tree/v0.12.14) (2024-12-30)
## [v0.12.10](https://github.com/volkmarnissen/angular/tree/v0.12.10) (2024-11-19)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/0.12.14...v0.12.14)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.9...v0.12.10)

## [0.12.14](https://github.com/modbus2mqtt/angular/tree/0.12.14) (2024-12-13)
## [v0.12.9](https://github.com/volkmarnissen/angular/tree/v0.12.9) (2024-11-16)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.13...0.12.14)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.8...v0.12.9)

## [v0.12.13](https://github.com/modbus2mqtt/angular/tree/v0.12.13) (2024-12-13)
## [v0.12.8](https://github.com/volkmarnissen/angular/tree/v0.12.8) (2024-11-14)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.12...v0.12.13)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.7...v0.12.8)

## [v0.12.12](https://github.com/modbus2mqtt/angular/tree/v0.12.12) (2024-12-11)
## [v0.12.7](https://github.com/volkmarnissen/angular/tree/v0.12.7) (2024-10-23)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.11...v0.12.12)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.6...v0.12.7)

## [v0.12.11](https://github.com/modbus2mqtt/angular/tree/v0.12.11) (2024-11-22)
## [v0.12.6](https://github.com/volkmarnissen/angular/tree/v0.12.6) (2024-10-16)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.10...v0.12.11)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.5...v0.12.6)

## [v0.12.10](https://github.com/modbus2mqtt/angular/tree/v0.12.10) (2024-11-19)
## [v0.12.5](https://github.com/volkmarnissen/angular/tree/v0.12.5) (2024-09-24)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.9...v0.12.10)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.4...v0.12.5)

## [v0.12.9](https://github.com/modbus2mqtt/angular/tree/v0.12.9) (2024-11-16)
## [v0.12.4](https://github.com/volkmarnissen/angular/tree/v0.12.4) (2024-09-16)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.8...v0.12.9)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.3...v0.12.4)

## [v0.12.8](https://github.com/modbus2mqtt/angular/tree/v0.12.8) (2024-11-14)
## [v0.12.3](https://github.com/volkmarnissen/angular/tree/v0.12.3) (2024-09-06)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.7...v0.12.8)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.2...v0.12.3)

## [v0.12.7](https://github.com/modbus2mqtt/angular/tree/v0.12.7) (2024-10-23)
## [v0.12.2](https://github.com/volkmarnissen/angular/tree/v0.12.2) (2024-08-27)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.6...v0.12.7)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.0...v0.12.2)

## [v0.12.6](https://github.com/modbus2mqtt/angular/tree/v0.12.6) (2024-10-16)
## [v0.12.0](https://github.com/volkmarnissen/angular/tree/v0.12.0) (2024-08-16)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.5...v0.12.6)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.11.0...v0.12.0)

## [v0.12.5](https://github.com/modbus2mqtt/angular/tree/v0.12.5) (2024-09-24)
## [v0.11.0](https://github.com/volkmarnissen/angular/tree/v0.11.0) (2024-08-05)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.4...v0.12.5)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.10.1...v0.11.0)

## [v0.12.4](https://github.com/modbus2mqtt/angular/tree/v0.12.4) (2024-09-16)
## [v0.10.1](https://github.com/volkmarnissen/angular/tree/v0.10.1) (2024-08-05)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.3...v0.12.4)

## [v0.12.3](https://github.com/modbus2mqtt/angular/tree/v0.12.3) (2024-09-06)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.2...v0.12.3)

## [v0.12.2](https://github.com/modbus2mqtt/angular/tree/v0.12.2) (2024-08-27)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.12.0...v0.12.2)

## [v0.12.0](https://github.com/modbus2mqtt/angular/tree/v0.12.0) (2024-08-16)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.11.0...v0.12.0)

## [v0.11.0](https://github.com/modbus2mqtt/angular/tree/v0.11.0) (2024-08-05)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/v0.10.1...v0.11.0)

## [v0.10.1](https://github.com/modbus2mqtt/angular/tree/v0.10.1) (2024-08-05)

[Full Changelog](https://github.com/modbus2mqtt/angular/compare/0b2169b1bceece9fa4c2c6940ef33dafe96ae43b...v0.10.1)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/0b2169b1bceece9fa4c2c6940ef33dafe96ae43b...v0.10.1)



Expand Down
6 changes: 5 additions & 1 deletion cypress/fixtures/slave.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"pollInterval": 500,
"pollMode": 1,
"rootTopic": "heatpump",
"modbusErrorsForSlave": []
"modbusStatusForSlave": {
"errors": [],
"requestCount": [0, 1, 2, 3, 4, 5, 6, 7],
"queueLength": 23
}
}
6 changes: 5 additions & 1 deletion cypress/fixtures/slaves.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"pollInterval": 500,
"pollMode": 1,
"rootTopic": "heatpump",
"modbusErrorsForSlave": []
"modbusStatusForSlave": {
"errors": [],
"requestCount": [0, 1, 2, 3, 4, 5, 6, 7],
"queueLength": 23
}
}
]
13 changes: 9 additions & 4 deletions cypress/modbus-error.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@ import { ModbusErrorComponent } from "angular/src/app/modbus-error/modbus-error.
import {
Iconfiguration,
ImodbusErrorsForSlave,
ImodbusStatusForSlave,
ModbusErrorStates,
ModbusTasks,
} from "@modbus2mqtt/server.shared";
import { ModbusRegisterType } from "@modbus2mqtt/specification.shared";

let date = Date.now();
let modbusErrors: ImodbusErrorsForSlave = {
task: ModbusTasks.deviceDetection,
let modbusErrors: ImodbusStatusForSlave = {
errors: [{
task: ModbusTasks.specification,
date: date,
address: { address: 1, registerType: ModbusRegisterType.HoldingRegister },
state: ModbusErrorStates.crc,
}],
requestCount: [0,1,2,3,4,5,6,7],
queueLength: 23
};
function mount(currentDate: number) {
// This configures the rootUrl for /api... calls
Expand All @@ -33,7 +38,7 @@ function mount(currentDate: number) {
providers: [provideHttpClient(withInterceptorsFromDi()), provideRouter([])],
autoDetectChanges: true,
componentProperties: {
modbusErrors: [modbusErrors],
modbusErrors: modbusErrors,
currentDate: date + 30 * 1000,
},
});
Expand All @@ -48,7 +53,7 @@ function mount(currentDate: number) {
providers: [provideHttpClient(withInterceptorsFromDi()), provideRouter([])],
autoDetectChanges: true,
componentProperties: {
modbusErrors: [modbusErrors],
modbusErrors: modbusErrors,
currentDate: currentDate,
},
});
Expand Down
17 changes: 10 additions & 7 deletions src/app/modbus-error/modbus-error.component.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<div>
<div>
Number of entries in the queue: {{modbusErrors?modbusErrors.queueLength:""}}
</div>
<ng-container *ngFor="let task of tasksToLog">
<div class="icon-text">
<mat-icon [class]="filterNewerThan(filterTask( modbusErrors, task), getMinAgo(60)).length > 0 ? 'red':'green'">circle</mat-icon>
<span>Task: {{ getTaskName(task)}}</span>
<div class="icon-text" >
<mat-icon [class]="filterNewerThan(filterTask( modbusErrors.errors, task), getMinAgo(60)).length > 0 ? 'red':'green'">circle</mat-icon>
<span>Task: {{ getTaskName(task)}} ({{modbusErrors.requestCount[task] }} processed calls) </span>
</div>
<div class="indent" *ngFor="let state of getErrorStates( filterNewerThan(filterTask( modbusErrors, task), getMinAgo(60) ))" >
<div class="indent" *ngFor="let state of getErrorStates( filterNewerThan(filterTask( modbusErrors.errors, task), getMinAgo(60) ))" >
<div>{{ getErrorStateName(state)}}
</div>
<ng-container
[ngTemplateOutlet]="errorStates"
[ngTemplateOutletContext]="{stateErrors:filterNewerThan(filterErrorState( filterTask( modbusErrors, task), state), getMinAgo(60))}"/>
[ngTemplateOutletContext]="{stateErrors:filterNewerThan(filterErrorState( filterTask( modbusErrors.errors, task), state), getMinAgo(60)) }"/>
</div>
</ng-container>
<ng-template #errorStates let-stateErrors='stateErrors'>
<ng-template #errorStates let-stateErrors='stateErrors' >
<ng-container
[ngTemplateOutlet]="errors"
[ngTemplateOutletContext]="{errorlist:filterLast(stateErrors), timeHeader: 'Last', timeSince: true}"/>
Expand All @@ -23,7 +26,7 @@
[ngTemplateOutlet]="errors"
[ngTemplateOutletContext]="{errorlist:filterNewerThan(stateErrors, getMinAgo(60)), timeHeader: '1 hour', timeSince: false}"/>
</ng-template>
<ng-template #errors let-errorlist='errorlist' let-timeHeader='timeHeader' let-timeSince="timeSince">
<ng-template #errors let-errorlist='errorlist' let-timeHeader='timeHeader' let-timeSince="timeSince" let-task="task">
<mat-expansion-panel >
<mat-expansion-panel-header>
<mat-panel-title> {{timeHeader}}</mat-panel-title>
Expand Down
14 changes: 9 additions & 5 deletions src/app/modbus-error/modbus-error.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { MatTooltip } from "@angular/material/tooltip";
import {
Iconfiguration,
ImodbusErrorsForSlave,
ImodbusStatusForSlave,
ModbusErrorStates,
ModbusTasks,
} from "@modbus2mqtt/server.shared";
Expand All @@ -38,14 +39,17 @@ const oneMinuteInMs = 60 * 1000;
})
export class ModbusErrorComponent implements OnInit {
config: Iconfiguration;
@Input({ required: true }) modbusErrors: ImodbusErrorsForSlave[] | undefined;
@Input({ required: true }) modbusErrors: ImodbusStatusForSlave | undefined;
@Input({ required: false }) currentDate: number | undefined = undefined;

tasksToCount : ModbusTasks[] = [
ModbusTasks.poll,
ModbusTasks.specification
]

tasksToLog: ModbusTasks[] = [
ModbusTasks.poll,
ModbusTasks.specification,
ModbusTasks.deviceDetection,
ModbusTasks.initialConnect,
ModbusTasks.specification
];
constructor(private entityApiService: ApiService) {}
ngOnInit(): void {
Expand Down Expand Up @@ -169,7 +173,7 @@ export class ModbusErrorComponent implements OnInit {
address: { address: -1, registerType: ModbusRegisterType.AnalogInputs },
task: ModbusTasks.initialConnect,
state: ModbusErrorStates.noerror,
date: 0,
date: 0
};
if (inValue != undefined)
inValue.forEach((v) => {
Expand Down
8 changes: 6 additions & 2 deletions src/app/select-slave/select-slave.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
IEntityCommandTopics,
ImodbusErrorsForSlave,
apiUri,
ImodbusStatusForSlave,
} from "@modbus2mqtt/server.shared";
import { MatInput } from "@angular/material/input";
import {
Expand Down Expand Up @@ -194,6 +195,7 @@ export class SelectSlaveComponent extends SessionStorage implements OnInit {

private updateSlaves(detectSpec?: boolean) {
this.entityApiService.getSlaves(this.bus.busId).subscribe((slaves) => {
console.log(JSON.stringify(slaves))
this.uiSlaves = [];
slaves.forEach((s) => {
this.uiSlaves.push(this.getUiSlave(s, detectSpec));
Expand Down Expand Up @@ -777,7 +779,9 @@ export class SelectSlaveComponent extends SessionStorage implements OnInit {
uiSlave.slaveForm.get("discoverEntitiesList")!.enable();
else uiSlave.slaveForm.get("discoverEntitiesList")!.disable();
}
getModbusErrors(uiSlave: IuiSlave): ImodbusErrorsForSlave[] | undefined {
return uiSlave.slave.modbusErrorsForSlave;
getModbusErrors(uiSlave: IuiSlave): ImodbusStatusForSlave | undefined {
if( !uiSlave|| ! uiSlave.slave || ! uiSlave.slave.modbusStatusForSlave)
return { requestCount:[0,0,0,0,0,0,0,0,0], errors: [], queueLength:0}
return uiSlave.slave.modbusStatusForSlave;
}
}