Exemple #1
0
        public double CalcSoilVolume(TankShape tankShape, double soilHeight)
        {
            ITank  tank   = GetTank(tankShape, TankProperties);
            double result = tank.CalcSoilVolume(soilHeight);

            return(result);
        }
Exemple #2
0
        public ITank GetTank(TankShape tankShape, string str)
        {
            Type  tankType = ALData.TankTypes[(int)tankShape];
            ITank result   = (ITank)StringSerializer.Deserialize(tankType, str);

            return(result);
        }
Exemple #3
0
        public double CalcWaterVolume(TankShape tankShape, double underfillHeight, double soilHeight)
        {
            ITank  tank   = GetTank(tankShape, TankProperties);
            double result = tank.CalcWaterVolume(underfillHeight, soilHeight);

            return(result);
        }
Exemple #4
0
        public double CalcTankVolume(TankShape tankShape)
        {
            ITank  tank   = GetTank(tankShape, TankProperties);
            double result = tank.CalcTankVolume();

            return(result);
        }
        public void RefreshProps(TankShape tankShape)
        {
            ITank tank = fRecord.GetTank(tankShape, fRecord.TankProperties);

            TypeDescriptor.AddAttributes(tank, new Attribute[] { new ReadOnlyAttribute(true) });
            tank.SetPropNames();
            fView.PropsGrid.SelectedObject = tank;

            RecalcValues();
        }
        public void EditTank()
        {
            if (fRecord == null)
            {
                return;
            }

            TankShape tankShape = fView.ShapeCombo.GetSelectedTag <TankShape>();
            var       tank      = fRecord.GetTank(tankShape, fRecord.TankProperties);

            IBrowser browser = fModel.Browser;

            if (browser.EditTank(tank))
            {
                fRecord.Tank = tank;
                RefreshProps(tankShape);
            }
        }
Exemple #7
0
 public double CalcWaterVolume(TankShape tankShape)
 {
     return(CalcWaterVolume(tankShape, UnderfillHeight, SoilHeight));
 }