From b1364008d6d38f7c450a64b5af238e78076de4da Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 24 Apr 2018 12:24:26 +0200 Subject: [PATCH] All Panels now living at the PanelsSpace --- .vs/AAWeb/v15/.suo | Bin 56320 -> 51712 bytes Project.njsproj | 4 +- ChartSpace.js => Spaces/ChartSpace.js | 0 FloatingSpace.js => Spaces/FloatingSpace.js | 0 Spaces/PanelsSpace.js | 8 ++- TimelineChart.js | 59 +++++++------------- index.html | 4 +- server.js | 2 +- 8 files changed, 32 insertions(+), 45 deletions(-) rename ChartSpace.js => Spaces/ChartSpace.js (100%) rename FloatingSpace.js => Spaces/FloatingSpace.js (100%) diff --git a/.vs/AAWeb/v15/.suo b/.vs/AAWeb/v15/.suo index 353cf82408447ab425c8593594f03fdd1d3909f1..4a684b9f4504f96212379f136b55ae7a832480ca 100644 GIT binary patch delta 2409 zcmd^=Yitx%6vy|@&TeI)-CFJV*kupae_=W5HyQ0!9J8H5*{f;b`<` zkOg9Z6|g@6{REH(#sL<{tqisiJOOe*E`Xc-a)mKGC)2xdEamH>bWQ~GXrXSB?nPJ? z^oDLS$)jFZ^vg#dO3gWe4D;dV4D};3d`pzlP{h;%17bEX2_ypx&;iaf4nzXhG%eJ# z&5d(+&$n>_CAwAq2u^iNbhA*caW_PJ zVyhf-rL^hEFXfOs-6=yYkEYVChZs?16A;<0;6ymvV6u3tV(pFk%#a{Dn>k5IFnq0S1EF-SJyv`CAA#uHeO}6KlKg$t+9vP(Ahc>3R6lmiv~bqPAMf-alX1>1=B% zeb{Ug8I-)mPFMG*l5J~ZOu7h5)oA9xo{pho7gaY^sk1wC1plctxo@xIj(*>mZ*cW- z!N=g8)p1m_A(77PNFz(rgs5xF+KdIW@0@ZJUB5i{ubc1EK+|J%+ZWls-6QCw<{H}S zN>r|#A?wG**ri9p^HDz-QNo0jU` zSRv@o%@$hPDiHEHyWYV+-sD6uP7&E3-@ z9<)PM56rjt;VREl*U?2(S&%~UT{F~!2c6|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$WF<3_2~!y2e_neU;qFB diff --git a/Project.njsproj b/Project.njsproj index cc4dd052a..57dbdc3d1 100644 --- a/Project.njsproj +++ b/Project.njsproj @@ -69,7 +69,7 @@ - + @@ -83,7 +83,7 @@ - + diff --git a/ChartSpace.js b/Spaces/ChartSpace.js similarity index 100% rename from ChartSpace.js rename to Spaces/ChartSpace.js diff --git a/FloatingSpace.js b/Spaces/FloatingSpace.js similarity index 100% rename from FloatingSpace.js rename to Spaces/FloatingSpace.js diff --git a/Spaces/PanelsSpace.js b/Spaces/PanelsSpace.js index 1117fd3cc..f2adebdd0 100644 --- a/Spaces/PanelsSpace.js +++ b/Spaces/PanelsSpace.js @@ -33,7 +33,7 @@ function newPanelsSpace() { } - function createNewPanel(pType) { + function createNewPanel(pType, pParameters) { let panel; @@ -52,6 +52,12 @@ function newPanelsSpace() { panel.initialize(); break; } + case "Plotter Panel": + { + panel = getNewPlotterPanel(pParameters.devTeam, pParameters.plotterCodeName, pParameters.moduleCodeName, pParameters.panelCodeName); + panel.initialize(); + break; + } } thisObject.panels.push(panel); diff --git a/TimelineChart.js b/TimelineChart.js index d4784f133..784ce013a 100644 --- a/TimelineChart.js +++ b/TimelineChart.js @@ -231,21 +231,27 @@ for (let i = 0; i < pProductCard.product.plotter.module.panels.length; i++) { - let panel = pProductCard.product.plotter.module.panels[i]; + let panelConfig = pProductCard.product.plotter.module.panels[i]; - let plotterPanel = getNewPlotterPanel(pProductCard.product.plotter.devTeam, pProductCard.product.plotter.codeName, pProductCard.product.plotter.moduleName, panel.codeName); + let parameters = { + devTeam: pProductCard.product.plotter.devTeam, + plotterCodeName: pProductCard.product.plotter.codeName, + moduleCodeName: pProductCard.product.plotter.moduleName, + panelCodeName: panelConfig.codeName + } - plotterPanel.initialize(); + let plotterPanelHandle = canvas.panelsSpace.createNewPanel("Plotter Panel", parameters); + let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle); /* Connect Panel to the Plotter via an Event. */ - if (panel.event !== undefined) { + if (panelConfig.event !== undefined) { - productPlotter.plotter.container.eventHandler.listenToEvent(panel.event, plotterPanel.onEventRaised); + productPlotter.plotter.container.eventHandler.listenToEvent(panelConfig.event, plotterPanel.onEventRaised); } - productPlotter.panels.push(plotterPanel); + productPlotter.panels.push(plotterPanelHandle); } /* Create The Profie Picture Ball */ @@ -309,6 +315,14 @@ } + /* Finally the panels. */ + + for (let j = 0; j < productPlotters[i].panels.length; j++) { + + canvas.panelsSpace.destroyPanel(productPlotters[i].panels[j]); + + } + productPlotters.splice(i, 1); // Delete item from array. } @@ -431,25 +445,6 @@ if (this.container.frame.isThisPointHere(point) === true) { - for (let i = 0; i < productPlotters.length; i++) { - - let productPlotter = productPlotters[i]; - - for (let j = 0; j < productPlotter.panels.length; j++) { - - let panel = productPlotter.panels[j]; - - let panelContainer = panel.getContainer(point); - - if (panelContainer !== undefined) { - - /* We found an inner container which has the point. We return it. */ - - return panelContainer; - } - } - } - // return this.container; Currently there is a BUG in which if this is enabled the datetime of the control panel is not recalculated. } else { @@ -522,20 +517,6 @@ let competitionPlotter = competitionPlotters[i]; competitionPlotter.plotter.draw(); } - - /* Finally the panels. */ - - for (let i = 0; i < productPlotters.length; i++) { - - let productPlotter = productPlotters[i]; - - for (let j = 0; j < productPlotter.panels.length; j++) { - - let panel = productPlotter.panels[j]; - panel.draw(); - } - } - } } diff --git a/index.html b/index.html index 2a3f76151..f89319c2e 100644 --- a/index.html +++ b/index.html @@ -31,8 +31,6 @@ - - @@ -70,6 +68,8 @@ + +