From 6c15c5c1c678fabbe54fedc9d2a5f12b14b8b768 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 17 Jan 2021 13:28:28 +0100 Subject: [PATCH 1/6] UiObject Message Implementation part 1 --- ...ui-websockets-error-bad-configuration.json | 16 ++ .../UI/Spaces/Floating-Space/UiObject.js | 138 ++++++------ .../Spaces/Floating-Space/UiObjectMessage.js | 202 ++++++++++++++++++ .../UI/Spaces/Floating-Space/UiObjectTitle.js | 4 - 4 files changed, 278 insertions(+), 82 deletions(-) create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/ui-websockets-errors-001-ui-websockets-error-bad-configuration.json create mode 100644 Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ui-websockets-errors-001-ui-websockets-error-bad-configuration.json b/Projects/Superalgos/Schemas/Docs-Topics/ui-websockets-errors-001-ui-websockets-error-bad-configuration.json new file mode 100644 index 000000000..aca834fea --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ui-websockets-errors-001-ui-websockets-error-bad-configuration.json @@ -0,0 +1,16 @@ +{ + "topic": "UI Websockets Errors", + "pageNumber": "1", + "type": "UI Websockets Error - Bad Configuration", + "definition": { + "text": "To enable websockets communications from the UI to Superalgos Clients, we need to read the config of the Network Node. In this case this configuration is unreadable because is not correctly formatted in JSON.", + "updated": 1610882552794 + }, + "paragraphs": [ + { + "style": "Success", + "text": "Edit the configuration and double check that is correctly formatted. If needed copy the text to an online JSON formatter to see clearly which is the problem.", + "updated": 1610882640511 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js index e2838ac67..9482e5e5c 100644 --- a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js @@ -4,7 +4,7 @@ function newUiObject() { const ERROR_LOG = true const logger = newWebDebugLog() - + let thisObject = { fitFunction: undefined, @@ -19,6 +19,7 @@ function newUiObject() { conditionEditor: undefined, formulaEditor: undefined, uiObjectTitle: undefined, + uiObjectMessage: undefined, circularProgressBar: undefined, isRunning: undefined, isPlaying: undefined, @@ -171,6 +172,8 @@ function newUiObject() { thisObject.menu = undefined thisObject.uiObjectTitle.finalize() thisObject.uiObjectTitle = undefined + thisObject.uiObjectMessage.finalize() + thisObject.uiObjectMessage = undefined thisObject.fitFunction = undefined thisObject.isVisibleFunction = undefined @@ -237,10 +240,18 @@ function newUiObject() { thisObject.uiObjectTitle = newUiObjectTitle() thisObject.uiObjectTitle.isVisibleFunction = thisObject.isVisibleFunction - thisObject.uiObjectTitle.container.connectToParent(thisObject.container, false, false, true, true, false, false, true, true) + thisObject.uiObjectTitle.container.connectToParent(thisObject.container, false, false, true, true, false, false, true, true) thisObject.uiObjectTitle.fitFunction = thisObject.fitFunction thisObject.uiObjectTitle.initialize(thisObject.payload) + /* Initialize UI Object Message */ + + thisObject.uiObjectMessage = newUiObjectMessage() + thisObject.uiObjectMessage.isVisibleFunction = thisObject.isVisibleFunction + thisObject.uiObjectMessage.container.connectToParent(thisObject.container, false, false, true, true, false, false, false, true) + thisObject.uiObjectMessage.fitFunction = thisObject.fitFunction + thisObject.uiObjectMessage.initialize(thisObject.payload) + /* Load UI Object Image */ iconPhysics() @@ -305,6 +316,9 @@ function newUiObject() { if (container !== undefined) { return container } } + container = thisObject.uiObjectMessage.getContainer(point) + if (container !== undefined) { return container } + container = thisObject.menu.getContainer(point) if (container !== undefined) { return container } } @@ -320,12 +334,16 @@ function newUiObject() { thisObject.menu.invisiblePhysics() childrenRunningPhysics() thisObject.uiObjectTitle.physics() + thisObject.uiObjectMessage.physics() } function physics() { thisObject.menu.physics() thisObject.uiObjectTitle.physics() + thisObject.menu.physics() + thisObject.uiObjectMessage.physics() + if (thisObject.codeEditor !== undefined) { thisObject.codeEditor.physics() } @@ -676,6 +694,11 @@ function newUiObject() { if (errorMessageCounter < 0) { errorMessageCounter = 0 thisObject.hasError = false + + if (thisObject.uiObjectMessage.type === 'Error') { + thisObject.uiObjectMessage.text = undefined + thisObject.uiObjectMessage.type = undefined + } } } @@ -684,6 +707,11 @@ function newUiObject() { if (warningMessageCounter < 0) { warningMessageCounter = 0 thisObject.hasWarning = false + + if (thisObject.uiObjectMessage.type === 'Warning') { + thisObject.uiObjectMessage.text = undefined + thisObject.uiObjectMessage.type = undefined + } } } @@ -692,6 +720,11 @@ function newUiObject() { if (infoMessageCounter < 0) { infoMessageCounter = 0 thisObject.hasInfo = false + + if (thisObject.uiObjectMessage.type === 'Info') { + thisObject.uiObjectMessage.text = undefined + thisObject.uiObjectMessage.type = undefined + } } } @@ -831,6 +864,11 @@ function newUiObject() { function resetErrorMessage() { errorMessage = undefined thisObject.hasError = false + + if (thisObject.uiObjectMessage.type === 'Error') { + thisObject.uiObjectMessage.text = undefined + thisObject.uiObjectMessage.type = undefined + } } function setWarningMessage(message, duration) { @@ -866,6 +904,11 @@ function newUiObject() { function resetWarningMessage() { warningMessage = undefined thisObject.hasWarning = false + + if (thisObject.uiObjectMessage.type === 'Warning') { + thisObject.uiObjectMessage.text = undefined + thisObject.uiObjectMessage.type = undefined + } } function setInfoMessage(message, duration) { @@ -901,6 +944,11 @@ function newUiObject() { function resetInfoMessage() { infoMessage = undefined thisObject.hasInfo = false + + if (thisObject.uiObjectMessage.type === 'Info') { + thisObject.uiObjectMessage.text = undefined + thisObject.uiObjectMessage.type = undefined + } } function getValue() { @@ -1346,6 +1394,7 @@ function newUiObject() { drawPercentage() drawStatus() thisObject.uiObjectTitle.draw() + thisObject.uiObjectMessage.draw() drawNodeType() } } @@ -1431,6 +1480,7 @@ function newUiObject() { if (drawTitle === true) { thisObject.uiObjectTitle.draw() + thisObject.uiObjectMessage.draw() } } } @@ -1677,94 +1727,26 @@ function newUiObject() { function drawErrorMessage() { if (thisObject.hasError === false) { return } - drawMessage(errorMessage, UI_COLOR.RUSTED_RED) + + thisObject.uiObjectMessage.text = errorMessage + thisObject.uiObjectMessage.type = 'Error' } function drawWarningMessage() { if (thisObject.hasError === true) { return } if (thisObject.hasWarning !== true) { return } - drawMessage(warningMessage, UI_COLOR.TITANIUM_YELLOW) + + thisObject.uiObjectMessage.text = errorMessage + thisObject.uiObjectMessage.type = 'Warning' } function drawInfoMessage() { if (thisObject.hasError === true) { return } if (thisObject.hasWarning === true) { return } if (thisObject.hasInfo !== true) { return } - drawMessage(infoMessage, UI_COLOR.TURQUOISE) - } - function drawMessage(message, textColor) { - - if (UI.projects.superalgos.spaces.floatingSpace.inMapMode === true) { - return - } - if (thisObject.codeEditor !== undefined && thisObject.codeEditor.visible === true) { return } - if (thisObject.formulaEditor !== undefined && thisObject.formulaEditor.visible === true) { return } - if (thisObject.confitionEditor !== undefined && thisObject.confitionEditor.visible === true) { return } - if (thisObject.configEditor !== undefined && thisObject.configEditor.visible === true) { return } - - /* Text Follows */ - let position = { - x: 0, - y: 0 - } - - position = thisObject.container.frame.frameThisPoint(position) - - if (UI.projects.superalgos.spaces.floatingSpace.inMapMode === true) { - position = UI.projects.superalgos.spaces.floatingSpace.transformPointToMap(position) - } - - let radius = thisObject.payload.floatingObject.container.frame.radius - /* Label Text */ - let labelPoint - let fontSize = thisObject.payload.floatingObject.currentFontSize * 3 / 4 - let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2 - let label - - browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY - - if (radius > 6) { - const IDEAL_LABEL_LENGTH = 80 - - label = message - - if (label !== undefined && label !== null) { - if (label.length > IDEAL_LABEL_LENGTH) { - if (label.length > IDEAL_LABEL_LENGTH * 3) { - label = label.substring(0, IDEAL_LABEL_LENGTH * 3) + '...' - } - fontSize = thisObject.payload.floatingObject.currentFontSize * 2 / 4 - } - - if (thisObject.isOnFocus === true) { - /* Split the line into Phrases */ - let phrases = splitTextIntoPhrases(label, 5) - - for (let i = 0; i < phrases.length; i++) { - let phrase = phrases[i] - labelPoint = { - x: position.x - getTextWidth(phrase) / 2, - y: position.y + lineSeparator * (6 - phrases.length + 1 + i) + 30 - } - printMessage(phrase) - } - } else { - if (label.length < 50) { - labelPoint = { - x: position.x - getTextWidth(label) / 2, - y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 6 - } - printMessage(label) - } - } - - function printMessage(text) { - browserCanvasContext.fillStyle = 'rgba(' + textColor + ', 1)' - browserCanvasContext.fillText(text, labelPoint.x, labelPoint.y) - } - } - } + thisObject.uiObjectMessage.text = errorMessage + thisObject.uiObjectMessage.type = 'Info' } function drawValue() { diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js new file mode 100644 index 000000000..deb874efe --- /dev/null +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js @@ -0,0 +1,202 @@ + +function newUiObjectMessage() { + const MODULE_NAME = 'UI Object Message' + + let thisObject = { + fitFunction: undefined, + isVisibleFunction: undefined, + allwaysVisible: undefined, + container: undefined, + payload: undefined, + type: undefined, + text: undefined, + docs: undefined, + physics: physics, + draw: draw, + getContainer: getContainer, + finalize: finalize, + initialize: initialize + } + + thisObject.container = newContainer() + thisObject.container.initialize(MODULE_NAME) + thisObject.container.isClickeable = true + thisObject.container.isDraggeable = false + thisObject.container.frame.radius = 0 + + let selfMouseClickEventSubscriptionId + + return thisObject + + function finalize() { + thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId) + + thisObject.container.finalize() + thisObject.container = undefined + thisObject.payload = undefined + thisObject.isVisibleFunction = undefined + thisObject.fitFunction = undefined + thisObject.type = undefined + thisObject.text = undefined + thisObject.docs = undefined + } + + function initialize(payload) { + thisObject.payload = payload + + selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick) + } + + function getContainer(point) { + if (thisObject.text === undefined) { return } + if (thisObject.container.frame.isThisPointHere(point, true) === true) { + return thisObject.container + } else { + return undefined + } + } + + function physics() { + if (thisObject.text === undefined) { return } + let text = trimMessageText(thisObject.text) + + /* Here we set the dimensions and position of this object */ + const FRAME_HEIGHT = 120 + const FRAME_WIDTH = 300 + + thisObject.container.frame.position.x = - FRAME_WIDTH / 2 + thisObject.container.frame.position.y = + 160 + + thisObject.container.frame.width = FRAME_WIDTH + thisObject.container.frame.height = FRAME_HEIGHT + } + + function onMouseClick(event) { + if (thisObject.text === undefined) { return } + let checkPoint = { + x: 0, + y: 0 + } + checkPoint = thisObject.container.frame.frameThisPoint(checkPoint) + + if (thisObject.isVisibleFunction(checkPoint) === true) { + // Open the docs and navigate. + } + } + + function draw() { + if (thisObject.text === undefined) { return } + if (thisObject.payload.floatingObject.isOnFocus !== true) { return } + + switch (thisObject.type) { + case 'Info': { + drawMessageBackground(UI_COLOR.TURQUOISE) + drawMessage(thisObject.text, UI_COLOR.TURQUOISE) + break + } + case 'Warning': { + drawMessageBackground(UI_COLOR.TITANIUM_YELLOW) + drawMessage(thisObject.text, UI_COLOR.TITANIUM_YELLOW) + break + } + case 'Error': { + drawMessageBackground(UI_COLOR.RUSTED_RED) + drawMessage(thisObject.text, UI_COLOR.RUSTED_RED) + break + } + } + } + + function drawMessageBackground(borderColor) { + if (thisObject.text === undefined) { return } + + let params = { + cornerRadius: 5, + lineWidth: 0.5, + container: thisObject.container, + borderColor: borderColor, + backgroundColor: UI.projects.superalgos.spaces.floatingSpace.style.backgroundColor, + castShadow: false, + opacity: 0.75 + } + + UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params) + + } + + function drawMessage(message, textColor) { + + if (UI.projects.superalgos.spaces.floatingSpace.inMapMode === true) { + return + } + + /* Text Follows */ + let position = { + x: 0, + y: 0 + } + + position = thisObject.container.frame.frameThisPoint(position) + + if (UI.projects.superalgos.spaces.floatingSpace.inMapMode === true) { + position = UI.projects.superalgos.spaces.floatingSpace.transformPointToMap(position) + } + + let radius = thisObject.payload.floatingObject.container.frame.radius + /* Label Text */ + let labelPoint + let fontSize = 20 + let lineSeparator = 25 + let label + + browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY + + if (radius > 6) { + const IDEAL_LABEL_LENGTH = 80 + + label = message + + if (label !== undefined && label !== null) { + if (label.length > IDEAL_LABEL_LENGTH) { + if (label.length > IDEAL_LABEL_LENGTH * 3) { + label = label.substring(0, IDEAL_LABEL_LENGTH * 3) + '...' + } + fontSize = 15 + } + + /* Split the line into Phrases */ + let phrases = splitTextIntoPhrases(label, 5) + if (phrases.length === 1) { + phrases.push("") + } + if (phrases.length === 2) { + phrases.push("") + } + + for (let i = 0; i < phrases.length; i++) { + let phrase = phrases[i] + labelPoint = { + x: position.x - getTextWidth(phrase) / 2 + thisObject.container.frame.width / 2, + y: position.y + lineSeparator * (4 - phrases.length + 1 + i) + } + printMessage(phrase) + } + + function printMessage(text) { + browserCanvasContext.fillStyle = 'rgba(' + textColor + ', 1)' + browserCanvasContext.fillText(text, labelPoint.x, labelPoint.y) + } + } + } + } + + function trimMessageText(text) { + if (text === undefined) { return } + const MAX_LABEL_LENGTH = 35 + if (text.length > MAX_LABEL_LENGTH) { + text = text.substring(0, MAX_LABEL_LENGTH) + '...' + } + return text + } +} + diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectTitle.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectTitle.js index 8c1678d9a..b0cb6038a 100644 --- a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectTitle.js +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectTitle.js @@ -1,10 +1,6 @@ function newUiObjectTitle() { const MODULE_NAME = 'UI Object Title' - const ERROR_LOG = true - - const logger = newWebDebugLog() - let thisObject = { fitFunction: undefined, From 4707cc6d69094ec3f453144f68066a14df7a92e1 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 17 Jan 2021 14:45:03 +0100 Subject: [PATCH 2/6] Websocket client errors documented --- ...ui-websockets-error-bad-configuration.json | 98 ++++++++++++++++++- .../UI/Spaces/Floating-Space/UiObject.js | 23 ++++- .../Spaces/Floating-Space/UiObjectMessage.js | 20 +++- .../UI/Spaces/Side-Space/SidePanelTab.js | 8 ++ UI/Canvas.js | 6 +- UI/EventsServerClient.js | 55 ++++++++--- 6 files changed, 183 insertions(+), 27 deletions(-) diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ui-websockets-errors-001-ui-websockets-error-bad-configuration.json b/Projects/Superalgos/Schemas/Docs-Topics/ui-websockets-errors-001-ui-websockets-error-bad-configuration.json index aca834fea..0178fc8a3 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/ui-websockets-errors-001-ui-websockets-error-bad-configuration.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/ui-websockets-errors-001-ui-websockets-error-bad-configuration.json @@ -3,14 +3,104 @@ "pageNumber": "1", "type": "UI Websockets Error - Bad Configuration", "definition": { - "text": "To enable websockets communications from the UI to Superalgos Clients, we need to read the config of the Network Node. In this case this configuration is unreadable because is not correctly formatted in JSON.", - "updated": 1610882552794 + "text": "To enable websockets communications from the UI to Superalgos Clients, we need to read the config of the Network Node. If anything is wrong with that configuration, the UI will not be able to communicate with the Client via websockets and many things, like running a Task will not be possible.", + "updated": 1610887696051 }, "paragraphs": [ + { + "style": "Text", + "text": "There are several reasons for the UI Web Sockets Client to report a Bad Configuration error. They are all listed below.", + "updated": 1610889008413 + }, + { + "style": "Anchor", + "text": "Invalid JSON Format" + }, + { + "style": "Title", + "text": "Reason #1: Invalid JSON Format", + "updated": 1610889030985 + }, + { + "style": "Text", + "text": "To enable websockets communications from the UI to Superalgos Clients, we need to read the config of the Network Node. In this case this configuration is unreadable because is not correctly formatted in JSON." + }, + { + "style": "Error", + "text": "Bad Configuration - Invalid JSON Format", + "updated": 1610889068414 + }, { "style": "Success", - "text": "Edit the configuration and double check that is correctly formatted. If needed copy the text to an online JSON formatter to see clearly which is the problem.", - "updated": 1610882640511 + "text": "Edit the configuration and double check that is correctly formatted. If needed, copy the text to an online JSON formatter to see clearly which is the problem.", + "updated": 1610887620569 + }, + { + "style": "Note", + "text": "This page contains several error conditions. When clicking at the Error Menssage at a node, you are redirected within this page to the section where the the error that is happening at that node is explained." + }, + { + "style": "Anchor", + "text": "Host Property Not Found" + }, + { + "style": "Title", + "text": "Reason #2: Host Property Not Found" + }, + { + "style": "Text", + "text": "The following property was expected and not found at the Network Node config:", + "updated": 1610889169227 + }, + { + "style": "Json", + "text": "host" + }, + { + "style": "Error", + "text": "Bad Configuration - Host Property Not Found", + "updated": 1610889199843 + }, + { + "style": "Success", + "text": "Double check that you did not misspell this property. It's value should be the hostName or IP number of the computer / server hosting the Superalgos Client.", + "updated": 1610889251223 + }, + { + "style": "Note", + "text": "This page contains several error conditions. When clicking at the Error Menssage at a node, you are redirected within this page to the section where the the error that is happening at that node is explained." + }, + { + "style": "Anchor", + "text": "WebSocketsPort Property Not Found", + "updated": 1610889501929 + }, + { + "style": "Title", + "text": "Reason #3: WebSocketsPort Property Not Found" + }, + { + "style": "Text", + "text": "The following property was expected and not found at the Network Node config:" + }, + { + "style": "Json", + "text": "webSocketsPort", + "updated": 1610889416628 + }, + { + "style": "Error", + "text": "Error: Bad Configuration - WebSocketsPort Property Not Found", + "updated": 1610889423432 + }, + { + "style": "Success", + "text": "Tip: Double check that you did not misspell this property. It's value should be the port number configured for the Client Websockets Interface.", + "updated": 1610889486046 + }, + { + "style": "Note", + "text": "This page contains several error conditions. When clicking at the Error Menssage at a node, you are redirected within this page to the section where the the error that is happening at that node is explained." } ] } \ No newline at end of file diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js index 9482e5e5c..bf8021fa0 100644 --- a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js @@ -125,6 +125,10 @@ function newUiObject() { let warningMessage = '' let infoMessage = '' + let errorDocs = undefined + let warningDocs = undefined + let infoDocs = undefined + let currentValue = 0 let valueMinDecimals = undefined let currentPercentage = '' @@ -203,6 +207,10 @@ function newUiObject() { lastHeartBeat = undefined onRunningCallBackFunction = undefined + + errorDocs = undefined + warningDocs = undefined + infoDocs = undefined } function finalizeEventsServerClient() { @@ -831,9 +839,10 @@ function newUiObject() { runningAtBackendCounter = 5 } - function setErrorMessage(message, duration) { + function setErrorMessage(message, duration, docs) { if (message !== undefined) { errorMessage = message + errorDocs = docs thisObject.hasError = true if (duration === undefined) { duration = 2 } errorMessageCounter = 100 * duration @@ -863,6 +872,7 @@ function newUiObject() { function resetErrorMessage() { errorMessage = undefined + errorDocs = undefined thisObject.hasError = false if (thisObject.uiObjectMessage.type === 'Error') { @@ -871,9 +881,10 @@ function newUiObject() { } } - function setWarningMessage(message, duration) { + function setWarningMessage(message, duration, docs) { if (message !== undefined) { warningMessage = message + warningDocs = docs thisObject.hasWarning = true if (duration === undefined) { duration = 1 } warningMessageCounter = 100 * duration @@ -903,6 +914,7 @@ function newUiObject() { function resetWarningMessage() { warningMessage = undefined + warningDocs = undefined thisObject.hasWarning = false if (thisObject.uiObjectMessage.type === 'Warning') { @@ -911,9 +923,10 @@ function newUiObject() { } } - function setInfoMessage(message, duration) { + function setInfoMessage(message, duration, docs) { if (message !== undefined) { infoMessage = message + infoDocs = docs thisObject.hasInfo = true if (duration === undefined) { duration = 1 } infoMessageCounter = 100 * duration @@ -943,6 +956,7 @@ function newUiObject() { function resetInfoMessage() { infoMessage = undefined + infoDocs = undefined thisObject.hasInfo = false if (thisObject.uiObjectMessage.type === 'Info') { @@ -1730,6 +1744,7 @@ function newUiObject() { thisObject.uiObjectMessage.text = errorMessage thisObject.uiObjectMessage.type = 'Error' + thisObject.uiObjectMessage.docs = errorDocs } function drawWarningMessage() { @@ -1738,6 +1753,7 @@ function newUiObject() { thisObject.uiObjectMessage.text = errorMessage thisObject.uiObjectMessage.type = 'Warning' + thisObject.uiObjectMessage.docs = warningDocs } function drawInfoMessage() { @@ -1747,6 +1763,7 @@ function newUiObject() { thisObject.uiObjectMessage.text = errorMessage thisObject.uiObjectMessage.type = 'Info' + thisObject.uiObjectMessage.docs = infoDocs } function drawValue() { diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js index deb874efe..c930fb4e0 100644 --- a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js @@ -62,7 +62,7 @@ function newUiObjectMessage() { /* Here we set the dimensions and position of this object */ const FRAME_HEIGHT = 120 - const FRAME_WIDTH = 300 + const FRAME_WIDTH = 350 thisObject.container.frame.position.x = - FRAME_WIDTH / 2 thisObject.container.frame.position.y = + 160 @@ -80,7 +80,19 @@ function newUiObjectMessage() { checkPoint = thisObject.container.frame.frameThisPoint(checkPoint) if (thisObject.isVisibleFunction(checkPoint) === true) { - // Open the docs and navigate. + if (thisObject.docs !== undefined) { + + if (UI.projects.superalgos.spaces.docsSpace.sidePanelTab.isOpen === true) { + UI.projects.superalgos.spaces.docsSpace.sidePanelTab.close() + } else { + UI.projects.superalgos.spaces.docsSpace.openSpaceAreaAndNavigateTo( + thisObject.docs.project, + thisObject.docs.category, + thisObject.docs.type, + thisObject.docs.anchor + ) + } + } } } @@ -154,7 +166,7 @@ function newUiObjectMessage() { if (radius > 6) { const IDEAL_LABEL_LENGTH = 80 - label = message + label = message if (label !== undefined && label !== null) { if (label.length > IDEAL_LABEL_LENGTH) { @@ -177,7 +189,7 @@ function newUiObjectMessage() { let phrase = phrases[i] labelPoint = { x: position.x - getTextWidth(phrase) / 2 + thisObject.container.frame.width / 2, - y: position.y + lineSeparator * (4 - phrases.length + 1 + i) + y: position.y + lineSeparator * (4 - phrases.length + 1 + i) } printMessage(phrase) } diff --git a/Projects/Superalgos/UI/Spaces/Side-Space/SidePanelTab.js b/Projects/Superalgos/UI/Spaces/Side-Space/SidePanelTab.js index 3b86f7c2d..13a7dc099 100644 --- a/Projects/Superalgos/UI/Spaces/Side-Space/SidePanelTab.js +++ b/Projects/Superalgos/UI/Spaces/Side-Space/SidePanelTab.js @@ -4,6 +4,8 @@ function newSidePanelTab() { screenside: undefined, pointerDirection: undefined, container: undefined, + isOpen: false, + isClosed: true, index: 0, open: open, close: close, @@ -136,6 +138,8 @@ function newSidePanelTab() { function animate() { if (animation === 'opening') { + thisObject.isOpen = false + thisObject.isClosed = false xOffset = xOffset + ANIMATION_STEP switch (thisObject.screenside) { case 'left': { @@ -155,6 +159,8 @@ function newSidePanelTab() { } if (animation === 'closing') { + thisObject.isOpen = false + thisObject.isClosed = false xOffset = xOffset - ANIMATION_STEP switch (thisObject.screenside) { case 'left': { @@ -175,6 +181,7 @@ function newSidePanelTab() { } function setOpened() { + thisObject.isOpen = true animation = 'none' xOffset = thisObject.container.parentContainer.frame.width thisObject.container.parentContainer.status = 'visible' @@ -192,6 +199,7 @@ function newSidePanelTab() { } } function setClosed() { + thisObject.isClosed = true animation = 'none' xOffset = 0 thisObject.container.parentContainer.status = 'hidden' diff --git a/UI/Canvas.js b/UI/Canvas.js index 15cc7e1cc..dffe08785 100644 --- a/UI/Canvas.js +++ b/UI/Canvas.js @@ -147,7 +147,7 @@ function newCanvas() { projectInstance.functionLibraries[functionLibraryDefinition.propertyName] = eval(functionLibraryDefinition.functionName + '()') } } - + /* Space Instantiation */ if (projectDefinition.UI.spaces === undefined) { continue } for (let j = 0; j < projectDefinition.UI.spaces.length; j++) { @@ -372,7 +372,9 @@ function newCanvas() { We will fordward the event to whoever is controlling the editor. */ - window.editorController.onKeyDown(event) + if (window.editorController !== undefined) { + window.editorController.onKeyDown(event) + } return } /* When the Docs is Visible, we do not process key down events of the Designer Space. */ diff --git a/UI/EventsServerClient.js b/UI/EventsServerClient.js index 190e3efd8..d72b522a0 100644 --- a/UI/EventsServerClient.js +++ b/UI/EventsServerClient.js @@ -6,7 +6,7 @@ function newEventsServerClient(networkNode) { const ERROR_LOG = true const INFO_LOG = true const logger = newWebDebugLog() - + let WEB_SOCKETS_CONNECTION @@ -27,7 +27,7 @@ function newEventsServerClient(networkNode) { let commandsWaitingConfirmation = new Map() let commandsSentByTimestamp = new Map() let nonce = 0 - let lastTryToReconnectDatetime + let lastTryToReconnectDatetime return thisObject @@ -54,7 +54,7 @@ function newEventsServerClient(networkNode) { if (WEB_SOCKETS_CONNECTION !== undefined) { if (WEB_SOCKETS_CONNECTION.readyState === 1) { return true - } + } } } @@ -76,7 +76,7 @@ function newEventsServerClient(networkNode) { } function sendToWebSocketServer(command) { - if (commandsWaitingConfirmation === undefined) {return} // object already finalized + if (commandsWaitingConfirmation === undefined) { return } // object already finalized nonce++ let stringNonce = nonce.toString() @@ -162,7 +162,7 @@ function newEventsServerClient(networkNode) { function physics() { if (WEB_SOCKETS_CONNECTION !== undefined) { - if (WEB_SOCKETS_CONNECTION.readyState === 3) { + if (WEB_SOCKETS_CONNECTION.readyState === 3) { /* Connection closed. May happen after computer goes to sleep. We will try to reconnect, but we will do it no more that once @@ -177,7 +177,7 @@ function newEventsServerClient(networkNode) { setuptWebSockets(onOpen) } } - + function onOpen() { if (INFO_LOG === true) { logger.write('[INFO] setuptWebSockets -> Found Web Sockets Connection Closed. Reconnected to WebSockets Server.') } } @@ -190,8 +190,8 @@ function newEventsServerClient(networkNode) { setuptWebSockets(onOpen) } - if (thisObject.isConnected() !== true ) { - if ( lastTryToReconnectDatetime !== undefined) { + if (thisObject.isConnected() !== true) { + if (lastTryToReconnectDatetime !== undefined) { if (networkNode !== undefined) { if (networkNode.payload !== undefined) { if (networkNode.payload.uiObject !== undefined) { @@ -206,8 +206,8 @@ function newEventsServerClient(networkNode) { if (networkNode.payload.uiObject !== undefined) { networkNode.payload.uiObject.setStatus('Connected to Superalgos Client via WebSockets.') retryCommandsPhysics() - } - } + } + } } } @@ -225,19 +225,46 @@ function newEventsServerClient(networkNode) { port = config.webSocketsPort /* Check if we really have to stablish the connection. */ - if (config.autoConnect === false) {return} + if (config.autoConnect === false) { return } } catch (err) { - networkNode.payload.uiObject.setErrorMessage('Bad configuration. Cannot know the host name or the webSocketsPort.') + networkNode.payload.uiObject.setErrorMessage( + 'Bad configuration. Invalid JSON Format.', + undefined, + { + project: 'Superalgos', + category: 'Topic', + type: 'UI Websockets Error - Bad Configuration', + anchor: 'Invalid JSON Format' + } + ) return } if (host === undefined) { - networkNode.payload.uiObject.setErrorMessage('Bad configuration. You need to have a host property.') + networkNode.payload.uiObject.setErrorMessage( + 'Bad configuration. Host Property Not Found.', + undefined, + { + project: 'Superalgos', + category: 'Topic', + type: 'UI Websockets Error - Bad Configuration', + anchor: 'Host Property Not Found' + } + ) return } if (port === undefined) { - networkNode.payload.uiObject.setErrorMessage('Bad configuration. You need to have a webSocketsPort property.') + networkNode.payload.uiObject.setErrorMessage( + 'Bad configuration. WebSocketsPort Property Not Found.', + undefined, + { + project: 'Superalgos', + category: 'Topic', + type: 'UI Websockets Error - Bad Configuration', + anchor: 'WebSocketsPort Property Not Found' + } + ) return } From 7360439027f212ec986f40e1e5d5d4cfff9d1d85 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 17 Jan 2021 19:36:45 +0100 Subject: [PATCH 3/6] This is my contribution to Superalgos --- Client/httpInterface.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index d1a9d7d6a..2a968bdd2 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -590,7 +590,6 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE switch (requestParameters[2]) { // switch by command case 'Contribute': { try { - console.log(JSON.stringify(requestParameters)) const commitMessage = unescape(requestParameters[3]) const username = unescape(requestParameters[4]) const token = unescape(requestParameters[5]) From 90f2f286837c3ee55e243f437490868c682a1d04 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 17 Jan 2021 20:57:44 +0100 Subject: [PATCH 4/6] Bug Fixes at the Docs, plus connecting TS with the Docs --- .../Schemas/Docs-Concepts/client.json | 14 +++++++++++ .../Superalgos/Schemas/Docs-Concepts/ts.json | 14 +++++++++++ .../Superalgos/Schemas/Docs-Concepts/ui.json | 13 ++++++++++ ...001-ts-process-error-unexpected-error.json | 18 ++++++++++++++ .../Indicator-Bot/SingleMarketIndicatorBot.js | 23 +++++++++++------- .../TS/Function-Libraries/ProcessFunctions.js | 24 ++++++++++++------- .../UI/Spaces/Docs-Space/CommandInterface.js | 4 ++-- .../UI/Spaces/Docs-Space/DocumentPage.js | 1 + .../UI/Spaces/Floating-Space/UiObject.js | 6 ++--- Projects/Superalgos/UI/Utilities/Docs.js | 16 ++++++------- 10 files changed, 103 insertions(+), 30 deletions(-) create mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/client.json create mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/ts.json create mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/ui.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/ts-process-errors-001-ts-process-error-unexpected-error.json diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/client.json b/Projects/Superalgos/Schemas/Docs-Concepts/client.json new file mode 100644 index 000000000..93b2ed1af --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Concepts/client.json @@ -0,0 +1,14 @@ +{ + "type": "Client", + "definition": { + "text": "The Client, together with the TS and the UI is one of the three core components of the Superalgos Software.", + "updated": 1610911936882 + }, + "paragraphs": [ + { + "style": "Success", + "text": "The Client is what users run.", + "updated": 1610912048355 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/ts.json b/Projects/Superalgos/Schemas/Docs-Concepts/ts.json new file mode 100644 index 000000000..e9f8ddafc --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Concepts/ts.json @@ -0,0 +1,14 @@ +{ + "type": "TS", + "definition": { + "text": "TS is the abbreviation of Task Server, one of the core components of the Superalgos Software.", + "updated": 1610912495126 + }, + "paragraphs": [ + { + "style": "Success", + "text": "TS is also the root object of a data structure available at runtime within the Task Server.", + "updated": 1610911849966 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/ui.json b/Projects/Superalgos/Schemas/Docs-Concepts/ui.json new file mode 100644 index 000000000..e336a44a4 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Concepts/ui.json @@ -0,0 +1,13 @@ +{ + "type": "UI", + "definition": { + "text": "UI is an abbreviation for User Interface (user interface), which refers to the operation screen and operation method of the software. In Superalgos the UI is a Web App that runs at an Internet Browser.", + "updated": 1610911735769 + }, + "paragraphs": [ + { + "style": "Text", + "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-process-errors-001-ts-process-error-unexpected-error.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-process-errors-001-ts-process-error-unexpected-error.json new file mode 100644 index 000000000..029fa082d --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-process-errors-001-ts-process-error-unexpected-error.json @@ -0,0 +1,18 @@ +{ + "topic": "TS Process Errors", + "pageNumber": "1", + "type": "TS Process Error - Unexpected Error", + "definition": { + "text": "Write here a summary for this topic page." + }, + "paragraphs": [ + { + "style": "Text", + "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode." + }, + { + "style": "Error", + "text": "Unexpected Error" + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js index 8a8ca5e1b..0b27dc2af 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js +++ b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js @@ -58,15 +58,10 @@ function run(callBackFunction) { try { - loop(); + loop() function loop() { try { - function pad(str, max) { - str = str.toString(); - return str.length < max ? pad(" " + str, max) : str; - } - /* For each loop we want to create a new log file. */ if (TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT !== undefined) { TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.finalize() @@ -96,6 +91,9 @@ let dataDependencies; let nextWaitTime; + processStopped() + TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = "The world is collapsing..." + return initializeProcessExecutionEvents(); @@ -798,8 +796,17 @@ function processStopped() { if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) { - TS.projects.superalgos.functionLibraries.processFunctions.processError( - TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, undefined, "An unexpected error caused the Process to stop.") + TS.projects.superalgos.functionLibraries.processFunctions.processError + ( + TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, + undefined, + "An unexpected error caused the Process to stop.", + { + project: 'Superalgos', + category: 'Topic', + type: 'TS Process Error - Unexpected Error' + } + ) } else { TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent( TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped') diff --git a/Projects/Superalgos/TS/Function-Libraries/ProcessFunctions.js b/Projects/Superalgos/TS/Function-Libraries/ProcessFunctions.js index 9f612f73b..3c0547589 100644 --- a/Projects/Superalgos/TS/Function-Libraries/ProcessFunctions.js +++ b/Projects/Superalgos/TS/Function-Libraries/ProcessFunctions.js @@ -19,52 +19,58 @@ exports.newSuperalgosFunctionLibrariesProcessFunctions = function () { TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Heartbeat', event) } - function processError (processKey, node, errorMessage) { + function processError (processKey, node, errorMessage, docs) { let event if (node !== undefined) { event = { nodeName: node.name, nodeType: node.type, nodeId: node.id, - errorMessage: errorMessage + errorMessage: errorMessage, + docs: docs } } else { event = { - errorMessage: errorMessage + errorMessage: errorMessage, + docs: docs } } TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(processKey, 'Error', event) } - function processWarning (processKey, node, warningMessage) { + function processWarning (processKey, node, warningMessage, docs) { let event if (node !== undefined) { event = { nodeName: node.name, nodeType: node.type, nodeId: node.id, - warningMessage: warningMessage + warningMessage: warningMessage, + docs: docs } } else { event = { - warningMessage: warningMessage + warningMessage: warningMessage, + docs: docs } } TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(processKey, 'Warning', event) } - function processInfo (processKey, node, infoMessage) { + function processInfo (processKey, node, infoMessage, docs) { let event if (node !== undefined) { event = { nodeName: node.name, nodeType: node.type, nodeId: node.id, - infoMessage: infoMessage + infoMessage: infoMessage, + docs: docs } } else { event = { - infoMessage: infoMessage + infoMessage: infoMessage, + docs: docs } } TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(processKey, 'Info', event) diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js index 0f9c82b1e..87120b1c8 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js @@ -731,7 +731,7 @@ function newSuperalgosDocsCommmandInterface() { let orderedArray = UI.projects.superalgos.utilities.docs.buildOrderedPageIndex( project, 'Topic', - review + topic ) pageNumber = orderedArray.length + 1 @@ -771,7 +771,7 @@ function newSuperalgosDocsCommmandInterface() { let orderedArray = UI.projects.superalgos.utilities.docs.buildOrderedPageIndex( project, 'Tutorial', - review + tutorial ) pageNumber = orderedArray.length + 1 diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js index 10b06f8c9..67803234c 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js @@ -66,6 +66,7 @@ function newSuperalgosDocsDocumentPage() { if (thisObject.docsSchemaDocument === undefined) { // Use the New Node Template let template = { + updated: true, type: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.type, definition: { text: "Write here the definition of this " + UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category + "." }, paragraphs: [ diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js index bf8021fa0..f05493feb 100644 --- a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js @@ -1119,7 +1119,7 @@ function newUiObject() { async function onError(message) { let uiObject = await getTargetUiObject(message) - uiObject.setErrorMessage(message.event.errorMessage, 10) + uiObject.setErrorMessage(message.event.errorMessage, 10, message.event.docs) let event = { type: 'Secondary Action Already Executed' @@ -1138,7 +1138,7 @@ function newUiObject() { async function onWarning(message) { let uiObject = await getTargetUiObject(message) - uiObject.setWarningMessage(message.event.warningMessage, 10) + uiObject.setWarningMessage(message.event.warningMessage, 10, message.event.docs) } } @@ -1152,7 +1152,7 @@ function newUiObject() { async function onInfo(message) { let uiObject = await getTargetUiObject(message) - uiObject.setInfoMessage(message.event.infoMessage, 10) + uiObject.setInfoMessage(message.event.infoMessage, 10, message.event.docs) } } } diff --git a/Projects/Superalgos/UI/Utilities/Docs.js b/Projects/Superalgos/UI/Utilities/Docs.js index 6fada327c..81182f38d 100644 --- a/Projects/Superalgos/UI/Utilities/Docs.js +++ b/Projects/Superalgos/UI/Utilities/Docs.js @@ -654,21 +654,21 @@ function newSuperalgosUtilitiesDocs() { for (let p = 0; p < PROJECTS_ARRAY.length; p++) { let project = PROJECTS_ARRAY[p] - searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsNodeSchema) - searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsConceptSchema) - searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsTopicSchema) - searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsTutorialSchema) - searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsReviewSchema) - searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsBookSchema) + searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsNodeSchema, 'Node') + searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsConceptSchema, 'Concept') + searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsTopicSchema, 'Topic') + searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsTutorialSchema, 'Tutorial') + searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsReviewSchema, 'Review') + searchInSchema(SCHEMAS_BY_PROJECT.get(project).map.docsBookSchema, 'Book') - function searchInSchema(docSchema) { + function searchInSchema(docSchema, category) { if (found === true) { return } if (docSchema.get(cleanPhrases[j]) !== undefined) { if (cleanPhrases[j] !== excludedType) { taggedText = taggedText + phrases[j].replace( cleanPhrases[j], - TAGGING_STRING_SEPARATOR + 'Node' + '|' + cleanPhrases[j] + '|' + project + TAGGING_STRING_SEPARATOR) + ' ' + TAGGING_STRING_SEPARATOR + category + '|' + cleanPhrases[j] + '|' + project + TAGGING_STRING_SEPARATOR) + ' ' } else { taggedText = taggedText + phrases[j] + ' ' } From a5d2f3941ad9d9825242c9ce7b75261eb7465ec8 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 17 Jan 2021 21:03:53 +0100 Subject: [PATCH 5/6] Deep Scan found bug fixes --- .../Indicator-Bot/SingleMarketIndicatorBot.js | 3 --- .../Superalgos/UI/Spaces/Floating-Space/UiObject.js | 4 ++-- .../UI/Spaces/Floating-Space/UiObjectMessage.js | 11 ----------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js index 0b27dc2af..887e3ea3a 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js +++ b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js @@ -91,9 +91,6 @@ let dataDependencies; let nextWaitTime; - processStopped() - TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = "The world is collapsing..." - return initializeProcessExecutionEvents(); diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js index f05493feb..0cf9e73e5 100644 --- a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObject.js @@ -1751,7 +1751,7 @@ function newUiObject() { if (thisObject.hasError === true) { return } if (thisObject.hasWarning !== true) { return } - thisObject.uiObjectMessage.text = errorMessage + thisObject.uiObjectMessage.text = warningMessage thisObject.uiObjectMessage.type = 'Warning' thisObject.uiObjectMessage.docs = warningDocs } @@ -1761,7 +1761,7 @@ function newUiObject() { if (thisObject.hasWarning === true) { return } if (thisObject.hasInfo !== true) { return } - thisObject.uiObjectMessage.text = errorMessage + thisObject.uiObjectMessage.text = infoMessage thisObject.uiObjectMessage.type = 'Info' thisObject.uiObjectMessage.docs = infoDocs } diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js index c930fb4e0..ba10d5505 100644 --- a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js @@ -58,7 +58,6 @@ function newUiObjectMessage() { function physics() { if (thisObject.text === undefined) { return } - let text = trimMessageText(thisObject.text) /* Here we set the dimensions and position of this object */ const FRAME_HEIGHT = 120 @@ -173,7 +172,6 @@ function newUiObjectMessage() { if (label.length > IDEAL_LABEL_LENGTH * 3) { label = label.substring(0, IDEAL_LABEL_LENGTH * 3) + '...' } - fontSize = 15 } /* Split the line into Phrases */ @@ -201,14 +199,5 @@ function newUiObjectMessage() { } } } - - function trimMessageText(text) { - if (text === undefined) { return } - const MAX_LABEL_LENGTH = 35 - if (text.length > MAX_LABEL_LENGTH) { - text = text.substring(0, MAX_LABEL_LENGTH) + '...' - } - return text - } } From ef394fdbb52a8b7cc6de7493ccb58137e90cfdfe Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 18 Jan 2021 09:37:51 +0100 Subject: [PATCH 6/6] Bug Fixed, Tutorials External Links withtout protocol --- Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js index aa0e6af4f..8f191a0bc 100644 --- a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js +++ b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js @@ -1373,7 +1373,7 @@ function newSuperalgosTutorialSpace() { case 'Link': { let text = UI.projects.superalgos.utilities.docs.getTextBasedOnLanguage(paragraph) let splittedText = text.split('->') - html = html + '' + splittedText[0] + '' + html = html + '' + splittedText[0] + '' break } case 'Note': {