Commit 782bb67d authored by Marc Duez's avatar Marc Duez
Browse files

model.js: store sample date and run date of each time point

-getSrTime() function who return the name or date of a time point (depends of the format selected by user)
parent 43f2ca7e
......@@ -79,12 +79,15 @@ Model.prototype = {
this.precision = 1;
this.time = [];
this.time_order = [];
this.timestamp = [];
this.timestamp2 = [];
this.clones = [];
this.windows = [];
this.germline = {};
this.dataFileName = '';
this.analysisFileName = '';
this.notation_type = "percent"
this.time_type = "name"
this.normalization = {
"A" : [],
"B" : 0,
......@@ -994,19 +997,53 @@ Model.prototype = {
this.update();
},
/* use scientific notation ( true/false )
/* use scientific notation / percent
*
* */
notation_switch: function (newR) {
console.log("scientific notation : " + newR)
if (newR==true) {
this.notation_type = "scientific"
}else{
this.notation_type = "percent"
notation_switch: function () {
var radio = document.getElementsByName("notation");
for(var elem in radio){
if(radio[elem].checked){
this.notation_type = radio[elem].value
this.update();
}
}
},
/* use name / date
*
* */
time_switch: function () {
var radio = document.getElementsByName("time");
for(var elem in radio){
if(radio[elem].checked){
this.time_type = radio[elem].value
this.update();
}
}
this.update();
},
getStrTime: function (timeID, format){
format = typeof format !== 'undefined' ? format : this.time_type;
var result = "-/-"
switch (format) {
case "name":
result = this.time[timeID]
break;
case "sampling_date":
if ((typeof this.timestamp2 != 'undefined') && this.timestamp2[timeID])
result = this.timestamp2[timeID].split(" ")[0]
break;
case "run_date":
if ((typeof this.timestamp != 'undefined') && this.timestamp[timeID])
result = this.timestamp[timeID].split(" ")[0]
break;
}
return result
},
/* change the current tracking point used
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment