From d2d1a4f41025e4b7663813eac81ac99674738cd8 Mon Sep 17 00:00:00 2001 From: bgrayson-mips <167797453+bgrayson-mips@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:19:31 -0500 Subject: [PATCH 1/2] Added in ability to specify a content_width for ColumnViews (#495) * Added in ability to specify a content_width * Reordered new arg to maintain backwards compatibility, per comment --- .../pipeViewer/scripts/alf_gen/ALFLayout.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/helios/pipeViewer/scripts/alf_gen/ALFLayout.py b/helios/pipeViewer/scripts/alf_gen/ALFLayout.py index 3b65405fc7..7dc968c3ea 100644 --- a/helios/pipeViewer/scripts/alf_gen/ALFLayout.py +++ b/helios/pipeViewer/scripts/alf_gen/ALFLayout.py @@ -266,7 +266,8 @@ def __init__(self, spacing, margins, include_detail_column : bool, - time_offset : int): + time_offset : int, + content_width : int): self._num_cycles = num_cycles self._locations = locations self._def_color = def_color @@ -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, @@ -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 @@ -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] + @@ -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] + @@ -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. ''' @@ -644,7 +648,8 @@ def createScheduleLineGroup(self, default_color, include_detail_column, margins) spacing = self._spacing, margins = margins, include_detail_column = include_detail_column, - time_offset = self._start_time) + time_offset = self._start_time, + content_width = content_width) return self._schedule_line def createColumnView(self, margins, content_width, default_color=[192,192,192]): @@ -654,7 +659,7 @@ def createColumnView(self, margins, content_width, default_color=[192,192,192]): self._column_view = self.ColumnView(locations = self._loc_strs, spacing = self._spacing, margins = margins, - content_width = content_width, def_color = default_color, - time_offset=0) + time_offset=0, + content_width = content_width) return self._column_view From 102a1199716bd8e33bc720bd42fab4651a11f276 Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Wed, 24 Apr 2024 14:43:23 -0500 Subject: [PATCH 2/2] Fix errors when compiling Argos with the latest Cython - Fixes `NameError: name 'extract_value' is not defined` error - Fixes segfault when trying to start Argos Fixes #465, #490, #492 --- helios/pipeViewer/pipe_view/core/src/core.pyx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helios/pipeViewer/pipe_view/core/src/core.pyx b/helios/pipeViewer/pipe_view/core/src/core.pyx index 57a6f18257..952ec2a041 100644 --- a/helios/pipeViewer/pipe_view/core/src/core.pyx +++ b/helios/pipeViewer/pipe_view/core/src/core.pyx @@ -7,9 +7,6 @@ import math import colorsys from logging import debug, error, info -# Color expression namespace -EXPR_NAMESPACE = {'re':re, 'colorsys':colorsys, 'math':math, 'extract':extract_value} - from common cimport * from libc.stdlib cimport strtoul from libcpp.unordered_map cimport unordered_map @@ -203,6 +200,9 @@ cdef wxFont* getFont(font): cdef wxBrush* getBrush(brush): return getBrush_wrapped(brush) +# Color expression namespace +EXPR_NAMESPACE = {'re':re, 'colorsys':colorsys, 'math':math, 'extract':extract_value} + cdef class Renderer: cdef unordered_map[int, wxPen] c_pens_map @@ -406,7 +406,8 @@ cdef class Renderer: return string_to_display, wx.TheBrushList.FindOrCreateBrush(wx.WHITE, wx.SOLID) def setFontFromDC(self, dc): - self.c_font = getFont(dc.GetFont())[0] + py_font = dc.GetFont() + self.c_font = getFont(py_font)[0] self.c_bold_font = wxFont(self.c_font) self.c_bold_font.MakeBold()