summaryrefslogtreecommitdiff
path: root/indra/llui/llstatbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llstatbar.h')
-rw-r--r--indra/llui/llstatbar.h52
1 files changed, 32 insertions, 20 deletions
diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h
index 513fff3234..c366fd65db 100644
--- a/indra/llui/llstatbar.h
+++ b/indra/llui/llstatbar.h
@@ -29,27 +29,33 @@
#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,
+ label_spacing,
+ update_rate,
+ unit_scale;
+
+ Optional<U32> precision;
+
+ Optional<bool> show_per_sec,
+ show_bar,
+ show_history,
+ show_mean;
+
+ Optional<std::string> stat;
+
Params()
: label("label"),
unit_label("unit_label"),
@@ -59,10 +65,11 @@ public:
label_spacing("label_spacing", 10.0f),
precision("precision", 0),
update_rate("update_rate", 5.0f),
- show_per_sec("show_per_sec", TRUE),
+ 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),
+ show_history("show_history", false),
+ show_mean("show_mean", true),
stat("stat")
{
changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
@@ -73,7 +80,8 @@ public:
virtual void draw();
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
- void setStat(LLStat* stat) { mStatp = stat; }
+ void setStat(const std::string& stat_name);
+
void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing);
void getRange(F32& bar_min, F32& bar_max) { bar_min = mMinBar; bar_max = mMaxBar; }
@@ -86,12 +94,16 @@ private:
F32 mLabelSpacing;
U32 mPrecision;
F32 mUpdatesPerSec;
+ F32 mUnitScale;
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;
+ LLTrace::TraceType<LLTrace::CountAccumulator<F64> >* mCountFloatp;
+ LLTrace::TraceType<LLTrace::CountAccumulator<S64> >* mCountIntp;
+ LLTrace::TraceType<LLTrace::MeasurementAccumulator<F64> >* mMeasurementFloatp;
+ LLTrace::TraceType<LLTrace::MeasurementAccumulator<S64> >* mMeasurementIntp;
LLFrameTimer mUpdateTimer;
LLUIString mLabel;