gui.calibration.entry — Allows the entry of temperature measurements

This module contains the TemperatureEntryHandler class, which manages a number of widgets that allow the user to enter temperature measurements when they are requested during the calibration procedure.

These widgets are

  • a gtk.HBox (box) that contains the gtk.Entry used to enter temperature measurements, a label that indicates that the measurement is in °C, and optionally a label that identifies the entry; and
  • a gtk.Button (button) that can be pressed to finalize the temperature input.

Since the ideal positioning of these widgets greatly depends on the context in which they are used, the TemperatureEntryHandler does not provide a container that contains both widgets. Instead, the client needs to add them separately to the GUI.

Clients also need to keep a reference to the handler itself to prevent it from being reclaimed as garbage.

The handler listens to TemperatureRequested and TemperatureRequestOver events to ensure that the widgets in the box are only sensitive while there is an unanswered temperature request, and that the button is only sensitive while there is an unanswered temperature request and the entered temperature measurement is an integer.

Using several TemperatureEntryHandler instances simultaneously is possible.

The TemperatureEntryHandler Class

class gui.calibration.entry.TemperatureEntryHandler(system, buttonStock='gtk-apply', useLabel=True)

Creates a new instance of this class, which accepts temperature measurements for the given ProductionSystem.

buttonStock is the GTK stock item used for the button (the default is gtk.STOCK_APPLY, but clients may want to use gtk.STOCK_OK instead); useLabel determines whether box contains a label that identifies the gtk.Entry.

TemperatureEntryHandler.box
A gtk.HBox that contains the gtk.Entry used to enter temperature measurements, a label that indicates that the measurement is in °C, and optionally a label that identifies the entry. Immutable.
TemperatureEntryHandler.button
A gtk.Button that can be pressed to finalize the temperature input. Immutable.