aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertopobjects.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloatertopobjects.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llfloatertopobjects.cpp')
-rw-r--r--linden/indra/newview/llfloatertopobjects.cpp52
1 files changed, 38 insertions, 14 deletions
diff --git a/linden/indra/newview/llfloatertopobjects.cpp b/linden/indra/newview/llfloatertopobjects.cpp
index a6efb06..02be0f9 100644
--- a/linden/indra/newview/llfloatertopobjects.cpp
+++ b/linden/indra/newview/llfloatertopobjects.cpp
@@ -44,6 +44,7 @@
44#include "lllineeditor.h" 44#include "lllineeditor.h"
45#include "lltextbox.h" 45#include "lltextbox.h"
46#include "lltracker.h" 46#include "lltracker.h"
47#include "llviewermessage.h"
47#include "llviewerparcelmgr.h" 48#include "llviewerparcelmgr.h"
48#include "llviewerregion.h" 49#include "llviewerregion.h"
49#include "lluictrlfactory.h" 50#include "lluictrlfactory.h"
@@ -51,6 +52,8 @@
51 52
52LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL; 53LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL;
53 54
55// Globals
56// const U32 TIME_STR_LENGTH = 30;
54 57
55// static 58// static
56void LLFloaterTopObjects::show() 59void LLFloaterTopObjects::show()
@@ -67,7 +70,7 @@ void LLFloaterTopObjects::show()
67} 70}
68 71
69LLFloaterTopObjects::LLFloaterTopObjects() 72LLFloaterTopObjects::LLFloaterTopObjects()
70: LLFloater("top_objects"), 73: LLFloater(std::string("top_objects")),
71 mInitialized(FALSE), 74 mInitialized(FALSE),
72 mtotalScore(0.f) 75 mtotalScore(0.f)
73{ 76{
@@ -124,7 +127,7 @@ BOOL LLFloaterTopObjects::postBuild()
124 127
125 mCurrentMode = STAT_REPORT_TOP_SCRIPTS; 128 mCurrentMode = STAT_REPORT_TOP_SCRIPTS;
126 mFlags = 0; 129 mFlags = 0;
127 mFilter = ""; 130 mFilter.clear();
128 131
129 return TRUE; 132 return TRUE;
130} 133}
@@ -161,11 +164,14 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
161 for (S32 block = 0; block < block_count; ++block) 164 for (S32 block = 0; block < block_count; ++block)
162 { 165 {
163 U32 task_local_id; 166 U32 task_local_id;
167 U32 time_stamp = 0;
164 LLUUID task_id; 168 LLUUID task_id;
165 F32 location_x, location_y, location_z; 169 F32 location_x, location_y, location_z;
166 F32 score; 170 F32 score;
167 char name_buf[MAX_STRING]; /* Flawfinder: ignore */ 171 std::string name_buf;
168 char owner_buf[MAX_STRING]; /* Flawfinder: ignore */ 172 std::string owner_buf;
173 F32 mono_score = 0.f;
174 bool have_extended_data = false;
169 175
170 msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block); 176 msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block);
171 msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block); 177 msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block);
@@ -173,17 +179,24 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
173 msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationY, location_y, block); 179 msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationY, location_y, block);
174 msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationZ, location_z, block); 180 msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationZ, location_z, block);
175 msg->getF32Fast(_PREHASH_ReportData, _PREHASH_Score, score, block); 181 msg->getF32Fast(_PREHASH_ReportData, _PREHASH_Score, score, block);
176 msg->getStringFast(_PREHASH_ReportData, _PREHASH_TaskName, MAX_STRING, name_buf, block); 182 msg->getStringFast(_PREHASH_ReportData, _PREHASH_TaskName, name_buf, block);
177 msg->getStringFast(_PREHASH_ReportData, _PREHASH_OwnerName, MAX_STRING, owner_buf, block); 183 msg->getStringFast(_PREHASH_ReportData, _PREHASH_OwnerName, owner_buf, block);
178 184 if(msg->getNumberOfBlocks("DataExtended"))
185 {
186 have_extended_data = true;
187 msg->getU32("DataExtended", "TimeStamp", time_stamp, block);
188 msg->getF32(_PREHASH_ReportData, "MonoScore", mono_score, block);
189 }
190
179 LLSD element; 191 LLSD element;
180 192
181 element["id"] = task_id; 193 element["id"] = task_id;
182 element["object_name"] = LLString(name_buf); 194 element["object_name"] = name_buf;
183 element["owner_name"] = LLString(owner_buf); 195 element["owner_name"] = owner_buf;
184 element["columns"][0]["column"] = "score"; 196 element["columns"][0]["column"] = "score";
185 element["columns"][0]["value"] = llformat("%0.3f", score); 197 element["columns"][0]["value"] = llformat("%0.3f", score);
186 element["columns"][0]["font"] = "SANSSERIF"; 198 element["columns"][0]["font"] = "SANSSERIF";
199
187 element["columns"][1]["column"] = "name"; 200 element["columns"][1]["column"] = "name";
188 element["columns"][1]["value"] = name_buf; 201 element["columns"][1]["value"] = name_buf;
189 element["columns"][1]["font"] = "SANSSERIF"; 202 element["columns"][1]["font"] = "SANSSERIF";
@@ -193,7 +206,18 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
193 element["columns"][3]["column"] = "location"; 206 element["columns"][3]["column"] = "location";
194 element["columns"][3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); 207 element["columns"][3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z);
195 element["columns"][3]["font"] = "SANSSERIF"; 208 element["columns"][3]["font"] = "SANSSERIF";
209 element["columns"][3]["column"] = "time";
210 element["columns"][3]["value"] = formatted_time((time_t)time_stamp);
211 element["columns"][3]["font"] = "SANSSERIF";
196 212
213 if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS
214 && have_extended_data)
215 {
216 element["columns"][4]["column"] = "Mono Time";
217 element["columns"][4]["value"] = llformat("%0.3f", mono_score);
218 element["columns"][4]["font"] = "SANSSERIF";
219 }
220
197 list->addElement(element); 221 list->addElement(element);
198 222
199 mObjectListData.append(element); 223 mObjectListData.append(element);
@@ -393,7 +417,7 @@ void LLFloaterTopObjects::onRefresh(void* data)
393{ 417{
394 U32 mode = STAT_REPORT_TOP_SCRIPTS; 418 U32 mode = STAT_REPORT_TOP_SCRIPTS;
395 U32 flags = 0; 419 U32 flags = 0;
396 LLString filter = ""; 420 std::string filter = "";
397 421
398 if (sInstance) 422 if (sInstance)
399 { 423 {
@@ -418,7 +442,7 @@ void LLFloaterTopObjects::onRefresh(void* data)
418 442
419 if (sInstance) 443 if (sInstance)
420 { 444 {
421 sInstance->mFilter = ""; 445 sInstance->mFilter.clear();
422 sInstance->mFlags = 0; 446 sInstance->mFlags = 0;
423 } 447 }
424} 448}
@@ -451,8 +475,8 @@ void LLFloaterTopObjects::showBeacon()
451 LLScrollListItem* first_selected = list->getFirstSelected(); 475 LLScrollListItem* first_selected = list->getFirstSelected();
452 if (!first_selected) return; 476 if (!first_selected) return;
453 477
454 LLString name = first_selected->getColumn(1)->getValue().asString(); 478 std::string name = first_selected->getColumn(1)->getValue().asString();
455 LLString pos_string = first_selected->getColumn(3)->getValue().asString(); 479 std::string pos_string = first_selected->getColumn(3)->getValue().asString();
456 480
457 F32 x, y, z; 481 F32 x, y, z;
458 S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z); 482 S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z);
@@ -460,6 +484,6 @@ void LLFloaterTopObjects::showBeacon()
460 484
461 LLVector3 pos_agent(x, y, z); 485 LLVector3 pos_agent(x, y, z);
462 LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent); 486 LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent);
463 LLString tooltip(""); 487 std::string tooltip("");
464 LLTracker::trackLocation(pos_global, name, tooltip, LLTracker::LOCATION_ITEM); 488 LLTracker::trackLocation(pos_global, name, tooltip, LLTracker::LOCATION_ITEM);
465} 489}