| 1 |
/* |
| 2 |
* Copyright (C) 2013-2015, 2019 by the Konclude Developer Team. |
| 3 |
* |
| 4 |
* This file is part of the reasoning system Konclude. |
| 5 |
* For details and support, see <http://konclude.com/>. |
| 6 |
* |
| 7 |
* Konclude is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of version 3 of the GNU Lesser General Public |
| 9 |
* License (LGPLv3) as published by the Free Software Foundation. |
| 10 |
* |
| 11 |
* Konclude is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU (Lesser) General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU (Lesser) General Public |
| 17 |
* License along with Konclude. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
#include "CPreprocessingTestingStep.h" |
| 22 |
#include "COntologyPreprocessingItem.h" |
| 23 |
|
| 24 |
|
| 25 |
namespace Konclude { |
| 26 |
|
| 27 |
namespace Reasoner { |
| 28 |
|
| 29 |
namespace Preprocess { |
| 30 |
|
| 31 |
|
| 32 |
CPreprocessingTestingStep::CPreprocessingTestingStep(TESTINGSTEPTYPE testingStepType, COntologyProcessingStepData* ontProcStepData, COntologyPreprocessingItem* preproItem) { |
| 33 |
mTestingStepType = testingStepType; |
| 34 |
mOntologyPreproItem = preproItem; |
| 35 |
mProcessingStepData = ontProcStepData; |
| 36 |
mStepFinished = false; |
| 37 |
} |
| 38 |
|
| 39 |
COntologyPreprocessingItem* CPreprocessingTestingStep::getOntologyPreprocessingItem() { |
| 40 |
return mOntologyPreproItem; |
| 41 |
} |
| 42 |
|
| 43 |
CPreprocessingTestingStep* CPreprocessingTestingStep::setOntologyPreprocessingItem(COntologyPreprocessingItem* preproItem) { |
| 44 |
mOntologyPreproItem = preproItem; |
| 45 |
return this; |
| 46 |
} |
| 47 |
|
| 48 |
bool CPreprocessingTestingStep::isStepFinished() { |
| 49 |
return mStepFinished; |
| 50 |
} |
| 51 |
|
| 52 |
bool CPreprocessingTestingStep::areStepProcessingRequirementSatisfied() { |
| 53 |
return mProcessingStepData->getProcessingStep()->areAllRequirementsSatisfied(mOntologyPreproItem->getOntology()); |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
bool CPreprocessingTestingStep::hasRequirements() { |
| 58 |
return !mRequirementStepDataList.isEmpty(); |
| 59 |
} |
| 60 |
|
| 61 |
CPreprocessingTestingStep* CPreprocessingTestingStep::setStepFinished(bool finished) { |
| 62 |
mStepFinished = finished; |
| 63 |
cint64 installFlags = COntologyProcessingStatus::PSCOMPLETELYYPROCESSED; |
| 64 |
mProcessingStepData->getProcessingStatus()->setProcessingFlags(installFlags); |
| 65 |
return this; |
| 66 |
} |
| 67 |
|
| 68 |
QList<COntologyProcessingRequirement*>* CPreprocessingTestingStep::getRequirementList() { |
| 69 |
return &mRequirementStepDataList; |
| 70 |
} |
| 71 |
|
| 72 |
COntologyProcessingStepData* CPreprocessingTestingStep::getProcessingStepData() { |
| 73 |
return mProcessingStepData; |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
CPreprocessingTestingStep::TESTINGSTEPTYPE CPreprocessingTestingStep::getPreprocessingTestingType() { |
| 78 |
return mTestingStepType; |
| 79 |
} |
| 80 |
|
| 81 |
CPreprocessingTestingStep* CPreprocessingTestingStep::setProcessingStepData(COntologyProcessingStepData* processingData) { |
| 82 |
mProcessingStepData = processingData; |
| 83 |
return this; |
| 84 |
} |
| 85 |
|
| 86 |
CPreprocessingTestingStep* CPreprocessingTestingStep::addProcessingRequirement(COntologyProcessingRequirement* processingRequirement) { |
| 87 |
mRequirementStepDataList.append(processingRequirement); |
| 88 |
return this; |
| 89 |
} |
| 90 |
|
| 91 |
CPreprocessingTestingStep* CPreprocessingTestingStep::submitRequirementsUpdate(cint64 flags, bool clearRequirements) { |
| 92 |
mProcessingStepData->getProcessingStatus()->setErrorFlags(flags); |
| 93 |
|
| 94 |
for (QList<COntologyProcessingRequirement*>::const_iterator it = mRequirementStepDataList.constBegin(), itEnd = mRequirementStepDataList.constEnd(); it != itEnd; ++it) { |
| 95 |
COntologyProcessingRequirement* requirement(*it); |
| 96 |
requirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED,flags); |
| 97 |
} |
| 98 |
|
| 99 |
if (clearRequirements) { |
| 100 |
mRequirementStepDataList.clear(); |
| 101 |
} |
| 102 |
return this; |
| 103 |
} |
| 104 |
|
| 105 |
|
| 106 |
}; // end namespace Preprocess |
| 107 |
|
| 108 |
}; // end namespace Reasoner |
| 109 |
|
| 110 |
}; // end namespace Konclude |