Loading isis/src/control/objs/NetworkVitals/Makefile 0 → 100644 +7 −0 Original line number Diff line number Diff line ifeq ($(ISISROOT), $(BLANK)) .SILENT: error: echo "Please set ISISROOT"; else include $(ISISROOT)/make/isismake.objs endif No newline at end of file isis/src/control/objs/NetworkVitals/NetworkVitals.cpp 0 → 100644 +245 −0 Original line number Diff line number Diff line #include "NetworkVitals.h" #include <QList> #include "IException.h" #include "IString.h" #include "ControlNet.h" #include "ControlPoint.h" #include "ControlMeasure.h" namespace Isis { NetworkVitals::NetworkVitals(ControlNet *cnet) { m_controlNet = cnet; validate(); } NetworkVitals::~NetworkVitals() { } bool NetworkVitals::hasIslands() { // Replace this with graph call!!!$!@$!@$!@$#@%#@$%#@ return true; } int NetworkVitals::numIslands() { // replace this with graph call!#@$!#%#@%*($#) return 1; } QList<QString> NetworkVitals::getIslands() { // TEMP, replace with graph QList<QString> list; list.append("CASSIS_01.cub"); return list; } int NetworkVitals::numPoints() { return m_controlNet->GetNumPoints(); } // REFACTOR int NetworkVitals::numIgnoredPoints() { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->IsIgnored()) count++; } return count; } int NetworkVitals::numLockedPoints() { return m_controlNet->GetNumEditLockPoints(); } // REFACTOR int NetworkVitals::numFixedPoints() { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Fixed") count++; } return count; } // REFACTOR int NetworkVitals::numConstraintedPoints() { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Constrained") count++; } return count; } // REFACTOR int NetworkVitals::numFreePoints() { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Free") count++; } return count; } // REFACTOR int NetworkVitals::numPointsBelowMeasureThreshold(int num) { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetNumMeasures() < num) count++; } return count; } int NetworkVitals::numImages() { return m_controlNet->GetCubeSerials().size(); } int NetworkVitals::numMeasures() { return m_controlNet->GetNumMeasures(); } // REFACTOR int NetworkVitals::numImagesBelowMeasureThreshold(int num) { int count = 0; foreach(QString serial, m_controlNet->GetCubeSerials()) { if (m_controlNet->GetMeasuresInCube(serial).size() < num) count++; } return count; } // REFACTOR int NetworkVitals::numImagesBelowHullTolerance(int tolerance) { return 1; } QList<QString> NetworkVitals::getCubeSerials() { return m_controlNet->GetCubeSerials(); } QList<ControlPoint*> NetworkVitals::getAllPoints() { return m_controlNet->GetPoints(); } // REFACTOR QList<ControlPoint*> NetworkVitals::getIgnoredPoints() { QList<ControlPoint*> ignoredPoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->IsIgnored()) ignoredPoints.append(point); } return ignoredPoints; } QList<ControlPoint*> NetworkVitals::getLockedPoints() { QList<ControlPoint*> lockedPoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->IsEditLocked()) lockedPoints.append(point); } return lockedPoints; } QList<ControlPoint*> NetworkVitals::getFixedPoints() { QList<ControlPoint*> fixedPoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Fixed") fixedPoints.append(point); } return fixedPoints; } QList<ControlPoint*> NetworkVitals::getConstrainedPoints() { QList<ControlPoint*> constrainedPoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Constrained") constrainedPoints.append(point); } return constrainedPoints; } QList<ControlPoint*> NetworkVitals::getFreePoints() { QList<ControlPoint*> freePoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Free") freePoints.append(point); } return freePoints; } // REFACTOR QList<ControlPoint*> NetworkVitals::getPointsBelowMeasureThreshold(int num) { QList<ControlPoint*> belowThreshold; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetNumMeasures() < num) belowThreshold.append(point); } return belowThreshold; } QList<QString> NetworkVitals::getAllImageSerials() { return m_controlNet->GetCubeSerials(); } // REFACTOR QList<QString> NetworkVitals::getImagesBelowMeasureThreshold(int num) { QList<QString> imagesBelowThreshold; foreach(QString serial, m_controlNet->GetCubeSerials()) { if (m_controlNet->GetMeasuresInCube(serial).size() < num) imagesBelowThreshold.append(serial); } return imagesBelowThreshold; } // REFACTOR QList<QString> NetworkVitals::getImagesBelowHullTolerance(int num) { QList<QString> list; list.append("Example.cub"); return list; } QString NetworkVitals::getStatus() { return m_status; } QString NetworkVitals::getStatusDetails() { return m_statusDetails; } QString NetworkVitals::getNetworkId() { return m_controlNet->GetNetworkId(); } // // ImageVitals NetworkVitals::getImageVitals(QString serial) { // return NULL; // } void NetworkVitals::validate() { QString status = ""; QString details = ""; if (hasIslands()) { status = "Broken!"; details = "This network has " + toString(numIslands()) + " islands."; } else { if (numPointsBelowMeasureThreshold() < 3) { status = "Weak!"; details += "This network has " + toString(numPointsBelowMeasureThreshold()) + " points with less than 3 measures\n"; } if (numImagesBelowMeasureThreshold() < 3) { status = "Weak!"; details += "This network has " + toString(numImagesBelowMeasureThreshold()) + " images with less than 3 measures\n"; } if (numImagesBelowHullTolerance() > 0) { status = "Weak!"; details += "This network has " + toString(numImagesBelowHullTolerance()) + " images below the Convex Hull Tolerance of 75%\n"; } if (status.isEmpty()) { status = "Healthy!"; details = "This network is healthy."; } } updateStatus(status, details); } void NetworkVitals::updateStatus(QString status, QString details) { m_status = status; m_statusDetails = details; emit networkChanged(); } } isis/src/control/objs/NetworkVitals/NetworkVitals.h 0 → 100644 +136 −0 Original line number Diff line number Diff line #ifndef NetworkVitals_h #define NetworkVitals_h /** * @file * $Revision: 1.2 $ * $Date: 2010/06/28 17:15:01 $ * * Unless noted otherwise, the portions of Isis written by the USGS are * public domain. See individual third-party library and package descriptions * for intellectual property information, user agreements, and related * information. * * Although Isis has been used by the USGS, no warranty, expressed or * implied, is made by the USGS as to the accuracy and functioning of such * software and related material nor shall the fact of distribution * constitute any such warranty, and no responsibility is assumed by the * USGS in connection therewith. * * For additional information, launch * $ISISROOT/doc/documents/Disclaimers/Disclaimers.html * in a browser or see the Privacy & Disclaimers page on the Isis website, * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on * http://www.usgs.gov/privacy.html. */ #include "ControlMeasure.h" #include "ControlNet.h" #include "ControlPoint.h" #include <QStringList> namespace Isis { class ControlNet; /** * @author 2018-05-28 Adam Goins * * @internal * @history 2018-05-28 Adam Goins - Initial Creation. */ class NetworkVitals : public QObject { Q_OBJECT public: NetworkVitals(ControlNet *net); virtual ~NetworkVitals(); ControlNet *m_controlNet; QString m_status; QString m_statusDetails; bool hasIslands(); int numIslands(); QList<QString> getIslands(); int numPoints(); int numIgnoredPoints(); int numLockedPoints(); int numFixedPoints(); int numConstraintedPoints(); int numFreePoints(); int numPointsBelowMeasureThreshold(int num=3); int numImages(); int numMeasures(); int numImagesBelowMeasureThreshold(int num=3); int numImagesBelowHullTolerance(int tolerance=75); QList<QString> getCubeSerials(); QList<ControlPoint*> getAllPoints(); QList<ControlPoint*> getIgnoredPoints(); QList<ControlPoint*> getLockedPoints(); QList<ControlPoint*> getFixedPoints(); QList<ControlPoint*> getConstrainedPoints(); QList<ControlPoint*> getFreePoints(); QList<ControlPoint*> getPointsBelowMeasureThreshold(int num=3); QList<QString> getAllImageSerials(); QList<QString> getImagesBelowMeasureThreshold(int num=3); QList<QString> getImagesBelowHullTolerance(int num=75); QString getNetworkId(); QString getStatus(); QString getStatusDetails(); void updateStatus(QString status, QString details); // ImageVitals getImageVitals(QString serial); signals: void networkChanged(); public slots: void validate(); private: // QHash<QString, ImageVitals> m_imageVitals; // class ImageVitals { // public: // ImageVitals(QString cubeSerial, // QList<ControlMeasure*> measures, // QList<ControlMeasure*> validMeasures) { // m_serial = cubeSerial; // m_measures = measures; // m_validMeasures = validMeasures; // } // ~ImageVitals() {} // // QString getSerial { // return m_serial; // } // // QList<ControlMeasure> getMeasures() { // return m_measures; // }; // // QList<ControlMeasure> getValidMeasures() { // return m_validMeasures; // } // // // // private: // QString m_serial; // QList<ControlMeasure*> m_measures; // QList<ControlMeasure*> m_validMeasures; // ControlNet *m_controlNet; // }; }; }; #endif isis/src/control/objs/NetworkVitals/unitTest.cpp 0 → 100644 +40 −0 Original line number Diff line number Diff line #include "ControlPointList.h" #include <string> #include <iostream> #include "IException.h" #include "FileName.h" #include "Preference.h" using namespace Isis; using namespace std; int main() { Isis::Preference::Preferences(true); Isis::ControlPointList cpl(Isis::FileName("points.lis")); //list of Control Point Ids in the file int size = cpl.Size(); //print point ids in the list for(int i = 0; i < size; i++) { std::cerr << cpl.ControlPointId(i) << "\n"; } // index out of range try { std::cerr << cpl.ControlPointId(size) << "\n"; } catch(Isis::IException &e) { e.print(); } try { std::cerr << cpl.ControlPointIndex("new0007") << "\n"; std::cerr << cpl.ControlPointIndex("new0036") << "\n"; std::cerr << cpl.ControlPointIndex("new0000") << "\n"; //not found - invalid point } catch(Isis::IException &e) { e.print(); } } isis/src/qisis/apps/healthmonitor/Makefile 0 → 100644 +7 −0 Original line number Diff line number Diff line ifeq ($(ISISROOT), $(BLANK)) .SILENT: error: echo "Please set ISISROOT"; else include $(ISISROOT)/make/isismake.apps endif No newline at end of file Loading
isis/src/control/objs/NetworkVitals/Makefile 0 → 100644 +7 −0 Original line number Diff line number Diff line ifeq ($(ISISROOT), $(BLANK)) .SILENT: error: echo "Please set ISISROOT"; else include $(ISISROOT)/make/isismake.objs endif No newline at end of file
isis/src/control/objs/NetworkVitals/NetworkVitals.cpp 0 → 100644 +245 −0 Original line number Diff line number Diff line #include "NetworkVitals.h" #include <QList> #include "IException.h" #include "IString.h" #include "ControlNet.h" #include "ControlPoint.h" #include "ControlMeasure.h" namespace Isis { NetworkVitals::NetworkVitals(ControlNet *cnet) { m_controlNet = cnet; validate(); } NetworkVitals::~NetworkVitals() { } bool NetworkVitals::hasIslands() { // Replace this with graph call!!!$!@$!@$!@$#@%#@$%#@ return true; } int NetworkVitals::numIslands() { // replace this with graph call!#@$!#%#@%*($#) return 1; } QList<QString> NetworkVitals::getIslands() { // TEMP, replace with graph QList<QString> list; list.append("CASSIS_01.cub"); return list; } int NetworkVitals::numPoints() { return m_controlNet->GetNumPoints(); } // REFACTOR int NetworkVitals::numIgnoredPoints() { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->IsIgnored()) count++; } return count; } int NetworkVitals::numLockedPoints() { return m_controlNet->GetNumEditLockPoints(); } // REFACTOR int NetworkVitals::numFixedPoints() { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Fixed") count++; } return count; } // REFACTOR int NetworkVitals::numConstraintedPoints() { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Constrained") count++; } return count; } // REFACTOR int NetworkVitals::numFreePoints() { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Free") count++; } return count; } // REFACTOR int NetworkVitals::numPointsBelowMeasureThreshold(int num) { int count = 0; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetNumMeasures() < num) count++; } return count; } int NetworkVitals::numImages() { return m_controlNet->GetCubeSerials().size(); } int NetworkVitals::numMeasures() { return m_controlNet->GetNumMeasures(); } // REFACTOR int NetworkVitals::numImagesBelowMeasureThreshold(int num) { int count = 0; foreach(QString serial, m_controlNet->GetCubeSerials()) { if (m_controlNet->GetMeasuresInCube(serial).size() < num) count++; } return count; } // REFACTOR int NetworkVitals::numImagesBelowHullTolerance(int tolerance) { return 1; } QList<QString> NetworkVitals::getCubeSerials() { return m_controlNet->GetCubeSerials(); } QList<ControlPoint*> NetworkVitals::getAllPoints() { return m_controlNet->GetPoints(); } // REFACTOR QList<ControlPoint*> NetworkVitals::getIgnoredPoints() { QList<ControlPoint*> ignoredPoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->IsIgnored()) ignoredPoints.append(point); } return ignoredPoints; } QList<ControlPoint*> NetworkVitals::getLockedPoints() { QList<ControlPoint*> lockedPoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->IsEditLocked()) lockedPoints.append(point); } return lockedPoints; } QList<ControlPoint*> NetworkVitals::getFixedPoints() { QList<ControlPoint*> fixedPoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Fixed") fixedPoints.append(point); } return fixedPoints; } QList<ControlPoint*> NetworkVitals::getConstrainedPoints() { QList<ControlPoint*> constrainedPoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Constrained") constrainedPoints.append(point); } return constrainedPoints; } QList<ControlPoint*> NetworkVitals::getFreePoints() { QList<ControlPoint*> freePoints; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetPointTypeString() == "Free") freePoints.append(point); } return freePoints; } // REFACTOR QList<ControlPoint*> NetworkVitals::getPointsBelowMeasureThreshold(int num) { QList<ControlPoint*> belowThreshold; foreach(ControlPoint* point, m_controlNet->GetPoints()) { if (point->GetNumMeasures() < num) belowThreshold.append(point); } return belowThreshold; } QList<QString> NetworkVitals::getAllImageSerials() { return m_controlNet->GetCubeSerials(); } // REFACTOR QList<QString> NetworkVitals::getImagesBelowMeasureThreshold(int num) { QList<QString> imagesBelowThreshold; foreach(QString serial, m_controlNet->GetCubeSerials()) { if (m_controlNet->GetMeasuresInCube(serial).size() < num) imagesBelowThreshold.append(serial); } return imagesBelowThreshold; } // REFACTOR QList<QString> NetworkVitals::getImagesBelowHullTolerance(int num) { QList<QString> list; list.append("Example.cub"); return list; } QString NetworkVitals::getStatus() { return m_status; } QString NetworkVitals::getStatusDetails() { return m_statusDetails; } QString NetworkVitals::getNetworkId() { return m_controlNet->GetNetworkId(); } // // ImageVitals NetworkVitals::getImageVitals(QString serial) { // return NULL; // } void NetworkVitals::validate() { QString status = ""; QString details = ""; if (hasIslands()) { status = "Broken!"; details = "This network has " + toString(numIslands()) + " islands."; } else { if (numPointsBelowMeasureThreshold() < 3) { status = "Weak!"; details += "This network has " + toString(numPointsBelowMeasureThreshold()) + " points with less than 3 measures\n"; } if (numImagesBelowMeasureThreshold() < 3) { status = "Weak!"; details += "This network has " + toString(numImagesBelowMeasureThreshold()) + " images with less than 3 measures\n"; } if (numImagesBelowHullTolerance() > 0) { status = "Weak!"; details += "This network has " + toString(numImagesBelowHullTolerance()) + " images below the Convex Hull Tolerance of 75%\n"; } if (status.isEmpty()) { status = "Healthy!"; details = "This network is healthy."; } } updateStatus(status, details); } void NetworkVitals::updateStatus(QString status, QString details) { m_status = status; m_statusDetails = details; emit networkChanged(); } }
isis/src/control/objs/NetworkVitals/NetworkVitals.h 0 → 100644 +136 −0 Original line number Diff line number Diff line #ifndef NetworkVitals_h #define NetworkVitals_h /** * @file * $Revision: 1.2 $ * $Date: 2010/06/28 17:15:01 $ * * Unless noted otherwise, the portions of Isis written by the USGS are * public domain. See individual third-party library and package descriptions * for intellectual property information, user agreements, and related * information. * * Although Isis has been used by the USGS, no warranty, expressed or * implied, is made by the USGS as to the accuracy and functioning of such * software and related material nor shall the fact of distribution * constitute any such warranty, and no responsibility is assumed by the * USGS in connection therewith. * * For additional information, launch * $ISISROOT/doc/documents/Disclaimers/Disclaimers.html * in a browser or see the Privacy & Disclaimers page on the Isis website, * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on * http://www.usgs.gov/privacy.html. */ #include "ControlMeasure.h" #include "ControlNet.h" #include "ControlPoint.h" #include <QStringList> namespace Isis { class ControlNet; /** * @author 2018-05-28 Adam Goins * * @internal * @history 2018-05-28 Adam Goins - Initial Creation. */ class NetworkVitals : public QObject { Q_OBJECT public: NetworkVitals(ControlNet *net); virtual ~NetworkVitals(); ControlNet *m_controlNet; QString m_status; QString m_statusDetails; bool hasIslands(); int numIslands(); QList<QString> getIslands(); int numPoints(); int numIgnoredPoints(); int numLockedPoints(); int numFixedPoints(); int numConstraintedPoints(); int numFreePoints(); int numPointsBelowMeasureThreshold(int num=3); int numImages(); int numMeasures(); int numImagesBelowMeasureThreshold(int num=3); int numImagesBelowHullTolerance(int tolerance=75); QList<QString> getCubeSerials(); QList<ControlPoint*> getAllPoints(); QList<ControlPoint*> getIgnoredPoints(); QList<ControlPoint*> getLockedPoints(); QList<ControlPoint*> getFixedPoints(); QList<ControlPoint*> getConstrainedPoints(); QList<ControlPoint*> getFreePoints(); QList<ControlPoint*> getPointsBelowMeasureThreshold(int num=3); QList<QString> getAllImageSerials(); QList<QString> getImagesBelowMeasureThreshold(int num=3); QList<QString> getImagesBelowHullTolerance(int num=75); QString getNetworkId(); QString getStatus(); QString getStatusDetails(); void updateStatus(QString status, QString details); // ImageVitals getImageVitals(QString serial); signals: void networkChanged(); public slots: void validate(); private: // QHash<QString, ImageVitals> m_imageVitals; // class ImageVitals { // public: // ImageVitals(QString cubeSerial, // QList<ControlMeasure*> measures, // QList<ControlMeasure*> validMeasures) { // m_serial = cubeSerial; // m_measures = measures; // m_validMeasures = validMeasures; // } // ~ImageVitals() {} // // QString getSerial { // return m_serial; // } // // QList<ControlMeasure> getMeasures() { // return m_measures; // }; // // QList<ControlMeasure> getValidMeasures() { // return m_validMeasures; // } // // // // private: // QString m_serial; // QList<ControlMeasure*> m_measures; // QList<ControlMeasure*> m_validMeasures; // ControlNet *m_controlNet; // }; }; }; #endif
isis/src/control/objs/NetworkVitals/unitTest.cpp 0 → 100644 +40 −0 Original line number Diff line number Diff line #include "ControlPointList.h" #include <string> #include <iostream> #include "IException.h" #include "FileName.h" #include "Preference.h" using namespace Isis; using namespace std; int main() { Isis::Preference::Preferences(true); Isis::ControlPointList cpl(Isis::FileName("points.lis")); //list of Control Point Ids in the file int size = cpl.Size(); //print point ids in the list for(int i = 0; i < size; i++) { std::cerr << cpl.ControlPointId(i) << "\n"; } // index out of range try { std::cerr << cpl.ControlPointId(size) << "\n"; } catch(Isis::IException &e) { e.print(); } try { std::cerr << cpl.ControlPointIndex("new0007") << "\n"; std::cerr << cpl.ControlPointIndex("new0036") << "\n"; std::cerr << cpl.ControlPointIndex("new0000") << "\n"; //not found - invalid point } catch(Isis::IException &e) { e.print(); } }
isis/src/qisis/apps/healthmonitor/Makefile 0 → 100644 +7 −0 Original line number Diff line number Diff line ifeq ($(ISISROOT), $(BLANK)) .SILENT: error: echo "Please set ISISROOT"; else include $(ISISROOT)/make/isismake.apps endif No newline at end of file