Commit 8bd76776 authored by amandaghassaei's avatar amandaghassaei

something wrong with menu load

parent d28536ce
......@@ -104,11 +104,11 @@ require.config({
emSimCell: 'simulation/function/EM/emSimCell',
emWire: 'simulation/function/EM/emWire',
//elementFEASim
elementFEASimPlist: 'plists/EMSimPlist',
elementFEASim: 'simulation/element/FEA/elementFEASim',
elementFEASimLattice: 'simulation/element/FEA/elementFEASimLattice',
elementFEASimCell: 'simulation/element/FEA/elementFEASimCell'
//elementMechSim
elementMechSimPlist: 'plists/EMSimPlist',
elementMechSim: 'simulation/element/Mech/elementMechSim',
elementMechSimLattice: 'simulation/element/Mech/elementMechSimLattice',
elementMechSimCell: 'simulation/element/Mech/elementMechSimCell'
},
shim: {
......
......@@ -250,7 +250,6 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
new THREE.Face3(20, 21, 22),
new THREE.Face3(22, 21, 23)
];
torsion1dof.computeFaceNormals();
......
/**
* Created by ghassaei on 5/31/16.
*/
define(['jquery', 'underscore', 'menuParent', 'elementMechSimPlist', 'elementMechSim', 'text!menus/templates/ElementMechBoundaryCondMenuView.html'],
function($, _, MenuParentView, elementMechSimPlist, elementMechSim, template){
return MenuParentView.extend({
events: {
"click #manualSelectFixed": "_manualFixedSelection",
"click #toggleFixedVis": "_toggleFixedVis"
},
_initialize: function(){
this.listenTo(elementMechSim, "change", this.render);
},
_manualFixedSelection: function(e){
e.preventDefault();
elementMechSim.set("manualSelectFixed", !elementMechSim.get("manualSelectFixed"));
},
_toggleFixedVis: function(e){
e.preventDefault();
elementMechSim.set("showFixed", !elementMechSim.get("showFixed"));
},
_makeTemplateJSON: function(){
return elementMechSim.toJSON();
},
template: _.template(template)
});
});
\ No newline at end of file
/**
* Created by ghassaei on 5/31/16.
*/
define(['jquery', 'underscore', 'menuParent', 'elementMechSim', 'text!menus/templates/ElementMechRunMenuView.html'],
function($, _, MenuParentView, elementMechSim, template){
return MenuParentView.extend({
events: {
},
_initialize: function(){
},
getPropertyOwner: function($target){
if ($target.hasClass('elementMechSim')) return elementMechSim;
return null;
},
_makeTemplateJSON: function(){
return elementMechSim.toJSON();
},
template: _.template(template)
});
});
\ No newline at end of file
/**
* Created by ghassaei on 5/31/16.
*/
define(['jquery', 'underscore', 'menuParent', 'elementMechSim', 'text!menus/templates/ElementMechSetupMenuView.html'],
function($, _, MenuParentView, elementMechSim, template){
return MenuParentView.extend({
events: {
},
_initialize: function(){
},
getPropertyOwner: function($target){
if ($target.hasClass('elementMechSim')) return elementMechSim;
return null;
},
_makeTemplateJSON: function(){
return elementMechSim.toJSON();
},
template: _.template(template)
});
});
\ No newline at end of file
......@@ -368,10 +368,13 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice', 'appState', 'tex
if (this.menu) this.menu.destroy();
var self = this;
console.log("menus/" + tabName.charAt(0).toUpperCase() + tabName.slice(1) + "MenuView");
require(["menus/" + tabName.charAt(0).toUpperCase() + tabName.slice(1) + "MenuView"], function(MenuView){
var data = {model:self.model};
if (object) data.myObject = object;
self.menu = new MenuView(data);
console.log(tabName);
console.log(self.menu);
self.menu.render();
});
},
......
......@@ -64,7 +64,7 @@ define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'navHier
e.preventDefault();
if (navSelection == "navSim"){//choose which simulation package to pull up
var hierLevel = appState.get("hierLevel");
if (hierLevel == "element" || hierLevel == "module" || hierLevel == "system"){
if (hierLevel == "module" || hierLevel == "system"){
$("#comingSoon").modal("show");
return;
}
......
Fixed Cells ( <%= fixedIndices.length %> ): <br/>
<a id="manualSelectFixed" class=" btn btn-lg btn-default btn-imageCustom<% if (manualSelectFixed){ %> btn-selected<% } %>"><img src="assets/imgs/cursor.png"></a>
<label>&nbsp;&nbsp;&nbsp;Manually select fixed cells</label><br/><br/>
<a id="toggleFixedVis" class="btn-block btn btn-lg btn-default">
<% if(showFixed){ %>Show All Cells
<% } else { %>Show Fixed Cells<% } %></a>
......@@ -224,7 +224,6 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'materialsPlis
this.lattice.clearCells();
var currentLevel = this.get("hierLevel");
this.set("materialClass", (_.keys(materialsPlist.allMaterialClasses[currentLevel]))[0]);
console.log(this.get("materialClass"));
globals.loadHierarchicalAssembly(currentLevel);
},
......
......@@ -48,6 +48,15 @@ define(['three'], function(THREE){
emRun: "Run"
}
},
elementMechNavSim:{
name: "Element FEA Simulation",
parent: "navSim",
tabs:{
elementMechSetup: "Globals",
elementMechBoundaryCond: "Boundaries",
elementMechRun: "Run"
}
},
emNavSignal:{
name: "Composite",
parentNav: "navSim",
......
......@@ -28,10 +28,22 @@ define(['three', 'underscore', 'backbone', 'threeModel', 'appState', 'lattice'],
_initialize: function(){
this.listenTo(appState, "change:currentNav", this._navChanged);
this.listenTo(appState, "change:currentTab", this._tabChanged);
this.listenTo(this, "change:showFixed", this._toggleFixedVisibility);
this.listenTo(this, "change:viewMode change:colorMax change:colorMin", this._viewModechanged);
this.listenTo(appState, "change:currentNav", function(){
if (!this.isActive()) return;
this._navChanged();
});
this.listenTo(appState, "change:currentTab", function(){
if (!this.isActive()) return;
this._tabChanged();
});
this.listenTo(this, "change:showFixed", function(){
if (!this.isActive()) return;
this._toggleFixedVisibility();
});
this.listenTo(this, "change:viewMode change:colorMax change:colorMin", function(){
if (!this.isActive()) return;
this._viewModechanged();
});
this._navChanged();
......
/**
* Created by ghassaei on 5/23/16.
*/
......@@ -3,8 +3,8 @@
*/
define(['three', 'underscore', 'backbone', 'threeModel', 'appState', 'Sim', 'emSimLattice', 'lattice', 'plist', 'globals'],
function(THREE, _, Backbone, three, appState, Sim, EmSimLattice, lattice, plist, globals){
define(['three', 'underscore', 'backbone', 'threeModel', 'appState', 'Sim', 'elementMechSimLattice', 'lattice', 'plist', 'globals'],
function(THREE, _, Backbone, three, appState, Sim, ElementMechSimLattice, lattice, plist, globals){
var elementFEASim = Sim.extend({
......@@ -17,7 +17,7 @@ define(['three', 'underscore', 'backbone', 'threeModel', 'appState', 'Sim', 'emS
initialize: function(){
this.simLattice = new EmSimLattice();
this.simLattice = new ElementMechSimLattice();
this.listenTo(this, "change:visibleWire", function(){this.showConductors();});
this.listenTo(this, "change:visibleActuator", function(){this.showActuator();});
......@@ -25,6 +25,10 @@ define(['three', 'underscore', 'backbone', 'threeModel', 'appState', 'Sim', 'emS
this._initialize();
},
isActive: function(){
return appState.get("currentNav") == "elementMechNavSim";
},
//events
......@@ -40,17 +44,16 @@ define(['three', 'underscore', 'backbone', 'threeModel', 'appState', 'Sim', 'emS
return;
}
this._changeGroundHeight();
var previous = appState.previous("currentNav");
if (previous != "emNavSignal" && plist.allMenus[appState.get("currentNav")].parent != "emNavSim"){
this.simLattice.setCells(lattice.getCells(), this.get("fixedIndices"));
}
var currentTab = appState.get("currentTab");
if (currentTab == "emElectronics" || currentTab == "signal"){
this.showConductors();
}
//var currentTab = appState.get("currentTab");
//if (currentTab == "emElectronics" || currentTab == "signal"){
// this.showConductors();
//}
},
_tabChanged: function(){
......
This diff is collapsed.
......@@ -32,6 +32,10 @@ define(['three', 'underscore', 'backbone', 'threeModel', 'appState', 'Sim', 'emS
this._initialize();
},
isActive: function(){
return appState.get("currentNav") == "emNavSim";
},
//events
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment