Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DataModel/AccessoryBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace DataModel
inverted(false),
lastUsed(0),
counter(0),
matchKey("")
matchKey("")
{
}

Expand Down
14 changes: 7 additions & 7 deletions DataModel/Feedback.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ namespace DataModel
inline Feedback(Manager* manager,
const FeedbackID feedbackID)
: LayoutItem(feedbackID),
controlID(ControlIdNone),
pin(FeedbackPinNone),
controlID(ControlIdNone),
pin(FeedbackPinNone),
device(FeedbackDeviceNone),
bus(FeedbackBusNone),
manager(manager),
feedbackType(FeedbackTypeDefault),
routeId(RouteNone),
inverted(false),
track(nullptr),
manager(manager),
feedbackType(FeedbackTypeDefault),
routeId(RouteNone),
inverted(false),
track(nullptr),
stateCounter(0)
{
}
Expand Down
2 changes: 1 addition & 1 deletion DataModel/LockableItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace DataModel

inline LockableItem()
: lockState(LockStateFree),
locoBaseIdentifier()
locoBaseIdentifier()
{
}

Expand Down
2 changes: 1 addition & 1 deletion DataModel/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace DataModel

inline Object()
: objectID(ObjectNone),
name(std::to_string(objectID))
name(std::to_string(objectID))
{
}

Expand Down
4 changes: 2 additions & 2 deletions DataModel/Route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace DataModel
{
Route::Route(Manager* manager, const std::string& serialized)
: LockableItem(),
manager(manager),
executeAtUnlock(false)
manager(manager),
executeAtUnlock(false)
{
Deserialize(serialized);
Track* track = manager->GetTrack(fromTrack);
Expand Down
4 changes: 2 additions & 2 deletions DataModel/Route.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ namespace DataModel

Route(Manager* manager, const RouteID routeID)
: LayoutItem(routeID),
LockableItem(),
manager(manager),
LockableItem(),
manager(manager),
executeAtUnlock(false),
delay(0),
pushpull(PushpullTypeBoth),
Expand Down
14 changes: 7 additions & 7 deletions DataTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ enum TrainType : uint32_t
TrainTypeHistoric = 0x00001000,
TrainTypeExtra = 0x00002000,

TrainTypePassengerWithCargo = 0x00008000,
TrainTypePassengerWithCargo = 0x00008000,

TrainTypePassenger = TrainTypeInternationalHighSpeed
| TrainTypeNationalHighSpeed
Expand All @@ -346,12 +346,12 @@ enum TrainType : uint32_t

TrainTypeCargoWithPassenger = 0x00800000,

TrainTypeCargo = TrainTypeCargoLongDistance
| TrainTypeCargoLocal
| TrainTypeCargoBlock
| TrainTypeCargoTractor
| TrainTypeCargoExpress
| TrainTypeCargoWithPassenger,
TrainTypeCargo = TrainTypeCargoLongDistance
| TrainTypeCargoLocal
| TrainTypeCargoBlock
| TrainTypeCargoTractor
| TrainTypeCargoExpress
| TrainTypeCargoWithPassenger,

TrainTypeRescue = 0x01000000,
TrainTypeConstruction = 0x02000000,
Expand Down
2 changes: 1 addition & 1 deletion Hardware/CS2Tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Hardware
: MaerklinCAN(params,
"Maerklin Central Station 2 (CS2) TCP / " + params->GetName() + " at IP " + params->GetArg1(),
params->GetName()),
connection(Network::TcpClient::GetTcpClientConnection(HardwareInterface::logger, params->GetArg1(), CS2Port))
connection(Network::TcpClient::GetTcpClientConnection(HardwareInterface::logger, params->GetArg1(), CS2Port))
{
HardwareInterface::logger->Info(Languages::TextStarting, GetFullName());

Expand Down
4 changes: 2 additions & 2 deletions Hardware/CS2Udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace Hardware
: MaerklinCAN(params,
"Maerklin Central Station 2 (CS2) UDP / " + params->GetName() + " at IP " + params->GetArg1(),
params->GetName()),
senderConnection(HardwareInterface::logger, params->GetArg1(), CS2SenderPort),
receiverConnection(HardwareInterface::logger, "0.0.0.0", CS2ReceiverPort)
senderConnection(HardwareInterface::logger, params->GetArg1(), CS2SenderPort),
receiverConnection(HardwareInterface::logger, "0.0.0.0", CS2ReceiverPort)
{
HardwareInterface::logger->Info(Languages::TextStarting, GetFullName());

Expand Down
2 changes: 1 addition & 1 deletion Hardware/CcSchnitte.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Hardware
: MaerklinCAN(params,
"CC-Schnitte / " + params->GetName() + " at serial port " + params->GetArg1(),
params->GetName()),
serialLine(HardwareInterface::logger, params->GetArg1(), B500000, 8, 'N', 1, true)
serialLine(HardwareInterface::logger, params->GetArg1(), B500000, 8, 'N', 1, true)
{
HardwareInterface::logger->Info(Languages::TextStarting, GetFullName());

Expand Down
4 changes: 2 additions & 2 deletions Hardware/DccPpExSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace Hardware
: DccPpEx(params,
"DCC-EX Serial / " + params->GetName() + " at serial port " + params->GetArg1(),
params->GetName()),
serialLine(logger, params->GetArg1(), B115200, 8, 'N', 1,
serialLine(logger, params->GetArg1(), B115200, 8, 'N', 1,
#ifdef __CYGWIN__
false
false
#else
true
#endif
Expand Down
2 changes: 1 addition & 1 deletion Hardware/DccPpExTcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace Hardware
: DccPpEx(params,
"DCC-EX TCP / " + params->GetName() + " at IP " + params->GetArg1(),
params->GetName()),
connection(Network::TcpClient::GetTcpClientConnection(logger, params->GetArg1(), Port))
connection(Network::TcpClient::GetTcpClientConnection(logger, params->GetArg1(), Port))
{
logger->Info(Languages::TextStarting, GetFullName());

Expand Down
8 changes: 4 additions & 4 deletions Hardware/HardwareInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ namespace Hardware
const std::string& fullName,
const std::string& shortName)
: manager(manager),
controlID(controlID),
logger(Logger::Logger::GetLogger(shortName)),
fullName(fullName),
shortName(shortName),
controlID(controlID),
logger(Logger::Logger::GetLogger(shortName)),
fullName(fullName),
shortName(shortName),
communicationError(false)
{
}
Expand Down
2 changes: 1 addition & 1 deletion Hardware/HardwareParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Hardware
std::string arg4,
std::string arg5)
: manager(nullptr),
controlID(controlID),
controlID(controlID),
hardwareType(hardwareType),
name(name),
arg1(arg1),
Expand Down
2 changes: 1 addition & 1 deletion Hardware/Hsi88.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Hardware
params->GetControlID(),
"HSI-88 / " + params->GetName() + " at serial port " + params->GetArg1(),
params->GetName()),
serialLine(logger, params->GetArg1(), B9600, 8, 'N', 1),
serialLine(logger, params->GetArg1(), B9600, 8, 'N', 1),
run(false)
{
logger->Info(Languages::TextStarting, GetFullName());
Expand Down
2 changes: 1 addition & 1 deletion Hardware/M6051.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Hardware
params->GetControlID(),
"Maerklin Interface (6050/6051) / " + params->GetName() + " at serial port " + params->GetArg1(),
params->GetName()),
serialLine(logger, params->GetArg1(), B2400, 8, 'N', 2),
serialLine(logger, params->GetArg1(), B2400, 8, 'N', 2),
run(true)
{
logger->Info(Languages::TextStarting, GetFullName());
Expand Down
2 changes: 1 addition & 1 deletion Hardware/Protocols/LocoNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ namespace Hardware
}

/**
* Reverse Engineered with a KM1 System control 7, but it does not work properly.
* Reverse Engineered with a KM1 System control 7, but it does not work properly.
void LocoNet::ProgramMain(const Address address,
const CvNumber cv,
const CvValue value)
Expand Down
2 changes: 1 addition & 1 deletion Logger/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Logger

Logger(LoggerServer& server, const std::string& component)
: server(server),
component(component)
component(component)
{}

~Logger() {};
Expand Down
2 changes: 1 addition & 1 deletion Logger/LoggerServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace Logger
private:
inline LoggerServer()
: fileLoggerStarted(false),
consoleLoggerStarted(false)
consoleLoggerStarted(false)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ using Storage::StorageParams;

Manager::Manager(Config& config)
: logger(Logger::Logger::GetLogger(Languages::GetText(Languages::TextManager))),
boosterState(BoosterStateStop),
boosterState(BoosterStateStop),
storage(nullptr),
startupInitLocos(StartupInitLocosAll),
defaultAccessoryDuration(DataModel::DefaultAccessoryPulseDuration),
Expand Down
64 changes: 32 additions & 32 deletions Network/TcpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,45 @@ namespace Network
{
TcpConnection TcpClient::GetTcpClientConnection(Logger::Logger* logger, const std::string& host, const unsigned short port)
{
struct sockaddr_storage address;
struct sockaddr_in* addressPointer = reinterpret_cast<struct sockaddr_in*>(&address);
addressPointer->sin_family = AF_INET;
addressPointer->sin_port = htons(port);
int ok = inet_pton(AF_INET, host.c_str(), &(addressPointer->sin_addr));
if (ok <= 0)
{
struct sockaddr_storage address;
struct sockaddr_in* addressPointer = reinterpret_cast<struct sockaddr_in*>(&address);
addressPointer->sin_family = AF_INET;
addressPointer->sin_port = htons(port);
int ok = inet_pton(AF_INET, host.c_str(), &(addressPointer->sin_addr));
if (ok <= 0)
{
logger->Error(Languages::TextUnableToResolveAddress, host);
return TcpConnection(0);
}
return TcpConnection(0);
}

int sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0)
{
int sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0)
{
logger->Error(Languages::TextUnableToCreateTcpSocket, host, port);
return TcpConnection(0);
}
return TcpConnection(0);
}

ok = ConnectWithTimeout(sock, reinterpret_cast<struct sockaddr*>(addressPointer), sizeof(address));
if (ok < 0)
{
Languages::TextSelector text;
switch (errno)
{
case ECONNREFUSED:
text = Languages::TextConnectionRefused;
break;
ok = ConnectWithTimeout(sock, reinterpret_cast<struct sockaddr*>(addressPointer), sizeof(address));
if (ok < 0)
{
Languages::TextSelector text;
switch (errno)
{
case ECONNREFUSED:
text = Languages::TextConnectionRefused;
break;

case ENETUNREACH:
text = Languages::TextNetworkUnreachable;
break;
case ENETUNREACH:
text = Languages::TextNetworkUnreachable;
break;

default:
text = Languages::TextConnectionFailed;
}
default:
text = Languages::TextConnectionFailed;
}
logger->Error(text, host, port);
close(sock);
return TcpConnection(0);
}
close(sock);
return TcpConnection(0);
}

return TcpConnection(sock, &address);
}
Expand Down
8 changes: 4 additions & 4 deletions Network/TcpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ namespace Network
const unsigned short port,
const std::string& threadName)
: run(false),
error(""),
address(address),
port(port),
threadName(threadName)
error(""),
address(address),
port(port),
threadName(threadName)
{
}

Expand Down
8 changes: 4 additions & 4 deletions Network/UdpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ namespace Network
: logger(Logger::Logger::GetLogger(threadName)),
run(false),
error(""),
address(address),
port(port),
serverSocket(0),
threadName(threadName)
address(address),
port(port),
serverSocket(0),
threadName(threadName)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Server/Web/HtmlTagSignal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace Server { namespace Web
{
HtmlTagSignal::HtmlTagSignal(__attribute__((unused)) const Manager& manager, const DataModel::Signal* const signal)
: HtmlTagLayoutItem(dynamic_cast<const DataModel::LayoutItem*>(signal)),
signal(signal)
signal(signal)
{
image += "<polygon points=\"15,0 21,0 21,36 15,36\" fill=\"white\"/>";
image += GetSignalImagePlain(signal);
Expand Down
2 changes: 1 addition & 1 deletion Server/Web/ResponseHtml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Server { namespace Web
{
ResponseHtml::ResponseHtml(const ResponseCode responseCode, const std::string& title, const HtmlTag body)
: Response(responseCode, body),
title(title)
title(title)
{
AddHeader("Cache-Control", "no-cache, must-revalidate");
AddHeader("Pragma", "no-cache");
Expand Down
4 changes: 2 additions & 2 deletions Storage/Sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ namespace Storage
{
SQLite::SQLite(const StorageParams* params)
: filename(params->filename),
logger(Logger::Logger::GetLogger("SQLite")),
keepBackups(params->keepBackups)
logger(Logger::Logger::GetLogger("SQLite")),
keepBackups(params->keepBackups)
{
Utils::Utils::RemoveOldBackupFiles (logger, filename, keepBackups);
logger->Info(Languages::TextOpeningSQLite, filename);
Expand Down
Loading