source: XIOS/trunk/html/generate_compile_table.js @ 1821

Last change on this file since 1821 was 1790, checked in by yushan, 4 years ago

trunk : add html scripts

File size: 5.1 KB
Line 
1function generateCompileTable()
2{
3  var machine_list=[];
4  var machine_revision_list=[];
5  var machine_full_name_list=[];
6  var machine_info_list=[];
7
8  if(typeof jeanzay_revision_list != 'undefined') 
9  {
10    machine_list.push("jeanzay");
11    machine_revision_list.push("jeanzay_revision_list")
12    machine_full_name_list.push("Jean-Zay")
13    machine_info_list.push("jeanzay_compile_info_list")
14  }
15 
16  if (typeof irene_revision_list != 'undefined') 
17  {
18    machine_list.push("irene");
19    machine_revision_list.push("irene_revision_list")
20    machine_full_name_list.push("Irene")
21    machine_info_list.push("irene_compile_info_list")
22  }
23 
24  if (typeof other_revision_list != 'undefined') 
25  {
26    machine_list.push("other");
27    machine_revision_list.push("other_revision_list")
28    machine_full_name_list.push("Other")
29    machine_info_list.push("other_compile_info_list")
30  }
31
32  var revision_list=[]
33
34  for (var i=0; i<machine_list.length; i++)
35  {
36    tmp_list = eval(machine_revision_list[i])
37
38    for (var j=0; j<tmp_list.length; j++)
39    {
40      if (revision_list.includes(tmp_list[j]) == false)
41      {
42        revision_list.push(tmp_list[j])
43      }
44    }
45  }
46
47  revision_list.sort(function(a, b){return b-a});
48 
49 
50  // Generate select list for compile table
51
52  var sel = document.getElementById("compile_revision");
53  for (var i=0; i<revision_list.length; i++)
54  {
55    var opt = document.createElement('option');
56    opt.appendChild( document.createTextNode(revision_list[i]) );
57    opt.value = revision_list[i]; 
58    sel.appendChild(opt); 
59  }
60 
61  // Generate content of compile table
62 
63 
64  var table = document.getElementById("compile_table")
65  table.style.backgroundColor = "#84c5ff";
66  table.setAttribute("class", "compile_table")
67  table.setAttribute("id", "compile_table")
68
69  var titelRow = document.getElementById("compile_table_row0")
70  var myCell = document.createElement("TD");
71  myCell.style.maxWidth="100px"
72  myCell.innerHTML = ("Revision");
73  titelRow.appendChild(myCell)
74
75  for (var machine_index=0; machine_index<machine_list.length; machine_index++)
76  {
77    var myCell = document.createElement("TD");
78    myCell.style.minWidth="500px"
79    myCell.innerHTML = (machine_full_name_list[machine_index]);
80    titelRow.appendChild(myCell)
81  }
82
83  for (var i=0; i<revision_list.length; i++)
84  {
85    var revision = revision_list[i]
86
87    var myRow = document.createElement("TR");
88    myRow.setAttribute("id", "compile_table_"+revision);
89    myRow.setAttribute("class", "compile_table_row");
90   
91    var myCell = document.createElement("TD");
92    myCell.innerHTML = (revision);
93    myCell.style.fontWeight = "bold";
94    myRow.appendChild(myCell)
95   
96    for( var j=0; j<machine_list.length; j++)
97    {
98      var machine = machine_list[j]
99      var myCell = document.createElement("TD");
100      myCell.setAttribute("id", "compile_table_"+revision+"_"+machine);
101      myRow.appendChild(myCell)
102    }       
103    table.appendChild(myRow)
104
105  }
106
107  for (var i=0; i<revision_list.length; i++)
108  {
109    var revision = revision_list[i]
110    for ( var j=0; j<machine_list.length; j++)
111    {
112      var machine = machine_list[j]
113      fillSubCompileTable(revision, machine, machine_info_list[j], machine_revision_list[j])
114    }
115  }
116
117}
118
119
120
121function fillSubCompileTable(revision, machine, machine_compile_info, machine_revision)
122{
123  var compile_info = eval(machine_compile_info)
124  var revision_list = eval(machine_revision)
125
126  var myTD = document.getElementById("compile_table_"+revision+"_"+machine);
127  if (!revision_list.includes(revision))
128  {
129    myTD.innerHTML="No Compile Information"
130    myTD.style.color="white"
131  }
132  else
133  {
134    var part_compile_info = []
135    var tmp_mode_list = []
136    var tmp_arch_list = []
137    for(var i=0; i<compile_info.length; i++)
138    {
139      if (revision == compile_info[i][0])
140      {
141        part_compile_info.push(compile_info[i])
142        if (!tmp_mode_list.includes(compile_info[i][3]))
143        {
144          tmp_mode_list.push(compile_info[i][3])
145        }
146        if (!tmp_arch_list.includes(compile_info[i][2]))
147        {
148          tmp_arch_list.push(compile_info[i][2])
149        }
150      }
151    }
152
153    mySubTable = document.createElement("table")
154    myTD.appendChild(mySubTable)
155
156    myRow = document.createElement("tr")
157    mySubTable.appendChild(myRow)
158    myCell = document.createElement("td")
159    myRow.appendChild(myCell)
160    for (var j=0; j<tmp_mode_list.length; j++)
161    {
162      myCell = document.createElement("td")
163      myCell.innerHTML=(tmp_mode_list[j])
164      myRow.appendChild(myCell)
165    }
166
167    for (var j=0; j<tmp_arch_list.length; j++)
168    {
169      myRow = document.createElement("tr")
170      mySubTable.appendChild(myRow)
171
172      myCell = document.createElement("td")
173      myCell.innerHTML = (tmp_arch_list[j])
174      myRow.appendChild(myCell)
175
176     
177      for(var i=0; i<tmp_mode_list.length; i++)
178      {
179        myCell = document.createElement("td")
180        for (var k=0; k<part_compile_info.length; k++)
181        {
182          if(part_compile_info[k][2] == tmp_arch_list[j] && part_compile_info[k][3] == tmp_mode_list[i])
183          {
184            myCell.innerHTML = (part_compile_info[k][4])
185            break
186          }
187        }       
188        myRow.appendChild(myCell)
189      }
190    }
191  }
192
193 
194}
Note: See TracBrowser for help on using the repository browser.