Amateurfunk: Motorola GP3xx – Auto-Import von QRGs mit Ablage

Hi zusammen,

ich wollte neulich ein Motorola GP680 (geflasht zu GP380) mit einer neuen Konfiguration betanken. Ziel war es für mich, die üblichen Relais-QRGs ohne viel Aufwand in das Gerät zu importieren.
Hierzu habe ich im Netz keine Import-Skripte gefunden, also habe ich fix selber ein AutoIT Skript dafür gebaut.

Das Skript geht durch eine Text-Datei und importiert die dort angegebenen Frequenzen mit dem entsprechenden Offset. Nun hieß es nur noch: Skript starten und Kaffee trinken ;-)

#include <TrayConstants.au3>
#include <GUIConstants.au3>
#include <string.au3>
#include <GUIListView.au3>
TraySetState($TRAY_ICONSTATE_SHOW)

$hGUI = "Programmiersoftware CPS für Motorola"
$hTitle = "CPS Import Script"
$sleep_low = 700
$sleep_high = 1400
$filename = "qrg.txt"

$file = FileOpen($filename, 0)
If $file = -1 Then
   MsgBox(0, "error", "File doesn't exist or can't be read")
   Exit
EndIf

TrayTip($hTitle, "Please enter Channel dialog! Waiting 10 Seconds...", 10)
Sleep(10000)

FileSetPos($file, 0, 0)
While 1
   Local $line = FileReadLine($file)
   If @error = -1 Then ExitLoop
   ControlClick($hGUI, "", "[CLASSNN:ToolbarWindow321]", "left", 1, 212, 13)
   SleepMe()
   $rx = $line
   $tx = $line - 7.6

   TrayTip($hTitle, "Adding: RX ["&$rx&"], TX ["&$tx&"]", 3)

   ; Reiter: 1, Kanal
   ; TX -> Edit1
   ; RX -> Edit2
   ; Leistung -> ComboBox4
   SleepMe()
   ControlClick($hGUI, "", "[CLASSNN:SysTabControl321]", "left", 1, 55, 13)
   ControlFocus($hGUI, "", "[CLASSNN:Edit1]")
   SleepMe(True)
   Send("{BACKSPACE 10}{DEL 10}")
   Send($tx)
   SleepMe(True)
   ControlFocus($hGUI, "", "[CLASSNN:Edit2]")
   SleepMe(True)
   Send("{BACKSPACE 10}{DEL 10}")
   Send($rx)
   SleepMe(True)
   ControlClick($hGUI, "", "[CLASSNN:ComboBox4]")
   Send("h")
   ControlClick($hGUI, "", "[CLASSNN:ComboBox4]")
   SleepMe(True)

   ; Reiter: 2, Display
   ; AlphaNum -> Button1
   ; Name -> Edit1
   SleepMe(True)
   ControlClick($hGUI, "", "[CLASSNN:SysTabControl321]", "left", 1, 121, 13)
   ControlClick($hGUI, "", "[CLASSNN:Button1]")
   SleepMe(True)
   ControlFocus($hGUI, "", "[CLASSNN:Edit1]")
   SleepMe(True)
   Send($rx & " MHz")
   SleepMe(True)

   SleepMe()
WEnd


Func SleepMe($islow = True, $message = "")
   If(Not WinActive($hGUI)) Then
   TrayTip($hTitle, "Please select window " & $hGUI & " for further processing.", 3)
   WinWaitActive($hGUI)
   EndIf
   If(Not $message == "") Then
   TrayTip($hTitle, $message, 3)
   EndIf
   If($islow) Then
   Sleep($sleep_low)
   Else
   Sleep($sleep_high)
   EndIf
EndFunc

Und dazugehörig die Frequenzen:

438.550
438.5625
438.575
438.5875
438.600
438.612
438.6125
438.625
438.650
438.675
438.6875
438.700
438.7125
438.725
438.7375
438.750
438.7625
438.7875
438.800
438.825
438.8875
438.900
438.9125
438.925
438.9375
438.975
438.9875
439.000
439.025
439.050
439.0625
439.075
439.100
439.125
439.150
439.175
439.200
439.2125
439.225
439.2375
439.250
439.2625
439.300
439.3125
439.325
439.3375
439.350
439.375
439.3875
439.400
439.425

Empfohlene Beiträge

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Schaltfläche "Zurück zum Anfang"