public ComponentNotification(string componentName, string message, HierarchyLevel hierarchyLevel, int positionOnHierarchyLevel)
 {
     ComponentName            = componentName;
     Message                  = message;
     HierarchyLevel           = hierarchyLevel;
     PositionOnHierarchyLevel = positionOnHierarchyLevel;
 }
        private void AddSubordinatedSection(DataGridView parentGrid, HierarchyLevel level)
        {
            frmAddSection addSection = new frmAddSection(Convert.ToInt32(parentGrid.SelectedRows[0].Cells[0].Value), level);

            addSection.ShowDialog();
            RefreshGrids();
        }
Exemple #3
0
        public void TestFlatPlanterFinalResults(decimal blndSoilDepth,
                                                InfiltrationTestProcedure ift, decimal natInfRate,
                                                HierarchyLevel lvl, Configuration cfg, decimal impArea, int preCN, int postCn,
                                                int preTC, int postTC, decimal infPcnt, decimal botArea, decimal botWidth,
                                                decimal botPerimeter, decimal ss, decimal freeBrd, decimal ovflHgt,
                                                decimal ovflSA, decimal ovflEHgt, decimal ovflESA, decimal rockBotArea,
                                                decimal rockStrgDepth, decimal rockWidth, decimal porosity,
                                                decimal belowPipeStrgDepth, decimal?orificeDiameter, OrificeReason rsn,
                                                // --------------------------------------------------------------------------
                                                double exppkWQInflow, double exppkWQOutflow, double expWQUDOutflow, double exppkWQOverflow,
                                                double expH2YPreDev, double exppkH2YInflow, double exppkH2YOutflow, double expH2YUDOutflow, double exppkH2YOverflow,
                                                double exp2YPreDev, double exppk2YInflow, double exppk2YOutflow, double exp2YUDOutflow, double exppk2YOverflow,
                                                double exp5YPreDev, double exppk5YInflow, double exppk5YOutflow, double exp5YUDOutflow, double exppk5YOverflow,
                                                double exp10YPreDev, double exppk10YInflow, double exppk10YOutflow, double exp10YUDOutflow, double exppk10YOverflow,
                                                double exp25YPreDev, double exppk25YInflow, double exppk25YOutflow, double exp25YUDOutflow, double exppk25YOverflow)
        {
            var ctch = MakeFlatPlanterCatchment(blndSoilDepth, ift, natInfRate, lvl, cfg, impArea,
                                                preCN, postCn, preTC, postTC, infPcnt, botArea, botWidth, botPerimeter,
                                                ss, freeBrd, ovflHgt, ovflSA, ovflEHgt, ovflESA, rockBotArea, rockStrgDepth,
                                                rockWidth, porosity, belowPipeStrgDepth, orificeDiameter, rsn);
            var calc = Calculator.Make(ctch.Facility.Category);

            Assert.IsNotNull(calc);
            var strmRslts = calc.CalculateResults(ctch);

            ValidateResults(strmRslts[DesignStorm.WQ], 0d, exppkWQInflow, exppkWQOutflow, expWQUDOutflow, exppkWQOverflow);
            ValidateResults(strmRslts[DesignStorm.HalfTwoYear], expH2YPreDev, exppkH2YInflow, exppkH2YOutflow, expH2YUDOutflow, exppkH2YOverflow);
            ValidateResults(strmRslts[DesignStorm.TwoYear], exp2YPreDev, exppk2YInflow, exppk2YOutflow, exp2YUDOutflow, exppk2YOverflow);
            ValidateResults(strmRslts[DesignStorm.FivYear], exp5YPreDev, exppk5YInflow, exppk5YOutflow, exp5YUDOutflow, exppk5YOverflow);
            ValidateResults(strmRslts[DesignStorm.TenYear], exp10YPreDev, exppk10YInflow, exppk10YOutflow, exp10YUDOutflow, exppk10YOverflow);
            ValidateResults(strmRslts[DesignStorm.TwntyFiv], exp25YPreDev, exppk25YInflow, exppk25YOutflow, exp25YUDOutflow, exppk25YOverflow);
        }
Exemple #4
0
 public ModelSection(int id, string name, string code, int?directorId, HierarchyLevel hierarchyLevel, int?parentSectionId)
 {
     Id              = id;
     Name            = name;
     Code            = code;
     DirectorId      = directorId;
     HierarchyLevel  = hierarchyLevel;
     ParentSectionId = parentSectionId;
 }
Exemple #5
0
 /// <summary>
 /// This function serves not only convenience but also protects from unexpeceted cases, for example,
 /// if a new type added
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="ifInt"></param>
 /// <param name="ifRat"></param>
 /// <param name="ifReal"></param>
 /// <param name="ifCom"></param>
 /// <param name="nums"></param>
 /// <returns></returns>
 protected static T SuperSwitch <T>(
     Func <IntegerNumber[], T> ifInt,
     Func <RationalNumber[], T> ifRat,
     Func <RealNumber[], T> ifReal,
     Func <ComplexNumber[], T> ifCom,
     HierarchyLevel type,
     params Number[] nums
     )
 => type switch
 {
Exemple #6
0
        public void AddNode(int?parentNode, string companyName, string companyCode, HierarchyLevel hierarchyLevel)
        {
            NodeModel node = new NodeModel()
            {
                Name           = companyName,
                Code           = companyCode,
                HierarchyLevel = hierarchyLevel,
                ParentNode     = parentNode
            };

            _nodeRepository.AddNode(node);
        }
Exemple #7
0
        public void TestFlatPlanterCommonValues(decimal blndSoilDepth,
                                                InfiltrationTestProcedure ift, decimal natInfRate,
                                                HierarchyLevel lvl, Configuration cfg, decimal impArea, int preCN, int postCn,
                                                int preTC, int postTC, decimal infPcnt, decimal botArea, decimal botWidth,
                                                decimal botPerimeter, decimal ss, decimal freeBrd, decimal ovflHgt,
                                                decimal ovflSA, decimal ovflEHgt, decimal ovflESA, decimal rockBotArea,
                                                decimal rockStrgDepth, decimal rockWidth, decimal porosity,
                                                decimal belowPipeStrgDepth, decimal?orificeDiameter, OrificeReason rsn)
        {
            var ctch = MakeFlatPlanterCatchment(blndSoilDepth, ift, natInfRate, lvl, cfg, impArea,
                                                preCN, postCn, preTC, postTC, infPcnt, botArea, botWidth, botPerimeter,
                                                ss, freeBrd, ovflHgt, ovflSA, ovflEHgt, ovflESA, rockBotArea, rockStrgDepth,
                                                rockWidth, porosity, belowPipeStrgDepth, orificeDiameter, rsn);
            var calc = Calculator.Make(ctch.Facility.Category);

            calc.CalculateCommonValues(ctch);
            Assert.IsNotNull(calc);
        }
Exemple #8
0
    protected void loadHierarchy()
    {
        DBFilter  filter;
        ArrayList list;

        filter = new DBFilter();
        filter.add(new Match("EmpID", CurEmpID));
        list = EEmpHierarchy.db.select(dbConn, filter);
        foreach (EEmpHierarchy element in list)
        {
            CurElements[element.HLevelID] = element;
        }

        filter = new DBFilter();
        filter.add("HLevelSeqNo", true);
        list = EHierarchyLevel.db.select(dbConn, filter);
        HierarchyLevel.DataSource = list;
        HierarchyLevel.DataBind();
    }
        public List <ModelSection> GetAllCompanies()
        {
            List <ModelSection> sections = new List <ModelSection>();

            Execute((command) =>
            {
                command.CommandText = "Select * from section where ParentSectionID is null";
                using (SqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        int sectionId        = reader.GetInt32(0);
                        string name          = reader.GetString(1);
                        string code          = reader.GetString(2);
                        int?directorId       = reader.IsDBNull(3) ? null : (int?)reader.GetInt32(3);
                        HierarchyLevel level = (HierarchyLevel)reader.GetInt32(4);
                        int?idParent         = reader.IsDBNull(5) ? null : (int?)reader.GetInt32(5);
                        sections.Add(new ModelSection(sectionId, name, code, directorId, level, idParent));
                    }
                }
            });
            return(sections);
        }
        public List <ModelSection> GetSectionsByParentId(int?parentId)
        {
            List <ModelSection> sections = new List <ModelSection>();

            Execute((command) =>
            {
                command.CommandText = "Select * from section where ParentSectionID=@parentId";
                command.Parameters.Add("@parentId", SqlDbType.Int).Value = (object)parentId ?? DBNull.Value;
                using (SqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        int sectionId        = reader.GetInt32(0);
                        string name          = reader.GetString(1);
                        string code          = reader.GetString(2);
                        int?directorId       = reader.IsDBNull(3) ? null : (int?)reader.GetInt32(3);
                        HierarchyLevel level = (HierarchyLevel)reader.GetInt32(4);
                        int?idParent         = reader.IsDBNull(5) ? null : (int?)reader.GetInt32(5);
                        sections.Add(new ModelSection(sectionId, name, code, directorId, level, idParent));
                    }
                }
            });
            return(sections);
        }
Exemple #11
0
 private static Catchment MakeFlatPlanterCatchment(
     decimal blndSoilDepth, InfiltrationTestProcedure ift,
     decimal natInfRate, HierarchyLevel lvl, Configuration cfg,
     decimal impArea, int preCN, int postCn,
     int preTC, int postTC, decimal infPcnt, decimal botArea, decimal botWidth,
     decimal botPerimeter, decimal ss, decimal freeBrd, decimal ovflHgt,
     decimal ovflSA, decimal ovflEHgt, decimal ovflESA, decimal rockBotArea,
     decimal rockStrgDepth, decimal rockWidth, decimal porosity,
     decimal belowPipeStrgDepth, decimal?orificeDiameter, OrificeReason rsn)
 {
     return(Catchment.Make("FlatPlanterTestCatchment",
                           ift, PRStatus.Pass, natInfRate,
                           lvl, impArea, preCN, postCn, preTC, postTC,
                           FlatPlanter.Make(true, blndSoilDepth, cfg,
                                            AboveGradeProperties.Make(botArea,
                                                                      botWidth, botPerimeter, ss, freeBrd,
                                                                      ovflHgt, ovflSA,
                                                                      ovflEHgt, ovflESA),
                                            BelowGradeProperties.Make(infPcnt, rockBotArea,
                                                                      rockStrgDepth, rockWidth, porosity, belowPipeStrgDepth,
                                                                      orificeDiameter.HasValue?
                                                                      Orifice.Make(orificeDiameter.Value):
                                                                      Orifice.Make(rsn)))));
 }
Exemple #12
0
 /// <summary>
 /// Checks affiliation of a number
 /// e. g.
 /// num.Is(Number.HierarchyLevel.INTEGER) would check whether a num is an IntegerNumber
 /// </summary>
 /// <param name="type">
 /// Number.HierarchyLevel {
 ///   INTEGER,
 ///   RATIONAL,
 ///   REAL,
 ///   COMPLEX
 /// }
 /// </param>
 /// <returns></returns>
 public bool Is(HierarchyLevel type)
 => (long)Type <= (long)type;
Exemple #13
0
 public EditNodeViewModel(HierarchyLevel hierarchyLevel, int?parentNode)
 {
     HierarchyLevel = hierarchyLevel;
     ParentNode     = parentNode;
 }
Exemple #14
0
 public EditNodeView(HierarchyLevel hierarchyLevel, int?parentNodeID)
 {
     InitializeComponent();
     _editNodeViewModel = new EditNodeViewModel(hierarchyLevel, parentNodeID);
 }
Exemple #15
0
 public frmAddSection(int?parentId, HierarchyLevel level)
 {
     InitializeComponent();
     _parentId = parentId;
     _level    = level;
 }
Exemple #16
0
        public void TestFlatPlanterCommonValueResults(decimal blndSoilDepth,
                                                      InfiltrationTestProcedure ift, decimal corrFac, decimal natInfRate,
                                                      HierarchyLevel lvl, Configuration cfg, decimal impArea, int preCN, int postCn,
                                                      int preTC, int postTC, decimal infPcnt, decimal botArea, decimal botWidth,
                                                      decimal botPerimeter, decimal ss, decimal freeBrd, decimal ovflHgt,
                                                      decimal ovflSA, decimal ovflEHgt, decimal ovflESA, decimal rockBotArea,
                                                      decimal rockStrgDepth, decimal rockWidth, decimal porosity,
                                                      decimal belowPipeStrgDepth, decimal?orificeDiameter, OrificeReason rsn,
                                                      // ---------------------------------------------------------------------
                                                      double expORArea, double expUnderDrainlen, double expMaxSurfDepth,
                                                      double expOFEDep, double expBSD, double expBSDAR, double expMaxRSD,
                                                      double?expMaxRSDBP, double?expMaxRSDAP, double?expMedCapN2R,
                                                      double?expMedCapAR, double?expMedCapBPNR, double?expMedCapNRAP,
                                                      double?expMedIFFromStrg, double?expNumberLayers, double?expLayerCapacity,
                                                      double?expRSWidth, double?expRSArea, double?expRockCap,
                                                      double?expRockCapBP, double?expRockCapAP, double?expMaxIncVolInputIntoRock,
                                                      double?expRaM, double?expBotInfArea, double?expMaxDsgnInfVolPerTS,
                                                      double?expSurfArea75, double?expOverFlowESA75,
                                                      double?expMaxSurfVol, double?expOverFlowESurfVol)
        {
            var ctch = MakeFlatPlanterCatchment(blndSoilDepth, ift, natInfRate, lvl, cfg, impArea,
                                                preCN, postCn, preTC, postTC, infPcnt, botArea, botWidth, botPerimeter,
                                                ss, freeBrd, ovflHgt, ovflSA, ovflEHgt, ovflESA, rockBotArea, rockStrgDepth,
                                                rockWidth, porosity, belowPipeStrgDepth, orificeDiameter, rsn);
            var calc = Calculator.Make(ctch.Facility.Category);

            Assert.IsNotNull(calc);
            var cv = calc.CalculateCommonValues(ctch);

            Assert.AreEqual(expORArea, (double)cv.OrificeArea.Value, dlta, "OrificeArea");
            Assert.AreEqual(expUnderDrainlen, (double)cv.UnderDrainLength.Value, dlta, "UnderDrainLength");
            Assert.AreEqual(expMaxSurfDepth, (double)cv.MaxSurfaceAreaDepth, dlta, "MaxSurfaceAreaDepth");
            Assert.AreEqual(expBSD, (double)cv.BSDFt, "BSDFt");
            Assert.AreEqual(expBSDAR, (double)cv.BSDARFt, "BSDARFt");
            Assert.AreEqual(expMaxRSD, (double)cv.MaxRockStorageDepthFt, "MaxRockStorageDepthFt");
            Assert.AreEqual(expMaxRSDBP, (double)cv.UnderdrainHeightFt, "UnderdrainHeightFt");
            Assert.AreEqual(expMaxRSDAP, (double)cv.MaxRSDAbovePipeFt, "MaxRSDAbovePipeFt");
            Assert.AreEqual(expMedCapN2R, (double)cv.MediaCapacityNext2Rock, "MediaCapacityNext2Rock");
            Assert.AreEqual(expMedCapAR, (double)cv.MaxMediaVolumeAboveRock, "MaxMediaVolumeAboveRock");
            Assert.AreEqual(expMedCapBPNR, (double)cv.MediaCapacityBPnr, "MediaCapacityBPnr");
            Assert.AreEqual(expMedCapNRAP, (double)cv.MaxMediaVolumeNRap, "MaxMediaVolumeNRap");
            Assert.AreEqual(expMedIFFromStrg, (double)cv.MaxMediaInflowFromStorageVolume,
                            "MaxMediaInflowFromStorageVolume");
            Assert.AreEqual(expNumberLayers, (double)cv.NumberLayers, "NumberLayers");
            Assert.AreEqual(expLayerCapacity, (double)cv.LayerStorageVolume, "LayerStorageVolume");
            Assert.AreEqual(expRSWidth, (double)cv.RockStorageWidth, "RockStorageWidth");
            Assert.AreEqual(expRSArea, (double)cv.RockStorageArea, "RockStorageArea");
            Assert.AreEqual(expRockCap, (double)cv.RockCapacity, "RockCapacity");
            Assert.AreEqual(expRockCapBP, (double)cv.RockCapacityBelowPipe, "RockCapacityBelowPipe");
            Assert.AreEqual(expRockCapAP, (double)cv.RockCapacityAbovePipe, "RockCapacityAbovePipe");
            Assert.AreEqual(expMaxIncVolInputIntoRock, (double)cv.MaxIncrementalVolumeInputIntoRock,
                            "MaxIncrementalVolumeInputIntoRock");
            Assert.AreEqual(expRaM, (double)cv.RAM, "RAM");
            Assert.AreEqual(expBotInfArea, (double)cv.BottomInfiltrationArea, "BottomInfiltrationArea");
            Assert.AreEqual(expMaxDsgnInfVolPerTS, (double)cv.MaxDesignInfiltrationVolPerTimeStep,
                            "MaxDesignInfiltrationVolPerTimeStep");
            Assert.AreEqual(expSurfArea75, (double)cv.SurfaceArea75, "SurfaceArea75");
            Assert.AreEqual(expMaxSurfVol, (double)cv.MaxSurfaceVolume, "MaxSurfaceVolume");
            if (cfg != Configuration.ConfigE)
            {
                return;
            }
            // -------------------------------------------
            Assert.AreEqual(expOverFlowESurfVol, (double)cv.OverflowESurfaceVolume, "OverflowESurfaceVolume");
            Assert.AreEqual(expOFEDep, (double)cv.OverflowEDepthFt, dlta, "OverflowEDepthFt");
            Assert.AreEqual(expOverFlowESA75, (double)cv.OverflowESurfArea75, "OverflowESurfArea75");
        }