Skip to content

Infinite Recharge: Improve error checking between Color Wheel and Power Cell Tracker on match creation #2

@TheAnnalyst

Description

@TheAnnalyst

Currently, it's possible to construct an InfiniteRechargeMatch that you cannot then load from the SQL backend.

const frc = require('frc-scouting');
const backend = new frc.SQLBackend(new frc.InfiniteRecharge.InfiniteRechargeSQL(':memory:'));

const cells = new frc.InfiniteRecharge.PowerCellTracker({
    LOW: {auto: 0, teleop: 0},
    INNER: {auto: 0, teleop: 0},
    OUTER: {auto: 0, teleop: 0},
}, true);
const wheel = new frc.InfiniteRecharge.ColorWheel('SPECIFIC_COLOR');
const match = new frc.InfiniteRecharge.InfiniteRechargeMatch(1, 'test', 1, 'RED', {powerCells: cells, colorWheel: wheel}); 

backend.saveMatch(match);
backend.getMatchByNumber(1); // throws an error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions