-
Notifications
You must be signed in to change notification settings - Fork 1
DAL
The Data Abstraction Layer or "DAL" object loads in an stores all app data. The DAL is populated in init.js
after Config load. The constructor has just one parameter, the current event ID. This parameter is used to determine which event data to pull from localStorage.
Data read from localStorage is stored in one of 4 data structures.
- meta
- Descriptions of each item in
teams
- Descriptions of each item in
- teams
- meta
- TBA team data
- name
- city
- state_prov
- country
- TBA team data
- rank
- TBA team ranking data
- wins
- losses
- ties
- ranking_points
- ranking_score
- tie_breaker
- TBA team ranking data
- matches
- Summary TBA match data for team's matches
- key
- comp_level
- set_number
- match_number
- alliance
- Summary TBA match data for team's matches
- pictures
- Unused
- pit
- Team pit results
- results
- List of team match results including smart_stats
- stats
- mean, median, mode, min, max, low, high, total, std_dev computed for each stat across all match results
- meta
- matches
- TBA match data for all matches
- match_name
- short_match_name
- comp_level
- set_number
- match_number
- scheduled_time
- predicted_time
- started_time
- display_time
- red_alliance
- blue_alliance
- complete
- red_score
- blue_score
- score_str
- videos
- score_breakdown
- winner
- TBA match data for all matches
- picklists
- all picklists
Load in configuration metadata for a given scouting mode. Called by build_teams() for each mode.
- mode
- String mode type: pit/match.
Returns an array of team keys with several filters.
- include_stats
- Boolean representation of whether or not to include the stats section.
- include_pit
- Boolean representation of whether or not to include the pit section.
- include_ranking
- Boolean representation of whether or not to include the rank section.
- include_meta
- Boolean representation of whether or not to include the meta section.
- types
- Array of input types to filter keys by.
Return an array of all single team keys with placeholders.
Returns an array of result keys.
- cycle
- Either a boolean representation of whether or not to include cycle or a string representing which cycle to include.
- types
- Array of input types to filter by.
Finds all matches where the given teams are in the alliances.
- alliance_a
- A required array of team numbers in the same alliance.
- alliance_b
- An opional array of team numbers in the opposing alliance to a.
Returns all match results sorted by match then position.
Returns all match results name in key-team format sorted by match then position.
- teams
- List of team numbers to filter by.
- sort
- Boolean representing whether to sort.
Returns all scouted pits sorted by teams number.
- teams
- List of team numbers to filter by.
- sort
- Boolean representing whether to sort.
Returns a map of position keys to team numbers for a given match.
- match_key
- String match key for result.
Returns a map of position keys to position names.
Populates the data structures, primarily teams, from localStorage.
- debug
- Whether or not to print debug timing data when complete.
Populates the matches data structure from localStorage. Called by build_teams().
Computes and adds a given set of smart stats to a result.
- result
- Result to pull stats from and add stats to.
- stats
- Array of smart stat configurations to compute.
Builds an object with opponent and partner alliance team numbers.
- team_num
- String team number.
- match_id
- String match id.
Determines how many matches have been completely scouted.
Replaces opponentX and partnerX with the appropriate team number.
- text
- String to replace placeholders in.
- alliances
- Object with properties opponents and partners with lists of team numbers.
Determines how many qualification matches are at the event.
Determines the name for a given stat.
- id
- String key of stat.
- stat
- String stat name.
Builds and returns a string in the format "#rank (score, wins-losses-ties)" for a given team.
- team
- String team number.
Return boolean representing if a given team pit is scouted.
- team
- String team number for result.
Return boolean representing if a given match-team is scouted.
- match_id
- String match key for result.
- team
- String team number for result.
Fetch a given data point for a match.
- match_id
- String match key for result.
- id
- String key to pull.
Extract a single stat from the DAL.
- id
- String key of stat to pull.
- map
- Boolean representing whether to make the value more human readable.
Extract a single stat from the DAL.
- id
- String key of stat to pull.
- stat
- String stat name to specifically pull.
- map
- Boolean representing whether to make the value more human readable.
Extract a single stat from a set of global stats.
- global_stats
- Object of stats to pull stat from.
- id
- String key of stat to pull.
- stat
- String stat name to specifically pull.
- map
- Boolean representing whether to make the value more human readable.
Computes all stats for a given key and team.
- team
- String team number to compute stat for.
- id
- String team key to compute stat of.
Computes all stats across a given set of teams for a given set of keys.
- keys
- Array of keys to compute stats for.
- teams
- Array of team numbers to compute stats across.
- stat
- String stat name to use for a single team value.
Saves the current picklists back to localStorage.