%eden
/*all the different viewports are kept in this file.  Mainly, the labelling and the health bars are created using donald*/
%donald

viewport LUNGVIEW
real linewidth, bar_seperation
real scaling
point top_left
char bar_colour
line lung_left, lung_left_bronchus, lung_left_bronchiole, lung_left_alveoli, under1, under2, under3, under4, under5, under6
label lung_left_label, lung_left_bronchus_label, lung_left_bronchiole_label, lung_left_alveoli_label
int spacing

linewidth = 20.0
top_left = {40, 900}
bar_seperation = 80.0
bar_colour="red"
scaling = 8.0


under1 = [top_left, {top_left.1+100*scaling, top_left.2}]
under2 = [{top_left.1, top_left.2-bar_seperation}, {top_left.1+100*scaling, top_left.2-bar_seperation}]
under3 = [{top_left.1, top_left.2-bar_seperation*2}, {top_left.1+100*scaling, top_left.2-bar_seperation*2}]
under4 = [{top_left.1, top_left.2-bar_seperation*3}, {top_left.1+100*scaling, top_left.2-bar_seperation*3}]

?A_under1 is "linewidth=20,color=blue";
?A_under2 is "linewidth=20,color=blue";
?A_under3 is "linewidth=20,color=blue";
?A_under4 is "linewidth=20,color=blue";


lung_left = [top_left, {top_left.1+left_lung_health!*scaling, top_left.2}]
lung_left_bronchus = [{top_left.1, top_left.2-bar_seperation}, {top_left.1+left_bronchus!*scaling, top_left.2-bar_seperation}]
lung_left_bronchiole = [{top_left.1, top_left.2-(bar_seperation*2)}, {top_left.1+left_bronchiole!*scaling, top_left.2-(bar_seperation*2)}]
lung_left_alveoli = [{top_left.1, top_left.2-(bar_seperation*3)}, {top_left.1+left_alveoli!*scaling, top_left.2-(bar_seperation*3)}]


?A_lung_left is "linewidth=20,color=red";
?A_lung_left_bronchus is "linewidth=20,color=red";
?A_lung_left_bronchiole is "linewidth=20,color=red";
?A_lung_left_alveoli is "linewidth=20,color=red";


lung_left_label = label("Left Lung Health", {320, 940})
lung_left_bronchus_label = label("Left Bronchus Health", {390, 940-bar_seperation})
lung_left_bronchiole_label = label("Left Bronchiole Throughput", {490, 940-bar_seperation*2})
lung_left_alveoli_label = label("Left Alveoli Surface Area", {470, 940-bar_seperation*3})




viewport TIME
spacing = 200
label day_label, hour_label, minute_label, second_label, day_label_label, hour_label_label, minute_label_label, second_label_label

day_label_label = label("Day", {650-100, 700})
hour_label_label = label("Hr", {650+100, 700})
minute_label_label = label("Min", {650-100, 500})
second_label_label = label("Sec", {650+100, 500})

day_label = label(day!, {650, 700})
hour_label = label(hour!, {650+200, 700})
minute_label = label(minute!, {650, 500})
second_label = label(second!, {650+200, 500})





viewport LUNGVIEW_RIGHT
line lung_right, lung_right_bronchus, lung_right_bronchiole, lung_right_alveoli, under5, under6, under7, under8
label lung_right_label, lung_right_bronchus_label, lung_right_bronchiole_label, lung_right_alveoli_label

under5 = [top_left, {top_left.1+100*scaling, top_left.2}]
under6 = [{top_left.1, top_left.2-bar_seperation}, {top_left.1+100*scaling, top_left.2-bar_seperation}]
under7 = [{top_left.1, top_left.2-bar_seperation*2}, {top_left.1+100*scaling, top_left.2-bar_seperation*2}]
under8 = [{top_left.1, top_left.2-bar_seperation*3}, {top_left.1+100*scaling, top_left.2-bar_seperation*3}]

?A_under5 is "linewidth=20,color=blue";
?A_under6 is "linewidth=20,color=blue";
?A_under7 is "linewidth=20,color=blue";
?A_under8 is "linewidth=20,color=blue";


lung_right = [top_left, {top_left.1+right_lung_health!*scaling, top_left.2}]
lung_right_bronchus = [{top_left.1, top_left.2-bar_seperation}, {top_left.1+right_bronchus!*scaling, top_left.2-bar_seperation}]
lung_right_bronchiole = [{top_left.1, top_left.2-(bar_seperation*2)}, {top_left.1+right_bronchiole!*scaling, top_left.2-(bar_seperation*2)}]
lung_right_alveoli = [{top_left.1, top_left.2-(bar_seperation*3)}, {top_left.1+right_alveoli!*scaling, top_left.2-(bar_seperation*3)}]


?A_lung_right is "linewidth=20,color=red";
?A_lung_right_bronchus is "linewidth=20,color=red";
?A_lung_right_bronchiole is "linewidth=20,color=red";
?A_lung_right_alveoli is "linewidth=20,color=red";


lung_right_label = label("Right Lung Health", {330, 940})
lung_right_bronchus_label = label("Right Bronchus Health", {400, 940-bar_seperation})
lung_right_bronchiole_label = label("Right Bronchiole Throughput", {500, 940-bar_seperation*2})
lung_right_alveoli_label = label("Right Alveoli Surface Area", {480, 940-bar_seperation*3})

viewport BPM
point top_left_BPM
real scaling_BPM
real bar_seperation_BPM
top_left_BPM = {350, 810}
bar_seperation_BPM = 370.0
scaling_BPM = 5.5
line under9, under10, lung_health_label, trachea_health_label 
label breaths_PM_label, bpm_label, lung_health_label_label, trachea_health_label_label

under9 = [top_left_BPM, {top_left_BPM.1+100*scaling_BPM, top_left_BPM.2}]
under10 = [{top_left_BPM.1, top_left_BPM.2-bar_seperation_BPM}, {top_left_BPM.1+100*scaling_BPM, top_left_BPM.2-bar_seperation_BPM}]
?A_under9 is "linewidth=20,color=blue";
?A_under10 is "linewidth=20,color=blue";

lung_health_label_label = label("Lung Health", {120, 800})
lung_health_label = [top_left_BPM,{top_left_BPM.1+lung_health!*scaling_BPM,top_left_BPM.2}]


trachea_health_label_label = label("Trachea Health", {150, 460})
trachea_health_label = [{top_left_BPM.1, top_left_BPM.2-bar_seperation_BPM}, {top_left_BPM.1+trachea!*scaling_BPM, top_left_BPM.2-bar_seperation_BPM}]


bpm_label = label("Breaths Per Min", {160, 170})
breaths_PM_label = label(breaths_PM!, {650, 170})

?A_lung_health_label is "linewidth=20,color=red";
?A_trachea_health_label is "linewidth=20,color=red";



viewport TIME_DELAY
int time_delay_x_pos
line delay_line
label delay_label
delay_label = label("time delay", {500, 500})
delay_line = [{time_delay_x_pos,0},{time_delay_x_pos,1000}]
?A_delay_line is "linewidth=5,color=blue";
?A_delay_label is "color=blue";


viewport AIR
label inhaled_air_content_label_label, oxygen_label_label, nitrogen_label_label, co2_label_label, co_label_label, irritants_label_label, tar_label_label, nicotine_label_label, other_label_label
inhaled_air_content_label_label = label("Inhaled Air Content (%)", {500, 950})
oxygen_label_label = label("Oxygen", {120, 800})
nitrogen_label_label = label("Nitrogen", {150, 700})
co2_label_label = label("CO2", {70, 600})
co_label_label = label("CO", {55, 500})
irritants_label_label = label("Irritants", {160, 400})
tar_label_label = label("Tar", {65,300})
nicotine_label_label = label("Nicotine", {150, 200})
other_label_label = label("Other", {100, 100})

label oxygen_label, nitrogen_label, co2_label, co_label, irritants_label, tar_label, nicotine_label, other_label

oxygen_label = label(oxygen!, {500, 800})
nitrogen_label = label(nitrogen!, {500, 700})
co2_label = label(co2!, {500, 600})
co_label = label(co!, {500, 500})
irritants_label = label(irritants!, {500, 400})
tar_label = label(tar!, {500,300})
nicotine_label = label(nicotine!, {500, 200})
other_label = label(other!, {500, 100})


?_time_delay_x_pos is (time_delay_window_mouse==@) ? 0 : time_delay_window_mouse[4];
