-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,7 @@ function servoSpeedConverter (scoresheet: ServoIntermediateScoresheet<import('./ | |
|
||
const models: Model[] = [ | ||
{ | ||
rulesId: ['[email protected]', '[email protected]', '[email protected]', '[email protected]', 'svgf-rh@2020', '[email protected]', 'svgf-vh@2023', 'ijru.speed.2020'], | ||
rulesId: ['[email protected]', '[email protected]', '[email protected]', 'ijru.speed@4.0.0', 'svgf-rh@2020', '[email protected]', 'svgf-vh@2023', 'ijru.speed.2020'], | ||
judgeType: 'S', | ||
name: 'Speed', | ||
component: defineAsyncComponent(async () => await import('./views/scoring/[email protected]/Speed.vue')), | ||
|
@@ -109,7 +109,7 @@ const models: Model[] = [ | |
} | ||
}, | ||
{ | ||
rulesId: ['[email protected]', '[email protected]', '[email protected]', '[email protected]', 'svgf-rh@2020', '[email protected]', 'ijru.speed.2020'], | ||
rulesId: ['[email protected]', '[email protected]', '[email protected]', 'ijru.speed@4.0.0', 'svgf-rh@2020', '[email protected]', 'ijru.speed.2020'], | ||
judgeType: 'Shj', | ||
name: 'Speed Head Judge', | ||
component: defineAsyncComponent(async () => await import('./views/scoring/[email protected]/Speed.vue')), | ||
|
@@ -199,6 +199,24 @@ const models: Model[] = [ | |
} | ||
} | ||
}, | ||
// { | ||
// rulesId: ['[email protected]'], | ||
// judgeType: 'Dt', | ||
// name: 'Turner Difficulty (Double Dutch)', | ||
// component: defineAsyncComponent(async () => await import('./views/scoring/[email protected]/DDTurnerDifficulty.vue')) | ||
// }, | ||
// { | ||
// rulesId: ['[email protected]'], | ||
// judgeType: 'Dj', | ||
// name: 'Jumper Difficulty (Double Dutch)', | ||
// component: defineAsyncComponent(async () => await import('./views/scoring/[email protected]/DDJumperDifficulty.vue')) | ||
// }, | ||
{ | ||
rulesId: ['[email protected]', '[email protected]'], | ||
judgeType: ['Dp', 'Dm', 'Dr', 'Da', 'Db'], | ||
name: 'Difficulty (Single Rope and Wheel)', | ||
component: defineAsyncComponent(async () => await import('./views/scoring/[email protected]/SRWHDifficulty.vue')) | ||
}, | ||
|
||
{ | ||
rulesId: ['[email protected]', '[email protected]'], | ||
|
@@ -377,7 +395,7 @@ const models: Model[] = [ | |
} | ||
}, | ||
{ | ||
rulesId: ['[email protected]'], | ||
rulesId: ['ijru[email protected]', '[email protected]', 'ijru.freestyle.wh@4.0.0'], | ||
judgeType: 'P', | ||
name: 'Presentation', | ||
component: defineAsyncComponent(async () => await import('./views/scoring/[email protected]/Presentation.vue')), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<template> | ||
<main class="grid grid-cols-3 grid-rows-score"> | ||
<score-button | ||
color="orange" | ||
label="Rep. Skill" | ||
:value="tally('rep')" | ||
:disabled="!!scoresheet?.completedAt" | ||
single-row | ||
@click="addMark({ schema: 'rep' })" | ||
/> | ||
<score-button | ||
color="none" | ||
label="Score" | ||
:value="result" | ||
single-row | ||
/> | ||
<score-button | ||
color="orange" | ||
label="Rep. Skill" | ||
:value="tally('rep')" | ||
:disabled="!!scoresheet?.completedAt" | ||
single-row | ||
@click="addMark({ schema: 'rep' })" | ||
/> | ||
|
||
<score-button | ||
v-for="[schema, level] in levels" | ||
:key="schema" | ||
:color="level < 7 ? 'green' : 'indigo'" | ||
:label="`Level ${level}`" | ||
:value="tally(schema)" | ||
:disabled="!!scoresheet?.completedAt" | ||
@click="addMark({ schema })" | ||
/> | ||
</main> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed } from 'vue' | ||
import ScoreButton from '../../../components/ScoreButton.vue' | ||
import { useScoresheet } from '../../../hooks/scoresheet' | ||
import type { Model } from '../../../models' | ||
import type { PropType } from 'vue' | ||
export type Schema = `diffL${'0.5' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}` | 'rep' | ||
defineProps({ | ||
model: { | ||
type: Object as PropType<Model>, | ||
required: true | ||
} | ||
}) | ||
const { addMark, tally, scoresheet } = useScoresheet<Schema>() | ||
function L (level: number): number { | ||
if (level === 0) return 0 | ||
return Math.round(Math.pow(1.5, level) * 10) / 100 | ||
} | ||
const levels = computed((): Array<[Schema, number]> => [ | ||
['diffL1', 1], | ||
['diffL0.5', 0.5], | ||
['diffL4', 4], | ||
['diffL2', 2], | ||
['diffL7', 7], | ||
['diffL5', 5], | ||
['diffL3', 3], | ||
['diffL8', 8], | ||
['diffL6', 6] | ||
]) | ||
const result = computed(() => { | ||
let res = 0 | ||
for (const [schema, level] of levels.value) { | ||
res += L(level) * tally(schema) | ||
} | ||
return res | ||
}) | ||
</script> |