
var draw_flags = function() {
    getFullPanel(2, 0, 2, 7, "tab-page-basic_systems", "sec-flags", "FLAGS", "", "VER 1.0");
    var panel = document.getElementById("sec-flags");
    panel.innerHTML += draw_flags_section_1();
    panel.innerHTML += draw_flags_section_2();
    panel.innerHTML += draw_flags_section_3();
    panel.innerHTML += draw_flags_section_4();
    panel.innerHTML += draw_flags_section_5();
}

var draw_flags_section_1 = function() {
    var html = getSectionTitle('INIT FLAGS');
    var rows = '';
    var row = '';
    row = getInfoCell('flags-init-0', 'SMUDGE');
    row += getInfoCell('flags-init-1', 'ADV_I');
    row += getInfoCell('flags-init-2', 'TANK_');
    row += getInfoCell('flags-init-3', 'APPLI');
    rows += getInfoRow(row);
    row = getInfoCell('flags-init-4', 'FERTI');
    row += getInfoCell('flags-init-5', 'SEED_');
    row += getInfoCell('flags-init-6', 'PICKU');
    row += getInfoCell('flags-init-7', 'LOGDA');
    rows += getInfoRow(row);
    row = getInfoCell('flags-init-8', 'COUNT');
    row += getInfoCell('flags-init-9', 'SECON');
    row += getInfoCell('flags-init-10', 'GOLDE');
    row += getInfoCell('flags-init-11', 'IMPL');
    rows += getInfoRow(row);
    row = getInfoCell('flags-init-12', 'HYDR');
    rows += getInfoRow(row);

    html += getTabel(rows);
    html = getPanel(html);
    return html;
}

var draw_flags_section_2 = function() {
    var html = getSectionTitle('GENERAL FLAGS');
    var rows = '';
    var row = '';
    row = getInfoCell('flags-general-0', 'ENGAGE');
    row += getInfoCell('flags-general-1', 'PLANTI');
    row += getInfoCell('flags-general-2', 'MOVE');
    row += getInfoCell('flags-general-3', 'PICK');
    rows += getInfoRow(row);
    row = getInfoCell('flags-general-4', 'LOGOV');
    row += getInfoCell('flags-general-5', 'DATA_I');
    rows += getInfoRow(row);

    html += getTabel(rows);
    html = getPanel(html);
    return html;
}

var draw_flags_section_3 = function() {
    var html = getSectionTitle('SYSTEM SOURCE FLAGS');
    var rows = '';
    var row = '';
    row = getInfoCell('flags-source-0-1', 'SIM_S');
    row += getInfoCell('flags-source-0-2', 'PIC_S');
    row += getInfoCell('flags-source-0-3', 'GPS_S');
    row += getInfoCell('flags-source-0-4', 'AUTOS');
    rows += getInfoRow(row);
    row = getInfoCell('flags-source-2', 'GPSSO');
    row += getInfoCell('flags-source-3', 'PASSW');
    row += getInfoCell('flags-source-4', 'RADIU');
    row += getInfoCell('flags-source-5', 'PRECI');
    rows += getInfoRow(row);
    row = getInfoCell('flags-source-6', 'LOGGI');
    row += getInfoCell('flags-source-7', 'TECHN');
    row += getInfoCell('flags-source-8', 'FONTS');
    row += getInfoCell('flags-source-9', 'BUZZE');
    rows += getInfoRow(row);
    row = getInfoCell('flags-source-10', 'FERTI');
    row += getInfoCell('flags-source-11', 'M_CAL');
    row += getInfoCell('flags-source-12', 'M_ENG');
    row += getInfoCell('flags-source-13', 'M_HYD');
    rows += getInfoRow(row);
    row = getInfoCell('flags-source-14', 'A_ALR');
    rows += getInfoRow(row);

    html += getTabel(rows);
    html = getPanel(html);
    return html;
}

var draw_flags_section_4 = function() {
    var html = getSectionTitle('ALARM FLAGS');
    var rows = '';
    var row = '';
    row = getInfoCell('flags-alarms-0', 'MASTE');
    row += getInfoCell('flags-alarms-1', 'SECON');
    row += getInfoCell('flags-alarms-2', 'MORSE');
    row += getInfoCell('flags-alarms-3', 'LONG_');
    rows += getInfoRow(row);
    row = getInfoCell('', 'SECOND');
    row += getInfoCell('flags-alarms-second', '0');
    rows += getInfoRow(row);

    html += getTabel(rows);
    
    var rows = '';
    var row = '';
    row = getInfoCell('flags-alarms-morse-0', '0');
    row += getInfoCell('flags-alarms-morse-1', '0');
    row += getInfoCell('flags-alarms-morse-2', '0');
    row += getInfoCell('flags-alarms-morse-3', '0');
    row += getInfoCell('flags-alarms-morse-4', '0');
    rows += getInfoRow(row);

    html += getTabel(rows);
    html = getPanel(html);
    return html;
}

var draw_flags_section_5 = function() {
    var html = getSectionTitle('ALARM CONTROL FLAGS');
    var rows = '';
    var row = '';
    row = getInfoCell('flags-alarms-con-0', 'ERROR');
    row += getInfoCell('flags-alarms-con-1', 'VOLTA');
    row += getInfoCell('flags-alarms-con-2', 'AMPER');
    row += getInfoCell('flags-alarms-con-3', 'WATER');
    rows += getInfoRow(row);
    row = getInfoCell('flags-alarms-con-4', 'CNFER');
    row += getInfoCell('flags-alarms-con-5', 'TNKMI');
    row += getInfoCell('flags-alarms-con-6', 'TNKMO');
    row += getInfoCell('flags-alarms-con-7', 'TNKEM');
    rows += getInfoRow(row);
    row = getInfoCell('flags-alarms-con-8', 'PRESS');
    rows += getInfoRow(row);

    html += getTabel(rows);
    html = getPanel(html);
    return html;
}

draw_flags();