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 Flowsheet(NewSystemPreferences newSystemPrefs, EvaporationAndDryingSystem system)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.newSystemPrefs = newSystemPrefs;
            UnitSystemCatalog catalog = UnitSystemService.GetInstance().GetUnitSystemCatalog();
            UnitSystem        us      = catalog.Get("SI-2");

            UnitSystemService.GetInstance().CurrentUnitSystem = us;
            this.currentUnitSystemName = us.Name;

            this.MultipleSelection = false;
            this.Activity          = FlowsheetActivity.Default;

            if (system == null)
            {
                DryingGas dg = DryingGasCatalog.GetInstance().GetDryingGas(newSystemPrefs.DryingGasName);
                if (dg == null)
                {
                    dg = DryingGasCatalog.GetInstance().GetDryingGas("Air");
                }

                DryingMaterial dm = DryingMaterialCatalog.GetInstance().GetDryingMaterial(newSystemPrefs.DryingMaterialName);
                if (dm == null)
                {
                    dm = DryingMaterialCatalog.GetInstance().GetDryingMaterial("Generic Material");
                }

                this.evapAndDryingSystem = new EvaporationAndDryingSystem("New System", dm, dg);
            }
            else
            {
                this.evapAndDryingSystem = system;
            }

            this.evapAndDryingSystem.SystemChanged      += new SystemChangedEventHandler(evapAndDryingSystem_SystemChanged);
            this.evapAndDryingSystem.CalculationStarted += new CalculationStartedEventHandler(evapAndDryingSystem_CalculationStarted);
            this.evapAndDryingSystem.CalculationEnded   += new CalculationEndedEventHandler(evapAndDryingSystem_CalculationEnded);

            this.connectionManager = new ConnectionManager(this);
            this.customEditor      = new ProsimoUI.CustomEditor.CustomEditor(this);
            this.streamManager     = new StreamManager(this);
            this.unitOpManager     = new UnitOpManager(this);
            UI ui = new UI();

            this.BackColor     = ui.FLOWSHEET_COLOR;
            this.NumericFormat = NumericFormat.FixedPoint;
            this.DecimalPlaces = "3";
            this.Version       = new FlowsheetVersion();

            this.KeyDown += new KeyEventHandler(Flowsheet_KeyDown);
            this.KeyUp   += new KeyEventHandler(Flowsheet_KeyUp);
            UnitSystemService.GetInstance().CurrentUnitSystemChanged += new CurrentUnitSystemChangedEventHandler(Flowsheet_CurrentUnitSystemChanged);
            this.IsDirty = false;
        }
Exemple #3
0
      public FlowsheetSettingsForm(DryingGas dryingGas, DryingMaterial dryingMaterial)
      {
          //
          // Required for Windows Form Designer support
          //
          InitializeComponent();

          string moistureName = dryingMaterial.Moisture.ToString();
          this.textBoxMoisture.Text = moistureName;
          this.textBoxDryingGas.Text = dryingGas.Name;
          this.textBoxDryingMaterial.Text = dryingMaterial.Name;
      }
Exemple #4
0
        public DryingGas GetSelectedDryingGas()
        {
            DryingGas dg = null;

            if (this.listViewGases.SelectedItems.Count > 0)
            {
                ListViewItem lvi = (ListViewItem)this.listViewGases.SelectedItems[0];
                ListViewItem.ListViewSubItem lvsi = (ListViewItem.ListViewSubItem)lvi.SubItems[0];
                dg = DryingGasCatalog.Instance.GetDryingGas(lvsi.Text);
            }
            return(dg);
        }
Exemple #5
0
        public Flowsheet(NewProcessSettings newProcessSettings, ApplicationPreferences appPrefs, EvaporationAndDryingSystem system)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.newProcessSettings = newProcessSettings;
            this.appPrefs           = appPrefs;

            this.MultipleSelection = false;
            SetFlowsheetActivity(FlowsheetActivity.Default);

            if (system == null)
            {
                DryingGas dg = DryingGasCatalog.GetInstance().GetDryingGas(newProcessSettings.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.GetInstance().GetDryingGas("Air");
                }

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

                this.evapAndDryingSystem = new EvaporationAndDryingSystem(UI.NEW_SYSTEM, dm, dg);
            }
            else
            {
                this.evapAndDryingSystem = system;
            }

            this.evapAndDryingSystem.SystemChanged      += new SystemChangedEventHandler(evapAndDryingSystem_SystemChanged);
            this.evapAndDryingSystem.CalculationStarted += new CalculationStartedEventHandler(evapAndDryingSystem_CalculationStarted);
            this.evapAndDryingSystem.CalculationEnded   += new CalculationEndedEventHandler(evapAndDryingSystem_CalculationEnded);
            this.evapAndDryingSystem.NameChanged        += new NameChangedEventHandler(evapAndDryingSystem_NameChanged);

            this.connectionManager = new ConnectionManager(this);
            this.customEditor      = new ProsimoUI.CustomEditor.CustomEditor(this);
            this.streamManager     = new StreamManager(this);
            this.unitOpManager     = new UnitOpManager(this);
            this.BackColor         = Color.White;
            this.Version           = new FlowsheetVersion();

            this.IsDirty = false;
        }
Exemple #6
0
        private void PopulateIt(IList gasList)
        {
            IEnumerator en = gasList.GetEnumerator();

            while (en.MoveNext())
            {
                DryingGas    dg  = (DryingGas)en.Current;
                ListViewItem lvi = new ListViewItem();

                ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem(lvi, dg.Name);
                lvi.SubItems.Insert(0, lvsi);

                string userDefStr = UI.GetBoolAsYesNo(dg.IsUserDefined);
                lvsi = new ListViewItem.ListViewSubItem(lvi, userDefStr);
                lvi.SubItems.Insert(1, lvsi);

                this.listViewGases.Items.Add(lvi);
            }
        }
Exemple #7
0
 private void DryingGasesControl_DryingGasChanged(DryingGas gas)
 {
     this.PopulateDryingGasList();
 }