<< Click to Display Table of Contents >>
Playback Queries |
The amount of playback data available can be huge, depending on the application. For smoother Screen browsing, an E3Playback performs database queries in short periods of time, called Slices.
Each playback data slice contains a fixed width of one day. Whenever the clock is positioned on a certain date and time, an E3Playback creates or finds out the time slice that contains the current date and time. Each data slice contains the following information:
•Period of that slice (starting and ending date and time)
•A list of Tags that already have their data loaded on that slice
•For each Tag stored on a slice, the following data is kept:
•The last event of the Tag before the beginning of that slice
•All Tag events inside that slice's interval
•The next Tag event after that slice's ending
•The alarm summary at the exact moment of that slice's beginning
•All alarm events that occurred during that slice's interval
•The next alarm event of each Alarm Source after that slice's ending
When a playback clock is moved over a time slice, an E3Playback analyzes if all necessary Tags are already loaded on that slice, as well as if all alarm information is already loaded. If some data is missing, then an asynchronous query is generated to load necessary data from a database. A playback query is composed of the following parameters:
•Period to search for (starting and ending date and time)
•Set of Tags to search for (this may be an empty set). For each Tag it must return:
•The last event prior to the beginning of that query
•All events occurred during that query's period
•The next event that occurred after the query's period
•Alarm information that must be searched for, which can be zero or more of the following options:
•Previous alarm summary (status of each Alarm Source at the beginning of query's date and time)
•Alarm events on that period
•Next alarm summary (next event of each Alarm Source after the ending of that period's date and time)
To execute a query on playback data, usually several database queries are needed. A playback data server performs these queries asynchronously and on a separate thread, collects data, and only returns them when all queries are finished.
When a playback query is completed, data is immediately added to its corresponding slice and E3Playback automatically triggers queries to update adjacent slices. This way, while the playback clock is moving forward, data queries are performed, and when the playback clock moves on to the next slice it is almost certain that it already contains all data loaded.
In case the playback clock is in Play mode and between a slice without data or with incomplete data, an E3Playback remains temporarily paused waiting for queries of that slice to be completed.
An E3Playback also tries to minimize database access, getting information from Last Previous Event, Next Event After, Previous Summary, and Next Summary fields to avoid querying this data again. For example:
•If a query to a Tag did not return the next event after that query's period, this means that this Tag does not have any event after that query's ending date and time, and therefore this Tag does not need to be queried on the next time slices
•If a query returned a previous summary, alarm events on that period, and the next summary for a slice, it could calculate the previous summary of the next slice simply by combining the previous summary and events occurred during the current slice. This way, there is no need to query a database for the previous summary of the next slice