Commit 25a681b
authored
Modbus Bridge: refactor & cleanup Elements (OpenEMS#2273)
This is a follow-up PR to OpenEMS#1976.
The initial intention for this PR was a bug that existed previously: When the Modbus Bridge detects a 'defective device', i.e. it is not possible to read from an external device connected via modbus, e.g. because it is turned off, somebody unplugged the cable, etc., all Channels are 'invalidated'. This invalidation did not work properly for individual Bits in `BitsWordElements`.
When looking at the previous code it becomes obvious how such a bug could happen. The structure and inheritance was complicated and @OVERRIDES were often unclear. Also there were hardly any JUnit tests to validate the function.
Because of this I had added JUnit tests in OpenEMS#2283, then refactored all Modbus Element classes and revalidated that they behave exactly the same way as before with the JUnit tests.
This implementation is tested on a couple of production systems, including my own private system.1 parent b0dff31 commit 25a681b
File tree
76 files changed
+876
-1307
lines changed- io.openems.edge.battery.fenecon.home/src/io/openems/edge/battery/fenecon/home
- io.openems.edge.battery.soltaro/src/io/openems/edge/battery/soltaro
- cluster
- versionb
- versionc
- single
- versionb
- versionc
- io.openems.edge.bridge.modbus
- src/io/openems/edge/bridge/modbus
- api
- element
- task
- worker
- sunspec
- test/io/openems/edge/bridge/modbus/api
- element
- task
- io.openems.edge.edge2edge/src/io/openems/edge/edge2edge/common
- io.openems.edge.goodwe/src/io/openems/edge/goodwe/common
- io.openems.edge.io.wago/src/io/openems/edge/wago
- io.openems.edge.io.weidmueller/src/io/openems/edge/io/weidmueller
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
76 files changed
+876
-1307
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
742 | | - | |
| 741 | + | |
| 742 | + | |
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | | - | |
686 | | - | |
| 685 | + | |
687 | 686 | | |
688 | 687 | | |
689 | 688 | | |
690 | | - | |
691 | | - | |
| 689 | + | |
| 690 | + | |
692 | 691 | | |
693 | 692 | | |
694 | 693 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | | - | |
| 489 | + | |
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
966 | 966 | | |
967 | 967 | | |
968 | 968 | | |
969 | | - | |
970 | | - | |
| 969 | + | |
| 970 | + | |
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
| 495 | + | |
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
568 | | - | |
| 568 | + | |
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
641 | | - | |
| 641 | + | |
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
| |||
Lines changed: 30 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
| 328 | + | |
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
| |||
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | | - | |
| 353 | + | |
353 | 354 | | |
354 | | - | |
355 | | - | |
| 355 | + | |
| 356 | + | |
356 | 357 | | |
357 | 358 | | |
358 | | - | |
| 359 | + | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| |||
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
367 | | - | |
| 368 | + | |
| 369 | + | |
368 | 370 | | |
369 | | - | |
370 | | - | |
371 | | - | |
| 371 | + | |
| 372 | + | |
372 | 373 | | |
373 | 374 | | |
374 | | - | |
| 375 | + | |
375 | 376 | | |
| 377 | + | |
376 | 378 | | |
377 | 379 | | |
378 | 380 | | |
379 | | - | |
| 381 | + | |
380 | 382 | | |
381 | 383 | | |
382 | 384 | | |
| |||
390 | 392 | | |
391 | 393 | | |
392 | 394 | | |
393 | | - | |
| 395 | + | |
394 | 396 | | |
395 | 397 | | |
396 | 398 | | |
397 | | - | |
| 399 | + | |
398 | 400 | | |
399 | 401 | | |
400 | 402 | | |
| |||
411 | 413 | | |
412 | 414 | | |
413 | 415 | | |
414 | | - | |
| 416 | + | |
415 | 417 | | |
416 | 418 | | |
417 | 419 | | |
418 | 420 | | |
419 | | - | |
420 | | - | |
| 421 | + | |
421 | 422 | | |
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
427 | | - | |
| 428 | + | |
428 | 429 | | |
429 | 430 | | |
430 | 431 | | |
431 | 432 | | |
432 | 433 | | |
433 | 434 | | |
434 | | - | |
435 | | - | |
| 435 | + | |
| 436 | + | |
436 | 437 | | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
443 | | - | |
| 444 | + | |
444 | 445 | | |
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
449 | | - | |
450 | | - | |
| 450 | + | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
| |||
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
460 | | - | |
| 461 | + | |
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
468 | | - | |
469 | | - | |
| 469 | + | |
| 470 | + | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| |||
Lines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
| 38 | + | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | | - | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
79 | | - | |
| 78 | + | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| |||
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | | - | |
| 87 | + | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
| |||
0 commit comments