MCPcopy Create free account
hub / github.com/DOI-USGS/ISIS3 / pointModified

Method pointModified

isis/src/control/objs/ControlNetVitals/ControlNetVitals.cpp:176–255  ·  view source on GitHub ↗

* This SLOT is designed to receive a signal emitted from the Control Network * whenever a modification is made to a Control Point. This SLOT receives the * ControlPoint that was modified, as well with the ControlPoint::ModType enum * indicating what type of modification was made to the Control Point. * * We then increment or decrement the appropriate internal counters based on

Source from the content-addressed store, hash-verified

174 * @param newValue The new value (if any) of whatever modification was made to the Control Point.
175 */
176 void ControlNetVitals::pointModified(ControlPoint *point, ControlPoint::ModType type,
177 QVariant oldValue, QVariant newValue) {
178
179 QString historyEntry;
180
181 switch(type) {
182 case ControlPoint::EditLockModified:
183
184 historyEntry = "Point Edit Lock Modified";
185
186 if (oldValue.toBool()) {
187 m_numPointsLocked--;
188 }
189
190 if (newValue.toBool()) {
191 m_numPointsLocked++;
192 }
193
194 emitHistoryEntry( historyEntry, point->GetId(),
195 oldValue, newValue );
196
197 break;
198
199 case ControlPoint::IgnoredModified:
200
201 historyEntry = "Point Ignored Modified";
202
203 if (oldValue.toBool()) {
204 m_numPointsIgnored--;
205 if (point->IsEditLocked()) {
206 m_numPointsLocked++;
207 }
208 m_pointTypeCounts[point->GetType()]++;
209 int numValidMeasures = point->GetNumValidMeasures();
210 if ( !m_pointMeasureCounts.contains(numValidMeasures) ) {
211 m_pointMeasureCounts.insert(numValidMeasures, 1);
212 }
213 else {
214 m_pointMeasureCounts[numValidMeasures]++;
215 }
216 }
217
218 if (newValue.toBool()) {
219 m_numPointsIgnored++;
220 if (point->IsEditLocked()) {
221 m_numPointsLocked--;
222 }
223 m_pointTypeCounts[point->GetType()]--;
224 int numValidMeasures = point->GetNumValidMeasures();
225 if ( --m_pointMeasureCounts[numValidMeasures] < 1 ) {
226 m_pointMeasureCounts.remove(numValidMeasures);
227 }
228 }
229
230 emitHistoryEntry( historyEntry, point->GetId(),
231 oldValue, newValue );
232
233 break;

Callers

nothing calls this directly

Calls 9

PointTypeEnum · 0.85
GetIdMethod · 0.80
validateFunction · 0.50
IsEditLockedMethod · 0.45
GetTypeMethod · 0.45
GetNumValidMeasuresMethod · 0.45
containsMethod · 0.45
insertMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected