Esempio n. 1
0
 public FormForVariableDef(cClassForVariable thisVariable)
 {
     InitializeComponent();
     this.thisVariable = thisVariable;
     this.radioButtonConstant.Checked = thisVariable.IsConstant;
     this.radioButtonVariable.Checked = !thisVariable.IsConstant;
     this.checkBoxRandom.Checked = thisVariable.IsVariableRandom;
     this.checkBoxProportionalToCol.Checked = thisVariable.IsVariableAlongColumns;
     this.checkBoxProportionalToRow.Checked = thisVariable.IsVariableAlongRows;
     this.numericUpDownIncrement.Value = (decimal)thisVariable.Increment;
 }
        public FormForInfoSingleCellPopInit_Simulator(cPoint3D WorldDim, cListVariables ListVariablesInput, FormForSimuGenerator Parent, cListAgents CellPopulation)
        {
            InitializeComponent();

            if (CellPopulation == null)
            {
                this.comboBoxCellType.Text = "Regular";
                this.ListVariables = ListVariablesInput;
                this.textBoxName.Text = "Population_" + Parent.MyPanelForParamCellPopulations.listViewForCellPopulations.Items.Count;
            }
            else
            {
                this.comboBoxCellType.Text = CellPopulation[0].Type.Name;
                this.textBoxName.Text = CellPopulation.Name;
                ListVariables = CellPopulation.AssociatedVariables;
            }

            this.WorldDim = WorldDim;
            this.Parent = Parent;

            this.v_CellNumber = ListVariables.FindVariable("v_CellNumber");
            this.v_InitPosX = ListVariables.FindVariable("v_InitPosX");
            this.v_InitPosY = ListVariables.FindVariable("v_InitPosY");
            this.v_InitPosZ = ListVariables.FindVariable("v_InitPosZ");
            this.v_InitPosType = ListVariables.FindVariable("v_InitPosType");
            this.v_InitVolType = ListVariables.FindVariable("v_InitVolType");
            this.v_InitVol = ListVariables.FindVariable("v_InitVol");

            if (v_InitVolType.Cst_Value == 0)
            {
                this.radioButtonVolumeRandom.Checked = false;
                this.radioButtonVolumeFixed.Checked = true;
            }
            else if (v_InitVolType.Cst_Value == 10)
            {
                this.radioButtonVolumeRandom.Checked = true;
                this.radioButtonVolumeFixed.Checked = false;
            }

            if (v_InitPosType.Cst_Value == 0)
            {
                this.radioButtonPosWorldCenter.Checked = true;
                this.radioButtonPosRandom.Checked = false;
                this.radioButtonPosManual.Checked = false;
            }
            else if (v_InitPosType.Cst_Value == 1)
            {
                this.radioButtonPosWorldCenter.Checked = false;
                this.radioButtonPosRandom.Checked = true;
                this.radioButtonPosManual.Checked = false;
            }
            else
            {
                this.radioButtonPosWorldCenter.Checked = false;
                this.radioButtonPosRandom.Checked = false;
                this.radioButtonPosManual.Checked = true;
            }

            this.numericUpDownInitialCellNumber.Value = (decimal)v_CellNumber.Cst_Value;
            this.numericUpDownManualX.Value = (decimal)v_InitPosX.Cst_Value;
            this.numericUpDownManualY.Value = (decimal)v_InitPosY.Cst_Value;
            this.numericUpDownManualZ.Value = (decimal)v_InitPosZ.Cst_Value;
            this.numericUpDownInitialVolumeManual.Value = (decimal)v_InitVol.Cst_Value;

            if (v_InitVol.IsConstant)
            {
                this.radioButtonVolumeFixed.Checked = true;
                this.radioButtonVolumeRandom.Checked = false;
            }
            else
            {
                this.radioButtonVolumeFixed.Checked = false;
                this.radioButtonVolumeRandom.Checked = true;
            }

            this.comboBoxCellType.Items.Clear();

            foreach (cCellType item in Parent.ListCellTypes)
                this.comboBoxCellType.Items.Add(item.Name);
        }
        private void UpdateVar(cClassForVariable Var, Label CurrentLabel)
        {
            FormForVariableDef WindowForVarDef = new FormForVariableDef(Var);
            if (WindowForVarDef.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
            Var = WindowForVarDef.thisVariable;

            if (CurrentLabel != null)
            {
                if (Var.IsConstant == false) CurrentLabel.ForeColor = Color.Firebrick;
                else CurrentLabel.ForeColor = Color.Black;
            }
        }