Example #1
0
    def __init__(self, parent):
        self.ind_parent = parent
        self._list_store = Gtk.ListStore(str, str)
        self._tree_view = Gtk.TreeView(self._list_store)

        self.sensor_mgr = SensorManager()
        self.sensor_mgr.fill_liststore(self._list_store)
    def __init__(self):
        self._preferences_dialog = None
        self._help_dialog = None

        #fn, self.tindicator = tempfile.mkstemp(suffix=".svg")

        #with open(self.tindicator, "w") as f:
        #    svg = '<?xml version="1.0" encoding="UTF-8" \
        #                standalone="no"?><svg id="empty" xmlns="http://www.w3.org/2000/svg" \
        #                height="22" width="1" version="1.0" \
        #                xmlns:xlink="http://www.w3.org/1999/xlink"></svg>'
        #    f.write(svg)
        #    f.close()

        #self.ind = appindicator.Indicator.new("indicator-sysmonitor", self.tindicator, \
        #                                      appindicator.IndicatorCategory.SYSTEM_SERVICES)
        self.ind = Gtk.Button.new()
        #self.ind.set_ordering_index(0)

        #self.ind.set_status(appindicator.IndicatorStatus.ACTIVE)
        self.ind.set_label("Init...")

        self._create_menu()

        self.alive = Event()
        self.alive.set()

        self.sensor_mgr = SensorManager()
        self.load_settings()
Example #3
0
    def __init__(self):
        self._preferences_dialog = None
        self._help_dialog = None

        self.ind = Gtk.Button.new()
        self.ind.set_label("Init...")

        self._create_menu()

        self.alive = Event()
        self.alive.set()

        self.sensor_mgr = SensorManager()
        self.load_settings()
Example #4
0
    def __init__(self, parent):
        """It creates the widget of the dialogs"""
        Gtk.Dialog.__init__(self)
        self.ind_parent = parent
        self.custom_entry = None
        self.interval_entry = None
        self.sensor_mgr = SensorManager()
        self._create_content()
        self.set_data()
        self.show_all()

        # not implemented yet - just hide
        self.display_icon_checkbutton.set_visible(False)
        self.iconpath_button.set_visible(False)
        self.iconpath_entry.set_visible(False)
Example #5
0
    def __init__(self, uuid):
        Budgie.Applet.__init__(self)

        # Add a button to our UI
        logging.info("start")

        if not os.path.exists(SensorManager.SETTINGS_FILE):
            sensor_mgr = SensorManager()
            sensor_mgr.save_settings()

        self.app = IndicatorSysmonitor()
        self.button = self.app.ind
        self.button.set_relief(Gtk.ReliefStyle.NONE)
        self.add(self.button)
        self.show_all()
Example #6
0
# App setup
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
app.logger.disabled = True
socketio = SocketIO(app, async_mode=async_mode)
thread = None
thread_lock = Lock()

namespace = '/socket'

# Other setup
start_time = time.time()

valve_manager = ValveManager()
sensor_manager = SensorManager()


def client_tester():
    i = 0
    while True:
        # TODO: Add better client test
        # Code to test Client
        send_log_data('Hello World!')
        send_sensor_data(
            sensor_manager.get_sensor_by_name("Pressure Sensor 1"))
        send_sensor_data(
            sensor_manager.get_sensor_by_name("Temperature Sensor 1"))
        # socketio.emit('sensor_data', {'time': time.time() - start_time,
        #                               'name': 'sensor1',
        #                               'value': i})
Example #7
0
        xyz = sens.get_point('24')
        if None not in xyz:
            xyz = sens.lowpass('24', xyz, 15)
            xyz = sens.get_point_normal(xyz)
            rightArm.set_uparm(xyz)

        xyz = sens.get_point('25')
        if None not in xyz:
            xyz = sens.lowpass('25', xyz, 15)
            xyz = sens.get_point_normal(xyz)
            rightArm.set_wrist(xyz)

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)

        leftArm.draw()
        rightArm.draw()

        # updates the display
        pygame.display.flip()
        pygame.time.wait(2)


if __name__ == "__main__":
    s = SensorManager()
    s.calibrate()
    s.poll_sensor()
    s.clear_sensors()

    visualize(s)
Example #8
0
 def _load_sensor_manager(self):
     """
     Sensors are managed by the SensorManager. On init, the module loads list of sensor mappings 
     (ID, sensor type) from cosmos via the Hub
     """
     self._sensor_manager = SensorManager(self._hub)