Merge pull request #58 from AAMasters/develop

Mora fixes
This commit is contained in:
benme authored and GitHub committed 2019-05-20 19:08:33 -03:00
commit 3f66e2f92b
7 files changed
+47 -21

No files matched your search

+12 -3
View File
@@ -109,7 +109,6 @@ function newRestartSimulation () {
await graphQlRestartSimulation(simulationParams)
thisObject.status = 'Calculating'
counterTillNextState = 2000
turnOffProductCards()
} else {
thisObject.status = 'Error'
counterTillNextState = 500
@@ -159,6 +158,11 @@ function newRestartSimulation () {
break
case 'Calculating':
thisObject.status = 'Refreshing'
turnOffProductCards()
counterTillNextState = 250
break
case 'Refreshing':
thisObject.status = 'Ready'
turnOnProductCards()
break
@@ -203,11 +207,14 @@ function newRestartSimulation () {
break
}
case 'Saving':
params.backgroundColor = UI_COLOR.GREY
params.backgroundColor = UI_COLOR.MANGANESE_PURPLE
break
case 'Restarting':
params.backgroundColor = UI_COLOR.GREY
break
case 'Refreshing':
params.backgroundColor = UI_COLOR.GOLDEN_ORANGE
break
case 'Calculating':
params.backgroundColor = UI_COLOR.TITANIUM_YELLOW
break
@@ -243,6 +250,9 @@ function newRestartSimulation () {
case 'Restarting':
label = 'RESTARTING TRADING ENGINE...'
break
case 'Refreshing':
label = 'RE-LOADING...'
break
case 'Calculating':
label = 'CALCULATING...'
break
@@ -261,4 +271,3 @@ function newRestartSimulation () {
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
}
+2 -1
View File
@@ -104,7 +104,7 @@ function newCircularMenuItem () {
function physics () {
if (thisObject.dontShowAtFullscreen === true && CURRENT_TOP_MARGIN === 0) { return }
const INCREASE_STEP = 0.25
const INCREASE_STEP = 1
if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= INCREASE_STEP) {
if (thisObject.currentRadius < thisObject.targetRadius) {
@@ -256,3 +256,4 @@ function newCircularMenuItem () {
}
}
}
+10 -9
View File
@@ -115,32 +115,32 @@ function newFloatingObject () {
function thisObjectPhysics () {
// The radius also have a target.
if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= 3) {
if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= 15) {
if (thisObject.container.frame.radius < thisObject.targetRadius) {
thisObject.container.frame.radius = thisObject.container.frame.radius + 3
thisObject.container.frame.radius = thisObject.container.frame.radius + 15
} else {
thisObject.container.frame.radius = thisObject.container.frame.radius - 3
thisObject.container.frame.radius = thisObject.container.frame.radius - 15
}
thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
}
// The imageSize also have a target.
if (Math.abs(thisObject.currentImageSize - thisObject.targetImageSize) >= 1) {
if (Math.abs(thisObject.currentImageSize - thisObject.targetImageSize) >= 10) {
if (thisObject.currentImageSize < thisObject.targetImageSize) {
thisObject.currentImageSize = thisObject.currentImageSize + 2
thisObject.currentImageSize = thisObject.currentImageSize + 10
} else {
thisObject.currentImageSize = thisObject.currentImageSize - 2
thisObject.currentImageSize = thisObject.currentImageSize - 10
}
}
// The fontSize also have a target.
if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= 0.2) {
if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= 1) {
if (thisObject.currentFontSize < thisObject.targetFontSize) {
thisObject.currentFontSize = thisObject.currentFontSize + 0.2
thisObject.currentFontSize = thisObject.currentFontSize + 1
} else {
thisObject.currentFontSize = thisObject.currentFontSize - 0.2
thisObject.currentFontSize = thisObject.currentFontSize - 1
}
}
@@ -307,3 +307,4 @@ function newFloatingObject () {
function updateRadius () {
}
}
+4 -4
View File
@@ -245,9 +245,9 @@ function newStrategyPart () {
browserCanvasContext.beginPath()
browserCanvasContext.moveTo(position.x, position.y)
browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
browserCanvasContext.strokeStyle = 'rgba(204, 204, 204, 0.5)'
browserCanvasContext.setLineDash([1, 4])
browserCanvasContext.lineWidth = 1
browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
browserCanvasContext.setLineDash([3, 4])
browserCanvasContext.lineWidth = 2
browserCanvasContext.stroke()
browserCanvasContext.setLineDash([0, 0])
}
@@ -260,7 +260,7 @@ function newStrategyPart () {
browserCanvasContext.beginPath()
browserCanvasContext.arc(targetPoint.x, targetPoint.y, radius, 0, Math.PI * 2, true)
browserCanvasContext.closePath()
browserCanvasContext.fillStyle = 'rgba(30, 30, 30, 1)'
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
browserCanvasContext.fill()
}
}
+1 -1
View File
@@ -303,7 +303,7 @@ function newProductCard () {
}
function onMarketFileLoaded (event) {
marketFileProgressBar.value = Math.trunc(event.currentValue * 100 / event.totalValue)
marketFileProgressBar.value = Math.trunc(event.totalValue * 100 / event.totalValue)
marketFileProgressBar.fillStyle = LOADING_FILL_STYLE
marketFileProgressBar.strokeStyle = LOADING_STROKE_STYLE
+8 -1
View File
@@ -43,7 +43,14 @@
function initialize () {
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
let INITIAL_POSITION
if (canvas.strategySpace.isInitialized === true) {
INITIAL_POSITION = 55
} else {
INITIAL_POSITION = 100
}
thisObject.container.frame.position.y = browserCanvas.height * INITIAL_POSITION / 100 - COCKPIT_SPACE_HEIGHT
canvasBrowserResizedEventSubscriptionId = window.canvasApp.eventHandler.listenToEvent('Browser Resized', resize)
selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+10 -2
View File
@@ -9,6 +9,7 @@ function newStrategySpace () {
iconByPartType: undefined,
workspace: undefined,
isDeployed: false,
isInitialized: false,
draw: draw,
getContainer: getContainer,
makeVisible: makeVisible,
@@ -35,6 +36,10 @@ function newStrategySpace () {
loadIconCollection()
buildIconByPartTypeMap()
if (thisObject.strategizerGateway.strategizerData !== undefined) {
thisObject.isInitialized = true
}
}
function buildIconByPartTypeMap () {
@@ -143,8 +148,10 @@ function newStrategySpace () {
function deploydTradingSystem () {
thisObject.workspace = newWorkspace()
thisObject.workspace.initialize(thisObject.strategizerGateway.strategizerData)
thisObject.isDeployed = true
if (thisObject.strategizerGateway.strategizerData !== undefined) {
thisObject.workspace.initialize(thisObject.strategizerGateway.strategizerData)
thisObject.isDeployed = true
}
}
function makeInvisible () {
@@ -173,3 +180,4 @@ function newStrategySpace () {
}
}
}