Exemple #1
0
        public Flowsheet(FlowsheetSettings newFlowsheetSettings, FlowsheetPreferences flowsheetPrefs, ApplicationPreferences appPrefs)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.flowsheetPrefs = flowsheetPrefs;
            this.appPrefs       = appPrefs;

            DryingGas dg = DryingGasCatalog.Instance.GetDryingGas(newFlowsheetSettings.DryingGasName);

            if (dg == null)
            {
                //string message = "You need to set a drying gas in Materials / New Process Settings first!";
                //MessageBox.Show(message, "New Flowsheet Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                dg = DryingGasCatalog.Instance.GetDryingGas("Air");
            }

            DryingMaterial dm = DryingMaterialCatalog.Instance.GetDryingMaterial(newFlowsheetSettings.DryingMaterialName);

            if (dm == null)
            {
                string message = "You need to choose a drying material for the new flowsheet to be created first! (go to Materials / Set Default Flowsheet Settings)";
                MessageBox.Show(message, "New Flowsheet Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            this.evapAndDryingSystem = new EvaporationAndDryingSystem(UI.NEW_SYSTEM, dm, dg);

            this.connectionManager = new ConnectionManager(this);
            this.customEditor      = new ProsimoUI.CustomEditor.CustomEditor(this);

            Init();
        }
Exemple #2
0
        public DefaultFlowsheetSettingsForm(MainForm mainForm, FlowsheetSettings newProcessSettings)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.mainForm             = mainForm;
            this.newFlowsheetSettings = newProcessSettings;

            //this.dryingGasesControl.ListViewGases.MultiSelect = false;
            this.dryingMaterialsControl.ListViewMaterials.MultiSelect = false;

            //this.dryingGasesControl.SelectDryingGas(this.newProcessSettings.DryingGasName);
            this.dryingMaterialsControl.SelectDryingMaterial(this.newFlowsheetSettings.DryingMaterialName);

            string materialName           = this.newFlowsheetSettings.DryingMaterialName;
            DryingMaterialCatalog catalog = DryingMaterialCatalog.Instance;

            if (!catalog.IsInCatalog(materialName))
            {
                materialName = "Generic Drying Material";
            }
            string moistureName = catalog.GetDryingMaterial(materialName).Moisture.ToString();

            this.textBoxMoisture.Text = moistureName;
            //string gasName = DryingGasCatalog.Instance.GetDryingGasForMoisture(moistureName).ToString();
            //this.textBoxDryingGas.Text = gasName;
            InitializeDryingGasComboBox(moistureName);

            this.textBoxDryingMaterial.Text = materialName;
            this.ResizeEnd += new EventHandler(NewProcessSettingsForm_ResizeEnd);
        }
Exemple #3
0
        private static void SetDefaultPrefs(MainForm mainForm)
        {
            FlowsheetSettings newProcessSettings = new FlowsheetSettings();

            mainForm.NewProcessSettings = newProcessSettings;
            ApplicationPreferences appPrefs = new ApplicationPreferences();

            mainForm.ApplicationPrefs = appPrefs;
        }
Exemple #4
0
 //public UIPreferences(Point mainFormLocation, Size mainFormSize, FormWindowState mainFormWindowState, bool toolboxVisible, Point toolboxLocation) {
 public UIPreferences(MainForm mainForm)
 {
     this.mainFormLocation    = mainForm.Location;
     this.mainFormSize        = mainForm.Size;
     this.mainFormWindowState = mainForm.WindowState;
     this.toolboxVisible      = mainForm.ToolboxVisible;
     //this.toolboxLocation = toolboxLocation;
     this.newProcessSettings = mainForm.NewProcessSettings;
     this.appPrefs           = mainForm.ApplicationPrefs;
     this.flowsheetPrefs     = mainForm.FlowsheetPrefs;
 }
Exemple #5
0
        //public virtual void SetObjectData(SerializationInfo info, StreamingContext context) {
        public override void SetObjectData()
        {
            int persistedClassVersion = info.GetInt32("ClassPersistenceVersionUIPreferences");

            this.mainFormLocation    = (Point)info.GetValue("MainFormLocation", typeof(Point));
            this.mainFormSize        = (Size)info.GetValue("MainFormSize", typeof(Size));
            this.mainFormWindowState = (FormWindowState)info.GetValue("MainFormWindowState", typeof(FormWindowState));
            this.toolboxVisible      = info.GetBoolean("ToolboxVisible");
            //this.ToolboxLocation = (Point)info.GetValue("ToolboxLocation", typeof(Point));
            this.appPrefs           = (ApplicationPreferences)RecallStorableObject("ApplicationPreferences", typeof(ApplicationPreferences));
            this.newProcessSettings = (FlowsheetSettings)RecallStorableObject("NewProcessSettings", typeof(FlowsheetSettings));
            this.flowsheetPrefs     = (FlowsheetPreferences)RecallStorableObject("FlowsheetPreferences", typeof(FlowsheetPreferences));
        }
Exemple #6
0
        public DefaultFlowsheetSettingsForm(MainForm mainForm, FlowsheetSettings newProcessSettings)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.mainForm             = mainForm;
            this.newFlowsheetSettings = newProcessSettings;

            this.dryingMaterialsControl              = new ProsimoUI.MaterialsUI.DryingMaterialsControl();
            this.dryingMaterialsControl.Anchor       = System.Windows.Forms.AnchorStyles.Left;
            this.dryingMaterialsControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.dryingMaterialsControl.Location     = new System.Drawing.Point(2, 34);
            this.dryingMaterialsControl.Name         = "dryingMaterialsControl";
            this.dryingMaterialsControl.Size         = new System.Drawing.Size(456, 349);
            this.dryingMaterialsControl.TabIndex     = 0;
            this.groupBoxSelectDryingMaterial.Controls.Add(this.dryingMaterialsControl);

            this.dryingMaterialsControl.Initialization();
            this.dryingMaterialsControl.ListViewMaterials.MultiSelect = false;
            this.dryingMaterialsControl.SelectDryingMaterial(this.newFlowsheetSettings.DryingMaterialName);

            this.comboBoxDryingFuel.Items.AddRange(FossilFuelCatalog.Instance.GetFossilFuelArray());
            this.comboBoxDryingFuel.SelectedIndex = 0;

            string materialName           = this.newFlowsheetSettings.DryingMaterialName;
            DryingMaterialCatalog catalog = DryingMaterialCatalog.Instance;

            if (!catalog.IsInCatalog(materialName))
            {
                materialName = DryingMaterial.GENERIC_DRYING_MATERIAL;
            }
            string moistureName = catalog.GetDryingMaterial(materialName).Moisture.ToString();

            this.textBoxMoisture.Text = moistureName;
            //string gasName = DryingGasCatalog.Instance.GetDryingGasForMoisture(moistureName).ToString();
            //this.textBoxDryingGas.Text = gasName;
            InitializeDryingGasComboBox(moistureName);
            InitializeDryingFuelComboBox(this.newFlowsheetSettings.FossilFuelName);

            this.textBoxDryingMaterial.Text = materialName;
            this.ResizeEnd += new EventHandler(NewProcessSettingsForm_ResizeEnd);
        }