Skip to content

Commit

Permalink
Fix the layout and updating code
Browse files Browse the repository at this point in the history
Fix the layout and updating code so that things are better behaved.
  • Loading branch information
mcdermj committed Jan 26, 2020
1 parent 9b26821 commit ced1aa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions ssdrframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def foff(self) -> str:
def foff(self, offset: int) -> None:
offset /= 1 << 6
self.text_freqoff.SetLabelText("{:.1f}".format(offset))
# self.text_freqoff.InvalidateBestSize()
self.text_freqoff.InvalidateBestSize()

@property
def snr(self) -> str:
Expand All @@ -175,7 +175,7 @@ def snr(self) -> str:
def snr(self, snr: float) -> None:
snr /= 1 << 6
self.text_snr.SetLabel('{:.2f}'.format(snr))
# self.text_snr.InvalidateBestSize()
self.text_snr.InvalidateBestSize()
self.gauge_snr.SetValue(snr)

@property
Expand All @@ -194,7 +194,7 @@ def ber(self) -> str:
def ber(self, ber: int) -> None:
ber /= 1 << 6
self.text_ber.SetLabel('{:.2f}'.format(ber))
# self.text_ber.InvalidateBestSize()
self.text_ber.InvalidateBestSize()

@property
def clock_offset(self) -> str:
Expand All @@ -204,7 +204,7 @@ def clock_offset(self) -> str:
def clock_offset(self, offset: int) -> None:
offset /= 1 << 6
self.text_clkoff.SetLabel('{:.2f}'.format(offset))
# self.text_clkoff.InvalidateBestSize()
self.text_clkoff.InvalidateBestSize()

@property
def sync_quality(self) -> str:
Expand All @@ -214,7 +214,7 @@ def sync_quality(self) -> str:
def sync_quality(self, quality: int) -> None:
quality /= 1 << 6
self.text_sync_metric.SetLabel('{:.2f}'.format(quality))
# self.text_sync_metric.InvalidateBestSize()
self.text_sync_metric.InvalidateBestSize()

@property
def total_bits_msb(self) -> int:
Expand All @@ -224,7 +224,7 @@ def total_bits_msb(self) -> int:
def total_bits_msb(self, bits: int) -> None:
self.total_bits = (self.total_bits & 0x0000ffff) + ((bits & 0xffff) << 16)
self.text_bits.SetLabel('{}'.format(self.total_bits))
# self.text_bits.InvalidateBestSize()
self.text_bits.InvalidateBestSize()

@property
def total_bits_lsb(self) -> int:
Expand All @@ -244,7 +244,7 @@ def error_bits(self) -> str:
def error_bits(self, bits: int) -> None:
bits &= 0xffff
self.text_errors.SetLabel('{}'.format(bits))
# self.text_errors.InvalidateBestSize()
self.text_errors.InvalidateBestSize()

def set_mode_handler(self, handler: Callable):
self.Bind(wx.EVT_CHOICE, handler, self.mode_selector)
1 change: 0 additions & 1 deletion vitaprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def received_meters(self, meter_data):
self.api.frame.Freeze()
for (meter_id, meter_value) in meter_data.items():
self.api.update_meter(meter_id, meter_value)
# self.api.frame.Layout()
self.api.frame.stats_sizer.Layout()
self.api.frame.Thaw()

Expand Down

0 comments on commit ced1aa0

Please sign in to comment.