Skip to content

Commit 5e583e2

Browse files
committed
all: Removed all isGUI checks from refreshDisplay methods.
1 parent bb39742 commit 5e583e2

File tree

10 files changed

+19
-37
lines changed

10 files changed

+19
-37
lines changed

src/inet/clock/base/ClockBase.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ void ClockBase::finish()
4545

4646
void ClockBase::refreshDisplay() const
4747
{
48-
if (getEnvir()->isGUI()) {
49-
auto text = StringFormat::formatString(displayStringTextFormat, this);
50-
getDisplayString().setTagArg("t", 0, text.c_str());
51-
}
48+
auto text = StringFormat::formatString(displayStringTextFormat, this);
49+
getDisplayString().setTagArg("t", 0, text.c_str());
5250
}
5351

5452
clocktime_t ClockBase::getClockTime() const

src/inet/common/packet/recorder/PcapRecorder.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,8 @@ std::string PcapRecorder::resolveDirective(char directive) const
169169

170170
void PcapRecorder::refreshDisplay() const
171171
{
172-
if (getEnvir()->isGUI()) {
173-
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
174-
getDisplayString().setTagArg("t", 0, text.c_str());
175-
}
172+
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
173+
getDisplayString().setTagArg("t", 0, text.c_str());
176174
}
177175

178176
void PcapRecorder::receiveSignal(cComponent *source, simsignal_t signalID, cObject *obj, cObject *details)

src/inet/linklayer/base/MacRelayUnitBase.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ std::string MacRelayUnitBase::resolveDirective(char directive) const
4848

4949
void MacRelayUnitBase::refreshDisplay() const
5050
{
51-
if (getEnvir()->isGUI()) {
52-
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
53-
getDisplayString().setTagArg("t", 0, text.c_str());
54-
}
51+
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
52+
getDisplayString().setTagArg("t", 0, text.c_str());
5553
}
5654

5755
void MacRelayUnitBase::broadcastPacket(Packet *outgoingPacket, const MacAddress& destinationAddress, NetworkInterface *incomingInterface)

src/inet/linklayer/ethernet/common/MacForwardingTable.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,8 @@ void MacForwardingTable::handleMessageWhenUp(cMessage *)
105105

106106
void MacForwardingTable::refreshDisplay() const
107107
{
108-
if (getEnvir()->isGUI()) {
109-
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
110-
getDisplayString().setTagArg("t", 0, text.c_str());
111-
}
108+
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
109+
getDisplayString().setTagArg("t", 0, text.c_str());
112110
}
113111

114112
std::string MacForwardingTable::resolveDirective(char directive) const

src/inet/linklayer/mrp/Mrp.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -1983,10 +1983,8 @@ void Mrp::refreshDisplay() const
19831983
}
19841984
}
19851985
}
1986-
if (getEnvir()->isGUI()) {
1987-
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
1988-
getDisplayString().setTagArg("t", 0, text.c_str());
1989-
}
1986+
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
1987+
getDisplayString().setTagArg("t", 0, text.c_str());
19901988
}
19911989

19921990
std::string Mrp::resolveDirective(char directive) const

src/inet/networklayer/common/NetworkInterface.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,8 @@ void NetworkInterface::pushPacketEnd(Packet *packet, const cGate *gate)
279279

280280
void NetworkInterface::refreshDisplay() const
281281
{
282-
if (getEnvir()->isGUI()) {
283-
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
284-
getDisplayString().setTagArg("t", 0, text.c_str());
285-
}
282+
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
283+
getDisplayString().setTagArg("t", 0, text.c_str());
286284
}
287285

288286
std::string NetworkInterface::resolveDirective(char directive) const

src/inet/networklayer/ipv4/Ipv4NetworkLayer.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ Define_Module(Ipv4NetworkLayer);
1515

1616
void Ipv4NetworkLayer::refreshDisplay() const
1717
{
18-
if (getEnvir()->isGUI()) {
19-
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
20-
getDisplayString().setTagArg("t", 0, text.c_str());
21-
}
18+
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
19+
getDisplayString().setTagArg("t", 0, text.c_str());
2220
}
2321

2422
std::string Ipv4NetworkLayer::resolveDirective(char directive) const

src/inet/power/storage/SimpleCcBattery.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ void SimpleCcBattery::initialize(int stage)
3636

3737
void SimpleCcBattery::refreshDisplay() const
3838
{
39-
if (getEnvir()->isGUI()) {
40-
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
41-
getDisplayString().setTagArg("t", 0, text.c_str());
42-
}
39+
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
40+
getDisplayString().setTagArg("t", 0, text.c_str());
4341
}
4442

4543
std::string SimpleCcBattery::resolveDirective(char directive) const

src/inet/power/storage/SimpleEpEnergyStorage.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ void SimpleEpEnergyStorage::handleMessage(cMessage *message)
5454

5555
void SimpleEpEnergyStorage::refreshDisplay() const
5656
{
57-
if (getEnvir()->isGUI()) {
58-
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
59-
getDisplayString().setTagArg("t", 0, text.c_str());
60-
}
57+
auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
58+
getDisplayString().setTagArg("t", 0, text.c_str());
6159
}
6260

6361
std::string SimpleEpEnergyStorage::resolveDirective(char directive) const

src/inet/queueing/base/PacketProcessorBase.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void PacketProcessorBase::initialize(int stage)
2626

2727
void PacketProcessorBase::refreshDisplay() const
2828
{
29-
if (getEnvir()->isGUI() && displayStringTextFormat != nullptr) {
29+
if (displayStringTextFormat != nullptr) {
3030
auto text = StringFormat::formatString(displayStringTextFormat, this);
3131
getDisplayString().setTagArg("t", 0, text.c_str());
3232
}

0 commit comments

Comments
 (0)