Example #1
0
 public Archive(RrdDb parentDb, ArcDef arcDef)
 {
    bool shouldInitialize = arcDef != null;
    this.parentDb = parentDb;
    consolFun = new RrdString(this, true);  // constant, may be cached
    xff = new RrdDouble(this);
    steps = new RrdInt(this, true);            // constant, may be cached
    rows = new RrdInt(this, true);            // constant, may be cached
    if (shouldInitialize)
    {
       consolFun.set(arcDef.getConsolFun().Name);
       xff.set(arcDef.getXff());
       steps.set(arcDef.getSteps());
       rows.set(arcDef.getRows());
    }
    int n = parentDb.getHeader().getDsCount();
    states = new ArcState[n];
    robins = new Robin[n];
    for (int i = 0; i < n; i++)
    {
       states[i] = new ArcState(this, shouldInitialize);
       int numRows = rows.get();
       robins[i] = new Robin(this, numRows, shouldInitialize);
    }
 }
Example #2
0
        public Archive(RrdDb parentDb, ArcDef arcDef)
        {
            bool shouldInitialize = arcDef != null;

            this.parentDb = parentDb;
            consolFun     = new RrdString(this, true); // constant, may be cached
            xff           = new RrdDouble(this);
            steps         = new RrdInt(this, true);    // constant, may be cached
            rows          = new RrdInt(this, true);    // constant, may be cached
            if (shouldInitialize)
            {
                consolFun.set(arcDef.getConsolFun().Name);
                xff.set(arcDef.getXff());
                steps.set(arcDef.getSteps());
                rows.set(arcDef.getRows());
            }
            int n = parentDb.getHeader().getDsCount();

            states = new ArcState[n];
            robins = new Robin[n];
            for (int i = 0; i < n; i++)
            {
                states[i] = new ArcState(this, shouldInitialize);
                int numRows = rows.get();
                robins[i] = new Robin(this, numRows, shouldInitialize);
            }
        }
Example #3
0
 public bool ContainsArchive(ArcDef otherArcDef)
 {
     foreach (ArcDef arcDef in arcDefs)
     {
         if (arcDef.getConsolFun().CSType == otherArcDef.getConsolFun().CSType &&
             arcDef.getSteps() == otherArcDef.getSteps())
         {
             return(true);
         }
     }
     return(false);
 }
Example #4
0
 public bool ContainsArchive(ArcDef otherArcDef)
 {
    foreach (ArcDef arcDef in arcDefs)
    {
       if (arcDef.getConsolFun().CSType == otherArcDef.getConsolFun().CSType 
          && arcDef.getSteps() == otherArcDef.getSteps())
          return true;
    }
    return false;
 }
Example #5
0
 public void UpdateArchive(ArcDef updatedArcDef)
 {
    var archDef = EditingDatabaseData.Definition.findArchive(updatedArcDef.getConsolFun(), updatedArcDef.getSteps());
    archDef.setRows(updatedArcDef.getRows());
    DatabaseDirty = true;
 }