Skip to content

Commit

Permalink
Merge pull request #22 from alja/funcrename
Browse files Browse the repository at this point in the history
More informative function names in etc/eve7
  • Loading branch information
alja authored Jan 22, 2019
2 parents 6d4e3da + 0aecfa3 commit e748038
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 30 deletions.
42 changes: 16 additions & 26 deletions etc/eve7/EveManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
if (typeof msg != "string") {
// console.log('ArrayBuffer size ',
// msg.byteLength, 'offset', offset);
this.UpdateBinary(msg, offset);
this.ImportSceneBinary(msg, offset);

return;
}
Expand All @@ -83,11 +83,11 @@

} else if (resp && resp[0] && resp[0].content == "REveScene::StreamElements") {

this.Update(resp);
this.ImportSceneJson(resp);

} else if (resp && resp.header && resp.header.content == "ElementsRepresentaionChanges") {

this.SceneChanged(resp);
this.ImportSceneChangeJson(resp);

}
}
Expand Down Expand Up @@ -189,7 +189,7 @@
}

// mark object and all its parents as modified
EveManager.prototype.MarkModified = function(id) {
EveManager.prototype.MarkSceneRrecreate = function(id) {
while (id) {
var elem = this.GetElement(id);
if (!elem) return;
Expand All @@ -198,26 +198,16 @@
}
}

EveManager.prototype.ProcessModified = function(sceneid) {
EveManager.prototype.ProcessSceneCreate = function(sceneid) {
var elem = this.GetElement(sceneid);
if (!elem || !elem.$modified) return;

this.callSceneReceivers(elem, "onSceneChanged", sceneid);
this.callSceneReceivers(elem, "onSceneCreate", sceneid);

delete elem.$modified;
}

EveManager.prototype.ProcessData = function(arr) {
if (!arr) return;

if (arr[0].content == "REveScene::StreamElements")
return this.Update(arr);

if (arr[0].content == "REveManager::DestroyElementsOf")
return this.DestroyElements(arr);
}

EveManager.prototype.Update = function(arr)
EveManager.prototype.ImportSceneJson = function(arr)
{
this.last_json = null;
// console.log("JSON", arr[0]);
Expand Down Expand Up @@ -257,18 +247,18 @@
obj = this.map[elem.fElementId] = elem;
}

this.MarkModified(elem.fElementId);
this.MarkSceneRrecreate(elem.fElementId);
}

if (arr[0].fTotalBinarySize == 0) {
console.log("scenemodified ", this.map[arr[0].fSceneId])
this.ProcessModified(arr[0].fSceneId);
this.ProcessSceneCreate(arr[0].fSceneId);
}

this.ProcessUpdate(300);
}

EveManager.prototype.SceneChanged = function(msg) {
EveManager.prototype.ImportSceneChangeJson = function(msg) {
var arr = msg.arr;
this.last_json = null;
this.scene_changes = msg;
Expand All @@ -293,14 +283,14 @@
this.last_json.push(arr[i]);

} else {
this.PostProcessSceneChanges();
this.CompleteSceneChanges();
}
}

//______________________________________________________________________________


EveManager.prototype.PostProcessSceneChanges = function()
EveManager.prototype.CompleteSceneChanges = function()
{
if (!this.scene_changes) return;

Expand Down Expand Up @@ -393,7 +383,7 @@

this.DeleteChildsOf(element);
element.$modified = true;
this.ProcessModified(ids[n]);
this.ProcessScenCreate(ids[n]);
}

// this.ignore_all = true;
Expand All @@ -412,7 +402,7 @@
}
}

EveManager.prototype.UpdateBinary = function(rawdata, offset) {
EveManager.prototype.ImportSceneBinary = function(rawdata, offset) {

if (!this.last_json || !rawdata || !rawdata.byteLength) return;

Expand Down Expand Up @@ -459,9 +449,9 @@
console.error('Raw data decoding error - length mismatch', lastoff, rawdata.byteLength);

if (this.scene_changes)
this.PostProcessSceneChanges();
this.CompleteSceneChanges();
else
this.ProcessModified(arr[0].fSceneId);
this.ProcessSceneCreate(arr[0].fSceneId);
}

JSROOT.EVE.EveManager = EveManager;
Expand Down
4 changes: 1 addition & 3 deletions etc/eve7/EveScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,8 @@
this.viewer.render();
}

EveScene.prototype.onSceneChanged = function(id)
EveScene.prototype.onSceneCreate = function(id)
{
console.log("EveScene.prototype.onSceneChanged scene changed ... AMT should this be called", id);

this.redrawScene();
}

Expand Down
2 changes: 1 addition & 1 deletion etc/eve7/EveTable.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ sap.ui.define([
if (this.mgr) this.mgr.Unregister(this);
},

onSceneChanged: function(element, id) {
onSceneCreate: function(element, id) {
console.log("!!!CHANGED", id);

this.setEveData();
Expand Down

0 comments on commit e748038

Please sign in to comment.