Files
MuditaOS/module-gui/gui/widgets/TopBar/SIM.cpp
2020-10-20 12:55:10 +02:00

38 lines
852 B
C++

// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "SIM.hpp"
namespace gui
{
using namespace Store;
SIM::SIM(Item *parent, uint32_t x, uint32_t y) : Image(parent, x, y, 0, 0)
{
set(simunknown);
}
void SIM::show(Store::GSM::SIM state)
{
if (state == current) {
return;
}
switch (state) {
case GSM::SIM::SIM1:
set(sim1);
break;
case GSM::SIM::SIM2:
set(sim2);
break;
case GSM::SIM::SIM_FAIL:
set(simfailed);
break;
case GSM::SIM::NONE:
[[fallthrough]];
case GSM::SIM::SIM_UNKNOWN:
set(simunknown);
break;
}
}
}; // namespace gui