Move graph location
This commit is contained in:
parent
fdf81ecf06
commit
e26e4006d6
@ -37,13 +37,13 @@ class HeaterGraph(Gtk.DrawingArea):
|
|||||||
if ev.type == Gdk.EventType.BUTTON_PRESS:
|
if ev.type == Gdk.EventType.BUTTON_PRESS:
|
||||||
x = ev.x
|
x = ev.x
|
||||||
y = ev.y
|
y = ev.y
|
||||||
|
# logging.info("Drawing area clicked: %s %s" % (x, y))
|
||||||
|
|
||||||
if ev.get_source_device().get_source() == Gdk.InputSource.TOUCHSCREEN:
|
if ev.get_source_device().get_source() == Gdk.InputSource.TOUCHSCREEN:
|
||||||
if ev.touch.type == Gdk.EventType.TOUCH_BEGIN:
|
if ev.touch.type == Gdk.EventType.TOUCH_BEGIN:
|
||||||
x = ev.touch.x
|
x = ev.touch.x
|
||||||
y = ev.touch.y
|
y = ev.touch.y
|
||||||
|
# logging.info("Drawing area clicked: %s %s" % (x, y))
|
||||||
logging.info("Drawing area clicked: %s %s" % (x, y))
|
|
||||||
|
|
||||||
|
|
||||||
def get_max_length(self):
|
def get_max_length(self):
|
||||||
@ -97,8 +97,6 @@ class HeaterGraph(Gtk.DrawingArea):
|
|||||||
if points_per_pixel > 3:
|
if points_per_pixel > 3:
|
||||||
points_per_pixel = 3
|
points_per_pixel = 3
|
||||||
data_points = graph_width * points_per_pixel
|
data_points = graph_width * points_per_pixel
|
||||||
logging.info("Max length: %s PPP: %s" % (self.max_length, points_per_pixel))
|
|
||||||
logging.info("aa: %s %s" % (points_per_pixel, data_points))
|
|
||||||
max_num = math.ceil(self.get_max_num(data_points) * 1.1 / 10) * 10
|
max_num = math.ceil(self.get_max_num(data_points) * 1.1 / 10) * 10
|
||||||
d_width = 1 / points_per_pixel
|
d_width = 1 / points_per_pixel
|
||||||
|
|
@ -6,7 +6,7 @@ import logging
|
|||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||||
from panels.menu import MenuPanel
|
from panels.menu import MenuPanel
|
||||||
from ks_includes.graph import HeaterGraph
|
from ks_includes.widgets.graph import HeaterGraph
|
||||||
|
|
||||||
def create_panel(*args):
|
def create_panel(*args):
|
||||||
return MainPanel(*args)
|
return MainPanel(*args)
|
||||||
@ -97,7 +97,6 @@ class MainPanel(MenuPanel):
|
|||||||
child = name.get_children()[0].get_children()[0].get_children()[1]
|
child = name.get_children()[0].get_children()[0].get_children()[1]
|
||||||
child.set_ellipsize(True)
|
child.set_ellipsize(True)
|
||||||
child.set_ellipsize(Pango.EllipsizeMode.END)
|
child.set_ellipsize(Pango.EllipsizeMode.END)
|
||||||
logging.info("DClass %s %s" % (device, class_name))
|
|
||||||
|
|
||||||
|
|
||||||
temp = Gtk.Label("")
|
temp = Gtk.Label("")
|
||||||
@ -229,9 +228,7 @@ class MainPanel(MenuPanel):
|
|||||||
def update_graph(self):
|
def update_graph(self):
|
||||||
self.labels['da'].queue_draw()
|
self.labels['da'].queue_draw()
|
||||||
alloc = self.labels['devices'].get_allocation()
|
alloc = self.labels['devices'].get_allocation()
|
||||||
logging.info("Devices height: %s" % alloc.height)
|
|
||||||
alloc = self.labels['da'].get_allocation()
|
alloc = self.labels['da'].get_allocation()
|
||||||
logging.info("DA height: %s" % alloc.height)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def update_temp(self, device, temp, target):
|
def update_temp(self, device, temp, target):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user