Esempio n. 1
0
 public Task3D(Task3D t)
 {
     throw new NotImplementedException();
 }
Esempio n. 2
0
        public Form3DTask(Task3D t)
        {
            InitializeComponent();
            comboBoxInputDevice.DataSource = Input3D.GetPossibleInputs();
            comboBoxEndButton.DataSource = ButtonEndCondition.ButtonText;
            comboBoxPerformanceMetric.DataSource = PerformanceMetrics.PerformanceMetricStrings;
            comboBoxShape.DataSource = new ShapeType[] { ShapeType.Cuboid, ShapeType.Ellipsoid };
            SpecifierLabel[] SpecifierLabels = new SpecifierLabel[]
            {
                SpecifierLabel.Static, SpecifierLabel.Dynamic,
                SpecifierLabel.Random
            };
            comboBoxPosX.BindingContext = new BindingContext();
            comboBoxPosX.DataSource = SpecifierLabels;
            comboBoxPosY.BindingContext = new BindingContext();
            comboBoxPosY.DataSource = SpecifierLabels;
            comboBoxPosZ.BindingContext = new BindingContext();
            comboBoxPosZ.DataSource = SpecifierLabels;
            comboBoxSizeX.BindingContext = new BindingContext();
            comboBoxSizeX.DataSource = SpecifierLabels;
            comboBoxSizeY.BindingContext = new BindingContext();
            comboBoxSizeY.DataSource = SpecifierLabels;
            comboBoxSizeZ.BindingContext = new BindingContext();
            comboBoxSizeZ.DataSource = SpecifierLabels;

            // Load Form from task data
            task = t;
            textBoxName.Text = task.Name;

            // Input loading
            comboBoxInputDevice.SelectedIndex = Input3D.GetInputIndex(task.primaryInput);
            additionalInputs = new List<InputDevice>();
            if (task.additionalInput != null)
                additionalInputs.AddRange(task.additionalInput);
            listBoxAdditionalInputs.DataSource = additionalInputs;

            // Performance Metric load
            comboBoxPerformanceMetric.SelectedIndex = (int)task.performanceMetric;

            //Region Loading
            if (t.regionEnabled)
            {
                groupBox1.Enabled = true;
                checkBoxEnableRegion.Checked = true;
            }
            else
            {
                groupBox1.Enabled = false;
                checkBoxEnableRegion.Checked = false;
            }

            if (t.region.Shape != ShapeType.NONE)
            {
                comboBoxPosX.SelectedItem = ((RegionParameter)t.region.rParams[regPT.X]).SL_pos;
                comboBoxPosY.SelectedItem = ((RegionParameter)t.region.rParams[regPT.Y]).SL_pos;
                comboBoxPosZ.SelectedItem = ((RegionParameter)t.region.rParams[regPT.Z]).SL_pos;
                comboBoxSizeX.SelectedItem = ((RegionParameter)t.region.rParams[regPT.X]).SL_size;
                comboBoxSizeY.SelectedItem = ((RegionParameter)t.region.rParams[regPT.Y]).SL_size;
                comboBoxSizeZ.SelectedItem = ((RegionParameter)t.region.rParams[regPT.Z]).SL_size;
                numericUpDownPosX1.Value = (decimal)((RegionParameter)t.region.rParams[regPT.X]).pos[0];
                numericUpDownPosX2.Value = (decimal)((RegionParameter)t.region.rParams[regPT.X]).pos[1];
                numericUpDownPosY1.Value = (decimal)((RegionParameter)t.region.rParams[regPT.Y]).pos[0];
                numericUpDownPosY2.Value = (decimal)((RegionParameter)t.region.rParams[regPT.Y]).pos[1];
                numericUpDownPosZ1.Value = (decimal)((RegionParameter)t.region.rParams[regPT.Y]).pos[0];
                numericUpDownPosZ2.Value = (decimal)((RegionParameter)t.region.rParams[regPT.Y]).pos[1];
                numericUpDownSizeX1.Value = (decimal)((RegionParameter)t.region.rParams[regPT.X]).size[0];
                numericUpDownSizeX2.Value = (decimal)((RegionParameter)t.region.rParams[regPT.X]).size[1];
                numericUpDownSizeY1.Value = (decimal)((RegionParameter)t.region.rParams[regPT.Y]).size[0];
                numericUpDownSizeY2.Value = (decimal)((RegionParameter)t.region.rParams[regPT.Y]).size[1];
                numericUpDownSizeZ1.Value = (decimal)((RegionParameter)t.region.rParams[regPT.Z]).size[0];
                numericUpDownSizeZ2.Value = (decimal)((RegionParameter)t.region.rParams[regPT.Z]).size[1];
            }

            // End Condition Loading
            if (task.endCondition.GetType() == typeof(ButtonEndCondition))
            {
                buttonEnd = (ButtonEndCondition)task.endCondition;
                timeEnd = new TimeLimitEndCondition();
                comboBoxEndCondition.SelectedIndex = 0;

            }
            else
            {
                buttonEnd = new ButtonEndCondition();
                timeEnd = (TimeLimitEndCondition)task.endCondition;
                comboBoxEndCondition.SelectedIndex = 1;
            }
            numericUpDownEndSeconds.Value = (decimal)timeEnd.TimeLimit;
            comboBoxEndButton.SelectedIndex = (int)buttonEnd.Button;
        }