File tree Expand file tree Collapse file tree 7 files changed +13
-13
lines changed Expand file tree Collapse file tree 7 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 5
5
namespace Flat3 \RevPi \IO ;
6
6
7
7
use Flat3 \RevPi \Interfaces \Module ;
8
- use Flat3 \RevPi \Monitors \DigitalTrigger ;
8
+ use Flat3 \RevPi \Monitors \DigitalMonitor ;
9
9
10
10
abstract class IO
11
11
{
@@ -22,7 +22,7 @@ public function get(): int|bool
22
22
23
23
public function monitor (callable $ callback ): void
24
24
{
25
- $ this ->module ->monitor (new DigitalTrigger ($ this ->name , $ callback ));
25
+ $ this ->module ->monitor (new DigitalMonitor ($ this ->name , $ callback ));
26
26
}
27
27
28
28
public function default (): int |bool
Original file line number Diff line number Diff line change 5
5
namespace Flat3 \RevPi \Interfaces ;
6
6
7
7
use Flat3 \RevPi \Led \LedPosition ;
8
- use Flat3 \RevPi \Monitors \Trigger ;
8
+ use Flat3 \RevPi \Monitors \Monitor ;
9
9
10
10
interface Module
11
11
{
@@ -15,7 +15,7 @@ public function getProcessImage(): ProcessImage;
15
15
16
16
public function resume (): void ;
17
17
18
- public function monitor (Trigger $ monitor ): void ;
18
+ public function monitor (Monitor $ monitor ): void ;
19
19
20
20
public function getSerialPort (string $ devicePath ): SerialPort ;
21
21
}
Original file line number Diff line number Diff line change 9
9
use Flat3 \RevPi \Interfaces \Module as ModuleInterface ;
10
10
use Flat3 \RevPi \Interfaces \ProcessImage ;
11
11
use Flat3 \RevPi \Interfaces \SerialPort ;
12
- use Flat3 \RevPi \Monitors \Trigger ;
12
+ use Flat3 \RevPi \Monitors \Monitor ;
13
13
use Illuminate \Support \Facades \Event ;
14
14
use Revolt \EventLoop ;
15
15
@@ -54,7 +54,7 @@ public function cancel(): void
54
54
$ this ->pollingCallbackId = null ;
55
55
}
56
56
57
- public function monitor (Trigger $ monitor ): void
57
+ public function monitor (Monitor $ monitor ): void
58
58
{
59
59
Event::listen (PollingEvent::class, function () use ($ monitor ) {
60
60
static $ previous = null ;
Original file line number Diff line number Diff line change 14
14
use Flat3 \RevPi \Interfaces \SerialPort ;
15
15
use Flat3 \RevPi \Led \LedPosition ;
16
16
use Flat3 \RevPi \Led \RemoteLed ;
17
- use Flat3 \RevPi \Monitors \Trigger ;
17
+ use Flat3 \RevPi \Monitors \Monitor ;
18
18
use Flat3 \RevPi \ProcessImage \ProcessImage ;
19
19
20
20
use function Amp \Websocket \Client \connect ;
@@ -49,7 +49,7 @@ public function resume(): void
49
49
throw new NotImplementedException ;
50
50
}
51
51
52
- public function monitor (Trigger $ monitor ): void
52
+ public function monitor (Monitor $ monitor ): void
53
53
{
54
54
throw new NotImplementedException ;
55
55
}
Original file line number Diff line number Diff line change 4
4
5
5
namespace Flat3 \RevPi \Monitors ;
6
6
7
- class DigitalTrigger extends Trigger
7
+ class DigitalMonitor extends Monitor
8
8
{
9
9
public function evaluate (mixed $ previous , mixed $ next ): void
10
10
{
Original file line number Diff line number Diff line change 4
4
5
5
namespace Flat3 \RevPi \Monitors ;
6
6
7
- abstract class Trigger
7
+ abstract class Monitor
8
8
{
9
9
/**
10
10
* @param callable $callback
Original file line number Diff line number Diff line change 7
7
use Flat3 \RevPi \Interfaces \Module ;
8
8
use Flat3 \RevPi \Led \LedColour ;
9
9
use Flat3 \RevPi \Led \LedPosition ;
10
- use Flat3 \RevPi \Monitors \DigitalTrigger ;
10
+ use Flat3 \RevPi \Monitors \DigitalMonitor ;
11
11
use Flat3 \RevPi \Tests \TestCase ;
12
12
13
13
class Connect5Test extends TestCase
@@ -34,7 +34,7 @@ public function test_analog_watch_high_low(): void
34
34
$ module ->getProcessImage ()->writeVariable ('AnalogOutputLogicLevel_1 ' , false );
35
35
$ this ->loop (2 );
36
36
37
- $ module ->monitor (new DigitalTrigger ('AnalogInputLogicLevel_1 ' , function ($ next ) {
37
+ $ module ->monitor (new DigitalMonitor ('AnalogInputLogicLevel_1 ' , function ($ next ) {
38
38
$ this ->switch = $ next ;
39
39
}));
40
40
@@ -67,7 +67,7 @@ public function test_digital_watch_high_low(): void
67
67
$ module ->getProcessImage ()->writeVariable ('DigitalOutput_3 ' , false );
68
68
self ::assertFalse ($ module ->getProcessImage ()->readVariable ('DigitalOutput_3 ' ));
69
69
70
- $ module ->monitor (new DigitalTrigger ('DigitalInput_4 ' , function ($ next ) {
70
+ $ module ->monitor (new DigitalMonitor ('DigitalInput_4 ' , function ($ next ) {
71
71
$ this ->switch = $ next ;
72
72
}));
73
73
You can’t perform that action at this time.
0 commit comments