Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added in ability to specify a content_width for ColumnViews #495

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions helios/pipeViewer/scripts/alf_gen/ALFLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def __init__(self,
spacing,
margins,
include_detail_column : bool,
content_width : int,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To allow backward compatibility, can you swap the order of the new param with time_offset?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I got them all -- can you double-check, since I don't know python?

time_offset : int):
self._num_cycles = num_cycles
self._locations = locations
Expand All @@ -285,6 +286,7 @@ def __init__(self,
self._line_pos = self._pos.copy()
self._caption_pos = [self._margins.left, self._pos[1]]
self._detail_column = include_detail_column
self._content_width = content_width

def addScheduleLine(self,
location_name : str,
Expand Down Expand Up @@ -333,6 +335,8 @@ def addScheduleLine(self,
if 'reverse' in kwargs:
reverse = kwargs['reverse']

content_width = self._content_width

# Create the mini layout
if mini_cnt != 0:
melement_height_total = 0
Expand All @@ -351,7 +355,7 @@ def addScheduleLine(self,
# Add the mini layout to the right
self._detailed_schedule_lines.append (Content(content='auto_color_anno_notext',
loc=loc, color=color,
dimensions=[self._spacing.caption_width,
dimensions=[content_width,
self._spacing.melem_height],
position = [
self._line_pos[0] +
Expand Down Expand Up @@ -417,7 +421,7 @@ def addScheduleLine(self,
self._detailed_schedule_lines.append (Content(content=content,
loc=loc,
color=color,
dimensions=[self._spacing.caption_width,
dimensions=[content_width,
self._spacing.height],
position = [
self._line_pos[0] +
Expand Down Expand Up @@ -633,7 +637,7 @@ def count(self, location):
uniq_names.add(re.sub(regexp, r'\1', match))
return len(uniq_names)

def createScheduleLineGroup(self, default_color, include_detail_column, margins):
def createScheduleLineGroup(self, default_color, include_detail_column, content_width, margins):
'''Create a ScheduleLineGroup that ScheduleLines can be added. See
ScheduleLineGroup for more documentation.
'''
Expand All @@ -644,6 +648,7 @@ def createScheduleLineGroup(self, default_color, include_detail_column, margins)
spacing = self._spacing,
margins = margins,
include_detail_column = include_detail_column,
content_width = content_width,
time_offset = self._start_time)
return self._schedule_line

Expand Down
Loading