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
130 changes: 44 additions & 86 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,134 +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.22...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)

- Baudrate 2400, 4800 is not configurable [\#16](https://github.com/modbus2mqtt/angular/pull/16) ([volkmarnissen](https://github.com/volkmarnissen))
- Enable Display and Input in Hex format for modbus Addresses [\#14](https://github.com/modbus2mqtt/angular/pull/14) ([volkmarnissen](https://github.com/volkmarnissen))
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.17...v0.12.18)

## [v0.12.22](https://github.com/modbus2mqtt/angular/tree/v0.12.22) (2025-09-03)
## [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.21...v0.12.22)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.16...v0.12.17)

## [v0.12.21](https://github.com/modbus2mqtt/angular/tree/v0.12.21) (2025-09-03)
## [v0.12.16](https://github.com/volkmarnissen/angular/tree/v0.12.16) (2024-12-31)

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

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

- \[Feature\] Add number of processed calls to Modbus Status [\#12](https://github.com/modbus2mqtt/angular/pull/12) ([volkmarnissen](https://github.com/volkmarnissen))
- \[Feature\] Add number of processed calls to Modbus Status [\#11](https://github.com/modbus2mqtt/angular/pull/11) ([volkmarnissen](https://github.com/volkmarnissen))
- 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.14...v0.12.15)

## [v0.12.20](https://github.com/modbus2mqtt/angular/tree/v0.12.20) (2025-04-14)
## [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.19...v0.12.20)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/0.12.14...v0.12.14)

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

- 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.13...0.12.14)

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

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

## [v0.12.18](https://github.com/modbus2mqtt/angular/tree/v0.12.18) (2025-01-15)
## [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.17...v0.12.18)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.11...v0.12.12)

## [v0.12.17](https://github.com/modbus2mqtt/angular/tree/v0.12.17) (2025-01-02)
## [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.16...v0.12.17)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.10...v0.12.11)

**Merged pull requests:**
## [v0.12.10](https://github.com/volkmarnissen/angular/tree/v0.12.10) (2024-11-19)

- 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.9...v0.12.10)

## [v0.12.16](https://github.com/modbus2mqtt/angular/tree/v0.12.16) (2024-12-31)
## [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.15...v0.12.16)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.8...v0.12.9)

## [v0.12.15](https://github.com/modbus2mqtt/angular/tree/v0.12.15) (2024-12-30)
## [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.14...v0.12.15)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.7...v0.12.8)

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

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

## [0.12.14](https://github.com/modbus2mqtt/angular/tree/0.12.14) (2024-12-13)
## [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.13...0.12.14)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.5...v0.12.6)

## [v0.12.13](https://github.com/modbus2mqtt/angular/tree/v0.12.13) (2024-12-13)
## [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.12...v0.12.13)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.4...v0.12.5)

## [v0.12.12](https://github.com/modbus2mqtt/angular/tree/v0.12.12) (2024-12-11)
## [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.11...v0.12.12)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.3...v0.12.4)

## [v0.12.11](https://github.com/modbus2mqtt/angular/tree/v0.12.11) (2024-11-22)
## [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.10...v0.12.11)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.2...v0.12.3)

## [v0.12.10](https://github.com/modbus2mqtt/angular/tree/v0.12.10) (2024-11-19)
## [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.9...v0.12.10)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.12.0...v0.12.2)

## [v0.12.9](https://github.com/modbus2mqtt/angular/tree/v0.12.9) (2024-11-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.8...v0.12.9)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.11.0...v0.12.0)

## [v0.12.8](https://github.com/modbus2mqtt/angular/tree/v0.12.8) (2024-11-14)
## [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.7...v0.12.8)
[Full Changelog](https://github.com/volkmarnissen/angular/compare/v0.10.1...v0.11.0)

## [v0.12.7](https://github.com/modbus2mqtt/angular/tree/v0.12.7) (2024-10-23)
## [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.6...v0.12.7)

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

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

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

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

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

[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
25 changes: 5 additions & 20 deletions cypress/fixtures/converters.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
[
{
"name": "number",
"registerTypes": [3, 4]
},
{
"name": "select",
"registerTypes": [3, 4, 1]
},
{
"name": "text",
"registerTypes": [3, 4]
},
{
"name": "binary",
"registerTypes": [1, 3]
},
{
"name": "value",
"registerTypes": [4, 3]
}
"number",
"select",
"text",
"binary",
"value"
]
6 changes: 1 addition & 5 deletions cypress/modbus-error.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ import {
provideHttpClient,
withInterceptorsFromDi,
} from "@angular/common/http";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { ActivatedRoute, provideRouter } from "@angular/router";
import { provideRouter } from "@angular/router";

import { ISpecificationMethods } from "angular/src/app/services/specificationInterface";
import { ModbusErrorComponent } from "angular/src/app/modbus-error/modbus-error.component";
import {
Iconfiguration,
ImodbusErrorsForSlave,
ImodbusStatusForSlave,
ModbusErrorStates,
ModbusTasks,
Expand Down
97 changes: 67 additions & 30 deletions cypress/specification-entity.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import {
beforeEachHelper as beforeEachEntityHelper,
mountEntityComponent,
setOnEntityNameOrVariableFieldsChangeFunc,
setOnPostModbusEntityFunc
} from "./support/entityHelper";
import { ImodbusData, Inumber, Itext } from "@modbus2mqtt/specification.shared";
import { Subject } from "rxjs";

describe("Entity Component tests", () => {
beforeEach(beforeEachEntityHelper); // mounts entity and opens all expansion panels
Expand Down Expand Up @@ -41,40 +44,74 @@ describe("Entity Component tests", () => {
});
it("No Variable Type => no variableConfiguration", () => {
cy.get('mat-select[formControlName="variableType"]')
.click()
.get("mat-option")
.first()
.click()
cy.get('input[formControlName="name"]').type("test")
cy.get('input[formControlName="icon"]').click().then(()=>{setOnEntityNameOrVariableFieldsChangeFunc((entity) => {
expect(entity.variableConfiguration).to.be.undefined;
expect((entity as ImodbusEntityWithName).name).to.be.equal('test');
})})
cy.get('mat-select[formControlName="variableEntity"]').invoke('val')
.then(val=>{
const myVal = val;
expect(myVal).to.equal('');
})

//cy.get('input[formControlName="name"]').should(
// "not.be.null");

});
it("Set Byte Order for Number", () => {
cy.get('mat-select[formControlName="converter"]')
.click()
.get("mat-option")
.first()
.click();
cy.get('input[formControlName="name"]').type("test");
cy.get('input[formControlName="icon"]')
.click().then(() => {
// Validation will be called after value change of any name or variable field
// onVariableEntityValueChange or onEntityNameValueChange
setOnPostModbusEntityFunc((entity) => {
expect((entity!.converterParameters! as Inumber).swapBytes).to.be.true;
return new Subject<ImodbusData>();
});
});;
cy.openAllExpansionPanels()
cy.get('mat-slide-toggle[formControlName="swapBytes"]')
.click()

});
it("Set Byte Order for Text", () => {
cy.get('mat-select[formControlName="converter"]')
.click()
.then(() => {
setOnEntityNameOrVariableFieldsChangeFunc((entity) => {
expect(entity.variableConfiguration).to.be.undefined;
expect((entity as ImodbusEntityWithName).name).to.be.equal("test");
.get("mat-option")
.eq(2)
.click().then(() => {
// Validation will be called after value change of any name or variable field
// onVariableEntityValueChange or onEntityNameValueChange
setOnPostModbusEntityFunc((entity) => {
expect((entity!.converterParameters! as Itext).swapBytes, "swapBytes is not defined").not.to.be.undefined;
expect((entity!.converterParameters! as Itext).swapBytes).to.be.true;
return new Subject<ImodbusData>();
});
});
cy.get('mat-select[formControlName="variableEntity"]')
.invoke("val")
.then((val) => {
const myVal = val;
expect(myVal).to.equal("");
});

//cy.get('input[formControlName="name"]').should(
// "not.be.null");

});;
cy.openAllExpansionPanels()
cy.get('[formControlName= "textSwapBytes"]')
.click()

});
});
describe("Test for Modbus Address", () => {
beforeEach(()=>{mountEntityComponent(true)}); // mounts entity and opens all expansion panels
afterEach(afterEachEntityHelper);
it("Modbus address in hex", () => {
const inputField='input[formControlName="modbusAddress"]'
const matField='mat-form-field input[formControlName="modbusAddress"]'
cy.get(inputField).should('have.value', '0x4');
cy.get(inputField).clear().type('1234').blur().should('have.value', '0x4d2');
cy.get(inputField).clear().type('0X12s32').blur().should('have.value', '0x1232');
cy.get(inputField).clear().type('0xx7')
cy.get(inputField).parent().get( "mat-error").should('contain', 'dec or hex')
})
});
// describe("Test for Modbus Address", () => {
// beforeEach(()=>{mountEntityComponent(true)}); // mounts entity and opens all expansion panels
// afterEach(afterEachEntityHelper);
// it("Modbus address in hex", () => {
// const inputField='input[formControlName="modbusAddress"]'
// const matField='mat-form-field input[formControlName="modbusAddress"]'
// cy.get(inputField).should('have.value', '0x4');
// cy.get(inputField).clear().type('1234').blur().should('have.value', '0x4d2');
// cy.get(inputField).clear().type('0X12s32').blur().should('have.value', '0x1232');
// cy.get(inputField).clear().type('0xx7')
// cy.get(inputField).parent().get( "mat-error").should('contain', 'dec or hex')
// })
// });
11 changes: 10 additions & 1 deletion cypress/support/entityHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "@modbus2mqtt/specification.shared";
import { ISpecificationMethods } from "angular/src/app/services/specificationInterface";
import { EntityComponent } from "angular/src/app/specification/entity/entity.component";
import { Subject } from "rxjs";
import { Observable, Subject } from "rxjs";
/**
* specification methods
*/
Expand Down Expand Up @@ -68,6 +68,14 @@ export function setOnEntityNameOrVariableFieldsChangeFunc(
if (valFunc) specificationMethods.copy2Translation = valFunc;
else specificationMethods.copy2Translation = () => {};
}
export function setOnPostModbusEntityFunc(
valFunc?: (entity: ImodbusEntity|undefined) => Observable<ImodbusData>
) {
if (valFunc) specificationMethods.postModbusEntity = valFunc;
else specificationMethods.postModbusEntity = () => {return new Subject<ImodbusData>()};
}


let selectEntity: ImodbusEntity = {
id: 1,
modbusValue: [4, 1, 1, 1],
Expand Down Expand Up @@ -122,4 +130,5 @@ export function beforeEachHelper() {
export function afterEachEntityHelper() {
// reset specificationMethods
setOnEntityNameOrVariableFieldsChangeFunc();
setOnPostModbusEntityFunc();
}
15 changes: 15 additions & 0 deletions src/app/specification/entity/entity.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ <h3 class="smallfield width150pt"> Identification{{entity.readonly?"":"/step"}}<
formControlName="step" (change)="onConverterValueChange()">
</mat-form-field>
</div>
<h3 class="smallfield width150pt"> Byte/Word Order</h3>
<div class="flexrows">
<mat-slide-toggle class="width50 toggleField" formControlName="swapWords"
matTooltip="Swap Words in 32 Bit Values"
(change)="onConverterValueChange()">Swap Word</mat-slide-toggle>
<mat-slide-toggle class="width50 toggleField" formControlName="swapBytes"
matTooltip="Swap Bytes"
(change)="onConverterValueChange()">Swap Bytes</mat-slide-toggle>
</div>
</div>
</form>
</mat-expansion-panel>
Expand All @@ -290,6 +299,12 @@ <h3 class="smallfield width150pt"> Identification{{entity.readonly?"":"/step"}}<
matTooltip="Optional: The entity is identified if the mqttvalue matches the regular expression"
formControlName="identExpr" (change)="onConverterValueChange()">
</mat-form-field>
<div >
<mat-slide-toggle class="width50 toggleField" formControlName="textSwapBytes"
matTooltip="Swap Bytes"
(change)="onConverterValueChange()">Swap Bytes</mat-slide-toggle>
</div>

</form>
</mat-expansion-panel>
<mat-expansion-panel
Expand Down
Loading