From e2223b619fa37daaf6103b34b39e789efc1a0b94 Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Fri, 23 Nov 2012 19:21:30 +0100 Subject: [PATCH] new model classes --- appli/CMakeLists.txt | 4 +- lib/CMakeLists.txt | 2 +- lib/creaDevManagerLib/CDMUtilities.cpp | 90 +++++++++++ lib/creaDevManagerLib/CDMUtilities.h | 58 +++++++ .../ControlCreaDevManagerMain.cpp | 132 ---------------- .../ControlCreaDevManagerProject.cpp | 9 +- .../ControlCreaDevManagerProject.h | 4 +- lib/creaDevManagerLib/creaDevManagerIds.h | 4 +- .../{controlCDMMain.cpp => modelCDMAppli.cpp} | 59 ++++--- lib/creaDevManagerLib/modelCDMAppli.h | 62 ++++++++ lib/creaDevManagerLib/modelCDMApplication.cpp | 79 ++++++++++ lib/creaDevManagerLib/modelCDMApplication.h | 68 +++++++++ lib/creaDevManagerLib/modelCDMBlackBox.cpp | 119 +++++++++++++++ lib/creaDevManagerLib/modelCDMBlackBox.h | 70 +++++++++ .../modelCDMIProjectTreeNode.h | 44 ++---- .../{controlCDMMain.h => modelCDMLib.cpp} | 69 +++++---- ...trolCreaDevManagerMain.h => modelCDMLib.h} | 62 ++++---- lib/creaDevManagerLib/modelCDMLibrary.cpp | 69 +++++++++ lib/creaDevManagerLib/modelCDMLibrary.h | 64 ++++++++ lib/creaDevManagerLib/modelCDMMain.cpp | 144 ++++++++++++++++-- lib/creaDevManagerLib/modelCDMMain.h | 31 +++- lib/creaDevManagerLib/modelCDMPackage.cpp | 116 ++++++++++++++ lib/creaDevManagerLib/modelCDMPackage.h | 82 ++++++++++ lib/creaDevManagerLib/modelCDMProject.cpp | 136 +++++++++++++++-- lib/creaDevManagerLib/modelCDMProject.h | 66 +++++++- .../modelCDMProjectsTree.cpp | 6 +- lib/creaDevManagerLib/modelCDMProjectsTree.h | 4 +- .../modelCDMProjectsTreeNode.cpp | 4 +- .../modelCDMProjectsTreeNode.h | 4 +- .../wxCDMMainDescriptionPanel.cpp | 4 +- .../wxCDMMainDescriptionPanel.h | 4 +- lib/creaDevManagerLib/wxCDMMainFrame.cpp | 100 ++++++------ lib/creaDevManagerLib/wxCDMMainFrame.h | 6 +- .../wxCDMNewProjectDialog.cpp | 30 ++-- lib/creaDevManagerLib/wxCDMNewProjectDialog.h | 8 +- .../wxCDMProjectActionsPanel.cpp | 4 +- .../wxCDMProjectActionsPanel.h | 4 +- .../wxCDMProjectsTreeCtrl.cxx | 4 +- lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.h | 4 +- 39 files changed, 1433 insertions(+), 396 deletions(-) create mode 100644 lib/creaDevManagerLib/CDMUtilities.cpp create mode 100644 lib/creaDevManagerLib/CDMUtilities.h delete mode 100644 lib/creaDevManagerLib/ControlCreaDevManagerMain.cpp rename lib/creaDevManagerLib/{controlCDMMain.cpp => modelCDMAppli.cpp} (62%) create mode 100644 lib/creaDevManagerLib/modelCDMAppli.h create mode 100644 lib/creaDevManagerLib/modelCDMApplication.cpp create mode 100644 lib/creaDevManagerLib/modelCDMApplication.h create mode 100644 lib/creaDevManagerLib/modelCDMBlackBox.cpp create mode 100644 lib/creaDevManagerLib/modelCDMBlackBox.h rename lib/creaDevManagerLib/{controlCDMMain.h => modelCDMLib.cpp} (60%) rename lib/creaDevManagerLib/{ControlCreaDevManagerMain.h => modelCDMLib.h} (59%) create mode 100644 lib/creaDevManagerLib/modelCDMLibrary.cpp create mode 100644 lib/creaDevManagerLib/modelCDMLibrary.h create mode 100644 lib/creaDevManagerLib/modelCDMPackage.cpp create mode 100644 lib/creaDevManagerLib/modelCDMPackage.h diff --git a/appli/CMakeLists.txt b/appli/CMakeLists.txt index 0ab307c..ffe8db3 100644 --- a/appli/CMakeLists.txt +++ b/appli/CMakeLists.txt @@ -1,7 +1,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -25,7 +25,7 @@ IF(CREA_BUILD_WX) ADD_SUBDIRECTORY(creaNewProject) -#EED ADD_SUBDIRECTORY(creaDevManager) + ADD_SUBDIRECTORY(creaDevManager) ENDIF(CREA_BUILD_WX) IF(WIN32) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index da6eaee..2531113 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -2,5 +2,5 @@ # USER! : Add a ADD_SUBDIRECTORY command for each one of your libraries # ----- -#EED ADD_SUBDIRECTORY(creaDevManagerLib) +ADD_SUBDIRECTORY(creaDevManagerLib) diff --git a/lib/creaDevManagerLib/CDMUtilities.cpp b/lib/creaDevManagerLib/CDMUtilities.cpp new file mode 100644 index 0000000..a73282f --- /dev/null +++ b/lib/creaDevManagerLib/CDMUtilities.cpp @@ -0,0 +1,90 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * CDMUtilities.cpp + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "CDMUtilities.h" + +#include + +namespace CDMUtilities +{ + template + Container& splitter::split + ( + Container& result, + const typename Container::value_type& s, + const typename Container::value_type& delimiters, + empties_t empties + ) + { + result.clear(); + size_t current; + size_t next = -1; + do + { + if (empties == no_empties) + { + next = s.find_first_not_of( delimiters, next + 1 ); + if (next == Container::value_type::npos) break; + next -= 1; + } + current = next + 1; + next = s.find_first_of( delimiters, current ); + result.push_back( s.substr( current, next - current ) ); + } + while (next != Container::value_type::npos); + return result; + } + + const std::string& fixPath(const std::string& path) + { + std::string pathFixed = ""; + + #if(_WIN32) + // ------ Windows + //TODO: implementation for windows + #else + // ------ LINUX / MacOS + //break path into folders + std::vector pathSlpit; + splitter::split(pathSlpit, path, "\"/", splitter::no_empties); + for (int i = 0; i < pathSlpit.size(); i++) + { + std::cout << pathSlpit[i]; + pathFixed += "/" + pathSlpit[i]; + } + #endif + return pathFixed; + + } +} diff --git a/lib/creaDevManagerLib/CDMUtilities.h b/lib/creaDevManagerLib/CDMUtilities.h new file mode 100644 index 0000000..15031ab --- /dev/null +++ b/lib/creaDevManagerLib/CDMUtilities.h @@ -0,0 +1,58 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * CDMUtilities.h + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef CDMUTILITIES_H_ +#define CDMUTILITIES_H_ + +#include + +namespace CDMUtilities +{ + struct splitter + { + enum empties_t { empties_ok, no_empties }; + template + static Container& split + ( + Container& result, + const typename Container::value_type& s, + const typename Container::value_type& delimiters, + empties_t empties = empties_ok + ); + }; + + const std::string& fixPath(const std::string& path); +}; + +#endif /* CDMUTILITIES_H_ */ diff --git a/lib/creaDevManagerLib/ControlCreaDevManagerMain.cpp b/lib/creaDevManagerLib/ControlCreaDevManagerMain.cpp deleted file mode 100644 index 650d17c..0000000 --- a/lib/creaDevManagerLib/ControlCreaDevManagerMain.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* -# --------------------------------------------------------------------- -# -# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) -# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton -# Previous Authors : Laurent Guigues, Jean-Pierre Roux -# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil -# -# This software is governed by the CeCILL-B license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL-B -# license as circulated by CEA, CNRS and INRIA at the following URL -# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -# or in the file LICENSE.txt. -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL-B license and that you accept its terms. -# ------------------------------------------------------------------------ -*/ - - -/* - * ControlCreaDevManagerMain.cpp - * - * Created on: 5/11/2012 - * Author: daniel - */ - -#include "ControlCreaDevManagerMain.h" - -#include -#include - -ControlCreaDevManagerMain::ControlCreaDevManagerMain() -{ -} - -ControlCreaDevManagerMain::~ControlCreaDevManagerMain() -{ -} - -const modelCDMProjectsTree& ControlCreaDevManagerMain::GetActiveProjects() const -{ - return projectsTree; -} - -bool ControlCreaDevManagerMain::LoadActiveProjects() -{ - // TODO LoadActiveProjects - std::cerr << "LoadActiveProjects unimplemented yet" << std::endl; - return true; -} - -bool ControlCreaDevManagerMain::UpdateActiveProjects() -{ - // TODO UpdateActiveProjects - std::cerr << "UpdateActiveProjects unimplemented yet" << std::endl; - return true; -} - -const int ControlCreaDevManagerMain::OpenProject(const std::string& actualpath) -{ - std::string path = actualpath; - std::cout << "selection path: "<< path << std::endl; - std::string path1 = path + "/Makefile"; - FILE* pFile = fopen(path1.c_str(), "r"); - if(pFile == NULL) // not the binary folder - { - std::cerr << path1 << ": file not found..." << std::endl; - path1 = path + "/CMakeLists.txt"; - pFile = fopen(path1.c_str(), "r"); - if(pFile == NULL) //not the source folder - { - std::cerr << path1 << ": file not found..." << std::endl; - return 1; - }else{//source folder - std::cout << "sources folder found..." << std::endl; - fclose(pFile); - } - }else{//binary folder - std::cout << "binary folder found..." << std::endl; - fclose(pFile); - - std::ifstream readFile; - readFile.open(path1.c_str()); - std::string word; - bool found = false; - - while(!found && readFile >> word) - { - //cout << word << endl; - if(word == "CMAKE_SOURCE_DIR") - { - readFile >> word; - readFile.ignore(); - getline(readFile, word, '\n'); - path = word; - found = true; - } - } - readFile.close(); - - if(!found) - { - std::cerr << "sources not found..." << std::endl; - - return 2; - }else{ - pFile = fopen(path.c_str(), "r"); - std::cout << "sources at " << path << " open = " << (pFile != NULL) << std::endl; - std::cout.flush(); - } - } - - projectsTree.SetRoot(path); - projectsTree.populateNode(path); - return 0; -} - -bool ControlCreaDevManagerMain::CloseProject(const std::string& projectName) -{ - // TODO CloseProject - std::cerr << "CloseProject unimplemented yet" << std::endl; - return true; -} diff --git a/lib/creaDevManagerLib/ControlCreaDevManagerProject.cpp b/lib/creaDevManagerLib/ControlCreaDevManagerProject.cpp index daa491b..cc66abe 100644 --- a/lib/creaDevManagerLib/ControlCreaDevManagerProject.cpp +++ b/lib/creaDevManagerLib/ControlCreaDevManagerProject.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * ControlCreaDevManagerProject.cpp * * Created on: 5/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "ControlCreaDevManagerProject.h" @@ -52,7 +52,7 @@ ControlCreaDevManagerProject::~ControlCreaDevManagerProject() bool ControlCreaDevManagerProject::CreateProject(const std::string& name, const std::string& dir, const std::string& author, const std::string& description) { - + // ------ Windows #if(_WIN32) std::string command("creaNewProject.bat "); @@ -88,9 +88,8 @@ bool ControlCreaDevManagerProject::CreateProject(const std::string& name, const return false; } -// ------ LINUX / MacOS - #else + // ------ LINUX / MacOS std::string command("creaNewProject.sh "); command += "\"" + dir + "\"" +" " + name; std::cout << "executing " << command << std::endl; diff --git a/lib/creaDevManagerLib/ControlCreaDevManagerProject.h b/lib/creaDevManagerLib/ControlCreaDevManagerProject.h index e760125..ca4f8d0 100644 --- a/lib/creaDevManagerLib/ControlCreaDevManagerProject.h +++ b/lib/creaDevManagerLib/ControlCreaDevManagerProject.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * ControlCreaDevManagerProject.h * * Created on: 5/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef CONTROLCREADEVMANAGERPROJECT_H_ diff --git a/lib/creaDevManagerLib/creaDevManagerIds.h b/lib/creaDevManagerLib/creaDevManagerIds.h index 124813d..d631080 100644 --- a/lib/creaDevManagerLib/creaDevManagerIds.h +++ b/lib/creaDevManagerLib/creaDevManagerIds.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * creaDevManagerIds.h * * Created on: 19/10/2012 - * Author: Daniel Gonzalez + * Author: Daniel Felipe Gonzalez Obando Gonzalez */ #ifndef CREADEVMANAGERIDS_H_ diff --git a/lib/creaDevManagerLib/controlCDMMain.cpp b/lib/creaDevManagerLib/modelCDMAppli.cpp similarity index 62% rename from lib/creaDevManagerLib/controlCDMMain.cpp rename to lib/creaDevManagerLib/modelCDMAppli.cpp index d7a88d5..ee7edc1 100644 --- a/lib/creaDevManagerLib/controlCDMMain.cpp +++ b/lib/creaDevManagerLib/modelCDMAppli.cpp @@ -1,70 +1,65 @@ /* # --------------------------------------------------------------------- # -# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil # -# This software is governed by the CeCILL-B license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL-B -# license as circulated by CEA, CNRS and INRIA at the following URL -# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # or in the file LICENSE.txt. # # As a counterpart to the access to the source code and rights to copy, # modify and redistribute granted by the license, users are provided only # with a limited warranty and the software's author, the holder of the # economic rights, and the successive licensors have only limited -# liability. +# liability. # # The fact that you are presently reading this means that you have had # knowledge of the CeCILL-B license and that you accept its terms. -# ------------------------------------------------------------------------ -*/ - +# ------------------------------------------------------------------------ + */ /* - * controlCDMMain.cpp + * modelCDMAppli.cpp * - * Created on: 13/11/2012 - * Author: daniel + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando */ -#include "controlCDMMain.h" -#include - -controlCDMMain::controlCDMMain() -{ - this->main = NULL; -} +#include "modelCDMAppli.h" -controlCDMMain::~controlCDMMain() +modelCDMAppli::modelCDMAppli() { - } -const modelCDMProject& controlCDMMain::GetActiveProject() +modelCDMAppli::~modelCDMAppli() { - if(!main) - this->main = new modelCDMProject(); - return *main; } -bool controlCDMMain::UpdateActiveProject() +bool modelCDMAppli::CreateApplication( + const std::string& name, + std::string*& result, + const std::string& path +) { + //TODO: implement method return true; } -const int controlCDMMain::OpenProject(const std::string& path) +bool modelCDMAppli::OpenCMakeListsFile(std::string*& result) { - return 1; + //TODO: implement method + return true; } -bool controlCDMMain::CloseProject(const std::string& projectName) +bool modelCDMAppli::Refresh(std::string*& result) { + //TODO: implement method return true; } - diff --git a/lib/creaDevManagerLib/modelCDMAppli.h b/lib/creaDevManagerLib/modelCDMAppli.h new file mode 100644 index 0000000..569fdb1 --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMAppli.h @@ -0,0 +1,62 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMAppli.h + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef MODELCDMAPPLI_H_ +#define MODELCDMAPPLI_H_ + +#include +#include + +#include"modelCDMIProjectTreeNode.h" +#include"modelCDMApplication.h" + +class modelCDMAppli : public modelCDMIProjectTreeNode +{ +public: + modelCDMAppli(); + ~modelCDMAppli(); + + bool CreateApplication( + const std::string& name, + std::string*& result, + const std::string& path = "/" + ); + bool OpenCMakeListsFile(std::string*& result); + bool Refresh(std::string*& result); + +private: + std::vector applications; +}; + +#endif /* MODELCDMAPPLI_H_ */ diff --git a/lib/creaDevManagerLib/modelCDMApplication.cpp b/lib/creaDevManagerLib/modelCDMApplication.cpp new file mode 100644 index 0000000..c1e715e --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMApplication.cpp @@ -0,0 +1,79 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMApplication.cpp + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "modelCDMApplication.h" + +modelCDMApplication::modelCDMApplication() +{ +} + +modelCDMApplication::~modelCDMApplication() +{ +} + +const std::string& modelCDMApplication::GetName() const +{ + return this->name; +} + +const std::string& modelCDMApplication::GetMainFile() const +{ + return this->mainFile; +} + +void modelCDMApplication::SetMainFile(const std::string& fileName) +{ +} + +bool modelCDMApplication::CreateFolder( + const std::string& name, + std::string*& result, + const std::string& path +) +{ + //TODO: implement method + return true; +} + +bool modelCDMApplication::OpenCMakeListsFile(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMApplication::Refresh(std::string*& result) +{ + //TODO: implement method + return true; +} diff --git a/lib/creaDevManagerLib/modelCDMApplication.h b/lib/creaDevManagerLib/modelCDMApplication.h new file mode 100644 index 0000000..a878c35 --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMApplication.h @@ -0,0 +1,68 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMApplication.h + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef MODELCDMAPPLICATION_H_ +#define MODELCDMAPPLICATION_H_ + +#include +#include + +#include"modelCDMIProjectTreeNode.h" + +class modelCDMApplication : public modelCDMIProjectTreeNode +{ +public: + modelCDMApplication(); + ~modelCDMApplication(); + + const std::string& GetName() const; + const std::string& GetMainFile() const; + + void SetMainFile(const std::string& fileName); + + bool CreateFolder( + const std::string& name, + std::string*& result, + const std::string& path = "/" + ); + bool OpenCMakeListsFile(std::string* & result); + bool Refresh(std::string*& result); + +private: + std::string name; + std::string mainFile; + std::vector applications; +}; + +#endif /* MODELCDMAPPLICATION_H_ */ diff --git a/lib/creaDevManagerLib/modelCDMBlackBox.cpp b/lib/creaDevManagerLib/modelCDMBlackBox.cpp new file mode 100644 index 0000000..f285f78 --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMBlackBox.cpp @@ -0,0 +1,119 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMBlackBox.cpp + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "modelCDMBlackBox.h" + +modelCDMBlackBox::modelCDMBlackBox() +{ +} + +modelCDMBlackBox::~modelCDMBlackBox() +{ +} + +const std::string& modelCDMBlackBox::GetName() const +{ + return this->name; +} + +const std::string& modelCDMBlackBox::GetAuthors() const +{ + return this->authors; +} + +const std::string& modelCDMBlackBox::GetAuthorsEmail() const +{ + return this->authorsEmail; +} + +const std::string& modelCDMBlackBox::GetCategories() const +{ + return this->categories; +} + +const std::string& modelCDMBlackBox::GetDescription() const +{ + return this->description; +} + +bool modelCDMBlackBox::SetAuthors(const std::string& authors, std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMBlackBox::SetAuthorsEmail( + const std::string& email, + std::string*& result +) +{ + //TODO: implement method + return true; +} + +bool modelCDMBlackBox::SetCategories( + const std::string& version, + std::string*& result +) +{ + //TODO: implement method + return true; +} + +bool modelCDMBlackBox::SetDescription( + const std::string& description, + std::string*& result +) +{ + //TODO: implement method + return true; +} + +bool modelCDMBlackBox::OpenCxx(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMBlackBox::OpenHxx(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMBlackBox::Refresh(std::string*& result) +{ + //TODO: implement method + return true; +} diff --git a/lib/creaDevManagerLib/modelCDMBlackBox.h b/lib/creaDevManagerLib/modelCDMBlackBox.h new file mode 100644 index 0000000..6755448 --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMBlackBox.h @@ -0,0 +1,70 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMBlackBox.h + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef MODELCDMBLACKBOX_H_ +#define MODELCDMBLACKBOX_H_ + +#include + +class modelCDMBlackBox +{ +public: + modelCDMBlackBox(); + ~modelCDMBlackBox(); + + const std::string& GetName() const; + const std::string& GetAuthors() const; + const std::string& GetAuthorsEmail() const; + const std::string& GetCategories() const; + const std::string& GetDescription() const; + + bool SetAuthors(const std::string& authors, std::string*& result); + bool SetAuthorsEmail(const std::string& email, std::string*& result); + bool SetCategories(const std::string& version, std::string*& result); + bool SetDescription(const std::string& description, std::string*& result); + + + bool OpenCxx(std::string*& result); + bool OpenHxx(std::string*& result); + bool Refresh(std::string*& result); + +private: + std::string name; + std::string authors; + std::string authorsEmail; + std::string categories; + std::string description; +}; + +#endif /* MODELCDMBLACKBOX_H_ */ diff --git a/lib/creaDevManagerLib/modelCDMIProjectTreeNode.h b/lib/creaDevManagerLib/modelCDMIProjectTreeNode.h index 1ee20e2..4d06cb6 100644 --- a/lib/creaDevManagerLib/modelCDMIProjectTreeNode.h +++ b/lib/creaDevManagerLib/modelCDMIProjectTreeNode.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -25,13 +25,11 @@ # ------------------------------------------------------------------------ */ - - /* * modelCDMIProjectTreeNode.h * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef MODELCDMIPROJECTTREENODE_H_ @@ -45,37 +43,23 @@ class modelCDMIProjectTreeNode public: virtual ~modelCDMIProjectTreeNode(){} - const std::string& GetPath() const - { - return this->path; - } - const std::string& GetName() const - { - return this->name; - } - const unsigned char& GetType() const - { - return this->type; - } - const int& GetLevel() const - { - return this->level; - } - const std::vector& GetChildren() const - { - return this->children; - } - void SetChildren(std::vector& children) - { - this->children.clear(); - this->children = children; - } + const std::string& GetPath() const; + const std::string& GetName() const; + const unsigned char& GetType() const; + const int& GetLevel() const; + const std::vector& GetChildren() const; + void SetChildren(const std::vector& children); + + const bool& Refresh(std::string*& result); + const bool& OpenInFileExplorer(std::string*& result) const; + protected: std::string path; std::string name; unsigned char type; int level; - std::vector children; + std::vector children; + }; diff --git a/lib/creaDevManagerLib/controlCDMMain.h b/lib/creaDevManagerLib/modelCDMLib.cpp similarity index 60% rename from lib/creaDevManagerLib/controlCDMMain.h rename to lib/creaDevManagerLib/modelCDMLib.cpp index d7c6528..d22a6fe 100644 --- a/lib/creaDevManagerLib/controlCDMMain.h +++ b/lib/creaDevManagerLib/modelCDMLib.cpp @@ -1,54 +1,65 @@ /* # --------------------------------------------------------------------- # -# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil # -# This software is governed by the CeCILL-B license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL-B -# license as circulated by CEA, CNRS and INRIA at the following URL -# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # or in the file LICENSE.txt. # # As a counterpart to the access to the source code and rights to copy, # modify and redistribute granted by the license, users are provided only # with a limited warranty and the software's author, the holder of the # economic rights, and the successive licensors have only limited -# liability. +# liability. # # The fact that you are presently reading this means that you have had # knowledge of the CeCILL-B license and that you accept its terms. -# ------------------------------------------------------------------------ -*/ - +# ------------------------------------------------------------------------ + */ /* - * controlCDMMain.h + * modelCDMLib.cpp * - * Created on: 13/11/2012 - * Author: daniel + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando */ -#ifndef CONTROLCDMMAIN_H_ -#define CONTROLCDMMAIN_H_ +#include "modelCDMLib.h" + +modelCDMLib::modelCDMLib() +{ +} + +modelCDMLib::~modelCDMLib() +{ +} -#include "modelCDMProject.h" +bool modelCDMLib::CreateLibrary( + const std::string& name, + std::string*& result, + const std::string& path +) +{ + //TODO: implement method + return true; +} -class controlCDMMain +bool modelCDMLib::OpenCMakeListsFile(std::string*& result) { -public: - controlCDMMain(); - ~controlCDMMain(); - const modelCDMProject& GetActiveProject(); - bool UpdateActiveProject(); - const int OpenProject(const std::string& path); - bool CloseProject(const std::string& projectName); -private: - modelCDMProject* main; -}; + //TODO: implement method + return true; +} -#endif /* CONTROLCDMMAIN_H_ */ +bool modelCDMLib::Refresh(std::string*& result) +{ + //TODO: implement method + return true; +} diff --git a/lib/creaDevManagerLib/ControlCreaDevManagerMain.h b/lib/creaDevManagerLib/modelCDMLib.h similarity index 59% rename from lib/creaDevManagerLib/ControlCreaDevManagerMain.h rename to lib/creaDevManagerLib/modelCDMLib.h index e6a5dfe..520822f 100644 --- a/lib/creaDevManagerLib/ControlCreaDevManagerMain.h +++ b/lib/creaDevManagerLib/modelCDMLib.h @@ -1,60 +1,62 @@ /* # --------------------------------------------------------------------- # -# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil # -# This software is governed by the CeCILL-B license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL-B -# license as circulated by CEA, CNRS and INRIA at the following URL -# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # or in the file LICENSE.txt. # # As a counterpart to the access to the source code and rights to copy, # modify and redistribute granted by the license, users are provided only # with a limited warranty and the software's author, the holder of the # economic rights, and the successive licensors have only limited -# liability. +# liability. # # The fact that you are presently reading this means that you have had # knowledge of the CeCILL-B license and that you accept its terms. -# ------------------------------------------------------------------------ -*/ - +# ------------------------------------------------------------------------ + */ /* - * ControlCreaDevManagerMain.h + * modelCDMLib.h * - * Created on: 5/11/2012 - * Author: daniel + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando */ -#ifndef CONTROLCREADEVMANAGERMAIN_H_ -#define CONTROLCREADEVMANAGERMAIN_H_ +#ifndef MODELCDMLIB_H_ +#define MODELCDMLIB_H_ + +#include +#include -#include -#include "modelCDMProjectsTree.h" +#include "modelCDMIProjectTreeNode.h" +#include "modelCDMLibrary.h" -class ControlCreaDevManagerMain +class modelCDMLib : public modelCDMIProjectTreeNode { public: - ControlCreaDevManagerMain(); - ~ControlCreaDevManagerMain(); + modelCDMLib(); + ~modelCDMLib(); - const modelCDMProjectsTree& GetActiveProjects() const; - bool LoadActiveProjects(); - bool UpdateActiveProjects(); - const int OpenProject(const std::string& path); - bool CloseProject(const std::string& projectName); + bool CreateLibrary( + const std::string& name, + std::string*& result, + const std::string& path = "/" + ); + bool OpenCMakeListsFile(std::string*& result); + bool Refresh(std::string*& result); private: - modelCDMProjectsTree projectsTree; + std::vector libraries; }; - - -#endif /* CONTROLCREADEVMANAGERMAIN_H_ */ +#endif /* MODELCDMLIB_H_ */ diff --git a/lib/creaDevManagerLib/modelCDMLibrary.cpp b/lib/creaDevManagerLib/modelCDMLibrary.cpp new file mode 100644 index 0000000..7bf7373 --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMLibrary.cpp @@ -0,0 +1,69 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMLibrary.cpp + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "modelCDMLibrary.h" + +modelCDMLibrary::modelCDMLibrary() +{ +} + +modelCDMLibrary::~modelCDMLibrary() +{ +} + +const std::string& modelCDMLibrary::GetName() const +{ + return this->name; +} + +bool modelCDMLibrary::CreateFolder( + const std::string& name, + std::string*& result, + const std::string& path) +{ + //TODO: implement method + return true; +} + +bool modelCDMLibrary::OpenCMakeListsFile(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMLibrary::Refresh(std::string*& result) +{ + //TODO: implement method + return true; +} diff --git a/lib/creaDevManagerLib/modelCDMLibrary.h b/lib/creaDevManagerLib/modelCDMLibrary.h new file mode 100644 index 0000000..64ae1f8 --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMLibrary.h @@ -0,0 +1,64 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMLibrary.h + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef MODELCDMLIBRARY_H_ +#define MODELCDMLIBRARY_H_ + +#include +#include + +#include "modelCDMIProjectTreeNode.h" + +class modelCDMLibrary : public modelCDMIProjectTreeNode +{ +public: + modelCDMLibrary(); + ~modelCDMLibrary(); + + const std::string& GetName() const; + + bool CreateFolder( + const std::string& name, + std::string*& result, + const std::string& path = "/" + ); + bool OpenCMakeListsFile(std::string*& result); + bool Refresh(std::string*& result); + +private: + std::string name; + std::vector libraries; +}; + +#endif /* MODELCDMLIBRARY_H_ */ diff --git a/lib/creaDevManagerLib/modelCDMMain.cpp b/lib/creaDevManagerLib/modelCDMMain.cpp index 9edeb64..307deca 100644 --- a/lib/creaDevManagerLib/modelCDMMain.cpp +++ b/lib/creaDevManagerLib/modelCDMMain.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -23,39 +23,155 @@ # The fact that you are presently reading this means that you have had # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ -*/ - - + */ /* * modelCDMMain.cpp * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "modelCDMMain.h" -#include +#include +#include +#include +#include + +#include "CDMUtilities.h" modelCDMMain::modelCDMMain() { - this->project = NULL; + //TODO: implement method } + modelCDMMain::~modelCDMMain() { - if (this->project != NULL) - delete this->project; + //TODO: implement method } -modelCDMProject* modelCDMMain::GetProject() +const modelCDMProject* modelCDMMain::GetProject() const { + //TODO: implement method return this->project; } -void modelCDMMain::SetProject(modelCDMProject* project) + +bool modelCDMMain::CreateProject( + const std::string& name, + const std::string& location, + std::string*& result, + const std::string& author, + const std::string& description) { - if(this->project != NULL && this->project != project) - delete this->project; - this->project = project; + //TODO: implement method + return true; } +bool modelCDMMain::OpenProject( + const std::string& path, + std::string*& result +) +{ + std::cout << "Selection path: "<< path << std::endl; + + //get fixed path + std::string pathFixed = CDMUtilities::fixPath(path); + std::cout << "Fixed selection path: "<< pathFixed << std::endl; + + //check if its binaries' folder + bool isBinary = false; + std::string pathBuild = ""; + + //check if Makefile file exists + std::string pathMakefile = pathFixed + "/Makefile"; + FILE* pFile = fopen(pathMakefile.c_str(), "r"); + + //is the binary folder + if (pFile != NULL) + { + fclose(pFile); + std::ifstream readFile; + readFile.open(pathMakefile.c_str()); + std::string word; + + while(!isBinary && readFile >> word) + { + //cout << word << endl; + if(word == "CMAKE_SOURCE_DIR") + { + readFile >> word; + readFile.ignore(); + getline(readFile, word, '\n'); + pathBuild = pathFixed; + pathFixed = word; + isBinary = true; + } + } + readFile.close(); + } + + //check if its source's folder + bool isSource = false; + std::string pathSource = ""; + //check if CMakeLists file exists + std::string pathCMakeLists = pathFixed + "/CMakeLists.txt"; + pFile = fopen(pathCMakeLists.c_str(), "r"); + + //is the source folder + if (pFile != NULL) + { + fclose(pFile); + std::ifstream readFile; + readFile.open(pathCMakeLists.c_str()); + std::string word; + + + while(!isSource && !readFile.eof()) + { + std::getline(readFile,word,'\n'); + int pos = word.find("PROJECT"); + if(pos != std::string::npos) + { + pathSource = pathFixed; + isSource = true; + } + } + readFile.close(); + } + + //if is source folder + if(isSource) + { + std::cout << "Project sources at: " << pathSource; + if(isBinary) + { + std::cout << ", and built in: " << pathBuild; + } + std::cout << std::endl; + } + else + { + result = new std::string("No source folder found. Please make sure to select either the project's build or source folder."); + return false; + } + + //TODO: create Project given the source folder + return true; +} + +bool modelCDMMain::RefreshProject( + std::string*& result +) +{ + //TODO: recreate the project using the project's path + return true; +} + +bool modelCDMMain::CloseProject( + std::string*& result +) +{ + //TODO: delete the project tree and leave it as NULL + return true; +} diff --git a/lib/creaDevManagerLib/modelCDMMain.h b/lib/creaDevManagerLib/modelCDMMain.h index d72d3b2..6a10470 100644 --- a/lib/creaDevManagerLib/modelCDMMain.h +++ b/lib/creaDevManagerLib/modelCDMMain.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -23,20 +23,20 @@ # The fact that you are presently reading this means that you have had # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ -*/ - - + */ /* * modelCDMMain.h * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef MODELCDMMAIN_H_ #define MODELCDMMAIN_H_ +#include + #include "modelCDMProject.h" class modelCDMMain @@ -45,8 +45,25 @@ public: modelCDMMain(); ~modelCDMMain(); - modelCDMProject* GetProject(); - void SetProject(modelCDMProject* project); + const modelCDMProject* GetProject() const; + + bool CreateProject( + const std::string& name, + const std::string& location, + std::string*& result, + const std::string& author = "unknown", + const std::string& description = "no description" + ); + bool OpenProject( + const std::string& path, + std::string*& result + ); + bool RefreshProject( + std::string*& result + ); + bool CloseProject( + std::string*& result + ); private: modelCDMProject* project; diff --git a/lib/creaDevManagerLib/modelCDMPackage.cpp b/lib/creaDevManagerLib/modelCDMPackage.cpp new file mode 100644 index 0000000..681c5a4 --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMPackage.cpp @@ -0,0 +1,116 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMPackage.cpp + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "modelCDMPackage.h" + +modelCDMPackage::modelCDMPackage() +{ +} + +modelCDMPackage::~modelCDMPackage() +{ +} + +const std::string& modelCDMPackage::GetName() const +{ + return this->name; +} + +const std::string& modelCDMPackage::GetAuthors() const +{ + return this->authors; +} + +const std::string& modelCDMPackage::GetAuthorsEmail() const +{ + return this->authorsEmail; +} + +const std::string& modelCDMPackage::GetVersion() const +{ + return this->version; +} + +const std::string& modelCDMPackage::GetDescription() const +{ + return this->description; +} + +bool modelCDMPackage::SetAuthors(const std::string& authors, std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMPackage::SetAuthorsEmail(const std::string& email, std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMPackage::SetVersion(const std::string& version, std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMPackage::SetDescription(const std::string& description, std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMPackage::CreateBlackBox( + const std::string& name, + const std::string& authors, + const std::string& authorsEmail, + const std::string& categories, + const std::string& description +) +{ + //TODO: implement method + return true; +} + +bool modelCDMPackage::OpenCMakeListsFile(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMPackage::Refresh(std::string*& result) +{ + //TODO: implement method + return true; +} diff --git a/lib/creaDevManagerLib/modelCDMPackage.h b/lib/creaDevManagerLib/modelCDMPackage.h new file mode 100644 index 0000000..b6202b5 --- /dev/null +++ b/lib/creaDevManagerLib/modelCDMPackage.h @@ -0,0 +1,82 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + +/* + * modelCDMPackage.h + * + * Created on: Nov 23, 2012 + * Author: Daniel Felipe Gonzalez + */ + +#ifndef MODELCDMPACKAGE_H_ +#define MODELCDMPACKAGE_H_ + +#include +#include + +#include"modelCDMIProjectTreeNode.h" +#include"modelCDMBlackBox.h" + +class modelCDMPackage : public modelCDMIProjectTreeNode +{ +public: + modelCDMPackage(); + ~modelCDMPackage(); + + const std::string& GetName() const; + const std::string& GetAuthors() const; + const std::string& GetAuthorsEmail() const; + const std::string& GetVersion() const; + const std::string& GetDescription() const; + + bool SetAuthors(const std::string& authors, std::string*& result); + bool SetAuthorsEmail(const std::string& email, std::string*& result); + bool SetVersion(const std::string& version, std::string*& result); + bool SetDescription(const std::string& description, std::string*& result); + + + bool CreateBlackBox( + const std::string& name, + const std::string& authors = "unknown", + const std::string& authorsEmail = "", + const std::string& categories = "empty", + const std::string& description = "no description" + ); + bool OpenCMakeListsFile(std::string*& result); + bool Refresh(std::string*& result); + +private: + std::string name; + std::string authors; + std::string authorsEmail; + std::string version; + std::string description; + std::vector applications; + +}; + +#endif /* MODELCDMPACKAGE_H_ */ diff --git a/lib/creaDevManagerLib/modelCDMProject.cpp b/lib/creaDevManagerLib/modelCDMProject.cpp index fbcf935..b7a0747 100644 --- a/lib/creaDevManagerLib/modelCDMProject.cpp +++ b/lib/creaDevManagerLib/modelCDMProject.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -23,24 +23,140 @@ # The fact that you are presently reading this means that you have had # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ -*/ - - + */ /* * modelCDMProject.cpp * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "modelCDMProject.h" -modelCDMProject::modelCDMProject(std::string name, std::string path, unsigned char type, int level) +modelCDMProject::modelCDMProject() +{ + //TODO: implement method +} + +modelCDMProject::modelCDMProject( + const std::string& name, + const std::string& path, + const unsigned char& type, + const int& level +) +{ + //TODO: implement method +} + +const std::string& +modelCDMProject::GetName() const +{ + return this->name; +} + +const std::string& +modelCDMProject::GetVersion() const +{ + return this->version; +} + +const std::string& +modelCDMProject::GetVersionDate() const +{ + return this->versionDate; +} + +const std::string& +modelCDMProject::GetBuildPath() const +{ + return this->buildPath; +} + +bool modelCDMProject::SetVersion(const std::string& version, std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::SetBuildPath(const std::string& path, std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::CreatePackage( + const std::string& name, + std::string*& result, + const std::string& authors, + const std::string& authorsEmail, + const std::string& version, + const std::string& description +) { - this->name = name; - this->path = path; - this->type = type; - this->level = level; + //TODO: implement method + return true; } +bool modelCDMProject::CreateLibrary( + const std::string& name, + std::string*& result, + const std::string& path +) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::CreateApplication( + const std::string& name, + std::string*& result, + const std::string& path +) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::CreateBlackBox( + const std::string& name, + const std::string& package, + const std::string& authors, + const std::string& authorsEmail, + const std::string& categories, + const std::string& description +) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::OpenCMakeListsFile(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::Refresh(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::ConfigureBuild(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::Build(std::string*& result) +{ + //TODO: implement method + return true; +} + +bool modelCDMProject::Connect(std::string*& result) +{ + //TODO: implement method + return true; +} diff --git a/lib/creaDevManagerLib/modelCDMProject.h b/lib/creaDevManagerLib/modelCDMProject.h index 82482de..604cea5 100644 --- a/lib/creaDevManagerLib/modelCDMProject.h +++ b/lib/creaDevManagerLib/modelCDMProject.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -23,28 +23,84 @@ # The fact that you are presently reading this means that you have had # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ -*/ - + */ /* * modelCDMProject.h * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef MODELCDMPROJECT_H_ #define MODELCDMPROJECT_H_ +#include +#include + #include "modelCDMIProjectTreeNode.h" +#include "modelCDMLib.h" +#include "modelCDMAppli.h" +#include "modelCDMPackage.h" class modelCDMProject : public modelCDMIProjectTreeNode { public: modelCDMProject(); - modelCDMProject(std::string name, std::string path, unsigned char type, int level); + modelCDMProject(const std::string& name, const std::string& path, const unsigned char& type, const int& level); ~modelCDMProject(){} + const std::string& GetName() const; + const std::string& GetVersion() const; + const std::string& GetVersionDate() const; + const std::string& GetBuildPath() const; + + bool SetVersion(const std::string& version, std::string*& result); + bool SetBuildPath(const std::string& path, std::string*& result); + + bool CreatePackage( + const std::string& name, + std::string*& result, + const std::string& authors = "info-dev", + const std::string& authorsEmail = "info-dev@creatis.insa-lyon.fr", + const std::string& version = "1.0.0", + const std::string& description = "no description" + ); + bool CreateLibrary( + const std::string& name, + std::string*& result, + const std::string& path = "/lib" + ); + bool CreateApplication( + const std::string& name, + std::string*& result, + const std::string& path = "/appli" + ); + bool CreateBlackBox( + const std::string& name, + const std::string& package = "", //if empty converts into "/bbtk_*projectName*_PKG" + const std::string& authors = "unknown", + const std::string& authorsEmail = "", + const std::string& categories = "empty", + const std::string& description = "no description" + ); + bool OpenCMakeListsFile(std::string*& result); + bool Refresh(std::string*& result); + bool ConfigureBuild(std::string*& result); + bool Build(std::string*& result); + bool Connect(std::string*& result); + +private: + + std::string name; + std::string version; + std::string versionDate; + std::string buildPath; + + modelCDMLib* lib; + modelCDMAppli* appli; + std::vector packages; + }; #endif /* MODELCDMPROJECT_H_ */ diff --git a/lib/creaDevManagerLib/modelCDMProjectsTree.cpp b/lib/creaDevManagerLib/modelCDMProjectsTree.cpp index 7c1a3cf..4e17226 100755 --- a/lib/creaDevManagerLib/modelCDMProjectsTree.cpp +++ b/lib/creaDevManagerLib/modelCDMProjectsTree.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * ModelCreaDevManagerTree.cpp * * Created on: 22/10/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "modelCDMProjectsTree.h" @@ -136,7 +136,7 @@ void modelCDMProjectsTree::populateNode(modelCDMProjectsTreeNode& node) std::string path = node.GetPath()+node.GetName()+"/"; - wxDir dir(wxString(path.c_str())); + wxDir dir(crea::std2wx(path.c_str())); if (!dir.IsOpened()) { std::cerr << "Couldn't open the directory" << std::endl; diff --git a/lib/creaDevManagerLib/modelCDMProjectsTree.h b/lib/creaDevManagerLib/modelCDMProjectsTree.h index 4b4f41e..42ed994 100755 --- a/lib/creaDevManagerLib/modelCDMProjectsTree.h +++ b/lib/creaDevManagerLib/modelCDMProjectsTree.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * modelCDMProjectsTree.h * * Created on: 22/10/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef MODELCDMPROJECTSTREE_H_ diff --git a/lib/creaDevManagerLib/modelCDMProjectsTreeNode.cpp b/lib/creaDevManagerLib/modelCDMProjectsTreeNode.cpp index c00ca5f..6d422aa 100755 --- a/lib/creaDevManagerLib/modelCDMProjectsTreeNode.cpp +++ b/lib/creaDevManagerLib/modelCDMProjectsTreeNode.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * ModelCreaDevManagerTreeNode.cpp * * Created on: 22/10/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "modelCDMProjectsTreeNode.h" diff --git a/lib/creaDevManagerLib/modelCDMProjectsTreeNode.h b/lib/creaDevManagerLib/modelCDMProjectsTreeNode.h index e7672b5..25ec959 100755 --- a/lib/creaDevManagerLib/modelCDMProjectsTreeNode.h +++ b/lib/creaDevManagerLib/modelCDMProjectsTreeNode.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * modelCDMProjectsTreeNode.h * * Created on: 22/10/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef MODELCDMPROJECTSTREENODE_H_ diff --git a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp index a88e6dd..e50abba 100644 --- a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * wxCDMMainPanel.cpp * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "wxCDMMainDescriptionPanel.h" diff --git a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.h index 4d1f088..e2efa88 100644 --- a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * wxCDMMainDescriptionPanel.h * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef WXCDMMAINDESCRIPTIONPANEL_H_ diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index 8cc4e78..e1578f9 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -28,16 +28,17 @@ #include "wxCDMMainFrame.h" +#include + +#include +#include "CDMUtilities.h" + #include "creaDevManagerIds.h" #include "wxCDMMainDescriptionPanel.h" #include "wxCDMProjectActionsPanel.h" #include "wxCDMNewProjectDialog.h" -#include - - - BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame) EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject) EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject) @@ -105,51 +106,51 @@ void wxCDMMainFrame::CreateMenus() //FileMenu menu_File = new wxMenu(); - menu_File->Append(ID_MENU_NEW_PROJECT, wxString("&New Project...")); - menu_File->Append(ID_MENU_OPEN_PROJECT, wxString("&Open Project...")); - menu_File->Append(ID_MENU_OPEN_RECENT, wxString("Open &Recent")); + menu_File->Append(ID_MENU_NEW_PROJECT, wxT("&New Project...")); + menu_File->Append(ID_MENU_OPEN_PROJECT, wxT("&Open Project...")); + menu_File->Append(ID_MENU_OPEN_RECENT, wxT("Open &Recent")); menu_File->AppendSeparator(); - menu_File->Append(ID_MENU_CLOSE_PROJECT, wxString("&Close Project")); - menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, wxString("C&lose All Projects")); + menu_File->Append(ID_MENU_CLOSE_PROJECT, wxT("&Close Project")); + menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, wxT("C&lose All Projects")); menu_File->AppendSeparator(); - menu_File->Append(ID_MENU_EXPORT_HIERARCHY, wxString("&Export Project Hierarchy...")); + menu_File->Append(ID_MENU_EXPORT_HIERARCHY, wxT("&Export Project Hierarchy...")); menu_File->AppendSeparator(); - menu_File->Append(ID_MENU_EXIT, wxString("E&xit")); + menu_File->Append(ID_MENU_EXIT, wxT("E&xit")); - menuBar->Append(menu_File, wxString("&File")); + menuBar->Append(menu_File, wxT("&File")); //EditMenu menu_Edit = new wxMenu(); - menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxString("&Refresh Project")); + menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxT("&Refresh Project")); menu_Edit->AppendSeparator(); - menu_Edit->Append(ID_MENU_CUT, wxString("Cu&t")); - menu_Edit->Append(ID_MENU_COPY, wxString("&Copy")); - menu_Edit->Append(ID_MENU_PASTE, wxString("&Paste")); + menu_Edit->Append(ID_MENU_CUT, wxT("Cu&t")); + menu_Edit->Append(ID_MENU_COPY, wxT("&Copy")); + menu_Edit->Append(ID_MENU_PASTE, wxT("&Paste")); menu_Edit->AppendSeparator(); - menu_Edit->Append(ID_MENU_DELETE, wxString("&Delete")); - menu_Edit->Append(ID_MENU_SELECT_ALL, wxString("Select &All")); - menu_Edit->Append(ID_MENU_SELECT_NONE, wxString("Ca&ncel Selection")); + menu_Edit->Append(ID_MENU_DELETE, wxT("&Delete")); + menu_Edit->Append(ID_MENU_SELECT_ALL, wxT("Select &All")); + menu_Edit->Append(ID_MENU_SELECT_NONE, wxT("Ca&ncel Selection")); - menuBar->Append(menu_Edit, wxString("&Edit")); + menuBar->Append(menu_Edit, wxT("&Edit")); //ToolsMenu menu_Tools = new wxMenu(); - menu_Tools->Append(ID_MENU_EVENT_LOG, wxString("Event &Log")); - menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxString("BBTK &Graphical Editor")); - menu_Tools->Append(ID_MENU_MINITOOLS, wxString("&MiniTools")); - menu_Tools->Append(ID_MENU_CODE_EDITOR, wxString("&Code Editor")); - menu_Tools->Append(ID_MENU_COMMAND_LINE, wxString("&Command Line")); + menu_Tools->Append(ID_MENU_EVENT_LOG, wxT("Event &Log")); + menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("BBTK &Graphical Editor")); + menu_Tools->Append(ID_MENU_MINITOOLS, wxT("&MiniTools")); + menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("&Code Editor")); + menu_Tools->Append(ID_MENU_COMMAND_LINE, wxT("&Command Line")); - menuBar->Append(menu_Tools, wxString("&Tools")); + menuBar->Append(menu_Tools, wxT("&Tools")); //HelpMenu menu_Help = new wxMenu(); - menu_Help->Append(ID_MENU_HELP, wxString("&Help")); - menu_Help->Append(ID_MENU_REPORT_BUG, wxString("Report &Bug")); - menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxString("&About CreaDevManager")); - menu_Help->Append(ID_MENU_ABOUT_CREATIS, wxString("A&bout CREATIS")); + menu_Help->Append(ID_MENU_HELP, wxT("&Help")); + menu_Help->Append(ID_MENU_REPORT_BUG, wxT("Report &Bug")); + menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxT("&About CreaDevManager")); + menu_Help->Append(ID_MENU_ABOUT_CREATIS, wxT("A&bout CREATIS")); - menuBar->Append(menu_Help, wxString("&Help")); + menuBar->Append(menu_Help, wxT("&Help")); //Set Bar SetMenuBar(menuBar); @@ -178,7 +179,7 @@ void wxCDMMainFrame::CreateControls() panel_Properties = new wxCDMMainDescriptionPanel( this, ID_WINDOW_PROPERTIES, - wxString("Description Panel"), + wxT("Description Panel"), wxDefaultPosition, wxSize(300, 400), 0 @@ -189,16 +190,16 @@ void wxCDMMainFrame::CreateControls() panel_ProjectActions = new wxCDMProjectActionsPanel( this, ID_WINDOW_PROJ_ACTIONS, - wxString("Project Actions Panel"), + wxT("Project Actions Panel"), wxDefaultPosition, wxSize(600,200), 0 ); panel_ProjectActions->SetMinSize(wxSize(500, 100)); - auiManager.AddPane(tree_Projects, wxLEFT, wxString("Projects Tree")); - auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxString("Project Actions")); - auiManager.AddPane(panel_Properties, wxCENTER, wxString("Properties")); + auiManager.AddPane(tree_Projects, wxLEFT, wxT("Projects Tree")); + auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxT("Project Actions")); + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); auiManager.Update(); auiManager.GetPane(tree_Projects).CloseButton(false).MaximizeButton(true); @@ -224,32 +225,27 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event) } void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) { - /* long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST; - wxDirDialog* FD = new wxDirDialog(this, wxString("Select the project directory"), wxString(""), style); + wxDirDialog* FD = new wxDirDialog(this, wxT("Select the project directory"), wxT(""), style); long userResponse; userResponse = FD->ShowModal(); if(userResponse == wxID_OK) { - switch(this->controller->OpenProject(crea::wx2std (FD->GetPath()))) + std::cout << "selection: " << crea::wx2std (FD->GetPath()) << std::endl; + std::string path = CDMUtilities::fixPath(crea::wx2std (FD->GetPath())); + std::cout << "fixed selection: " << path << std::endl; + std::string* result; + if (!this->model->OpenProject(path, result)) { - case 1: - wxMessageBox( wxT("No project selected."), wxT("Open Project - Error"), wxICON_ERROR); - event.Skip(); - break; - case 2: - wxMessageBox( wxString("Sources not found."), wxString("Open Project - Error"), wxICON_ERROR); + wxMessageBox( crea::std2wx(result->c_str()), wxT("Open Project - Error"), wxICON_ERROR); event.Skip(); - break; - case 0: - break; }; - - ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(controller->GetActiveProjects()); + //TODO: Create tree control + //((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(controller->GetActiveProjects()); auiManager.Update(); } - */ + event.Skip(); } void wxCDMMainFrame::OnMenuOpenRecent(wxCommandEvent& event) diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.h b/lib/creaDevManagerLib/wxCDMMainFrame.h index ece3090..e2505eb 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.h +++ b/lib/creaDevManagerLib/wxCDMMainFrame.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -42,7 +42,7 @@ public: wxCDMMainFrame( wxWindow* parent, wxWindowID id = -1, - const wxString& caption = wxString("CREATIS CreaDevManager"), + const wxString& caption = wxT("CREATIS CreaDevManager"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE @@ -53,7 +53,7 @@ public: bool Create( wxWindow* parent, wxWindowID id = -1, - const wxString& caption = wxString("CREATIS CreaDevManager"), + const wxString& caption = wxT("CREATIS CreaDevManager"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE diff --git a/lib/creaDevManagerLib/wxCDMNewProjectDialog.cpp b/lib/creaDevManagerLib/wxCDMNewProjectDialog.cpp index 45f30e7..e0ad6d4 100644 --- a/lib/creaDevManagerLib/wxCDMNewProjectDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMNewProjectDialog.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * wxCDMNewProjectDialog.cpp * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "wxCDMNewProjectDialog.h" @@ -97,10 +97,10 @@ void wxCDMNewProjectDialog::CreateControls() wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL); - wxStaticText* title = new wxStaticText(this, wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY); + wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Create a new project"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY); v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5); - wxStaticText* instruction = new wxStaticText(this, wxID_ANY, wxString("Please fill the following details."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT); + wxStaticText* instruction = new wxStaticText(this, wxID_ANY, wxT("Please fill the following details."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT); v_sizer1->Add(instruction, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5); wxFlexGridSizer* formItems = new wxFlexGridSizer(4,2,9,15); @@ -111,8 +111,8 @@ void wxCDMNewProjectDialog::CreateControls() wxStaticText *stxtPrjPkg = new wxStaticText(this, -1, wxT("Default Package's Description (HTML)")); wxBoxSizer* h_sizer1 = new wxBoxSizer(wxHORIZONTAL); - wxButton *ddPrjLocBtn = new wxButton(this, ID_BUTTON_CHOOSE, wxString("Choose directory...")); - this->projectLocation = new wxStaticText(this, -1, wxString("")); + wxButton *ddPrjLocBtn = new wxButton(this, ID_BUTTON_CHOOSE, wxT("Choose directory...")); + this->projectLocation = new wxStaticText(this, -1, wxT("")); h_sizer1->Add(ddPrjLocBtn,0,wxALIGN_LEFT | wxLEFT | wxALIGN_CENTER_VERTICAL, 5); h_sizer1->Add(this->projectLocation,0,wxALIGN_LEFT | wxLEFT | wxALIGN_CENTER_VERTICAL, 5); h_sizer1->SetMinSize(wxSize(150, 20)); @@ -136,8 +136,8 @@ void wxCDMNewProjectDialog::CreateControls() v_sizer1->Add(formItems, 1, wxEXPAND | wxALL, 15); wxBoxSizer* h_sizer2 = new wxBoxSizer(wxHORIZONTAL); - h_sizer2->Add(new wxButton(this, ID_BUTTON_NEXT, wxString("Create Project")), 0, wxALL | wxALIGN_CENTER_VERTICAL, 5); - h_sizer2->Add(new wxButton(this, ID_BUTTON_CANCEL, wxString("Cancel")), 0, wxALL | wxALIGN_CENTER_VERTICAL, 5); + h_sizer2->Add(new wxButton(this, ID_BUTTON_NEXT, wxT("Create Project")), 0, wxALL | wxALIGN_CENTER_VERTICAL, 5); + h_sizer2->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Cancel")), 0, wxALL | wxALIGN_CENTER_VERTICAL, 5); v_sizer1->Add(h_sizer2, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30); @@ -149,19 +149,19 @@ void wxCDMNewProjectDialog::OnCreateProject(wxCommandEvent& event) { bool ready = true; - if(ready && this->projectName->GetValue() == wxString("")) + if(ready && this->projectName->GetValue() == wxT("")) { - wxMessageBox(wxString("The project name cannot be empty"),_T("Error"),wxOK | wxICON_ERROR); + wxMessageBox(wxT("The project name cannot be empty"),_T("Error"),wxOK | wxICON_ERROR); ready = false; } - if(ready && this->projectLocation->GetLabel() == wxString("")) + if(ready && this->projectLocation->GetLabel() == wxT("")) { - wxMessageBox(wxString("The project location cannot be empty"),_T("Error"),wxOK | wxICON_ERROR); + wxMessageBox(wxT("The project location cannot be empty"),_T("Error"),wxOK | wxICON_ERROR); ready = false; } - if(ready && this->packageAuthor->GetValue() == wxString("")) + if(ready && this->packageAuthor->GetValue() == wxT("")) { - wxMessageBox(wxString("The project's author cannot be empty"),_T("Error"),wxOK | wxICON_ERROR); + wxMessageBox(wxT("The project's author cannot be empty"),_T("Error"),wxOK | wxICON_ERROR); ready = false; } @@ -181,7 +181,7 @@ void wxCDMNewProjectDialog::OnCancel(wxCommandEvent& event) void wxCDMNewProjectDialog::OnChooseLocation(wxCommandEvent& event) { - wxDirDialog* dialog = new wxDirDialog(this, "Choose the location of the new project"); + wxDirDialog* dialog = new wxDirDialog(this, wxT("Choose the location of the new project")); dialog->ShowModal(); this->projectLocation->SetLabel(dialog->GetPath()); this->Update(); diff --git a/lib/creaDevManagerLib/wxCDMNewProjectDialog.h b/lib/creaDevManagerLib/wxCDMNewProjectDialog.h index bfec02f..ce99eab 100644 --- a/lib/creaDevManagerLib/wxCDMNewProjectDialog.h +++ b/lib/creaDevManagerLib/wxCDMNewProjectDialog.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * wxCDMNewProjectDialog.h * * Created on: 13/11/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef WXCDMNEWPROJECTDIALOG_H_ @@ -46,7 +46,7 @@ public: wxCDMNewProjectDialog( wxWindow* parent, wxWindowID id = wxID_ANY, - const wxString& caption = wxString("New Project"), + const wxString& caption = wxT("New Project"), const wxPoint& position = wxDefaultPosition, const wxSize& size = wxSize(400,300), long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER @@ -55,7 +55,7 @@ public: bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, - const wxString& caption = wxString("New Project"), + const wxString& caption = wxT("New Project"), const wxPoint& position = wxDefaultPosition, const wxSize& size = wxSize(400,300), long style = wxDEFAULT_DIALOG_STYLE diff --git a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp index 125caf3..fec0050 100755 --- a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # # This software is governed by the CeCILL-B license under French law and @@ -28,7 +28,7 @@ * wxCDMProjectActionsPanel.cpp * * Created on: 25/10/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "wxCDMProjectActionsPanel.h" diff --git a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.h b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.h index 44745fd..74133d1 100755 --- a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.h +++ b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * wxCDMProjectActionsPanel.h * * Created on: 25/10/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef WXCDMPROJECTACTIONSPANEL_H_ diff --git a/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx b/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx index fb8f7d8..5ba578e 100755 --- a/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx +++ b/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * wxCreaDevManagerTreeCtrl.cpp * * Created on: 19/10/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #include "wxCDMProjectsTreeCtrl.h" diff --git a/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.h b/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.h index 116b458..cb5fbda 100755 --- a/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.h +++ b/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.h @@ -2,7 +2,7 @@ # --------------------------------------------------------------------- # # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image -# pour la Santé) +# pour la Sant�) # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton # Previous Authors : Laurent Guigues, Jean-Pierre Roux # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil @@ -30,7 +30,7 @@ * wxCreaDevManagerTreeCtrl.h * * Created on: 19/10/2012 - * Author: daniel + * Author: Daniel Felipe Gonzalez Obando */ #ifndef WXCDMPROJECTSTREECTRL_H_ -- 2.45.1