コード例 #1
0
 public CoolerControl(Flowsheet flowsheet, Point location, Cooler cooler)
     :
     base(flowsheet, location, cooler)
 {
 }
コード例 #2
0
 public ElectrostaticPrecipitatorControl(Flowsheet flowsheet, Point location, ElectrostaticPrecipitator electrostaticPrecipitator)
     : base(flowsheet, location, electrostaticPrecipitator)
 {
 }
コード例 #3
0
 public void InitializeVariableTextBoxes(Flowsheet flowsheet, DryerScopingModel scoping)
 {
     this.textBoxGasVelocity.InitializeVariable(flowsheet.ApplicationPrefs, scoping.GasVelocity);
 }
コード例 #4
0
 public ElectrostaticPrecipitatorsEditor(Flowsheet flowsheet) : base(flowsheet)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
 }
コード例 #5
0
 public DryingStreamControl(Flowsheet flowsheet, Point location, DryingStream dryingStream)
     : base(flowsheet, location, dryingStream)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
 }
コード例 #6
0
 public BagFilterControl(Flowsheet flowsheet, Point location, BagFilter bagFilter) :
     base(flowsheet, location, bagFilter)
 {
     InitializeComponent();
 }
コード例 #7
0
 public ScrubberCondenserControl(Flowsheet flowsheet, Point location, ScrubberCondenser scrubberCondenser)
     :
     base(flowsheet, location, scrubberCondenser)
 {
 }
コード例 #8
0
 public AirFilterControl(Flowsheet flowsheet, Point location, AirFilter airFilter)
     : base(flowsheet, location, airFilter)
 {
     //InitializeComponent();
 }
コード例 #9
0
 public MixerControl(Flowsheet flowsheet, Point location, Mixer mixer)
     : base(flowsheet, location, mixer)
 {
 }
コード例 #10
0
 public GasStreamControl(Flowsheet flowsheet, Point location, DryingGasStream gasStream)
     : base(flowsheet, location, gasStream)
 {
     InitializeComponent();
 }
コード例 #11
0
 public GasStreamControl(Flowsheet flowsheet, Point location, DryingGasStream gasStream, StreamOrientation orientation)
     : base(flowsheet, location, gasStream, orientation)
 {
     InitializeComponent();
     this.Name = "Gas Stream: " + gasStream.Name;
 }
コード例 #12
0
 public EjectorControl(Flowsheet flowsheet, Point location, Ejector ejector)
     : base(flowsheet, location, ejector)
 {
 }
コード例 #13
0
 public ProcessStreamBaseControl(Flowsheet flowsheet, Point location, ProcessStreamBase processStreamBase) :
     base(flowsheet, location, processStreamBase)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
 }
コード例 #14
0
 public SensAnalysisView(IFlowsheet fs)
     : base()
 {
     flowsheet = (Flowsheet)fs;
     Init();
 }
コード例 #15
0
 public ValveControl(Flowsheet flowsheet, Point location, Valve valve)
     : base(flowsheet, location, valve)
 {
 }
コード例 #16
0
 public TeeControl(Flowsheet flowsheet, Point location, Tee tee)
     :
     base(flowsheet, location, tee)
 {
 }
コード例 #17
0
 private void InitializeTheUI(Flowsheet flowsheet, ParticleSizeFractionAndEfficiency sizeAndFraction)
 {
     this.textBoxDiameter.InitializeVariable(flowsheet.ApplicationPrefs, sizeAndFraction.Diameter);
     this.textBoxWeightFraction.InitializeVariable(flowsheet.ApplicationPrefs, sizeAndFraction.WeightFraction);
     this.textBoxEfficiency.InitializeVariable(flowsheet.ApplicationPrefs, sizeAndFraction.Efficiency);
 }
コード例 #18
0
 public DryerControl(Flowsheet flowsheet, Point location, Dryer dryer)
     : base(flowsheet, location, dryer)
 {
 }
コード例 #19
0
        void AddVariable(DWSIM.SharedClasses.Flowsheet.Optimization.OPTVariable newiv, StackLayout ivcontainer, List <string> objs)
        {
            Flowsheet fsheet = (Flowsheet)flowsheet;

            var su = flowsheet.FlowsheetOptions.SelectedUnitSystem;
            var nf = flowsheet.FlowsheetOptions.NumberFormat;

            List <string> proplist  = new List <string>();
            List <string> proplist2 = new List <string>();

            proplist.Add("");
            proplist2.Add("");

            var container = new DynamicLayout {
                Padding = new Padding(5), Width = 300
            };

            //container.BackgroundColor = Eto.Drawing.Colors.White;
            container.Tag = new Random().Next() + mycase.variables.Count + 1;

            var slcontainer = new StackLayoutItem(container);

            s.CreateAndAddLabelRow(container, "Optimization Variable #" + (ivcontainer.Items.Count + 1).ToString());

            var btnremove = s.CreateAndAddButtonRow(container, "Remove Variable", null, (arg1a, arg2a) =>
            {
                mycase.variables.Remove(newiv.id);
                ivcontainer.Items.Remove(slcontainer);
            });

            s.CreateAndAddLabelRow(container, "Definitions");

            s.CreateAndAddStringEditorRow(container, "Name", newiv.name, (arg3b, arg2b) =>
            {
                newiv.name = arg3b.Text;
            });

            s.CreateAndAddDropDownRow(container, "Type", new[] { "DEP", "IND", "AUX", "CON" }.ToList(), (int)newiv.type, (arg3, arg2) => { newiv.type = (DWSIM.SharedClasses.Flowsheet.Optimization.OPTVariableType)arg3.SelectedIndex; });

            DropDown spinprop = null;

            int idx = 0;

            if (flowsheet.SimulationObjects.ContainsKey(newiv.objectID))
            {
                idx = objs.IndexOf(flowsheet.SimulationObjects[newiv.objectID].GraphicObject.Tag);
            }

            s.CreateAndAddLabelRow(container, "Flowsheet Object Property Link");

            s.CreateAndAddDropDownRow(container, "Object", objs, idx, (arg3c, arg2c) =>
            {
                if (arg3c.SelectedIndex > 0)
                {
                    var obj        = flowsheet.GetFlowsheetSimulationObject(objs[arg3c.SelectedIndex]);
                    newiv.objectID = obj.Name;
                    if (newiv.type == DWSIM.SharedClasses.Flowsheet.Optimization.OPTVariableType.Independent)
                    {
                        proplist = obj.GetProperties(PropertyType.WR).ToList();
                    }
                    else
                    {
                        proplist = obj.GetProperties(PropertyType.ALL).ToList();
                    }
                    proplist.Insert(0, "");
                    proplist2 = proplist.Select(x => flowsheet.GetTranslatedString(x)).ToList();

                    spinprop.Items.Clear();
                    spinprop.Items.AddRange(proplist2.Select((x) => new ListItem {
                        Key = x, Text = x
                    }));
                }
            });

            int idx2 = 0;

            if (flowsheet.SimulationObjects.ContainsKey(newiv.objectID))
            {
                var obj = flowsheet.SimulationObjects[newiv.objectID];
                if (newiv.type == DWSIM.SharedClasses.Flowsheet.Optimization.OPTVariableType.Independent)
                {
                    proplist = obj.GetProperties(PropertyType.WR).ToList();
                }
                else
                {
                    proplist = obj.GetProperties(PropertyType.ALL).ToList();
                }
                proplist.Insert(0, "");
                proplist2 = proplist.Select(x => flowsheet.GetTranslatedString(x)).ToList();
                idx2      = proplist.IndexOf(newiv.propID);
            }

            TextBox tviv = null;

            spinprop = s.CreateAndAddDropDownRow(container, "Property", proplist2, idx2, (arg3c, arg2c) =>
            {
                if (spinprop.SelectedIndex > 0)
                {
                    newiv.propID       = proplist[arg3c.SelectedIndex];
                    newiv.unit         = fsheet.SimulationObjects[newiv.objectID].GetPropertyUnit(newiv.propID, su);
                    newiv.initialvalue = (double)fsheet.SimulationObjects[newiv.objectID].GetPropertyValue(newiv.propID, su);
                    tviv.Text          = newiv.initialvalue.ToString(nf);
                }
            });

            s.CreateAndAddLabelRow(container, "Variable Bounds");
            s.CreateAndAddDescriptionRow(container, "Bounds will be taken into account only if you use a bounded solver.");
            s.CreateAndAddTextBoxRow(container, nf, "Lower Bound", newiv.lowerlimit.GetValueOrDefault(), (arg3, arg2) => { newiv.lowerlimit = arg3.Text.ToDoubleFromCurrent(); });
            s.CreateAndAddTextBoxRow(container, nf, "Upper Bound", newiv.upperlimit.GetValueOrDefault(), (arg3, arg2) => { newiv.upperlimit = arg3.Text.ToDoubleFromCurrent(); });

            s.CreateAndAddLabelRow(container, "Initial Value");
            s.CreateAndAddDescriptionRow(container, "Set the initial value of the variable (IND only, other variable types will have their values read from the flowsheet).");
            tviv = s.CreateAndAddTextBoxRow(container, nf, "Initial Value", newiv.initialvalue, (arg3, arg2) => { newiv.initialvalue = arg3.Text.ToDoubleFromCurrent(); });

            ivcontainer.Items.Add(slcontainer);
        }
コード例 #20
0
        public HumidityChartForm(Flowsheet flowsheet, PsychrometricChartModel psychrometricChartModel)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.flowsheet  = flowsheet;
            this.unitSystem = UnitSystemService.GetInstance().CurrentUnitSystem;
            this.psychrometricChartModel = psychrometricChartModel;

            this.labelPressureName.InitializeVariable(this.psychrometricChartModel.Pressure);
            this.textBoxPressureValue.InitializeVariable(flowsheet, this.psychrometricChartModel.Pressure);

            this.hcCurrentStateEditor          = new HumidityChartCurrentStateEditor(this.flowsheet, psychrometricChartModel.StateStream);
            this.hcCurrentStateEditor.Location = new Point(0, 254);
            this.panel.Controls.Add(this.hcCurrentStateEditor);
            this.hcCurrentStateEditor.Visible = false;

            this.hcProcessEditor          = new HumidityChartProcessEditor(this.flowsheet, psychrometricChartModel.ProcessInputStream, psychrometricChartModel.ProcessOutputStream);
            this.hcProcessEditor.Location = new Point(0, 254);
            this.panel.Controls.Add(this.hcProcessEditor);
            this.hcProcessEditor.Visible = false;

            this.psychrometricChartModel.HumidityChartChanged += new HumidityChartChangedEventHandler(psychrometricChartModel_HumidityChartChanged);
            this.psychrometricChartModel.SolveComplete        += new SolveCompleteEventHandler(psychrometricChartModel_SolveComplete);

            UnitSystemService.GetInstance().CurrentUnitSystemChanged += new CurrentUnitSystemChangedEventHandler(HumidityChartForm_CurrentUnitSystemChanged);

            this.flowsheet.NumericFormatStringChanged += new NumericFormatStringChangedEventHandler(flowsheet_NumericFormatStringChanged);

            //
            this.currentStateCtrl                  = new StateControl(this.plotCtrl.Graph);
            this.currentStateCtrl.Visible          = false;
            this.currentStateCtrl.MouseDown       += new MouseEventHandler(currentStateCtrl_MouseDown);
            this.currentStateCtrl.LocationChanged += new EventHandler(currentStateCtrl_LocationChanged);
            this.currentStateCtrl.MouseUp         += new MouseEventHandler(currentStateCtrl_MouseUp);
            this.plotCtrl.Graph.Controls.Add(this.currentStateCtrl);

            this.inStateCtrl                  = new StateControl(this.plotCtrl.Graph);
            this.inStateCtrl.Visible          = false;
            this.inStateCtrl.MouseDown       += new MouseEventHandler(inStateCtrl_MouseDown);
            this.inStateCtrl.LocationChanged += new EventHandler(inStateCtrl_LocationChanged);
            this.inStateCtrl.MouseUp         += new MouseEventHandler(inStateCtrl_MouseUp);
            this.plotCtrl.Graph.Controls.Add(this.inStateCtrl);

            this.outStateCtrl                  = new StateControl(this.plotCtrl.Graph);
            this.outStateCtrl.Visible          = false;
            this.outStateCtrl.MouseDown       += new MouseEventHandler(outStateCtrl_MouseDown);
            this.outStateCtrl.LocationChanged += new EventHandler(outStateCtrl_LocationChanged);
            this.outStateCtrl.MouseUp         += new MouseEventHandler(outStateCtrl_MouseUp);
            this.plotCtrl.Graph.Controls.Add(this.outStateCtrl);

            this.plotCtrl.Graph.NumericFormatString = this.flowsheet.NumericFormatString;
            this.plotCtrl.InitializePlotControl(this);

            this.psychrometricChartModel.HCTypeChanged += new HCTypeChangedEventHandler(psychrometricChartModel_HCTypeChanged);
            if (this.psychrometricChartModel.HCType == HCType.ChartOnly)
            {
                this.radioButtonChartOnly.Checked = true;
            }
            else if (this.psychrometricChartModel.HCType == HCType.Process)
            {
                this.radioButtonProcess.Checked = true;
            }
            else if (this.psychrometricChartModel.HCType == HCType.State)
            {
                this.radioButtonState.Checked = true;
            }
        }
コード例 #21
0
 public OptimizerView(IFlowsheet fs)
     : base()
 {
     flowsheet = (Flowsheet)fs;
     Init();
 }
コード例 #22
0
 public Models(Flowsheet fs, DynamicLayout layout)
 {
     flowsheet = fs;
     container = layout;
     Initialize();
 }
コード例 #23
0
ファイル: Spreadsheet.cs プロジェクト: jmptrader/dwsim6
        public Spreadsheet(Flowsheet fs)
        {
            Columns.AddRange(new[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" });

            flowsheet = fs;
            scontrol  = new ReoGridFullControl(GlobalSettings.Settings.AutomationMode);
            Sheet     = scontrol.GridControl;
            SetCustomFunctions();
            flowsheet.GetSpreadsheetObjectFunc = () => { return(Sheet); };
            Sheet.CurrentWorksheet.Name        = "MAIN";

            if (scontrol.ImportDataMenuItem != null)
            {
                scontrol.ImportDataMenuItem.Click += (sender, e) =>
                {
                    Application.Instance.Invoke(() =>
                    {
                        var selector = new PropertySelector()
                        {
                            Flowsheet = flowsheet, ObjList = ObjList
                        };

                        selector.btnOK.Click += (sender2, e2) =>
                        {
                            var units = "";
                            if (selector.list4.SelectedValue != null)
                            {
                                units = selector.list4.SelectedValue.ToString();
                            }
                            Sheet.CurrentWorksheet.Cells[Sheet.CurrentWorksheet.SelectionRange.StartPos].Formula =
                                String.Format("GETPROPVAL({3}{1}{3}{0}{3}{2}{3}{0}{3}{4}{3})",
                                              ';',
                                              selector.list2.SelectedKey,
                                              selector.list3.SelectedKey,
                                              '"', units);

                            selector.Close();

                            Sheet.CurrentWorksheet.EndEdit(EndEditReason.Cancel);
                        };

                        selector.ShowModal();
                    });
                }
            }
            ;

            if (scontrol.ExportDataMenuItem != null)
            {
                scontrol.ExportDataMenuItem.Click += (sender, e) =>
                {
                    Application.Instance.Invoke(() =>
                    {
                        var selector = new PropertySelector()
                        {
                            Flowsheet = flowsheet, ObjList = ObjList
                        };

                        selector.btnOK.Click += (sender2, e2) =>
                        {
                            var units = "";
                            if (selector.list4.SelectedValue != null)
                            {
                                units = selector.list4.SelectedValue.ToString();
                            }
                            var scell     = Sheet.CurrentWorksheet.Cells[Sheet.CurrentWorksheet.SelectionRange.StartPos];
                            var currdata  = scell.Formula == null ? scell.Data : scell.Formula;
                            scell.Formula = String.Format("SETPROPVAL({3}{1}{3}{0}{3}{2}{3}{0}{3}{4}{3}{0}{3}{5}{3})",
                                                          ';',
                                                          selector.list2.SelectedKey,
                                                          selector.list3.SelectedKey,
                                                          '"',
                                                          currdata, units);

                            selector.Close();

                            Sheet.CurrentWorksheet.EndEdit(EndEditReason.Cancel);
                        };

                        selector.ShowModal();
                    });
                }
            }
            ;

            if (scontrol.CreateChartMenuItem != null)
            {
                scontrol.CreateChartMenuItem.Click += (sender, e) =>
                {
                    Application.Instance.Invoke(() =>
                    {
                        CreateChartFromRange(sender, e);
                    });
                }
            }
            ;
        }
コード例 #24
0
 public Compounds(IFlowsheet fs, TableLayout layout)
 {
     flowsheet = (Flowsheet)fs;
     container = layout;
     Initialize();
 }
コード例 #25
0
 public CompoundTools(Flowsheet fs) :
     base()
 {
     flowsheet = fs;
     Init();
 }
コード例 #26
0
 public void InitializeVariableTextBoxes(Flowsheet flowsheet, HXRatingModel rating)
 {
     this.textBoxWallThermalConductivity.InitializeVariable(flowsheet.ApplicationPrefs, rating.WallThermalConductivity);
     this.textBoxWallThickness.InitializeVariable(flowsheet.ApplicationPrefs, rating.WallThickness);
 }
コード例 #27
0
 public MaterialStreamControl(Flowsheet flowsheet, Point location, DryingMaterialStream materialStream)
     : this(flowsheet, location, materialStream, StreamOrientation.Right)
 {
 }
コード例 #28
0
 public CyclonesEditor(Flowsheet flowsheet) : base(flowsheet)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
 }
コード例 #29
0
ファイル: CompoundCreator.cs プロジェクト: up2038292/dwsim6
 public CompoundCreatorView(Flowsheet fs) :
     base()
 {
     flowsheet = fs;
     Init();
 }