|
2 | 2 | var resolution = 100;// 100; //number of points per arc |
3 | 3 | var span_resolution = 20; |
4 | 4 | var precision = 3; |
5 | | - |
| 5 | +var spanChanged = false; |
6 | 6 |
|
7 | 7 | //code to save the state to jsonBin - cool! (and free) |
8 | 8 | var toastElList = [].slice.call(document.querySelectorAll('.toast')) |
@@ -228,6 +228,7 @@ function updateFromOldState() { |
228 | 228 |
|
229 | 229 | function updateFromDom() { |
230 | 230 | schematic[0].freq = Number(domFreq.value); |
| 231 | + spanChanged = !(schematic[0].span == Number(domSpan.value)) |
231 | 232 | schematic[0].span = Number(domSpan.value) |
232 | 233 | zo = Number(domZo.value); |
233 | 234 | schematic[0].zo = Number(domZo.value); |
@@ -478,12 +479,12 @@ function update_smith_chart() { |
478 | 479 | freq = schematic[0].freq * schematic[0].freq_unit.multiplier; |
479 | 480 | span_freq = schematic[0].span * schematic[0].span_unit.multiplier; |
480 | 481 | //console.log(schematic[0].freq * schematic[0].freq_unit.multiplier,schematic[0].span * schematic[0].span_unit.multiplier) |
481 | | - if (freq < span_freq) { |
| 482 | + if ((freq < span_freq) && spanChanged) { |
482 | 483 | swal({ |
483 | 484 | type: 'error', |
484 | 485 | title: 'Oops...', |
485 | | - text: 'Span is larger than frequency, this will result in -ve frequencies and is not allowed..."', |
486 | | - footer: '<a href>Reduce your span frequency</a>' |
| 486 | + text: 'Span is larger than frequency, this will result in -ve frequencies and likely you did not mean this', |
| 487 | + footer: 'Reduce your span frequency' |
487 | 488 | }) |
488 | 489 | } |
489 | 490 |
|
|
0 commit comments