});
$("#button_plot_spectrum").click(function(){
spectrum = get_spectrum_JSON();
+ plot_choices();
plot_spectrum();
});
$("#button_clear_spectrum").click(function(){
});
$( "#progressbar" ).progressbar({
- value: 100
+ value: 1000
});
get_coral_scanner_settings();
get_pmt_ro_settings();
spectrum = get_spectrum_JSON();
+ plot_choices();
plot_spectrum();
get_scan_meta();
}
+function plot_choices() {
+ // insert checkboxes
+ var choiceContainer = $("#choices");
+ choiceContainer.html("");
+ $.each(spectrum, function(key, val) {
+ choiceContainer.append("<br/><input type='checkbox' name='" + key +
+ "' checked='checked' id='id" + key + "'></input>" +
+ "<label for='id" + key + "'>"
+ + key + "</label>");
+ });
+
+ choiceContainer.find("input").click(function(){plot_spectrum();});
+
+
+}
+
+
function plot_spectrum() {
var data = [];
- for (x in spectrum){
- data.push(
- {
- data: spectrum[x].data,
- bars: { show: true , barWidth: 0.8*parseFloat(spectrum[x].meta.bin_width), align: "center" },
- label: x
- }
- );
- }
+// for (x in spectrum){
+// data.push(
+// {
+// data: spectrum[x].data,
+// bars: { show: true , barWidth: 0.8*parseFloat(spectrum[x].meta.bin_width), align: "center" },
+// label: x
+// }
+// );
+// }
+
+ $('#choices').find("input:checked").each(function () {
+ var key = $(this).attr("name");
+ if (key && spectrum[key]) {
+// data.push(datasets[key]);
+ data.push(
+ {
+ data: spectrum[key].data,
+ bars: { show: true , barWidth: 0.8*parseFloat(spectrum[key].meta.bin_width), align: "center" },
+ label: key
+ }
+ );
+ }
+ });
var options = {
selection: {
$('#'+id).html(answer[id]);
}
$( "#progressbar" ).progressbar({
- max: answer.rows,
- value: answer.current_row
+ max: answer.number_points,
+ value: answer.points_scanned
});
}
});
print "<p id='show_pmt_spectrum' class='quasibutton' >spectrum</p>";
print "<div id='pmt_spectrum_container' class='stylishBox padded'>";
- print '<div id="spectrum_plot_container" style="width:600px;height:300px"></div>';
+ print "<table><tr><td>";
+ print '<div id="spectrum_plot_container" style="width:600px;height:300px;float:left;"></div>';
+ print "</td><td>";
+ print '<div id="choices"></div>';
+ print "</td></tr></table>";
print "<input type='button' id='button_plot_spectrum' value='plot spectrum'>";
print "<input type='button' id='button_clear_spectrum' value='clear spectrum'>";
print "<label><input type='checkbox' id='checkbox_log_spectrum' >log y</label>";
- print br br;
+ print br;
print "record name: ";
print "<input type='text' id='text_spectrum_name' value='signal'>";
print "<input type='button' id='button_record_spectrum' value='record spectrum'>";
abort => 0,
cols => $scan_pattern->{cols},
rows => $scan_pattern->{rows},
+ number_points => $scan_pattern->{number_points},
+ points_scanned => 0,
current_col => 0,
current_row => 0,
ETA => $ETA,
abort => 0,
current_col => ($col+1),
current_row => ($row+1),
+ points_scanned => $points_scanned,
seconds_left => 0
};
$self->{status_shm}->writeShm($status);
%$status,
current_col => ($col+1),
current_row => ($row+1),
+ points_scanned => $points_scanned,
seconds_left => $seconds_left
};
$self->{status_shm}->writeShm($status);