public DryerScopingEditor(DryerControl dryerCtrl) { // // Required for Windows Form Designer support // InitializeComponent(); this.inConstruction = true; this.dryer = dryerCtrl.Dryer; this.Text = "Dryer Scoping: " + dryerCtrl.Dryer.Name; this.dryerScopingCommonLabelsControl.InitializeVariableLabels(this.dryer.ScopingModel); this.dryerScopingCommonValuesControl.InitializeVariableTextBoxes(dryerCtrl.Flowsheet, this.dryer.ScopingModel); this.SetCrossSectionType(this.dryer.ScopingModel.CrossSectionType); this.dryerScopingCircularLabelsControl.InitializeVariableLabels(this.dryer.ScopingModel); this.dryerScopingCircularValuesControl.InitializeVariableTextBoxes(dryerCtrl.Flowsheet, this.dryer.ScopingModel); this.dryerScopingRectangularLabelsControl.InitializeVariableLabels(this.dryer.ScopingModel); this.dryerScopingRectangularValuesControl.InitializeVariableTextBoxes(dryerCtrl.Flowsheet, this.dryer.ScopingModel); this.dryer.SolveComplete += new SolveCompleteEventHandler(dryer_SolveComplete); this.inConstruction = false; }
static void Main(string[] args) { var water = new WaterManagingSubsystem(); var thermo = new Thermo(); var engine = new Engine(); var dryer = new Dryer(); var washingMachine = new WashingMachine.WashingMachine(dryer, engine, thermo, water); // Cotton Console.WriteLine("Cotton"); washingMachine.WashCotton(); // Wool Console.WriteLine("Wool"); washingMachine.WashWool(); int temp = washingMachine.GetTemperature(); // 1. принадлежат самому объекту // 2. методы объектов параметров // 3. созданы внутри метода // 4. поля текущего объекта Console.ReadLine(); }
protected override void ValidatingHandler(object sender, System.ComponentModel.CancelEventArgs e) { Dryer dryer = this.DryerCtrl.Dryer; TextBox tb = (TextBox)sender; if (tb.Text != null) { if (tb.Text.Trim().Equals("")) { if (sender == this.textBoxName) { e.Cancel = true; string message3 = "Please specify a name!"; MessageBox.Show(message3, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { if (sender == this.textBoxName) { ErrorMessage error = dryer.SpecifyName(this.textBoxName.Text); if (error != null) { UI.ShowError(error); } } } } }
public WashingMachine(Dryer dryer, Engine engine, Thermo thermo, WaterManagingSubsystem water) { _dryer = dryer; _engine = engine; _thermo = thermo; _water = water; }
public LaundryRoom InitializeLaundryRoom() { LaundryRoom laundryRoom = new LaundryRoom(); Washer washer1 = new Washer(1, "1", "open"); Washer washer2 = new Washer(2, "2", "open"); Washer washer3 = new Washer(3, "3", "busy"); Washer washer4 = new Washer(4, "4", "idle"); Washer washer5 = new Washer(5, "5", "open"); List <Washer> washerList = new List <Washer>(); washerList.Add(washer1); washerList.Add(washer2); washerList.Add(washer3); washerList.Add(washer4); washerList.Add(washer5); Dryer dryer1 = new Dryer(1, "1", "open"); Dryer dryer2 = new Dryer(2, "2", "busy"); Dryer dryer3 = new Dryer(3, "3", "idle"); Dryer dryer4 = new Dryer(4, "4", "open"); Dryer dryer5 = new Dryer(5, "5", "idle"); List <Dryer> dryerList = new List <Dryer>(); dryerList.Add(dryer1); dryerList.Add(dryer2); dryerList.Add(dryer3); dryerList.Add(dryer4); dryerList.Add(dryer5); laundryRoom.washerList = washerList; laundryRoom.dryerList = dryerList; return(laundryRoom); }
public DryerScopingCircularValuesControl(Flowsheet flowsheet, Dryer dryer) { // NOTE: this constructor is not used InitializeComponent(); this.InitializeVariableTextBoxes(flowsheet, dryer.ScopingModel); }
public override bool Test(Sim a, Dryer target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (target.CurDryerState != Dryer.DryerState.Done) { return(false); } return(true); }
public override bool Test(Sim a, Dryer target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (target.LotCurrent.GetObjects <ClothingPileWet>().Length == 0 && (a.GetObjectInRightHand() as ClothingPileWet) == null && GlobalFunctions.GetClosestObject <WashingMachine>((IEnumerable <WashingMachine>)target.LotCurrent.GetObjects <WashingMachine>(), (IGameObject)target, new Predicate <WashingMachine>(WashingMachineDoLaundryEx.IsWashingDone)) == null) { return(false); } return(target.CurDryerState == Dryer.DryerState.Empty); }
public DryerEditor(DryerControl dryerCtrl) : base(dryerCtrl) { // // Required for Windows Form Designer support // this.inConstruction = true; this.DryerCtrl = dryerCtrl; Dryer dryer = dryerCtrl.Dryer; this.Text = "Dryer: " + dryer.Name; this.UpdateStreamsUI(); initializeGrid(dryerCtrl, columnIndex, false, "Dryer"); dryerCtrl.Dryer.StreamAttached += new StreamAttachedEventHandler(Dryer_StreamAttached); dryerCtrl.Dryer.StreamDetached += new StreamDetachedEventHandler(Dryer_StreamDetached); this.menuItemScoping = new MenuItem(); this.menuItemScoping.Index = this.menuItemReport.Index + 1; this.menuItemScoping.Text = "Scoping"; this.menuItemScoping.Click += new EventHandler(menuItemScoping_Click); this.mainMenu.MenuItems.Add(this.menuItemScoping); this.labelCalculationType = new System.Windows.Forms.Label(); this.comboBoxCalculationType = new System.Windows.Forms.ComboBox(); // labelCalculationType this.labelCalculationType.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.labelCalculationType.Location = new System.Drawing.Point(310, 8); this.labelCalculationType.Name = "labelCalculationType"; this.labelCalculationType.BackColor = Color.DarkGray; this.labelCalculationType.Size = new System.Drawing.Size(192, 20); this.labelCalculationType.TabIndex = 5; this.labelCalculationType.Text = "Calculation Type:"; this.labelCalculationType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // comboBoxCalculationType this.comboBoxCalculationType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxCalculationType.Items.AddRange(new object[] { "Balance", "Scoping" }); this.comboBoxCalculationType.Location = new System.Drawing.Point(502, 8); this.comboBoxCalculationType.Name = "comboBoxCalculationType"; this.comboBoxCalculationType.Size = new System.Drawing.Size(80, 21); this.comboBoxCalculationType.TabIndex = 7; this.comboBoxCalculationType.SelectedIndexChanged += new EventHandler(comboBoxCalculationType_SelectedIndexChanged); this.namePanel.Controls.Add(this.labelCalculationType); this.namePanel.Controls.Add(this.comboBoxCalculationType); this.comboBoxCalculationType.SelectedIndex = -1; this.inConstruction = false; this.SetCalculationType(this.DryerCtrl.Dryer.DryerCalculationType); }
public DryerControl(Flowsheet flowsheet, Point location, Dryer dryer) : base(flowsheet, location, dryer) { InitializeComponent(); this.Size = new System.Drawing.Size(UI.UNIT_OP_CTRL_W, UI.UNIT_OP_CTRL_H); UI.SetStatusColor(this, this.Dryer.SolveState); this.UpdateBackImage(); }
protected override void Start() { spriteRenderer = GetComponent <SpriteRenderer>(); //Find a Dryer or WashingMachine to track capacity //Yes I know Dryer and WashingMachine should inherit from a parent Machine class since //they're so similar and it would simplify the code a lot, but too late, and too bad! washingMachine = GetComponentInParent <WashingMachine>(); dryer = GetComponentInParent <Dryer>(); }
// Start is called before the first frame update void Start() { dryer = GetComponentInParent <Dryer>(); animatedTransform = dryer.animator.transform; idleAnimatedTransformPos = animatedTransform.transform.localPosition; idleAnimatedTransformRot = animatedTransform.transform.localRotation; initialLocalPos = transform.localPosition; initialLocalRot = transform.localRotation; }
public void InitializeVariableLabels(Dryer uo) { this.labelMoistureEvaporationRate.InitializeVariable(uo.MoistureEvaporationRate); this.labelSpecificHeatConsumption.InitializeVariable(uo.SpecificHeatConsumption); this.labelThermalEfficiency.InitializeVariable(uo.ThermalEfficiency); this.labelGasPressureDrop.InitializeVariable(uo.GasPressureDrop); this.labelHeatLoss.InitializeVariable(uo.HeatLoss); this.labelHeatInput.InitializeVariable(uo.HeatInput); this.labelWorkInput.InitializeVariable(uo.WorkInput); this.labelHeatLossByTransportDevice.InitializeVariable(uo.HeatLossByTransportDevice); this.labelFractionOfMaterialLostToGasOutlet.InitializeVariable(uo.FractionOfMaterialLostToGasOutlet); this.labelGasOutletMaterialLoading.InitializeVariable(uo.GasOutletMaterialLoading); }
public override void SetObjectData() { base.SetObjectData(); int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionDryerRatingModel", typeof(int)); if (persistedClassVersion == 1) { this.owner = info.GetValue("Owner", typeof(Dryer)) as Dryer; this.procVarList = info.GetValue("ProcVarList", typeof(ArrayList)) as ArrayList; this.flowDirection = (FlowDirectionType)info.GetValue("FlowDirection", typeof(FlowDirectionType)); this.gasVelocity = (ProcessVarDouble)RecallStorableObject("GasVelocity", typeof(ProcessVarDouble)); } }
public override bool Test(Sim a, ClothingPileWet target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (Sims3.Gameplay.Queries.CountObjects <Dryer>(target.LotCurrent) == 0U) { greyedOutTooltipCallback = new GreyedOutTooltipCallback(ClothingPileWet.DryClothesInDryer.NoDryersOnLotToolTip); return(false); } if (Dryer.FindClosestAvailibleDryer((GameObject)target, a) == null) { greyedOutTooltipCallback = new GreyedOutTooltipCallback(ClothingPileWet.DryClothesInDryer.NoAvailibleDryersOnLot); return(false); } return(true); }
public DryerScopingModel(Dryer dryer) : base() { this.owner = dryer; crossSectionType = CrossSectionType.Circle; gasVelocity = new ProcessVarDouble(StringConstants.GAS_VELOCITY, PhysicalQuantity.Velocity, 2.0, VarState.Specified, dryer); diameter = new ProcessVarDouble(StringConstants.DIAMETER, PhysicalQuantity.Length, VarState.Specified, dryer); height = new ProcessVarDouble(StringConstants.HEIGHT, PhysicalQuantity.Length, VarState.Specified, dryer); lengthDiameterRatio = new ProcessVarDouble(StringConstants.LENGTH_DIAMETER_RATIO, PhysicalQuantity.Unknown, 8.0, VarState.Specified, dryer); width = new ProcessVarDouble(StringConstants.WIDTH, PhysicalQuantity.Length, VarState.Specified, dryer); length = new ProcessVarDouble(StringConstants.LENGTH, PhysicalQuantity.Length, VarState.Specified, dryer); lengthWidthRatio = new ProcessVarDouble(StringConstants.LENGTH_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, dryer); heightWidthRatio = new ProcessVarDouble(StringConstants.HEIGHT_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, dryer); InitializeVarListAndRegisterVars(); }
static void Main(string[] args) { var water = new WaterManagingSubsystem(); var thermo = new Thermo(); var engine = new Engine(); var dryer = new Dryer(); var washingMachine = new WashingMachine.WashingMachine(dryer, engine, thermo, water); Console.WriteLine("Cotton"); washingMachine.WashCotton(); Console.WriteLine("Wool"); washingMachine.WashWool(); Console.ReadLine(); }
public override void SetObjectData() { base.SetObjectData(); int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionDryerScopingModel", typeof(int)); if (persistedClassVersion == 1) { this.owner = info.GetValue("Owner", typeof(Dryer)) as Dryer; this.procVarList = info.GetValue("ProcVarList", typeof(ArrayList)) as ArrayList; this.crossSectionType = (CrossSectionType)info.GetValue("CrossSectionType", typeof(CrossSectionType)); this.diameter = (ProcessVarDouble)RecallStorableObject("Diameter", typeof(ProcessVarDouble)); this.gasVelocity = (ProcessVarDouble)RecallStorableObject("GasVelocity", typeof(ProcessVarDouble)); this.height = (ProcessVarDouble)RecallStorableObject("Height", typeof(ProcessVarDouble)); this.lengthDiameterRatio = (ProcessVarDouble)RecallStorableObject("LengthDiameterRatio", typeof(ProcessVarDouble)); this.width = (ProcessVarDouble)RecallStorableObject("Width", typeof(ProcessVarDouble)); this.length = (ProcessVarDouble)RecallStorableObject("Length", typeof(ProcessVarDouble)); this.lengthWidthRatio = (ProcessVarDouble)RecallStorableObject("LengthWidthRatio", typeof(ProcessVarDouble)); this.heightWidthRatio = (ProcessVarDouble)RecallStorableObject("HeightWidthRatio", typeof(ProcessVarDouble)); } }
public override bool Test(Sim a, WashingMachine target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (target.mWashState != WashingMachine.WashState.HasCleanLaundry) { return(false); } if (!WashingMachine.DryClothesBase.DoesDryerExist(target.LotCurrent)) { if (!target.LotCurrent.IsCommunityLot && !WashingMachine.DryClothesBase.DoesClotheslineExist(target.LotCurrent)) { greyedOutTooltipCallback = new GreyedOutTooltipCallback(WashingMachine.DryClothesInDryer.NoDryersOnLotToolTip); } return(false); } if (Dryer.FindClosestAvailibleDryer((GameObject)target, a) == null) { greyedOutTooltipCallback = new GreyedOutTooltipCallback(WashingMachine.DryClothesInDryer.NoAvailibleDryersOnLot); return(false); } return(true); }
private void Start() { dryer = GetComponentInParent <Dryer>(); }
public DryerEditor(DryerControl dryerCtrl) : base(dryerCtrl) { // // Required for Windows Form Designer support // InitializeComponent(); this.inConstruction = true; Dryer dryer = this.DryerCtrl.Dryer; this.Text = "Dryer: " + dryer.Name; this.UpdateStreamsUI(); this.groupBoxDryer = new System.Windows.Forms.GroupBox(); this.groupBoxDryer.Location = new System.Drawing.Point(724, 24); this.groupBoxDryer.Name = "groupBoxDryer"; this.groupBoxDryer.Text = "Dryer"; this.groupBoxDryer.Size = new System.Drawing.Size(280, 240); this.groupBoxDryer.TabIndex = 128; this.groupBoxDryer.TabStop = false; this.panel.Controls.Add(this.groupBoxDryer); // for the other UOs we do some resizing here! DryerLabelsControl dryerLabelsCtrl = new DryerLabelsControl(this.DryerCtrl.Dryer); this.groupBoxDryer.Controls.Add(dryerLabelsCtrl); dryerLabelsCtrl.Location = new Point(4, 12 + 20 + 2); DryerValuesControl dryerValuesCtrl = new DryerValuesControl(this.DryerCtrl); this.groupBoxDryer.Controls.Add(dryerValuesCtrl); dryerValuesCtrl.Location = new Point(196, 12 + 20 + 2); dryerCtrl.Dryer.StreamAttached += new StreamAttachedEventHandler(Dryer_StreamAttached); dryerCtrl.Dryer.StreamDetached += new StreamDetachedEventHandler(Dryer_StreamDetached); this.menuItemScoping = new MenuItem(); this.menuItemScoping.Index = this.menuItemReport.Index + 1; this.menuItemScoping.Text = "Scoping"; this.menuItemScoping.Click += new EventHandler(menuItemScoping_Click); this.mainMenu.MenuItems.Add(this.menuItemScoping); this.labelCalculationType = new System.Windows.Forms.Label(); this.comboBoxCalculationType = new System.Windows.Forms.ComboBox(); // labelCalculationType this.labelCalculationType.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.labelCalculationType.Location = new System.Drawing.Point(300, 0); this.labelCalculationType.Name = "labelCalculationType"; this.labelCalculationType.BackColor = Color.DarkGray; this.labelCalculationType.Size = new System.Drawing.Size(192, 20); this.labelCalculationType.TabIndex = 5; this.labelCalculationType.Text = "Calculation Type:"; this.labelCalculationType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // comboBoxCalculationType this.comboBoxCalculationType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxCalculationType.Items.AddRange(new object[] { "Balance", "Scoping" }); this.comboBoxCalculationType.Location = new System.Drawing.Point(492, 0); this.comboBoxCalculationType.Name = "comboBoxCalculationType"; this.comboBoxCalculationType.Size = new System.Drawing.Size(80, 21); this.comboBoxCalculationType.TabIndex = 7; this.comboBoxCalculationType.SelectedIndexChanged += new EventHandler(comboBoxCalculationType_SelectedIndexChanged); this.panel.Controls.Add(this.labelCalculationType); this.panel.Controls.Add(this.comboBoxCalculationType); this.comboBoxCalculationType.SelectedIndex = -1; this.inConstruction = false; this.SetCalculationType(this.DryerCtrl.Dryer.DryerCalculationType); }
private void UpdateStreamsUI() { // clear the stream group-boxes and start again this.groupBoxDryingMedium.Controls.Clear(); this.groupBoxMaterial.Controls.Clear(); Dryer dryer = this.DryerCtrl.Dryer; bool hasGasIn = false; bool hasGasOut = false; bool hasMaterialIn = false; bool hasMaterialOut = false; DryingGasStream gasIn = dryer.GasInlet; if (gasIn != null) { hasGasIn = true; } DryingGasStream gasOut = dryer.GasOutlet; if (gasOut != null) { hasGasOut = true; } DryingMaterialStream materialIn = dryer.MaterialInlet; if (materialIn != null) { hasMaterialIn = true; } DryingMaterialStream materialOut = dryer.MaterialOutlet; if (materialOut != null) { hasMaterialOut = true; } if (hasGasIn || hasGasOut) { DryingGasStream labelsStream = null; if (hasGasIn) { labelsStream = gasIn; } else if (hasGasOut) { labelsStream = gasOut; } gasLabelsCtrl = new GasStreamLabelsControl(labelsStream); this.groupBoxDryingMedium.Controls.Add(gasLabelsCtrl); gasLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasGasIn) { GasStreamControl gasInCtrl = (GasStreamControl)this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.GasInlet.Name); gasValuesInCtrl = new GasStreamValuesControl(gasInCtrl); this.groupBoxDryingMedium.Controls.Add(gasValuesInCtrl); gasValuesInCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxGasInName.SetSolvable(dryer.GasInlet); this.groupBoxDryingMedium.Controls.Add(this.textBoxGasInName); this.textBoxGasInName.Text = dryer.GasInlet.Name; UI.SetStatusColor(this.textBoxGasInName, dryer.GasInlet.SolveState); } if (hasGasOut) { GasStreamControl gasOutCtrl = (GasStreamControl)this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.GasOutlet.Name); gasValuesOutCtrl = new GasStreamValuesControl(gasOutCtrl); this.groupBoxDryingMedium.Controls.Add(gasValuesOutCtrl); gasValuesOutCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxGasOutName.SetSolvable(dryer.GasOutlet); this.groupBoxDryingMedium.Controls.Add(this.textBoxGasOutName); this.textBoxGasOutName.Text = dryer.GasOutlet.Name; UI.SetStatusColor(this.textBoxGasOutName, dryer.GasOutlet.SolveState); } if (hasMaterialIn || hasMaterialOut) { DryingMaterialStream labelsStream = null; if (hasMaterialIn) { labelsStream = materialIn; } else if (hasMaterialOut) { labelsStream = materialOut; } materialLabelsCtrl = new MaterialStreamLabelsControl(labelsStream); this.groupBoxMaterial.Controls.Add(materialLabelsCtrl); materialLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasMaterialIn) { MaterialStreamControl materialInCtrl = (MaterialStreamControl)this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.MaterialInlet.Name); materialValuesInCtrl = new MaterialStreamValuesControl(materialInCtrl); this.groupBoxMaterial.Controls.Add(materialValuesInCtrl); materialValuesInCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxMaterialInName.SetSolvable(dryer.MaterialInlet); this.groupBoxMaterial.Controls.Add(this.textBoxMaterialInName); this.textBoxMaterialInName.Text = dryer.MaterialInlet.Name; UI.SetStatusColor(this.textBoxMaterialInName, dryer.MaterialInlet.SolveState); } if (hasMaterialOut) { MaterialStreamControl materialOutCtrl = (MaterialStreamControl)this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.MaterialOutlet.Name); materialValuesOutCtrl = new MaterialStreamValuesControl(materialOutCtrl); this.groupBoxMaterial.Controls.Add(materialValuesOutCtrl); materialValuesOutCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxMaterialOutName.SetSolvable(dryer.MaterialOutlet); this.groupBoxMaterial.Controls.Add(this.textBoxMaterialOutName); this.textBoxMaterialOutName.Text = dryer.MaterialOutlet.Name; UI.SetStatusColor(this.textBoxMaterialOutName, dryer.MaterialOutlet.SolveState); } }
public DryerControl(Flowsheet flowsheet, Point location, Dryer dryer) : base(flowsheet, location, dryer) { }
//private void Dryer_StreamAttached(UnitOperation uo, ProcessStreamBase ps, int desc) { // this.UpdateStreamsUI(); //} //private void Dryer_StreamDetached(UnitOperation uo, ProcessStreamBase ps) { // this.UpdateStreamsUI(); //} protected override void UpdateStreamsUI() { // clear the stream group-boxes and start again this.groupBoxDryingMedium.Controls.Clear(); this.groupBoxMaterial.Controls.Clear(); Dryer dryer = this.DryerCtrl.Dryer; bool hasGasIn = false; bool hasGasOut = false; bool hasMaterialIn = false; bool hasMaterialOut = false; DryingGasStream gasIn = dryer.GasInlet; hasGasIn = gasIn != null; DryingGasStream gasOut = dryer.GasOutlet; hasGasOut = gasOut != null; DryingMaterialStream materialIn = dryer.MaterialInlet; hasMaterialIn = materialIn != null; DryingMaterialStream materialOut = dryer.MaterialOutlet; hasMaterialOut = materialOut != null; if (hasGasIn || hasGasOut) { DryingGasStream labelsStream = hasGasIn ? gasIn : gasOut; //gasLabelsCtrl = new ProcessVarLabelsControl(labelsStream.VarList); gasLabelsCtrl = new GasStreamLabelsControl(labelsStream); this.groupBoxDryingMedium.Controls.Add(gasLabelsCtrl); gasLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasGasIn) { ProcessStreamBaseControl gasInCtrl = this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.GasInlet.Name); //gasValuesInCtrl = new ProcessVarValuesControl(gasInCtrl); gasValuesInCtrl = new GasStreamValuesControl((GasStreamControl)gasInCtrl); this.groupBoxDryingMedium.Controls.Add(gasValuesInCtrl); gasValuesInCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxGasInName.SetSolvable(dryer.GasInlet); this.groupBoxDryingMedium.Controls.Add(this.textBoxGasInName); this.textBoxGasInName.Text = dryer.GasInlet.Name; UI.SetStatusColor(this.textBoxGasInName, dryer.GasInlet.SolveState); } if (hasGasOut) { ProcessStreamBaseControl gasOutCtrl = this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.GasOutlet.Name); //gasValuesOutCtrl = new ProcessVarValuesControl(gasOutCtrl); gasValuesOutCtrl = new GasStreamValuesControl((GasStreamControl)gasOutCtrl); this.groupBoxDryingMedium.Controls.Add(gasValuesOutCtrl); gasValuesOutCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxGasOutName.SetSolvable(dryer.GasOutlet); this.groupBoxDryingMedium.Controls.Add(this.textBoxGasOutName); this.textBoxGasOutName.Text = dryer.GasOutlet.Name; UI.SetStatusColor(this.textBoxGasOutName, dryer.GasOutlet.SolveState); } if (hasMaterialIn || hasMaterialOut) { DryingMaterialStream labelsStream = hasMaterialIn ? materialIn : materialOut; //materialLabelsCtrl = new ProcessVarLabelsControl(labelsStream.VarList); materialLabelsCtrl = new MaterialStreamLabelsControl(labelsStream); this.groupBoxMaterial.Controls.Add(materialLabelsCtrl); materialLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasMaterialIn) { ProcessStreamBaseControl materialInCtrl = this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.MaterialInlet.Name); //materialValuesInCtrl = new ProcessVarValuesControl(materialInCtrl); materialValuesInCtrl = new MaterialStreamValuesControl((MaterialStreamControl)materialInCtrl); this.groupBoxMaterial.Controls.Add(materialValuesInCtrl); materialValuesInCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxMaterialInName.SetSolvable(dryer.MaterialInlet); this.groupBoxMaterial.Controls.Add(this.textBoxMaterialInName); this.textBoxMaterialInName.Text = dryer.MaterialInlet.Name; UI.SetStatusColor(this.textBoxMaterialInName, dryer.MaterialInlet.SolveState); } if (hasMaterialOut) { ProcessStreamBaseControl materialOutCtrl = this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.MaterialOutlet.Name); //materialValuesOutCtrl = new ProcessVarValuesControl(materialOutCtrl); materialValuesOutCtrl = new MaterialStreamValuesControl((MaterialStreamControl)materialOutCtrl); this.groupBoxMaterial.Controls.Add(materialValuesOutCtrl); materialValuesOutCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxMaterialOutName.SetSolvable(dryer.MaterialOutlet); this.groupBoxMaterial.Controls.Add(this.textBoxMaterialOutName); this.textBoxMaterialOutName.Text = dryer.MaterialOutlet.Name; UI.SetStatusColor(this.textBoxMaterialOutName, dryer.MaterialOutlet.SolveState); } }
private Flowsheet SetFlowsheetContent(NewProcessSettings newProcessSettings, ApplicationPreferences appPrefs, ArrayList items, string flowsheetName) { Flowsheet flowsheet = null; IEnumerator e = items.GetEnumerator(); while (e.MoveNext()) { object obj = e.Current; if (obj is EvaporationAndDryingSystem) { EvaporationAndDryingSystem persisted = (EvaporationAndDryingSystem)obj; persisted.SetSystemFileName(flowsheetName); // call this before SetObjectData() persisted.SetObjectData(); flowsheet = new Flowsheet(newProcessSettings, appPrefs, persisted); } else if (obj is GasStreamControl) { GasStreamControl persistedCtrl = (GasStreamControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); DryingGasStream stream = flowsheet.EvaporationAndDryingSystem.GetGasStream(solvableName); GasStreamControl newCtrl = new GasStreamControl(flowsheet, new Point(0, 0), stream); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is MaterialStreamControl) { MaterialStreamControl persistedCtrl = (MaterialStreamControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); DryingMaterialStream stream = flowsheet.EvaporationAndDryingSystem.GetMaterialStream(solvableName); MaterialStreamControl newCtrl = new MaterialStreamControl(flowsheet, new Point(0, 0), stream); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is DryerControl) { DryerControl persistedCtrl = (DryerControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Dryer uo = flowsheet.EvaporationAndDryingSystem.GetDryer(solvableName); DryerControl newCtrl = new DryerControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is HeatExchangerControl) { HeatExchangerControl persistedCtrl = (HeatExchangerControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); HeatExchanger uo = flowsheet.EvaporationAndDryingSystem.GetHeatExchanger(solvableName); HeatExchangerControl newCtrl = new HeatExchangerControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is CycloneControl) { CycloneControl persistedCtrl = (CycloneControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Cyclone uo = flowsheet.EvaporationAndDryingSystem.GetCyclone(solvableName); CycloneControl newCtrl = new CycloneControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is EjectorControl) { EjectorControl persistedCtrl = (EjectorControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Ejector uo = flowsheet.EvaporationAndDryingSystem.GetEjector(solvableName); EjectorControl newCtrl = new EjectorControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is WetScrubberControl) { WetScrubberControl persistedCtrl = (WetScrubberControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); WetScrubber uo = flowsheet.EvaporationAndDryingSystem.GetWetScrubber(solvableName); WetScrubberControl newCtrl = new WetScrubberControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is ScrubberCondenserControl) { ScrubberCondenserControl persistedCtrl = (ScrubberCondenserControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); ScrubberCondenser uo = flowsheet.EvaporationAndDryingSystem.GetScrubberCondenser(solvableName); ScrubberCondenserControl newCtrl = new ScrubberCondenserControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is MixerControl) { MixerControl persistedCtrl = (MixerControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Mixer uo = flowsheet.EvaporationAndDryingSystem.GetMixer(solvableName); MixerControl newCtrl = new MixerControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is TeeControl) { TeeControl persistedCtrl = (TeeControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Tee uo = flowsheet.EvaporationAndDryingSystem.GetTee(solvableName); TeeControl newCtrl = new TeeControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is FlashTankControl) { FlashTankControl persistedCtrl = (FlashTankControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); FlashTank uo = flowsheet.EvaporationAndDryingSystem.GetFlashTank(solvableName); FlashTankControl newCtrl = new FlashTankControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is FanControl) { FanControl persistedCtrl = (FanControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Fan uo = flowsheet.EvaporationAndDryingSystem.GetFan(solvableName); FanControl newCtrl = new FanControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is ValveControl) { ValveControl persistedCtrl = (ValveControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Valve uo = flowsheet.EvaporationAndDryingSystem.GetValve(solvableName); ValveControl newCtrl = new ValveControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is BagFilterControl) { BagFilterControl persistedCtrl = (BagFilterControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); BagFilter uo = flowsheet.EvaporationAndDryingSystem.GetBagFilter(solvableName); BagFilterControl newCtrl = new BagFilterControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is AirFilterControl) { AirFilterControl persistedCtrl = (AirFilterControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); AirFilter uo = flowsheet.EvaporationAndDryingSystem.GetAirFilter(solvableName); AirFilterControl newCtrl = new AirFilterControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is CompressorControl) { CompressorControl persistedCtrl = (CompressorControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Compressor uo = flowsheet.EvaporationAndDryingSystem.GetCompressor(solvableName); CompressorControl newCtrl = new CompressorControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is HeaterControl) { HeaterControl persistedCtrl = (HeaterControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Heater uo = flowsheet.EvaporationAndDryingSystem.GetHeater(solvableName); HeaterControl newCtrl = new HeaterControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is CoolerControl) { CoolerControl persistedCtrl = (CoolerControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Cooler uo = flowsheet.EvaporationAndDryingSystem.GetCooler(solvableName); CoolerControl newCtrl = new CoolerControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is ElectrostaticPrecipitatorControl) { ElectrostaticPrecipitatorControl persistedCtrl = (ElectrostaticPrecipitatorControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); ElectrostaticPrecipitator uo = flowsheet.EvaporationAndDryingSystem.GetElectrostaticPrecipitator(solvableName); ElectrostaticPrecipitatorControl newCtrl = new ElectrostaticPrecipitatorControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is PumpControl) { PumpControl persistedCtrl = (PumpControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Pump uo = flowsheet.EvaporationAndDryingSystem.GetPump(solvableName); PumpControl newCtrl = new PumpControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is RecycleControl) { RecycleControl persistedCtrl = (RecycleControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Recycle uo = flowsheet.EvaporationAndDryingSystem.GetRecycle(solvableName); RecycleControl newCtrl = new RecycleControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is SolvableConnection) { SolvableConnection persistedDc = (SolvableConnection)obj; SolvableConnection dc = new SolvableConnection(flowsheet); dc.SetObjectData(persistedDc.SerializationInfo, persistedDc.StreamingContext); flowsheet.ConnectionManager.Connections.Add(dc); } else if (obj is FlowsheetPreferences) { FlowsheetPreferences flowsheetPrefs = obj as FlowsheetPreferences; flowsheetPrefs.SetObjectData(flowsheetPrefs.SerializationInfo, flowsheetPrefs.StreamingContext); flowsheet.BackColor = flowsheetPrefs.BackColor; } else if (obj is ProsimoUI.CustomEditor.CustomEditor) { ProsimoUI.CustomEditor.CustomEditor persistedEditor = (ProsimoUI.CustomEditor.CustomEditor)obj; flowsheet.CustomEditor.SetObjectData(persistedEditor.SerializationInfo, persistedEditor.StreamingContext); } } if (this.CheckFlowsheetVersion(items, flowsheet)) { flowsheet.IsDirty = false; } else { flowsheet = null; } return(flowsheet); }
protected override bool PrivateUpdate(ScenarioFrame frame) { base.PrivateUpdate(frame); LaundryState state; if (!mPushed.TryGetValue(Sim.Household, out state)) { state = new LaundryState(); mPushed.Add(Sim.Household, state); } List <GameObject> broken = new List <GameObject>(); if (!state.mDryer) { List <ClothingPileWet> wetPiles = new List <ClothingPileWet>(Sim.LotHome.GetObjects <ClothingPileWet>()); foreach (ICanDryClothes obj in Sim.LotHome.GetObjects <ICanDryClothes>()) { if (obj.IsAvailible()) { continue; } Clothesline line = obj as Clothesline; if (line != null) { IncStat("Try Empty Line"); if (Situations.PushInteraction(this, Sim, line, Clothesline.GetCleanLaundry.Singleton)) { state.mDryer = true; IncStat("Push Empty Line"); return(true); } if (wetPiles.Count > 0) { ClothingPileWet pile = RandomUtil.GetRandomObjectFromList(wetPiles); wetPiles.Remove(pile); if (Situations.PushInteraction(this, Sim, pile, ClothingPileWet.DryClothesOnClothesline.Singleton)) { state.mDryer = true; IncStat("Hang Wet Pile"); return(true); } } } else { Dryer dryer = obj as Dryer; if (dryer != null) { IncStat("Try Empty Dryer"); if (Situations.PushInteraction(this, Sim, dryer, Dryer.GetCleanLaundry.Singleton)) { state.mDryer = true; IncStat("Push Empty Dryer"); return(true); } if (wetPiles.Count > 0) { ClothingPileWet pile = RandomUtil.GetRandomObjectFromList(wetPiles); wetPiles.Remove(pile); if (Situations.PushInteraction(this, Sim, pile, ClothingPileWet.DryClothesInDryer.Singleton)) { state.mDryer = true; IncStat("Dry Wet Pile"); return(true); } } if ((dryer.Repairable != null) && (dryer.Repairable.Broken)) { broken.Add(dryer); } } } } } if (!state.mWasher) { foreach (WashingMachine machine in Sim.LotHome.GetObjects <WashingMachine>()) { if (machine.mWashState == WashingMachine.WashState.HasCleanLaundry) { if (WashingMachine.DryClothesBase.DoesClotheslineExist(Sim.LotHome)) { IncStat("Try Clothesline"); if (Situations.PushInteraction(this, Sim, machine, WashingMachine.DryClothesOnClothesline.Singleton)) { state.mWasher = true; IncStat("Push Clothesline"); return(true); } } else { IncStat("Try Dryer"); if (Situations.PushInteraction(this, Sim, machine, WashingMachine.DryClothesInDryer.Singleton)) { state.mWasher = true; IncStat("Push Dryer"); return(true); } } } else if (machine.CanDoLaundry()) { IncStat("Try Washer"); if (Situations.PushInteraction(this, Sim, machine, WashingMachine.DoLaundry.Singleton)) { state.mWasher = true; IncStat("Push Washer"); return(true); } } if ((machine.Repairable != null) && (machine.Repairable.Broken)) { broken.Add(machine); } } } if (broken.Count > 0) { IncStat("Repair Push"); Add(frame, new ScheduledRepairScenario(Sim, RandomUtil.GetRandomObjectFromList(broken)), ScenarioResult.Start); return(true); } return(false); }
public DryerLabelsControl(Dryer uo) : this() { this.InitializeVariableLabels(uo); }
protected DryerRatingModel(Dryer dryer) { this.owner = dryer; flowDirection = FlowDirectionType.Counter; gasVelocity = new ProcessVarDouble(StringConstants.GAS_VELOCITY, PhysicalQuantity.Velocity, 2.0, VarState.Specified, dryer); }
private void Start() { dryer = GetComponentInParent <Dryer>(); spriteRenderer = GetComponentInChildren <SpriteRenderer>(); animator = GetComponent <Animator>(); }
protected override void PrivatePerformAction(bool prompt) { try { Overwatch.Log("Cleanup Laundromat"); foreach (Lot lot in LotManager.AllLots) { if (!Allow(lot)) { continue; } foreach (GameObject obj in lot.GetObjects <GameObject>()) { WashingMachine washing = obj as WashingMachine; if (washing != null) { if (washing.mWashState != WashingMachine.WashState.Empty) { Overwatch.Log("Washer Emptied"); washing.SetObjectToReset(); washing.RemoveClothes(); } } else { Dryer dryer = obj as Dryer; if (dryer != null) { if (dryer.CurDryerState != Dryer.DryerState.Empty) { Overwatch.Log("Dryer Emptied"); dryer.ForceDryerDone(); dryer.TakeClothes(false); dryer.SetGeometryState("empty"); } } else { Clothesline line = obj as Clothesline; if (line != null) { if (line.CurClothesState != Dryer.DryerState.Empty) { Overwatch.Log("Line Emptied"); if (line.mDripFX == null) { line.StartDrying(); } line.ForceClothesDry(); line.ClothesTaken(); } } } } } } if (prompt) { Overwatch.AlarmNotify(Common.Localize("CleanupLaundromat:Complete")); } } catch (Exception e) { Common.Exception(Name, e); } }