GridProtectionAlliance / openPDC

Open Source Phasor Data Concentrator
MIT License
128 stars 59 forks source link

API to read data from local archive *.d data #125

Closed Xinya-Li closed 5 years ago

Xinya-Li commented 5 years ago

For OpenHistorian, there is a way to read data through a API as described in https://github.com/GridProtectionAlliance/openHistorian/blob/master/Source/Documentation/wiki/openHistorian_Documentation.md "Open Archive" from Historian Trending Tool did a same thing using the connection settings.

Is there a similar way to do that for openPDC archive data (*.d)? The "Open Archive" in Historian Trending Tool in openPDC is different by targeting archive location directly.

Thank you very much

ritchiecarroll commented 5 years ago

Sure. Looks at the source for this tool:

https://github.com/GridProtectionAlliance/gsf/blob/master/Source/Tools/HistorianView/MainWindow.xaml.cs#L600

It opens .D files and queries then visualizes the data using the ArchiveReader class:

https://github.com/GridProtectionAlliance/gsf/blob/master/Source/Libraries/GSF.Historian/Files/ArchiveReader.cs

Thanks, Ritchie