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
+ 46
33
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -319,13 +319,15 @@ class Plotting:
"""
Plot lines with dots at the data points. Colors of dot and lines are
defined in valueColors in database.
Ex: L:G|D:W|Z:C means
Lines are plotted with color G
Dots are plotted with color W
Additional dot with value Zero in color C (for channel GPS Lk/Unlk)
If D is not defined, dots won't be displayed.
If L is not defined, lines will be plotted with color G
Color codes are defined in colorSettings
Ex: Line:#00FF00|Dot:#FF0000|Zero:#0000FF means
Lines are plotted with color #00FF00
Dots are plotted with color #FF0000
Additional dot with value Zero in color #0000FF (for channel GPS
Lk/Unlk)
If Dot is not defined, dots won't be displayed.
If Line is not defined, lines will be plotted with color G.
If Zero is not defined, points with value zero will be plotted the same
as other points.
:param c_data: data of the channel which includes down-sampled
(if needed) data in keys 'times' and 'data'.
@@ -350,18 +352,18 @@ class Plotting:
for cStr in color_parts:
obj, c = cStr.split(':')
colors[obj] = c
l_color = 'G'
l_color = '#00FF00'
has_dot = False
if 'L' in colors:
l_color = colors['L']
if 'D' in colors:
d_color = colors['D']
if 'Line' in colors:
l_color = colors['Line']
if 'Dot' in colors:
d_color = colors['Dot']
has_dot = True
else:
d_color = l_color
if chan_id == 'GPS Lk/Unlk':
z_color = colors['Z']
z_color = colors['Zero']
sample_no_list = []
ax.x_bottom = x_list[0][np.where(y_list[0] == -1)[0]]
sample_no_list.append(ax.x_bottom.size)
@@ -369,7 +371,7 @@ class Plotting:
sample_no_list.append(ax.x_center.size)
ax.x_top = x_list[0][np.where(y_list[0] == 1)[0]]
sample_no_list.append(ax.x_top.size)
sample_no_colors = [clr[d_color], clr[z_color], clr[d_color]]
sample_no_colors = [d_color, z_color, d_color]
sample_no_pos = [0.05, 0.5, 0.95]
top_bottom_index = np.where(y_list[0] != 0)[0]
@@ -383,15 +385,15 @@ class Plotting:
markersize=1.5,
linestyle='',
zorder=constants.Z_ORDER['DOT'],
mfc=clr[z_color],
mec=clr[z_color],
mfc=z_color,
mec=z_color,
picker=True, pickradius=3)
ax.chan_plots.append(chan_plot)
info = "GPS Clock Power"
else:
sample_no_list = [None, sum([len(x) for x in x_list]), None]
sample_no_colors = [None, clr[d_color], None]
sample_no_colors = [None, d_color, None]
sample_no_pos = [None, 0.5, None]
ax.x_center = x_list[0]
ax.y_center = y_list[0]
@@ -413,16 +415,16 @@ class Plotting:
x, y, marker='o', markersize=0.01,
linestyle='-', linewidth=0.7,
zorder=constants.Z_ORDER['LINE'],
color=clr[l_color],
color=l_color,
picker=True, pickradius=3)
else:
chan_plot, = ax.plot(
x, y, marker='s', markersize=1.5,
linestyle='-', linewidth=0.7,
zorder=constants.Z_ORDER['LINE'],
color=clr[l_color],
mfc=clr[d_color],
mec=clr[d_color],
color=l_color,
mfc=d_color,
mec=d_color,
picker=True, pickradius=3)
ax.chan_plots.append(chan_plot)
Loading