web/fairdy/static/fairdy/js/form.js
//function to check if the defined GPC stripe is overlapping or not
function to check if the defined GPC stripe is overlapping or not
function to check if the defined GPC stripe is overlapping or not
function refreshGpcOverlap() {
    let k_hor = parseInt($('#id_k_horizontal').val());
    let m_hor = parseInt($('#id_m_horizontal').val());
    let k_ver = parseInt($('#id_k_vertical').val());
    let m_ver = parseInt($('#id_m_vertical').val());
    let n_val = parseInt($('#id_n_value').val());
    let rect_size = ((k_hor+m_hor) * (k_ver+m_ver));
    if (rect_size == n_val) {
        $('#radio_nonoverlapping').attr('checked', false);
        $('#radio_overlapping').attr('checked', true);
        $('#id_n_value').val(n_val);
        $('#id_k_value').val(k_hor*k_ver);
        $('#id_m_value').val(n_val - (k_hor*k_ver));
    } else {
        $('#radio_overlapping').attr('checked', false);
        $('#radio_nonoverlapping').attr('checked', true);
        $('#id_n_value').val(n_val);
        $('#id_k_value').val(k_hor*k_ver);
        $('#id_m_value').val(m_hor*k_ver + k_hor*m_ver);
    }
}
function refreshGpcOverlap ( ) { let k_hor = parseInt ( $ ( '#id_k_horizontal' ) . val ( ) ) ; let m_hor = parseInt ( $ ( '#id_m_horizontal' ) . val ( ) ) ; let k_ver = parseInt ( $ ( '#id_k_vertical' ) . val ( ) ) ; let m_ver = parseInt ( $ ( '#id_m_vertical' ) . val ( ) ) ; let n_val = parseInt ( $ ( '#id_n_value' ) . val ( ) ) ; let rect_size = ( ( k_hor + m_hor ) * ( k_ver + m_ver ) ) ; if ( rect_size == n_val ) { $ ( '#radio_nonoverlapping' ) . attr ( 'checked' , false ) ; $ ( '#radio_overlapping' ) . attr ( 'checked' , true ) ; $ ( '#id_n_value' ) . val ( n_val ) ; $ ( '#id_k_value' ) . val ( k_hor * k_ver ) ; $ ( '#id_m_value' ) . val ( n_val - ( k_hor * k_ver ) ) ; } else { $ ( '#radio_overlapping' ) . attr ( 'checked' , false ) ; $ ( '#radio_nonoverlapping' ) . attr ( 'checked' , true ) ; $ ( '#id_n_value' ) . val ( n_val ) ; $ ( '#id_k_value' ) . val ( k_hor * k_ver ) ; $ ( '#id_m_value' ) . val ( m_hor * k_ver + k_hor * m_ver ) ; } }
function to check if the defined GPC stripe is overlapping or not
function to check if the defined GPC stripe is overlapping or not
//check for overlapping pyramid simulation //overlapping //non-overlapping