%eden
/*This file deals with the interface and creates all the windows necessary*/
%scout
window lung_health_meter = {
    type: DONALD
    box: [{10,10}, {250,220}]
    pict: "LUNGVIEW"
    xmin:0
    ymin:575
    xmax:1000
    ymax:1000
    bgcolor: "Grey"
    border: 0
    sensitive: ON
};


integer x_difference = 90;
integer y_difference = 15;
integer valid1 = 0;
integer valid2 = 0;
string clockstring = "start clock";
integer square_size = 15;
integer btn_spacing = 40;
integer LLA = 1;
integer LBSA = 1;
integer LBIA = 1;
integer LAA = 1;
integer height = 364;
integer center_c = 442;

integer RLA = 1;
integer RBSA = 1;
integer RBIA = 1;
integer RAA = 1;
integer LA = 1;
integer TA = 1;

integer smoke_scout = 0;
integer city_scout = 0;
integer stress_scout = 0;
integer relieve_scout = 0;

window left_lung_active_btn = {
    type: TEXT
    frame: ([{225,50}, {225+square_size,50+square_size}])
    bgcolor:if LLA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if LLA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};
window left_bronchus_active_btn = {
    type: TEXT
    frame: ([{225,50+btn_spacing}, {225+square_size,50+square_size+btn_spacing}])
    bgcolor:if LBSA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if LBSA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};

window left_bronchiole_active_btn = {
    type: TEXT
    frame: ([{225,50+btn_spacing*2}, {225+square_size,50+square_size+btn_spacing*2}])
    bgcolor:if LBIA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if LBIA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};

window left_alveoli_active_btn = {
    type: TEXT
    frame: ([{225,50+btn_spacing*3}, {225+square_size,50+square_size+btn_spacing*3}])
    bgcolor:if LAA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if LAA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};
integer right_shift = 645;
window right_lung_active_btn = {
    type: TEXT
    frame: ([{225+right_shift,50}, {225+square_size+right_shift,50+square_size}])
    bgcolor:if RLA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if RLA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};
window right_bronchus_active_btn = {
    type: TEXT
    frame: ([{225+right_shift,50+btn_spacing}, {225+square_size+right_shift,50+square_size+btn_spacing}])
    bgcolor:if RBSA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if RBSA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};

window right_bronchiole_active_btn = {
    type: TEXT
    frame: ([{225+right_shift,50+btn_spacing*2}, {225+square_size+right_shift,50+square_size+btn_spacing*2}])
    bgcolor:if RBIA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if RBIA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};

window right_alveoli_active_btn = {
    type: TEXT
    frame: ([{225+right_shift,50+btn_spacing*3}, {225+square_size+right_shift,50+square_size+btn_spacing*3}])
    bgcolor:if RAA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if RAA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};

window lung_active_btn = {
    type: TEXT
    frame: ([{620,375}, {620+square_size,375+square_size}])
    bgcolor:if LA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if LA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};

window trachea_active_btn = {
    type: TEXT
    frame: ([{620,375+30}, {620+square_size,375+square_size+30}])
    bgcolor:if TA then "green" else "red" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief:if TA then "sunken" else "raised" endif
    sensitive: ON+LEAVE+ENTER
};

window clock_start_btn = {
    type: TEXT
    frame: ([{670,240}, {670+x_difference,240+y_difference}])
    string: "START CLOCK"
    bgcolor:if valid1 then "grey" else "green" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief: "flat"
    sensitive: ON+LEAVE+ENTER
};

window clock_stop_btn = {
    type: TEXT
    frame: ([{670,263}, {670+x_difference,263+y_difference}])
    string: "STOP  CLOCK"
    bgcolor:if valid2 then "grey" else "green" endif
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief: "flat"
    sensitive: ON+LEAVE+ENTER
};

integer x_dif_smoke = 105;
integer y_level_smoke = 350;
window start_smoking_btn = {
    type: TEXT
    frame: ([{665,y_level_smoke}, {665+x_dif_smoke,y_level_smoke+y_difference}])
    string: if smoke_scout then "SMOKING!!!!!!" else "START SMOKING" endif
    bgcolor:if smoke_scout then "green" else "grey" endif,
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief: if smoke_scout then "sunken" else "raised" endif,
    sensitive: ON+LEAVE+ENTER
};

window stop_smoking_btn = {
    type: TEXT
    frame: ([{675+x_dif_smoke,y_level_smoke}, {675+x_dif_smoke*2,y_level_smoke+y_difference}])
    string: if smoke_scout then "STOP  SMOKING" else "NOT  SMOKING!" endif
    bgcolor:if smoke_scout then "grey" else "green" endif,
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief: if smoke_scout then "raised" else "sunken" endif,
    sensitive: ON+LEAVE+ENTER
};

integer x_dif_city = 105;
integer y_level_city = 380;
window enter_city_btn = {
    type: TEXT
    frame: ([{665,y_level_city}, {665+x_dif_city,y_level_city+y_difference}])
    string: if city_scout then "   POLLUTION  " else " ENTER CITY  " endif
    bgcolor:if city_scout then "green" else "grey" endif,
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief: if city_scout then "sunken" else "raised" endif,
    sensitive: ON+LEAVE+ENTER
};

window enter_countryside_btn = {
    type: TEXT
    frame: ([{675+x_dif_city,y_level_city}, {675+x_dif_city*2,y_level_city+y_difference}])
    string: if city_scout then " COUNTRYSIDE " else "  FRESH AIR" endif
    bgcolor:if city_scout then "grey" else "green" endif,
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief: if city_scout then "raised" else "sunken" endif,
    sensitive: ON+LEAVE+ENTER
};

integer x_dif_stress = 105;
integer y_level_stress = 410;
window add_stress_btn = {
    type: TEXT
    frame: ([{665,y_level_stress}, {665+x_dif_stress, y_level_stress+y_difference}])
    string: if stress_scout then "ADDING" else " ADD STRESS  " endif,
    bgcolor:if stress_scout then "green" else "grey" endif,
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief: if stress_scout then "sunken" else "raised" endif,
    sensitive: ON+LEAVE+ENTER
};

window relieve_stress_btn = {
    type: TEXT
    frame: ([{675+x_dif_stress,y_level_stress}, {675+x_dif_stress*2,y_level_stress+y_difference}])
    string: if relieve_scout then "  RELIEVING" else "  RELIEVE STRESS" endif,
    bgcolor:if relieve_scout then "green" else "grey" endif,
    fgcolor:"blue"
    border: 2
    bdcolor: "red"
    relief: if relieve_scout then "sunken" else "raised" endif,
    sensitive: ON+LEAVE+ENTER
};



string left_lung_image = "L_L_S";
window left_lung_pic = {
    type: IMAGE
    box: [{260,10}, {center_c,height}]
    pict: left_lung_image,
    xmin:0
    ymin:0
    xmax:1000
    ymax:1000
    bgcolor: "Grey"
    border: 0
    relief: "flat"
    sensitive: ON
};

integer width_c = 202;

string right_lung_image = "R_L_S";
window right_lung_pic = {
    type: IMAGE
    box: [{center_c,10}, {center_c+width_c,height}]
    pict: right_lung_image,
    xmin:0
    ymin:0
    xmax:1000
    ymax:1000
    bgcolor: "Grey"
    border: 0
    relief: "flat"
    sensitive: ON
};

integer t_height = 159;
integer trachea_left_point = 426;
integer trachea_right_point = 455;
string trachea_image = "T_V_S";

window trachea_pic = {
    type: DONALD
    box: [{trachea_left_point,10}, {trachea_right_point,t_height}]
    pict: trachea_image,
    xmin:0
    ymin:0
    xmax:1000
    ymax:1000
    bgcolor: "Grey"
    border: 0
    sensitive: ON
};



window right_lung_stats = {
    type: DONALD
    box: [{654,10}, {894, 220}]
    pict: "LUNGVIEW_RIGHT"
     xmin:0
    ymin:575
    xmax:1000
    ymax:1000
    bgcolor: "Grey"
    border: 0
    sensitive: ON
};

integer x_dif = 384;
integer y_dif = 78;
window bpm_window = {
    type: DONALD
    box: [{260,368}, {260+x_dif,368+y_dif}]
    pict: "BPM"
    xmin:0
    ymin:0
    xmax:1000
    ymax:1000
    bgcolor: "grey"
    border: 0
    sensitive: ON
};

window time_window = {
    type: DONALD
    box: [{655,225}, {655+240,225+100}]
    pict: "TIME"
    xmin:0
    ymin:0
    xmax:1000
    ymax:1000
    bgcolor: "grey"
    border: 0
    sensitive: ON
};

window time_delay_window = {
    type: DONALD
    box: [{670,288}, {670+200,288+15}]
    pict: "TIME_DELAY"
    xmin:0
    ymin:0
    xmax:1000
    ymax:1000
    bgcolor: "Grey"
    border: 1
    relief: "raised"
    sensitive: ON
};

window air_content_window = {
    type: DONALD
    box: [{10,225}, {10+240,225+220}]
    pict: "AIR"
    xmin:0
    ymin:0
    xmax:1000
    ymax:1000
    bgcolor: "Grey"
    border: 1
    relief: "flat"
    sensitive: ON
};



respiratoryModel  = <lung_active_btn/trachea_active_btn/add_stress_btn/relieve_stress_btn/enter_city_btn/enter_countryside_btn/stop_smoking_btn/start_smoking_btn/air_content_window/time_delay_window/right_alveoli_active_btn/right_bronchiole_active_btn/right_bronchus_active_btn/right_lung_active_btn/left_alveoli_active_btn/left_bronchiole_active_btn/left_bronchus_active_btn/left_lung_active_btn/clock_stop_btn/clock_start_btn/time_window/bpm_window/trachea_pic/left_lung_pic/right_lung_pic/lung_health_meter/right_lung_stats>;

