Skip to content

Commit

Permalink
Merge branch 'commontk:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
txdy077345 authored Oct 24, 2024
2 parents 9f22fe7 + d7ce6d9 commit b2039f2
Show file tree
Hide file tree
Showing 131 changed files with 9,345 additions and 3,938 deletions.
66 changes: 0 additions & 66 deletions .circleci/config.yml

This file was deleted.

93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI (Build)

on:
# Triggers the workflow on push or pull request events
push:
branches:
- "master"
pull_request:
branches:
- "*"
# Allows running this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: ["ubuntu-latest", "ubuntu-20.04"]
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Setup CMake
uses: jwlawson/actions-setup-cmake@959f1116cf9f1ae42fff8ec1a4aaae6d4a0e348b # v2.0.1
with:
cmake-version: "3.16.3"

- name: Display CMake version
run: |
cmake --version
- name: Retrieve new lists of APT packages
run: sudo apt-get update

- name: Install Qt
run: |
sudo apt-get install -y \
qtbase5-dev \
qtmultimedia5-dev \
qttools5-dev \
libqt5xmlpatterns5-dev \
libqt5svg5-dev \
qtwebengine5-dev \
qtscript5-dev \
qtbase5-private-dev \
libqt5x11extras5-dev \
libxt-dev
- name: Install VTK
if: matrix.runs-on == 'ubuntu-latest'
run: |
sudo apt-get install -y \
libvtk9-dev \
libvtk9-qt-dev
- name: Configure CTK
run: |
cmake \
-DCTK_QT_VERSION:STRING=5 \
-DCTK_ENABLE_Widgets:BOOL=ON \
-DCTK_USE_SYSTEM_VTK:BOOL=$CTK_USE_VTK \
-DCTK_LIB_Visualization/VTK/Widgets:BOOL=$CTK_USE_VTK \
-DCTK_LIB_Visualization/VTK/Widgets_USE_TRANSFER_FUNCTION_CHARTS:BOOL=$CTK_USE_VTK \
-DCTK_APP_ctkDICOM:BOOL=ON \
-DCTK_LIB_DICOM/Core:BOOL=ON \
-DCTK_LIB_DICOM/Widgets:BOOL=ON \
-DCTK_LIB_Scripting/Python/Core:BOOL=ON \
-DCTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK:BOOL=$CTK_USE_VTK \
-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTCORE:BOOL=ON \
-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTGUI:BOOL=ON \
-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTUITOOLS:BOOL=ON \
-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTNETWORK:BOOL=ON \
-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTMULTIMEDIA:BOOL=ON \
-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTWEBKIT:BOOL=OFF \
-DCTK_LIB_Scripting/Python/Widgets:BOOL=ON \
-DCTK_ENABLE_Python_Wrapping:BOOL=ON \
-B CTK-build \
-S .
env:
CTK_USE_VTK: "${{ matrix.runs-on == 'ubuntu-latest' && 'ON' || 'OFF' }}"

- name: Display Qt5_DIR
run: |
cat CTK-build/CMakeCache.txt | grep ^Qt5_DIR
- name: Build CTK
run: |
cmake \
--build CTK-build -- -j4
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,13 @@ int main(int argc, char** argv)
DICOMVisualBrowser.setMinimumSize(QSize(1000, 1000));
DICOMVisualBrowser.setDatabaseDirectory(databaseDirectory);

DICOMVisualBrowser.serverSettingsGroupBox()->setChecked(true);
QObject::connect(&directoryButton, SIGNAL(directoryChanged(const QString&)),
&DICOMVisualBrowser, SLOT(setDatabaseDirectory(const QString&)));

mainLayout.addWidget(&DICOMVisualBrowser);

mainWidget.setLayout(&mainLayout);

mainWidget.show();
DICOMVisualBrowser.onShowPatients();

return app.exec();
}
2 changes: 1 addition & 1 deletion CMake/ctkMacroSetupQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
macro(ctkMacroSetupQt)

if(CTK_QT_VERSION VERSION_EQUAL "5")
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.16.3)
find_package(Qt5 COMPONENTS Core)

set(CTK_QT5_COMPONENTS Core)
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
#
###########################################################################

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.16.3)

foreach(p
CMP0054 # CMake 3.1
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
Expand Down
57 changes: 49 additions & 8 deletions Libs/Core/ctkAbstractJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,14 @@ ctkAbstractJob::ctkAbstractJob()
this->MaximumConcurrentJobsPerType = 20;
this->Priority = QThread::Priority::LowPriority;
this->CreationDateTime = QDateTime::currentDateTime();
this->DestroyAfterUse = false;
}

//----------------------------------------------------------------------------
ctkAbstractJob::~ctkAbstractJob()
{
}

//----------------------------------------------------------------------------
void ctkAbstractJob::setJobUID(const QString &jobUID)
{
this->JobUID = jobUID;
}

//----------------------------------------------------------------------------
QString ctkAbstractJob::className() const
{
Expand All @@ -67,6 +62,12 @@ QString ctkAbstractJob::jobUID() const
return this->JobUID;
}

//----------------------------------------------------------------------------
void ctkAbstractJob::setJobUID(const QString &jobUID)
{
this->JobUID = jobUID;
}

//----------------------------------------------------------------------------
ctkAbstractJob::JobStatus ctkAbstractJob::status() const
{
Expand All @@ -91,9 +92,13 @@ void ctkAbstractJob::setStatus(JobStatus status)
{
emit this->started();
}
else if (this->Status == JobStatus::Stopped)
else if (this->Status == JobStatus::UserStopped)
{
emit this->canceled();
emit this->userStopped();
}
else if (this->Status == JobStatus::AttemptFailed)
{
emit this->attemptFailed();
}
else if (this->Status == JobStatus::Failed)
{
Expand Down Expand Up @@ -195,6 +200,42 @@ QDateTime ctkAbstractJob::completionDateTime() const
return this->CompletionDateTime;
}

//----------------------------------------------------------------------------
QString ctkAbstractJob::runningThreadID() const
{
return this->RunningThreadID;
}

//----------------------------------------------------------------------------
void ctkAbstractJob::setRunningThreadID(QString runningThreadID)
{
this->RunningThreadID = runningThreadID;
}

//----------------------------------------------------------------------------
QString ctkAbstractJob::log() const
{
return this->Log;
}

//----------------------------------------------------------------------------
void ctkAbstractJob::addLog(QString log)
{
this->Log += log;
}

//----------------------------------------------------------------------------
bool ctkAbstractJob::destroyAfterUse() const
{
return this->DestroyAfterUse;
}

//----------------------------------------------------------------------------
void ctkAbstractJob::setDestroyAfterUse(bool destroyAfterUse)
{
this->DestroyAfterUse = destroyAfterUse;
}

//----------------------------------------------------------------------------
QVariant ctkAbstractJob::toVariant()
{
Expand Down
Loading

0 comments on commit b2039f2

Please sign in to comment.