3 if (typeof JSROOT !=
"object") {
4 var e1 =
new Error(
"analysiseditor.js requires JSROOT to be already loaded");
5 e1.source =
"analysiseditor.js";
9 if (typeof GO4 !=
"object") {
10 var e1 =
new Error(
"analysiseditor.js requires GO4 to be already loaded");
11 e1.source =
"analysiseditor.js";
29 GO4.AnalysisStatusEditor =
function(stat) {
30 JSROOT.TBasePainter.call(
this, stat);
33 this.changes = [[
"dummy0",
"init0"],[
"dummy1",
"init1"]];
34 this.showmore= [
false,
false];
36 this.ClearShowstates();
40 GO4.AnalysisStatusEditor.prototype = Object.create(JSROOT.TBasePainter.prototype);
42 GO4.AnalysisStatusEditor.prototype.DabcCommand =
function(cmd, option, callback) {
44 if (this.GetItemName()!=
"") {
45 pre = this.GetItemName() +
"/";
48 pre +=
"exe.json\?method=";
49 var fullcom = pre + cmd + option;
51 JSROOT.NewHttpRequest(fullcom,
'text',
function(res) {
52 console.log(
"DabcCommand completed.");
57 GO4.AnalysisStatusEditor.prototype.MarkChanged =
function(key, step) {
59 for (var index = 0; index < this.changes[step].length; index++) {
60 if (this.changes[step][index]== key)
return;
62 this.changes[step].push(key);
63 console.log(
"Mark changed :%s at step %d", key, step);
64 var
id =
"#" + this.get_main_id();
66 $(
id+
" .buttonAnaChangeLabel").show();
70 GO4.AnalysisStatusEditor.prototype.ClearChanges =
function() {
72 var numsteps=this.changes.length;
73 for (step = 0; step < numsteps ; step++) {
74 var len=this.changes[step].length;
75 for (index = 0; index < len ; index++) {
76 var removed=this.changes[step].pop();
80 var
id = this.get_main_id();
81 if (
id) $(
"#" +
id +
" .buttonAnaChangeLabel").hide();
84 GO4.AnalysisStatusEditor.prototype.ClearShowstates =
function() {
85 for (var index = 0; index < this.showmore.length; ++index)
90 GO4.AnalysisStatusEditor.prototype.EvaluateChanges =
function(optionstring) {
91 var
id =
"#" + this.get_main_id();
94 var numsteps=this.changes.length;
95 for (step = 0; step < numsteps ; step++) {
96 var len=this.changes[step].length;
98 for (index = 0; index < len ; index++) {
100 var key=this.changes[step][index];
103 var theElement=editor.stat.fxStepArray.arr[step];
105 if(key==
"stepenabled")
107 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbProcessEnabled;
109 else if(key==
"sourceenabled")
111 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbSourceEnabled;
113 else if(key==
"storeenabled")
115 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbStoreEnabled;
117 else if(key==
"sourcesel")
119 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiID;
121 else if(key==
"sourcename")
123 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fName;
125 else if(key==
"sourceport")
127 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiPort;
129 else if(key==
"sourcetmout")
131 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiTimeout;
133 else if(key==
"sourceretry")
135 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiRetryCnt;
137 else if(key==
"sourcefirst")
139 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuStartEvent;
141 else if(key==
"sourcelast")
143 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuStopEvent;
145 else if(key==
"sourceskip")
147 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuEventInterval;
149 else if(key==
"storesel")
151 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiID;
153 else if(key==
"storename")
155 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fName;
157 else if(key==
"storesplit")
159 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiSplit;
161 else if(key==
"storebuf")
163 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiBufsize;
165 else if(key==
"storecomp")
167 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiCompression;
169 else if(key==
"storeasf")
171 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiAutosavesize;
173 else if(key==
"storeover")
175 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fbOverwrite;
179 else if(key==
"asfname")
181 stepoptions+=
"&"+key+
"="+editor.stat.fxAutoFileName;
184 else if(key==
"asfenabled")
186 stepoptions+=
"&"+key+
"="+editor.stat.fbAutoSaveOn;
189 else if(key==
"asftime")
191 stepoptions+=
"&"+key+
"="+editor.stat.fiAutoSaveInterval;
193 else if(key==
"asfcomp")
195 stepoptions+=
"&"+key+
"="+editor.stat.fiAutoSaveCompression;
197 else if(key==
"asfoverwrite")
199 stepoptions+=
"&"+key+
"="+editor.stat.fbAutoSaveOverwrite;
201 else if(key==
"anaprefsname")
203 stepoptions+=
"&"+key+
"="+editor.stat.fxConfigFileName;
207 console.log(
"Warning: EvaluateChanges found unknown key:%s", key);
215 optionstring+=stepoptions;
217 console.log(
"Resulting option string:%s", optionstring);
228 GO4.AnalysisStatusEditor.prototype.refreshEditor =
function()
230 var
id =
"#" + this.get_main_id();
236 this.ClearShowstates();
237 var tabelement=$(
id+
" .steptabs");
238 tabelement.tabs(
"option",
"disabled", [0, 1, 2, 3, 4, 5, 6, 7] );
239 for(var j=0; j<8;++j){
240 $(
id +
" .steptabs ul:first li:eq("+ j +
")").hide();
242 stat.fxStepArray.arr.forEach(
function(element, index, array) {
243 tabelement.tabs(
"enable",index);
244 $(
id +
" .steptabs ul:first li:eq("+index+
") a").text(element.fName);
245 $(
id +
" .steptabs ul:first li:eq("+index+
")").show();
246 editor.showmore.push(
false);
248 tabelement.tabs(
"load",index);
255 $(
id +
" .anaASF_name").val(stat.fxAutoFileName);
256 $(
id+
" .anaASF_enabled")
257 .prop(
'checked', stat.fbAutoSaveOn)
259 editor.MarkChanged(
"asfenabled",0);
260 editor.stat.fbAutoSaveOn=this.checked;
264 $(
id +
" .anaASF_time").val(stat.fiAutoSaveInterval);
265 $(
id +
" .anaASF_compression").val(stat.fiAutoSaveCompression);
267 $(
id+
" .anaASF_overwrite")
268 .prop(
'checked', stat.fbAutoSaveOverwrite)
270 editor.MarkChanged(
"asfoverwrite",0);
271 editor.stat.fbAutoSaveOverwrite= this.checked;
275 $(
id +
" .anaprefs_name").val(stat.fxConfigFileName);
279 editor.ClearChanges();
284 GO4.AnalysisStatusEditor.prototype.showStepEditor =
function(pthis, theElement, theIndex)
286 var
id =
"#" + this.get_main_id();
288 var showmore=editor.showmore[theIndex];
290 var storetable=pthis.find(
" .step_store");
291 var sourcetable=pthis.find(
" .step_source");
292 var enablebox=pthis.find(
" .step_box_step_enab");
293 var sourcebox=pthis.find(
" .step_box_source_enab");
294 var storebox=pthis.find(
" .step_box_store_enab");
296 var sourcesel=pthis.find(
" .step_source_select");
297 var sourcemore=pthis.find(
" .step_source_expand");
298 var sourceform=pthis.find(
" .step_source_form");
299 var sourcename=pthis.find(
" .step_source_name");
300 var sourcenamelabel=pthis.find(
" .step_source_name_label");
301 var sourcetag=pthis.find(
" .step_source_tagfile");
302 var sourcetaglabel=pthis.find(
" .step_source_tagfile_label");
303 var sourceport=pthis.find(
" .step_source_port");
304 var sourceportlabel=pthis.find(
" .step_source_port_label");
305 var sourcetmout=pthis.find(
" .step_source_tmout");
306 var sourcetmoutlabel=pthis.find(
" .step_source_tmout_label");
307 var sourceretry=pthis.find(
" .step_source_retry");
308 var sourceretrylabel=pthis.find(
" .step_source_retry_label");
309 var sourceargs=pthis.find(
" .step_source_args");
310 var sourceargslabel=pthis.find(
" .step_source_args_label");
311 var sourcefirst=pthis.find(
" .step_source_firstev");
312 var sourcefirstlabel=pthis.find(
" .step_source_firstev_label");
313 var sourcelast=pthis.find(
" .step_source_lastev");
314 var sourcelastlabel=pthis.find(
" .step_source_lastev_label");
315 var sourceskip=pthis.find(
" .step_source_stepev");
316 var sourceskiplabel=pthis.find(
" .step_source_stepev_label");
318 var storesel=pthis.find(
" .step_store_select");
319 var storename=pthis.find(
" .step_store_name");
320 var storesplit=pthis.find(
" .step_store_split");
321 var storebuf=pthis.find(
" .step_store_buf");
322 var storecomp=pthis.find(
" .step_store_comp");
323 var storetreeasf=pthis.find(
" .step_store_asf");
324 var storeover=pthis.find(
" .step_store_overwrite");
327 if (theElement.fbProcessEnabled) {
328 sourcebox.prop(
'disabled',
false);
329 storebox.prop(
'disabled',
false);
330 if (theElement.fbSourceEnabled) {
335 if (theElement.fbStoreEnabled) {
341 sourcebox.prop(
'disabled',
true);
342 storebox.prop(
'disabled',
true);
353 switch(theElement.fxSourceType.fiID)
355 case GO4.EvIOType.GO4EV_FILE:
356 case GO4.EvIOType.GO4EV_MBS_RANDOM:
358 sourceportlabel.hide();
360 sourcetmoutlabel.hide();
362 sourceretrylabel.hide();
364 sourcetaglabel.hide();
366 sourcefirstlabel.hide();
368 sourcelastlabel.hide()
370 sourceskiplabel.hide();
372 sourceargslabel.hide();
374 case GO4.EvIOType.GO4EV_MBS_STREAM:
375 case GO4.EvIOType.GO4EV_MBS_TRANSPORT:
376 case GO4.EvIOType.GO4EV_MBS_EVENTSERVER:
377 case GO4.EvIOType.GO4EV_MBS_REVSERV:
381 sourceportlabel.show();
383 sourcetmoutlabel.show();
385 sourceretrylabel.show();
387 sourcefirstlabel.show();
389 sourcelastlabel.show();
391 sourceskiplabel.show();
396 sourceportlabel.hide();
398 sourcetmoutlabel.hide();
400 sourceretrylabel.hide();
402 sourcefirstlabel.hide();
404 sourcelastlabel.hide();
406 sourceskiplabel.hide();
409 sourcetaglabel.hide();
411 sourceargslabel.hide();
415 case GO4.EvIOType.GO4EV_USER:
419 sourceportlabel.show();
421 sourcetmoutlabel.show();
423 sourceargslabel.show();
428 sourceportlabel.hide();
430 sourcetmoutlabel.hide();
432 sourceargslabel.hide();
435 sourceretrylabel.hide();
437 sourcetaglabel.hide();
439 sourcefirstlabel.hide();
441 sourcelastlabel.hide();
443 sourceskiplabel.hide();
446 console.log(
"showStepEditor WARNING: unknown event source id: "+theElement.fxSourceType.fiID);
447 case GO4.EvIOType.GO4EV_MBS_FILE:
451 sourcetaglabel.show();
453 sourcefirstlabel.show();
455 sourcelastlabel.show();
457 sourceskiplabel.show();
462 sourcetaglabel.hide();
464 sourcefirstlabel.hide();
466 sourcelastlabel.hide();
468 sourceskiplabel.hide();
471 sourceportlabel.hide();
473 sourcetmoutlabel.hide();
475 sourceretrylabel.hide();
477 sourceargslabel.hide();
488 switch(theElement.fxStoreType.fiID)
491 console.log(
"showStepEditor WARNING: unknown event store id: "+theElement.fxStoreType.fiID);
492 case GO4.EvIOType.GO4EV_FILE:
493 storecomp.spinner(
"enable");
494 storetreeasf.spinner(
"enable");
495 storeover.prop(
'disabled',
false);
497 case GO4.EvIOType.GO4EV_BACK:
498 storecomp.spinner(
"disable");
499 storetreeasf.spinner(
"disable");
500 storeover.prop(
'disabled',
true);
506 sourcesel.selectmenu(
"option",
"width", sourcetable.width()*0.8);
507 sourcesel.selectmenu(
'refresh',
true);
509 storesel.selectmenu(
"option",
"width", storetable.width()*0.8);
510 storesel.selectmenu(
'refresh',
true);
513 pthis.css(
"padding",
"5px");
515 $(
id+
" .steptabs").tabs(
"refresh");
520 GO4.AnalysisStatusEditor.prototype.fillEditor =
function()
522 var
id =
"#" + this.get_main_id();
525 $(
id +
" .steptabs").tabs({
527 activate :
function(event, ui) {
532 load:
function(event, ui) {
537 var theIndex = ui.tab.index();
540 var theElement=editor.stat.fxStepArray.arr[theIndex];
546 var storetable=pthis.find(
" .step_store");
547 var sourcetable=pthis.find(
" .step_source");
548 var enablebox=pthis.find(
" .step_box_step_enab");
549 var sourcebox=pthis.find(
" .step_box_source_enab");
550 var storebox=pthis.find(
" .step_box_store_enab");
552 var sourcesel=pthis.find(
" .step_source_select");
553 var sourcemore=pthis.find(
" .step_source_expand");
554 var sourceform=pthis.find(
" .step_source_form");
555 var sourcename=pthis.find(
" .step_source_name");
556 var sourcetag=pthis.find(
" .step_source_tagfile");
557 var sourceport=pthis.find(
" .step_source_port");
558 var sourcetmout=pthis.find(
" .step_source_tmout");
559 var sourceretry=pthis.find(
" .step_source_retry");
560 var sourceargs=pthis.find(
" .step_source_args");
561 var sourcefirst=pthis.find(
" .step_source_firstev");
562 var sourcelast=pthis.find(
" .step_source_lastev");
563 var sourceskip=pthis.find(
" .step_source_stepev");
565 var storesel=pthis.find(
" .step_store_select");
566 var storename=pthis.find(
" .step_store_name");
567 var storesplit=pthis.find(
" .step_store_split");
568 var storebuf=pthis.find(
" .step_store_buf");
569 var storecomp=pthis.find(
" .step_store_comp");
570 var storetreeasf=pthis.find(
" .step_store_asf");
571 var storeover=pthis.find(
" .step_store_overwrite");
574 enablebox.prop(
'checked', theElement.fbProcessEnabled)
577 editor.MarkChanged(
"stepenabled", theIndex);
578 theElement.fbProcessEnabled=this.checked;
579 editor.showStepEditor(pthis, theElement, theIndex);
583 sourcebox.prop(
'checked', theElement.fbSourceEnabled)
586 editor.MarkChanged(
"sourceenabled", theIndex);
587 theElement.fbSourceEnabled=this.checked;
588 editor.showStepEditor(pthis, theElement, theIndex);
592 storebox.prop(
'checked', theElement.fbStoreEnabled)
595 editor.MarkChanged(
"storeenabled", theIndex);
596 theElement.fbStoreEnabled=this.checked;
597 editor.showStepEditor(pthis, theElement, theIndex);
601 sourcesel.selectmenu({
602 change :
function(event, ui) {
603 editor.MarkChanged(
"sourcesel",theIndex);
608 switch(Number(ui.item.value))
612 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_FILE;
615 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_STREAM;
618 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_TRANSPORT;
621 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_EVENTSERVER;
624 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_REVSERV;
627 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_RANDOM;
630 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_USER;
634 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_FILE;
640 theElement.fxSourceType.fName=sourcename.val();
641 theElement.fxSourceType.fiPort=sourceport.val();
642 theElement.fxSourceType.fiTimeout=sourcetmout.val();
643 theElement.fxSourceType.fiRetryCnt=sourceretry.val();
644 theElement.fxSourceType.fxTagFile=sourcetag.val();
645 theElement.fxSourceType.fuStartEvent=sourcefirst.val();
646 theElement.fxSourceType.fuStopEvent=sourcelast.val();
647 theElement.fxSourceType.fuEventInterval=sourceskip.val();
648 theElement.fxSourceType.fxExpression=sourceargs.val();
650 editor.showStepEditor(pthis, theElement, theIndex);
655 sourcemore.prop(
'checked', editor.showmore[theIndex]).click(
658 var doshow=$(
this).prop(
'checked');
660 editor.showmore[theIndex]=
true;
662 editor.showmore[theIndex]=
false;
664 editor.showStepEditor(pthis, theElement, theIndex);
668 sourcename.val(theElement.fxSourceType.fName);
676 event.preventDefault();
677 var content= sourcename[0].value;
678 content=content.trim();
679 editor.MarkChanged(
"sourcename",theIndex);
680 theElement.fxSourceType.fName=content;
681 console.log(
"Submitting sourcename form with: "+content);
700 stop:
function( event, ui ) {
701 editor.MarkChanged(
"sourceport",theIndex);
702 theElement.fxSourceType.fiPort=this.value;
707 sourcetmout.spinner({
711 stop:
function( event, ui ) {
712 editor.MarkChanged(
"sourcetmout",theIndex);
713 theElement.fxSourceType.fiTimeout=this.value;
719 sourceretry.spinner({
723 stop:
function( event, ui ) {
724 editor.MarkChanged(
"sourceretry",theIndex);
725 theElement.fxSourceType.fiRetryCnt=this.value;
730 sourcefirst.spinner({
734 stop:
function( event, ui ) {
735 editor.MarkChanged(
"sourcefirst",theIndex);
736 theElement.fxSourceType.fuStartEvent=this.value;
744 stop:
function( event, ui ) {
745 editor.MarkChanged(
"sourcelast",theIndex);
746 theElement.fxSourceType.fuStopEvent=this.value;
754 stop:
function( event, ui ) {
755 editor.MarkChanged(
"sourceskip",theIndex);
756 theElement.fxSourceType.fuEventInterval=this.value;
761 storesel.selectmenu({
762 change :
function(event, ui) {
763 editor.MarkChanged(
"storesel",theIndex);
766 switch(Number(ui.item.value))
771 theElement.fxStoreType.fiID=GO4.EvIOType.GO4EV_FILE;
774 theElement.fxStoreType.fiID=GO4.EvIOType.GO4EV_BACK;
777 theElement.fxStoreType.fName=storename.val();
778 theElement.fxStoreType.fiSplit=storesplit.val();
779 theElement.fxStoreType.fiBufsize=storebuf.val()* 1000.;
780 theElement.fxStoreType.fiCompression=storecomp.val();
781 theElement.fxStoreType.fiAutosavesize=storetreeasf.val();
785 editor.showStepEditor(pthis, theElement, theIndex);
792 storename.val(theElement.fxStoreType.fName)
794 editor.MarkChanged(
"storename",theIndex);
795 theElement.fxStoreType.fName=this.value.trim();
803 stop:
function( event, ui ) {
804 editor.MarkChanged(
"storesplit",theIndex);
805 theElement.fxStoreType.fiSplit=this.value;
813 stop:
function( event, ui ) {
814 editor.MarkChanged(
"storebuf",theIndex);
815 theElement.fxStoreType.fiBufsize=this.value * 1000;
823 stop:
function( event, ui ) {
824 editor.MarkChanged(
"storecomp",theIndex);
825 theElement.fxStoreType.fiCompression=this.value;
828 storetreeasf.spinner({
832 stop:
function( event, ui ) {
833 editor.MarkChanged(
"storeasf",theIndex);
834 theElement.fxStoreType.fiAutosavesize=this.value;
838 storeover.click(
function() {
839 editor.MarkChanged(
"storeover",theIndex);
840 theElement.fxStoreType.fbOverwrite=this.checked;
850 switch(theElement.fxSourceType.fiID)
852 case GO4.EvIOType.GO4EV_FILE:
855 case GO4.EvIOType.GO4EV_MBS_STREAM:
857 sourceport.val(theElement.fxSourceType.fiPort);
858 sourcetmout.val(theElement.fxSourceType.fiTimeout);
859 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
860 sourcetag.text(theElement.fxSourceType.fxTagFile);
861 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
862 sourcelast.val(theElement.fxSourceType.fuStopEvent);
863 sourceskip.val(theElement.fxSourceType.fuEventInterval);
865 case GO4.EvIOType.GO4EV_MBS_TRANSPORT:
867 sourceport.val(theElement.fxSourceType.fiPort);
868 sourcetmout.val(theElement.fxSourceType.fiTimeout);
869 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
870 sourcetag.text(theElement.fxSourceType.fxTagFile);
871 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
872 sourcelast.val(theElement.fxSourceType.fuStopEvent);
873 sourceskip.val(theElement.fxSourceType.fuEventInterval);
875 case GO4.EvIOType.GO4EV_MBS_EVENTSERVER:
877 sourceport.val(theElement.fxSourceType.fiPort);
878 sourcetmout.val(theElement.fxSourceType.fiTimeout);
879 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
880 sourcetag.text(theElement.fxSourceType.fxTagFile);
881 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
882 sourcelast.val(theElement.fxSourceType.fuStopEvent);
883 sourceskip.val(theElement.fxSourceType.fuEventInterval);
885 case GO4.EvIOType.GO4EV_MBS_REVSERV:
887 sourceport.val(theElement.fxSourceType.fiPort);
888 sourcetmout.val(theElement.fxSourceType.fiTimeout);
889 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
890 sourcetag.text(theElement.fxSourceType.fxTagFile);
891 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
892 sourcelast.val(theElement.fxSourceType.fuStopEvent);
893 sourceskip.val(theElement.fxSourceType.fuEventInterval);
895 case GO4.EvIOType.GO4EV_MBS_RANDOM:
898 case GO4.EvIOType.GO4EV_USER:
900 sourceport.val(theElement.fxSourceType.fiPort);
901 sourcetmout.val(theElement.fxSourceType.fiTimeout);
902 sourceargs.text(theElement.fxSourceType.fxExpression);
905 console.log(
"WARNING: unknown event source id: "+theElement.fiID);
906 case GO4.EvIOType.GO4EV_MBS_FILE:
908 sourcetag.text(theElement.fxSourceType.fxTagFile);
909 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
910 sourcelast.val(theElement.fxSourceType.fuStopEvent);
911 sourceskip.val(theElement.fxSourceType.fuEventInterval);
915 sourcesel.selectmenu(
'refresh',
true);
919 storesplit.val(theElement.fxStoreType.fiSplit);
920 storebuf.val(theElement.fxStoreType.fiBufsize / 1000);
921 storecomp.val(theElement.fxStoreType.fiCompression);
922 storetreeasf.val(theElement.fxStoreType.fiAutosavesize);
926 switch(theElement.fxStoreType.fiID)
929 case GO4.EvIOType.GO4EV_BACK:
932 case GO4.EvIOType.GO4EV_FILE:
933 storeover.prop(
'checked', theElement.fxStoreType.fbOverwrite);
939 storesel.selectmenu(
'refresh',
true);
941 editor.showStepEditor(pthis, theElement, theIndex);
953 $(
id+
" .buttonGetAnalysis")
954 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
956 if (JSROOT.hpainter) JSROOT.hpainter.display(editor.GetItemName());
957 else console.log(
"dabc object not found!");
960 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/right.png)");
964 $(
id+
" .buttonSetAnalysis")
965 .button({text:
true, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
968 options=editor.EvaluateChanges(options);
969 console.log(
"submit analysis "+ editor.GetItemName()+
", options="+options);
970 editor.DabcCommand(
"UpdateFromUrl",options,
function(result) {
971 console.log(result ?
"setting analyis configuration done. " :
"set analysis FAILED.");
973 editor.ClearChanges();
974 if ((JSROOT.hpainter != null) && (
'reload' in JSROOT.hpainter)) JSROOT.hpainter.reload();
979 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/left.png)");
982 $(
id+
" .buttonAnaChangeLabel")
983 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
985 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/info1.png)");
988 $(
id+
" .buttonSetStartAnalysis")
989 .button({text:
true, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
992 options=editor.EvaluateChanges(options);
994 console.log(
"submit and start analysis "+ editor.GetItemName()+
", options="+options);
995 editor.DabcCommand(
"UpdateFromUrl",options,
function(result) {
996 console.log(result ?
"submit and start analyis configuration done. " :
"set analysis FAILED.");
998 editor.ClearChanges();
999 if ((JSROOT.hpainter != null) && (
'reload' in JSROOT.hpainter)) JSROOT.hpainter.reload();
1006 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/start.png)");
1009 $(
id+
" .buttonCloseAnalysis")
1010 .button({text:
true, icons: { primary:
"ui-icon-closethick MyButtonStyle"}}).click(
function() {
1011 var options=
"&close";
1013 console.log(
"close analysis "+ editor.GetItemName()+
", options="+options);
1014 editor.DabcCommand(
"UpdateFromUrl",options,
function(
1016 console.log(result ?
"closing down analyis done. "
1017 :
"set analysis FAILED.");
1025 $(
id+
" .buttonSaveAnaASF")
1026 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1028 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/filesave.png)");
1031 $(
id +
" .anaASF_form").submit(
1034 var content= $(
id +
" .anaASF_name")[0].value;
1035 content=content.trim();
1037 editor.MarkChanged(
"asfname",0);
1038 editor.stat.fxAutoFileName=content;
1039 var requestmsg =
"Really Write autosave file : "+ content;
1040 var response = confirm(requestmsg);
1042 event.preventDefault();
1046 console.log(
"Writing autosave file: "+content);
1047 var options=
"&saveasf="+content;
1048 editor.DabcCommand(
"UpdateFromUrl",options,
function(
1050 console.log(result ?
"Writing autosave file done. "
1051 :
"Writing autosave file FAILED.");
1053 event.preventDefault();
1058 $(
id +
" .anaASF_time").spinner({
1062 stop:
function( event, ui ) {
1064 editor.MarkChanged(
"asftime",0);
1065 editor.stat.fiAutoSaveInterval=this.value;
1070 $(
id +
" .anaASF_compression").spinner({
1074 stop:
function( event, ui ) {
1075 editor.MarkChanged(
"asfcomp",0);
1076 editor.stat.fiAutoSaveCompression=this.value;
1082 $(
id+
" .buttonSaveAnaConf")
1083 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1085 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/filesave.png)");
1087 $(
id+
" .buttonLoadAnaConf")
1088 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1090 var content= $(
id +
" .anaprefs_name")[0].value;
1091 content=content.trim();
1092 var requestmsg =
"Really load analysis preferences: "+ content;
1093 var response = confirm(requestmsg);
1094 if (!response)
return;
1095 console.log(
"Loading analysis Prefs from "+content);
1096 var options=
"&loadprefs="+content;
1097 editor.DabcCommand(
"UpdateFromUrl",options,
function(result) {
1099 if (JSROOT.hpainter) JSROOT.hpainter.display(editor.GetItemName());
1100 else console.log(
"dabc object not found!");
1102 console.log(
"Loading preferences " + (result ?
"done" :
"FAILED."));
1106 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/fileopen.png)");
1109 $(
id +
" .anaprefs_form").submit(
1111 event.preventDefault();
1112 var content= $(
id +
" .anaprefs_name")[0].value;
1113 content=content.trim();
1116 editor.MarkChanged(
"anaprefsname",0);
1117 editor.stat.fxConfigFileName=content;
1118 var requestmsg =
"Really save analysis preferences: "+ content;
1119 var response = confirm(requestmsg);
1120 if (!response)
return;
1121 console.log(
"Saving analysis Prefs to "+content);
1123 var options=
"&saveprefs="+content;
1124 editor.DabcCommand(
"UpdateFromUrl",options,
function(result) {
1125 console.log(result ?
"Saving preferences done. " :
"Saving preferences FAILED.");
1129 this.refreshEditor();
1132 GO4.AnalysisStatusEditor.prototype.drawEditor =
function(divid) {
1134 this.SetDivId(divid);
1138 $(
"#"+divid).empty();
1139 $(
"#"+divid).load(GO4.source_dir +
"html/analysiseditor.htm",
"",
function() {
1141 for (var i=0;i<8;i++)
1142 html+=
'<li><a href="'+ GO4.source_dir +
'html/stepeditor.htm">Step ' + i +
'</a></li>';
1144 $(
"#"+ divid+
" .steptabs").html(html);
1145 pthis.SetDivId(divid);
1147 pthis.DrawingReady();
1152 GO4.AnalysisStatusEditor.prototype.RedrawPad =
function(resize) {
1154 this.refreshEditor();
1157 GO4.AnalysisStatusEditor.prototype.UpdateObject =
function(obj) {
1158 if (obj._typename !=
this.stat._typename)
return false;
1159 this.stat = JSROOT.clone(obj);
1163 GO4.drawGo4AnalysisStatus =
function(divid, stat, option) {
1165 var h = $(
"#"+divid).height(), w = $(
"#"+divid).width();
1166 if ((h<10) && (w>10)) $(
"#"+divid).height(w*0.7);
1167 var status =
new GO4.AnalysisStatusEditor(stat);
1168 return status.drawEditor(divid);