Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Fix #13

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5a7b790
Fix typo in conversion model formula
cesarBLG May 26, 2023
99b195c
Ignore balise covers
cesarBLG May 26, 2023
58a7d7a
Remove unneeded mutex
cesarBLG May 26, 2023
641d69b
Merge branch 'master' of github.com:cesarBLG/ETCS
cesarBLG May 26, 2023
80403fb
Update liborts
cesarBLG May 26, 2023
0e43a1d
Polish translation based on ET25 locomotive manual and Windows versio…
Bartlomiej-Skwara May 24, 2023
47e5723
Changes to keep compatible with MSVC
Bartlomiej-Skwara May 24, 2023
707f57a
destructing objects through derived pointer is UB without virtual des…
Milek7 May 24, 2023
a75dc0e
fix text leaks in planning window
Milek7 May 24, 2023
dcbcd3b
fix speed gauge surface leak
Milek7 May 24, 2023
0e4ca25
use vector in drawPolygon (or delete[] should be used, but vector is …
Milek7 May 24, 2023
000cf46
Set font and color once, not every gauge step
Bartlomiej-Skwara May 25, 2023
c6d7d89
NTC SHP dedicated symbol
Bartlomiej-Skwara May 25, 2023
03076a0
Sometimes we use the string "DEL" and sometimes the icon. The ET25 lo…
Bartlomiej-Skwara May 25, 2023
662c2b1
Typo in polish translation
Bartlomiej-Skwara May 25, 2023
a2006b8
DMI settings
Bartlomiej-Skwara May 24, 2023
ba0f8b7
Not all vehicles support every ETCS level. Let's save it in configura…
Bartlomiej-Skwara May 24, 2023
43ff796
Dynamic resolution, fullscreen and borderless mode, display selector,…
Bartlomiej-Skwara May 24, 2023
2b1e695
Preserve scale calculation for big screens
cesarBLG May 26, 2023
4882ba5
Double size of ack border
cesarBLG May 26, 2023
b6ee4f6
Scale borders for big screens
cesarBLG May 27, 2023
5b75283
Settings path for android
cesarBLG May 27, 2023
b9098e2
Update gitignore
cesarBLG May 27, 2023
870e0a6
Ack region should be the whole display area
cesarBLG May 28, 2023
b9de41a
Add external ack button
cesarBLG May 28, 2023
79ca026
Debug balise info for MSVC
cesarBLG May 30, 2023
7c94f98
Fix information comparator
cesarBLG May 30, 2023
5333507
Fix potential bug
cesarBLG May 30, 2023
65005cc
Fix critical crash
cesarBLG May 30, 2023
676ca5b
Fix coordinate system assignment
cesarBLG May 31, 2023
5d79aa3
Fix null pointer
cesarBLG May 31, 2023
10bc97d
SRS 3.4.2.3.3.4
cesarBLG Jun 1, 2023
052b972
Graceful exit
cesarBLG Jun 1, 2023
75622eb
Store RBC number
cesarBLG Jun 2, 2023
e55ccc3
Reject L2 MA if SSP or gradient not covering its full length
cesarBLG Jun 2, 2023
a4c8c8e
Unify all data kept in NP mode in a single file
cesarBLG Jun 2, 2023
5011ea9
Add missing NID_PACKET number
cesarBLG Jun 4, 2023
d31d52c
Emergency braking in SF mode according to 4.4.5.1.2 "The ERTMS/ETCS o…
Bartlomiej-Skwara May 29, 2023
d9c3c91
Valid SoundHorn icon file
Bartlomiej-Skwara May 30, 2023
59e815e
fix gcc warnings
Milek7 May 30, 2023
cbb8802
Why loading gauge, axle load and train category are not stored in tra…
Bartlomiej-Skwara May 31, 2023
61bd7b3
Default DMI settings
cesarBLG Jun 4, 2023
c3081b8
Android cold movement
cesarBLG Jun 4, 2023
6e00f2a
Fix out of range for SH authorisation
cesarBLG Jun 4, 2023
ef420c6
Traindata Fix
albertosaurio65 Jun 4, 2023
f3da945
Merge remote-tracking branch 'upstream/master'
albertosaurio65 Aug 7, 2023
8ad07fe
Update liborts
albertosaurio65 Aug 7, 2023
ac93f18
Update Traindata / Fix STM Bombardier
albertosaurio65 Aug 7, 2023
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
46 changes: 46 additions & 0 deletions DMI/Settings/settings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include "settings.h"
#include <fstream>
#include <iostream>
#include <map>
#include <string>
#include <algorithm>

std::map<std::string, std::string> Settings::items;

void Settings::Init()
{
std::string line;
std::ifstream file;
#ifdef __ANDROID__
extern std::string filesDir;
file.open(filesDir+"/settings.ini");
#else
file.open("settings.ini");
#endif

if (!file.is_open()) {
perror("Settings file error...");
return;
}

items.clear();

while (std::getline(file, line)) {
int pos = line.find('=', 0);
items.insert(std::pair<std::string, std::string>(line.substr(0, pos), line.substr(pos+1)));
}

std::cout << items.size() << " settings variables loaded!" << std::endl;
}

std::string Settings::Get(std::string key)
{
try
{
return items.at(key);
}
catch(const std::exception& e)
{
return key;
}
}
14 changes: 14 additions & 0 deletions DMI/Settings/settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef _Settings_H
#define _Settings_H

#include <map>
#include <string>

class Settings
{
public:
static void Init();
static std::string Get(std::string);
static std::map<std::string, std::string> items;
};
#endif
10 changes: 10 additions & 0 deletions DMI/state/acks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "../tcp/server.h"
#include "../sound/sound.h"
#include "../messages/messages.h"
#include "../graphics/display.h"
#include "acks.h"
#include <list>
#include "platform_runtime.h"
Expand Down Expand Up @@ -194,4 +195,13 @@ void setAck(AckType type, int id, bool ack)
else ++it;
}
}
}
void externalAck(bool pressed)
{
if (componentAck == nullptr) return;
for (auto it = active_windows.begin(); it != active_windows.end(); ++it)
{
if ((*it)->active) (*it)->event(pressed, 0, 0);
else (*it)->event(0, -100, -100);
}
}
1 change: 1 addition & 0 deletions DMI/state/acks.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ extern AckType AllowedAck;
extern Component *componentAck;
void setAck(AckType type, int id, bool ack);
void updateAcks();
void externalAck(bool pressed);
#endif
2 changes: 1 addition & 1 deletion DMI/stm_bombardier.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
}
],
"etcs_supervision": true,
"etcs_dial_range": 250,
"etcs_dial_range": 250
}
]
}
Binary file added DMI/symbols/STM/EBICAB_ASFA/asfap.bmp
Binary file not shown.
Binary file added DMI/symbols/STM/EBICAB_ASFA/atp_MV.bmp
Binary file not shown.
Binary file added DMI/symbols/STM/EBICAB_ASFA/atp_atp.bmp
Binary file not shown.
Binary file added DMI/symbols/STM/EBICAB_ASFA/atp_vl.bmp
Binary file not shown.
Binary file added DMI/symbols/STM/EBICAB_ASFA/bts.bmp
Binary file not shown.
Binary file modified DMI/symbols/STM/EBICAB_ASFA/conv.bmp
Binary file not shown.
Binary file added DMI/symbols/STM/EBICAB_ASFA/man.bmp
Binary file not shown.
Loading
Loading