From OpenSCADAWiki
Jump to: navigation, search

The OpenSCADA software interface to implement an access to the archived data is presented by the objects and virtual functions of the calls from the OpenSCADA core:

  • TTypeArchivator->TModule — The root module's object of the "Archives" subsystem:
    • TMArchivator *AMess(const string &id, const string &db ); — It is called when you open or create a new message archiver id by this module in the db storage.
    • TVArchivator *AVal(const string &id, const string &db ); — It is called when you open or create a new values archiver id by this module in the db storage.
  • TMArchivator — The messages archiver object with its own archiving method and storage location:
    • void start( ); — Start of the archiver. The archiver starts to receive messages and place them into storage.
    • void stop( ); — Stop of the archiver.
    • time_t begin( ); — Data beginning in the archiver accordingly with the current state of the storage.
    • time_t end( ); — Data end in the archiver in accordance with the current state of the storage.
    • void put( vector<TMess::SRec> &mess ); — Call to place the mess messages in the storage.
    • void get( time_t b_tm, time_t e_tm, vector<TMess::SRec> &mess, const string &category = "", char level = 0, time_t upTo = 0 ); — Request of the mess messages in the archive for the b_tm...e_tm interval according to the category template category and the level, with the restriction on the request time to upTo.
  • TVArchivator — The values archiver object with its own archiving method and storage location:
    • void setValPeriod( double per ); — It is called when the archivers values frequency is changed.
    • void setArchPeriod( int per ); — It is called when the archiving frequency is changed.
    • void start( ); — Start of the archiver. The archiver starts to receive messages and place them into storage.
    • void stop( bool full_del = false ); — Stop of the archiver with the ability to completely remove its data from the storage, if the full_del is set.
    • TVArchEl *getArchEl( TVArchive &arch ); — Request the object-representative of the arch archive, served by the archiver.
  • TVArchEl — The representative object of the values in the archiver's storage:
    • void fullErase( ); — It is called to complete remove a part of the archive in the archiver.
    • int64_t end( ); — End time of the archive in the archiver.
    • int64_t begin( ); — Start time of the archive in the archiver.
    • TVariant getValProc( int64_t *tm, bool up_ord ); — The request for the processing of one value from the archive for the time tm and fine-tuning to the upper value in the sampling grid up_ord.
    • void getValsProc( TValBuf &buf, int64_t beg, int64_t end ); — The request for the getting values group processing buf for the specified period of time.
    • void setValsProc( TValBuf &buf, int64_t beg, int64_t end ); — The request for the setting values group processing buf for the specified period of time.