PageRenderTime 93ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llui/llstatgraph.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 70 lines | 34 code | 11 blank | 25 comment | 0 complexity | c2a45bb6af7066e76ea02bb5d79e1763 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llstatgraph.h
  3. * @brief Simpler compact stat graph with tooltip
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLSTATGRAPH_H
  27. #define LL_LLSTATGRAPH_H
  28. #include "llview.h"
  29. #include "llframetimer.h"
  30. #include "v4color.h"
  31. class LLStat;
  32. class LLStatGraph : public LLView
  33. {
  34. public:
  35. LLStatGraph(const LLView::Params&);
  36. virtual void draw();
  37. void setLabel(const std::string& label);
  38. void setUnits(const std::string& units);
  39. void setPrecision(const S32 precision);
  40. void setStat(LLStat *statp);
  41. void setThreshold(const S32 i, F32 value);
  42. void setMin(const F32 min);
  43. void setMax(const F32 max);
  44. /*virtual*/ void setValue(const LLSD& value);
  45. LLStat *mStatp;
  46. BOOL mPerSec;
  47. private:
  48. F32 mValue;
  49. F32 mMin;
  50. F32 mMax;
  51. LLFrameTimer mUpdateTimer;
  52. std::string mLabel;
  53. std::string mUnits;
  54. S32 mPrecision; // Num of digits of precision after dot
  55. S32 mNumThresholds;
  56. F32 mThresholds[4];
  57. LLColor4 mThresholdColors[4];
  58. };
  59. #endif // LL_LLSTATGRAPH_H