fix load/moto, add default broker for gapp/moto. gut broken meta app
This commit is contained in:
parent
6b9c9b2753
commit
b471713917
9 changed files with 35 additions and 3060 deletions
|
|
@ -33,7 +33,7 @@ class Engine {
|
|||
load(url) {
|
||||
return new Promise((accept, reject) => {
|
||||
try {
|
||||
new moto.STL().load(url, vertices => {
|
||||
new load.STL().load(url, vertices => {
|
||||
this.listener({loaded: url, vertices});
|
||||
this.widget.loadVertices(vertices).center();
|
||||
accept(this);
|
||||
|
|
@ -47,7 +47,7 @@ class Engine {
|
|||
parse(data) {
|
||||
return new Promise((accept, reject) => {
|
||||
try {
|
||||
let vertices = new moto.STL().parse(data);
|
||||
let vertices = new load.STL().parse(data);
|
||||
this.listener({parsed: data, vertices});
|
||||
this.widget.loadVertices(vertices).center();
|
||||
accept(this);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
SETUP = parseOpt(LOC.search.substring(1)),
|
||||
SECURE = isSecure(LOC.protocol),
|
||||
LOCAL = self.debug && !SETUP.remote,
|
||||
EVENT = KIRI.broker = new Broker(),
|
||||
EVENT = KIRI.broker,
|
||||
SDB = MOTO.KV,
|
||||
ODB = KIRI.odb = new MOTO.Storage(SETUP.d ? SETUP.d[0] : 'kiri'),
|
||||
// K3DB = KIRI.wdb = new MOTO.Storage('kiri3', { stores:["file","work"] }).init(),
|
||||
|
|
@ -522,7 +522,7 @@
|
|||
break;
|
||||
}
|
||||
if (data.parse) {
|
||||
new moto.STL().parse(data.parse, vertices => {
|
||||
new load.STL().parse(data.parse, vertices => {
|
||||
let widget = newWidget().loadVertices(vertices);
|
||||
platform.add(widget);
|
||||
});
|
||||
|
|
|
|||
2377
src/main/meta.js
2377
src/main/meta.js
File diff suppressed because it is too large
Load diff
|
|
@ -72,3 +72,9 @@ class Broker {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// establish default broker when GridApp container present
|
||||
let gapp = self.gapp;
|
||||
if (gapp && !gapp.broker) {
|
||||
gapp.broker = new Broker();
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
(function() {
|
||||
|
||||
let gapp = self.gapp = self.gapp || {},
|
||||
moto = self.moto = self.moto || {},
|
||||
moto = self.moto = self.moto || gapp,
|
||||
ccvalue = self.navigator ? navigator.hardwareConcurrency || 1 : 1,
|
||||
ccmax = ccvalue > 3 ? ccvalue - 1 : 0,
|
||||
workcc = false, // concurrent or not
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
(function() {
|
||||
|
||||
let gapp = self.gapp = self.gapp || {},
|
||||
moto = self.moto = self.moto || {},
|
||||
moto = self.moto = self.moto || gapp,
|
||||
time = Date.now;
|
||||
|
||||
if (moto.worker) return;
|
||||
|
|
@ -44,7 +44,10 @@ const dispatch = moto.worker = {
|
|||
}
|
||||
},
|
||||
error: (data) => {
|
||||
dispatch.send({ error: data });
|
||||
if (canSend(data)) {
|
||||
done = true;
|
||||
dispatch.send({ error: data });
|
||||
}
|
||||
}
|
||||
},
|
||||
canSend = (data) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue