Skip to content

Commit

Permalink
Fix formatting and regenerate expected
Browse files Browse the repository at this point in the history
  • Loading branch information
niamhdougan committed Jan 14, 2021
1 parent dce6bd4 commit b2dfe8e
Show file tree
Hide file tree
Showing 4 changed files with 476 additions and 2,050 deletions.
28 changes: 15 additions & 13 deletions pvi/adl_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import math

from ._types import Widget


Expand Down Expand Up @@ -183,7 +184,7 @@ def make_box(self, box_label, nodes):
self.label_reset = 0
self.column_counter = 0

# Position new box
# Position new box
self.box_y = self.y
self.box_x = self.x
self.box_w = self.box_column
Expand All @@ -195,15 +196,16 @@ def make_box(self, box_label, nodes):
# vertically in the window
if self.box_h > self.h:
self.box_h = self.max_box_h
self.max_nodes = (math.floor((self.box_h - (2 * self.margin))
/ self.label_height))
self.max_nodes = math.floor(
(self.box_h - (2 * self.margin)) / self.label_height
)
remainder = nodes - self.max_nodes
num_cols = math.ceil(remainder / self.max_nodes)
self.box_w += (num_cols * self.box_column)
self.box_w += num_cols * self.box_column

if (self.box_y + self.box_h) > self.h:
self.y = 40 # Start back at the top
self.box_y = self.y
self.y = 40 # Start back at the top
self.box_y = self.y
self.x += self.widget_width + self.margin # New column
self.box_x = self.x

Expand Down Expand Up @@ -273,7 +275,7 @@ def make_widget(self, widget_label, nodes, widget_type, read_pv, write_pv):
elif widget_type == Widget.COMBO:
self.widget_width = (self.box_column / 4) - (3 / 2 * self.margin)
pv_menu = self.make_combo(write_pv)
self.x += + self.widget_width + self.margin
self.x += +self.widget_width + self.margin
pv_rbv = self.make_rbv(read_pv)
widget = pv_menu + pv_rbv

Expand Down Expand Up @@ -314,14 +316,14 @@ def make_label(self, widget_label):
self.column_counter += 1
self.label_reset = 0
self.x = self.box_x + self.margin + (self.box_column * self.column_counter)
self.y = (self.box_y
+ self.margin
+ (self.label_height * (self.label_reset + 1)))
self.y = (
self.box_y + self.margin + (self.label_height * (self.label_reset + 1))
)
else:
self.x = self.box_x + self.margin + (self.box_column * self.column_counter)
self.y = (self.box_y
+ self.margin
+ (self.label_height * (self.label_reset + 1)))
self.y = (
self.box_y + self.margin + (self.label_height * (self.label_reset + 1))
)
label_text = f"""
# (Static Text)
text {{
Expand Down
16 changes: 8 additions & 8 deletions pvi/edl_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import math

from ._types import Widget


Expand Down Expand Up @@ -225,15 +226,16 @@ def make_box(self, box_label, nodes):
# vertically in the window
if self.box_h > self.h:
self.box_h = self.max_box_h
self.max_nodes = (math.floor((self.box_h - (2 * self.margin))
/ self.label_height))
self.max_nodes = math.floor(
(self.box_h - (2 * self.margin)) / self.label_height
)
remainder = nodes - self.max_nodes
num_cols = math.ceil(remainder / self.max_nodes)
self.box_w += (num_cols * self.box_column)
self.box_w += num_cols * self.box_column

if (self.box_y + self.box_h + self.exit_space) > self.h:
self.y = 50 # Start back at the top
self.box_y = self.y
self.y = 50 # Start back at the top
self.box_y = self.y
self.x += self.widget_width + (3 * self.margin) # New column
self.box_x = self.x

Expand Down Expand Up @@ -342,9 +344,7 @@ def make_label(self, widget_label):
self.y = self.box_y + self.margin + (self.label_height * self.label_reset)
else:
self.x = self.box_x + self.margin + (self.box_column * self.column_counter)
self.y = (self.box_y
+ self.margin
+ (self.label_height * self.label_reset))
self.y = self.box_y + self.margin + (self.label_height * self.label_reset)
label_text = f"""# (Static Text)
object activeXTextClass
beginObjectProperties
Expand Down

0 comments on commit b2dfe8e

Please sign in to comment.