Common: the DeadbandSettings class and .set_parms method

Cogent Tools Demo and Tutorials: Version 4.0
Prev | Chapter 14. History Functions | Next

# 14.23. Common: the `DeadbandSettings` class and `.set_parms` method

| This class and method are located in the `lib/common.g` file.

       /*--------------------------------------------------------------------
        * Class:       DeadbandSettings
        * Description: The instance variables of this class correspond to the
        *              four possible types of Cascade Historian deadbands.
        *              They are set by entry values in the Parameters window,
        *              and sent to the Historian by the set_parms() method.
        *------------------------------------------------------------------*/
       class DeadbandSettings
       {
         history;
         absolute = 5;
         percent = 0;
         timelimit = 1;
         countlimit = 0;
       }

       /*--------------------------------------------------------------------
        * Method:      DeadbandSettings.set_parms
        * Returns:     The return from the Cascade Historian,  or nil
        * Description: Assigns the values from the parameter array to the
        *              appropriate instance variables of the class, and sends
        *              them to the Cascade Historian using the send_hs_command()
        *              function.  Activated by the "OK" button.
        *------------------------------------------------------------------*/
       method DeadbandSettings.set_parms(button, p_array)
       {
         .absolute = p_array[0];
         .percent = p_array[1];
         .timelimit = p_array[2];
         .countlimit = p_array[3];
         send_hs_command(button, "deadband", .history,
                      array(.absolute, .percent, .timelimit, .countlimit));
       }

Prev | Home | Next
Common: Sending Commands to the Cascade Historian `send_hs_command`, `assign_history`, `display_hs_info` | Up | Common: Plot Setup - `find_midnite`, `min_max`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.