Skip to content

Commit

Permalink
Improve 'filter' option UI and corresponding locale strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktu288 committed Aug 19, 2023
1 parent 49b8d77 commit 76a63da
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 28 deletions.
2 changes: 1 addition & 1 deletion cn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ <h2 id="views">视图</h2>
<div class="caption">
<p class="mode-title" id="simulate_colors">模拟色彩</p>
<span id="simulate_colors_desc">
模拟光源的颜色(波长)、混色与透光物的色散
模拟光源的颜色(波长)、混色、滤光,以及透光物的色散
</span>
</div>
<center>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ <h2 id="views">Views</h2>
<div class="caption">
<p class="mode-title" id="simulate_colors">Simulate Colors</p>
<span id="simulate_colors_desc">
Simulate colors (wavelengths) of light sources, mixture of colors, and chromatic dispersion of glasses.
Simulate colors (wavelengths) of light sources, mixture of colors, color filtering, and chromatic dispersion of glasses.
</span>
</div>
<center>
Expand Down
37 changes: 22 additions & 15 deletions simulator/js/simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,24 +606,31 @@ function shootWaitingRays() {

//Optical Filter Settings
function dichroicSettings(obj, elem){
if (colorMode && createAdvancedOptions(obj.isDichroic)) {
if (colorMode) {
createBooleanAttr(getMsg('filter'), obj.isDichroic, function(obj, value) {
obj.isDichroic = value;
obj.wavelength = obj.wavelength || GREEN_WAVELENGTH;
obj.isDichroicFilter = obj.isDichroicFilter || false;
obj.bandwidth = obj.bandwidth || 10
}, elem);
createBooleanAttr(getMsg('invert'), obj.isDichroicFilter, function(obj, value) {
if(obj.isDichroic){
obj.isDichroicFilter = value;
obj.isDichroic = value;
obj.wavelength = obj.wavelength || GREEN_WAVELENGTH;
obj.isDichroicFilter = obj.isDichroicFilter || false;
obj.bandwidth = obj.bandwidth || 10
if (obj == objs[selectedObj]) {
cartesianSign = value;
localStorage.rayOpticsCartesianSign = value?"true":"false";
selectObj(selectedObj);
}
}, elem);
createNumberAttr(getMsg('wavelength'), UV_WAVELENGTH, INFRARED_WAVELENGTH, 1, obj.wavelength || GREEN_WAVELENGTH, function(obj, value) {
obj.wavelength = value;
}, elem);
createNumberAttr("± " + getMsg('bandwidth'), 0, (INFRARED_WAVELENGTH - UV_WAVELENGTH) , 1, obj.bandwidth || 10, function(obj, value) {
obj.bandwidth = value;
}, elem);
if (obj.isDichroic) {
createBooleanAttr(getMsg('invert'), obj.isDichroicFilter, function(obj, value) {
if(obj.isDichroic){
obj.isDichroicFilter = value;
}
}, elem);
createNumberAttr(getMsg('wavelength'), UV_WAVELENGTH, INFRARED_WAVELENGTH, 1, obj.wavelength || GREEN_WAVELENGTH, function(obj, value) {
obj.wavelength = value;
}, elem);
createNumberAttr("± " + getMsg('bandwidth'), 0, (INFRARED_WAVELENGTH - UV_WAVELENGTH) , 1, obj.bandwidth || 10, function(obj, value) {
obj.bandwidth = value;
}, elem);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ locales["de"] = {
},
"color_mode_popover": {
"incomplete": true,
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
},
"rayDensity_popover": {
"message": "Gibt die Dichte der Lichtstrahlen für die Simulation an. Logarithmische Skala."
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ locales["en"] = {
"message": "Simulate the rays and images seen from some position. The blue circle is the observer. Any rays crossing it are considered to be 'observed'. The observer does not know where the rays actually begin, but may think they begin at some point(s) if they intersect there. The rays are shown in blue, and the points in yellow (real) or orange (virtual). (Drag the big blue dot to move the observer.)<br>When 'Simulate Colors' is on, they are shown in source colors instead."
},
"color_mode_popover": {
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
},
"rayDensity_popover": {
"message": "Decides how dense should the lights be simulated. The number is in log scale."
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ locales["fr"] = {
},
"color_mode_popover": {
"incomplete": true,
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
},
"rayDensity_popover": {
"incomplete": true,
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ locales["ja"] = {
},
"color_mode_popover": {
"incomplete": true,
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
},
"rayDensity_popover": {
"incomplete": false,
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ locales["nl"] = {
},
"color_mode_popover": {
"incomplete": true,
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
},
"rayDensity_popover": {
"incomplete": true,
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ locales["pl"] = {
},
"color_mode_popover": {
"incomplete": true,
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
},
"rayDensity_popover": {
"message": "Decyduje o tym, jaka ma być gęstość promieni symulowanego światła. Liczba jest w skali logarytmicznej."
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ locales["ru"] = {
},
"color_mode_popover": {
"incomplete": true,
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
},
"rayDensity_popover": {
"incomplete": true,
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ locales["LOCALE_ID"] = {
},
"color_mode_popover": {
"incomplete": true,
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low."
},
"rayDensity_popover": {
"incomplete": true,
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/zh_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ locales["zh-CN"] = {
"message": "模拟从某位置见到的光线与像。蓝色圆形为观察者,与其相交的光线被其「观察」到。观察者无法知道光线真正的起始位置,但若其在某处相交,它会认为光线是从该处来的。光线以蓝色表示,相交处以黄色(实像)或橘色(虚像)表示。 (拖曳大蓝点以移动观察者。)<br>若使用「模拟色彩」,则改以光源颜色显示。"
},
"color_mode_popover": {
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>模拟光源的颜色(波长)、混色、滤光(镜子的进阶选项)与透光物的色散。选取物件后可调整这些参数。重叠多条不同波长的光线可用于模拟光谱。屏幕显示之颜色仅为粗略近似,且当「光线密度」太高或太低时可能非常不准确。"
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>模拟光源的颜色(波长)、混色、遮光物与镜子的滤光,以及透光物的色散。选取物件后可调整这些参数。重叠多条不同波长的光线可用于模拟光谱。屏幕显示之颜色仅为粗略近似,且当「光线密度」太高或太低时可能非常不准确。"
},
"rayDensity_popover": {
"message": "决定光线模拟的密度。数值为对数刻度。"
Expand Down
2 changes: 1 addition & 1 deletion simulator/locales/zh_TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ locales["zh-TW"] = {
"message": "模擬從某位置見到的光線與像。藍色圓形為觀察者,與其相交的光線被其「觀察」到。觀察者無法知道光線真正的起始位置,但若其在某處相交,它會認為光線是從該處來的。光線以藍色表示,相交處以黃色(實像)或橘色(虛像)表示。(拖曳大藍點以移動觀察者。)<br>若使用「模擬色彩」,則改以光源顏色顯示。"
},
"color_mode_popover": {
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>模擬光源的顏色(波長)、混色、濾光(鏡子的進階選項)與透光物的色散。選取物件後可調整這些參數。重疊多條不同波長的光線可用於模擬光譜。螢幕顯示之顏色僅為粗略近似,且當「光線密度」太高或太低時可能非常不準確。"
"message": "<img src='../img/simulate_colors.png' align='left' style='margin-right: 10px; margin-bottom: 4px; max-width: 250px'>模擬光源的顏色(波長)、混色、遮光物與鏡子的濾光,以及透光物的色散。選取物件後可調整這些參數。重疊多條不同波長的光線可用於模擬光譜。螢幕顯示之顏色僅為粗略近似,且當「光線密度」太高或太低時可能非常不準確。"
},
"rayDensity_popover": {
"message": "決定光線模擬的密度。數值為對數刻度。"
Expand Down
2 changes: 1 addition & 1 deletion tw/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ <h2 id="views">呈現方式</h2>
<div class="caption">
<p class="mode-title" id="simulate_colors">模擬色彩</p>
<span id="simulate_colors_desc">
模擬光源的顏色(波長)、混色與透光物的色散
模擬光源的顏色(波長)、混色、濾光,以及透光物的色散
</span>
</div>
<center>
Expand Down

0 comments on commit 76a63da

Please sign in to comment.