public async Task textSummaryStations(string dbname) { //summary based on total variables List <string> collNames = MongoTools.collectionNames(db); string firstletter = ""; string vname = ""; int stationcode = 0; string source = ""; int freq = 0; foreach (string collection in collNames) { //all station record collections start with an s_ string[] parts = collection.Split('_'); firstletter = parts[0]; if (firstletter == "s") { stationcode = Convert.ToInt32(parts[1]); vname = parts[4]; if (vname == "PA") { continue; } source = parts[2]; freq = Convert.ToInt32(parts[5]); VariableMeta meta = getVariableMetaFromDB(vname, source, db); RecordMeta rm = new RecordMeta(vname, freq); addStation(stationcode); addRecord(stationcode, rm); await getTotalRecords(collection, stationcode, vname); await getDateLimits(collection, stationcode, vname); await insideRange(collection, stationcode, meta); } } annualStats(); insertManyRecordStationSummary(); printToSummary(); }
public void addRecordMeta(RecordMeta record) { recordMeta.Add(record); }
private void addRecord(int code, RecordMeta rm) { var s = stations.Find(x => x.code == code); s.addRecordMeta(rm); }