Example #1
0
 public ManualForm(Tank tank)
 {
     InitializeComponent();
     InitTimer();
     tank1 = tank;
 }
Example #2
0
        public void UpdateControls(Tank tank)
        {
            lic1Bar.ForceValue((int)(tank.waterContent / tank.mixedCapacity * 100));
            Console.WriteLine((int)(tank.waterContent / tank.mixedCapacity * 100));
            lic2Bar.ForceValue((int)(tank.oilSepContent / tank.oilCapacity * 100));
            pic1Bar.ForceValue((int)(tank.gasContent / tank.gasCapacity * 30) + 55);

            gasValve.ForceValue((int)(tank.gasOutflow / 255 / 4 * 100));
            waterValve.ForceValue((int)(tank.waterOutflow / 255 / 4 * 100));
            oilValve.ForceValue((int)(tank.oilOutflow / 255 / 4 * 100));

            inflowBox.Text = "Oil: " + tank.oilInflow.ToString() + " l/s\nWater: " + tank.waterInflow.ToString() + " l/s\nGas: " + tank.gasInflow + " l/s";


            // r/softwaregore
            if (tank.noodKlep)
            {
                inputValve.BackColor = Color.Green;
            }
            else
            {
                inputValve.BackColor = Color.Red;
            }

            if (tank.liquidHH)
            {
                liquidHH.BackColor = Color.Red;
            }
            else
            {
                liquidHH.BackColor = Color.Transparent;
            }
            if (tank.presureHH)
            {
                presureHH.BackColor = Color.Red;
            }
            else
            {
                presureHH.BackColor = Color.Transparent;
            }

            if (tank.pic1HA)
            {
                pic1HA.BackColor = Color.DarkOrange;
            }
            else
            {
                pic1HA.BackColor = Color.Transparent;
            }
            if (tank.pic1LA)
            {
                pic1LA.BackColor = Color.DarkOrange;
            }
            else
            {
                pic1LA.BackColor = Color.Transparent;
            }
            if (tank.lic1HA)
            {
                lic1HA.BackColor = Color.DarkOrange;
            }
            else
            {
                lic1HA.BackColor = Color.Transparent;
            }
            if (tank.lic1LA)
            {
                lic1LA.BackColor = Color.DarkOrange;
            }
            else
            {
                lic1LA.BackColor = Color.Transparent;
            }
            if (tank.lic2HA)
            {
                lic2HA.BackColor = Color.DarkOrange;
            }
            else
            {
                lic2HA.BackColor = Color.Transparent;
            }
            if (tank.lic2LA)
            {
                lic2LA.BackColor = Color.DarkOrange;
            }
            else
            {
                lic2LA.BackColor = Color.Transparent;
            }
        }