rally point commands
11669
def cmd_rally(self, args):
        ''''''
        #TODO: add_land arg
        if len(args) < 1:
            self.print_usage()
            return

        elif args[0] == "add":
            self.cmd_rally_add(args[1:])

        elif args[0] == "move":
            self.cmd_rally_move(args[1:])

        elif args[0] == "clear":
            self.rallyloader.clear()
            self.mav_param.mavset(self.master,'RALLY_TOTAL',0,3)

        elif args[0] == "remove":
            if not self.have_list:
                print("Please list rally points first")
                return
            if (len(args) < 2):
                print("Usage: rally remove RALLYNUM")
                return
            self.rallyloader.remove(int(args[1]))
            self.send_rally_points()

        elif args[0] == "list":
            self.list_rally_points()
            self.have_list = True

        elif args[0] == "load":
            if (len(args) < 2):
                print("Usage: rally load filename")
                return

            try:
                self.rallyloader.load(args[1])
            except Exception as msg:
                print("Unable to load %s - %s" % (args[1], msg))
                return

            self.send_rally_points()
            self.have_list = True

            print("Loaded %u rally points from %s" % (self.rallyloader.rally_count(), args[1]))

        elif args[0] == "save":
            if (len(args) < 2):
                print("Usage: rally save filename")
                return

            self.rallyloader.save(args[1])

            print("Saved rally file %s" % args[1])

        elif args[0] == "alt":
            self.cmd_rally_alt(args[1:])

        elif args[0] == "land":
            if (len(args) >= 2 and args[1] == "abort"):
                self.abort_ack_received = False
                self.abort_first_send_time = 0

                self.abort_alt = self.settings.rally_breakalt
                if (len(args) >= 3):
                    self.abort_alt = int(args[2])

            else:
                self.master.mav.command_long_send(self.settings.target_system,
                        self.settings.target_component,
                        mavutil.mavlink.MAV_CMD_DO_RALLY_LAND,
                        0, 0, 0, 0, 0, 0, 0, 0)

        else:
            self.print_usage()
719425
public void initEndpoints() {
		switch (this.getVersion()) {
			case 1:
				// get number of instances for all command classes on this node.
				for (ZWaveCommandClass commandClass : this.getNode().getCommandClasses()) {
					if (commandClass.getCommandClass() == CommandClass.NO_OPERATION)
						continue;
					this.getController().sendData(this.getMultiInstanceGetMessage(commandClass.getCommandClass()));
				}
				break;
			case 2:
				this.getController().sendData(this.getMultiChannelEndpointGetMessage());
				break;
			default:
				logger.warn(String.format("Unknown version %d for command class %s (0x%02x)", 
						this.getVersion(), this.getCommandClass().getLabel(), this.getCommandClass().getKey()));
		}
	}
1341565
public void commandsForDomainModel(final Object root, final CommandsForDomainModelCallback callback) {
        final State state = createCommandList(new WithCommandType() {
            @Override
            public void invoke(final State state) {
                createObservableObject(root, state);
            }
        }, false);

        final SetRootElement msg = new SetRootElement();
        msg.setRootElementId(objectRegistry.getIdOrFail(root));
        // prepend it to the ClearReferences command
        state.commands.add(state.commands.size() - 1, msg);

        callback.commandsReady(state.commands);
    }
764518
def postcmd(self, stop, line):
        '''  '''
        self.color_prompt()
        return Cmd.postcmd(self, stop, line)
117970
def move_rally(self, key):
        ''''''
        a = key.split(' ')
        if a[0] != 'Rally' or len(a) != 2:
            print("Bad rally object %s" % key)
            return
        i = int(a[1])
        self.moving_rally = i
1048543
function highlightDataPoints({values}) {
            let accumulator = 0;

            cleanDataPointHighlights();

            // ensure order stays constant
            let sortedValues = order.reduce((acc, current) => {
                return [...acc, values.find(({name}) => name === current)];
            },[]);

            sortedValues.forEach((d, index) => {
                let marker = verticalMarkerContainer
                    .append('g')
                    .classed('circle-container', true)
                        .append('circle')
                        .classed('data-point-highlighter', true)
                        .attr('cx', highlightCircleSize)
                        .attr('cy', 0)
                        .attr('r', highlightCircleRadius)
                        .style('stroke-width', highlightCircleStroke)
                        .style('stroke', categoryColorMap[d.name])
                        .style('cursor', 'pointer')
                        .on('click', function() {
                            addGlowFilter(this);
                            handleHighlightClick(this, d);
                        })
                        .on('mouseout', function() {
                            removeFilter(this);
                        });

                accumulator = accumulator + sortedValues[index][valueLabel];

                marker.attr('transform', `translate( ${(- highlightCircleSize)}, ${(yScale(accumulator))} )` );
            });
        }
710581
function spawnObservable(command, args) {
  return Observable.create(observer => {
    const cmd = spawn(command, args);
    observer.next(''); // hack to kick things off, not every command will have a stdout
    cmd.stdout.on('data', (data) => { observer.next(data.toString('utf8')); });
    cmd.stderr.on('data', (data) => { observer.error(data.toString('utf8')); });
    cmd.on('close', (data) => { observer.complete(); });
  });
}
1065933
def cmdloop(self, intro=None):
    """"""
    style = style_from_pygments(BasicStyle, style_dict)
    self.preloop()
    stop = None
    while not stop:
        line = prompt(get_prompt_tokens=get_prompt_tokens, lexer=lexer,
                      get_bottom_toolbar_tokens=get_bottom_toolbar_tokens,
                      history=history, style=style, true_color=True,
                      on_exit='return-none', on_abort='return-none',
                      completer=QCompleter())
        if line is None or line.strip() == r'\\':
            raise SystemExit
        else:
            line = self.precmd(line)
            stop = self.onecmd(line)
        stop = self.postcmd(stop, line)
    self.postloop()
1135562
def load(self, filename):
        ''''''
        f = open(filename, mode='r')
        self.clear()
        for line in f:
            if line.startswith('#'):
                continue
            line = line.strip()
            if not line:
                continue
            a = line.split()
            if len(a) != 7:
                raise MAVRallyError("invalid rally file line: %s" % line)

            if (a[0].lower() == "rally"):
                self.create_and_append_rally_point(float(a[1]) * 1e7, float(a[2]) * 1e7,
                                                   float(a[3]), float(a[4]), float(a[5]) * 100.0, int(a[6]))
        f.close()
        return len(self.rally_points)
1323310
def list_commands(self, ctx):
        """"""
        commands = super(PinaxGroup, self).list_commands(ctx)
        return [cmd for cmd in order_manually(commands)]
1031336
def cmd(self, endpoints, cmd):
        """"""
        replies = []
        for ep in endpoints:
            try:
                replies.append(self._cmd(ep, cmd))
            except self.CmdFailed as ex:
                # if there's only 1 endpoint, give up.
                # if there's more, keep trying.
                if len(endpoints) == 1:
                    raise ex

        return "".join(replies)
1246242
def send_rally_points(self):
        ''''''
        self.mav_param.mavset(self.master,'RALLY_TOTAL',self.rallyloader.rally_count(),3)

        for i in range(self.rallyloader.rally_count()):
            self.send_rally_point(i)
141685
private void addPoint() {
		ControlPoint point = new ControlPoint(Color.white, 0.5f);
		for (int i=0;i<list.size()-1;i++) {
			ControlPoint now = (ControlPoint) list.get(i);
			ControlPoint next = (ControlPoint) list.get(i+1);
			if ((now.pos <= 0.5f) && (next.pos >=0.5f)) {
				list.add(i+1,point);
				break;
			}
			
		}
		selected = point;
		sortPoints();
		repaint(0);
		
		fireUpdate();
	}
760756
def cmd_rally_add(self, args):
        ''''''
        if len(args) < 1:
            alt = self.settings.rallyalt
        else:
            alt = float(args[0])

        if len(args) < 2:
            break_alt = self.settings.rally_breakalt
        else:
            break_alt = float(args[1])

        if len(args) < 3:
            flag = self.settings.rally_flags
        else:
            flag = int(args[2])
            #currently only supporting autoland values:
            #True (nonzero) and False (zero)
            if (flag != 0):
                flag = 2

        if not self.have_list:
            print("Please list rally points first")
            return

        if (self.rallyloader.rally_count() > 4):
            print ("Only 5 rally points possible per flight plan.")
            return

        try:
            latlon = self.module('map').click_position
        except Exception:
            print("No map available")
            return
        if latlon is None:
            print("No map click position available")
            return

        land_hdg = 0.0

        self.rallyloader.create_and_append_rally_point(latlon[0] * 1e7, latlon[1] * 1e7, alt, break_alt, land_hdg, flag)
        self.send_rally_points()
        print("Added Rally point at %s %f %f, autoland: %s" % (str(latlon), alt, break_alt, bool(flag & 2)))
453744
def _query(action=None,
           command=None,
           args=None,
           method='GET',
           header_dict=None,
           data=None):
    '''
    
    '''
    token = _get_token()
    username = __opts__.get('rallydev', {}).get('username', None)
    password = __opts__.get('rallydev', {}).get('password', None)
    path = 'https://rally1.rallydev.com/slm/webservice/v2.0/'

    if action:
        path += action

    if command:
        path += '/{0}'.format(command)

    log.debug('RallyDev URL: %s', path)

    if not isinstance(args, dict):
        args = {}

    args['key'] = token

    if header_dict is None:
        header_dict = {'Content-type': 'application/json'}

    if method != 'POST':
        header_dict['Accept'] = 'application/json'

    decode = True
    if method == 'DELETE':
        decode = False

    return_content = None
    result = salt.utils.http.query(
        path,
        method,
        params=args,
        data=data,
        header_dict=header_dict,
        decode=decode,
        decode_type='json',
        text=True,
        status=True,
        username=username,
        password=password,
        cookies=True,
        persist_session=True,
        opts=__opts__,
    )
    log.debug('RallyDev Response Status Code: %s', result['status'])
    if 'error' in result:
        log.error(result['error'])
        return [result['status'], result['error']]

    return [result['status'], result.get('dict', {})]
90290
def register_commands(self):
        
        for command in self._entry_points[self.COMMANDS_ENTRY_POINT].values():
            command.load()
878188
function (win, fromPoint, toPoint, duration, callback) {
		if(syn.support.pointerEvents){
			createEventAtPoint("pointerover", fromPoint, win);
			createEventAtPoint("pointerenter", fromPoint, win);
		}
		createEventAtPoint("mouseover", fromPoint, win);
		createEventAtPoint("mouseenter", fromPoint, win);

		if(syn.support.pointerEvents){ createEventAtPoint("pointermove", fromPoint, win); }
		createEventAtPoint("mousemove", fromPoint, win);
		
		
		if(syn.support.pointerEvents){createEventAtPoint("pointerdown", fromPoint, win);}
		if(syn.support.touchEvents){createEventAtPoint("touchstart", fromPoint, win);}
		createEventAtPoint("mousedown", fromPoint, win);
		startMove(win, fromPoint, toPoint, duration, function () {
			if(syn.support.pointerEvents){createEventAtPoint("pointerup", toPoint, win);}
			if(syn.support.touchEvents){createEventAtPoint("touchend", toPoint, win);}
			createEventAtPoint("mouseup", toPoint, win);
			if(syn.support.pointerEvents){createEventAtPoint("pointerleave", toPoint, win);}
			createEventAtPoint("mouseleave", toPoint, win);
			callback();
		});
	}