Several Bug Fixes and Mantainance

This commit is contained in:
Luis Fernando Molina committed 2020-01-15 12:25:49 +01:00
1 parent 6ec6014aab
commit dbd058bd21
6 files changed
+65 -45

No files matched your search

+1 -3
View File
@@ -201,9 +201,7 @@ function newPlottersManager () {
dataMine: dataMine.code.codeName,
plotterCodeName: plotterModule.parentNode.code.codeName,
moduleCodeName: plotterModule.code.codeName,
panelCodeName: panel.code.codeName,
panelId: panel.id,
isLegacy: panel.code.isLegacy
panelNode: panel
}
let owner = thisObject.payload.node.payload.parentNode.id // Panels are owned by the time machine.
+3 -1
View File
@@ -70,7 +70,9 @@ function newContainer () {
thisObject.frame = newFrame()
thisObject.frame.initialize(pType)
thisObject.frame.containerName = pName
if (pName !== undefined) {
thisObject.frame.containerName = pName
}
thisObject.frame.container = thisObject
thisObject.eventHandler = newEventHandler()
+1
View File
@@ -33,6 +33,7 @@ function newProductsPanel () {
function finalize () {
thisObject.container.eventHandler.stopListening(onMouseWheelEventSuscriptionId)
panelTabButton.finalize()
panelTabButton = undefined
layersMap = undefined
visibleLayers = undefined
+39 -30
View File
@@ -5,35 +5,41 @@ function newPanelTabButton () {
parentContainer: undefined,
draw: draw,
getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
initialize: initialize
initialize: initialize,
finalize: finalize
}
let isInitialized = false
/* Cointainer stuff */
var container = newContainer()
container.name = 'Panel Tab Button'
container.initialize()
container.isClickeable = true
thisObject.container = container
thisObject.container = newContainer()
thisObject.container.name = 'Panel Tab Button'
thisObject.container.initialize()
thisObject.container.isClickeable = true
thisObject.container.frame.containerName = 'Panel Tab Button'
/* Lets listen to our own events to react when we have a Mouse Click */
thisObject.container.eventHandler.listenToEvent('onMouseClick', buttonPressed)
/* Animation to hide the pannel */
let tabStatus = 'visible'
let visiblePosition = {}
let hiddenPosition = {}
let transitionPosition = {}
let onMouseClickEventSuscriptionId
return thisObject
function finalize () {
thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
thisObject.container.finalize()
thisObject.container = undefined
thisObject.fitFunction = undefined
thisObject.parentContainer = undefined
tabStatus = undefined
visiblePosition = undefined
hiddenPosition = undefined
transitionPosition = undefined
}
function initialize () {
thisObject.container.frame.width = 10
thisObject.container.frame.height = 10
@@ -54,10 +60,13 @@ function newPanelTabButton () {
transitionPosition.x = visiblePosition.x
transitionPosition.y = visiblePosition.y
/* Lets listen to our own events to react when we have a Mouse Click */
onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
isInitialized = true
}
function buttonPressed (event) {
function onMouseClick (event) {
if (tabStatus === 'visible') {
visiblePosition.x = thisObject.parentContainer.frame.position.x
visiblePosition.y = thisObject.parentContainer.frame.position.y
@@ -104,7 +113,7 @@ function newPanelTabButton () {
}
function getContainer (point) {
var container
let container
/* First we check if thisObject point is inside thisObject space. */
@@ -132,13 +141,13 @@ function newPanelTabButton () {
}
point2 = {
x: container.frame.width - 3,
x: thisObject.container.frame.width - 3,
y: 3
}
point3 = {
x: container.frame.width / 2,
y: container.frame.height - 3
x: thisObject.container.frame.width / 2,
y: thisObject.container.frame.height - 3
}
break
}
@@ -150,13 +159,13 @@ function newPanelTabButton () {
}
point2 = {
x: container.frame.width - 4,
x: thisObject.container.frame.width - 4,
y: 4
}
point3 = {
x: container.frame.width / 2,
y: container.frame.height - 4
x: thisObject.container.frame.width / 2,
y: thisObject.container.frame.height - 4
}
break
}
@@ -164,16 +173,16 @@ function newPanelTabButton () {
case 'going up': {
point1 = {
x: 4,
y: container.frame.height - 4
y: thisObject.container.frame.height - 4
}
point2 = {
x: container.frame.width - 4,
y: container.frame.height - 4
x: thisObject.container.frame.width - 4,
y: thisObject.container.frame.height - 4
}
point3 = {
x: container.frame.width / 2,
x: thisObject.container.frame.width / 2,
y: 4
}
break
@@ -182,16 +191,16 @@ function newPanelTabButton () {
case 'hidden': {
point1 = {
x: 3,
y: container.frame.height - 3
y: thisObject.container.frame.height - 3
}
point2 = {
x: container.frame.width - 3,
y: container.frame.height - 3
x: thisObject.container.frame.width - 3,
y: thisObject.container.frame.height - 3
}
point3 = {
x: container.frame.width / 2,
x: thisObject.container.frame.width / 2,
y: 3
}
break
+18 -8
View File
@@ -8,18 +8,16 @@ function newPlotterPanel () {
let thisObject = {
fitFunction: undefined,
onRecordChange: onRecordChange,
container: undefined,
onRecordChange: onRecordChange,
draw: draw,
getContainer: getContainer,
initialize: initialize
initialize: initialize,
finalize: finalize
}
let container = newContainer()
container.initialize()
thisObject.container = container
container.frame.containerName = 'Plotter Panel'
thisObject.container = newContainer()
thisObject.container.initialize('Plotter Panel')
let heightFactor = 1
let currentRecord
@@ -28,9 +26,21 @@ function newPlotterPanel () {
return thisObject
function finalize () {
thisObject.container.finalize()
thisObject.container = undefined
thisObject.fitFunction = undefined
heightFactor = undefined
currentRecord = undefined
panelTabButton.finalize()
panelTabButton = undefined
panelNode = undefined
}
function initialize (pPanelNode) {
panelNode = pPanelNode
container.frame.containerName = panelNode.name
thisObject.container.frame.containerName = panelNode.name
thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL
+3 -3
View File
@@ -47,14 +47,14 @@ function newPanelsSpace () {
}
case 'Plotter Panel':
{
if (pParameters.isLegacy !== true) {
if (pParameters.panelNode.code.isLegacy !== true) {
panel = newPlotterPanel()
panel.fitFunction = canvas.chartSpace.fitFunction
panel.container.isVisibleFunction = canvas.chartSpace.isThisPointVisible
panel.session = pSession
panel.initialize(pParameters.panelId)
panel.initialize(pParameters.panelNode)
} else {
panel = getNewPlotterPanel(pParameters.dataMine, pParameters.plotterCodeName, pParameters.moduleCodeName, pParameters.panelCodeName)
panel = getNewPlotterPanel(pParameters.dataMine, pParameters.plotterCodeName, pParameters.moduleCodeName, pParameters.panelNode.code.codeName)
panel.fitFunction = canvas.chartSpace.fitFunction
panel.container.isVisibleFunction = canvas.chartSpace.isThisPointVisible
panel.session = pSession