Skip to content
Snippets Groups Projects

Use new editor for valuesColor in Parameter dialog

Merged Kien Le requested to merge feature-#193-better_editor_for_valuesColor into develop
2 unresolved threads
2 files
+ 13
14
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -204,10 +204,9 @@ class Plotting:
"""
Plot channel with 2 different values, one above, one under center line.
Each value has corresponding color defined in valueColors in database.
Ex: 1:Y|0:R means
value == 1 => plot above center line with Y color
value == 0 => plot under center line with R color
Color codes are defined in colorSettings.
Ex: Down:#FF0000|Up:#00FFFF means
value == 1 => plot above center line with #00FFFF color
value == 0 => plot under center line with #FF0000 color
:param c_data: data of the channel which includes down-sampled
(if needed) data in keys 'times' and 'data'.
@@ -225,10 +224,10 @@ class Plotting:
val_cols = chan_db_info['valueColors'].split('|')
# up/down has 2 values: 0, 1 which match with index of points_list
points_list = [[], []]
colors = [[], []]
colors = {}
for vc in val_cols:
v, c = vc.split(':')
val = int(get_val(v))
val = 0 if v == 'Down' else 1
points = []
for times, data in zip(c_data['times'], c_data['data']):
points += [times[i]
@@ -241,20 +240,20 @@ class Plotting:
down_dots, = ax.plot(
points_list[0], len(points_list[0]) * [-0.5], linestyle="",
marker='s', markersize=2, zorder=constants.Z_ORDER['DOT'],
color=clr[colors[0]], picker=True, pickradius=3)
color=colors[0], picker=True, pickradius=3)
ax.chan_plots.append(down_dots)
# up dots
up_dots, = ax.plot(
points_list[1], len(points_list[1]) * [0.5], linestyle="",
marker='s', markersize=2, zorder=constants.Z_ORDER['DOT'],
color=clr[colors[1]], picker=True, pickradius=3)
color=colors[1], picker=True, pickradius=3)
ax.chan_plots.append(up_dots)
ax.set_ylim(-2, 2)
self.plotting_axes.set_axes_info(
ax,
sample_no_list=[len(points_list[0]), None, len(points_list[1])],
sample_no_colors=[clr[colors[0]], None, clr[colors[1]]],
sample_no_colors=[colors[0], None, colors[1]],
sample_no_pos=[0.25, None, 0.75],
chan_db_info=chan_db_info)
Loading