drawPrint

This commit is contained in:
Luis Fernando Molina committed 2020-10-19 19:41:46 +02:00
1 parent 6649a0b225
commit b35a61c7f2
18 files changed
+53 -53

No files matched your search

@@ -181,7 +181,7 @@ function newAutoScaleButton() {
if (thisObject.autoMinScale === true && thisObject.autoMaxScale === true) {
icon = UI.projects.superalgos.spaces.designSpace.getIconByProjectAndName( 'Superalgos', 'toggle-auto-time-scale-auto-min-max')
}
drawIcon(icon, 0, 0, 0, 0, ICON_SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon, 0, 0, 0, 0, ICON_SIZE, thisObject.container)
break
}
case 'Y': {
@@ -197,7 +197,7 @@ function newAutoScaleButton() {
if (thisObject.autoMinScale === true && thisObject.autoMaxScale === true) {
icon = UI.projects.superalgos.spaces.designSpace.getIconByProjectAndName( 'Superalgos', 'toggle-auto-scale-auto-min-max')
}
drawIcon(icon, 0, 0, 0, 0, ICON_SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon, 0, 0, 0, 0, ICON_SIZE, thisObject.container)
break
}
}
@@ -13,7 +13,7 @@ function drawScaleDisplay(label1, label2, label3, xExtraOffSet1, xExtraOffSet2,
opacity: OPACITY
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
/* Place the Text */
@@ -21,12 +21,12 @@ function drawScaleDisplay(label1, label2, label3, xExtraOffSet1, xExtraOffSet2,
label2 = label2.substring(0, 20)
label3 = label3.substring(0, 20)
drawLabel(label1, 1 / 2, 92 / 100, 0, 0, 9, container)
drawLabel(label2, 1 / 2, 42 / 100, 0, 0, 17, container)
drawLabel(label3, 1 / 2, 67 / 100, 0, 0, 9, container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label1, 1 / 2, 92 / 100, 0, 0, 9, container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label2, 1 / 2, 42 / 100, 0, 0, 17, container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label3, 1 / 2, 67 / 100, 0, 0, 9, container)
drawIcon(icon1, 1 / 8, 1 / 2, 0, 0, 28, container)
drawIcon(icon2, 7 / 8, 1 / 2, 0, 0, 28, container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon1, 1 / 8, 1 / 2, 0, 0, 28, container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon2, 7 / 8, 1 / 2, 0, 0, 28, container)
}
function drawScaleDisplayCover(container) {
@@ -40,6 +40,6 @@ function drawScaleDisplayCover(container) {
opacity: '0.25'
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
}
@@ -521,8 +521,8 @@ function newRateScale() {
let fitPoint2 = thisObject.fitFunction(ratePoint2)
if (fitPoint1.y === ratePoint1.y && fitPoint2.y === ratePoint2.y) {
drawLabel(labels[1], 1 / 2, 0, 0, 0, FONT_SIZE, thisObject.container, UI_COLOR.GREY, undefined, ratePoint1.y)
drawLabel(labels[2], 1 / 2, 0, decimalsDisplace, -5, 9, thisObject.container, UI_COLOR.GREY, undefined, ratePoint1.y)
UI.projects.superalgos.utilities.drawPrint.drawLabel(labels[1], 1 / 2, 0, 0, 0, FONT_SIZE, thisObject.container, UI_COLOR.GREY, undefined, ratePoint1.y)
UI.projects.superalgos.utilities.drawPrint.drawLabel(labels[2], 1 / 2, 0, decimalsDisplace, -5, 9, thisObject.container, UI_COLOR.GREY, undefined, ratePoint1.y)
}
}
}
@@ -314,8 +314,8 @@ function newTimeScale() {
let fitPoint2 = thisObject.fitFunction(timePoint2)
if (fitPoint1.x === timePoint1.x && fitPoint2.x === timePoint2.x) {
drawLabel(labels[1], 1 / 2, 0, 18, 17, FONT_SIZE, thisObject.container, UI_COLOR.GREY, timePoint1.x, undefined)
drawLabel(labels[2], 1 / 2, 0, 18, 30, 12, thisObject.container, UI_COLOR.GREY, timePoint1.x, undefined)
UI.projects.superalgos.utilities.drawPrint.drawLabel(labels[1], 1 / 2, 0, 18, 17, FONT_SIZE, thisObject.container, UI_COLOR.GREY, timePoint1.x, undefined)
UI.projects.superalgos.utilities.drawPrint.drawLabel(labels[2], 1 / 2, 0, 18, 30, 12, thisObject.container, UI_COLOR.GREY, timePoint1.x, undefined)
}
}
}
@@ -583,7 +583,7 @@ function newTimeMachine() {
}
function drawChartsBackground() {
drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0.5, thisObject.fitFunction)
UI.projects.superalgos.utilities.drawPrint.drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0.5, thisObject.fitFunction)
}
function draw() {
@@ -665,7 +665,7 @@ function newTimeMachine() {
if (description !== undefined) {
label = description
}
printLabel(label, position.x + 20, position.y - 10, opacity, fontSize)
UI.projects.superalgos.utilities.drawPrint.printLabel(label, position.x + 20, position.y - 10, opacity, fontSize)
if (icon !== undefined) {
if (icon.canDrawIcon === true) {
@@ -730,7 +730,7 @@ function newTimeMachine() {
}
}
printLabel(exchangeMarket.exchangeName, -5 + xOffSet, -30, opacity, fontSize, UI_COLOR.GREY)
UI.projects.superalgos.utilities.drawPrint.printLabel(exchangeMarket.exchangeName, -5 + xOffSet, -30, opacity, fontSize, UI_COLOR.GREY)
position.x = position.x + INTER_EXCHANGE_SPACE
@@ -746,7 +746,7 @@ function newTimeMachine() {
}
}
printLabel(exchangeMarket.marketName, -5 + xOffSet, -10, opacity, fontSize, UI_COLOR.GREY)
UI.projects.superalgos.utilities.drawPrint.printLabel(exchangeMarket.marketName, -5 + xOffSet, -10, opacity, fontSize, UI_COLOR.GREY)
icon = exchangeMarket.quotedAssetIcon
if (icon !== undefined) {
@@ -417,6 +417,6 @@ function newTimelineChart() {
}
function drawChartsBackground() {
drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0, thisObject.fitFunction)
UI.projects.superalgos.utilities.drawPrint.drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0, thisObject.fitFunction)
}
}
@@ -266,7 +266,7 @@ function newSuperalgosCockpitSpace() {
x: thisObject.container.frame.width / 2,
y: thisObject.container.frame.height / 2 + 5
}
printLabel(statusText, position.x, position.y, 1, 15, textColor, true, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.printLabel(statusText, position.x, position.y, 1, 15, textColor, true, thisObject.container)
}
if (UI.projects.superalgos.spaces.designSpace !== undefined) {
@@ -138,7 +138,7 @@ function newFullScreen() {
params.backgroundColor = UI_COLOR.DARK_TURQUOISE
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
}
function drawText() {
@@ -437,7 +437,7 @@ function newCircularMenuItem() {
params.opacity = 0.8
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
}
}
}
@@ -1185,14 +1185,14 @@ function newConditionEditor() {
function thisObjectDrawForeground() {
if (thisObject.visible === true) {
const SIZE = 36
drawIcon(timeFrameIcon, 0, 0, -PICKER_WIDTH * 3.25, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
drawIcon(dataMineIcon, 0, 0, -PICKER_WIDTH * 2.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
drawIcon(botIcon, 0, 0, -PICKER_WIDTH * 1.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
drawIcon(whenIcon, 0, 0, -PICKER_WIDTH * 0.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
drawIcon(productIcon, 0, 0, PICKER_WIDTH * 0.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
drawIcon(propertyIcon, 0, 0, PICKER_WIDTH * 1.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
drawIcon(operationIcon, 0, 0, PICKER_WIDTH * 2.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
drawIcon(valueIcon, 0, 0, PICKER_WIDTH * 3.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(timeFrameIcon, 0, 0, -PICKER_WIDTH * 3.25, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(dataMineIcon, 0, 0, -PICKER_WIDTH * 2.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(botIcon, 0, 0, -PICKER_WIDTH * 1.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(whenIcon, 0, 0, -PICKER_WIDTH * 0.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(productIcon, 0, 0, PICKER_WIDTH * 0.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(propertyIcon, 0, 0, PICKER_WIDTH * 1.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(operationIcon, 0, 0, PICKER_WIDTH * 2.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(valueIcon, 0, 0, PICKER_WIDTH * 3.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
}
}
}
@@ -209,7 +209,7 @@ function newPicker() {
}
if (i === 2 || isMouseOver === true) {
drawLabel(label, 1 / 2, i / VISIBLE_LABELS, 0, 0, fontSize, thisObject.container, fontColor, undefined, undefined, opacity)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label, 1 / 2, i / VISIBLE_LABELS, 0, 0, fontSize, thisObject.container, fontColor, undefined, undefined, opacity)
}
}
}
@@ -305,7 +305,7 @@ function newUiObjectTitle() {
opacity: 0.25
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
}
}
@@ -646,7 +646,7 @@ function newLayer() {
opacity: OPACITY
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
let parentLabel1FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label1FontSize')
let parentLabel2FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label2FontSize')
@@ -682,19 +682,19 @@ function newLayer() {
label3FontSize = 9
}
drawLabel(label1, 1 / 2, 5.2 / 10, -5, 0, label1FontSize, thisObject.container)
drawLabel(label2, 1 / 2, 8.2 / 10, -5, 0, label2FontSize, thisObject.container)
drawLabel(label3, 1 / 2, 9.5 / 10, -5, 0, label3FontSize, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label1, 1 / 2, 5.2 / 10, -5, 0, label1FontSize, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label2, 1 / 2, 8.2 / 10, -5, 0, label2FontSize, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label3, 1 / 2, 9.5 / 10, -5, 0, label3FontSize, thisObject.container)
drawProgressBar(marketFileProgressBar, 2, -45 + 18)
drawProgressBar(dailyFileProgressBar, 2, -46 + 18)
drawProgressBar(singleFileProgressBar, 2, -47 + 18)
drawProgressBar(fileSequenceProgressBar, 2, -48 + 18)
drawIcon(thisObject.exchangeIcon, 1 / 8, 2 / 10, 0, 0, 14, thisObject.container)
drawIcon(thisObject.plotterTypeIcon, 7 / 8, 2 / 10, 0, 0, 14, thisObject.container)
drawIcon(thisObject.baseAssetIcon, 3.4 / 8, 2 / 10, 0, 0, 14, thisObject.container)
drawIcon(thisObject.quotedAssetIcon, 4.6 / 8, 2 / 10, 0, 0, 14, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(thisObject.exchangeIcon, 1 / 8, 2 / 10, 0, 0, 14, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(thisObject.plotterTypeIcon, 7 / 8, 2 / 10, 0, 0, 14, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(thisObject.baseAssetIcon, 3.4 / 8, 2 / 10, 0, 0, 14, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(thisObject.quotedAssetIcon, 4.6 / 8, 2 / 10, 0, 0, 14, thisObject.container)
}
}
@@ -465,13 +465,13 @@ function newLayersPanel() {
opacity: 1
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
drawLabel(label1, 1 / 2, 0, 0, 15, 9, thisObject.container)
drawLabel(label2, 1 / 2, 0, 0, 30, 9, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label1, 1 / 2, 0, 0, 15, 9, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label2, 1 / 2, 0, 0, 30, 9, thisObject.container)
drawIcon(icon1, 1 / 8, 0, 0, 20, 28, thisObject.container)
drawIcon(icon2, 7 / 8, 0, 0, 20, 28, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon1, 1 / 8, 0, 0, 20, 28, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon2, 7 / 8, 0, 0, 20, 28, thisObject.container)
}
function drawScrollBar() {
@@ -79,6 +79,6 @@ function newPanelsVisibleButton() {
icon = UI.projects.superalgos.spaces.designSpace.getIconByProjectAndName( 'Superalgos', 'toggle-panel-off')
}
drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 14, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 14, thisObject.container)
}
}
@@ -176,8 +176,8 @@ function newPlotterPanel() {
if (panelData.textStyle.config.paletteColor !== undefined) { paletteColor = eval(panelData.textStyle.config.paletteColor) }
}
printLabel(labelText, X_AXIS, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
printLabel(value, X_AXIS, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, opacity, fontSize, paletteColor, true, thisObject.container, thisObject.fitFunction, false, true)
UI.projects.superalgos.utilities.drawPrint.printLabel(labelText, X_AXIS, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
UI.projects.superalgos.utilities.drawPrint.printLabel(value, X_AXIS, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, opacity, fontSize, paletteColor, true, thisObject.container, thisObject.fitFunction, false, true)
}
}
}
@@ -100,10 +100,10 @@ function newListItem() {
labelColor = UI_COLOR.TITANIUM_YELLOW
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
drawLabel(name, 1 / 2, 3.0 / 10, -5, 0, 15, thisObject.container, labelColor)
drawLabel(type, 1 / 2, 7.2 / 10, -5, 0, 15, thisObject.container, labelColor)
drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 80, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.drawLabel(name, 1 / 2, 3.0 / 10, -5, 0, 15, thisObject.container, labelColor)
UI.projects.superalgos.utilities.drawPrint.drawLabel(type, 1 / 2, 7.2 / 10, -5, 0, 15, thisObject.container, labelColor)
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 80, thisObject.container)
}
}
@@ -216,9 +216,9 @@ function newListView() {
opacity: 1
}
roundedCornersBackground(params)
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
drawLabel(label, 1 / 2, 0, 0, 25, 15, thisObject.container, UI_COLOR.BLACK)
UI.projects.superalgos.utilities.drawPrint.drawLabel(label, 1 / 2, 0, 0, 25, 15, thisObject.container, UI_COLOR.BLACK)
}
function drawScrollBar() {