Exemple #1
0
 protected ProcessVar(string name, VarState state, IProcessVarOwner owner)
     : base()
 {
     this.name  = name;
     this.state = state;
     this.owner = owner;
 }
Exemple #2
0
 protected ProcessVar(string name, PhysicalQuantity type, VarState state, IProcessVarOwner owner) : base()
 {
     this.name  = name;
     this.type  = type;
     this.state = state;
     this.owner = owner;
 }
Exemple #3
0
        public ProcVarsMoreThenOneOutOfRangeForm(INumericFormat iNumericFormat, IProcessVarOwner solvable, ErrorMessage error)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.solvable = solvable;
            this.Text     = error.Title;

            // display the message
            this.labelMessage.Text = error.Message;

            IEnumerator en = error.ProcessVarsAndValues.ProcessVarList.GetEnumerator();

            while (en.MoveNext())
            {
                ProcessVar pv                    = (ProcessVar)en.Current;
                object     minMaxVals            = error.ProcessVarsAndValues.GetVarRange(pv);
                MinMaxProcVarElementControl ctrl = new MinMaxProcVarElementControl(iNumericFormat, pv, minMaxVals);
                ctrl.Dock = DockStyle.Top;
                this.panelCenter.Controls.Add(ctrl);
                ctrl.BringToFront();
            }
        }
Exemple #4
0
 public DuhringLine(IProcessVarOwner owner, double concentratn, PointF startPoint, PointF endPoint)
 {
     concentration             = new ProcessVarDouble(StringConstants.MASS_CONCENTRATION, PhysicalQuantity.Unknown, concentratn, VarState.Specified, owner);
     startSolventBoilingPoint  = new ProcessVarDouble(StringConstants.SOLVENT_BOILING_POINT, PhysicalQuantity.Temperature, startPoint.X, VarState.Specified, owner);
     startSolutionBoilingPoint = new ProcessVarDouble(StringConstants.SOLUTION_BOILING_POINT, PhysicalQuantity.Temperature, startPoint.Y, VarState.Specified, owner);
     endSolventBoilingPoint    = new ProcessVarDouble(StringConstants.SOLVENT_BOILING_POINT, PhysicalQuantity.Temperature, endPoint.X, VarState.Specified, owner);
     endSolutionBoilingPoint   = new ProcessVarDouble(StringConstants.SOLUTION_BOILING_POINT, PhysicalQuantity.Temperature, endPoint.Y, VarState.Specified, owner);
 }
Exemple #5
0
 public DuhringLine(IProcessVarOwner owner)
 {
     concentration             = new ProcessVarDouble("DuhringLineConcentration", PhysicalQuantity.Unknown, VarState.Specified, owner);
     startSolventBoilingPoint  = new ProcessVarDouble(StringConstants.SOLVENT_BOILING_POINT, PhysicalQuantity.Temperature, VarState.Specified, owner);
     startSolutionBoilingPoint = new ProcessVarDouble(StringConstants.SOLUTION_BOILING_POINT, PhysicalQuantity.Temperature, VarState.Specified, owner);
     endSolventBoilingPoint    = new ProcessVarDouble(StringConstants.SOLVENT_BOILING_POINT, PhysicalQuantity.Temperature, VarState.Specified, owner);
     endSolutionBoilingPoint   = new ProcessVarDouble(StringConstants.SOLUTION_BOILING_POINT, PhysicalQuantity.Temperature, VarState.Specified, owner);
 }
Exemple #6
0
        public IProcessVarOwner GetSelectedProcessVarOwner()
        {
            IProcessVarOwner varOwner = null;

            if (this.listBoxSolvable.SelectedItems.Count == 1)
            {
                varOwner = this.listBoxSolvable.SelectedItem as IProcessVarOwner;
            }
            return(varOwner);
        }
Exemple #7
0
 public void SelectProcessVarOwner(IProcessVarOwner iProcVarOwner)
 {
     for (int i = 0; i < this.listBoxSolvable.Items.Count; i++)
     {
         IProcessVarOwner ipvOwner = (IProcessVarOwner)this.listBoxSolvable.Items[i];
         if (ipvOwner.Name.Equals(iProcVarOwner.Name))
         {
             this.listBoxSolvable.SelectedIndex = i;
             break;
         }
     }
 }
Exemple #8
0
 public void SelectProcessVariable(ProcessVar procVar)
 {
     for (int i = 0; i < this.listViewVariable.Items.Count; i++)
     {
         ListViewVariableItem lvvi = this.listViewVariable.Items[i] as ListViewVariableItem;
         if (lvvi.Variable.Equals(procVar))
         {
             IProcessVarOwner iProcVarOwner = procVar.Owner;
             this.SelectProcessVarOwner(iProcVarOwner);
             lvvi.Selected = true;
             break;
         }
     }
 }
Exemple #9
0
        public override void SetObjectData()
        {
            base.SetObjectData();
            int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionProcessVariable", typeof(int));

            if (persistedClassVersion == 1)
            {
                this.name    = (string)info.GetValue("Name", typeof(string));
                this.id      = (int)info.GetValue("ID", typeof(int));
                this.state   = (VarState)info.GetValue("State", typeof(VarState));
                this.type    = (PhysicalQuantity)info.GetValue("Type", typeof(PhysicalQuantity));
                this.enabled = (bool)info.GetValue("Enabled", typeof(bool));
                this.owner   = info.GetValue("Owner", typeof(IProcessVarOwner)) as IProcessVarOwner;
            }
        }
Exemple #10
0
 public ProcessVarInt(string name, PhysicalQuantity type, int varValue, VarState state, IProcessVarOwner owner)
     : base(name, type, state, owner)
 {
     this.varValue = varValue;
 }
Exemple #11
0
 public ProcessVarInt(string name, PhysicalQuantity type, VarState state, IProcessVarOwner owner)
     : base(name, type, state, owner)
 {
 }
Exemple #12
0
 public ProcessVarDouble(string name, VarState state, IProcessVarOwner owner)
     : base(name, state, owner)
 {
 }
Exemple #13
0
        public ProcVarsOnlyOneOutOfRangeForm(INumericFormat iNumericFormat, IProcessVarOwner solvable, ErrorMessage error)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Text     = error.Title;
            this.solvable = solvable;

            // display the message
            this.labelMessage.Text = error.Message;

            this.var = (ProcessVar)error.ProcessVarsAndValues.ProcessVarList[0];

            // dispaly the variable
            this.labelProcVarName.InitializeVariable(var);
            this.labelProcVarName.BorderStyle = BorderStyle.None;
            this.textBoxExistingValue.InitializeVariable(iNumericFormat, var);

            string averageValStr = "";
            object minMaxValues  = error.ProcessVarsAndValues.GetVarRange(var);

            // note: the min and max values are not converted to the current unit system,
            //       and they also needs formating
            if (var is ProcessVarDouble)
            {
                DoubleRange doubleRange = (DoubleRange)minMaxValues;

                double valMin  = doubleRange.MinValue;
                double val2Min = 0.0;
                val2Min = UnitSystemService.GetInstance().ConvertFromSIValue(var.Type, valMin);
                if (val2Min == Constants.NO_VALUE)
                {
                    this.textBoxMinValue.Text = "";
                }
                else
                {
                    this.textBoxMinValue.Text = val2Min.ToString(iNumericFormat.NumericFormatString);
                }

                double valMax  = doubleRange.MaxValue;
                double val2Max = 0.0;
                val2Max = UnitSystemService.GetInstance().ConvertFromSIValue(var.Type, valMax);
                if (val2Max == Constants.NO_VALUE)
                {
                    this.textBoxMaxValue.Text = "";
                }
                else
                {
                    this.textBoxMaxValue.Text = val2Max.ToString(iNumericFormat.NumericFormatString);
                }

                double averageVal = (val2Min + val2Max) / 2;
                averageValStr = averageVal.ToString(iNumericFormat.NumericFormatString);
            }
            else if (var is ProcessVarInt)
            {
                IntRange intRange = (IntRange)minMaxValues;

                int valMin = intRange.MinValue;
                if (valMin == Constants.NO_VALUE_INT)
                {
                    this.textBoxMinValue.Text = "";
                }
                else
                {
                    this.textBoxMinValue.Text = valMin.ToString(UI.DECIMAL);
                }

                int valMax = intRange.MaxValue;
                if (valMax == Constants.NO_VALUE_INT)
                {
                    this.textBoxMaxValue.Text = "";
                }
                else
                {
                    this.textBoxMaxValue.Text = valMax.ToString(UI.DECIMAL);
                }

                int averageVal = (int)((valMin + valMax) / 2);
                averageValStr = averageVal.ToString(iNumericFormat.NumericFormatString);
            }

            // as convenience, initialize the new value with the recommended value
            this.textBoxNewValue.Text = averageValStr;

            this.textBoxExistingValue.BackColor = Color.Gainsboro;
            this.textBoxMinValue.BackColor      = Color.Gainsboro;
            this.textBoxMaxValue.BackColor      = Color.Gainsboro;
        }
Exemple #14
0
 public ParticleSizeAndFraction(IProcessVarOwner owner)
 {
     diameter       = new ProcessVarDouble(StringConstants.DIAMETER, PhysicalQuantity.MicroLength, 2.0e-5, VarState.Specified, owner);
     weightFraction = new ProcessVarDouble(StringConstants.WEIGHT_FRACTION, PhysicalQuantity.Fraction, 1.0, VarState.Specified, owner);
 }