Layers Panels and Plygons
This commit is contained in:
1 parent
20b7883d46
commit
23dc684ba3
3 files changed
+76
No files matched your search
@@ -467,6 +467,16 @@ function newSuperalgosActionSwitch() {
|
||||
functionLibraryMineFunctions.addAllDataMineDataDependencies(action.node, action.rootNodes, functionLibraryUiObjectsFromNodes)
|
||||
}
|
||||
break
|
||||
case 'Add All Layer Panels':
|
||||
{
|
||||
functionLibraryChartingSpaceFunctions.addAllLayerPanels(action.node, functionLibraryUiObjectsFromNodes)
|
||||
}
|
||||
break
|
||||
case 'Add All Layer Polygons':
|
||||
{
|
||||
functionLibraryChartingSpaceFunctions.addAllLayerPolygons(action.node, functionLibraryUiObjectsFromNodes)
|
||||
}
|
||||
break
|
||||
case 'Add All Mine Layers':
|
||||
{
|
||||
functionLibraryChartingSpaceFunctions.addAllMineLayers(action.node, action.rootNodes, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
function newChartingSpaceFunctions() {
|
||||
thisObject = {
|
||||
addAllLayerPanels: addAllLayerPanels,
|
||||
addAllLayerPolygons: addAllLayerPolygons,
|
||||
addAllMineLayers: addAllMineLayers,
|
||||
addMissingDashboards: addMissingDashboards,
|
||||
addMissingTimeMachines: addMissingTimeMachines,
|
||||
@@ -280,4 +282,62 @@ function newChartingSpaceFunctions() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addAllLayerPanels(node, functionLibraryUiObjectsFromNodes) {
|
||||
if (validateReferences(node) !== true) { return }
|
||||
let plotterModule = node.payload.referenceParent.payload.referenceParent.payload.referenceParent
|
||||
for (let i = 0; i < plotterModule.panels.length; i++) {
|
||||
let plotterPanel = plotterModule.panels[i]
|
||||
let layerPanel = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Layer Panel')
|
||||
layerPanel.payload.referenceParent = plotterPanel
|
||||
}
|
||||
}
|
||||
|
||||
function addAllLayerPolygons(node, functionLibraryUiObjectsFromNodes) {
|
||||
if (validateReferences(node) !== true) { return }
|
||||
let plotterModule = node.payload.referenceParent.payload.referenceParent.payload.referenceParent
|
||||
|
||||
if (plotterModule.shapes === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Referenced Plotter Module does not have a Shapes child.')
|
||||
return
|
||||
}
|
||||
|
||||
for (let i = 0; i < plotterModule.shapes.polygons.length; i++) {
|
||||
let polygon = plotterModule.shapes.polygons[i]
|
||||
let layerPolygon = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Layer Polygon')
|
||||
layerPolygon.payload.referenceParent = polygon
|
||||
}
|
||||
}
|
||||
|
||||
function validateReferences(node) {
|
||||
/* Validations to see if we can do this or not. */
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.uiObject === undefined) { return }
|
||||
if (node.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a reference parent node to execute this action.')
|
||||
return
|
||||
}
|
||||
if (node.payload.referenceParent.payload === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a reference parent node to execute this action.')
|
||||
return
|
||||
}
|
||||
if (node.payload.referenceParent.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a reference grand parent node to execute this action.')
|
||||
return
|
||||
}
|
||||
if (node.payload.referenceParent.payload.referenceParent.payload === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a reference grand parent node to execute this action.')
|
||||
return
|
||||
}
|
||||
if (node.payload.referenceParent.payload.referenceParent.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a reference grand grand parent node to execute this action.')
|
||||
return
|
||||
}
|
||||
if (node.payload.referenceParent.payload.referenceParent.payload.referenceParent.payload === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a reference grand grand parent node to execute this action.')
|
||||
return
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14984,6 +14984,9 @@
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
"Use Reference Parent"
|
||||
],
|
||||
"initialValues": {
|
||||
"config": "{ \n\"status\": \"on\"\n}"
|
||||
},
|
||||
@@ -15024,6 +15027,9 @@
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
"Use Reference Parent"
|
||||
],
|
||||
"initialValues": {
|
||||
"config": "{ \n\"status\": \"on\"\n}"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user