コード例 #1
0
ファイル: visca.cs プロジェクト: faizulhaque/VISCA-Control
        // Constructors
        public EVI_D70()
        {
            // Initialize internal variables
            port = new SerialPort();
            hardware_connected = false;
            thread_control = new CancellationTokenSource();
            initilization_error = false;
            serial_channel_open = new ManualResetEventSlim(true);
            socket_available = new ManualResetEventSlim(true);
            command_buffer = new ObservableCollection<command>();
            emergency_stop_turnstyle = new ManualResetEventSlim(false);
            _pan = new angular_position();
            _tilt = new angular_position();
            _zoom = new zoom_position();
            pan_tilt_status = DRIVE_STATUS.FULL_STOP;
            zoom_status = DRIVE_STATUS.FULL_STOP;
            last_inquiry_was_pan_tilt = false;
            num_cmds_since_inquiry = 0;
            command_buffer.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(command_buffer_changed_event_handler);
            command_buffer_populated = new ManualResetEventSlim(false);
            failed_command = null;
            last_successful_pan_tilt_cmd = null;
            last_successful_zoom_cmd = null;
            socket_one_cmd = null;
            socket_two_cmd = null;

            // Trace listener
            trace_msgs = new internal_trace_listener();
            Trace.Listeners.Add(trace_msgs);
            position_data_error += new CameraHardwareErrorEventHandler(print_trace_log);
            serial_port_error += new CameraHardwareErrorEventHandler(print_trace_log);
            command_error += new CameraHardwareErrorEventHandler(print_trace_log);

            // Threads
            inquiry_after_stop_thread = new Thread(new ThreadStart(inquiry_after_stop));
            pan_tilt_inquiry_after_stop = false;
            zoom_inquiry_after_stop = false;
            after_stop = new ManualResetEventSlim(false);
            pan_tilt_inquiry_complete = new ManualResetEventSlim(false);
            zoom_inquiry_complete = new ManualResetEventSlim(false);
            dispatch_thread = new Thread(new ThreadStart(dispatch));
            receive_thread = new Thread(new ThreadStart(receive));

            // PID
            pid_thread = new Thread(new ThreadStart(pid));
            pid_turnstyle = new ManualResetEventSlim(false);
            pid_data_turnstyle = new ManualResetEventSlim(true);
            pid_pan_tilt_speed = (new pan_tilt_jog_command(1)).pan_tilt_speed;
            pid_zoom_speed = (new zoom_jog_command(1)).zoom_speed;
            _pan.position_changed += new EventHandler<EventArgs>(pid_data_changed);
            _tilt.position_changed += new EventHandler<EventArgs>(pid_data_changed);
            _zoom.position_changed += new EventHandler<EventArgs>(pid_data_changed);
            _pid_target_pan_position.position_changed += new EventHandler<EventArgs>(pid_data_changed);
            _pid_target_tilt_position.position_changed += new EventHandler<EventArgs>(pid_data_changed);
            _pid_target_zoom_position.position_changed += new EventHandler<EventArgs>(pid_data_changed);
        }
コード例 #2
0
ファイル: visca.cs プロジェクト: faizulhaque/VISCA-Control
 public readonly_angular_position(angular_position rhs)
 {
     pos.deep_clone(rhs);
 }
コード例 #3
0
ファイル: visca.cs プロジェクト: faizulhaque/VISCA-Control
 public virtual void deep_clone(angular_position rhs)
 {
     encoder_count = rhs.encoder_count;
     radians = rhs.radians;
 }
コード例 #4
0
ファイル: visca.cs プロジェクト: faizulhaque/VISCA-Control
 public static angular_position create_from_radians(double r)
 {
     angular_position p = new angular_position();
     p.radians = r;
     return p;
 }
コード例 #5
0
ファイル: visca.cs プロジェクト: faizulhaque/VISCA-Control
 public static angular_position create_from_encoder_count(short e)
 {
     angular_position p = new angular_position();
     p.encoder_count = e;
     return p;
 }
コード例 #6
0
ファイル: visca.cs プロジェクト: faizulhaque/VISCA-Control
 public static angular_position create_from_degrees(double d)
 {
     angular_position p = new angular_position();
     p.degrees = d;
     return p;
 }
コード例 #7
0
ファイル: visca.cs プロジェクト: faizulhaque/VISCA-Control
 public angular_position(angular_position rhs)
 {
     encoder_count = rhs.encoder_count;
     radians = rhs.radians;
 }