Skip to content

Commit

Permalink
packages UI
Browse files Browse the repository at this point in the history
  • Loading branch information
gbook committed Jan 19, 2024
1 parent ed2faed commit 984a32f
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 66 deletions.
17 changes: 17 additions & 0 deletions src/squirrel/squirrel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ squirrel::~squirrel()
}


/* ---------------------------------------------------------- */
/* --------- DatabaseConnect -------------------------------- */
/* ---------------------------------------------------------- */
bool squirrel::DatabaseConnect() {

db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(QString(workingDir + "/squirrel.db"));

if (db.open()) {
return true;
}
else {
return false;
}
}


/* ------------------------------------------------------------ */
/* ----- read ------------------------------------------------- */
/* ------------------------------------------------------------ */
Expand Down
5 changes: 5 additions & 0 deletions src/squirrel/squirrel.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <QDate>
#include <QDateTime>
#include <QDebug>
#include <QtSql>
#include "squirrelSubject.h"
#include "squirrelExperiment.h"
#include "squirrelPipeline.h"
Expand Down Expand Up @@ -124,13 +125,17 @@ class squirrel
QString GetLog() { return log; }

private:
bool DatabaseConnect();

void PrintPackage();
bool MakeTempDir(QString &dir);
QString workingDir;
QString logfile;
QStringList msgs; /* squirrel messages, to be passed back upon writing (or reading) through the squirrel library */
QString log;

QSqlDatabase db;

bool isValid;
bool isOkToDelete;
};
Expand Down
1 change: 1 addition & 0 deletions src/squirrel/squirrellib.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Use this file to build libsquirrel

QT -= gui
QT += sql

CONFIG += c++17 console
CONFIG -= app_bundle
Expand Down
4 changes: 3 additions & 1 deletion src/web/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ function GetSeriesInfo($id, $modality) {
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
$uid = $row['uid'];
$seriesnum = $row['series_num'];
$seriessize = $row['series_size'];
$numfiles = $row['numfiles'];
$studynum = $row['study_num'];
$subjectid = $row['subject_id'];
$studyid = $row['study_id'];
Expand All @@ -697,7 +699,7 @@ function GetSeriesInfo($id, $modality) {
$projectid = $row['project_id'];

$path = $GLOBALS['cfg']['archivedir'] . "/$uid/$studynum";
return array($path, $uid, $studynum, $seriesnum, $studyid, $subjectid, $modality, $type, $studydatetime, $enrollmentid, $projectname, $projectid);
return array($path, $uid, $studynum, $seriesnum, $seriessize, $numfiles, $studyid, $subjectid, $modality, $type, $studydatetime, $enrollmentid, $projectname, $projectid);
}


Expand Down
2 changes: 1 addition & 1 deletion src/web/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
$studyid = GetVariable("studyid");
}
if (($seriesid != "") && ($modality != "")) {
list($path1, $uid, $studynum, $seriesnum, $studyid, $subjectid, $modality1, $studytype1, $studydatetime1, $enrollmentid1, $projectname, $projectid) = GetSeriesInfo($seriesid, $modality);
list($path1, $uid, $studynum, $seriesnum, $seriessize, $numfiles, $studyid, $subjectid, $modality1, $studytype1, $studydatetime1, $enrollmentid1, $projectname, $projectid) = GetSeriesInfo($seriesid, $modality);
?>
<a href="projects.php?action=displayprojectinfo&id=<?=$projectid?>" class="item"><?=$projectname?></a>
<a href="subjects.php?id=<?=$subjectid?>" class="item"><?=$uid?></a>
Expand Down
Loading

0 comments on commit 984a32f

Please sign in to comment.