// UL/DL Status Sections
if (AzureusCoreFactory.isCoreRunning()) {
AzureusCore core = AzureusCoreFactory.getSingleton();
GlobalManager gm = core.getGlobalManager();
GlobalManagerStats stats = gm.getStats();
int dl_limit = NetworkManager.getMaxDownloadRateBPS() / 1024;
long rec_data = stats.getDataReceiveRate();
long rec_prot = stats.getProtocolReceiveRate();
if (last_dl_limit != dl_limit || last_rec_data != rec_data || last_rec_prot != rec_prot) {
last_dl_limit = dl_limit;
last_rec_data = rec_data;
last_rec_prot = rec_prot;
statusDown.setText((dl_limit == 0 ? "" : "[" + dl_limit + "K] ")
+ DisplayFormatters.formatDataProtByteCountToKiBEtcPerSec(rec_data, rec_prot));
}
boolean auto_up = TransferSpeedValidator.isAutoSpeedActive(gm)
&& TransferSpeedValidator.isAutoUploadAvailable(core);
int ul_limit_norm = NetworkManager.getMaxUploadRateBPSNormal() / 1024;
String seeding_only;
if (NetworkManager.isSeedingOnlyUploadRate()) {
int ul_limit_seed = NetworkManager.getMaxUploadRateBPSSeedingOnly() / 1024;
if (ul_limit_seed == 0) {
seeding_only = "+" + Constants.INFINITY_STRING + "K";
} else {
int diff = ul_limit_seed - ul_limit_norm;
seeding_only = (diff >= 0 ? "+" : "") + diff + "K";
}
} else {
seeding_only = "";
}
int sent_data = stats.getDataSendRate();
if (imgRec != null && !imgRec.isDisposed()) {
updateGraph(statusDown, imgRec, rec_data, max_rec);
updateGraph(statusUp, imgSent, sent_data, max_sent);
}
statusUp.setText((ul_limit_norm == 0 ? "" : "[" + ul_limit_norm + "K"
+ seeding_only + "]")
+ (auto_up ? "* " : " ")
+ DisplayFormatters.formatDataProtByteCountToKiBEtcPerSec(
sent_data, stats.getProtocolSendRate()));
}
}