]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/visualisations/DynamicVisualisationsUI.java
Move remaining profiles to visualisations for perf
[simantics/district.git] / org.simantics.district.network.ui / src / org / simantics / district / network / ui / visualisations / DynamicVisualisationsUI.java
index 46bea63f2a14032bff8e708aa424c44cf9025a02..e21bcb2a241a59e68a05c1815bb223deb1b34ceb 100644 (file)
@@ -98,6 +98,11 @@ public class DynamicVisualisationsUI {
     private Composite parent;
 
     private Button disableUpdatesButton;
+    private Button resetVisualisationButton;
+    private Button hoveringVertexEnabledButton;
+    private Button hoveringEdgesEnabledButton;
+    private Button elevationServerEnabledButton;
+    private Button notInSimulationButton;
 
     private List<Supplier<Pair<String, DynamicArrowContribution>>> edgeArrowSuppliers;
 
@@ -119,6 +124,8 @@ public class DynamicVisualisationsUI {
     private Button dynamicSymbolsValvesButton;
     private Button dynamicSymbolsPumpingStationsButton;
 
+    private Text intervalText;
+
     public DynamicVisualisationsUI(Composite parent) {
         this.parent = parent;
         ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
@@ -157,20 +164,33 @@ public class DynamicVisualisationsUI {
                 String item = templateSelectionCombo.getItem(templateSelectionCombo.getSelectionIndex());
                 for (NamedResource template : visualisations) {
                     if (item.equals(template.getName())) {
-                        Simantics.getSession().asyncRequest(new WriteRequest() {
-                            
-                            @Override
-                            public void perform(WriteGraph graph) throws DatabaseException {
-                                Resource vf = DynamicVisualisations.getVisualisationFolder(graph, parentResource);
-                                DynamicVisualisations.setActiveVisualisation(graph, vf, template.getResource());
-                            }
-                        });
-                        break;
+                        if (parentResource != null) {
+                            Resource res = parentResource;
+                            Simantics.getSession().asyncRequest(new WriteRequest() {
+                                
+                                @Override
+                                public void perform(WriteGraph graph) throws DatabaseException {
+                                    Resource vf = DynamicVisualisations.getVisualisationFolder(graph, res);
+                                    DynamicVisualisations.setActiveVisualisation(graph, vf, template.getResource());
+                                }
+                            });
+                            break;
+                        }
                     }
                 }
             }
         });
         
+        Composite intervalElementsComposite = new Composite(parent, SWT.NONE);
+        GridDataFactory.fillDefaults().grab(true, false).applyTo(intervalElementsComposite);
+        GridLayoutFactory.fillDefaults().numColumns(1).applyTo(intervalElementsComposite);
+        initializeIntervalElements(intervalElementsComposite);
+        
+        Composite hoverElementsComposite = new Composite(parent, SWT.NONE);
+        GridDataFactory.fillDefaults().grab(true, false).applyTo(hoverElementsComposite);
+        GridLayoutFactory.fillDefaults().numColumns(1).applyTo(hoverElementsComposite);
+        initializeHoverElements(hoverElementsComposite);
+        
         Composite hideElementsComposite = new Composite(parent, SWT.NONE);
         GridDataFactory.fillDefaults().grab(true, false).applyTo(hideElementsComposite);
         GridLayoutFactory.fillDefaults().numColumns(1).applyTo(hideElementsComposite);
@@ -235,16 +255,59 @@ public class DynamicVisualisationsUI {
                 removeVisualisationTemplate(visualisation.getName(), Optional.of(visualisation.getVisualisationResource()));
             }
         });
+    }
+    
+    private void initializeIntervalElements(Composite parent) {
+        Group group = new Group(parent, SWT.NONE);
+        group.setText("Generic");
+        GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
+        GridLayoutFactory.fillDefaults().numColumns(2).margins(5, 5).applyTo(group);
+        
+        createIntervalElements(group);
+    }
+    
+    private void createIntervalElements(Composite parent) {
+
+        Label label = new Label(parent, SWT.NONE);
+        label.setText("Interval (seconds)");
+        intervalText = new Text(parent, SWT.BORDER);
+        GridDataFactory.fillDefaults().grab(true, false).applyTo(intervalText);
+        addSelectionListener(intervalText);
         
-        disableUpdatesButton = new Button(buttonBarsComposite, SWT.CHECK);
+        disableUpdatesButton = new Button(parent, SWT.CHECK);
         disableUpdatesButton.setText("Disable updates");
-        disableUpdatesButton.addSelectionListener(new SelectionAdapter() {
-            
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                disableUpdates();
-            }
-        });
+        addSelectionListener(disableUpdatesButton);
+
+        resetVisualisationButton = new Button(parent, SWT.CHECK);
+        resetVisualisationButton.setText("Reset Visualisation");
+        addSelectionListener(resetVisualisationButton);
+        
+        notInSimulationButton = new Button(parent, SWT.CHECK);
+        notInSimulationButton.setText("Not in Simulation");
+        addSelectionListener(notInSimulationButton);
+
+        elevationServerEnabledButton = new Button(parent, SWT.CHECK);
+        elevationServerEnabledButton.setText("Elevation Server Bounding Box");
+        addSelectionListener(elevationServerEnabledButton);
+    }
+    
+    private void initializeHoverElements(Composite parent) {
+        Group group = new Group(parent, SWT.NONE);
+        group.setText("Hover");
+        GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
+        GridLayoutFactory.fillDefaults().numColumns(2).margins(5, 5).applyTo(group);
+        
+        createHoverElements(group);
+    }
+    
+    private void createHoverElements(Composite parent) {
+        hoveringVertexEnabledButton = new Button(parent, SWT.CHECK);
+        hoveringVertexEnabledButton.setText("Vertex Key Variables on Hover");
+        addSelectionListener(hoveringVertexEnabledButton);
+        
+        hoveringEdgesEnabledButton = new Button(parent, SWT.CHECK);
+        hoveringEdgesEnabledButton.setText("Edge Key Variables on Hover");
+        addSelectionListener(hoveringEdgesEnabledButton);
     }
     
     private void initializeHideElements(Composite parent) {
@@ -410,21 +473,18 @@ public class DynamicVisualisationsUI {
         
         Combo variableCombo = new Combo(parent, SWT.READ_ONLY);
         variableCombo.setItems(arrowContributions.keySet().toArray(new String[arrowContributions.size()]));
-        addSelectionListener(variableCombo);
-        
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(variableCombo);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(variableCombo);
         
         Text gainText = new Text(parent, SWT.BORDER);
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(gainText);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(gainText);
         addSelectionListener(gainText);
         
         Text biasText = new Text(parent, SWT.BORDER);
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(biasText);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(biasText);
         addSelectionListener(biasText);
         
         Button defaultButton = new Button(parent, SWT.CHECK);
         GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(defaultButton);
-        addSelectionListener(defaultButton);
         defaultButton.addSelectionListener(new SelectionAdapter() {
             
             @Override
@@ -442,6 +502,7 @@ public class DynamicVisualisationsUI {
                 }
             }
         });
+        addSelectionListener(defaultButton);
         
         variableCombo.addSelectionListener(new SelectionAdapter() {
             
@@ -461,6 +522,7 @@ public class DynamicVisualisationsUI {
                 defaultButton.setSelection(true);
             }
         });
+        addSelectionListener(variableCombo);
         
         arrowRows.put(object.getArrowObject().getName(), new ArrowObjectRow(label, usedButton, variableCombo, gainText, biasText, defaultButton));
         
@@ -498,10 +560,6 @@ public class DynamicVisualisationsUI {
         };
     }
 
-    protected void disableUpdates() {
-        
-    }
-
     protected void removeVisualisationTemplate(String name, Optional<Resource> of) {
         if (of.isPresent()) {
             Resource visualisation = of.get();
@@ -595,6 +653,25 @@ public class DynamicVisualisationsUI {
         boolean dynamicSymbolsValves = dynamicSymbolsValvesButton.getSelection();
         boolean dynamicSymbolsPumpingStations = dynamicSymbolsPumpingStationsButton.getSelection();
         
+        boolean disabled = disableUpdatesButton.getSelection();
+        boolean resetVisualisation = resetVisualisationButton.getSelection();
+        Long interval;
+        try {
+            // inteval is in milliseconds but shown as seconds
+            
+            interval = (long)(Double.parseDouble(intervalText.getText()) * 1000);
+        } catch (NumberFormatException e) {
+            // ignore
+            interval = 2000L;
+        }
+        final long finalInterval = interval;
+        
+        boolean hoverVertex = hoveringVertexEnabledButton.getSelection();
+        boolean hoverEdges = hoveringEdgesEnabledButton.getSelection();
+        
+        boolean elevationServerBoundingBox = elevationServerEnabledButton.getSelection();
+        boolean notInSimulation = notInSimulationButton.getSelection();
+        
         Simantics.getSession().asyncRequest(new WriteRequest() {
             
             @Override
@@ -605,6 +682,7 @@ public class DynamicVisualisationsUI {
                 } else {
                     exist = DynamicVisualisations.createVisualisation(graph, parentResource, templateName);
                 }
+                DynamicVisualisations.setIntervalAndDisabled(graph, exist, finalInterval, disabled, resetVisualisation);
                 DynamicVisualisations.setColorContributions(graph, exist, colorCollect);
                 DynamicVisualisations.setColorBarOptions(graph, exist, colorBarOptions);
                 DynamicVisualisations.setSizeContributions(graph, exist, sizeCollect);
@@ -631,6 +709,10 @@ public class DynamicVisualisationsUI {
                         dynamicSymbolsValves,
                         dynamicSymbolsPumpingStations
                     );
+                DynamicVisualisations.setKeyVariablesHover(graph, exist, hoverVertex, hoverEdges);
+                
+                DynamicVisualisations.setElevationServerBoundingBox(graph, exist, elevationServerBoundingBox);
+                DynamicVisualisations.setNotInSimulation(graph, exist, notInSimulation);
             }
         });
     }
@@ -866,29 +948,27 @@ public class DynamicVisualisationsUI {
         
         Combo variableCombo = new Combo(parent, SWT.READ_ONLY);
         variableCombo.setItems(colorContributions.keySet().toArray(new String[colorContributions.size()]));
-        addSelectionListener(variableCombo);
         
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(variableCombo);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(variableCombo);
         
         Text minText = new Text(parent, SWT.BORDER);
-        GridDataFactory.fillDefaults().grab(true, false).hint(150, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(minText);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(minText);
         addSelectionListener(minText);
         
         Text maxText = new Text(parent, SWT.BORDER);
-        GridDataFactory.fillDefaults().grab(true, false).hint(150, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(maxText);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(maxText);
         addSelectionListener(maxText);
         
         Text unit = new Text(parent, SWT.READ_ONLY);
-        GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(unit);
+        GridDataFactory.fillDefaults().grab(true, false).hint(30, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(unit);
         
         Combo colorMapCombo = new Combo(parent, SWT.READ_ONLY);
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(colorMapCombo);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(colorMapCombo);
         colorMapCombo.setItems(colorMaps.keySet().toArray(new String[colorMaps.keySet().size()]));
         addSelectionListener(colorMapCombo);
         
         Button defaultButton = new Button(parent, SWT.CHECK);
         GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(defaultButton);
-        addSelectionListener(defaultButton);
         defaultButton.addSelectionListener(new SelectionAdapter() {
             
             @Override
@@ -916,6 +996,7 @@ public class DynamicVisualisationsUI {
                 }
             }
         });
+        addSelectionListener(defaultButton);
         
         variableCombo.addSelectionListener(new SelectionAdapter() {
             
@@ -948,6 +1029,7 @@ public class DynamicVisualisationsUI {
                 }
             }
         });
+        addSelectionListener(variableCombo);
         
         coloringRows.put(object.getColoringObject().getName(), new ColoringObjectRow(label, usedButton, variableCombo, minText, maxText, unit, colorMapCombo, defaultButton));
 
@@ -960,26 +1042,20 @@ public class DynamicVisualisationsUI {
                     String key = variableCombo.getItem(selectionIndex);
                     DynamicColorContribution cont = colorContributions.get(key);
                     if (cont != null) {
-                        String colorMap = colorMapCombo.getItem(colorMapCombo.getSelectionIndex());
-                        try {
-                            Map<String, DynamicColorMap> colorMaps = Simantics.getSession().syncRequest(new UniqueRead<Map<String, DynamicColorMap>>() {
-        
-                                @Override
-                                public Map<String, DynamicColorMap> perform(ReadGraph graph) throws DatabaseException {
-                                    return DynamicVisualisationsContributions.dynamicColorMaps(graph);
-                                }
-                            });
+                        
+                        String label = variableCombo.getItem(variableCombo.getSelectionIndex());
+                        DynamicColorContribution dcc;
+                        if (colorMapCombo.getSelectionIndex() > -1) {
+                            String colorMap = colorMapCombo.getItem(colorMapCombo.getSelectionIndex());
                             DynamicColorMap dColorMap = colorMaps.get(colorMap);
-                            String label = variableCombo.getItem(variableCombo.getSelectionIndex());
-                            
-                            DynamicColorContribution dcc = new DynamicColorContribution(label, cont.getModuleName(), cont.getAttributeName(), unit.getText(), cont.getVariableGain(), cont.getVariableBias(), dColorMap, Double.parseDouble(minText.getText()), Double.parseDouble(maxText.getText()));
-                            dcc.setUsed(usedButton.getSelection());
-                            dcc.setUseDefault(defaultButton.getSelection());
-                            
-                            return Pair.make(object.getColoringObject().getName(), dcc);
-                        } catch (DatabaseException e) {
-                            LOGGER.error("Could not get DynamicColorContribution", e);
+                            dcc = new DynamicColorContribution(label, cont.getModuleName(), cont.getAttributeName(), unit.getText(), cont.getVariableGain(), cont.getVariableBias(), dColorMap, Double.parseDouble(minText.getText()), Double.parseDouble(maxText.getText()));
+                        } else {
+                            dcc = colorContributions.get(label);
                         }
+                        dcc.setUsed(usedButton.getSelection());
+                        dcc.setUseDefault(defaultButton.getSelection());
+                        
+                        return Pair.make(object.getColoringObject().getName(), dcc);
                     }
                 }
                 return null;
@@ -1035,29 +1111,26 @@ public class DynamicVisualisationsUI {
         
         Combo variableCombo = new Combo(parent, SWT.READ_ONLY);
         variableCombo.setItems(sizeContributions.keySet().toArray(new String[sizeContributions.size()]));
-        addSelectionListener(variableCombo);
-        
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(variableCombo);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(variableCombo);
         
         Text minText = new Text(parent, SWT.BORDER);
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(minText);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(minText);
         addSelectionListener(minText);
         
         Text maxText = new Text(parent, SWT.BORDER);
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(maxText);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(maxText);
         addSelectionListener(maxText);
         
         Label unit = new Label(parent, SWT.NONE);
-        GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(unit);
+        GridDataFactory.fillDefaults().grab(true, false).hint(30, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(unit);
         
         Combo sizeMapCombo = new Combo(parent, SWT.READ_ONLY);
-        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(sizeMapCombo);
+        GridDataFactory.fillDefaults().grab(true, false).hint(100, SWT.DEFAULT).align(SWT.CENTER, SWT.CENTER).applyTo(sizeMapCombo);
         sizeMapCombo.setItems(sizeMaps.keySet().toArray(new String[sizeMaps.keySet().size()]));
         addSelectionListener(sizeMapCombo);
         
         Button defaultButton = new Button(parent, SWT.CHECK);
         GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(defaultButton);
-        addSelectionListener(defaultButton);
         defaultButton.addSelectionListener(new SelectionAdapter() {
             
             @Override
@@ -1085,6 +1158,7 @@ public class DynamicVisualisationsUI {
                 }
             }
         });
+        addSelectionListener(defaultButton);
         
         variableCombo.addSelectionListener(new SelectionAdapter() {
             
@@ -1114,6 +1188,7 @@ public class DynamicVisualisationsUI {
                 defaultButton.setSelection(true);
             }
         });
+        addSelectionListener(variableCombo);
         
         sizingRows.put(object.getSizingObject().getName(), new SizingObjectRow(label, usedButton, variableCombo, minText, maxText, unit, sizeMapCombo, defaultButton));
         
@@ -1126,26 +1201,20 @@ public class DynamicVisualisationsUI {
                     String key = variableCombo.getItem(selectionIndex);
                     DynamicSizeContribution cont = sizeContributions.get(key);
                     if (cont != null) {
-                        String sizeMap = sizeMapCombo.getItem(sizeMapCombo.getSelectionIndex());
-                        try {
-                            Map<String, DynamicSizeMap> sizeMaps = Simantics.getSession().syncRequest(new UniqueRead<Map<String, DynamicSizeMap>>() {
-        
-                                @Override
-                                public Map<String, DynamicSizeMap> perform(ReadGraph graph) throws DatabaseException {
-                                    return DynamicVisualisationsContributions.dynamicSizeMaps(graph);
-                                }
-                            });
-                            DynamicSizeMap dColorMap = sizeMaps.get(sizeMap);
-                            String label = variableCombo.getItem(variableCombo.getSelectionIndex());
-                            
-                            DynamicSizeContribution dsc = new DynamicSizeContribution(label, cont.getModuleName(), cont.getAttributeName(), unit.getText(), cont.getVariableGain(), cont.getVariableBias(), dColorMap, Double.parseDouble(minText.getText()), Double.parseDouble(maxText.getText()));
-                            dsc.setUsed(usedButton.getSelection());
-                            dsc.setUseDefault(defaultButton.getSelection());
-                            
-                            return Pair.make(object.getSizingObject().getName(), dsc);
-                        } catch (DatabaseException e) {
-                            LOGGER.error("Could not get DynamicColorContribution", e);
+
+                        String label = variableCombo.getItem(variableCombo.getSelectionIndex());
+                        DynamicSizeContribution dsc;
+                        if (sizeMapCombo.getSelectionIndex() > -1) {
+                            String sizeMap = sizeMapCombo.getItem(sizeMapCombo.getSelectionIndex());
+                            DynamicSizeMap dSizeMap = sizeMaps.get(sizeMap);
+                            dsc = new DynamicSizeContribution(label, cont.getModuleName(), cont.getAttributeName(), unit.getText(), cont.getVariableGain(), cont.getVariableBias(), dSizeMap, Double.parseDouble(minText.getText()), Double.parseDouble(maxText.getText()));
+                        } else {
+                            dsc = sizeContributions.get(label);
                         }
+                        dsc.setUsed(usedButton.getSelection());
+                        dsc.setUseDefault(defaultButton.getSelection());
+                        
+                        return Pair.make(object.getSizingObject().getName(), dsc);
                     }
                 }
                 return null;
@@ -1321,13 +1390,17 @@ public class DynamicVisualisationsUI {
     private void updateListening() {
         if (visualisationsListener != null)
             visualisationsListener.dispose();
-        visualisationsListener = new VisualisationsListener(this);
-        Simantics.getSession().asyncRequest(new DynamicVisualisationsRequest(parentResource), visualisationsListener);
+        if (parentResource != null) {
+            visualisationsListener = new VisualisationsListener(this);
+            Simantics.getSession().asyncRequest(new DynamicVisualisationsRequest(parentResource), visualisationsListener);
+        }
         
         if (listener != null)
             listener.dispose();
-        listener = new VisualisationListener(this);
-        Simantics.getSession().asyncRequest(new ActiveDynamicVisualisationsRequest(parentResource), listener);
+        if (parentResource != null) {
+            listener = new VisualisationListener(this);
+            Simantics.getSession().asyncRequest(new ActiveDynamicVisualisationsRequest(parentResource), listener);
+        }
     }
 
     private static class VisualisationsListener implements Listener<Collection<NamedResource>> {
@@ -1409,6 +1482,19 @@ public class DynamicVisualisationsUI {
                     }
                 }
                 
+                intervalText.setText(Double.toString(((double)visualisation.getInterval()) / 1000.0));
+                disableUpdatesButton.setSelection(visualisation.disabledUpdates());
+                
+                hoveringVertexEnabledButton.setSelection(visualisation.isKeyVariablesVertexHover());
+                hoveringEdgesEnabledButton.setSelection(visualisation.isKeyVariablesEdgesHover());
+                
+                hideConsumersButton.setSelection(visualisation.isHideConsumers());
+                hideEdgesButton.setSelection(visualisation.isHideEdges());
+                hideProducersButton.setSelection(visualisation.isHideProducers());
+                hideValvesButton.setSelection(visualisation.isHideValves());
+                hidePumpingStationsButton.setSelection(visualisation.isHidePumpingStations());
+                hidePointsButton.setSelection(visualisation.isHidePoints());
+                
                 Map<String, DynamicColorContribution> colorContributions = visualisation.getColorContributions();
                 for (Entry<String, DynamicColorContribution> entry : colorContributions.entrySet()) {
                     
@@ -1470,6 +1556,10 @@ public class DynamicVisualisationsUI {
                         break;
                     }
                 }
+                
+                pointsStaticPropertiesButton.setSelection(visualisation.isStaticPropertiesPoints());
+                networkBranchesStaticPropertiesButton.setSelection(visualisation.isStaticPropertiesNetworkBranches());
+                consumersStaticPropertiesButton.setSelection(visualisation.isStaticPropertiesConsumers());
             }
         });
     }