Example #1
0
        public MainPanel(string mw_SerialPort,string rx_SerialPort)
        {
            InitializeComponent();
            if (!String.IsNullOrEmpty(rx_SerialPort))
            {
                rx_profiler = new Profiler(this, init_display_rx, update_display_rx);
                RC_driver = new serial_driver(rx_SerialPort, this, rx_profiler, stream_source.RC_transmitter);
                rx_status.Text = "Open";
            }
            else
            {
                rx_status.Text = "Not Available";
            }
            System.Threading.Thread.Sleep(1000);
            if (!String.IsNullOrEmpty(mw_SerialPort))
            {
                mw_profiler = new Profiler(this, init_display_mw, update_display_mw);
                hardware_driver = new serial_driver(mw_SerialPort, this, mw_profiler, stream_source.flight_controller);
                mw_commander = new commander();
                lblStrip_mw_status.Text = "Open";
            }
            else
            {
                lblStrip_mw_status.Text = "Not Available";
            }
            msg_ctrl_main = new msg_ctrl(hardware_driver.SerialParser, stream_source.flight_controller);
            msg_ctrl_main.DebugTextReceived += new msg_ctrl.DebugTextReceivedHandler(this.OnDebugTextReceived);
            mw_profiler.AttachProbeReceivedEvent();
            display_adapter_main = new dispaly_adapter(this,mw_profiler, attitudeIndicatorInstrument, rollRateInstrument);
            display.Smoothing = System.Drawing.Drawing2D.SmoothingMode.None;
            display.Refresh();
            //int tmp = Thread.CurrentThread.ManagedThreadId;
            display.PlaySpeed = 0.05f;
            session_organizer_main = new session_organizer(treeView_mrft, hardware_driver, mw_commander, msg_ctrl_main);
            flight_scenario_main = new flight_scenario(0, session_organizer_main, listViewFlightScenario, lbl_status_txt,lblStrip_mw_status,lst_flight_history, this);
            //TODO: Optimize this
            session_display_manager_main = new session_display_manager(barBeta, barAmp, barBias,txt_mrft_session_cmnt,
                txt_point_comment,txt_num_mrft_bags, chart_mrft,chart_mrft_session, tabControlTune,combo_tune_method,combo_model_type,
                combo_pid_optim, listViewMRFTPoints,barProp,barIntegral, barDerivative,barWindup,chk_en_pv_derive,
                chk_get_bias, txt_pid_comment,combo_cmd_type,combo_ref_src,txt_beta_val,txt_amp_val,txt_bias_val,
                session_organizer_main);
            DisplayUpdateTimer = new Timer();
            DisplayUpdateTimer.Interval = 100;
            DisplayUpdateTimer.Start();
            DisplayUpdateTimer.Tick += new EventHandler(OnDisplayRefreshTimerTick);

        }
Example #2
0
 //Constructor:
 public ReferenceSource(int id_para, session_organizer organizer_para,
     commander.reference_source reference_source_para = commander.reference_source.user_input)
 {
     _organizer = organizer_para;
     _reference_source = (int)reference_source_para;
     ID = id_para;
     Node.Name = "Reference_Source_element_" + ID;
     Node.Text = "Reference_Source_element_" + ID;
     Node.Tag = "Reference_Source_element";
 }
Example #3
0
 public pid_element(int id_para,session_organizer organizer_para)
 {
     _organizer = organizer_para;
     ID = id_para;
     Node.Name = "PID_element_" + ID;
     Node.Text = "PID_element_" + ID;
     Node.Tag = "PID_element";
 }
Example #4
0
 //Constructors:
 public mrft_element(int id_para,session_organizer organizer_para)
 {
     _organizer = organizer_para;
     TimeOutWatch = new Timer();
     TimeOutWatch.Tick += OnTimeOut;
     ID = id_para;
     Node.Name = "MRFT_element_" + ID;
     Node.Text = "MRFT_element_" + ID;
     Node.Tag = "MRFT_element";
 }
Example #5
0
 //Constructor:
 public CommandElement(int id_para, session_organizer organizer_para,
     commander.cmd_type cmd_type_para = commander.cmd_type.arm)
 {
     _organizer = organizer_para;
     _cmd_type = cmd_type_para;
     ID = id_para;
     Node.Name = "Command_element_" + ID;
     Node.Text = "Command_element_" + ID;
     Node.Tag = "Command_element";
 }