/*
 *    SCCS ID: %Z%%M% %I% %E% SST 
 *
 *    Copyright (c) 1992 Mark Soloway.  All rights reserved.
 *    See SST_LEGAL_NOTICE file for terms of the license.
 */

#include "TTGaugePattern.h"
#include "TTMessage.h"

TTGaugePattern::TTGaugePattern (Gauge &gauge, Tt_status &status) :
  TTPattern (status)
{
  if (status == TT_OK) {
    displayGauge = &gauge;
    status = useDefaultPatternCallback (TT_TRUE);
  }
}

TTGaugePattern::~TTGaugePattern ()
{
}

Tt_callback_action TTGaugePattern::defaultPatternCallback (TTMessage *message)
{
  int       value;
  Tt_status status = message->getArgValue (0, value);

  if (status == TT_OK)
    displayGauge->setValue (value);

  return TT_CALLBACK_PROCESSED;
}
