Warning, /graphics/kst-plot/devel-docs/deprecated/updatecycleexplanation is written in an unsupported language. File is not indexed.

0001 Overview of Update Cycle
0002 
0003 Process Overview
0004 
0005 The basic idea behind the update cycle is that the DataSource detects an update and then emits a signal telling all objects that
0006 are dependent on it to update and the loop continues until all updates are complete.
0007 
0008 Creation of connections
0009 
0010 The connections are all created by the dependent objects connecting to the source's signal.  Each object is responsible for
0011 knowing what objects it depends on and creating and disconnecting the links as necessary when changes are made to the object.
0012 
0013 Processing of updates
0014 
0015 Processing of updates is triggered by the UpdateManager each time the Timer for the minimum update cycle has triggered.  If a 
0016 change was detected the update cycle for the datasources that requested updates begins, otherwise it waits for another minimum
0017 update cycle.
0018 
0019 Detecting change
0020 
0021 Detecting the change to the datasource is the responsibility of the plugin.  There are two common ways to check.
0022 
0023 Timer
0024 
0025   Timer based detecting means that the plugin checks if the datasource has each each time the timer is triggered.
0026 
0027 File Based
0028 
0029   File or Data based detecting does not use a timer but is still constrained by the update cycle timer.  This uses
0030   QFileSystemWatcher to monitor the files on disk and when the file changes the update request is triggered.
0031 
0032 
0033 Requesing Update
0034 
0035 The update manager controls all updates, as such, if any object wants to update it must ask the UpdateManager.  When the 
0036 DataSource detects a change it tells the UpdateManager who, when the timer triggers, begins the update cycle by telling the
0037 DataSource it can notify it's dependents.
0038 
0039 Each Dependent then requests from the UpdateManager to update, and waits for permission to begin, this continues down the 
0040 line until all objects are updated.  The UpdateManager also requires each object indicate when it's update has started and 
0041 finished and uses this information to ensure that each type of update is completed before continuing to the next.  All
0042 DataVectors must be updated before any DataObjects and it continues for Relations and Plots until everything is updated
0043 in such a way as to prevent any data inconsistencies or reprocessing of data.
0044 
0045 
0046 Processing an Update
0047 
0048 Each object processes the update using it's update function and is entirely dependent on the object type.  In doing an update
0049 it must follow the following steps.
0050 
0051   0.  Get an update Signal from parent object.
0052   1.  Request Update from the UpdateManager
0053   2.  Wait for permission to begin.
0054   3.  Notify the UpdateManager it is starting.
0055   4.  Update the object.
0056   5.  emit the Update cycle for dependents to pick up.
0057   6.  Notify the UpdateManager it is finished.
0058 
0059 
0060 Debugging
0061 
0062 Debugging output is configured in updatemanager.h and provides two levels of debugging.
0063 
0064   1   UpdateManager based.  This outputs all data from the UpdateManager.  Lines denoted with UM -
0065   2   Full Debugging.  This also includes output from all Updatable objects as they are updating.  Lines denoted with UP -
0066 
0067 
0068 Sample Output from full debugging.
0069 
0070 UM - Allow updates triggered
0071 UM - Beginning update for "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0072 # Beginning Update Cycle based on DataSource change.
0073         UM - Update beginning for "DS-dm.cur" for update "DS-dm.cur" update count 1
0074                 UP - Data Source update required by Vector "V1" for update of "DS-dm.cur"
0075 # DataSource has 3 Vectors configured for it.  Once update begins each Vector must be updated.
0076 # As each Vector begins updating the update count is incremented and when it finished is 
0077 # decremented.
0078                 UM - Update beginning for "V1" for update "DS-dm.cur" update count 2
0079                         UP - Vector "V1" has been updated as part of update of "DS-dm.cur" informing dependents
0080                         UP - Curve update ready for "DS-dm.cur"
0081 # This vector has two curves associated with it.  After it updates, both request updates.
0082                         UM - Curve "C1" requested update requested for "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0083                              Current dependent update list QMap((DirFileSource(0x80ff448) ,  (Kst::Curve(0xb420a298) )  ) )
0084                         UP - Curve update ready for "DS-dm.cur"
0085                         UM - Curve "C2" requested update requested for "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0086                              Current dependent update list QMap((DirFileSource(0x80ff448) ,  (Kst::Curve(0xb420a298) ,  Kst::Curve(0xb420a998) )  ) )
0087                 UM - Update finish notification from "V1" for update "DS-dm.cur" update count 1
0088 # Vector update is finished update count is reduced.
0089                 UP - Data Source update required by Vector "V2" for update of "DS-dm.cur"
0090                 UM - Update beginning for "V2" for update "DS-dm.cur" update count 2
0091                         UP - Vector "V2" has been updated as part of update of "DS-dm.cur" informing dependents
0092 # Second Vector updating
0093                         UP - Curve update ready for "DS-dm.cur"
0094 # One curve associated.  Overlaps V1, no effective change.
0095                         UM - Curve "C1" requested update requested for "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0096                              Current dependent update list QMap((DirFileSource(0x80ff448) ,  (Kst::Curve(0xb420a298) ,  Kst::Curve(0xb420a998) )  ) )
0097                 UM - Update finish notification from "V2" for update "DS-dm.cur" update count 1
0098                 UP - Data Source update required by Vector "V3" for update of "DS-dm.cur"
0099                 UM - Update beginning for "V3" for update "DS-dm.cur" update count 2
0100                         UP - Vector "V3" has been updated as part of update of "DS-dm.cur" informing dependents
0101 # Third Vector Updating
0102                         UP - Curve update ready for "DS-dm.cur"
0103 # One curve associated.  Overlaps V1, no effective change.
0104                         UM - Curve "C2" requested update requested for "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0105                              Current dependent update list QMap((DirFileSource(0x80ff448) ,  (Kst::Curve(0xb420a298) ,  Kst::Curve(0xb420a998) )  ) )
0106                 UM - Update finish notification from "V3" for update "DS-dm.cur" update count 1
0107         UM - Update finish notification from "DS-dm.cur" for update "DS-dm.cur" update count 0
0108 # All Vectors have now been updated.  The Primitives have all been updated and update count is 0.  Moving on to relations.
0109         UM - All primitive updates complete updating relations for update of "DS-dm.cur"
0110              Current dependentUpdate requests QMap((DirFileSource(0x80ff448) ,  (Kst::Curve(0xb420a298) ,  Kst::Curve(0xb420a998) )  ) )
0111 # Relation Map has been built during Primitive Updates.  Update Manager triggers each.
0112                 UP - Relation "C1" is processing update of "DS-dm.cur"
0113                 UM - Update beginning for "C1" for update "DS-dm.cur" update count 1
0114                 UP - Relation "C1" has been updated as part of update of "DS-dm.cur" informing dependents
0115 # Updating Curve 1, Plots containing Curve request updates.  Update count is tracked.
0116                         UP - Curve update required by Plot for update of "DS-dm.cur"
0117                         UM - Plot update requested for "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0118                              Current display update list QMap((DirFileSource(0x80ff448) ,  (0x80d535c) ) )
0119                         UM - Update finish notification from "C1" for update "DS-dm.cur" update count 0
0120                 UP - Relation "C2" is processing update of "DS-dm.cur"
0121 # Finished Updating Curve, Update count reduced.
0122                 UM - Update beginning for "C2" for update "DS-dm.cur" update count 1
0123                 UP - Relation "C2" has been updated as part of update of "DS-dm.cur" informing dependents
0124 # Repeating for Curve 2
0125                         UP - Curve update required by Plot for update of "DS-dm.cur"
0126                         UM - Plot update requested for "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0127                              Current display update list QMap((DirFileSource(0x80ff448) ,  (0x80d535c, 0x81e0d64) ) )
0128                         UM - Update finish notification from "C2" for update "DS-dm.cur" update count 0
0129         UM - All relation updates complete, updating plots for update of "DS-dm.cur"
0130 # All relations updated, use Map of Plots to trigger update.  No display object is updated until all objects are updated.
0131              Current display update list QMap((DirFileSource(0x80ff448) ,  (0x80d535c, 0x81e0d64) ) )
0132                 UP - Updating Plot
0133                         UP - Updating Plot Projection Rect - X and Y Maximum
0134 # Plot is updated and if necessary zoom is changed.
0135                 UP - Updating Plot
0136                         UP - Updating Plot Projection Rect - X and Y Maximum
0137         UM - All Plot updates completed for update of  "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0138 # Finish of all Plot Updates.
0139 UM - Update Complete for  "/home/kst2/kst/tests/dirfile_maker/dm.cur (DS-dm.cur)"
0140 # Finish of Update Cycle
0141 UM - Delaying for  2000 ms before allowing next update  
0142 # Delay until next update.