Skip to content

Commit cf8fd35

Browse files
committed
adding q-factor output box
1 parent 5356a27 commit cf8fd35

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

smith_chart/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,18 @@ <h4 class="mb-0"><strong>ONLINE SMITH CHART TOOL</strong></h4>
161161
</div>
162162
</div>
163163
<div class="row">
164-
<div class="col-lg-6">
164+
<div class="col-lg">
165165
<div class="input-group mb-2 ">
166166
<span class="input-group-text inputGroupmw">VSWR</span>
167167
<output id="vswr_live" class="form-control bg-navy text-white"></output>
168168
</div>
169169
</div>
170+
<div class="col-lg">
171+
<div class="input-group mb-2 ">
172+
<span class="input-group-text inputGroupmw">Q Factor</span>
173+
<output id="q_factor" class="form-control bg-navy text-white"></output>
174+
</div>
175+
</div>
170176
</div>
171177
<div class="row text-center mt-3"><strong>Click below to add a component to your system</strong></div>
172178
<div class="row g-0">

smith_chart/js/smith_tool.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,11 @@ function update_smith_chart() {
880880
var vswr_live = (1 + reflection_mag) / (1 - reflection_mag);
881881
document.getElementById("vswr_live").innerHTML = '<div class="text_box">' + vswr_live.toPrecision(3) + "</div>";
882882

883+
//calculate Q factor
884+
var q_factor = Math.abs(imag_old/real_old)
885+
document.getElementById("q_factor").innerHTML = '<div class="text_box">' + q_factor.toPrecision(3) + "</div>";
886+
887+
883888
//populate vmin_distanceEl and vmax_distanceEl
884889
vmax_distanceEl.value = ((0.5 * reflection_phase) / 360).toPrecision(precision);
885890

0 commit comments

Comments
 (0)