Skip to content

Commit

Permalink
added logic to auto flip bottom layer
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmieclark3 committed Aug 4, 2021
1 parent 60af539 commit 69ff3d3
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion auto-generated-widget.html
Expand Up @@ -1673,17 +1673,22 @@

mirrorX: false,
mirrorY: false,
userModifiedMirrors: false,
//V5.1D20161229 - Added
setupMirrorAxis: function() {
this.userModifiedMirrors = false;
$("#com-chilipeppr-widget-eagle .mirrorAxisX").change(this.onChangeMirrorAxis.bind(this));
$("#com-chilipeppr-widget-eagle .mirrorAxisY").change(this.onChangeMirrorAxis.bind(this));
$('#com-chilipeppr-widget-eagle .mirrorAxisX').prop ("checked", false);
$('#com-chilipeppr-widget-eagle .mirrorAxisY').prop ("checked", false);
},
//V5.1D20161229 - Added
onChangeMirrorAxis: function() {
onChangeMirrorAxis: function(e,wasCode) {
this.mirrorX = $('#com-chilipeppr-widget-eagle .mirrorAxisX').prop ("checked");
this.mirrorY = $('#com-chilipeppr-widget-eagle .mirrorAxisY').prop ("checked");
if (!wasCode) {
this.userModifiedMirrors = true;
}
//this.clearEagleBrd();
//this.draw3d();
},
Expand Down Expand Up @@ -1793,6 +1798,24 @@
}*/
var oldActiveLayer = this.activeLayer;
if (selectedLayerInDropdown != oldActiveLayer) {
if (selectedLayerInDropdown == "Bottom") {
var hasMirror = this.mirrorX || this.mirrorY;
if (!hasMirror && !this.userModifiedMirrors) {
var mirrY$ = $('#com-chilipeppr-widget-eagle .mirrorAxisY');
mirrY$.prop("checked", true);
mirrY$.trigger("change", true); //Send it wasn't user that dirtied the controls
}
}
if (selectedLayerInDropdown == "Top") {
var hasMirror = this.mirrorX || this.mirrorY;
if (hasMirror && !this.userModifiedMirrors) {
var mirrY$ = $('#com-chilipeppr-widget-eagle .mirrorAxisY');
var mirrX$ = $('#com-chilipeppr-widget-eagle .mirrorAxisX');
mirrY$.prop("checked", false);
mirrX$.prop("checked", false);
mirrY$.trigger("change", true); //Send it wasn't user that dirtied the controls
}
}
this.activeLayer = selectedLayerInDropdown;
console.log("layer active now: ", this.activeLayer);
//debugger;
Expand Down Expand Up @@ -2305,6 +2328,7 @@
chilipeppr.publish("/com-chilipeppr-elem-flashmsg/flashmsg", "Opening Eagle BRD", "Parsing Eagle BRD file and generating signal paths.", 3000, true);
// reset main properties
this.activeLayer = 'Top';
this.userModifiedMirrors = false;
this.clearEagleBrd();
this.clear3dViewer();
// create board
Expand Down

0 comments on commit 69ff3d3

Please sign in to comment.