Skip to content

Instantly share code, notes, and snippets.

@anthonydiiorio
Last active July 1, 2019 18:41
Show Gist options
  • Save anthonydiiorio/bb70f685a049c6b390bc725fe99c2f58 to your computer and use it in GitHub Desktop.
Save anthonydiiorio/bb70f685a049c6b390bc725fe99c2f58 to your computer and use it in GitHub Desktop.
AutoHotKey script to quickly set up Log4OM for satellites
#IfWinActive ahk_exe LogOMUI.exe
!1:: ; Alt + 1 AO-91
setSat("AO-91|AMSAT-OSCAR-91","UV","FM",145960,435250)
return
#IfWinActive ahk_exe LogOMUI.exe
!2:: ; Alt + 2 AO-92
setSat("AO-92|AMSAT-OSCAR-92","UV","FM",145880,435350)
return
#IfWinActive ahk_exe LogOMUI.exe
!3:: ; Alt + 3 AO-85
setSat("AO-85|AMSAT-OSCAR-85","UV","FM",145980,435170)
return
#IfWinActive ahk_exe LogOMUI.exe
!4:: ; Alt + 4 SO-50
setSat("SO-50|Saudi-OSCAR 50","VU","FM",436795,145850)
return
#IfWinActive ahk_exe LogOMUI.exe
!5:: ; Alt + 5 Diwata-2 PO-101
setSat("PO-101|Diwata-2","UV","FM",145900,437500)
return
#IfWinActive ahk_exe LogOMUI.exe
!0:: ; Clear Sat Mode
WinGetClass, class
LogID := SubStr(class, 31, 7)
Send {F6}
sleep, 300
ControlGet, SatField, Enabled ,, Edit2, A
if (SatField = 1){ ; Uncheck if checked
Control, Check ,, WindowsForms10.BUTTON.app.0.%LogID%_r6_ad114, A ; Enable Sat Mode
}
ControlSetText, WindowsForms10.EDIT.app.0.%LogID%_r6_ad114,, A ; Clear RX Frequency
ControlSetText, WindowsForms10.EDIT.app.0.%LogID%_r6_ad113,, A ; Clear RX Hz
ControlSend, WindowsForms10.EDIT.app.0.%LogID%_r6_ad114,0, A ; Set RX Frequency
ControlSend, WindowsForms10.EDIT.app.0.%LogID%_r6_ad113,000, A ; Set RX Hz
Send {F1}
sleep, 300
ControlSetText, WindowsForms10.EDIT.app.0.%LogID%_r6_ad18,, A ; Clear TX Frequency
ControlSetText, WindowsForms10.EDIT.app.0.%LogID%_r6_ad17,, A ; Clear TX Hz
ControlSend, WindowsForms10.EDIT.app.0.%LogID%_r6_ad17,000, A ; Set TX Hz
return
setSat(sat, satmode, txmode, rx, tx){
if (satmode = "UV" ){
satmode := "auu"
}
else if (satmode = "VU"){
satmode := "av"
}
if (txmode = "FM"){
txmode := "aff"
}
else if (txmode = "SSB"){
txmode := "as"
}
WinGetClass, class
LogID := SubStr(class, 31, 7)
Send {F6}
sleep, 300
ControlGet, SatField, Enabled ,, Edit2, A
if (SatField = 0){ ; Check if unchecked
Control, Check ,, WindowsForms10.BUTTON.app.0.%LogID%_r6_ad114, A ; Enable Sat Mode
}
ControlSetText, Edit2, %sat%, A ; Set Satellite Name
ControlSetText, WindowsForms10.EDIT.app.0.%LogID%_r6_ad114,, A ; Clear RX Frequency
ControlSetText, WindowsForms10.EDIT.app.0.%LogID%_r6_ad113,, A ; Clear RX Hz
ControlSend, WindowsForms10.EDIT.app.0.%LogID%_r6_ad114,%rx%, A ; Set RX Frequency
ControlSend, WindowsForms10.EDIT.app.0.%LogID%_r6_ad113,000, A ; Set RX Hz
ControlSend, WindowsForms10.COMBOBOX.app.0.%LogID%_r6_ad18,%satmode%, A ; Set Mode UV/VU
Send {F1}
sleep, 300
ControlSend,WindowsForms10.COMBOBOX.app.0.%LogID%_r6_ad15,%txmode%, A ; Set TX Mode
ControlSetText, WindowsForms10.EDIT.app.0.%LogID%_r6_ad18,, A ; Clear TX Frequency
ControlSetText, WindowsForms10.EDIT.app.0.%LogID%_r6_ad17,, A ; Clear TX Hz
ControlSend, WindowsForms10.EDIT.app.0.%LogID%_r6_ad18,%tx%, A ; Set TX Frequency
ControlSend, WindowsForms10.EDIT.app.0.%LogID%_r6_ad17,000, A ; Set TX Hz
Send {Escape}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment