Skip to content

Added encoding to morse - #61

Draft
EA5JQP wants to merge 6 commits into
kamilsss655:mainfrom
EA5JQP:feature/text_to_morse
Draft

Added encoding to morse#61
EA5JQP wants to merge 6 commits into
kamilsss655:mainfrom
EA5JQP:feature/text_to_morse

Conversation

@EA5JQP

@EA5JQP EA5JQP commented Jul 22, 2024

Copy link
Copy Markdown
Contributor

Instead of typing morse code directly, a translation is used to make it easier to send a message.

Comment thread main/Kconfig.projbuild Outdated
help
Beacon repeat delay in seconds

config MORSE_CODE_BEACON_TEXT

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good! I'd welcome this feature as it has been on my TODO list.

One suggestion though is to have the text to morse code conversion done on the backend (C code) instead of frontend. This way you can remove:

config MORSE_CODE_BEACON_TEXT

and only keep:

    config BEACON_TEXT

the C code should convert stored text, when needed to dots and dashes.

Front-end part could then remain unchanged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for the suggestion! I will do as you say.

@EA5JQP

EA5JQP commented Jul 25, 2024

Copy link
Copy Markdown
Contributor Author

Hello,

I got the morse enconding done on the backend so MORSE_CODE_BEACON_TEXT could be removed but I left the morse encoding in the frontend. It is possible to remove it entirely but I would like to show the user the morse string being transmitted.

Please let me know if you have any suggestion on the code. I made use of chatGPT since I am not really confortable on C.

@kamilsss655 kamilsss655 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments :)

Comment thread frontend/src/views/Beacon.vue Outdated
v-model="settingsStore['beacon.morse_code.text']"
label="Morse code"
disable
v-if="beaconMode != BeaconMode.OFF && beaconMode != BeaconMode.WAV"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use:

beaconMode == BeaconMode.MORSE_CODE

Comment thread frontend/src/stores/settings.ts Outdated
"beacon.text": "-..--.",
"beacon.text": "Default text",
"beacon.delay_seconds": 12,
"beacon.morse_code.text": "-.. . ..-. .- ..- .-.. - / - . -..- -",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beacon.morse_code.text should not be in the store as we need to have single source of truth. Instead in the Vue component you can use watch and calculate the morse code value dynamically based on the value of beacon.text.

Comment thread frontend/src/views/Beacon.vue Outdated
}


/*() => [settingsStore["beacon.morse_code.text"], settingsStore["beacon.text"]],

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove commented code?

Comment thread main/app/beacon.c Outdated
TRANSMIT_AfskParam_t afsk_param = {
.input = gSettings.beacon.text,
.len = strlen(gSettings.beacon.text),
.input = gSettings.beacon.morse_code.text,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong, these are afsk params

Comment thread main/app/morse.c
@@ -0,0 +1,67 @@
#include "morse.h"

// Morse code representation for each letter, digit, space, and punctuation

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will take a look later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants