From 6fa887e78a5c642c1003d62105be0a64ca221ab4 Mon Sep 17 00:00:00 2001 From: Glenwing Date: Tue, 24 Apr 2018 22:16:02 -0700 Subject: [PATCH] Results Polishing Implemented clearing of results for invalid input Added protections for out of range refresh frequencies in GTF, CVT, CVT-RB, and CVT-R2 Added proper V refresh results for interlaced scan Fixed interlanced blanking calculations for 'None' timing format option Removed mock placeholder values in Results --- bandwidth/SI.js | 38 +- bandwidth/bandwidth-spec-details.js | 41 ++- bandwidth/bandwidth.js | 542 ++++++++++++++++------------ bandwidth/index.html | 96 ++--- bandwidth/style.css | 2 - 5 files changed, 429 insertions(+), 290 deletions(-) diff --git a/bandwidth/SI.js b/bandwidth/SI.js index 57f82cd..dfdd9c7 100644 --- a/bandwidth/SI.js +++ b/bandwidth/SI.js @@ -6,6 +6,7 @@ function SI(value, unit, options_input) { ['mode', 'f'], ['p', '2'], //['exclude', ['c', 'd', 'D', 'H']], + ['round', 'n'], ['exclude', []], ['include', []], @@ -31,28 +32,45 @@ function SI(value, unit, options_input) { mode: 'f' Precision mode (default Fixed mode). Options are: 'fixed' or 'f' Uses a fixed number of decimal places, specified by precision field 'sig' or 's' Targets a fixed number of significant figures. - 'adaptive' or 'a' Uses up to a certain number of decimal points, but leaves no trailing zeroes when not needed. + 'adaptive' or 'a' Uses up to the specified number of decimal points, but leaves no trailing zeroes when not needed. p: 2 Specifies default precision (number of decimal places). For adaptive mode, it may be specified in the format "[2, 5]" to indicate minimum and maximum precision. A single number will be interpreted as a maximum. Also accepts individual decimal place settings for each prefix, in array format; for example: {p: [1, G2, M0]} sets a default of 1 for all prefixes, then specifies 2 decimal places for Giga and 0 for Mega. - That can alternatively be written as powers: + That can alternatively be written using powers instead of prefix symbols: {p: [1, [9, 2], [6, 0]]} + round: Options: + n Rounds to nearest (default) + + Rounds toward positive infinity (ceil) (1.9 -> 2; -1.9 -> 1) + - Rounds toward negative infinity (floor) (1.9 -> 1; -1.9 -> -2) + 0 Rounds toward zero (truncate) (1.9 -> 1; -1.9 -> 1) + !0 Rounds away from zero (1.9 -> 2; -1.9 -> -2) + Also accepted: + up Same as + + ceil Same as + + +inf Same as + - separator: ',' Character to use as thousands separator (default comma) - decimal: '.' Character to use as decimal point (default period) - unit_sep: ' ' Character to place between the value and unit symbol (default non-breaking space) - big_kilo: 'true' Use capital K for kilo instead of small k. (default false) - no_mu: 'true' Use "u" instead of "µ" on output, if necessary for compatibility reasons (default false) - threshold: 1000 Point at which to use the next + down Same as - + floor Same as - + -inf Same as - + + zero Same as 0 + !zero Same as !0 + + + grouper: ',' Character to use for digit grouping (default comma); space is interpreted as Non-Breaking Thin Space (U+2009) + radix: '.' Character to use as decimal point (default period); error if same as grouper + unit_sep: ' ' Character to place between the value and unit symbol (default Non-Breaking Space (U+00A0)) + big_kilo: 'false' Use capital K for kilo instead of small k. (default false) + no_mu: 'false' Use "u" instead of "µ" on output, if necessary for compatibility reasons (default false) + threshold: 0 Point at which to use the next prefix (represeted by power). For example, if Threshold is set to 2, then + number must be at 100,000,000 to use the Mega prefix (>= 10^2 times the prefix value). 0 for normal behavior. exclude: ['c', 'd'] SI prefixes to exclude, for situational use (i.e. for displaying time, one may not wish for "centiseconds"). Symbols can also be used as shortcuts, as in the following examples: '>=G' excludes Giga and larger '>G' excludes larger than Giga, but not Giga itself 'Pixels per frame is the effective number of total pixels (horizontal resolution times vertical resolution), including both active and blank pixels' + '
  • Frames per second is the vertical refresh frequency (for progressive scan) or half the vertical field rate (for interlaced scan)
  • ' + 'The data rate for YCBCR 4:4:4 video is the same as RGB. ' + - 'For YCBCR 4:2:2 video, the data rate is divided by 1.5. For YCBCR 4:2:0 the data rate is divided by 2.

    ' + + 'For YCBCR 4:2:2 video, the data rate is divided by 1.5. For YCBCR 4:2:0, the data rate is divided by 2.

    ' + 'The total bandwidth required for video transmission is larger than the data rate, due to additional overhead involved with transmission.', 'results_bit_rate': @@ -151,24 +151,15 @@ var Detailed_Explanation = { 'results_v_field': '', + 'results_v_field_actual': + '', + 'results_v_field_dev': '', 'results_v_field_dev_perc': '', - 'results_v_framerate': - '', - - 'results_v_framerate_actual': - '', - - 'results_v_framerate_dev': - '', - - 'results_v_framerate_dev_perc': - '', - 'results_v_field_per': '', @@ -181,6 +172,30 @@ var Detailed_Explanation = { 'results_v_field_per_dev_perc': '', + 'results_v_frame': + '', + + 'results_v_frame_actual': + '', + + 'results_v_frame_dev': + '', + + 'results_v_frame_dev_perc': + '', + + 'results_v_frame_per': + '', + + 'results_v_frame_per_actual': + '', + + 'results_v_frame_per_dev': + '', + + 'results_v_frame_per_dev_perc': + '', + 'results_h_refresh': '', diff --git a/bandwidth/bandwidth.js b/bandwidth/bandwidth.js index eed731e..e0f9487 100644 --- a/bandwidth/bandwidth.js +++ b/bandwidth/bandwidth.js @@ -441,7 +441,7 @@ function calcMain() { if(Global_InputVars['V_SW_INT'] == '') { submitVar('V_SW_INT') } */ - if (!input_ok()) { clearResults(); return; } + if (!input_ok()) { clearResults(); $('#TIMING_FORMAT_NAME').html(''); return; } var hres = Global_InputVars['HRES']; var vres = Global_InputVars['VRES']; @@ -462,178 +462,257 @@ function calcMain() { var v_eff = Timing['V_EFF'] * scan var freq_act = Timing['F_ACTUAL']; - /* - var results = { - hres: hres, - vres: vres, - freq: freq, - px_bits: color_depth, - px_format: px_format, - comp: comp, - scan: scan, + // DATA TRANSMISSION - Timing: Timing, + { + Detailed_Results['data_rate'] = SI( + (h_eff * v_eff * freq_act * color_depth / px_format / scan / comp), + 'bit/s', + {'p':2, 'output':'split'}, + ); - // Calculate results - // Resolution with blanking intervals - h_eff: Timing['H_EFF'], - v_eff: Timing['V_EFF'], + Detailed_Results['8b10b'] = SI( + (h_eff * v_eff * freq_act * color_depth / px_format / scan / comp) * (1.25), + 'bit/s', + {'p':2, 'output':'split'}, + ); - // Aspect ratio - ratio_num: hres / vres, - ratio_str: (hres / GCD(hres, vres)) + ':' + (vres / GCD(hres, vres)), + Detailed_Results['16b18b'] = SI( + (h_eff * v_eff * freq_act * color_depth / px_format / scan / comp) * (1.125), + 'bit/s', + {'p':2, 'output':'split'}, + ); - // Total pixel count of image - px_per_frame: hres * vres, - px_per_frame_eff: (Timing['H_EFF']) * (Timing['V_EFF']), + Detailed_Results['pixel_rate'] = SI( + (h_eff * v_eff * freq_act / scan), + 'px/s', + {'p':[3, 'b1', 'k1', 'M1'], 'output':'split'}, + ); - // Size (bits) of one frame - bits_per_frame: hres * vres * color_depth, - bits_per_frame_eff: (Timing['H_EFF']) * (Timing['V_EFF']) * color_depth, - - // Pixel clock - px_per_sec: hres * vres * Timing['F_ACTUAL'], - px_per_sec_eff: (Timing['H_EFF']) * (Timing['V_EFF']) * Timing['F_ACTUAL'], - - // Raw bit rate - bits_per_sec_eff: (Timing['H_EFF']) * (Timing['V_EFF']) * color_depth * Timing['F_ACTUAL'], - };*/ - - Detailed_Results['data_rate'] = SI( - (h_eff * v_eff * freq_act * color_depth / px_format / scan / comp), - 'bit/s', - {'p':2, 'output':'split'}, - ); - - Detailed_Results['8b10b'] = SI( - (h_eff * v_eff * freq_act * color_depth / px_format / scan / comp) * (1.25), - 'bit/s', - {'p':2, 'output':'split'}, - ); - - Detailed_Results['16b18b'] = SI( - (h_eff * v_eff * freq_act * color_depth / px_format / scan / comp) * (1.125), - 'bit/s', - {'p':2, 'output':'split'}, - ); - - Detailed_Results['pixel_rate'] = SI( - (h_eff * v_eff * freq_act / scan), - 'px/s', - {'p':[3, 'b1', 'k1', 'M1'], 'output':'split'}, - ); - - Detailed_Results['pixel_rate_active'] = SI( - (hres * vres * freq_act / scan), - 'px/s', - {'p':[3, 'b1', 'k1', 'M1'], 'output':'split'}, - ); - - Detailed_Results['active_px'] = { - 'h': hres, - 'v': vres, - 't': SI(hres * vres, 'px', {'p':0, 'output':'split', 'include': ['b']}), + Detailed_Results['pixel_rate_active'] = SI( + (hres * vres * freq_act / scan), + 'px/s', + {'p':[3, 'b1', 'k1', 'M1'], 'output':'split'}, + ); } - Detailed_Results['blank_px'] = { - 'h': h_eff - hres, - 'v': v_eff - vres, - 't': SI((h_eff * v_eff) - (hres * vres), 'px', {'p':0, 'output':'split', 'include': ['b']}), + // RESOLUTION + + { + Detailed_Results['active_px'] = { + 'h': { 'val': hres }, + 'v': { 'val': vres }, + 't': SI(hres * vres, 'px', {'p':0, 'output':'split', 'include': ['b']}), + }; + + Detailed_Results['blank_px'] = { + 'h': { 'val': h_eff - hres }, + 'v': { 'val': v_eff - vres }, + 't': SI((h_eff * v_eff) - (hres * vres), 'px', {'p':0, 'output':'split', 'include': ['b']}), + }; + + Detailed_Results['total_px'] = { + 'h': { 'val': h_eff }, + 'v': { 'val': v_eff }, + 't': SI(h_eff * v_eff, 'px', {'p':0, 'output':'split', 'exclude': ['B']}), + }; + + Detailed_Results['overhead_px'] = { + 'h': SI(100 * ((h_eff / hres) - 1), '%', {'p':2, 'output':'split', 'exclude': ['B']}), + 'v': SI(100 * ((v_eff / vres) - 1), '%', {'p':2, 'output':'split', 'exclude': ['B']}), + 't': SI(100 * (((h_eff * v_eff) / (hres * vres)) - 1), '%', {'p':2, 'output':'split', 'exclude': ['B']}), + }; } - Detailed_Results['total_px'] = { - 'h': h_eff, - 'v': v_eff, - 't': SI(h_eff * v_eff, 'px', {'p':0, 'output':'split', 'exclude': ['B']}), + // FORMAT + + { + if ($('input[name=COLOR_DEPTH_SLCT]:checked').val() == 'Custom') { + if (color_depth % 3 == 0) { Detailed_Results['bpc'] = { 'val': color_depth / 3, 'unit':'bpc' }; } + else { Detailed_Results['bpc'] = { 'val': '-', 'unit': '' }; } + } + else { + Detailed_Results['bpc'] = { 'val': color_depth / 3, 'unit':'bpc' }; + } + Detailed_Results['bpp'] = { 'val': color_depth, 'unit': 'bit/px' }; + + Detailed_Results['palette'] = SI(Math.pow(2, color_depth), 'colors', {'p':0, 'output':'split', 'include':['b']}); + + if ($('input[name=PX_FORMAT_SLCT]:checked').val() == 'RGB') { Detailed_Results['px_format'] = 'RGB'; } + else if ($('input[name=PX_FORMAT_SLCT]:checked').val() == 'YCBCR 4:4:4') { Detailed_Results['px_format'] = 'YCBCR 4:4:4'; } + else if ($('input[name=PX_FORMAT_SLCT]:checked').val() == 'YCBCR 4:2:2') { Detailed_Results['px_format'] = 'YCBCR 4:2:2'; } + else if ($('input[name=PX_FORMAT_SLCT]:checked').val() == 'YCBCR 4:2:0') { Detailed_Results['px_format'] = 'YCBCR 4:2:0'; } + + if (scan == 1) { Detailed_Results['scan'] = 'Progressive'; } + if (scan == 2) { Detailed_Results['scan'] = 'Interlaced'; } } - Detailed_Results['overhead_px'] = { - 'h': SI(100 * ((h_eff / hres) - 1), '%', {'p':2, 'output':'split', 'exclude': ['B']}), - 'v': SI(100 * ((v_eff / vres) - 1), '%', {'p':2, 'output':'split', 'exclude': ['B']}), - 't': SI(100 * (((h_eff * v_eff) / (hres * vres)) - 1), '%', {'p':2, 'output':'split', 'exclude': ['B']}), + // VERTICAL REFRESH FOR PROGRESSIVE SCAN + + { + Detailed_Results['v_freq'] = SI( + freq, + 'Hz', + {'p':3, 'output':'split', 'include':['>=b']}, + ); + + Detailed_Results['v_freq_actual'] = SI( + freq_act, + 'Hz', + {'p':3, 'output':'split', 'include':['>=b']}, + ); + + Detailed_Results['v_freq_dev'] = SI( + Math.abs(freq - freq_act), + 'Hz', + {'p':6, 'output':'split', 'include':['>=b']}, + ); + + Detailed_Results['v_freq_dev_perc'] = SI( + Math.abs(100 * ((freq - freq_act) / freq)), + '%', + {'p':6, 'output':'split', 'include':['b']}, + ); + + Detailed_Results['v_per'] = SI( + 1 / freq, + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_per_actual'] = SI( + 1 / freq_act, + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_per_dev'] = SI( + Math.abs((1 / freq) - (1 / freq_act)), + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_per_dev_perc'] = SI( + Math.abs(100 * ((1 / freq) - (1 / freq_act)) / (1 / freq)), + '%', + {'p':6, 'output':'split', 'include':['b']}, + ); } - if ($('input[name=COLOR_DEPTH_SLCT]:checked').val() == 'Custom') { - if (color_depth % 3 == 0) { Detailed_Results['bpc'] = { 'val': color_depth / 3, 'unit':'bpc' }; } - else { Detailed_Results['bpc'] = { 'val': '-', 'unit': '' }; } + // VERTICAL REFRESH FOR INTERLACED SCAN + + { + Detailed_Results['v_field'] = SI( + freq, + 'Hz', + {'p':3, 'output':'split', 'include':['>=b']}, + ); + + Detailed_Results['v_field_actual'] = SI( + Timing['F_ACTUAL'], + 'Hz', + {'p':3, 'output':'split', 'include':['>=b']}, + ); + + Detailed_Results['v_field_dev'] = SI( + Math.abs(freq - freq_act), + 'Hz', + {'p':6, 'output':'split', 'include':['>=b']}, + ); + + Detailed_Results['v_field_dev_perc'] = SI( + Math.abs(100 * ((freq - freq_act) / freq)), + '%', + {'p':6, 'output':'split', 'include':['b']}, + ); + + Detailed_Results['v_field_per'] = SI( + 1 / freq, + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_field_per_actual'] = SI( + 1 / freq_act, + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_field_per_dev'] = SI( + Math.abs((1 / freq) - (1 / freq_act)), + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_field_per_dev_perc'] = SI( + Math.abs(100 * ((1 / freq) - (1 / freq_act)) / (1 / freq)), + '%', + {'p':6, 'output':'split', 'include':['b']}, + ); + + Detailed_Results['v_frame'] = SI( + freq / 2, + 'FPS', + {'p':3, 'output':'split', 'include':['b']}, + ); + + Detailed_Results['v_frame_actual'] = SI( + freq_act / 2, + 'FPS', + {'p':3, 'output':'split', 'include':['b']}, + ); + + Detailed_Results['v_frame_dev'] = SI( + Math.abs((freq / 2) - (freq_act / 2)), + 'FPS', + {'p':6, 'output':'split', 'include':['b']}, + ); + + Detailed_Results['v_frame_dev_perc'] = SI( + Math.abs(100 * ((freq - freq_act) / freq)), + '%', + {'p':6, 'output':'split', 'include':['b']}, + ); + + Detailed_Results['v_frame_per'] = SI( + (1 / (freq / 2)), + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_frame_per_actual'] = SI( + 1 / (freq_act / 2), + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_frame_per_dev'] = SI( + Math.abs((2 / freq) - (2 / freq_act)), + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); + + Detailed_Results['v_frame_per_dev_perc'] = SI( + Math.abs(100 * ((2 / freq) - (2 / freq_act)) / (2 / freq)), + '%', + {'p':6, 'output':'split', 'include':['b']}, + ); } - else { - Detailed_Results['bpc'] = { 'val': color_depth / 3, 'unit':'bpc' } + + // HORIZONTAL REFRESH + { + Detailed_Results['h_freq'] = SI( + (v_eff * freq_act) / scan, + 'Hz', + {'p':3, 'output':'split', 'include':['>=b']}, + ); + + Detailed_Results['h_per'] = SI( + scan / (v_eff * freq_act), + 's', + {'p':3, 'output':'split', 'include':['<=b']}, + ); } - Detailed_Results['bpp'] = { 'val': color_depth, 'unit': 'bit/px' }; - - Detailed_Results['palette'] = SI(Math.pow(2, color_depth), 'colors', {'p':0, 'output':'split', 'include':['b']}); - - if ($('input[name=PX_FORMAT_SLCT]:checked').val() == 'RGB') { Detailed_Results['px_format'] = 'RGB'; } - else if ($('input[name=PX_FORMAT_SLCT]:checked').val() == 'YCBCR 4:4:4') { Detailed_Results['px_format'] = 'YCBCR 4:4:4'; } - else if ($('input[name=PX_FORMAT_SLCT]:checked').val() == 'YCBCR 4:2:2') { Detailed_Results['px_format'] = 'YCBCR 4:2:2'; } - else if ($('input[name=PX_FORMAT_SLCT]:checked').val() == 'YCBCR 4:2:0') { Detailed_Results['px_format'] = 'YCBCR 4:2:0'; } - - if (scan == 1) { Detailed_Results['scan'] = 'Progressive'; } - if (scan == 2) { Detailed_Results['scan'] = 'Interlaced'; } - - Detailed_Results['v_freq'] = SI( - freq, - 'Hz', - {'p':3, 'output':'split', 'include':['>=b']}, - ); - - Detailed_Results['v_freq_actual'] = SI( - Timing['F_ACTUAL'], - 'Hz', - {'p':3, 'output':'split', 'include':['>=b']}, - ); - - DEBUG('freq:', typeof(freq), freq) - DEBUG('f_actual', typeof(Timing['F_ACTUAL']), Timing['F_ACTUAL']) - DEBUG('f - fa', freq - Timing['F_ACTUAL']) - Detailed_Results['v_freq_dev'] = SI( - Math.abs(freq - Timing['F_ACTUAL']), - 'Hz', - {'p':6, 'output':'split', 'include':['>=b']}, - ); - - Detailed_Results['v_freq_dev_perc'] = SI( - Math.abs(100 * ((freq - Timing['F_ACTUAL']) / freq)), - '%', - {'p':6, 'output':'split', 'include':['b']}, - ); - - Detailed_Results['v_per'] = SI( - 1 / freq, - 's', - {'p':3, 'output':'split', 'include':['<=b']}, - ); - - Detailed_Results['v_per_actual'] = SI( - 1 / Timing['F_ACTUAL'], - 's', - {'p':3, 'output':'split', 'include':['<=b']}, - ); - - Detailed_Results['v_per_dev'] = SI( - Math.abs((1 / freq) - (1 / Timing['F_ACTUAL'])), - 's', - {'p':3, 'output':'split', 'include':['<=b']}, - ); - - Detailed_Results['v_per_dev_perc'] = SI( - Math.abs(100 * ((1 / freq) - (1 / Timing['F_ACTUAL'])) / (1 / freq)), - '%', - {'p':6, 'output':'split', 'include':['b']}, - ); - - Detailed_Results['h_freq'] = SI( - (v_eff * Timing['F_ACTUAL']) / scan, - 'Hz', - {'p':3, 'output':'split', 'include':['>=b']}, - ); - - Detailed_Results['h_per'] = SI( - scan / (v_eff * Timing['F_ACTUAL']), - 's', - {'p':3, 'output':'split', 'include':['<=b']}, - ); //DEBUG('Results:', SI(results['bits_per_sec_eff'], 'bit/s', 2), results); updateDisplay(); @@ -661,6 +740,9 @@ function getTiming(timing_standard) { 'V_BL': '', 'H_BL': '', + 'V_EFF': '', + 'H_EFF': '', + 'F_ACTUAL': Global_InputVars['FREQ'], }; } @@ -669,16 +751,26 @@ function getTiming(timing_standard) { if (timing_standard != 'Custom') { if (timing_standard == 'CVT-R2') { DEBUG('Fetching CVT-R2 Timing...') + if (Global_InputVars['FREQ'] >= (1 / 0.00046)) { + $('#TIMING_FORMAT_NAME').html('≥ 2173.9 Hz not allowed'); + return false; + } Timing = CVT_R(2); if (!Timing) { DEBUG ('CVT-R2 calculation error.'); clearTiming(); - return false; } + return false; + } else { $('#TIMING_FORMAT_NAME').html('VESA Name: ' + (Global_InputVars['HRES'] * Global_InputVars['VRES'] / 1000000).toFixed(2) + 'M' + Timing['VESA_AR'] + '-R'); } } else if (timing_standard == 'CVT-RB') { + DEBUG('Fetching CVT-R2 Timing...') + if (Global_InputVars['FREQ'] >= (1 / 0.00046)) { + $('#TIMING_FORMAT_NAME').html('≥ 2173.9 Hz not allowed'); + return false; + } Timing = CVT_R(1); if (!Timing) { DEBUG ('CVT-RB calculation error.'); @@ -690,6 +782,10 @@ function getTiming(timing_standard) { } } else if (timing_standard == 'CVT') { + if (Global_InputVars['FREQ'] >= (1 / 0.00055)) { + $('#TIMING_FORMAT_NAME').html('≥ 1818.18 Hz not allowed'); + return false; + } Timing = CVT(); if (!Timing) { DEBUG ('CVT calculation error.'); @@ -701,6 +797,10 @@ function getTiming(timing_standard) { } } else if (timing_standard == 'GTF') { + if (Global_InputVars['FREQ'] >= (1 / 0.00055)) { + $('#TIMING_FORMAT_NAME').html('≥ 1818.18 Hz not allowed'); + return false; + } Timing = GTF(); $('#TIMING_FORMAT_NAME').html(''); if (!Timing) { @@ -747,7 +847,7 @@ function getTiming(timing_standard) { 'V_BL': 0, 'H_BL': 0, - 'V_EFF': Global_InputVars['VRES'], + 'V_EFF': Global_InputVars['VRES'] / Global_InputVars['SCAN'], 'H_EFF': Global_InputVars['HRES'], 'F_ACTUAL': Global_InputVars['FREQ'], @@ -776,9 +876,9 @@ function getTiming(timing_standard) { submitVar('H_FP', $('#H_FP').val()); submitVar('H_BP', $('#H_BP').val()); submitVar('H_SW', $('#H_SW').val()); - submitVar('V_FP_INT', Global_InputVars['V_FP'] + 0.5); - submitVar('V_SW_INT', Global_InputVars['V_SW']); - submitVar('V_BP_INT', Global_InputVars['V_BP'] + 0.5); + if (isNum(Global_InputVars['V_FP'])) { submitVar('V_FP_INT', Global_InputVars['V_FP'] + 0.5); } + if (isNum(Global_InputVars['V_SW'])) { submitVar('V_SW_INT', Global_InputVars['V_SW']); } + if (isNum(Global_InputVars['V_BP'])) { submitVar('V_BP_INT', Global_InputVars['V_BP'] + 0.5); } Timing = { 'V_FP': Global_InputVars['V_FP'], @@ -1341,80 +1441,71 @@ function DMT() { } -function updateDisplay() { +function updateDisplay(mode) { + var clear = 'clear' var cells; var id; - id_list = ['data_rate', '8b10b', '16b18b', 'pixel_rate', 'pixel_rate_active']; + id_list = [ + 'data_rate', '8b10b', '16b18b', 'pixel_rate', 'pixel_rate_active', + 'bpc', 'bpp', 'palette', + + 'v_freq', 'v_freq_actual', 'v_freq_dev', 'v_freq_dev_perc', + 'v_per', 'v_per_actual', 'v_per_dev', 'v_per_dev_perc', + + 'h_freq', 'h_per', + + 'v_field', 'v_field_actual', 'v_field_dev', 'v_field_dev_perc', + 'v_field_per', 'v_field_per_actual', 'v_field_per_dev', 'v_field_per_dev_perc', + 'v_frame', 'v_frame_actual', 'v_frame_dev', 'v_frame_dev_perc', + 'v_frame_per', 'v_frame_per_actual', 'v_frame_per_dev', 'v_frame_per_dev_perc', + ]; for (var x = 0; x < id_list.length; x++) { id = id_list[x]; cells = $('#results_' + id).children(); - DEBUG('Detailed Results:', Detailed_Results[id]); - DEBUG('Cells:', cells) - cells[1].innerHTML = Detailed_Results[id]['val']; - cells[2].innerHTML = Detailed_Results[id]['unit']; + if (mode != clear) { + DEBUG('Detailed Results:', Detailed_Results[id]); + DEBUG('Cells:', cells) + cells[1].innerHTML = Detailed_Results[id]['val']; + cells[2].innerHTML = Detailed_Results[id]['unit']; + } else { + cells[1].innerHTML = ''; + cells[2].innerHTML = ''; + + } } - id_list = ['active_px', 'blank_px', 'total_px']; + id_list = ['active_px', 'blank_px', 'total_px', 'overhead_px']; for (var x = 0; x < id_list.length; x++) { id = id_list[x]; cells = $('#results_' + id).children(); - DEBUG('Detailed Results:', Detailed_Results[id]); - DEBUG('Cells:', cells) - cells[1].innerHTML = Detailed_Results[id]['h']; - cells[2].innerHTML = Detailed_Results[id]['v']; - cells[3].innerHTML = Detailed_Results[id]['t']['val']; - cells[4].innerHTML = Detailed_Results[id]['t']['unit']; - } - id = 'overhead_px'; - cells = $('#results_' + id).children(); - DEBUG('Detailed Results:', Detailed_Results[id]); - DEBUG('Cells:', cells) - cells[1].innerHTML = Detailed_Results[id]['h']['val']; - cells[2].innerHTML = Detailed_Results[id]['v']['val']; - cells[3].innerHTML = Detailed_Results[id]['t']['val']; - cells[4].innerHTML = Detailed_Results[id]['t']['unit']; - - id_list = ['bpc', 'bpp', 'palette']; - for (var x = 0; x < id_list.length; x++) { - id = id_list[x]; - cells = $('#results_' + id).children(); - DEBUG('Detailed Results:', Detailed_Results[id]); - DEBUG('Cells:', cells) - cells[1].innerHTML = Detailed_Results[id]['val']; - cells[2].innerHTML = Detailed_Results[id]['unit']; + if (mode != clear) { + DEBUG('Detailed Results:', Detailed_Results[id]); + DEBUG('Cells:', cells) + cells[1].innerHTML = Detailed_Results[id]['h']['val']; + cells[2].innerHTML = Detailed_Results[id]['v']['val']; + cells[3].innerHTML = Detailed_Results[id]['t']['val']; + cells[4].innerHTML = Detailed_Results[id]['t']['unit']; + } else { + cells[1].innerHTML = ''; + cells[2].innerHTML = ''; + cells[3].innerHTML = ''; + cells[4].innerHTML = ''; + } + } - id = 'px_format'; - cells = $('#results_' + id).children(); - DEBUG('Detailed Results:', Detailed_Results[id]); - DEBUG('Cells:', cells) - cells[1].innerHTML = Detailed_Results[id] - - id = 'scan'; - cells = $('#results_' + id).children(); - DEBUG('Detailed Results:', Detailed_Results[id]); - DEBUG('Cells:', cells) - cells[1].innerHTML = Detailed_Results[id] - - id_list = ['v_freq', 'v_freq_actual', 'v_freq_dev', 'v_freq_dev_perc', 'v_per', 'v_per_actual', 'v_per_dev', 'v_per_dev_perc']; + id_list = ['px_format', 'scan']; for (var x = 0; x < id_list.length; x++) { id = id_list[x]; cells = $('#results_' + id).children(); - DEBUG('Detailed Results:', Detailed_Results[id]); - DEBUG('Cells:', cells) - cells[1].innerHTML = Detailed_Results[id]['val']; - cells[2].innerHTML = Detailed_Results[id]['unit']; - } - - id_list = ['h_freq', 'h_per']; - for (var x = 0; x < id_list.length; x++) { - id = id_list[x]; - cells = $('#results_' + id).children(); - DEBUG('Detailed Results:', Detailed_Results[id]); - DEBUG('Cells:', cells) - cells[1].innerHTML = Detailed_Results[id]['val']; - cells[2].innerHTML = Detailed_Results[id]['unit']; + if (mode != clear) { + DEBUG('Detailed Results:', Detailed_Results[id]); + DEBUG('Cells:', cells) + cells[1].innerHTML = Detailed_Results[id] + } else { + cells[1].innerHTML = ''; + } } return; @@ -1422,9 +1513,14 @@ function updateDisplay() { function clearResults() { + updateDisplay('clear'); + if ($('#TIMING_DROP').val() != 'Custom') { + clearTiming(); + } return; } + function timingUIChange() { // Controls the enabled/disabled state of the custom timing format input fields var timing_params = [ @@ -1465,6 +1561,8 @@ function timingUIChange() { $('#V_SW_INT_CONTAINER').css('display', 'table-cell'); $('#V_BLANK_INT_CONTAINER').css('display', 'table-cell'); $('#V_BLANK_EVEN_LABEL').html('(Even) Vblank'); + $('#results_v_progressive').css('display', 'none'); + $('#results_v_interlaced').css('display', 'table'); } else if (value == 'p') { $('#V_BLANK_INT_LABEL').css('display', 'none'); @@ -1473,6 +1571,8 @@ function timingUIChange() { $('#V_SW_INT_CONTAINER').css('display', 'none'); $('#V_BLANK_INT_CONTAINER').css('display', 'none'); $('#V_BLANK_EVEN_LABEL').html('Vblank'); + $('#results_v_progressive').css('display', 'table'); + $('#results_v_interlaced').css('display', 'none'); } else { DEBUG('Something somewhere has gone terribly wrong. Attemped to grab SCAN_SLCT value, and it was neither "p" nor "i"!'); diff --git a/bandwidth/index.html b/bandwidth/index.html index 9b17337..3fa7ab7 100644 --- a/bandwidth/index.html +++ b/bandwidth/index.html @@ -108,8 +108,8 @@
    -
    - +
    +
    @@ -274,101 +274,109 @@ Data TransmissionValueUnit - Data Rate8.00Gbit/s + Data Rate Bandwidth: - 8b/10b Encoding10.00Gbit/s + 8b/10b Encoding - 16b/18b Encoding9.00Gbit/s + 16b/18b Encoding - Pixel Rate (Effective)346Mpx/s + Pixel Rate (Effective) - Pixel Rate (Active Pixels Only)346Mpx/s + Pixel Rate (Active Pixels Only) - + - + - + - +
    ResolutionHor.Ver.TotalUnit
    Active192010802,073,600px
    Active
    Blank8077240,400px
    Blank
    Effective Total200011572,314,000px
    Effective Total
    Overhead4.177.1311.59%
    Overhead
    - + - + - + - + - +
    FormatValueUnit
    Color Depth (Per Channel)8bpc
    Color Depth (Per Channel)
    Color Depth (Per Pixel)24bit/px
    Color Depth (Per Pixel)
    Palette Size16,777,216colors
    Palette Size
    Pixel FormatRGB
    Pixel Format
    Scan TypeProgressive
    Scan Type
    - +
    - + - + - + - + - + - + - + - +
    Vertical RefreshValueUnit
    Frequency (Target)144.000Hz
    Frequency (Target)
    Frequency (Actual)143.993Hz
    Frequency (Actual)
    Deviation0.007Hz
    Deviation
    0.00486%
    Period (Target)6.944ms
    Period (Target)
    Period (Actual)6.945ms
    Period (Actual)
    Deviation0.338µs
    Deviation
    0.00486%
    - + - + - + - + - - - - - - - - - + - + - + - + - + + + + + + + + + + + + + + + + + - + - +
    Horizontal RefreshValueUnit
    Frequency167.757kHz
    Frequency
    Period5.961µs
    Period