File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed
VisualPinball.Engine.Mpf.Test Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ Or, if you already have it:
40
40
41
41
` pip install mpf mpf-mc --pre --upgrade `
42
42
43
- After that, ` mpf --version ` should return at least ** MPF v0.55.0-dev.12 ** .
43
+ After that, ` mpf --version ` should return at least ** MPF v0.55.0-dev.37 ** .
44
44
45
45
## Usage
46
46
Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ public static async Task Main(string[] args)
69
69
mpfApi . Client . OnFadeLight += ( _ , request ) => {
70
70
Console . WriteLine ( $ "[MPF] light fades ({ request . CommonFadeMs } ms):") ;
71
71
} ;
72
+ mpfApi . Client . OnDmdFrame += ( _ , request ) => {
73
+ Console . WriteLine ( $ "[MPF] new DMD frame!") ;
74
+ } ;
72
75
73
76
var descr = mpfApi . GetMachineDescription ( ) ;
74
77
Console . WriteLine ( $ "Description: { descr } in { s . ElapsedMilliseconds } ms") ;
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ public class MpfClient
30
30
public event EventHandler < DisableCoilRequest > OnDisableCoil ;
31
31
public event EventHandler < ConfigureHardwareRuleRequest > OnConfigureHardwareRule ;
32
32
public event EventHandler < RemoveHardwareRuleRequest > OnRemoveHardwareRule ;
33
+ public event EventHandler < SetDmdFrameRequest > OnDmdFrame ;
33
34
34
35
private Channel _channel ;
35
36
private MpfHardwareService . MpfHardwareServiceClient _client ;
@@ -96,6 +97,9 @@ private async void ReceiveCommands()
96
97
case Commands . CommandOneofCase . RemoveHardwareRule :
97
98
OnRemoveHardwareRule ? . Invoke ( this , commands . RemoveHardwareRule ) ;
98
99
break ;
100
+ case Commands . CommandOneofCase . DmdFrameRequest :
101
+ OnDmdFrame ? . Invoke ( this , commands . DmdFrameRequest ) ;
102
+ break ;
99
103
default :
100
104
throw new ArgumentOutOfRangeException ( ) ;
101
105
}
Original file line number Diff line number Diff line change @@ -34,10 +34,23 @@ message LightDescription {
34
34
string hardware_channel_color = 3 ;
35
35
}
36
36
37
+ message DmdDescription {
38
+ enum ColorMapping {
39
+ BW = 0 ;
40
+ RGB = 1 ;
41
+ }
42
+
43
+ string name = 1 ;
44
+ ColorMapping color_mapping = 2 ;
45
+ uint32 width = 3 ;
46
+ uint32 height = 4 ;
47
+ }
48
+
37
49
message MachineDescription {
38
50
repeated SwitchDescription switches = 1 ;
39
51
repeated CoilDescription coils = 2 ;
40
52
repeated LightDescription lights = 3 ;
53
+ repeated DmdDescription dmds = 4 ;
41
54
}
42
55
43
56
// Platform streams switch changes to MPF
@@ -47,6 +60,12 @@ message SwitchChanges {
47
60
uint64 change_time = 3 ;
48
61
}
49
62
63
+ message SetDmdFrameRequest {
64
+ string name = 1 ;
65
+ bytes frame = 2 ;
66
+ float brightness = 3 ;
67
+ }
68
+
50
69
message Commands {
51
70
oneof command {
52
71
FadeLightRequest fade_light = 1 ;
@@ -55,6 +74,7 @@ message Commands {
55
74
DisableCoilRequest disable_coil = 4 ;
56
75
ConfigureHardwareRuleRequest configure_hardware_rule = 5 ;
57
76
RemoveHardwareRuleRequest remove_hardware_rule = 6 ;
77
+ SetDmdFrameRequest dmd_frame_request = 7 ;
58
78
}
59
79
}
60
80
You can’t perform that action at this time.
0 commit comments