kopia lustrzana https://github.com/bmo/py-wsjtx
note to self: don't refactor too late in evening w/o testing
rodzic
fe69d7e058
commit
5f53293f9c
|
@ -7,18 +7,19 @@ class QCOLOR:
|
|||
|
||||
def __init__(self, spec, alpha, red, green, blue):
|
||||
self.spec = spec
|
||||
self.red = alpha
|
||||
self.green = red
|
||||
self.blue = green
|
||||
self.alpha = blue
|
||||
self.red = red
|
||||
self.green = green
|
||||
self.blue = blue
|
||||
self.alpha = alpha
|
||||
|
||||
@classmethod
|
||||
def Black(cls):
|
||||
return QCOLOR(QCOLOR.SPEC_RGB, 255, 0, 0,0)
|
||||
return QCOLOR(QCOLOR.SPEC_RGB, 255, 0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def Red(cls):
|
||||
return QCOLOR(QCOLOR.SPEC_RGB, 255, 255, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def RGBA(cls, alpha, red, green, blue):
|
||||
return QCOLOR(QCOLOR.SPEC_RGB, alpha, red, green, blue)
|
||||
|
@ -27,4 +28,8 @@ class QCOLOR:
|
|||
def White(cls):
|
||||
return QCOLOR(QCOLOR.SPEC_RGB, 255,255,255,255)
|
||||
|
||||
@classmethod
|
||||
def Uncolor(cls):
|
||||
return QCOLOR(QCOLOR.SPEC_INVALID, 0,0,0,0)
|
||||
|
||||
|
||||
|
|
|
@ -36,11 +36,17 @@ while True:
|
|||
callsign = m.group(1)
|
||||
|
||||
color_pkt = pywsjtx.HighlightCallsignPacket.Builder(the_packet.wsjtx_id, callsign,
|
||||
pywsjtx.QCOLOR.RGBA(255,random.randint(0,255),random.randint(0,255),random.randint(0,255)),
|
||||
pywsjtx.QCOLOR.RGBA(255,random.randint(0,255),random.randint(0,255),random.randint(0,255)),
|
||||
|
||||
pywsjtx.QCOLOR.Red(),
|
||||
pywsjtx.QCOLOR.White(),
|
||||
True)
|
||||
|
||||
normal_pkt = pywsjtx.HighlightCallsignPacket.Builder(the_packet.wsjtx_id, callsign,
|
||||
pywsjtx.QCOLOR.Uncolor(),
|
||||
pywsjtx.QCOLOR.Uncolor(),
|
||||
True)
|
||||
s.send_packet(addr_port, color_pkt)
|
||||
print(pywsjtx.PacketUtil.hexdump(color_pkt))
|
||||
#print(pywsjtx.PacketUtil.hexdump(color_pkt))
|
||||
print(the_packet)
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue