Skip to content

Commit

Permalink
Merge pull request #98 from neilenns/neilenns/issue97
Browse files Browse the repository at this point in the history
Only allow setting the show last received callsign checkbox when RX is enabled
  • Loading branch information
neilenns authored Jul 17, 2024
2 parents 525bc78 + f7fdf97 commit 2777b3e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug property inspectors",
"request": "launch",
"type": "msedge",
"url": "http://localhost:23654",
"webRoot": "${workspaceFolder}"
},
{
"name": "Debug plugin",
"type": "node",
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ station status action like this:
| Listening | The image to display when the station is active. Optional, defaults to green. |
| Active comms | The image to display when a transmission is actively taking place. Optional, defaults to orange. |

## Configuring a TrackAudio status action

The TrackAudio status action shows the status of the connection between StreamDeck and TrackAudio. Simply
add the action to your profile and, optionally, configure an image for the disconnected and connected states.

## Configuring a hotline action

The hotline action provides a quick way to toggle between two stations for voice transmissions. Start by adding
Expand All @@ -58,3 +53,8 @@ your primary station in TrackAudio with XCA enabled and the hotline station in T
| Hotline active | The image to display when transmitting on the hotline frequency. Optional, defaults to orange. |
| Both active | The image to display when both the primary and hotline and frequencies are the active frequency. This should never happen, as it means your voice transmissions will get sent to both frequencies. Optional, defaults to red. |
| Neither active | The iamge to display when neither the primary nor the hotline frequencies have TX enabled. Optional, defaults to black. |

## Configuring a TrackAudio status action

The TrackAudio status action shows the status of the connection between StreamDeck and TrackAudio. Simply
add the action to your profile and, optionally, configure an image for the disconnected and connected states.
10 changes: 10 additions & 0 deletions com.neil-enns.trackaudio.sdPlugin/pi/stationStatus.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,15 @@
accept="image/png, image/jpeg, image/svg+xml"
></sdpi-file>
</sdpi-item>

<script type="text/javascript">
document
.querySelector('[setting="listenTo"]')
.addEventListener("valuechange", function (ev) {
document.querySelector(
'[setting="showLastReceivedCallsign"]'
).disabled = ev.target.value !== "rx";
});
</script>
</body>
</html>
Binary file modified docs/images/station-status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions src/controllers/stationStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,15 @@ export class StationStatusController implements Controller {

/**
* Shows the title on the action. Appends the last received callsign to
* the base title if it exists and showLastReceivedCallsign is enabled in settings.
* the base title if it exists, showLastReceivedCallsign is enabled in settings,
* and the action is listening to RX.
*/
public showTitle() {
if (this.lastReceivedCallsign && this.showLastReceivedCallsign) {
if (
this.lastReceivedCallsign &&
this.showLastReceivedCallsign &&
this.listenTo === "rx"
) {
this.action
.setTitle(`${this.title}\n\n${this.lastReceivedCallsign}`)
.catch((error: unknown) => {
Expand Down

0 comments on commit 2777b3e

Please sign in to comment.