//private string aaConfigName(McfDataSet.sitemcfRow s) //{ // string rval = "unknown"; // if (s.DCPMFG == "S" && s.REPINT == 60 // && s.SCHAN != 42 && s.SCHAN != 54) // rval = "SutronSatlink"; // if (s.DCPMFG == "S") // rval = "Sutron8xxx"; // if (s.DCPMFG == "D") // rval = "DesignAnalysis"; // if (s.DCPMFG == "V") // rval = "VitelVX1004"; // if (s.DCPMFG == "A") // rval = "FTSTX312"; // return rval + "-pnusbr"; //} // SetupNetworkList(); public void InsertSites() { int id = NextID(svr, "site"); int count = 0; for (int i = 0; i < mcf.sitemcf.Rows.Count; i++) { Reclamation.TimeSeries.Hydromet.McfDataSet.sitemcfRow s = mcf.sitemcf[i]; var usgs_id = ""; if (!InSiteList(s.SITE)) { continue; } if (SiteExists(s.SITE)) { string msg = "Site " + s.SITE + " " + s.DESCR + " Allready in DECODES "; Logger.WriteLine(msg); continue; } string active_flag = "TRUE"; if (s.MASTERSW != 1) { active_flag = "FALSE"; } decodes.site.AddsiteRow(id, s.LAT.ToString(), s.LONG.ToString(), "", s.STATE, "", s.TimeZone(s.TZONE.ToString()), "USA", s.ELEV, "ft", s.DESCR, active_flag, "", 0, ""); decodes.site_property.Addsite_propertyRow(id, "accessControlList", s.ACL); decodes.site_property.Addsite_propertyRow(id, "alternateID", s.ALTID); decodes.site_property.Addsite_propertyRow(id, "catagoryID", s.CATID); decodes.site_property.Addsite_propertyRow(id, "stationType", s.STATYPE); decodes.site_property.Addsite_propertyRow(id, "group", s.GRP.ToString()); decodes.site_property.Addsite_propertyRow(id, "telemetryType", s.TTYPE); decodes.site_property.Addsite_propertyRow(id, "timeZone", s.TTYPE); decodes.site_property.Addsite_propertyRow(id, "codingType", s.CTYPE); decodes.site_property.Addsite_propertyRow(id, "masterSwitch", s.MASTERSW.ToString()); decodes.site_property.Addsite_propertyRow(id, "dayfileSwitch", s.DFMSW.ToString()); decodes.site_property.Addsite_propertyRow(id, "archiverSwitch", s.ACMSW.ToString()); decodes.sitename.AddsitenameRow(id, "cbtt", s.SITE.Trim(), "", ""); decodes.sitename.AddsitenameRow(id, "usgs", usgs_id, "", ""); count++; id++; } Logger.WriteLine("added " + count + " sites"); DecodesUtility.UpdateServer(svr, decodes); DecodesUtility.UpdateSequences(svr); }
public void importMcf(string networkListName) { int networklistid = SetupNetworkList(networkListName); InsertSites(); InsertGoesPlatform(networklistid); DecodesUtility.UpdateServer(svr, decodes); DecodesUtility.UpdateSequences(svr); svr.Vacuum(); }
public void importMcf(string[] siteFilter, string networkListName) { // DecodesUtility.TruncateTables(svr); //DecodesUtility.AddEquipment(decodes); int networklistid = SetupNetworkList(networkListName); InsertSite(siteFilter); platformID = NextID(svr, "platform"); platformConfigID = NextID(svr, "platformconfig"); decodesScriptID = NextID(svr, "decodesscript"); InsertGoesPlatform(siteFilter, networklistid); DecodesUtility.UpdateServer(svr, decodes); svr.Vacuum(); }