Notifications - Q-FRC/QDash GitHub Wiki

QFRCDashboard supports robot-side notifications via QFRCLib.

Notifications

Creating Notifications

Notifications can be created via the Notification object. The object contains several properties:

  • Title: What to display as the summary or title of the notification.
  • Description: The extended description of the notification.
  • Level: The urgency of the notification (info, warning, critical).
  • Display Time (ms): How long to display the notification for. (default 3000ms)
  • Width: The width of the notification on the dashboard. (default 350px)
  • Height: The height of the notification on the dashboard. (default -1px; set to -1 to fit to content)

In-Constructor

You can specify all your values directly in the constructor.

Notification notif = new Notification(
        ErrorLevel.Information,
        "Running Tests",
        "Running subsystem tests.",
        10000,
        500,
        400);

Set Methods

You can change your values on the fly.

Notification notif = new Notification();
notif.setTitle("Autonomous");
notif.setDescription("Running PABC12 Routine");
notif.setDisplayTimeMillis(15000);
notif.setLevel(ErrorLevel.Information);

Method Chaining (recommended)

You can use the .with<Value> methods to chain together value settings.

Notification notif = new Notification()
        .withTitle("Endgame!")
        .withDescription("30 seconds left!")
        .withDisplayMilliseconds(5000)
        .withLevel(ErrorLevel.Warning);

Sending Notifications

Send your notification at any time via QFRCLib.sendNotification:

QFRCLib.sendNotification(notif);

Interaction

You can close a notification at any time by clicking on it.

CloseNotifications

⚠️ **GitHub.com Fallback** ⚠️