Isis Developer Reference
|
Compares two Control Networks and reports their differences. More...
#include <ControlNetDiff.h>
Public Member Functions | |
ControlNetDiff () | |
Create a ControlNetDiff without any tolerances. | |
ControlNetDiff (Pvl &diffFile) | |
Create a ControlNetDiff with persistent tolerances. | |
virtual | ~ControlNetDiff () |
Destroy the ControlNetDiff. | |
void | addTolerances (Pvl &diffFile) |
Add the given ignore keys and tolerances to the persisent collections of such values. | |
Pvl | compare (FileName &net1Name, FileName &net2Name) |
Compare two Control Networks given their file names, and return their differences. | |
Protected Member Functions | |
void | compare (PvlObject &point1Pvl, PvlObject &point2Pvl, PvlObject &report) |
Compare two Control Points stored as PvlObjects, and add any differences to the report object. | |
void | compareGroups (PvlContainer &g1, PvlContainer &g2, PvlObject &report) |
Compare two collections, or groupings, of PvlKeywords. | |
void | compare (PvlKeyword &k1, PvlKeyword &k2, PvlContainer &report) |
Compare two keywords and report the differences to the given report container. | |
void | diff (QString name, PvlObject &o1, PvlObject &o2, PvlContainer &report) |
Add a new difference keyword to the given report if the PvlObjects have different values for the keyword with the given name. | |
void | diff (QString name, QString v1, QString v2, PvlContainer &report) |
Add a new difference keyword to the given report if the two string are not equal. | |
PvlKeyword | makeKeyword (QString name, QString v1, QString v2) |
Create a new keyword with the given label name and the given values. | |
void | diff (QString name, double v1, double v2, double tol, PvlContainer &report) |
Add a new difference keyword to the given report if the two numerical values are not equal within the given tolerance. | |
PvlKeyword | makeKeyword (QString name, double v1, double v2, double tol) |
Create a new keyword with the given label name and the given values. | |
void | addUniquePoint (QString label, QString v1, QString v2, PvlObject &parent) |
Add a new keyword for the given point to the parent object. | |
void | addUniqueMeasure (QString label, QString v1, QString v2, PvlObject &parent) |
Add a new keyword for the given measure to the parent object. | |
Compares two Control Networks and reports their differences.
This class opens two Control Networks from Filenames and returns their differences as a PVL structure. It is generally stateless, able to compare multiple networks in succession without needing to reset anything. However, the tolerances that are added are persistent.
Differences will be reported as PvlKeywords with two to three values. The first value is from the first network, the second from the second network, and the third the failed tolerance (if provided). Control Point PVL Objects and Control Measure PVL Groups will only be reported if there are differences, or they appear in only one of the two networks. The number of points and measures will similarly only be reported if they differ. The tolerances are stored in a PVL structure containing an IgnoreKeys group with keywords to ignore completely, and a Tolerances group to ignore if the (numerical) values are different within the given tolerance.
Isis::ControlNetDiff::ControlNetDiff | ( | ) |
Create a ControlNetDiff without any tolerances.
|
explicit |
Create a ControlNetDiff with persistent tolerances.
diffFile | The PVL of ignore keywords and tolerance values |
References addTolerances().
|
virtual |
Destroy the ControlNetDiff.
Does not own any passed-in data.
void Isis::ControlNetDiff::addTolerances | ( | Pvl & | diffFile | ) |
Add the given ignore keys and tolerances to the persisent collections of such values.
Does not clear any previously added ignore keys or tolerances. The DateTime keyword is always ignored
diffFile | The PVL of ignore keywords and tolerance values |
References Isis::toDouble().
Referenced by ControlNetDiff().
|
protected |
Add a new keyword for the given measure to the parent object.
It is assumed that one of the two values provided represents a missing SerialNumber.
name | The label of the measure uniquely identifying it |
v1 | The first measure's value for the unique label |
v2 | The second measure's value for the unique label |
parent | Container for the measure group |
References Isis::PvlObject::addGroup(), and Isis::PvlKeyword::addValue().
Referenced by compare().
|
protected |
Add a new keyword for the given point to the parent object.
It is assumed that one of the two values provided represents a missing PointId.
name | The label of the point uniquely identifying it |
v1 | The first points's value for the unique label |
v2 | The second points's value for the unique label |
parent | Container for the point object |
References Isis::PvlContainer::addKeyword(), Isis::PvlObject::addObject(), and Isis::PvlKeyword::addValue().
Referenced by compare().
Compare two Control Networks given their file names, and return their differences.
References addUniquePoint(), compare(), diff(), Isis::PvlObject::findKeyword(), Isis::PvlObject::findObject(), Isis::PvlObject::object(), and Isis::toString().
Referenced by compare(), and compareGroups().
|
protected |
Compare two keywords and report the differences to the given report container.
If a tolerance value exists for the keyword name, the difference will only be reported if the numerical difference magnitude between the values is greater than the tolerance. Otherwise, the keywords must have equal values. At present, only the first value of the keywords is compared. Keywords with multiple values are not considered, nor are their units.
k1 | The first keyword |
k2 | The second keyword |
report | Container for reporting all differences between these keywords |
References diff(), Isis::PvlContainer::name(), and Isis::toDouble().
|
protected |
Compare two Control Points stored as PvlObjects, and add any differences to the report object.
A new Point object will only be added to the report if there were top-level point data differences or measure differences.
point1Pvl | Container for the first Control Point |
point2Pvl | Container for the second Control Point |
report | Container for reporting all differences between these points |
References Isis::PvlObject::addObject(), addUniqueMeasure(), compareGroups(), diff(), makeKeyword(), and Isis::toString().
|
protected |
Compare two collections, or groupings, of PvlKeywords.
If the container has the keyword "SerialNumber", we assume it is a Control Measure, and thus create a PvlGroup to add to our report containing all the differences. Otherwise we add differences directly to the given report object. The measure PvlGroup will only be added if there are data differences.
g1 | Container for the first keyword collection |
g2 | Container for the second keyword collection |
report | Container for reporting all differences between these groupings |
References Isis::PvlObject::addGroup(), compare(), diff(), Isis::PvlContainer::hasKeyword(), and makeKeyword().
Referenced by compare().
|
protected |
Add a new difference keyword to the given report if the two numerical values are not equal within the given tolerance.
The two values represent values of keywords to be directly compared. The first name string is the label of the keyword.
name | The label of the keyword whose values are being compared |
v1 | The first keyword's value |
v2 | The second keyword's value |
tol | The tolerance to compare against the values |
report | Container for reporting differences between these values for the keyword with the given name |
References Isis::PvlContainer::addKeyword(), and makeKeyword().
|
protected |
Add a new difference keyword to the given report if the PvlObjects have different values for the keyword with the given name.
name | The name of the keyword to be compared |
o1 | The first object |
o2 | The second object |
report | Container for reporting differences between these objects for the keyword with the given name |
References diff().
Referenced by compare(), compare(), compare(), compareGroups(), and diff().
|
protected |
Add a new difference keyword to the given report if the two string are not equal.
The two value strings represent values of keywords to be directly compared. The first name string is the label of the keyword.
name | The label of the keyword whose values are being compared |
v1 | The first keyword's value |
v2 | The second keyword's value |
report | Container for reporting differences between these values for the keyword with the given name |
References Isis::PvlContainer::addKeyword(), and makeKeyword().
|
protected |
Create a new keyword with the given label name and the given values.
If the two values are equal within the given tolerance, only add one of them to the keyword.
name | The label of the keyword whose values are being compared |
v1 | The first keyword's value |
v2 | The second keyword's value |
tol | The tolerance to compare against the values |
References Isis::PvlKeyword::addValue(), and Isis::toString().
|
protected |
Create a new keyword with the given label name and the given values.
If the two values are equal, only add one of them to the keyword.
name | The label of the keyword whose values are being compared |
v1 | The first keyword's value |
v2 | The second keyword's value |
References Isis::PvlKeyword::addValue().
Referenced by compare(), compareGroups(), diff(), and diff().