コード例 #1
0
 internal ShuffleboardInstance(NetworkTableInstance ntInstance)
 {
     m_rootTable        = ntInstance.GetTable(Shuffleboard.kBaseTableName);
     m_rootMetaTable    = m_rootTable.GetSubTable(".metadata");
     m_selectedTabEntry = m_rootMetaTable.GetEntry("Selected");
     UsageReporting.Report(ResourceType.Shuffleboard, 0);
 }
コード例 #2
0
ファイル: SimpleWidget.cs プロジェクト: robotdotnet/WPILib
 public override void BuildInto(NetworkTable parentTable, NetworkTable metaTable)
 {
     BuildMetadata(metaTable);
     if (!m_entry.IsValid)
     {
         m_entry = parentTable.GetEntry(Title);
     }
 }
コード例 #3
0
ファイル: DriverStation.cs プロジェクト: robotdotnet/WPILib
 public MatchDataSender(NetworkTableInstance inst)
 {
     table        = inst.GetTable("FMSInfo");
     typeMetadata = table.GetEntry(".type");
     typeMetadata.ForceSetString("FMSInfo");
     gameSpecificMessage = table.GetEntry("GameSpecificMessage");
     gameSpecificMessage.ForceSetString("");
     eventName = table.GetEntry("EventName");
     eventName.ForceSetString("");
     matchNumber = table.GetEntry("MatchNumber");
     matchNumber.ForceSetDouble(0);
     replayNumber = table.GetEntry("ReplayNumber");
     replayNumber.ForceSetDouble(0);
     matchType = table.GetEntry("MatchType");
     matchType.ForceSetDouble(0);
     alliance = table.GetEntry("IsRedAlliance");
     alliance.ForceSetBoolean(true);
     station = table.GetEntry("StationNumber");
     station.ForceSetDouble(1);
     controlWord = table.GetEntry("FMSControlData");
     controlWord.ForceSetDouble(0);
 }
コード例 #4
0
        void ISendable.InitSendable(ISendableBuilder builder)
        {
            builder.SmartDashboardType = "Scheduler";
            NetworkTableEntry namesEntry  = builder.GetEntry("Names");
            NetworkTableEntry idsEntry    = builder.GetEntry("Ids");
            NetworkTableEntry cancelEntry = builder.GetEntry("Cancel");

            builder.UpdateTable = () =>
            {
                var ids = new Dictionary <double, ICommand>();

                foreach (var command in m_scheduledCommands.Keys)
                {
                    ids.Add(command.GetHashCode(), command);
                }

                var toCancel = cancelEntry.GetDoubleArray(ReadOnlySpan <double> .Empty);
                foreach (var hash in toCancel)
                {
                    if (ids.TryGetValue(hash, out var command))
                    {
                        Cancel(command);
                        ids.Remove(hash);
                    }
                    cancelEntry.SetDoubleArray(ReadOnlySpan <double> .Empty);
                }

                var names = new List <string>();

                foreach (var command in ids.Values)
                {
                    names.Add(command.Name);
                }

                namesEntry.SetStringArray(names.ToArray());
                idsEntry.SetDoubleArray(ids.Keys.ToArray());
            };
        }
コード例 #5
0
 internal RecordingController(NetworkTableInstance ntInstance)
 {
     m_recordingControlEntry        = ntInstance.GetEntry(RecordingControlKey);
     m_recordingFileNameFormatEntry = ntInstance.GetEntry(RecordingFileNameFormatKey);
     m_eventsTable = ntInstance.GetTable(EventMarkerTableName);
 }