forked from N0BOY/FT8CN
-
Notifications
You must be signed in to change notification settings - Fork 1
Add FT8 DXpedition Hound mode (work a Fox) #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
78 changes: 78 additions & 0 deletions
78
ft8cn/app/src/main/kotlin/radio/ks3ckc/ft8us/ui/components/HoundSetupSheet.kt
This file contains hidden or 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,78 @@ | ||
| package radio.ks3ckc.ft8us.ui.components | ||
|
|
||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.material3.AlertDialog | ||
| import androidx.compose.material3.OutlinedTextField | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.material3.TextButton | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.runtime.setValue | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.text.input.KeyboardType | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.foundation.text.KeyboardOptions | ||
|
|
||
| /** | ||
| * Setup dialog for FT8 DXpedition "Hound" mode. The user tunes the rig to the | ||
| * Fox's published dial frequency (via the normal frequency picker), then enters | ||
| * the Fox's base callsign here and an initial call frequency in the 1000-4000 Hz | ||
| * Hound band. On Start, the app begins calling the Fox and auto-QSYs down when | ||
| * answered. | ||
| */ | ||
| @Composable | ||
| fun HoundSetupSheet( | ||
| visible: Boolean, | ||
| initialFoxCall: String, | ||
| onDismiss: () -> Unit, | ||
| onStart: (foxCall: String, callFreqHz: Float) -> Unit, | ||
| ) { | ||
| if (!visible) return | ||
|
|
||
| var foxCall by remember { mutableStateOf(initialFoxCall) } | ||
| var callFreq by remember { mutableStateOf("2500") } | ||
|
|
||
| AlertDialog( | ||
| onDismissRequest = onDismiss, | ||
| title = { Text("Work a DXpedition (Hound)") }, | ||
| text = { | ||
| Column { | ||
| Text( | ||
| "Tune the rig to the Fox's published dial frequency first. " + | ||
| "You call high (1000–4000 Hz); the app auto-QSYs you " + | ||
| "down to where the Fox answers and replies with your report.", | ||
| ) | ||
| Spacer(Modifier.height(12.dp)) | ||
| OutlinedTextField( | ||
| value = foxCall, | ||
| onValueChange = { foxCall = it.uppercase().trim() }, | ||
| label = { Text("Fox callsign") }, | ||
| singleLine = true, | ||
| ) | ||
| Spacer(Modifier.height(8.dp)) | ||
| OutlinedTextField( | ||
| value = callFreq, | ||
| onValueChange = { v -> callFreq = v.filter { it.isDigit() }.take(4) }, | ||
| label = { Text("Call frequency (Hz, 1000–4000)") }, | ||
| singleLine = true, | ||
| keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number), | ||
| ) | ||
| } | ||
| }, | ||
| confirmButton = { | ||
| TextButton( | ||
| onClick = { | ||
| val f = (callFreq.toFloatOrNull() ?: 2500f).coerceIn(1000f, 4000f) | ||
| if (foxCall.trim().length >= 3) onStart(foxCall.trim(), f) | ||
| }, | ||
| ) { Text("Start") } | ||
| }, | ||
| dismissButton = { | ||
| TextButton(onClick = onDismiss) { Text("Cancel") } | ||
| }, | ||
| ) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.