bugfix: auto-start init

This commit is contained in:
semenov
2025-09-19 09:23:35 +03:00
parent c0af0fe27d
commit c9c62d22c0
13 changed files with 17577 additions and 15 deletions

View File

@@ -95,9 +95,10 @@ ServerSettings *DataParser::getClientSettings()
return settings;
}
void DataParser::xmlParser(const QByteArray& array)
bool DataParser::xmlParser(const QByteArray& array)
{
QXmlStreamReader xmlReader(array);
bool result = false;
xmlReader.readNext();
@@ -135,6 +136,7 @@ void DataParser::xmlParser(const QByteArray& array)
if (value == "UNCHANGEABLE")
{
//версию нельзя изменять
result = true;
}
if (value == "CHANGEABLE")
@@ -227,7 +229,7 @@ void DataParser::xmlParser(const QByteArray& array)
QString name = attr.name().toString();
QString value = attr.value().toString();
if(name == "Version")
if (name == "Version")
data->setName(value);
else if(name == "Created")
data->setCreateData(QDateTime::fromString(value));
@@ -247,4 +249,5 @@ void DataParser::xmlParser(const QByteArray& array)
xmlReader.readNext();
}
return result;
}

View File

@@ -6,7 +6,6 @@
#include <QObject>
#include <QDomDocument>
#include <QXmlStreamWriter>
#include <Data/FileData.h>
#include <Data/Datas.h>
#include <Data/FileData.h>
#include <Core/tools.h>
@@ -22,7 +21,7 @@ public:
void initialize(PostProcessorSystem *postProcessSystem);
ServerSettings* getClientSettings();
void xmlParser(const QByteArray& array);
bool xmlParser(const QByteArray& array);
private:
PostProcessorSystem *postProcessSystem;
};

View File

@@ -77,7 +77,6 @@ QByteArray DataParserOutput::xmlAnswer(const QList<SXmlAnswerTag>& listTag, cons
return array;
}
void DataParserOutput::createFileDataList(const QList<FileData>& fileDataList,const QString& filename)
{
QFile file(filename);
@@ -129,7 +128,6 @@ void DataParserOutput::createAuthMessage(ClientAutorization *auth)
void DataParserOutput::createServerSettings(ServerSettings* serverSettings)
{
QFile file(settingsName);
file.open(QIODevice::WriteOnly);
QXmlStreamWriter xmlWriter(&file);

View File

@@ -38,7 +38,8 @@ void RecognizeSystem::recognize(QTcpSocket *socket)
stream.startTransaction();
stream >> packetType;
if(!stream.commitTransaction()){
if(!stream.commitTransaction())
{
emit sigSendDebugLog(Tools::getTime() + " CLIENT: packetType - FAIL commitTransaction");
if(socket->waitForReadyRead(TCP_READ_TIMEOUT)){

View File

@@ -12,7 +12,7 @@ public:
QString Language;
QString LocalVersionName;
StreamingVersionData versionData;
bool isAutoStart;
bool isAutoStart = false;
bool mathModelUse;
};

View File

@@ -1,11 +1,10 @@
QT += core gui
QT += network
QT += xml
QT += testlib
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
@@ -85,6 +84,9 @@ FORMS += \
TRANSLATIONS = QtLanguage_ru.ts\
QtLanguage_eng.ts
#TEMPLATE = subdirs
#SUBDIRS += Unit-tests\
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin

2
StaticData/authData.xml Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuthData Login="O1" Password="1111" InstructorName="" ClientName="Коровин А.В." AccessType="trainee"/>

8872
StaticData/clientHash.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
<DisplayInfo DisplaysID="0;"/>

5
StaticData/settings.xml Normal file
View File

@@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<ServerSettingsContainer>
<ServerSettings Port="6000" LocalPortMath="18004" AutoStart="0" Language="RUS" DestPortMath="18003" UseMathModel="1" Address="192.168.100.134"/>
<VersionData Created="Вт авг 19 11:09:28 2025" isChangable="0" Version="base"/>
</ServerSettingsContainer>

8675
StaticData/streamingHash.xml Normal file

File diff suppressed because it is too large Load Diff

2
StaticData/temp.xml Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<ClientNotify Code="DISABLE"/>

View File

@@ -79,7 +79,7 @@ void CoreManager::binding()
connect(postProcessorSystem,&PostProcessorSystem::sigCallUpdateList,this,&CoreManager::callUpdateList,Qt::AutoConnection);
connect(postProcessorSystem,&PostProcessorSystem::sigSocketDisabled,this,&CoreManager::lostConnection,Qt::AutoConnection);
connect(postProcessorSystem,&PostProcessorSystem::sigServerBlocked,this,&CoreManager::serverBlocked,Qt::AutoConnection);
connect(postProcessorSystem,&PostProcessorSystem::sigStartCompare,hashComparer,&HashComparer::CompareDeltas,Qt::AutoConnection); // ОПАСНОСТЬ
connect(postProcessorSystem,&PostProcessorSystem::sigStartCompare,hashComparer,&HashComparer::CompareDeltas,Qt::AutoConnection);
connect(postProcessorSystem,&PostProcessorSystem::sigSaveLoginData,this,&CoreManager::checkLoginResult,Qt::AutoConnection);
connect(versionContainer,&VersionContainer::sigSetServerVersion,this,&CoreManager::setServerVersion,Qt::AutoConnection);
@@ -93,15 +93,15 @@ void CoreManager::binding()
connect(hashComparer,&HashComparer::sigCallCheck,this,&CoreManager::checkUpdate);
connect(hashComparer,&HashComparer::sigHaveDelta,this,&CoreManager::checkUpdateInfo);
connect(updateController,&UpdateController::sigUpdateComplete,widgetManager,&WidgetManager::setCompeteState,Qt::AutoConnection);//ОПАСНОСТЬ
connect(updateController,&UpdateController::sigUpdateComplete,widgetManager,&WidgetManager::setCompeteState,Qt::AutoConnection);
connect(updateController,&UpdateController::sigSendHashInfo,widgetManager->getMainWindow(),&MainWindow::updateInitInformation,Qt::AutoConnection);
connect(client,&TCPClient::sigConnectionState,widgetManager,&WidgetManager::setConnectionState,Qt::AutoConnection);//ОПАСНОСТЬ
connect(client,&TCPClient::sigServerDisconnect,widgetManager,&WidgetManager::setServerDisconnectState,Qt::AutoConnection);//ОПАСНОСТЬ
connect(client,&TCPClient::sigConnectionState,widgetManager,&WidgetManager::setConnectionState,Qt::AutoConnection);
connect(client,&TCPClient::sigServerDisconnect,widgetManager,&WidgetManager::setServerDisconnectState,Qt::AutoConnection);
connect(sendSystem,&SendSystem::sigSend,this,&CoreManager::calcUpdateProgress,Qt::AutoConnection);
connect(sendSystem,&SendSystem::sigGetXmlAnswer,dataParserOutput,&DataParserOutput::xmlAnswer_notify,Qt::DirectConnection);//ОПАСНОСТЬ
connect(sendSystem,&SendSystem::sigGetXmlAnswer,dataParserOutput,&DataParserOutput::xmlAnswer_notify,Qt::DirectConnection);
}
void CoreManager::initializeSystems()
@@ -183,6 +183,7 @@ void CoreManager::setLocalVersion()
version->setIsChangeable(currentSettings->versionData.getIsChangeable());
versionContainer->setLocalVersionData(version);
widgetManager->getMainWindow()->setClientVersionName(versionContainer->getLocalVersion());
}
void CoreManager::checkLoginResult(ServerAuthorization *auth)