|
|
|
@ -7,67 +7,6 @@ use prost::Message;
|
|
|
|
|
use std::io::Cursor;
|
|
|
|
|
use serde::{Serialize, Deserialize};
|
|
|
|
|
|
|
|
|
|
// TODO:
|
|
|
|
|
// 1) Represent state of division/fieldset/field/match(maybe save/load)
|
|
|
|
|
// 2) Create functions to update the states and publish to MQTT based on incoming 'notifications'
|
|
|
|
|
// 2) Create functions to update the state that map to NOTICE_IDs and take in the notice struct
|
|
|
|
|
// Notifications parsed last year:
|
|
|
|
|
// - NOTICE_REALTIME_SCORE_CHANGED
|
|
|
|
|
// - NOTICE_FIELD_TIMER_STARTED
|
|
|
|
|
// - NOTICE_FIELD_TIMER_STOPPED
|
|
|
|
|
// - NOTICE_FIELD_RESET_TIMER
|
|
|
|
|
// - NOTICE_FIELD_MATCH_ASSIGNED
|
|
|
|
|
// - NOTICE_ACTIVE_FIELD_CHANGED
|
|
|
|
|
// - NOTICE_RANKINGS_UPDATED
|
|
|
|
|
// - NOTICE_EVENT_STATUS_UPDATED
|
|
|
|
|
// - NOTICE_ELIM_ALLIANCE_UPDATED
|
|
|
|
|
// - NOTICE_ELIM_UNAVAIL_TEAMS_UPDATED
|
|
|
|
|
// - NOTICE_MATCH_LIST_UPDATED
|
|
|
|
|
//
|
|
|
|
|
// Notice protobuf:
|
|
|
|
|
// message Notice {
|
|
|
|
|
// optional tm.NoticeId id = 1;
|
|
|
|
|
// optional tm.MatchTuple affectedMatch = 2;
|
|
|
|
|
// optional tm.ElimAlliance elimAlliance = 3;
|
|
|
|
|
// optional tm.SideChallengeScore sideChallengeScore = 4;
|
|
|
|
|
// optional tm.EventConfig eventConfig = 5;
|
|
|
|
|
// optional tm.FieldHwState fieldState = 6;
|
|
|
|
|
// optional tm.FieldTime fieldTime = 7;
|
|
|
|
|
// optional tm.Field field = 8;
|
|
|
|
|
// optional tm.MatchTimeSchedList matchTimeSchedList = 9;
|
|
|
|
|
// optional tm.MatchTimeSchedList matchTimeSched = 10;
|
|
|
|
|
// optional tm.FieldSetList fieldSetList = 11;
|
|
|
|
|
// optional tm.PitDisplayList pitDisplayList = 12;
|
|
|
|
|
// optional tm.DisplayState displayState = 13;
|
|
|
|
|
// optional tm.AssignedObjectType.AssignedObjectEnum assignedType = 15;
|
|
|
|
|
// optional tm.PublishOptions publishOptions = 16;
|
|
|
|
|
// optional tm.Division division = 17;
|
|
|
|
|
// optional tm.MatchScore matchScore = 18;
|
|
|
|
|
// optional tm.Rankings rankings = 19;
|
|
|
|
|
// optional tm.MatchRound affectedRound = 20;
|
|
|
|
|
// optional tm.Award award = 21;
|
|
|
|
|
// optional tm.FieldSet fieldSet = 22;
|
|
|
|
|
// optional tm.TeamInfo teamInfo = 23;
|
|
|
|
|
// optional double obsolete_serverTime = 24;
|
|
|
|
|
// optional tm.TeamInspection teamInspection = 25;
|
|
|
|
|
// optional int32 obsolete_serverTimeZoneInSecs = 27;
|
|
|
|
|
// optional tm.ElimQueueList elimQueueList = 28;
|
|
|
|
|
// optional tm.TextMessageNotice textMessage = 29;
|
|
|
|
|
// optional string originatingClient = 30;
|
|
|
|
|
// optional bool isLocal = 31;
|
|
|
|
|
// optional tm.DisplaySlide displaySlide = 32;
|
|
|
|
|
// optional tm.AssignedMatchList assignedMatchList = 33;
|
|
|
|
|
// optional tm.MobileDeviceMatchLockList mobileMatchLocks = 34;
|
|
|
|
|
// optional tm.ElimWinsToAdvanceList elimWinsToAdvanceList = 35;
|
|
|
|
|
// optional string temporaryCode = 36;
|
|
|
|
|
// optional tm.MatchScoreList matchScoreLog = 37;
|
|
|
|
|
// optional tm.PublishStatus publishStatus = 38;
|
|
|
|
|
// optional tm.MatchInfo matchInfo = 39;
|
|
|
|
|
// optional tm.AwardList awardList = 40;
|
|
|
|
|
// optional string eventName = 41;
|
|
|
|
|
// optional tm.FieldControlStatus fieldControlStatus = 42;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// MQTT Topics:
|
|
|
|
|
// - division/{division_id}
|
|
|
|
|
// - division/{division_id}/ranking
|
|
|
|
|