Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
add time widget
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGamer1002 committed Mar 28, 2023
1 parent eee0e1b commit c27ba97
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 60 deletions.
109 changes: 49 additions & 60 deletions final-final-final.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"showGrid": true,
"hgap": 16.0,
"vgap": 16.0,
"titleType": 2,
"titleType": 1,
"tiles": {
"0,0": {
"size": [
Expand Down Expand Up @@ -38,7 +38,7 @@
"Visuals/Show voltage and current values": true
}
},
"26,0": {
"27,0": {
"size": [
5,
8
Expand Down Expand Up @@ -88,14 +88,27 @@
"Visuals/Num tick marks": 5,
"Visuals/Show text": true,
"Visuals/Orientation": "HORIZONTAL"
},
{
"_type": "Number Bar",
"_source0": "network_table:///Shuffleboard/Config/Tank/Max Speed",
"_title": "Max Speed",
"_glyph": 148,
"_showGlyph": false,
"Range/Min": 0.0,
"Range/Max": 1.0,
"Range/Center": 0.0,
"Visuals/Num tick marks": 5,
"Visuals/Show text": true,
"Visuals/Orientation": "HORIZONTAL"
}
]
}
},
"8,0": {
"size": [
9,
8
16,
14
],
"content": {
"_type": "Camera Stream",
Expand All @@ -106,37 +119,16 @@
"Crosshair/Show crosshair": true,
"Crosshair/Crosshair color": "#FFFFFFFF",
"Controls/Show controls": true,
"Controls/Rotation": "HALF",
"Controls/Rotation": "NONE",
"compression": 35.0,
"fps": 15,
"imageWidth": 640,
"imageHeight": 480
}
},
"17,0": {
"size": [
9,
8
],
"content": {
"_type": "Camera Stream",
"_source0": "camera_server://limelight",
"_title": "limelight",
"_glyph": 148,
"_showGlyph": false,
"Crosshair/Show crosshair": true,
"Crosshair/Crosshair color": "#FFFFFFFF",
"Controls/Show controls": true,
"Controls/Rotation": "HALF",
"compression": 27.0,
"fps": -1,
"imageWidth": -1,
"imageHeight": -1
}
},
"12,8": {
"25,8": {
"size": [
19,
7,
7
],
"content": {
Expand All @@ -155,38 +147,6 @@
"Visible data/FMSInfo/FMSControlData": true,
"Visible data/Shuffleboard/PDP/PDP/Voltage": true
}
},
"9,10": {
"size": [
3,
3
],
"content": {
"_type": "Number Bar",
"_source0": "network_table:///Shuffleboard/Config/Tank/Max Speed",
"_title": "Shuffleboard/Config/Tank/Max Speed",
"_glyph": 148,
"_showGlyph": false,
"Range/Min": 0.0,
"Range/Max": 1.0,
"Range/Center": 0.0,
"Visuals/Num tick marks": 5,
"Visuals/Show text": true,
"Visuals/Orientation": "HORIZONTAL"
}
},
"9,8": {
"size": [
2,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///FMSInfo/FMSControlData",
"_title": "/FMSInfo/FMSControlData",
"_glyph": 148,
"_showGlyph": false
}
}
}
}
Expand Down Expand Up @@ -458,6 +418,35 @@
"_glyph": 148,
"_showGlyph": false
}
},
"42,2": {
"size": [
5,
1
],
"content": {
"_type": "Field",
"_source0": "network_table:///SmartDashboard/Field",
"_title": "Field",
"_glyph": 148,
"_showGlyph": false,
"Game/Game": "A2023_Charged_Up",
"Visuals/Robot Icon Size": 50.0,
"Visuals/Show Outside Circles": false
}
},
"34,2": {
"size": [
2,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///SmartDashboard/rightTrigger",
"_title": "rightTrigger",
"_glyph": 148,
"_showGlyph": false
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package frc.robot;

import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
Expand Down Expand Up @@ -51,6 +53,7 @@ public class RobotContainer {
new DecreaseMaxSpeedCommand(m_Tank);
private final FineDriveCommand m_FineDriveCommand = new FineDriveCommand(m_Tank);

private GenericEntry timeWidget = Shuffleboard.getTab("stuff").add("time", 0).withWidget("Match Time").getEntry();


/** The container for the robot. Contains subsystems, OI devices, and commands. */
Expand Down Expand Up @@ -220,5 +223,6 @@ public void initTest() {

public void robotPeriodic() {
Logger.updateEntries();
timeWidget.setDouble(DriverStation.getMatchTime());
}
}

0 comments on commit c27ba97

Please sign in to comment.