private void ReadExternalData(DateTime t1, DateTime t2) { var pc = textBoxPcode.Text.Trim().ToLower(); if (GetSourceType() == ExternalSource.USGS) { UsgsDailyParameter usgsParm = FindUsgsParameter(pc); externalSeries = new UsgsDailyValueSeries(this.textBoxUsgs.Text.Trim(), usgsParm); } else if (GetSourceType() == ExternalSource.OWRD) { if (pc == "qd" || pc == "qj") { externalSeries = new OwrdSeries(this.textBoxOwrd.Text.Trim(), OwrdSeries.OwrdDataSet.MDF, this.checkBoxProvisional.Checked); } else if (pc == "af") { externalSeries = new OwrdSeries(this.textBoxOwrd.Text.Trim(), OwrdSeries.OwrdDataSet.Midnight_Volume, this.checkBoxProvisional.Checked); } else { externalSeries = new Series(); } } else if (GetSourceType() == ExternalSource.IDACORP) { externalSeries = GetIdahoPowerSeries(); externalSeries.Units = "cfs"; } else if (GetSourceType() == ExternalSource.nrcs) { var snotelSiteID = NrcsSnotelSeries.LookupSiteID(textBoxSnotel.Text); string snotelParameter = NrcsSnotelSeries.SnotelParameterFromHydrometPcode(pc); externalSeries = new NrcsSnotelSeries(snotelSiteID, snotelParameter); } else if (GetSourceType() == ExternalSource.Idwr) { externalSeries = new IDWRDailySeries(textBoxIdwr.Text.Trim()); } externalSeries.Read(t1, t2); // convert units if needed if (externalSeries.Units == "degrees Celsius") { externalSeries.Units = "degrees C"; } if (externalSeries.Units == "degrees C") { Reclamation.TimeSeries.Math.ConvertUnits(externalSeries, "degrees F"); } externalSeries.Appearance.LegendText = GetSourceType().ToString() + " " + externalSeries.Name; }
private void ReadDailyExternalData(DateTime t1, DateTime t2) { var pc = textBoxPcode.Text.Trim().ToLower(); ExternalSource src = GetSourceType(); switch (src) { case ExternalSource.USGS: UsgsDailyParameter usgsParm = FindUsgsParameter(pc); externalSeries = new UsgsDailyValueSeries(this.textBoxUsgs.Text.Trim(), usgsParm); break; case ExternalSource.OWRD: if (pc == "qd" || pc == "qj") { externalSeries = new OwrdSeries(this.textBoxOwrd.Text.Trim(), OwrdSeries.OwrdDataSet.MDF, this.checkBoxProvisional.Checked); } else if (pc == "af") { externalSeries = new OwrdSeries(this.textBoxOwrd.Text.Trim(), OwrdSeries.OwrdDataSet.Midnight_Volume, this.checkBoxProvisional.Checked); } else { externalSeries = new Series(); } break; case ExternalSource.IDACORP: externalSeries = GetIdahoPowerSeries(); externalSeries.Units = "cfs"; break; case ExternalSource.nrcs: var snotelSiteID = NrcsSnotelSeries.LookupSiteID(textBoxSnotel.Text); string snotelParameter = NrcsSnotelSeries.SnotelParameterFromHydrometPcode(pc); externalSeries = new NrcsSnotelSeries(snotelSiteID, snotelParameter); externalSeries.Units = "in"; break; case ExternalSource.Idwr: externalSeries = new IDWRDailySeries(textBoxIdwr.Text.Trim()); break; default: updateStatus("Invalid Data Source. Missing data?", true); externalSeries = new Series("", TimeInterval.Daily); return; } externalSeries.Read(t1, t2); // convert units if needed if (externalSeries.Units == "degrees Celsius") { externalSeries.Units = "degrees C"; } if (externalSeries.Units == "degrees C") { Reclamation.TimeSeries.Math.ConvertUnits(externalSeries, "degrees F"); } externalSeries.Appearance.LegendText = GetSourceType().ToString() + " " + externalSeries.Name; }