RobotCore
1.0
WPILib port to raspberry Pi
Toggle main menu visibility
Loading...
Searching...
No Matches
SchedulerProto.java
1
// Copyright (c) FIRST and other WPILib contributors.
2
// Open Source Software; you can modify and/or share it under the terms of
3
// the WPILib BSD license file in the root directory of this project.
4
5
package
org.wpilib.command3.proto;
6
7
import
org.wpilib.command3.Command;
8
import
org.wpilib.command3.Scheduler;
9
import
org.wpilib.command3.proto.ProtobufCommands.ProtobufScheduler;
10
import
org.wpilib.util.protobuf.Protobuf;
11
import
us.hebi.quickbuf.Descriptors;
12
19
public
class
SchedulerProto
implements
Protobuf
<Scheduler, ProtobufScheduler> {
20
@Override
21
public
Class<Scheduler>
getTypeClass
() {
22
return
Scheduler
.class;
23
}
24
25
@Override
26
public
Descriptors.Descriptor
getDescriptor
() {
27
return
ProtobufScheduler.getDescriptor();
28
}
29
30
@Override
31
public
ProtobufScheduler
createMessage
() {
32
return
ProtobufScheduler.newInstance();
33
}
34
35
@Override
36
public
Scheduler
unpack(ProtobufScheduler msg) {
37
throw
new
UnsupportedOperationException(
"Deserialization not supported"
);
38
}
39
40
@Override
41
public
void
pack(ProtobufScheduler msg,
Scheduler
scheduler) {
42
msg.clear();
43
44
var commandProto =
new
CommandProto(scheduler);
45
46
Protobuf.packArray(
47
msg.getMutableQueuedCommands(),
48
scheduler.
getQueuedCommands
().toArray(
new
Command
[0]),
49
commandProto);
50
51
Protobuf.packArray(
52
msg.getMutableRunningCommands(),
53
scheduler.
getRunningCommands
().toArray(
new
Command
[0]),
54
commandProto);
55
56
msg.setLastTimeMs(scheduler.
lastRuntimeMs
());
57
}
58
}
org.wpilib.command3.Scheduler
Definition
Scheduler.java:106
org.wpilib.command3.Scheduler.getQueuedCommands
Collection< Command > getQueuedCommands()
Definition
Scheduler.java:1335
org.wpilib.command3.Scheduler.lastRuntimeMs
double lastRuntimeMs()
Definition
Scheduler.java:1427
org.wpilib.command3.Scheduler.getRunningCommands
Collection< Command > getRunningCommands()
Definition
Scheduler.java:1275
org.wpilib.command3.proto.SchedulerProto
Definition
SchedulerProto.java:19
org.wpilib.command3.proto.SchedulerProto.getDescriptor
Descriptors.Descriptor getDescriptor()
Definition
SchedulerProto.java:26
org.wpilib.command3.proto.SchedulerProto.createMessage
ProtobufScheduler createMessage()
Definition
SchedulerProto.java:31
org.wpilib.command3.proto.SchedulerProto.getTypeClass
Class< Scheduler > getTypeClass()
Definition
SchedulerProto.java:21
org.wpilib.command3.Command
Definition
Command.java:98
org.wpilib.util.protobuf.Protobuf
Definition
Protobuf.java:32
org
wpilib
command3
proto
SchedulerProto.java
Generated by
1.18.0