|
27 | 27 | import au.gov.asd.tac.constellation.graph.schema.visual.concept.VisualConcept; |
28 | 28 | import au.gov.asd.tac.constellation.plugins.PluginException; |
29 | 29 | import au.gov.asd.tac.constellation.plugins.PluginExecution; |
| 30 | +import au.gov.asd.tac.constellation.plugins.PluginInfo; |
30 | 31 | import au.gov.asd.tac.constellation.plugins.PluginInteraction; |
| 32 | +import au.gov.asd.tac.constellation.plugins.PluginType; |
31 | 33 | import au.gov.asd.tac.constellation.plugins.parameters.PluginParameters; |
32 | 34 | import au.gov.asd.tac.constellation.plugins.templates.SimpleReadPlugin; |
33 | 35 | import au.gov.asd.tac.constellation.views.qualitycontrol.QualityControlEvent; |
|
51 | 53 | public final class QualityControlAutoVetter implements GraphManagerListener, GraphChangeListener { |
52 | 54 |
|
53 | 55 | private static QualityControlAutoVetter INSTANCE = null; |
54 | | - |
55 | 56 | private static final List<QualityControlAutoVetterListener> buttonListeners = new ArrayList<>(); |
56 | 57 |
|
57 | 58 | private QualityControlState state; |
58 | 59 |
|
59 | 60 | private Graph currentGraph; |
60 | 61 | private long lastGlobalModificationCounter; |
| 62 | + private long lastCameraModificationCounter; |
61 | 63 |
|
62 | 64 | private final List<QualityControlListener> listeners; |
63 | 65 |
|
@@ -152,10 +154,17 @@ public void graphChanged(final GraphChangeEvent event) { |
152 | 154 | if (graph != null) { |
153 | 155 | final ReadableGraph readableGraph = graph.getReadableGraph(); |
154 | 156 | try { |
| 157 | + final int cameraAttribute = VisualConcept.GraphAttribute.CAMERA.get(readableGraph); |
| 158 | + |
155 | 159 | final long thisGlobalModificationCounter = readableGraph.getGlobalModificationCounter(); |
| 160 | + final long thisCameraModificationCounter = readableGraph.getValueModificationCounter(cameraAttribute); |
| 161 | + |
156 | 162 | if (thisGlobalModificationCounter != lastGlobalModificationCounter) { |
157 | | - updateQualityControlState(graph); |
| 163 | + if (lastCameraModificationCounter == thisCameraModificationCounter) { |
| 164 | + updateQualityControlState(graph); |
| 165 | + } |
158 | 166 | lastGlobalModificationCounter = thisGlobalModificationCounter; |
| 167 | + lastCameraModificationCounter = thisCameraModificationCounter; |
159 | 168 | } |
160 | 169 | } finally { |
161 | 170 | readableGraph.release(); |
@@ -288,6 +297,7 @@ public static synchronized QualityControlAutoVetter getInstance() { |
288 | 297 | return INSTANCE; |
289 | 298 | } |
290 | 299 |
|
| 300 | + @PluginInfo(pluginType = PluginType.UPDATE, tags = {"LOW LEVEL"}) |
291 | 301 | private static class QualityControlViewStateUpdater extends SimpleReadPlugin { |
292 | 302 |
|
293 | 303 | @Override |
@@ -352,7 +362,7 @@ public void read(final GraphReadMethods graph, final PluginInteraction interacti |
352 | 362 |
|
353 | 363 | @Override |
354 | 364 | public String getName() { |
355 | | - return "Quality Control View: Save State"; |
| 365 | + return "Quality Control View: Update State"; |
356 | 366 | } |
357 | 367 | } |
358 | 368 |
|
|
0 commit comments