HydrologicEngineeringCenter / ExcelToCWMS

1 stars 2 forks source link

TS.WriteToConsole shows DB native units (metric) #18

Closed Tich1212 closed 3 years ago

Tich1212 commented 3 years ago

image

 public void WriteToConsole()
        {
            Console.WriteLine("TSID = "+TSID);
            Console.WriteLine("Units = " + Units);
            foreach (var item in data)
            {
                Console.WriteLine("{0:dd-MMM-yyyy HHmm}{1,10:f3}{2,8:d}", item.Key, item.Value.Value, item.Value.Quality);
            }
        }
Tich1212 commented 3 years ago

LookUpUnits is always returning null. Looks like there is not a "UNIT_ID" in returned table. but units are stored in [0][2]

image

https://github.com/HydrologicEngineeringCenter/ExcelToCWMS/blob/5e8666f9c0553e61d4dd5752677bf9607c564631/Hec.Cwms/CwmsDatabase.cs#L70-L76

So ReadTimeSeries units are null and the timeseries data is returned in metric: https://github.com/HydrologicEngineeringCenter/ExcelToCWMS/blob/5e8666f9c0553e61d4dd5752677bf9607c564631/Hec.Cwms/CwmsDatabase.cs#L79-L86

Tich1212 commented 3 years ago

Issue addressed with Pull Request #20.