diff --git a/js/lattice/LatticeEsim.js b/js/lattice/LatticeEsim.js index 251b7c86d2bac35a059e267b773bf5641e2ffc98..aab2070fb3de82352818166c41d970257132f22c 100644 --- a/js/lattice/LatticeEsim.js +++ b/js/lattice/LatticeEsim.js @@ -15,9 +15,12 @@ define(['lattice', 'appState', 'threeModel', 'eSim', 'eSimCell'], function(latti }, _showConductors: function(){ + if (!eSim.get("conductorGroups") || eSim.get("conductorGroups").length == 0){ + this.setOpaque(); + three.render(); + return; + } var groupNum = eSim.get("visibleConductorGroup"); - console.log(eSim.get("conductorGroups")); - console.log(groupNum); var allVisible = groupNum < 0; this._loopCells(this.sparseCells, function(cell){ if (cell) cell.setTransparent(function(evalCell){ @@ -36,6 +39,7 @@ define(['lattice', 'appState', 'threeModel', 'eSim', 'eSimCell'], function(latti if (cell) cell.propagateConductorGroupNum(); }); this._calcNumberConnectedComponents(); + this._showConductors(); }, _calcNumberConnectedComponents: function(){ diff --git a/js/menus/templates/ESetupMenuView.html b/js/menus/templates/ESetupMenuView.html index 4b9e81196993f41a6f3f0b1f027c45803b2d6653..80aaea56b2cd7a8e0570d65a8e0ad0dc08a855e6 100644 --- a/js/menus/templates/ESetupMenuView.html +++ b/js/menus/templates/ESetupMenuView.html @@ -10,16 +10,16 @@ Simulation Type: <a href="#" id="calcConnectivity" class="btn btn-block btn-lg btn-default"><% if(conductorGroups){ %>Re-<% } %>Calculate Connectivity</a><br/> <% if(conductorGroups){ %> Num Connected Conductors:  <%= conductorGroups.length %><br/> - <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> - Show All - </label> - <% _.each(conductorGroups, function(groupNum, index){ %> + <% if(conductorGroups.length > 0){ %> <label class="radio"> - <input type="radio" <% if (groupNum == visibleConductorGroup){ %>checked<% } %> name="visibleConductorGroup" value="<%= groupNum %>" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> - Group Num <%= index + 1 %> + <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> + Show All </label> - <% }); %> - - + <% _.each(conductorGroups, function(groupNum, index){ %> + <label class="radio"> + <input type="radio" <% if (groupNum == visibleConductorGroup){ %>checked<% } %> name="visibleConductorGroup" value="<%= groupNum %>" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> + Group Num <%= index + 1 %> + </label> + <% }); %> + <% } %> <% } %> \ No newline at end of file