Beispiel #1
0
/*****************************************************
**
**   Formatter   ---   getFullDateStringFromJD
**
******************************************************/
const wxString Formatter::getFullDateStringFromJD( const double &jd, const int format )
{
	wxString s;
	int year, month, day;

	getDateIntsFromJD( jd, day, month, year );
	int l = LanguageConfig::get()->getLocale()->GetLanguage();
	if ( l == wxLANGUAGE_GERMAN ) // German
		s.Printf( wxT( "%02d.%02d.%04d %s" ), day, month, year, (const wxChar*)getTimeFormatted( getTimeFromJD(jd)) );
	else
		s.Printf( wxT( "%04d-%02d-%02d %s" ), year, month, day, (const wxChar*)getTimeFormatted( getTimeFromJD(jd)) );
	return s;
}
Beispiel #2
0
void PnlGlobal::refresh(GRender& render) {

	std::string time = getTimeFormatted(getUptimeMS());

	render.print(26, 0, time.c_str());

	render.print(1, 0, "packets:");
	render.print(12, 0, intToString(sum.receivedPackets));

	render.print(1, 1, "bytes:");
	render.print(12, 1, intToString(sum.receivedBytes));


	render.print(12, 3, "Total");
	render.print(25, 3, "PerPacket");

	uint32_t payload = sum.receivedBytes - sum.receivedProtocolOverheadBytes;
	uint32_t payloadPerPacket = payload / (sum.receivedPackets + 0.00001);
	render.print(1, 4, "payload:");
	render.print(12, 4, intToString(payload).c_str());
	render.print(25, 4, intToString(payloadPerPacket).c_str());


	uint32_t protoOverhead = (sum.receivedProtocolOverheadBytes) / (float) (payload + 0.00001) * 100;
	uint32_t overheadPerPacket = sum.receivedProtocolOverheadBytes / (sum.receivedPackets + 0.00001);
	std::string overhead = "(" + floatToString(protoOverhead, 1) + "%)";
	render.print(1, 5, "overhead:");
	render.print(12, 5, intToString(sum.receivedProtocolOverheadBytes).c_str());
	render.print(25, 5, intToString(overheadPerPacket).c_str());
	render.print(29, 5, overhead.c_str());

}