summaryrefslogtreecommitdiff
path: root/indra/llui/llstatbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llstatbar.h')
-rwxr-xr-xindra/llui/llstatbar.h98
1 files changed, 60 insertions, 38 deletions
diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h
index 513fff3234..3daec297bb 100755
--- a/indra/llui/llstatbar.h
+++ b/indra/llui/llstatbar.h
@@ -29,41 +29,54 @@
#include "llview.h"
#include "llframetimer.h"
-
-class LLStat;
+#include "lltracerecording.h"
class LLStatBar : public LLView
{
public:
+
struct Params : public LLInitParam::Block<Params, LLView::Params>
{
- Optional<std::string> label;
- Optional<std::string> unit_label;
- Optional<F32> bar_min;
- Optional<F32> bar_max;
- Optional<F32> tick_spacing;
- Optional<F32> label_spacing;
- Optional<U32> precision;
- Optional<F32> update_rate;
- Optional<bool> show_per_sec;
- Optional<bool> show_bar;
- Optional<bool> show_history;
- Optional<bool> show_mean;
- Optional<std::string> stat;
+ Optional<std::string> label,
+ unit_label;
+
+ Optional<F32> bar_min,
+ bar_max,
+ tick_spacing,
+ update_rate,
+ unit_scale;
+
+ Optional<U32> precision;
+
+ Optional<bool> show_per_sec,
+ show_bar,
+ show_history,
+ show_mean,
+ scale_range;
+
+ Optional<S32> num_frames,
+ max_height;
+ Optional<std::string> stat;
+ Optional<EOrientation> orientation;
+
Params()
: label("label"),
unit_label("unit_label"),
bar_min("bar_min", 0.0f),
bar_max("bar_max", 50.0f),
tick_spacing("tick_spacing", 10.0f),
- label_spacing("label_spacing", 10.0f),
precision("precision", 0),
update_rate("update_rate", 5.0f),
- show_per_sec("show_per_sec", TRUE),
- show_bar("show_bar", TRUE),
- show_history("show_history", FALSE),
- show_mean("show_mean", TRUE),
- stat("stat")
+ unit_scale("unit_scale", 1.f),
+ show_per_sec("show_per_sec", true),
+ show_bar("show_bar", true),
+ show_history("show_history", false),
+ show_mean("show_mean", true),
+ scale_range("scale_range", true),
+ num_frames("num_frames", 300),
+ max_height("max_height", 200),
+ stat("stat"),
+ orientation("orientation", VERTICAL)
{
changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
}
@@ -73,30 +86,39 @@ public:
virtual void draw();
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
- void setStat(LLStat* stat) { mStatp = stat; }
- void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing);
+ void setStat(const std::string& stat_name);
+
+ void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing);
void getRange(F32& bar_min, F32& bar_max) { bar_min = mMinBar; bar_max = mMaxBar; }
/*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options.
private:
- F32 mMinBar;
- F32 mMaxBar;
- F32 mTickSpacing;
- F32 mLabelSpacing;
- U32 mPrecision;
- F32 mUpdatesPerSec;
- BOOL mPerSec; // Use the per sec stats.
- BOOL mDisplayBar; // Display the bar graph.
- BOOL mDisplayHistory;
- BOOL mDisplayMean; // If true, display mean, if false, display current value
-
- LLStat* mStatp;
+ F32 mMinBar;
+ F32 mMaxBar;
+ F32 mCurMaxBar;
+ F32 mTickSpacing;
+ F32 mLabelSpacing;
+ U32 mPrecision;
+ F32 mUpdatesPerSec;
+ F32 mUnitScale;
+ S32 mNumFrames;
+ S32 mMaxHeight;
+ bool mPerSec; // Use the per sec stats.
+ bool mDisplayBar; // Display the bar graph.
+ bool mDisplayHistory;
+ bool mDisplayMean; // If true, display mean, if false, display current value
+ bool mScaleRange;
+ EOrientation mOrientation;
+
+ LLTrace::TraceType<LLTrace::CountAccumulator>* mCountFloatp;
+ LLTrace::TraceType<LLTrace::EventAccumulator>* mEventFloatp;
+ LLTrace::TraceType<LLTrace::SampleAccumulator>* mSampleFloatp;
LLFrameTimer mUpdateTimer;
- LLUIString mLabel;
- std::string mUnitLabel;
- F32 mValue;
+ LLUIString mLabel;
+ std::string mUnitLabel;
+ F32 mValue;
};
#endif