Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ improve their pileup handling skills, and enhance their overall proficiency in C
- POTA Activator - exchange callsign and state in a POTA-style format.
- CW Ops Test (CWT) - exchange callsign, name and CW Ops number in the CWT QSO format.
- K1USN SST - exchange callsign, name, and state in the SST QSO format.
- Field Day - exchange callsign, class, and ARRL section in an ARRL Field Day format.

### How to "Cheat"

Expand Down
46 changes: 45 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@ <h3 class="mb-2 mb-sm-0 text-center text-sm-start me-sm-3">Mode</h3>
for="modePota"
>POTA Activator</label
>
<input
type="radio"
class="btn-check"
name="mode"
id="modeFieldDay"
value="fd"
autocomplete="off"
/>
<label
class="btn btn-outline-primary d-flex align-items-center justify-content-center"
for="modeFieldDay"
>Field Day</label
>

<input
type="radio"
Expand Down Expand Up @@ -266,7 +279,6 @@ <h5>Your Station Settings</h5>
/>
<div class="invalid-feedback"></div>
</div>

<div class="col-6 col-md-4 col-lg-2">
<label for="yourSpeed" class="form-label">Speed (WPM)</label>
<input
Expand Down Expand Up @@ -313,6 +325,38 @@ <h5>Your Station Settings</h5>
required
/>
</div>
<div class="col-6 col-md-4 col-lg-2">
<label for="yourSection" class="form-label">Section</label>
<input
type="text"
id="yourSection"
name="section"
class="form-control"
maxlength="3"
placeholder="(e.g., CA, TX, STX, LAX)"
autocomplete="off"
autocapitalize="characters"
spellcheck="false"
autocorrect="off"
/>
<div class="invalid-feedback"></div>
</div>
<div class="col-6 col-md-4 col-lg-2">
<label for="yourClass" class="form-label">Class (FD)</label>
<input
type="text"
id="yourClass"
name="klass"
class="form-control"
maxlength="4"
placeholder="(e.g., 3A, 2B, 1BB)"
autocomplete="off"
autocapitalize="characters"
spellcheck="false"
autocorrect="off"
/>
<div class="invalid-feedback"></div>
</div>
</div>
</div>
</div>
Expand Down
24 changes: 23 additions & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ document.addEventListener('DOMContentLoaded', () => {
yourCallsign: 'yourCallsign',
yourName: 'yourName',
yourState: 'yourState', // Added yourState
yourSection: 'yourSection',
yourClass: 'yourClass',
yourSpeed: 'yourSpeed',
yourSidetone: 'yourSidetone',
yourVolume: 'yourVolume',
Expand All @@ -218,6 +220,9 @@ document.addEventListener('DOMContentLoaded', () => {
localStorage.getItem(keys.yourCallsign) || yourCallsign.value;
yourName.value = localStorage.getItem(keys.yourName) || yourName.value;
yourState.value = localStorage.getItem(keys.yourState) || yourState.value; // Load yourState
yourSection.value =
localStorage.getItem(keys.yourSection) || yourSection.value;
yourClass.value = localStorage.getItem(keys.yourClass) || yourClass.value;
yourSpeed.value = localStorage.getItem(keys.yourSpeed) || yourSpeed.value;
yourSidetone.value =
localStorage.getItem(keys.yourSidetone) || yourSidetone.value;
Expand All @@ -234,6 +239,12 @@ document.addEventListener('DOMContentLoaded', () => {
// Save yourState
localStorage.setItem(keys.yourState, yourState.value);
});
yourSection.addEventListener('input', () => {
localStorage.setItem(keys.yourSection, yourSection.value);
});
yourClass.addEventListener('input', () => {
localStorage.setItem(keys.yourClass, yourClass.value);
});
yourSpeed.addEventListener('input', () => {
localStorage.setItem(keys.yourSpeed, yourSpeed.value);
});
Expand Down Expand Up @@ -293,6 +304,17 @@ function getModeConfig() {
return modeLogicConfig[currentMode];
}

/**
* Retrieves the current mode
*
* Returns the string value of the current mode
*
* @returns {string} currnet mode.
*/
export function getCurrentMode() {
return currentMode;
}

/**
* Updates the UI to reflect the current mode's configuration.
*
Expand Down Expand Up @@ -912,7 +934,7 @@ function nextSingleStation(responseStartTime) {
const responseField = document.getElementById('responseField');
const cqButton = document.getElementById('cqButton');

let callingStation = getCallingStation();
let callingStation = getCallingStation(currentMode);
printStation(callingStation);
currentStation = callingStation;
currentStationAttempts = 0;
Expand Down
18 changes: 18 additions & 0 deletions src/js/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ function getDOMInputs() {
.toUpperCase(),
yourName: document.getElementById('yourName').value.trim(),
yourState: document.getElementById('yourState').value.trim().toUpperCase(), // Convert to uppercase for consistency
yourSection: document
.getElementById('yourSection')
.value.trim()
.toUpperCase(),
yourClass: document.getElementById('yourClass').value.trim().toUpperCase(),
yourSpeed: parseInt(document.getElementById('yourSpeed').value, 10),
yourSidetone: parseInt(document.getElementById('yourSidetone').value, 10),
// convert volume to a float between 0 and 1
Expand Down Expand Up @@ -115,6 +120,19 @@ function validateInputs(inputs) {
openAccordionSection('collapseYourStationSettings');
isValid = false;
}
if (!inputs.yourSection && inputs.mode === 'fd') {
markFieldInvalid(
'yourSection',
'Your section is required for Field Day mode.'
);
openAccordionSection('collapseYourStationSettings');
isValid = false;
}
if (!inputs.yourClass && inputs.mode === 'fd') {
markFieldInvalid('yourClass', 'Your class is required for Field Day mode.');
openAccordionSection('collapseYourStationSettings');
isValid = false;
}
if (!inputs.yourName && inputs.mode === 'cwt') {
markFieldInvalid('yourName', 'Your name is required for CWT mode.');
openAccordionSection('collapseYourStationSettings');
Expand Down
26 changes: 26 additions & 0 deletions src/js/modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ export const modeUIConfig = {
extraColumnHeader: 'State',
resultsHeader: 'POTA Mode Results',
},
fd: {
showTuButton: true,
showInfoField: true,
infoFieldPlaceholder: 'Class',
showInfoField2: true,
infoField2Placeholder: 'Section',
tableExtraColumn: true,
extraColumnHeader: 'Exchange',
},
sst: {
showTuButton: true,
showInfoField: true,
Expand Down Expand Up @@ -98,6 +107,23 @@ export const modeLogicConfig = {
extraInfoFieldKey: 'state',
extraInfoFieldKey2: null,
},
fd: {
cqMessage: (yourStation, theirStation, arbitrary) =>
`CQ FD ${yourStation.callsign}`,
yourExchange: (yourStation, theirStation, arbitrary) =>
`${yourStation.klass} ${yourStation.section}`,
theirExchange: (yourStation, theirStation, arbitrary) =>
`${theirStation.acknowledgement}${theirStation.klass} ${theirStation.section}${theirStation.thanks}`,
yourSignoff: (yourStation, theirStation, arbitrary) =>
`TU ${yourStation.callsign}`,
theirSignoff: null,
requiresInfoField: true,
requiresInfoField2: true,
showTuStep: true,
modeName: 'Field Day',
extraInfoFieldKey: 'klass',
extraInfoFieldKey2: 'section',
},
contest: {
cqMessage: (yourStation, theirStation, arbitrary) =>
`CQ TEST DE ${yourStation.callsign}`,
Expand Down
Loading