Files
P42_UI/app/controllers/dashboard/DashboardsController.js
T

79 lines
2.0 KiB
JavaScript

class DashboardsController extends EICController {
constructor(params) {
super(params)
this.agentDefs = app.Assets.Store.json.agentDefs
}
/**
*
* @returns
*/
index() {
const models = {
// mailings: new MailingsModel(payload['/mailings'].permissions)
}
const ttb = new app.LoadedModules.Threetobus()
ttb.initScene()
const m1 = ttb.buildFromJSON(this.agentDefs.molecule1)
m1.name = 'agent42'
ttb.scene.add(m1)
setTimeout(() => {
ttb.smoothRelMove({
object: m1,
dX: 5,
dY:0,
dZ:0,
delay: 1500,
easing: 'Quadratic',
easingMode: 'InOut',
})
},3000)
this.loadWindow(
'visualisers/SpaceView',
{
title: '3D view',
static: true,
expanded: false,
windowStyle:{
width: '800px',
height: '600px',
left: '50px',
top: '100px',
}
},
{
models: models,
agentDefs: this.agentDefs,
rendererId:'3drenderer',
mode: '3D',
ttb: ttb,
}
)
this.loadWindow(
'visualisers/SpaceView',
{
title: '2D View',
static: true,
expanded: false,
windowStyle:{
width: '600px',
height: '450px',
right:'10px',
top:'100px',
}
},
{
models: models,
agentDefs: this.agentDefs,
rendererId:'2drenderer',
mode: '2D',
ttb: ttb,
}
)
}
}
app.registerClass('DashboardsController', DashboardsController);