Exemple #1
0
 public void deep_clone(pan_tilt_absolute_command rhs)
 {
     base.deep_clone(rhs);
     pan_tilt_speed = rhs.pan_tilt_speed;
     pan_pos = new pan_position(rhs.pan_pos);
     tilt_pos = new tilt_position(rhs.tilt_pos);
 }
Exemple #2
0
        public void absolute_pan_tilt(int speed, pan_position pan_angle, tilt_position tilt_angle)
        {
            if (!hardware_connected)  // No motion commands allowed now
                return;

            lock (command_buffer)
            {
                // Eliminate any pan/tilt command from the buffer
                for (int i = 0; i < command_buffer.Count; ++i)
                    if (command_buffer[i] is pan_tilt_absolute_command || command_buffer[i] is pan_tilt_cancel_command ||
                        command_buffer[i] is pan_tilt_jog_command || command_buffer[i] is pan_tilt_stop_jog_command)  // There's already a pan/tilt command that is awaiting dispatch
                        command_buffer.RemoveAt(i);

                command_buffer.Add(new pan_tilt_absolute_command(camera_num, speed, pan_angle, tilt_angle));  // Add it to the end of the buffer
            }
        }
Exemple #3
0
 public pan_tilt_absolute_command(int camera_number, int speed = 6, pan_position p = null, tilt_position t = null)
     : base(camera_number)
 {
     pan_tilt_speed = speed;
     if (p == null)
         pan_pos = new pan_position();
     else
         pan_pos = new pan_position(p);
     if (t == null)
         tilt_pos = new tilt_position();
     else
         tilt_pos = new tilt_position(t);
 }
Exemple #4
0
 public pan_tilt_absolute_command(pan_tilt_absolute_command rhs)
     : base(rhs)
 {
     pan_tilt_speed = rhs.pan_tilt_speed;
     pan_pos = new pan_position(rhs.pan_pos);
     tilt_pos = new tilt_position(rhs.tilt_pos);
 }
Exemple #5
0
 // The warning given here is a bug in the compiler.  It makes no sense to have "new" (or "override") for a static function.
 public static tilt_position create_from_radians(double r)
 {
     tilt_position p = new tilt_position();
     p.radians = r;
     return p;
 }
Exemple #6
0
 // The warning given here is a bug in the compiler.  It makes no sense to have "new" (or "override") for a static function.
 public static tilt_position create_from_encoder_count(short e)
 {
     tilt_position p = new tilt_position();
     p.encoder_count = e;
     return p;
 }
Exemple #7
0
 // The warning given here is a bug in the compiler.  It makes no sense to have "new" (or "override") for a static function.
 public static tilt_position create_from_degrees(double d)
 {
     tilt_position p = new tilt_position();
     p.degrees = d;
     return p;
 }
Exemple #8
0
 public tilt_position(tilt_position rhs)
     : base(rhs)
 {
 }
Exemple #9
0
 public readonly_tilt_position(tilt_position rhs)
 {
     pos.deep_clone(rhs);
 }