diff --git a/js/lattice/LatticeEsim.js b/js/lattice/LatticeEsim.js index dcabf95bf551fe45296d3602ea6d1a9019c2f679..a120eab088c370b13e352c8f1a1fdd8b38ab21de 100644 --- a/js/lattice/LatticeEsim.js +++ b/js/lattice/LatticeEsim.js @@ -15,13 +15,13 @@ define(['lattice', 'appState', 'threeModel', 'eSim', 'eSimCell', 'eSimSuperCell' }, _showConductors: function(){ - if (!eSim.get("conductorGroups") || eSim.get("conductorGroups").length == 0){ + var groupNum = eSim.get("visibleConductorGroup"); + if (!eSim.get("conductorGroups") || eSim.get("conductorGroups").length == 0 || groupNum == -2){ this.setOpaque(); three.render(); return; } - var groupNum = eSim.get("visibleConductorGroup"); - var allVisible = groupNum < 0; + var allVisible = groupNum == -1; this._loopCells(this.sparseCells, function(cell){ if (cell) cell.setTransparent(function(evalCell){ return !(evalCell.conductiveGroupVisible(allVisible, groupNum)); diff --git a/js/menus/templates/ESetupMenuView.html b/js/menus/templates/ESetupMenuView.html index a897a6387ab18c5611aec091681836cc3f9ab5fb..4fed4531e4693c60cb54206cf0d97e68ed2f1d0f 100644 --- a/js/menus/templates/ESetupMenuView.html +++ b/js/menus/templates/ESetupMenuView.html @@ -15,7 +15,11 @@ Simulation Type: Num Connected Conductors:  <%= conductorGroups.length %><br/> <% if(conductorGroups.length > 0){ %> <label class="radio"> - <input type="radio" <% if (visibleConductorGroup < 0){ %>checked<% } %> name="visibleConductorGroup" value="-1" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> + <input type="radio" <% if (visibleConductorGroup == -2){ %>checked<% } %> name="visibleConductorGroup" value="-2" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> + Show Everything + </label> + <label class="radio"> + <input type="radio" <% if (visibleConductorGroup == -1){ %>checked<% } %> name="visibleConductorGroup" value="-1" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> Show All Conducting Groups </label> <% _.each(conductorGroups, function(groupData, index){ %> diff --git a/js/menus/templates/EStaticMenuView.html b/js/menus/templates/EStaticMenuView.html index 1e2c04a1c2d15a962043ae552d03644d684008f1..86bd6115e4bad1b68ac26fa2e9c235e8599f74e6 100644 --- a/js/menus/templates/EStaticMenuView.html +++ b/js/menus/templates/EStaticMenuView.html @@ -1,6 +1,10 @@ <% if(conductorGroups && conductorGroups.length > 0){ %> <label class="radio"> - <input type="radio" <% if (visibleConductorGroup < 0){ %>checked<% } %> name="visibleConductorGroup" value="-1" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> + <input type="radio" <% if (visibleConductorGroup == -2){ %>checked<% } %> name="visibleConductorGroup" value="-2" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> + Show Everything + </label> + <label class="radio"> + <input type="radio" <% if (visibleConductorGroup == -1){ %>checked<% } %> name="visibleConductorGroup" value="-1" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> Show All Conducting Groups </label> <% _.each(conductorGroups, function(groupData, index){ %> @@ -11,8 +15,10 @@ <input data-property="current" data-index="<%= index %>" value="<%= groupData.current %>" placeholder="Current" class="form-control floatInput eSimGroup currentInput" type="text"> </label> <% }); %><br/> - <div class="inlineSwatch capacitance"></div>Capacitance:<br/><br/> - <div class="inlineSwatch inductance"></div>Inductance:<br/> + <div class="inlineSwatch capacitance"></div>Capacitance:<br/> + <div class="inlineSwatch inductance"></div>Inductance:<br/><br/> + <a href="#" id="calcCapacitance" class="btn btn-block btn-lg btn-default"><% if(globalCapacitance){ %>Re-<% } %>Calculate Capacitance</a><br/> + <a href="#" id="calcInductance" class="btn btn-block btn-lg btn-default"><% if(globalInductance){ %>Re-<% } %>Calculate Inductance</a><br/> <% } else { %> <div class="inlineWarning">No conductive groups detected, please navigate to previous tab and calculate.</div> <% } %> \ No newline at end of file diff --git a/js/simulation/electronics/eSim.js b/js/simulation/electronics/eSim.js index e4f64174524ea48ce992892c0340a0bee5346092..8f1d140f3d05cec084f9c22088a76d1a94cd5ddc 100644 --- a/js/simulation/electronics/eSim.js +++ b/js/simulation/electronics/eSim.js @@ -9,7 +9,9 @@ define(['underscore', 'backbone'], function(_, Backbone){ defaults:{ conductorGroups: null,//[{id: xx, current:xx, voltage:xx}] - visibleConductorGroup: -1 + visibleConductorGroup: -1, + globalCapacitance: null, + globalInductance: null }