From 4bc68108d5443814007e4e3e448a37d312ac0b31 Mon Sep 17 00:00:00 2001 From: "Ryan@fsunuc" Date: Wed, 21 Dec 2022 13:38:11 -0500 Subject: [PATCH] added recoil inner and outter radius --- heliosmatics.html | 9 +++++++++ heliosmatics.js | 27 +++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/heliosmatics.html b/heliosmatics.html index f0772c6..b6ec2a4 100644 --- a/heliosmatics.html +++ b/heliosmatics.html @@ -203,6 +203,15 @@ + + + + + + + +
Recoil radius, inner [mm]: outter [mm]:
+

diff --git a/heliosmatics.js b/heliosmatics.js index f9e052b..1b1f543 100644 --- a/heliosmatics.js +++ b/heliosmatics.js @@ -767,17 +767,20 @@ document.getElementById('posArrayRange').oninput = function(){ function AdjustRecoilPos(){ let pos1 = parseInt(document.getElementById('posRecoil').value); let pos2 = pos1+10; - + + let radius1 = parseInt(document.getElementById('innerRecoil').value); + let radius2 = parseInt(document.getElementById('outterRecoil').value); + //document.getElementById('n0').innerHTML = pos1; - + let shapeRecoil = { type: 'rect', xref: 'x', yref: 'y', x0 : pos1, x1 : pos2, - y0 : 10, - y1 : 45, + y0 : radius1, + y1 : radius2, fillcolor : '#FF0000', opacity : 0.4, line : { width : 0} @@ -821,6 +824,22 @@ document.getElementById('posRecoilRange').oninput = function(){ AdjustRecoilPos(); } +document.getElementById('innerRecoil').addEventListener('keypress', + function(e){ + if(e.keyCode == 13){ + AdjustRecoilPos(); + } + }, false +); + +document.getElementById('outterRecoil').addEventListener('keypress', + function(e){ + if(e.keyCode == 13){ + AdjustRecoilPos(); + } + }, false +); + function AdjustRangeRZ(){ let zmin = parseInt(document.getElementById('zRange1').value);