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):
|
def __init__(self, spec, alpha, red, green, blue):
|
||||||
self.spec = spec
|
self.spec = spec
|
||||||
self.red = alpha
|
self.red = red
|
||||||
self.green = red
|
self.green = green
|
||||||
self.blue = green
|
self.blue = blue
|
||||||
self.alpha = blue
|
self.alpha = alpha
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def Black(cls):
|
def Black(cls):
|
||||||
return QCOLOR(QCOLOR.SPEC_RGB, 255, 0, 0,0)
|
return QCOLOR(QCOLOR.SPEC_RGB, 255, 0, 0, 0)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def Red(cls):
|
def Red(cls):
|
||||||
return QCOLOR(QCOLOR.SPEC_RGB, 255, 255, 0, 0)
|
return QCOLOR(QCOLOR.SPEC_RGB, 255, 255, 0, 0)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def RGBA(cls, alpha, red, green, blue):
|
def RGBA(cls, alpha, red, green, blue):
|
||||||
return QCOLOR(QCOLOR.SPEC_RGB, alpha, red, green, blue)
|
return QCOLOR(QCOLOR.SPEC_RGB, alpha, red, green, blue)
|
||||||
|
@ -27,4 +28,8 @@ class QCOLOR:
|
||||||
def White(cls):
|
def White(cls):
|
||||||
return QCOLOR(QCOLOR.SPEC_RGB, 255,255,255,255)
|
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)
|
callsign = m.group(1)
|
||||||
|
|
||||||
color_pkt = pywsjtx.HighlightCallsignPacket.Builder(the_packet.wsjtx_id, callsign,
|
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)
|
True)
|
||||||
s.send_packet(addr_port, color_pkt)
|
s.send_packet(addr_port, color_pkt)
|
||||||
print(pywsjtx.PacketUtil.hexdump(color_pkt))
|
#print(pywsjtx.PacketUtil.hexdump(color_pkt))
|
||||||
print(the_packet)
|
print(the_packet)
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue