Пример #1
0
def setupCommonStyle(line, marker):

    markerSymbol = "Ellipse"  # in this case a circle, because we give only one size parameter.
    edgeColor = "#555555"
    faceColor = "#cc0000"
    alpha = 0.8
    size = 6
    params = {
        "marker/cross/symbol/marker": markerSymbol,
        "marker/cross/symbol/edgecolor": edgeColor,
        "marker/cross/symbol/facecolor": faceColor,
        "marker/cross/symbol/alpha": alpha,
        "marker/cross/symbol/size": size,
        "marker/cross/line/color": "#000000",
        #"marker/cross/line/width": 0.0,
        "marker/cross/line/style": "NoPen",
    }
    CONF.update_defaults(dict(plot=params))
    marker.markerparam.read_config(CONF, "plot", "marker/cross")
    marker.markerparam.update_marker(marker)
    params = {
        "shape/drag/symbol/marker": markerSymbol,
        "shape/drag/symbol/size": size,
        "shape/drag/symbol/edgecolor": edgeColor,
        "shape/drag/symbol/facecolor": faceColor,
        "shape/drag/symbol/alpha": alpha,
    }
    CONF.update_defaults(dict(plot=params))
    line.shapeparam.read_config(CONF, "plot", "shape/drag")
    line.shapeparam.update_shape(line)
Пример #2
0
def setupStyleRangeMarker(range_):
    params = {
        "range/line/style": 'SolidLine',
        "range/line/color": "gray",  # "#ff9393",
        "range/line/width": 1,
        "range/sel_line/style": 'SolidLine',
        "range/sel_line/color": "gray",  # "red",
        "range/sel_line/width": 1 + 0 * 2,
        "range/fill": "gray",
        "range/shade": 0.10,
        "range/symbol/marker": "Ellipse",
        "range/symbol/size": 7 + 1,
        "range/symbol/edgecolor": "white",
        "range/symbol/facecolor": "gray",  # "#ff9393",
        "range/symbol/alpha": 1 - 0.2,
        "range/sel_symbol/marker": "Ellipse",
        "range/sel_symbol/size": 9 - 1,
        "range/sel_symbol/edgecolor": "white",
        "range/sel_symbol/facecolor": "gray",  # "red",
        "range/sel_symbol/alpha": .9,
        "range/multi/color": "#806060",
    }

    CONF.update_defaults(dict(histogram=params))
    range_.shapeparam.read_config(CONF, "histogram", "range")
    range_.shapeparam.update_range(range_)
Пример #3
0
def setupStyleRangeMarker(range_):
    params = {
             "range/line/style" : 'SolidLine',
             "range/line/color" : "gray", # "#ff9393",
             "range/line/width" : 1,
             "range/sel_line/style" : 'SolidLine',
             "range/sel_line/color" : "gray", # "red",
             "range/sel_line/width" : 1 + 0* 2,
             "range/fill" : "gray",
             "range/shade" : 0.10,
             "range/symbol/marker" : "Ellipse",
             "range/symbol/size" : 7+1,
             "range/symbol/edgecolor" : "white",
             "range/symbol/facecolor" : "gray", # "#ff9393",
             "range/symbol/alpha" : 1 - 0.2,
             "range/sel_symbol/marker" : "Ellipse",
             "range/sel_symbol/size" : 9-1,
             "range/sel_symbol/edgecolor" : "white",
             "range/sel_symbol/facecolor" : "gray", # "red",
             "range/sel_symbol/alpha" : .9,
             "range/multi/color" : "#806060",
            }

    CONF.update_defaults(dict(histogram=params))
    range_.shapeparam.read_config(CONF, "histogram", "range")
    range_.shapeparam.update_range(range_)
Пример #4
0
def setupCommonStyle(line, marker):

   markerSymbol = "Ellipse" # in this case a circle, because we give only one size parameter.
   edgeColor = "#555555"
   faceColor = "#cc0000"
   alpha = 0.8
   size = 6
   params = {
       "marker/cross/symbol/marker": markerSymbol,
       "marker/cross/symbol/edgecolor": edgeColor,
       "marker/cross/symbol/facecolor": faceColor,
       "marker/cross/symbol/alpha": alpha,
       "marker/cross/symbol/size": size,
       "marker/cross/line/color" : "#000000",
       #"marker/cross/line/width": 0.0,
       "marker/cross/line/style": "NoPen",
       }
   CONF.update_defaults(dict(plot=params))
   marker.markerparam.read_config(CONF, "plot", "marker/cross")
   marker.markerparam.update_marker(marker)
   params = {
       "shape/drag/symbol/marker": markerSymbol,
       "shape/drag/symbol/size": size,
       "shape/drag/symbol/edgecolor": edgeColor,
       "shape/drag/symbol/facecolor": faceColor,
       "shape/drag/symbol/alpha": alpha,
       "shape/drag/line/color": "#555555",
       }
   CONF.update_defaults(dict(plot=params))
   line.shapeparam.read_config(CONF, "plot", "shape/drag")
   line.shapeparam.update_shape(line)
Пример #5
0
    def create_peakmap_labels(self):
        plot = self.widget.plot
        rect_marker = RectangleShape()
        rect_label = make.info_label("TR", [PeakmapCursorRangeInfo(rect_marker)], title=None)
        rect_label.labelparam.label = ""
        rect_label.setVisible(1)
        plot.rect_label = rect_label
        plot.add_item(rect_label)

        params = {
            "shape/drag/symbol/size": 0,
            "shape/drag/line/color": "#cccccc",
            "shape/drag/line/width": 1.5,
            "shape/drag/line/alpha": 0.4,
            "shape/drag/line/style": "SolidLine",

        }
        CONF.update_defaults(dict(plot=params))
        rect_marker.shapeparam.read_config(CONF, "plot", "shape/drag")
        rect_marker.shapeparam.update_shape(rect_marker)
        rect_marker.setVisible(0)
        rect_marker.set_rect(0, 0, np.nan, np.nan)
        plot.add_item(rect_marker)

        plot.canvas_pointer = True  # x-cross marker on
        # we hack label_cb for updating legend:

        def label_cb(rt, mz):
            # passing None here arives as np.nan if you call get_rect later, so we use
            # np.nan here:
            rect_marker.set_rect(rt, mz, np.nan, np.nan)
            return ""

        cross_marker = plot.cross_marker
        cross_marker.label_cb = label_cb
        params = {
            "marker/cross/line/color": "#cccccc",
            "marker/cross/line/width": 1.5,
            "marker/cross/line/alpha": 0.4,
            "marker/cross/line/style": "DashLine",
            "marker/cross/symbol/marker": "NoSymbol",
            "marker/cross/markerstyle": "Cross",
        }
        CONF.update_defaults(dict(plot=params))
        cross_marker.markerparam.read_config(CONF, "plot", "marker/cross")
        cross_marker.markerparam.update_marker(cross_marker)

        self.cross_marker = cross_marker
        self.rect_marker = rect_marker
Пример #6
0
def create_peakmap_labels(plot):
    rect_marker = RectangleShape()
    rect_label = make.info_label("TR", [PeakmapCursorRangeInfo(rect_marker)],
                                 title=None)
    rect_label.labelparam.label = ""
    rect_label.labelparam.font.size = 12
    rect_label.labelparam.update_label(rect_label)
    rect_label.setVisible(1)
    plot.rect_label = rect_label
    plot.add_item(rect_label)

    params = {
        "shape/drag/symbol/size": 0,
        "shape/drag/line/color": "#cccccc",
        "shape/drag/line/width": 1.5,
        "shape/drag/line/alpha": 0.4,
        "shape/drag/line/style": "SolidLine",
    }
    CONF.update_defaults(dict(plot=params))
    rect_marker.shapeparam.read_config(CONF, "plot", "shape/drag")
    rect_marker.shapeparam.update_shape(rect_marker)
    rect_marker.setVisible(0)
    rect_marker.set_rect(0, 0, np.nan, np.nan)
    plot.add_item(rect_marker)

    plot.canvas_pointer = True  # x-cross marker on

    # we hack label_cb for updating legend:

    def label_cb(rt, mz):
        # passing None here arives as np.nan if you call get_rect later, so we use
        # np.nan here:
        rect_marker.set_rect(rt, mz, np.nan, np.nan)
        return ""

    cross_marker = plot.cross_marker
    cross_marker.label_cb = label_cb
    params = {
        "marker/cross/line/color": "#cccccc",
        "marker/cross/line/width": 1.5,
        "marker/cross/line/alpha": 0.4,
        "marker/cross/line/style": "DashLine",
        "marker/cross/symbol/marker": "NoSymbol",
        "marker/cross/markerstyle": "Cross",
    }
    CONF.update_defaults(dict(plot=params))
    cross_marker.markerparam.read_config(CONF, "plot", "marker/cross")
    cross_marker.markerparam.update_marker(cross_marker)
Пример #7
0
def setupStyleRtMarker(marker):
    linecolor = "#909090"
    edgeColor = "#005500"
    faceColor = "#005500"
    params = {
        "marker/cross/symbol/marker": "Rect",
        "marker/cross/symbol/size": 0,
        "marker/cross/symbol/edgecolor": edgeColor,
        "marker/cross/symbol/facecolor": faceColor,
        "marker/cross/line/color": linecolor,
        "marker/cross/line/width": 1.0,
        "marker/cross/line/style": "SolidLine",
        "marker/cross/sel_symbol/size": 0,
        "marker/cross/sel_line/color": linecolor,
        "marker/cross/sel_line/width": 1.0,
        "marker/cross/sel_line/style": "SolidLine",
    }
    CONF.update_defaults(dict(plot=params))
    marker.markerparam.read_config(CONF, "plot", "marker/cross")
    marker.markerparam.update_marker(marker)
Пример #8
0
def setupStyleRtMarker(marker):
   linecolor = "#909090"
   edgeColor = "#005500"
   faceColor = "#005500"
   params = {
       "marker/cross/symbol/marker": "Rect",
       "marker/cross/symbol/size": 0,
       "marker/cross/symbol/edgecolor": edgeColor,
       "marker/cross/symbol/facecolor": faceColor,
       "marker/cross/line/color" : linecolor,
       "marker/cross/line/width": 1.0,
       "marker/cross/line/style": "SolidLine",

       "marker/cross/sel_symbol/size": 0,
       "marker/cross/sel_line/color" : linecolor,
       "marker/cross/sel_line/width": 1.0,
       "marker/cross/sel_line/style": "SolidLine",
       }
   CONF.update_defaults(dict(plot=params))
   marker.markerparam.read_config(CONF, "plot", "marker/cross")
   marker.markerparam.update_marker(marker)
Пример #9
0
import rrpam_wds
import rrpam_wds.constants as c
from rrpam_wds.gui import monkey_patch_guiqwt_guidata

# there are some changes to the guiqwt classes to be done. It is not easy to do this by subclassing, as
# we need to use make.* facotry.
monkey_patch_guiqwt_guidata._patch_all()
# show guiqwt where the images are.
add_image_module_path("rrpam_wds.gui", "images")
# this how we change an option

# if there is not .config directory in the home directory, create it.
configfile = os.path.join(c.HOMEDIR, '.config')
if (os.path.isfile(configfile) and (not os.path.isdir(configfile))):
    os.unlink(configfile)
if (not os.path.isdir(configfile)):
    os.mkdir(configfile)

DEFAULTS = {
    'plot': {
        "selection/distance": 10,
    }
}
CONF.update_defaults(DEFAULTS)
CONF.set_application("rrpamwds", version=rrpam_wds.__version__)


def save():
    CONF.save()