-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Предварительно: поправлен рассинхрон по реалтайму
- Loading branch information
1 parent
fcf0711
commit a2838e0
Showing
6 changed files
with
151 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
rem Создаем структуру каталогов игры | ||
|
||
mkdir %RRS_DEV_ROOT% | ||
mkdir %RRS_DEV_ROOT%\bin | ||
mkdir %RRS_DEV_ROOT%\lib | ||
mkdir %RRS_DEV_ROOT%\modules | ||
mkdir %RRS_DEV_ROOT%\plugins | ||
|
||
mkdir %RRS_DEV_ROOT%\cfg | ||
mkdir %RRS_DEV_ROOT%\data | ||
mkdir %RRS_DEV_ROOT%\routes | ||
mkdir %RRS_DEV_ROOT%\fonts | ||
mkdir %RRS_DEV_ROOT%\themes | ||
|
||
mkdir %RRS_DEV_ROOT%\sdk | ||
mkdir %RRS_DEV_ROOT%\sdk\include | ||
|
||
rem Копируем бинарные файлы | ||
|
||
xcopy ..\..\bin\*.exe %RRS_DEV_ROOT%\bin\ | ||
xcopy ..\..\lib\*.dll %RRS_DEV_ROOT%\bin\ | ||
move %RRS_DEV_ROOT%\bin\rkf5.dll %RRS_DEV_ROOT%\lib\rkf5.dll | ||
move %RRS_DEV_ROOT%\bin\rk4.dll %RRS_DEV_ROOT%\lib\rk4.dll | ||
|
||
xcopy ..\..\modules\*.dll %RRS_DEV_ROOT%\modules | ||
xcopy ..\..\modules\vl60\*.dll %RRS_DEV_ROOT%\modules\vl60\ | ||
xcopy ..\..\modules\passcar\*.dll %RRS_DEV_ROOT%\modules\passcar\ | ||
|
||
xcopy ..\..\plugins\*.dll %RRS_DEV_ROOT%\plugins | ||
|
||
rem Копируем конфиги | ||
|
||
xcopy ..\cfg\*.xml %RRS_DEV_ROOT%\cfg\ | ||
del %RRS_DEV_ROOT%\cfg\control-panel.xml | ||
xcopy ..\cfg\couplings\*.xml %RRS_DEV_ROOT%\cfg\couplings\ | ||
xcopy ..\cfg\devices\*.xml %RRS_DEV_ROOT%\cfg\devices\ | ||
|
||
xcopy ..\cfg\main-resist\default.xml %RRS_DEV_ROOT%\cfg\main-resist\ | ||
xcopy ..\cfg\main-resist\passcar.xml %RRS_DEV_ROOT%\cfg\main-resist\ | ||
xcopy ..\cfg\main-resist\loco-resist.xml %RRS_DEV_ROOT%\cfg\main-resist\ | ||
|
||
xcopy ..\cfg\vehicles\vl60pk-1543\*.* %RRS_DEV_ROOT%\cfg\vehicles\vl60pk-1543\ | ||
xcopy ..\cfg\vehicles\IMR_pass_rzd-11100\*.* %RRS_DEV_ROOT%\cfg\vehicles\IMR_pass_rzd-11100\ | ||
xcopy ..\cfg\vehicles\IMR_pass_rzd-13819\*.* %RRS_DEV_ROOT%\cfg\vehicles\IMR_pass_rzd-13819\ | ||
xcopy ..\cfg\vehicles\IMR_pass_rzd-16733\*.* %RRS_DEV_ROOT%\cfg\vehicles\IMR_pass_rzd-16733\ | ||
xcopy ..\cfg\vehicles\IMR_pass_rzd-17669\*.* %RRS_DEV_ROOT%\cfg\vehicles\IMR_pass_rzd-17669\ | ||
xcopy ..\cfg\vehicles\IMR_pass_rzd-25924\*.* %RRS_DEV_ROOT%\cfg\vehicles\IMR_pass_rzd-25924\ | ||
|
||
xcopy ..\cfg\trains\vl60pk-1543.xml %RRS_DEV_ROOT%\cfg\trains\ | ||
xcopy ..\cfg\trains\vl60pk-1543-pass-train.xml %RRS_DEV_ROOT%\cfg\trains\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#ifndef ELAPSED_TIMER_H | ||
#define ELAPSED_TIMER_H | ||
|
||
#include <QThread> | ||
|
||
class ElapsedTimer : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
|
||
ElapsedTimer(QObject *parent = Q_NULLPTR); | ||
|
||
~ElapsedTimer(); | ||
|
||
void setInterval(quint64 interval); | ||
|
||
void start(); | ||
|
||
signals: | ||
|
||
void process(); | ||
|
||
private: | ||
|
||
bool is_started; | ||
|
||
quint64 interval; | ||
|
||
QThread thread; | ||
|
||
private slots: | ||
|
||
void loop(); | ||
}; | ||
|
||
#endif // ELAPSED_TIMER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "elapsed-timer.h" | ||
|
||
#include <QElapsedTimer> | ||
#include <QTimer> | ||
#include <QEventLoop> | ||
|
||
ElapsedTimer::ElapsedTimer(QObject *parent) : QObject(parent) | ||
, is_started(false) | ||
, interval(0) | ||
{ | ||
|
||
} | ||
|
||
ElapsedTimer::~ElapsedTimer() | ||
{ | ||
|
||
} | ||
|
||
void ElapsedTimer::setInterval(quint64 interval) | ||
{ | ||
this->interval = interval; | ||
} | ||
|
||
void ElapsedTimer::start() | ||
{ | ||
is_started = true; | ||
connect(&thread, &QThread::started, this, &ElapsedTimer::loop); | ||
thread.start(); | ||
} | ||
|
||
void ElapsedTimer::loop() | ||
{ | ||
QTimer *timer = new QTimer(this); | ||
connect(timer, &QTimer::timeout, this, &ElapsedTimer::process, Qt::DirectConnection); | ||
timer->setTimerType(Qt::PreciseTimer); | ||
timer->start(static_cast<int>(interval)); | ||
|
||
QEventLoop eventLoop; | ||
|
||
while (is_started) | ||
{ | ||
eventLoop.processEvents(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters