コード例 #1
0
        public MainWindow()
        {
            dbManager = new DBManager();

            //Create the component info control
            componentInfoControl = new componentInfoUserControl(this, dbManager);
            componentInfoControl.Location = new System.Drawing.Point(9, 428);

            //Create the component tree control
            treeControl = new componentTreeUserControl(this, componentInfoControl, dbManager);
            treeControl.Location = new System.Drawing.Point(9, 6);

            //Set the info panel to use the TreeUserControl being used by the Main Window
            componentInfoControl.setTreeControl(treeControl);

            //Create a default aircraft layout and add it to the middle panel
            aircraftControl = new SinglePropellerLayout(this, treeControl);
            aircraftControl.Location = new Point(10, 10);

            InitializeComponent();

            //Add controls to their appropriate containers
            splitContainer1.Panel1.Controls.Add(treeControl);
            splitContainer1.Panel1.Controls.Add(componentInfoControl);
            splitContainer1.Panel2.Controls.Add(aircraftControl);


        }
コード例 #2
0
        public componentTreeUserControl(MainWindow mainWindow, componentInfoUserControl infoControl, DBManager dbManager)
        {
            this.mainWindow = mainWindow;
            this.infoControl = infoControl;

            this.dbManager = dbManager;

            InitializeComponent();
            initializeComponentTree(); 
        }
コード例 #3
0
 public AddBatteryPanel(NewComponentWindow newComponentWindow, DBManager dbManager)
 {
     this.dbManager = dbManager;
     this.newComponentWindow = newComponentWindow;
     InitializeComponent();
     cellConfigurationComboItems = new List<string> { "1S", "2S", "3S", "4S", "5S", "6S", "7S", "8S" };
     cellComboBox.DataSource = cellConfigurationComboItems;
     Enabled = false;
     Visible = false;
 }
コード例 #4
0
        public AddPropellerPanel(NewComponentWindow newComponentWindow, DBManager dbManager)
        {
            this.dbManager = dbManager;
            this.newComponentWindow = newComponentWindow;

            bladeCountComboBoxItems = new List<int> { 2,3,4,5 };
            InitializeComponent();

            bladeCountComboBox.DataSource = bladeCountComboBoxItems;
        }
コード例 #5
0
        public AddMotorPanel(NewComponentWindow newComponentWindow, DBManager dbManager)
        {
            this.newComponentWindow = newComponentWindow;
            this.dbManager = dbManager;

            InitializeComponent();

            //Populate the combo boxes
            minCellComboBoxItems = new List<string> { "1S", "2S", "3S", "4S", "5S", "6S", "7S", "8S" };
            maxCellComboBoxItems = new List<string> { "1S", "2S", "3S", "4S", "5S", "6S", "7S", "8S" };

            minCellComboBox.DataSource = minCellComboBoxItems;
            maxCellComboBox.DataSource = maxCellComboBoxItems;
        }
コード例 #6
0
        public componentInfoUserControl(MainWindow mainWindow, DBManager dbManager)
        {
            this.dbManager = dbManager;
            this.mainWindow = mainWindow;    

            batteryPanel = new BatteryInfo(this, dbManager);
            motorPanel = new MotorInfo(this, dbManager);
            propellerPanel = new PropellerInfo(this, dbManager);

            batteryPanel.Location = new Point(10, 50);
            motorPanel.Location = new Point(10, 50);
            propellerPanel.Location = new Point(10, 50);

            InitializeComponent();

            Controls.Add(batteryPanel);
            Controls.Add(motorPanel);
            Controls.Add(propellerPanel);

            batteryPanel.deactivateControl();
        }
コード例 #7
0
        public NewComponentWindow(MainWindow mainWindow, DBManager dbManager)
        {
            this.mainWindow = mainWindow;
            this.dbManager = dbManager;

            //Enables the main window on close
            FormClosed += new FormClosedEventHandler(NewComponentWindow_FormClosed);

            //Component combo box choices
            componentComboItems = new List<string> { "Choose component type...", "Battery", "Motor", "Propeller" };

            InitializeComponent();

            //Populates the Choose Component combo box with choices
            componentComboBox.DataSource = componentComboItems;

            //Set up component user controls
            batteryPanel = new AddBatteryPanel(this, dbManager);
            motorPanel = new AddMotorPanel(this, dbManager);
            propellerPanel = new AddPropellerPanel(this, dbManager);

            batteryPanel.Location = new Point(12, 124);
            motorPanel.Location = new Point(12, 124);
            propellerPanel.Location = new Point(12, 124);


            Controls.Add(batteryPanel);
            Controls.Add(motorPanel);
            Controls.Add(propellerPanel);

            motorPanel.Visible = false;
            motorPanel.Enabled = false;

            propellerPanel.Visible = false;
            propellerPanel.Enabled = false;
            
        }
コード例 #8
0
 public BatteryInfo(componentInfoUserControl infoControl, DBManager dbManager) : base(infoControl, dbManager)
 {
     InitializeComponent();
 }
コード例 #9
0
 public PropellerInfo(componentInfoUserControl infoControl, DBManager dbManager) : base(infoControl, dbManager)
 {
     InitializeComponent();
 }
コード例 #10
0
 public InfoPanel(componentInfoUserControl infoControl, DBManager dbManager)
 {
     this.dbManager = dbManager;
     this.infoControl = infoControl;
     InitializeComponent();            
 }