예제 #1
0
        /// <summary>
        /// Add the following
        ///
        /// cbtt_ch|gh = ""
        /// cbtt_hh|hj = ConstantShift(...)
        /// cbtt_(q|qc) = GenericWeir(....)
        ///
        /// </summary>
        /// <param name="sc"></param>
        /// <param name="prop"></param>
        /// <param name="cbtt"></param>
        /// <param name="pc"></param>
        /// <param name="width_factor"></param>
        /// <param name="exponent"></param>
        /// <param name="offset"></param>
        /// <param name="shift"></param>
        private static void AddGenericWeir(TimeSeriesDatabaseDataSet.SeriesCatalogDataTable sc,
                                           TimeSeriesDatabaseDataSet.seriespropertiesDataTable prop,
                                           string cbtt, string pc,
                                           string width_factor, string exponent, string offset, string shift)
        {
            string shiftCode = "";
            string flowCode  = "";

            if (pc == "ch")
            {
                shiftCode = "hh";
                flowCode  = "qc";
            }
            else
            {
                shiftCode = "hj";
                flowCode  = "q";
            }
            int parentID = 0; // TO DO.
            // afci_qc = GenericWeir(afci_ch,width_factor,exponent) // smart to look for shift... in afci_ch.Properties.shift
            // afci_hh = ConstantShift(afci_ch); // lookup shift from properties...
            // afci_ch.shift=-0.41


            var id = sc.AddInstantRow(cbtt, parentID, "feet", pc, "");

            prop.Set("shift", shift, id); // save current shift in properties.
            prop.Set("program", "hydromet", id);
            sc.AddInstantRow(cbtt, parentID, "feet", shiftCode, "ConstantShift(%site%_" + pc + ")");
            prop.Set("program", "hydromet", id);

            string expression = "GenericWeir(%site%_" + pc + "," + offset + "," + width_factor + "," + exponent + ")";

            id = sc.AddInstantRow(cbtt, parentID, "cfs", flowCode, expression);
            prop.Set("program", "hydromet", id);
        }
예제 #2
0
파일: AddSite.cs 프로젝트: jmptrader/Pisces
 private void AddInstantRow(string siteID, string units, string pcode, string expression = "")
 {
     m_seriesCatalog.AddInstantRow(siteID, 0, units, pcode, expression);
 }