Implementing new icons part 1
This commit is contained in:
1 parent
402540c781
commit
b5291209ce
4 files changed
+285
No files matched your search
@@ -236,6 +236,30 @@ function newStrategyPart () {
|
||||
compatibleType = '->' + 'Parameters'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Backend':
|
||||
compatibleType = '->' + 'Definition'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Backend Process':
|
||||
compatibleType = '->' + 'Backend'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Sensor':
|
||||
compatibleType = '->' + 'Backend Process'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Indicator':
|
||||
compatibleType = '->' + 'Backend Process'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Trading Engine':
|
||||
compatibleType = '->' + 'Backend Process'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Bot Process':
|
||||
compatibleType = '->' + 'Sensor' + '->' + 'Indicator' + '->' + 'Trading Engine'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Strategy':
|
||||
compatibleType = '->' + 'Trading System'
|
||||
compatibleSubType = undefined
|
||||
@@ -334,6 +358,12 @@ function newStrategyPart () {
|
||||
let nearbyNode = floatingObject.payload.node
|
||||
if (compatibleType.indexOf('->' + nearbyNode.type) >= 0) {
|
||||
/* Discard objects with busy coonection ports */
|
||||
if (thisObject.payload.node.type === 'Backend' && nearbyNode.backend !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Backend Process' && nearbyNode.backendProcess !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Sensor' && nearbyNode.bot !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Indicator' && nearbyNode.bot !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Trading Engine' && nearbyNode.bot !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Bot Process' && nearbyNode.botProcess !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Trading System' && nearbyNode.tradingSystem !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Personal Data' && nearbyNode.personalData !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Parameters' && nearbyNode.parameters !== undefined) { continue }
|
||||
|
||||
@@ -304,6 +304,237 @@ function newStrategyPartConstructor () {
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Backend': {
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Backend Process',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Backend Process',
|
||||
visible: false,
|
||||
relatedStrategyPart: 'Backend',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -20
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Backend',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Backend',
|
||||
visible: false,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: +20
|
||||
}
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Backend Process': {
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Sensor',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Sensor',
|
||||
visible: false,
|
||||
relatedStrategyPart: 'Sensor',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -60
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Indicator',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Indicator',
|
||||
visible: false,
|
||||
relatedStrategyPart: 'Indicator',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -20
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Trading Engine',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Trading Engine',
|
||||
visible: false,
|
||||
relatedStrategyPart: 'Trading Engine',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 20
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Backend Process',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Backend Process',
|
||||
visible: false,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: +6s0
|
||||
}
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Sensor': {
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Bot Process',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Bot Process',
|
||||
visible: false,
|
||||
relatedStrategyPart: 'Bot Process',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -20
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Sensor',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Sensor',
|
||||
visible: false,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: +20
|
||||
}
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Indicator': {
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Bot Process',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Bot Process',
|
||||
visible: false,
|
||||
relatedStrategyPart: 'Bot Process',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -20
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Indicator',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Indicator',
|
||||
visible: false,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: +20
|
||||
}
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Bot Process',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Bot Process',
|
||||
visible: false,
|
||||
relatedStrategyPart: 'Bot Process',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -20
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Trading Engine',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Trading Engine',
|
||||
visible: false,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: +20
|
||||
}
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Bot Process': {
|
||||
strategyPart.codeEditor = newCodeEditor()
|
||||
strategyPart.codeEditor.isVisibleFunction = strategyPart.isVisibleFunction
|
||||
strategyPart.codeEditor.initialize()
|
||||
strategyPart.codeEditor.container.connectToParent(strategyPart.container, false, false, true, true, false, false, false, false)
|
||||
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Edit Bot Process',
|
||||
actionFunction: strategyPart.codeEditor.activate,
|
||||
label: 'Edit Bot Process',
|
||||
visible: false,
|
||||
iconPathOn: 'html',
|
||||
iconPathOff: 'html',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -20,
|
||||
dontShowAtFullscreen: true
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Bot Process',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Bot Process',
|
||||
visible: false,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: +20
|
||||
}
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Personal Data': {
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
|
||||
@@ -52,6 +52,24 @@ function newStrategyPartTitle () {
|
||||
thisObject.allwaysVisible = true
|
||||
break
|
||||
}
|
||||
case 'Backend': {
|
||||
break
|
||||
}
|
||||
case 'Backend Process': {
|
||||
break
|
||||
}
|
||||
case 'Sensor': {
|
||||
break
|
||||
}
|
||||
case 'Indicator': {
|
||||
break
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
break
|
||||
}
|
||||
case 'Bot Process': {
|
||||
break
|
||||
}
|
||||
case 'Personal Data': {
|
||||
break
|
||||
}
|
||||
|
||||
@@ -40,6 +40,12 @@ function newStrategySpace () {
|
||||
function buildIconByPartTypeMap () {
|
||||
const relationshipArray = [
|
||||
['Definition', 'text'],
|
||||
['Backend', 'task'],
|
||||
['Backend Process', 'timeline'],
|
||||
['Sensor', 'pipette'],
|
||||
['Indicator', 'vector'],
|
||||
['Trading Engine', 'brainstorming'],
|
||||
['Bot Process', 'grid'],
|
||||
['Personal Data', 'security'],
|
||||
['Exchange Account', 'approve'],
|
||||
['Exchange Account Asset', 'paper-plane'],
|
||||
|
||||
Reference in new issue
Block a user