C# Class GSF.Historian.Files.ArchiveFile

Inheritance: System.ComponentModel.Component, IArchive, ISupportLifecycle, ISupportInitialize, IProvideStatus, IPersistSettings
Afficher le fichier Open project: GridProtectionAlliance/gsf Class Usage Examples

Private Properties

Свойство Type Description
BeginInit void
BuildHistoricFileList void
CloseStream void
ConserveMemoryTimer_Elapsed void
CurrentDataQueue_ProcessException void
DeleteFile void
EndInit void
FileWatcher_Created void
FileWatcher_Deleted void
FileWatcher_Renamed void
FindHistoricArchiveFileForRead bool
FindHistoricArchiveFileForWrite bool
GetHistoricFileInfo Info
HistoricDataQueue_ProcessException void
InsertInCurrentArchiveFile void
IsNewHistoricArchiveFile bool
MaintainMaximumNumberOfHistoricFiles void
MetadataFile_FileModified void
MoveFile void
OffloadHistoricFiles void
OffloadMaxAgedFiles void
OpenStream void
OutOfSequenceDataQueue_ProcessException void
PrepareForRollover void
ReOpen void
ReadData IEnumerable
SyncStateFile void
WriteToCurrentArchiveFile void
WriteToHistoricArchiveFile void

Méthodes publiques

Méthode Description
ArchiveFile ( ) : System

Initializes a new instance of the ArchiveFile class.

ArchiveFile ( IContainer container ) : System

Initializes a new instance of the ArchiveFile class.

Close ( ) : void

Closes the ArchiveFile if it IsOpen.

Initialize ( ) : void

Initializes the ArchiveFile.

Initialize() is to be called by user-code directly only if the ArchiveFile is not consumed through the designer surface of the IDE.

LoadSettings ( ) : void

Loads saved settings for the ArchiveFile from the config file if the PersistSettings property is set to true.

MaximumDataBlocks ( double fileSize, int blockSize ) : int

Returns the number of ArchiveDataBlocks an ArchiveFile can have.

Open ( ) : void

Opens the ArchiveFile for use.

ReadData ( IEnumerable historianIDs, DateTime startTime, DateTime endTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( IEnumerable historianIDs, DateTime startTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( IEnumerable historianIDs, TimeTag startTime, TimeTag endTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( IEnumerable historianIDs, TimeTag startTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( IEnumerable historianIDs, bool timeSorted = true ) : IEnumerable

Reads all ArchiveDataPoints from the ArchiveFile for the specified historianIDs.

ReadData ( IEnumerable historianIDs, string startTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( IEnumerable historianIDs, string startTime, string endTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( int historianID, DateTime startTime, DateTime endTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( int historianID, DateTime startTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( int historianID, TimeTag startTime, TimeTag endTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( int historianID, TimeTag startTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( int historianID, bool timeSorted = true ) : IEnumerable

Reads all ArchiveDataPoints from the ArchiveFile for the specified historianID.

ReadData ( int historianID, string startTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadData ( int historianID, string startTime, string endTime, bool timeSorted = true ) : IEnumerable

Reads ArchiveDataPoints from the ArchiveFile.

ReadMetaData ( int historianID ) : byte[]

Reads MetadataRecord for the specified historianID.

ReadMetaDataSummary ( int historianID ) : byte[]

Reads MetadataRecordSummary for the specified historianID.

ReadStateData ( int historianID ) : byte[]

Reads StateRecord for the specified historianID.

ReadStateDataSummary ( int historianID ) : byte[]

Reads StateRecordSummary for the specified historianID.

Rollover ( ) : void

Performs rollover of active ArchiveFile to a new ArchiveFile.

Save ( ) : void

Saves the ArchiveFile.

SaveSettings ( ) : void

Saves settings for the ArchiveFile to the config file if the PersistSettings property is set to true.

SynchronizeStateFile ( ) : void

Requests a resynchronization of the state file.

WriteData ( IDataPoint dataPoint ) : void

Writes the specified dataPoint to the ArchiveFile.

WriteData ( IEnumerable dataPoints ) : void

Writes the specified dataPoints to the ArchiveFile.

WriteMetaData ( int historianID, byte metadata ) : void

Writes metadata for the specified historianID.

WriteStateData ( int historianID, byte statedata ) : void

Writes statedata for the specified historianID.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the ArchiveFile and optionally releases the managed resources.

OnDataReadException ( Exception ex ) : void

Raises the DataReadException event.

OnDataWriteException ( Exception ex ) : void

Raises the DataWriteException event.

OnFileFull ( ) : void

Raises the FileFull event.

OnFutureDataReceived ( IDataPoint dataPoint ) : void

Raises the FutureDataReceived event.

OnHistoricDataReceived ( IDataPoint dataPoint ) : void

Raises the HistoricDataReceived event.

OnHistoricFileListBuildComplete ( ) : void

Raises the HistoricFileListBuildComplete event.

OnHistoricFileListBuildException ( Exception ex ) : void

Raise the HistoricFileListBuildException event.

OnHistoricFileListBuildStart ( ) : void

Raises the HistoricFileListBuildStart event.

OnHistoricFileListUpdated ( ) : void

Raises the HistoricFileListUpdated event.

OnMetadataUpdated ( ) : void

Raises the MetadataUpdated event.

OnOffloadComplete ( ) : void

Raises the OffloadComplete event.

OnOffloadException ( Exception ex ) : void

Raises the OffloadException event.

OnOffloadProgress ( ProcessProgress offloadProgress ) : void

Raises the OffloadProgress event.

OnOffloadStart ( ) : void

Raises the OffloadStart event.

OnOrphanDataReceived ( IDataPoint dataPoint ) : void

Raises the OrphanDataReceived event.

OnOutOfSequenceDataReceived ( IDataPoint dataPoint ) : void

Raises the OutOfSequenceDataReceived event.

OnProcessAlarmNotification ( StateRecord pointState ) : void

Raises the ProcessAlarmNotification event.

OnRolloverComplete ( ) : void

Raises the RolloverComplete event.

OnRolloverException ( Exception ex ) : void

Raises the RolloverException event.

OnRolloverPreparationComplete ( ) : void

Raises the RolloverPreparationComplete event.

OnRolloverPreparationException ( Exception ex ) : void

Raises the RolloverPreparationException event.

OnRolloverPreparationStart ( ) : void

Raises the RolloverPreparationStart event.

OnRolloverStart ( ) : void

Raises the RolloverStart event.

WaitForReadersRelease ( ) : bool

Waits for all readers to relinquish read locks on active file.

Private Methods

Méthode Description
BeginInit ( ) : void
BuildHistoricFileList ( ) : void
CloseStream ( ) : void
ConserveMemoryTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void
CurrentDataQueue_ProcessException ( object sender, EventArgs e ) : void
DeleteFile ( string fileName ) : void
EndInit ( ) : void
FileWatcher_Created ( object sender, FileSystemEventArgs e ) : void
FileWatcher_Deleted ( object sender, FileSystemEventArgs e ) : void
FileWatcher_Renamed ( object sender, RenamedEventArgs e ) : void
FindHistoricArchiveFileForRead ( System.ComponentModel.Info fileInfo, TimeTag startTime, TimeTag endTime ) : bool
FindHistoricArchiveFileForWrite ( System.ComponentModel.Info fileInfo, TimeTag searchTime ) : bool
GetHistoricFileInfo ( string fileName ) : Info
HistoricDataQueue_ProcessException ( object sender, EventArgs e ) : void
InsertInCurrentArchiveFile ( IDataPoint items ) : void
IsNewHistoricArchiveFile ( Info fileInfo, string fileName ) : bool
MaintainMaximumNumberOfHistoricFiles ( ) : void
MetadataFile_FileModified ( object sender, EventArgs e ) : void
MoveFile ( string sourceFileName, string destinationFileName ) : void
OffloadHistoricFiles ( ) : void
OffloadMaxAgedFiles ( ) : void
OpenStream ( ) : void
OutOfSequenceDataQueue_ProcessException ( object sender, EventArgs e ) : void
PrepareForRollover ( ) : void
ReOpen ( ) : void
ReadData ( IEnumerable historianIDs, TimeTag startTime, TimeTag endTime, IDataPoint resumeFrom, bool timeSorted ) : IEnumerable
SyncStateFile ( object state ) : void
WriteToCurrentArchiveFile ( IDataPoint items ) : void
WriteToHistoricArchiveFile ( IDataPoint items ) : void

Method Details

ArchiveFile() public méthode

Initializes a new instance of the ArchiveFile class.
public ArchiveFile ( ) : System
Résultat System

ArchiveFile() public méthode

Initializes a new instance of the ArchiveFile class.
public ArchiveFile ( IContainer container ) : System
container IContainer object that contains the .
Résultat System

Close() public méthode

Closes the ArchiveFile if it IsOpen.
public Close ( ) : void
Résultat void

Dispose() protected méthode

Releases the unmanaged resources used by the ArchiveFile and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Résultat void

Initialize() public méthode

Initializes the ArchiveFile.
Initialize() is to be called by user-code directly only if the ArchiveFile is not consumed through the designer surface of the IDE.
public Initialize ( ) : void
Résultat void

LoadSettings() public méthode

Loads saved settings for the ArchiveFile from the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public LoadSettings ( ) : void
Résultat void

MaximumDataBlocks() public static méthode

Returns the number of ArchiveDataBlocks an ArchiveFile can have.
public static MaximumDataBlocks ( double fileSize, int blockSize ) : int
fileSize double Size (in MB) of the .
blockSize int Size (in KB) of the s in the .
Résultat int

OnDataReadException() protected méthode

Raises the DataReadException event.
protected OnDataReadException ( Exception ex ) : void
ex Exception to send to event.
Résultat void

OnDataWriteException() protected méthode

Raises the DataWriteException event.
protected OnDataWriteException ( Exception ex ) : void
ex Exception to send to event.
Résultat void

OnFileFull() protected méthode

Raises the FileFull event.
protected OnFileFull ( ) : void
Résultat void

OnFutureDataReceived() protected méthode

Raises the FutureDataReceived event.
protected OnFutureDataReceived ( IDataPoint dataPoint ) : void
dataPoint IDataPoint to send to event.
Résultat void

OnHistoricDataReceived() protected méthode

Raises the HistoricDataReceived event.
protected OnHistoricDataReceived ( IDataPoint dataPoint ) : void
dataPoint IDataPoint to send to event.
Résultat void

OnHistoricFileListBuildComplete() protected méthode

Raises the HistoricFileListBuildComplete event.
protected OnHistoricFileListBuildComplete ( ) : void
Résultat void

OnHistoricFileListBuildException() protected méthode

Raise the HistoricFileListBuildException event.
protected OnHistoricFileListBuildException ( Exception ex ) : void
ex Exception to send to event.
Résultat void

OnHistoricFileListBuildStart() protected méthode

Raises the HistoricFileListBuildStart event.
protected OnHistoricFileListBuildStart ( ) : void
Résultat void

OnHistoricFileListUpdated() protected méthode

Raises the HistoricFileListUpdated event.
protected OnHistoricFileListUpdated ( ) : void
Résultat void

OnMetadataUpdated() protected méthode

Raises the MetadataUpdated event.
protected OnMetadataUpdated ( ) : void
Résultat void

OnOffloadComplete() protected méthode

Raises the OffloadComplete event.
protected OnOffloadComplete ( ) : void
Résultat void

OnOffloadException() protected méthode

Raises the OffloadException event.
protected OnOffloadException ( Exception ex ) : void
ex Exception to send to event.
Résultat void

OnOffloadProgress() protected méthode

Raises the OffloadProgress event.
protected OnOffloadProgress ( ProcessProgress offloadProgress ) : void
offloadProgress ProcessProgress to send to event.
Résultat void

OnOffloadStart() protected méthode

Raises the OffloadStart event.
protected OnOffloadStart ( ) : void
Résultat void

OnOrphanDataReceived() protected méthode

Raises the OrphanDataReceived event.
protected OnOrphanDataReceived ( IDataPoint dataPoint ) : void
dataPoint IDataPoint to send to event.
Résultat void

OnOutOfSequenceDataReceived() protected méthode

Raises the OutOfSequenceDataReceived event.
protected OnOutOfSequenceDataReceived ( IDataPoint dataPoint ) : void
dataPoint IDataPoint to send to event.
Résultat void

OnProcessAlarmNotification() protected méthode

Raises the ProcessAlarmNotification event.
protected OnProcessAlarmNotification ( StateRecord pointState ) : void
pointState StateRecord to send to event.
Résultat void

OnRolloverComplete() protected méthode

Raises the RolloverComplete event.
protected OnRolloverComplete ( ) : void
Résultat void

OnRolloverException() protected méthode

Raises the RolloverException event.
protected OnRolloverException ( Exception ex ) : void
ex Exception to send to event.
Résultat void

OnRolloverPreparationComplete() protected méthode

Raises the RolloverPreparationComplete event.
protected OnRolloverPreparationComplete ( ) : void
Résultat void

OnRolloverPreparationException() protected méthode

Raises the RolloverPreparationException event.
protected OnRolloverPreparationException ( Exception ex ) : void
ex Exception to send to event.
Résultat void

OnRolloverPreparationStart() protected méthode

Raises the RolloverPreparationStart event.
protected OnRolloverPreparationStart ( ) : void
Résultat void

OnRolloverStart() protected méthode

Raises the RolloverStart event.
protected OnRolloverStart ( ) : void
Résultat void

Open() public méthode

Opens the ArchiveFile for use.
One or all of the , or properties are not set.
public Open ( ) : void
Résultat void

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( IEnumerable historianIDs, DateTime startTime, DateTime endTime, bool timeSorted = true ) : IEnumerable
historianIDs IEnumerable Historian identifiers for which s are to be retrieved.
startTime DateTime Start (in UTC) for the s to be retrieved.
endTime DateTime End (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( IEnumerable historianIDs, DateTime startTime, bool timeSorted = true ) : IEnumerable
historianIDs IEnumerable Historian identifiers for which s are to be retrieved.
startTime DateTime Start (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( IEnumerable historianIDs, TimeTag startTime, TimeTag endTime, bool timeSorted = true ) : IEnumerable
historianIDs IEnumerable Historian identifiers for which s are to be retrieved.
startTime TimeTag Start (in UTC) for the s to be retrieved.
endTime TimeTag End (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( IEnumerable historianIDs, TimeTag startTime, bool timeSorted = true ) : IEnumerable
historianIDs IEnumerable Historian identifiers for which s are to be retrieved.
startTime TimeTag Start (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads all ArchiveDataPoints from the ArchiveFile for the specified historianIDs.
public ReadData ( IEnumerable historianIDs, bool timeSorted = true ) : IEnumerable
historianIDs IEnumerable Historian identifiers for which s are to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( IEnumerable historianIDs, string startTime, bool timeSorted = true ) : IEnumerable
historianIDs IEnumerable Historian identifiers for which s are to be retrieved.
startTime string representation of the start time (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( IEnumerable historianIDs, string startTime, string endTime, bool timeSorted = true ) : IEnumerable
historianIDs IEnumerable Historian identifiers for which s are to be retrieved.
startTime string representation of the start time (in UTC) for the s to be retrieved.
endTime string representation of the end time (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( int historianID, DateTime startTime, DateTime endTime, bool timeSorted = true ) : IEnumerable
historianID int Historian identifier for which s are to be retrieved.
startTime DateTime Start (in UTC) for the s to be retrieved.
endTime DateTime End (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( int historianID, DateTime startTime, bool timeSorted = true ) : IEnumerable
historianID int Historian identifier for which s are to be retrieved.
startTime DateTime Start (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( int historianID, TimeTag startTime, TimeTag endTime, bool timeSorted = true ) : IEnumerable
historianID int Historian identifier for which s are to be retrieved.
startTime TimeTag Start (in UTC) for the s to be retrieved.
endTime TimeTag End (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( int historianID, TimeTag startTime, bool timeSorted = true ) : IEnumerable
historianID int Historian identifier for which s are to be retrieved.
startTime TimeTag Start (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads all ArchiveDataPoints from the ArchiveFile for the specified historianID.
public ReadData ( int historianID, bool timeSorted = true ) : IEnumerable
historianID int Historian identifier for which s are to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( int historianID, string startTime, bool timeSorted = true ) : IEnumerable
historianID int Historian identifier for which s are to be retrieved.
startTime string representation of the start time (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadData() public méthode

Reads ArchiveDataPoints from the ArchiveFile.
public ReadData ( int historianID, string startTime, string endTime, bool timeSorted = true ) : IEnumerable
historianID int Historian identifier for which s are to be retrieved.
startTime string representation of the start time (in UTC) for the s to be retrieved.
endTime string representation of the end time (in UTC) for the s to be retrieved.
timeSorted bool Indicates whether the data retrieved from the archive should be time sorted.
Résultat IEnumerable

ReadMetaData() public méthode

Reads MetadataRecord for the specified historianID.
public ReadMetaData ( int historianID ) : byte[]
historianID int Historian identifier.
Résultat byte[]

ReadMetaDataSummary() public méthode

Reads MetadataRecordSummary for the specified historianID.
public ReadMetaDataSummary ( int historianID ) : byte[]
historianID int Historian identifier.
Résultat byte[]

ReadStateData() public méthode

Reads StateRecord for the specified historianID.
public ReadStateData ( int historianID ) : byte[]
historianID int Historian identifier.
Résultat byte[]

ReadStateDataSummary() public méthode

Reads StateRecordSummary for the specified historianID.
public ReadStateDataSummary ( int historianID ) : byte[]
historianID int Historian identifier.
Résultat byte[]

Rollover() public méthode

Performs rollover of active ArchiveFile to a new ArchiveFile.
is not .
public Rollover ( ) : void
Résultat void

Save() public méthode

Saves the ArchiveFile.
is not open.
public Save ( ) : void
Résultat void

SaveSettings() public méthode

Saves settings for the ArchiveFile to the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public SaveSettings ( ) : void
Résultat void

SynchronizeStateFile() public méthode

Requests a resynchronization of the state file.
public SynchronizeStateFile ( ) : void
Résultat void

WaitForReadersRelease() protected méthode

Waits for all readers to relinquish read locks on active file.
protected WaitForReadersRelease ( ) : bool
Résultat bool

WriteData() public méthode

Writes the specified dataPoint to the ArchiveFile.
public WriteData ( IDataPoint dataPoint ) : void
dataPoint IDataPoint to be written.
Résultat void

WriteData() public méthode

Writes the specified dataPoints to the ArchiveFile.
public WriteData ( IEnumerable dataPoints ) : void
dataPoints IEnumerable points to be written.
Résultat void

WriteMetaData() public méthode

Writes metadata for the specified historianID.
public WriteMetaData ( int historianID, byte metadata ) : void
historianID int Historian identifier.
metadata byte data.
Résultat void

WriteStateData() public méthode

Writes statedata for the specified historianID.
public WriteStateData ( int historianID, byte statedata ) : void
historianID int Historian identifier.
statedata byte data.
Résultat void