Skip to content

Commit

Permalink
Clarify the behavior of Detector
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktu288 committed Jul 25, 2024
1 parent d6e4124 commit 8ad3d0d
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 3 deletions.
2 changes: 2 additions & 0 deletions simulator/js/objs/other/Detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ objTypes['Detector'] = class extends LineObjMixin(BaseSceneObj) {
}

populateObjBar(objBar) {
objBar.createInfoBox(getMsg('tool_Detector_info_popover'));

objBar.createBoolean(getMsg('irradMap'), this.irradMap, function (obj, value) {
obj.irradMap = value;
}, null, true);
Expand Down
6 changes: 3 additions & 3 deletions simulator/js/simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function shootWaitingRays() {
timerID = setTimeout(shootWaitingRays, firstBreak ? 100:1);
firstBreak = false;
document.getElementById('forceStop').style.display = '';
document.getElementById('simulatorStatus').innerHTML = getMsg("ray_count") + shotRayCount + '<br>' + getMsg("total_truncation") + totalTruncation.toFixed(3) + '<br>' + getMsg("time_elapsed") + (new Date() - drawBeginTime) + '<br>';
document.getElementById('simulatorStatus').innerHTML = getMsg("ray_count") + shotRayCount + '<br>' + getMsg("total_truncation") + totalTruncation.toFixed(3) + '<br>' + getMsg("brightness_scale") + ((brightnessScale <= 0) ? "-" : brightnessScale.toFixed(3)) + '<br>' + getMsg("time_elapsed") + (new Date() - drawBeginTime) + '<br>';

draw(true, true); // Redraw the opticalObjs to avoid outdated information (e.g. detector readings).

Expand Down Expand Up @@ -633,7 +633,7 @@ function shootWaitingRays() {

if (forceStop)
{
document.getElementById('simulatorStatus').innerHTML = getMsg("ray_count") + shotRayCount + '<br>' + getMsg("total_truncation") + totalTruncation.toFixed(3) + '<br>' + getMsg("time_elapsed") + (new Date() - drawBeginTime) + '<br>' + getMsg("force_stopped");
document.getElementById('simulatorStatus').innerHTML = getMsg("ray_count") + shotRayCount + '<br>' + getMsg("total_truncation") + totalTruncation.toFixed(3) + '<br>' + getMsg("brightness_scale") + ((brightnessScale <= 0) ? "-" : brightnessScale.toFixed(3)) + '<br>' + getMsg("time_elapsed") + (new Date() - drawBeginTime) + '<br>' + getMsg("force_stopped");
forceStop = false;
}
else if (hasExceededTime)
Expand All @@ -642,7 +642,7 @@ function shootWaitingRays() {
}
else
{
document.getElementById('simulatorStatus').innerHTML = getMsg("ray_count") + shotRayCount + '<br>' + getMsg("total_truncation") + totalTruncation.toFixed(3) + '<br>' + getMsg("time_elapsed") + (new Date() - drawBeginTime);
document.getElementById('simulatorStatus').innerHTML = getMsg("ray_count") + shotRayCount + '<br>' + getMsg("total_truncation") + totalTruncation.toFixed(3) + '<br>' + getMsg("brightness_scale") + ((brightnessScale <= 0) ? "-" : brightnessScale.toFixed(3)) + '<br>' + getMsg("time_elapsed") + (new Date() - drawBeginTime);
}
document.getElementById('forceStop').style.display = 'none';
//ctx.stroke();
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,10 @@ locales["de"] = {
"tool_Detector_popover": {
"message": "Ein Messwerkzeug für Energieflussrate (P), der Rate des senkrechten Impulsflusses (F∩) und der Rate des parallelen Impulsflusses (F∥) durch ein Segment. (Ziehen oder Klicken zum Erzeugen.) Die Einheiten sind willkürlich."
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"message": "Ein Text-Label."
},
Expand Down Expand Up @@ -905,6 +909,10 @@ locales["de"] = {
"incomplete": true,
"message": "Truncated brightness: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"incomplete": true,
"message": "Time elapsed (ms): "
Expand Down
6 changes: 6 additions & 0 deletions simulator/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,9 @@ locales["en"] = {
"tool_Detector_popover": {
"message": "A tool for measuring the rate of energy flow (P), the rate of perpendicular momentum flow (F⊥), and the rate of parallel momentum flow (F∥) through a line segment. (Drag or click to create the line segment.) The units are arbitrary."
},
"tool_Detector_info_popover": {
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"message": "A text label."
},
Expand Down Expand Up @@ -795,6 +798,9 @@ locales["en"] = {
"total_truncation": {
"message": "Truncated brightness: "
},
"brightness_scale": {
"message": "Brightness Scale: "
},
"time_elapsed": {
"message": "Time elapsed (ms): "
},
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,10 @@ locales["es"] = {
"tool_Detector_popover": {
"message": "Una herramienta para medir el flujo de energía (P), el momento perpendicular de flujo (F⊥), y el momento paralelo de flujo (F∥) a través de un segmento de recta. (Arrastre o clique para crear el segmento de recta.) Las unidades son arbitrarias."
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"message": "Un cuadro de texto."
},
Expand Down Expand Up @@ -826,6 +830,10 @@ locales["es"] = {
"total_truncation": {
"message": "Brillo truncado: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"message": "Tiempo transcurrido (ms): "
},
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,10 @@ locales["fr"] = {
"incomplete": true,
"message": "A tool for measuring the rate of energy flow (P), the rate of perpendicular momentum flow (F⊥), and the rate of parallel momentum flow (F∥) through a line segment. (Drag or click to create the line segment.) The units are arbitrary."
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"message": "Une légende, pour un objet quelconque."
},
Expand Down Expand Up @@ -954,6 +958,10 @@ locales["fr"] = {
"incomplete": true,
"message": "Truncated brightness: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"incomplete": true,
"message": "Time elapsed (ms): "
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,10 @@ locales["ja"] = {
"incomplete": false,
"message": "線分を通るエネルギー流の速度 (P)、垂直運動量流の速度 (F⊥)、および平行運動量流の速度 (F∥) を測定するためのツールです。 (ドラッグまたはクリックで線分を作成します。)単位は任意です。"
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"incomplete": false,
"message": "テキストラベル."
Expand Down Expand Up @@ -1058,6 +1062,10 @@ locales["ja"] = {
"incomplete": true,
"message": "Truncated brightness: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"incomplete": true,
"message": "Time elapsed (ms): "
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,10 @@ locales["ko"] = {
"incomplete": false,
"message": "선분을 통해 전달되는 에너지 흐름 (P), 수직 방향 momentum flow (F⊥), 평행 방향 memontum flow (F∥) 을 측정하는 도구입니다. 단위는 임의값 (A.U.) 입니다.."
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"incomplete": false,
"message": "텍스트 추가"
Expand Down Expand Up @@ -1058,6 +1062,10 @@ locales["ko"] = {
"incomplete": true,
"message": "Truncated brightness: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"incomplete": true,
"message": "Time elapsed (ms): "
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,10 @@ locales["nl"] = {
"incomplete": true,
"message": "A tool for measuring the rate of energy flow (P), the rate of perpendicular momentum flow (F⊥), and the rate of parallel momentum flow (F∥) through a line segment. (Drag or click to create the line segment.) The units are arbitrary."
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"incomplete": true,
"message": "A text label."
Expand Down Expand Up @@ -970,6 +974,10 @@ locales["nl"] = {
"incomplete": true,
"message": "Truncated brightness: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"incomplete": true,
"message": "Time elapsed (ms): "
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,10 @@ locales["pl"] = {
"tool_Detector_popover": {
"message": "Narzędzie do pomiaru szybkości przepływu energii (P), szybkości prostopadłego przepływu pędu (F⊥), i szybkości równoległego przepływu pędu (F∥) przez odcinek. (Przeciągnij lub kliknij, aby utworzyć odcinek). Jednostki są umowne."
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"message": "Etykieta tekstowa."
},
Expand Down Expand Up @@ -849,6 +853,10 @@ locales["pl"] = {
"incomplete": true,
"message": "Truncated brightness: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"incomplete": true,
"message": "Time elapsed (ms): "
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/pt_BR.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,10 @@ locales["pt-BR"] = {
"incomplete": true,
"message": "A tool for measuring the rate of energy flow (P), the rate of perpendicular momentum flow (F⊥), and the rate of parallel momentum flow (F∥) through a line segment. (Drag or click to create the line segment.) The units are arbitrary."
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"incomplete": true,
"message": "A text label."
Expand Down Expand Up @@ -855,6 +859,10 @@ locales["pt-BR"] = {
"total_truncation": {
"message": "Brilho truncado: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"message": "Tempo decorrido (ms): "
},
Expand Down
8 changes: 8 additions & 0 deletions simulator/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,10 @@ locales["ru"] = {
"incomplete": true,
"message": "A tool for measuring the rate of energy flow (P), the rate of perpendicular momentum flow (F⊥), and the rate of parallel momentum flow (F∥) through a line segment. (Drag or click to create the line segment.) The units are arbitrary."
},
"tool_Detector_info_popover": {
"incomplete": true,
"message": "<ul><li>P: The rate of energy flow (flux) in B/s (see below).</li><li>F⊥: The rate of perpendicular momentum flow in (B/s)/c.</li><li>F∥: The rate of parallel momentum flow in (B/s)/c.</li><li>The irradiance in the exported CSV is in (B/s)/L.</li><li>L is the arbitrary unit of length used in this simulator.</li><li>B is an arbitrary unit of radiant flux or luminous flux, corresponding to the unit of the \"Brightness\" option being B/L for non-Lambertian beams and 500B/360° for point sources.</li><li>The dimensionless factor s is the \"Brightness Scale\" shown in Settings -> Show status box, which equals 1 when \"Ray Density\" is above some threshold and proportional to \"Ray Density\" otherwise.</li><li>If some rays are truncated in the infinite series of internal reflection, the total truncation is shown as error estimates.</li></ul>"
},
"tool_TextLabel_popover": {
"incomplete": true,
"message": "A text label."
Expand Down Expand Up @@ -958,6 +962,10 @@ locales["ru"] = {
"incomplete": true,
"message": "Truncated brightness: "
},
"brightness_scale": {
"incomplete": true,
"message": "Brightness Scale: "
},
"time_elapsed": {
"incomplete": true,
"message": "Time elapsed (ms): "
Expand Down
Loading

0 comments on commit 8ad3d0d

Please sign in to comment.