set total axes movement speed in mm/second
326367
def set_speed(self, value):
        ''' '''
        self._combined_speed = float(value)
        speed_per_min = int(self._combined_speed * SEC_PER_MIN)
        command = GCODES['SET_SPEED'] + str(speed_per_min)
        log.debug("set_speed: {}".format(command))
        self._send_command(command)
699013
def ToMilliseconds(self):
    """"""
    millis = _RoundTowardZero(self.nanos, _NANOS_PER_MILLISECOND)
    return self.seconds * _MILLIS_PER_SECOND + millis
956275
def activate_axes(self, axes):
        '''
        
        '''
        axes = ''.join(set(axes) & set(AXES) - set(DISABLE_AXES))
        active_currents = {
            ax: self._active_current_settings['now'][ax]
            for ax in axes
            if self._active_axes[ax] is False
        }
        if active_currents:
            self._save_current(active_currents, axes_active=True)
697355
def get_movement_delta(self):
        """"""
        pos = self.pan - self.previous_pos
        self.previous_pos = Vector2(self.pan.X, self.pan.Y)
        return pos
305462
def set_xticks(start, step, axes="gca"):
    
    if axes=="gca": axes = _pylab.gca()

    # first get one of the tick label locations
    yposition = axes.xaxis.get_ticklabels()[0].get_position()[1]

    # get the bounds
    xmin, xmax = axes.get_xlim()

    # get the starting tick
    nstart = int(_pylab.floor((xmin-start)/step))
    nstop  = int(_pylab.ceil((xmax-start)/step))
    ticks = []
    for n in range(nstart,nstop+1): ticks.append(start+n*step)

    axes.set_xticks(ticks)

    # set the y-position
    for t in axes.xaxis.get_ticklabels():
        x, y = t.get_position()
        t.set_position((x, yposition))

    _pylab.draw()
1322740
function updateTimeProgression(curve, x, y) {
        var percentX = Math.round(100 * x / WIDTH_MAIN),
            percentY = Math.round(100 * ((HEIGHT_MAIN - y) / HEIGHT_MAIN));

        // Constrain horizontal percentage to [0, 100] range
        percentX = Math.min(Math.max(0, percentX), 100);

        curve.parentNode.setAttribute("data-time", percentX);
        curve.parentNode.setAttribute("data-progression", percentY);
    }
371991
def move_position(self, dx, dy, speed=None):
        ''' '''
        if speed:
            self._intf.write('MoveChuckPosition %1.1f %1.1f R Y %d' % (dx, dy, speed))
        else:
            self._intf.write('MoveChuckPosition %1.1f %1.1f R Y' % (dx, dy))
58911
def _time_marker_move(self, event):
        """"""
        limit = self.pixel_width
        x = self._canvas_ticks.canvasx(event.x)
        x = min(max(x, 0), limit)
        _, y = self._canvas_ticks.coords(self._time_marker_image)
        self._canvas_ticks.coords(self._time_marker_image, x, y)
        self._timeline.coords(self._time_marker_line, x, 0, x, self._timeline.winfo_height())
        self._time_show()
942385
function (vel) {
            var fx = this.friction.x * me.timer.tick,
                nx = vel.x + fx,
                x = vel.x - fx,
                fy = this.friction.y * me.timer.tick,
                ny = vel.y + fy,
                y = vel.y - fy;

            vel.x = (
                (nx < 0) ? nx :
                ( x > 0) ? x  : 0
            );
            vel.y = (
                (ny < 0) ? ny :
                ( y > 0) ? y  : 0
            );
        }
546964
def on_timer(self, event):
        

        # Set relative speed and acceleration
        rel_speed = event.dt
        rel_acc = 0.1

        # Get what's forward
        pf, pr, pl, pu = self._get_directions()

        # Increase speed through acceleration
        # Note that self._speed is relative. We can balance rel_acc and
        # rel_speed to get a nice smooth or direct control
        self._speed += self._acc * rel_acc

        # Reduce speed. Simulate resistance. Using brakes slows down faster.
        # Note that the way that we reduce speed, allows for higher
        # speeds if keys ar bound to higher acc values (i.e. turbo)
        reduce = np.array([0.05, 0.05, 0.05, 0.1, 0.1, 0.1])
        reduce[self._brake > 0] = 0.2
        self._speed -= self._speed * reduce
        if np.abs(self._speed).max() < 0.05:
            self._speed *= 0.0

        # --- Determine new position from translation speed

        if self._speed[:3].any():

            # Create speed vectors, use scale_factor as a reference
            dv = np.array([1.0/d for d in self._flip_factors])
            #
            vf = pf * dv * rel_speed * self._scale_factor
            vr = pr * dv * rel_speed * self._scale_factor
            vu = pu * dv * rel_speed * self._scale_factor
            direction = vf, vr, vu

            # Set position
            center_loc = np.array(self._center, dtype='float32')
            center_loc += (self._speed[0] * direction[0] +
                           self._speed[1] * direction[1] +
                           self._speed[2] * direction[2])
            self._center = tuple(center_loc)

        # --- Determine new orientation from rotation speed

        roll_angle = 0

        # Calculate manual roll (from speed)
        if self._speed[3:].any():
            angleGain = np.array([1.0, 1.5, 1.0]) * 3 * math.pi / 180
            angles = self._speed[3:] * angleGain

            q1 = Quaternion.create_from_axis_angle(angles[0], -1, 0, 0)
            q2 = Quaternion.create_from_axis_angle(angles[1], 0, 1, 0)
            q3 = Quaternion.create_from_axis_angle(angles[2], 0, 0, -1)
            q = q1 * q2 * q3
            self._rotation1 = (q * self._rotation1).normalize()

        # Calculate auto-roll
        if self.auto_roll:
            up = {'x': (1, 0, 0), 'y': (0, 1, 0), 'z': (0, 0, 1)}[self.up[1]]
            up = np.array(up) * {'+': +1, '-': -1}[self.up[0]]

            def angle(p1, p2):
                return np.arccos(p1.dot(p2))
            #au = angle(pu, (0, 0, 1))
            ar = angle(pr, up)
            al = angle(pl, up)
            af = angle(pf, up)
            # Roll angle that's off from being leveled (in unit strength)
            roll_angle = math.sin(0.5*(al - ar))
            # Correct for pitch
            roll_angle *= abs(math.sin(af))  # abs(math.sin(au))
            if abs(roll_angle) < 0.05:
                roll_angle = 0
            if roll_angle:
                # Correct to soften the force at 90 degree angle
                roll_angle = np.sign(roll_angle) * np.abs(roll_angle)**0.5
                # Get correction for this iteration and apply
                angle_correction = 1.0 * roll_angle * math.pi / 180
                q = Quaternion.create_from_axis_angle(angle_correction,
                                                      0, 0, 1)
                self._rotation1 = (q * self._rotation1).normalize()

        # Update
        if self._speed.any() or roll_angle or self._update_from_mouse:
            self._update_from_mouse = False
            self.view_changed()
1085416
def on_for_seconds(self, steering, speed, seconds, brake=True, block=True):
        
        (left_speed, right_speed) = self.get_speed_steering(steering, speed)
        MoveTank.on_for_seconds(self, SpeedNativeUnits(left_speed), SpeedNativeUnits(right_speed), seconds, brake, block)
261728
def ToMicroseconds(self):
    """"""
    micros = _RoundTowardZero(self.nanos, _NANOS_PER_MICROSECOND)
    return self.seconds * _MICROS_PER_SECOND + micros
407957
def on_for_seconds(self, left_speed, right_speed, seconds, brake=True, block=True):
        

        if seconds < 0:
            raise ValueError("seconds is negative ({})".format(seconds))

        (left_speed_native_units, right_speed_native_units) = self._unpack_speeds_to_native_units(left_speed, right_speed)

        # Set all parameters
        self.left_motor.speed_sp = int(round(left_speed_native_units))
        self.left_motor.time_sp = int(seconds * 1000)
        self.left_motor._set_brake(brake)
        self.right_motor.speed_sp = int(round(right_speed_native_units))
        self.right_motor.time_sp = int(seconds * 1000)
        self.right_motor._set_brake(brake)

        log.debug("%s: on_for_seconds %ss at left-speed %s, right-speed %s" %
            (self, seconds, left_speed, right_speed))

        # Start the motors
        self.left_motor.run_timed()
        self.right_motor.run_timed()

        if block:
            self._block()
751110
def movement(self):
        
        if abs(self.lonspeed) < 0.0003:
            return const.STATIONARY
        elif self.lonspeed > 0:
            return const.DIRECT
        else:
            return const.RETROGRADE
642589
function(time, x, y) {
		if(time - _gestureCheckSpeedTime > 50) {
			var o = _posPoints.length > 2 ? _posPoints.shift() : {};
			o.x = x;
			o.y = y; 
			_posPoints.push(o);
			_gestureCheckSpeedTime = time;
		}
	}
627855
def timing(self, stat, delta, rate=1):
        """"""
        return self.send(stat, "%d|ms" % delta, rate)
305145
def ship_move(ship, x, y, speed):
    """"""
    click.echo('Moving ship %s to %s,%s with speed %s' % (ship, x, y, speed))