projecthorus / horus-gui

Project Horus Telemetry Decoder
GNU General Public License v3.0
33 stars 8 forks source link

Add some features of Horus GUI for Win #26

Closed 9A4AM closed 1 year ago

9A4AM commented 1 year ago

Hi, I wish to add some features in source and final release Horus GUI for Win. 1.) Add log file (missed in Win version)! --- It is very usual for analyse flight (OK, we have log on Habhub, but we sometime testing flight without notice flight!) Solution: In gui.py -----> Add this part of code: with open("log.txt", 'a') as f: print(_decoded['ukhas_str'], file=f)

in section:

Handle binary packets

        try:
            _decoded = decode_packet(frame.data)
            _decoded['snr'] = _snr
            _decoded['baud_rate'] = _baud_rate
            if _modulation_detail:
                _decoded['modulation_detail'] = _modulation_detail
            if _radio_dial:
                _decoded['f_centre'] = _radio_dial

            widgets["latestRawSentenceData"].setText(f"{_packet} ({_snr:.1f} dB SNR)")
            widgets["latestDecodedSentenceData"].setText(_decoded['ukhas_str'])
            habitat_uploader.add(_decoded['ukhas_str']+'\n')
            # Upload the string to Sondehub Amateur
            sondehub_uploader.add(_decoded)
            # Save to local LOG (log.txt inside app folder) - 9A4AM
            with open("log.txt", 'a') as f:
             print(_decoded['ukhas_str'], file=f)
        except Exception as e:
            if "CRC Failure" in str(e) and widgets["inhibitCRCSelector"].isChecked():
                pass

This is add:

Save to local LOG (log.txt inside app folder) - 9A4AM

            with open("log.txt", 'a') as f:
             print(_decoded['ukhas_str'], file=f)

2.) Add upload station info --- This function is very usual when we send payload and we expected receive station in direction on the flight (many peaple have receivers start, but if receiver not uplaoad data, not upload position and st-by status for receive - like a Beacon on APRS).

Solution: In gui.py -----> **In declare***

Timer for auto upload position - 9A4AM

import threading

*and in section **** def handle_log_update(log_update): global widgets

widgets["console"].appendPlainText(log_update)
# Make sure the scroll bar is right at the bottom.
_sb = widgets["console"].verticalScrollBar()
_sb.setValue(_sb.maximum())

Auto UPDATE position - every day 4 times - 9A4AM

def Update_location(): timer = threading.Timer(21600.0, Update_location) # called every xx minute timer.daemon = True timer.name = "timer_deamon" timer.start() habitat_position_reupload()

Update_location()


Thanks in advance and best regards!

73 de 9A4AM, Mario from Croatia!!

darksidelemm commented 1 year ago

I will not be supporting UKHAS string generation for Horus binary packets any longer, as Habitat is being retired shortly, and the replacement Sondehub-Amateur does not support them, instead taking JSON-formatted packets. I would be happy to save out a log file of some sort, however I'm not sure where this will end up with the way the executable runs.

As for regular station position uploads, this should already be happening every 6 hours for both Habitat and Sondehub-amateur

darksidelemm commented 1 year ago

So since v0.3.10 we've had log output support, so I'll close this issue.