mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
feat: add file data complete
This commit is contained in:
@@ -8,6 +8,7 @@ kanban-plugin: board
|
|||||||
|
|
||||||
- [ ] проверить работоспособность без Qt - не работает
|
- [ ] проверить работоспособность без Qt - не работает
|
||||||
- [ ] 23 -> связное оборудование -> общая часть
|
- [ ] 23 -> связное оборудование -> общая часть
|
||||||
|
- [ ] Добавить экран первой настройки
|
||||||
|
|
||||||
|
|
||||||
## bugs
|
## bugs
|
||||||
@@ -26,8 +27,7 @@ kanban-plugin: board
|
|||||||
|
|
||||||
## feature client QT
|
## feature client QT
|
||||||
|
|
||||||
- [ ] Добавить экран первой настройки
|
- [ ] у RRJClient пробрасывать аргументы в Unity приложение
|
||||||
- [ ] добавить выбор файлов которые нжно обновить в клиенте и формировать из него список того, что обновляется
|
|
||||||
|
|
||||||
|
|
||||||
## feature server
|
## feature server
|
||||||
@@ -43,6 +43,8 @@ kanban-plugin: board
|
|||||||
|
|
||||||
## Complete
|
## Complete
|
||||||
|
|
||||||
|
- [ ] починить закрытие во время загрузки
|
||||||
|
- [ ] добавить выбор файлов которые нжно обновить в клиенте и формировать из него список того, что обновляется
|
||||||
- [ ] Связать схемный и реальный манометр
|
- [ ] Связать схемный и реальный манометр
|
||||||
- [ ] QT клиент при восстановлении сразу показывают кнопку обновить, а должен вызывать слайдер загрузкии
|
- [ ] QT клиент при восстановлении сразу показывают кнопку обновить, а должен вызывать слайдер загрузкии
|
||||||
- [ ] при переключении между позициями при режиме панели не сбрасывается fov
|
- [ ] при переключении между позициями при режиме панели не сбрасывается fov
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ struct FileData
|
|||||||
{
|
{
|
||||||
QString path;
|
QString path;
|
||||||
QString hash;
|
QString hash;
|
||||||
|
QString lastUpdate;
|
||||||
|
|
||||||
bool operator==(const FileData& other)const{
|
bool operator==(const FileData& other)const{
|
||||||
if(this->path==(other.path) && this->hash == other.hash) return true;
|
if(this->path==(other.path) && this->hash == other.hash) return true;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ void DataParser::createFileDataList(QList<FileData> fileDataList,QString filenam
|
|||||||
|
|
||||||
xmlWriter.writeAttribute("Path",data.path);
|
xmlWriter.writeAttribute("Path",data.path);
|
||||||
xmlWriter.writeAttribute("Hash",data.hash);
|
xmlWriter.writeAttribute("Hash",data.hash);
|
||||||
|
xmlWriter.writeAttribute("LastUpdate",data.lastUpdate);
|
||||||
|
|
||||||
xmlWriter.writeEndElement();
|
xmlWriter.writeEndElement();
|
||||||
}
|
}
|
||||||
@@ -499,6 +500,8 @@ QList<FileData>* DataParser::xmlFileDataParse(QByteArray array, QString filter =
|
|||||||
data.path = value;
|
data.path = value;
|
||||||
else if(name == "Hash")
|
else if(name == "Hash")
|
||||||
data.hash = value;
|
data.hash = value;
|
||||||
|
else if(name == "LastUpdate")
|
||||||
|
data.lastUpdate = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data.path.contains(filter))
|
if(data.path.contains(filter))
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ struct FileData
|
|||||||
{
|
{
|
||||||
QString path;
|
QString path;
|
||||||
QString hash;
|
QString hash;
|
||||||
|
QString lastUpdate;
|
||||||
|
|
||||||
bool operator==(const FileData& other)const
|
bool operator==(const FileData& other)const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ void FastHashCalculator::calculateHashes(QString path)
|
|||||||
|
|
||||||
QtConcurrent::map(files, [this](const QString &filePath)
|
QtConcurrent::map(files, [this](const QString &filePath)
|
||||||
{
|
{
|
||||||
|
QFileInfo fileinfo(filePath);
|
||||||
|
|
||||||
QByteArray hash = calculateFileHashOptimized(filePath);
|
QByteArray hash = calculateFileHashOptimized(filePath);
|
||||||
QMutexLocker locker(&_mutex);
|
QMutexLocker locker(&_mutex);
|
||||||
FileData currentFile;
|
FileData currentFile;
|
||||||
@@ -68,6 +70,7 @@ void FastHashCalculator::calculateHashes(QString path)
|
|||||||
|
|
||||||
currentFile.path = Tools::createLocalPath(filePath);
|
currentFile.path = Tools::createLocalPath(filePath);
|
||||||
currentFile.hash = hash.toHex();
|
currentFile.hash = hash.toHex();
|
||||||
|
currentFile.lastUpdate = fileinfo.fileTime(QFileDevice::FileModificationTime).toString("dd.MM.yyyy hh:mm:ss");
|
||||||
hashList->append(currentFile);
|
hashList->append(currentFile);
|
||||||
}).waitForFinished();
|
}).waitForFinished();
|
||||||
|
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ void UpdateController::saveHash(QString fileName,QList<FileData> *fileList)
|
|||||||
|
|
||||||
xmlWriter.writeAttribute("Path",data.path);
|
xmlWriter.writeAttribute("Path",data.path);
|
||||||
xmlWriter.writeAttribute("Hash",data.hash);
|
xmlWriter.writeAttribute("Hash",data.hash);
|
||||||
|
xmlWriter.writeAttribute("LastUpdate",data.lastUpdate);
|
||||||
|
|
||||||
xmlWriter.writeEndElement();
|
xmlWriter.writeEndElement();
|
||||||
}
|
}
|
||||||
@@ -162,6 +163,7 @@ void UpdateController::saveHash(QString fileName,QList<FileData> *fileList)
|
|||||||
|
|
||||||
QList<FileData>* UpdateController::loadHash(QString filename)
|
QList<FileData>* UpdateController::loadHash(QString filename)
|
||||||
{
|
{
|
||||||
|
//TODO: дублируется функционал DataParser
|
||||||
QList<FileData> *files = new QList<FileData>();
|
QList<FileData> *files = new QList<FileData>();
|
||||||
|
|
||||||
QFile hashFile(filename);
|
QFile hashFile(filename);
|
||||||
@@ -190,6 +192,8 @@ QList<FileData>* UpdateController::loadHash(QString filename)
|
|||||||
data.path = value;
|
data.path = value;
|
||||||
else if(name == "Hash")
|
else if(name == "Hash")
|
||||||
data.hash = value;
|
data.hash = value;
|
||||||
|
else if(name == "LastUpdate")
|
||||||
|
data.lastUpdate = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
files->append(data);
|
files->append(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user