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";
31 GO4.AnalysisStatusEditor =
function(divid, stat) {
32 BasePainter.call(
this, divid);
33 if (this.SetDivId) this.SetDivId(divid);
35 this.changes = [[
"dummy0",
"init0"],[
"dummy1",
"init1"]];
36 this.showmore= [
false,
false];
38 this.ClearShowstates();
41 GO4.AnalysisStatusEditor.prototype = Object.create(BasePainter.prototype);
43 GO4.AnalysisStatusEditor.prototype.MarkChanged =
function(key, step) {
45 for (var index = 0; index < this.changes[step].length; index++) {
46 if (this.changes[step][index]== key)
return;
48 this.changes[step].push(key);
49 console.log(
"Mark changed :%s at step %d", key, step);
50 var
id =
"#" + this.get_main_id();
52 $(
id+
" .buttonAnaChangeLabel").show();
56 GO4.AnalysisStatusEditor.prototype.ClearChanges =
function() {
58 var numsteps=this.changes.length;
59 for (step = 0; step < numsteps ; step++) {
60 var len=this.changes[step].length;
61 for (index = 0; index < len ; index++) {
62 var removed=this.changes[step].pop();
66 var
id = this.get_main_id();
67 if (
id) $(
"#" +
id +
" .buttonAnaChangeLabel").hide();
70 GO4.AnalysisStatusEditor.prototype.ClearShowstates =
function() {
71 for (var index = 0; index < this.showmore.length; ++index)
76 GO4.AnalysisStatusEditor.prototype.EvaluateChanges =
function(optionstring) {
77 var
id =
"#" + this.get_main_id();
80 var numsteps=this.changes.length;
81 for (step = 0; step < numsteps ; step++) {
82 var len=this.changes[step].length;
84 for (index = 0; index < len ; index++) {
86 var key=this.changes[step][index];
89 var theElement=editor.stat.fxStepArray.arr[step];
91 if(key==
"stepenabled")
93 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbProcessEnabled;
95 else if(key==
"sourceenabled")
97 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbSourceEnabled;
99 else if(key==
"storeenabled")
101 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbStoreEnabled;
103 else if(key==
"sourcesel")
105 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiID;
107 else if(key==
"sourcename")
109 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fName;
111 else if(key==
"sourceport")
113 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiPort;
115 else if(key==
"sourcetmout")
117 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiTimeout;
119 else if(key==
"sourceretry")
121 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiRetryCnt;
123 else if(key==
"sourcefirst")
125 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuStartEvent;
127 else if(key==
"sourcelast")
129 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuStopEvent;
131 else if(key==
"sourceskip")
133 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuEventInterval;
135 else if(key==
"storesel")
137 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiID;
139 else if(key==
"storename")
141 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fName;
143 else if(key==
"storesplit")
145 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiSplit;
147 else if(key==
"storebuf")
149 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiBufsize;
151 else if(key==
"storecomp")
153 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiCompression;
155 else if(key==
"storeasf")
157 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiAutosavesize;
159 else if(key==
"storeover")
161 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fbOverwrite;
165 else if(key==
"asfname")
167 stepoptions+=
"&"+key+
"="+editor.stat.fxAutoFileName;
170 else if(key==
"asfenabled")
172 stepoptions+=
"&"+key+
"="+editor.stat.fbAutoSaveOn;
175 else if(key==
"asftime")
177 stepoptions+=
"&"+key+
"="+editor.stat.fiAutoSaveInterval;
179 else if(key==
"asfcomp")
181 stepoptions+=
"&"+key+
"="+editor.stat.fiAutoSaveCompression;
183 else if(key==
"asfoverwrite")
185 stepoptions+=
"&"+key+
"="+editor.stat.fbAutoSaveOverwrite;
187 else if(key==
"anaprefsname")
189 stepoptions+=
"&"+key+
"="+editor.stat.fxConfigFileName;
193 console.log(
"Warning: EvaluateChanges found unknown key:%s", key);
198 optionstring+=stepoptions;
200 console.log(
"Resulting option string:%s", optionstring);
204 GO4.AnalysisStatusEditor.prototype.refreshEditor =
function()
206 var
id =
"#" + this.get_main_id();
212 this.ClearShowstates();
213 var tabelement=$(
id+
" .steptabs");
214 tabelement.tabs(
"option",
"disabled", [0, 1, 2, 3, 4, 5, 6, 7] );
215 for(var j=0; j<8;++j){
216 $(
id +
" .steptabs ul:first li:eq("+ j +
")").hide();
218 stat.fxStepArray.arr.forEach(
function(element, index, array) {
219 tabelement.tabs(
"enable",index);
220 $(
id +
" .steptabs ul:first li:eq("+index+
") a").text(element.fName);
221 $(
id +
" .steptabs ul:first li:eq("+index+
")").show();
222 editor.showmore.push(
false);
224 tabelement.tabs(
"load",index);
231 $(
id +
" .anaASF_name").val(stat.fxAutoFileName);
232 $(
id+
" .anaASF_enabled")
233 .prop(
'checked', stat.fbAutoSaveOn)
235 editor.MarkChanged(
"asfenabled",0);
236 editor.stat.fbAutoSaveOn=this.checked;
240 $(
id +
" .anaASF_time").val(stat.fiAutoSaveInterval);
241 $(
id +
" .anaASF_compression").val(stat.fiAutoSaveCompression);
243 $(
id+
" .anaASF_overwrite")
244 .prop(
'checked', stat.fbAutoSaveOverwrite)
246 editor.MarkChanged(
"asfoverwrite",0);
247 editor.stat.fbAutoSaveOverwrite= this.checked;
251 $(
id +
" .anaprefs_name").val(stat.fxConfigFileName);
255 editor.ClearChanges();
260 GO4.AnalysisStatusEditor.prototype.showStepEditor =
function(pthis, theElement, theIndex)
262 var
id =
"#" + this.get_main_id();
264 var showmore=editor.showmore[theIndex];
266 var storetable=pthis.find(
" .step_store");
267 var sourcetable=pthis.find(
" .step_source");
268 var enablebox=pthis.find(
" .step_box_step_enab");
269 var sourcebox=pthis.find(
" .step_box_source_enab");
270 var storebox=pthis.find(
" .step_box_store_enab");
272 var sourcesel=pthis.find(
" .step_source_select");
273 var sourcemore=pthis.find(
" .step_source_expand");
274 var sourceform=pthis.find(
" .step_source_form");
275 var sourcename=pthis.find(
" .step_source_name");
276 var sourcenamelabel=pthis.find(
" .step_source_name_label");
277 var sourcetag=pthis.find(
" .step_source_tagfile");
278 var sourcetaglabel=pthis.find(
" .step_source_tagfile_label");
279 var sourceport=pthis.find(
" .step_source_port");
280 var sourceportlabel=pthis.find(
" .step_source_port_label");
281 var sourcetmout=pthis.find(
" .step_source_tmout");
282 var sourcetmoutlabel=pthis.find(
" .step_source_tmout_label");
283 var sourceretry=pthis.find(
" .step_source_retry");
284 var sourceretrylabel=pthis.find(
" .step_source_retry_label");
285 var sourceargs=pthis.find(
" .step_source_args");
286 var sourceargslabel=pthis.find(
" .step_source_args_label");
287 var sourcefirst=pthis.find(
" .step_source_firstev");
288 var sourcefirstlabel=pthis.find(
" .step_source_firstev_label");
289 var sourcelast=pthis.find(
" .step_source_lastev");
290 var sourcelastlabel=pthis.find(
" .step_source_lastev_label");
291 var sourceskip=pthis.find(
" .step_source_stepev");
292 var sourceskiplabel=pthis.find(
" .step_source_stepev_label");
294 var storesel=pthis.find(
" .step_store_select");
295 var storename=pthis.find(
" .step_store_name");
296 var storesplit=pthis.find(
" .step_store_split");
297 var storebuf=pthis.find(
" .step_store_buf");
298 var storecomp=pthis.find(
" .step_store_comp");
299 var storetreeasf=pthis.find(
" .step_store_asf");
300 var storeover=pthis.find(
" .step_store_overwrite");
303 if (theElement.fbProcessEnabled) {
304 sourcebox.prop(
'disabled',
false);
305 storebox.prop(
'disabled',
false);
306 if (theElement.fbSourceEnabled) {
311 if (theElement.fbStoreEnabled) {
317 sourcebox.prop(
'disabled',
true);
318 storebox.prop(
'disabled',
true);
329 switch(theElement.fxSourceType.fiID)
331 case GO4.EvIOType.GO4EV_FILE:
332 case GO4.EvIOType.GO4EV_MBS_RANDOM:
334 sourceportlabel.hide();
336 sourcetmoutlabel.hide();
338 sourceretrylabel.hide();
340 sourcetaglabel.hide();
342 sourcefirstlabel.hide();
344 sourcelastlabel.hide()
346 sourceskiplabel.hide();
348 sourceargslabel.hide();
350 case GO4.EvIOType.GO4EV_MBS_STREAM:
351 case GO4.EvIOType.GO4EV_MBS_TRANSPORT:
352 case GO4.EvIOType.GO4EV_MBS_EVENTSERVER:
353 case GO4.EvIOType.GO4EV_MBS_REVSERV:
357 sourceportlabel.show();
359 sourcetmoutlabel.show();
361 sourceretrylabel.show();
363 sourcefirstlabel.show();
365 sourcelastlabel.show();
367 sourceskiplabel.show();
372 sourceportlabel.hide();
374 sourcetmoutlabel.hide();
376 sourceretrylabel.hide();
378 sourcefirstlabel.hide();
380 sourcelastlabel.hide();
382 sourceskiplabel.hide();
385 sourcetaglabel.hide();
387 sourceargslabel.hide();
391 case GO4.EvIOType.GO4EV_USER:
395 sourceportlabel.show();
397 sourcetmoutlabel.show();
399 sourceargslabel.show();
404 sourceportlabel.hide();
406 sourcetmoutlabel.hide();
408 sourceargslabel.hide();
411 sourceretrylabel.hide();
413 sourcetaglabel.hide();
415 sourcefirstlabel.hide();
417 sourcelastlabel.hide();
419 sourceskiplabel.hide();
422 console.log(
"showStepEditor WARNING: unknown event source id: "+theElement.fxSourceType.fiID);
423 case GO4.EvIOType.GO4EV_MBS_FILE:
427 sourcetaglabel.show();
429 sourcefirstlabel.show();
431 sourcelastlabel.show();
433 sourceskiplabel.show();
438 sourcetaglabel.hide();
440 sourcefirstlabel.hide();
442 sourcelastlabel.hide();
444 sourceskiplabel.hide();
447 sourceportlabel.hide();
449 sourcetmoutlabel.hide();
451 sourceretrylabel.hide();
453 sourceargslabel.hide();
464 switch(theElement.fxStoreType.fiID)
467 console.log(
"showStepEditor WARNING: unknown event store id: "+theElement.fxStoreType.fiID);
468 case GO4.EvIOType.GO4EV_FILE:
469 storecomp.spinner(
"enable");
470 storetreeasf.spinner(
"enable");
471 storeover.prop(
'disabled',
false);
473 case GO4.EvIOType.GO4EV_BACK:
474 storecomp.spinner(
"disable");
475 storetreeasf.spinner(
"disable");
476 storeover.prop(
'disabled',
true);
482 sourcesel.selectmenu(
"option",
"width", sourcetable.width()*0.8);
483 sourcesel.selectmenu(
'refresh',
true);
485 storesel.selectmenu(
"option",
"width", storetable.width()*0.8);
486 storesel.selectmenu(
'refresh',
true);
489 pthis.css(
"padding",
"5px");
491 $(
id+
" .steptabs").tabs(
"refresh");
496 GO4.AnalysisStatusEditor.prototype.fillEditor =
function()
498 var
id =
"#" + this.get_main_id();
501 $(
id +
" .steptabs").tabs({
503 activate :
function(event, ui) {
508 load:
function(event, ui) {
513 var theIndex = ui.tab.index();
516 var theElement=editor.stat.fxStepArray.arr[theIndex];
522 var storetable=pthis.find(
" .step_store");
523 var sourcetable=pthis.find(
" .step_source");
524 var enablebox=pthis.find(
" .step_box_step_enab");
525 var sourcebox=pthis.find(
" .step_box_source_enab");
526 var storebox=pthis.find(
" .step_box_store_enab");
528 var sourcesel=pthis.find(
" .step_source_select");
529 var sourcemore=pthis.find(
" .step_source_expand");
530 var sourceform=pthis.find(
" .step_source_form");
531 var sourcename=pthis.find(
" .step_source_name");
532 var sourcetag=pthis.find(
" .step_source_tagfile");
533 var sourceport=pthis.find(
" .step_source_port");
534 var sourcetmout=pthis.find(
" .step_source_tmout");
535 var sourceretry=pthis.find(
" .step_source_retry");
536 var sourceargs=pthis.find(
" .step_source_args");
537 var sourcefirst=pthis.find(
" .step_source_firstev");
538 var sourcelast=pthis.find(
" .step_source_lastev");
539 var sourceskip=pthis.find(
" .step_source_stepev");
541 var storesel=pthis.find(
" .step_store_select");
542 var storename=pthis.find(
" .step_store_name");
543 var storesplit=pthis.find(
" .step_store_split");
544 var storebuf=pthis.find(
" .step_store_buf");
545 var storecomp=pthis.find(
" .step_store_comp");
546 var storetreeasf=pthis.find(
" .step_store_asf");
547 var storeover=pthis.find(
" .step_store_overwrite");
550 enablebox.prop(
'checked', theElement.fbProcessEnabled)
553 editor.MarkChanged(
"stepenabled", theIndex);
554 theElement.fbProcessEnabled=this.checked;
555 editor.showStepEditor(pthis, theElement, theIndex);
559 sourcebox.prop(
'checked', theElement.fbSourceEnabled)
562 editor.MarkChanged(
"sourceenabled", theIndex);
563 theElement.fbSourceEnabled=this.checked;
564 editor.showStepEditor(pthis, theElement, theIndex);
568 storebox.prop(
'checked', theElement.fbStoreEnabled)
571 editor.MarkChanged(
"storeenabled", theIndex);
572 theElement.fbStoreEnabled=this.checked;
573 editor.showStepEditor(pthis, theElement, theIndex);
577 sourcesel.selectmenu({
578 change :
function(event, ui) {
579 editor.MarkChanged(
"sourcesel",theIndex);
584 switch(Number(ui.item.value))
588 theElement.fxSourceType.fiID=
GO4.EvIOType.GO4EV_FILE;
591 theElement.fxSourceType.fiID=
GO4.EvIOType.GO4EV_MBS_STREAM;
594 theElement.fxSourceType.fiID=
GO4.EvIOType.GO4EV_MBS_TRANSPORT;
597 theElement.fxSourceType.fiID=
GO4.EvIOType.GO4EV_MBS_EVENTSERVER;
600 theElement.fxSourceType.fiID=
GO4.EvIOType.GO4EV_MBS_REVSERV;
603 theElement.fxSourceType.fiID=
GO4.EvIOType.GO4EV_MBS_RANDOM;
606 theElement.fxSourceType.fiID=
GO4.EvIOType.GO4EV_USER;
610 theElement.fxSourceType.fiID=
GO4.EvIOType.GO4EV_MBS_FILE;
616 theElement.fxSourceType.fName=sourcename.val();
617 theElement.fxSourceType.fiPort=sourceport.val();
618 theElement.fxSourceType.fiTimeout=sourcetmout.val();
619 theElement.fxSourceType.fiRetryCnt=sourceretry.val();
620 theElement.fxSourceType.fxTagFile=sourcetag.val();
621 theElement.fxSourceType.fuStartEvent=sourcefirst.val();
622 theElement.fxSourceType.fuStopEvent=sourcelast.val();
623 theElement.fxSourceType.fuEventInterval=sourceskip.val();
624 theElement.fxSourceType.fxExpression=sourceargs.val();
626 editor.showStepEditor(pthis, theElement, theIndex);
631 sourcemore.prop(
'checked', editor.showmore[theIndex]).click(
634 var doshow=$(
this).prop(
'checked');
636 editor.showmore[theIndex]=
true;
638 editor.showmore[theIndex]=
false;
640 editor.showStepEditor(pthis, theElement, theIndex);
644 sourcename.val(theElement.fxSourceType.fName);
652 event.preventDefault();
653 var content= sourcename[0].value;
654 content=content.trim();
655 editor.MarkChanged(
"sourcename",theIndex);
656 theElement.fxSourceType.fName=content;
657 console.log(
"Submitting sourcename form with: "+content);
676 stop:
function( event, ui ) {
677 editor.MarkChanged(
"sourceport",theIndex);
678 theElement.fxSourceType.fiPort=this.value;
683 sourcetmout.spinner({
687 stop:
function( event, ui ) {
688 editor.MarkChanged(
"sourcetmout",theIndex);
689 theElement.fxSourceType.fiTimeout=this.value;
695 sourceretry.spinner({
699 stop:
function( event, ui ) {
700 editor.MarkChanged(
"sourceretry",theIndex);
701 theElement.fxSourceType.fiRetryCnt=this.value;
706 sourcefirst.spinner({
710 stop:
function( event, ui ) {
711 editor.MarkChanged(
"sourcefirst",theIndex);
712 theElement.fxSourceType.fuStartEvent=this.value;
720 stop:
function( event, ui ) {
721 editor.MarkChanged(
"sourcelast",theIndex);
722 theElement.fxSourceType.fuStopEvent=this.value;
730 stop:
function( event, ui ) {
731 editor.MarkChanged(
"sourceskip",theIndex);
732 theElement.fxSourceType.fuEventInterval=this.value;
737 storesel.selectmenu({
738 change :
function(event, ui) {
739 editor.MarkChanged(
"storesel",theIndex);
742 switch(Number(ui.item.value))
747 theElement.fxStoreType.fiID=
GO4.EvIOType.GO4EV_FILE;
750 theElement.fxStoreType.fiID=
GO4.EvIOType.GO4EV_BACK;
753 theElement.fxStoreType.fName=storename.val();
754 theElement.fxStoreType.fiSplit=storesplit.val();
755 theElement.fxStoreType.fiBufsize=storebuf.val()* 1000.;
756 theElement.fxStoreType.fiCompression=storecomp.val();
757 theElement.fxStoreType.fiAutosavesize=storetreeasf.val();
761 editor.showStepEditor(pthis, theElement, theIndex);
768 storename.val(theElement.fxStoreType.fName)
770 editor.MarkChanged(
"storename",theIndex);
771 theElement.fxStoreType.fName=this.value.trim();
779 stop:
function( event, ui ) {
780 editor.MarkChanged(
"storesplit",theIndex);
781 theElement.fxStoreType.fiSplit=this.value;
789 stop:
function( event, ui ) {
790 editor.MarkChanged(
"storebuf",theIndex);
791 theElement.fxStoreType.fiBufsize=this.value * 1000;
799 stop:
function( event, ui ) {
800 editor.MarkChanged(
"storecomp",theIndex);
801 theElement.fxStoreType.fiCompression=this.value;
804 storetreeasf.spinner({
808 stop:
function( event, ui ) {
809 editor.MarkChanged(
"storeasf",theIndex);
810 theElement.fxStoreType.fiAutosavesize=this.value;
814 storeover.click(
function() {
815 editor.MarkChanged(
"storeover",theIndex);
816 theElement.fxStoreType.fbOverwrite=this.checked;
826 switch(theElement.fxSourceType.fiID)
828 case GO4.EvIOType.GO4EV_FILE:
831 case GO4.EvIOType.GO4EV_MBS_STREAM:
833 sourceport.val(theElement.fxSourceType.fiPort);
834 sourcetmout.val(theElement.fxSourceType.fiTimeout);
835 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
836 sourcetag.text(theElement.fxSourceType.fxTagFile);
837 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
838 sourcelast.val(theElement.fxSourceType.fuStopEvent);
839 sourceskip.val(theElement.fxSourceType.fuEventInterval);
841 case GO4.EvIOType.GO4EV_MBS_TRANSPORT:
843 sourceport.val(theElement.fxSourceType.fiPort);
844 sourcetmout.val(theElement.fxSourceType.fiTimeout);
845 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
846 sourcetag.text(theElement.fxSourceType.fxTagFile);
847 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
848 sourcelast.val(theElement.fxSourceType.fuStopEvent);
849 sourceskip.val(theElement.fxSourceType.fuEventInterval);
851 case GO4.EvIOType.GO4EV_MBS_EVENTSERVER:
853 sourceport.val(theElement.fxSourceType.fiPort);
854 sourcetmout.val(theElement.fxSourceType.fiTimeout);
855 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
856 sourcetag.text(theElement.fxSourceType.fxTagFile);
857 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
858 sourcelast.val(theElement.fxSourceType.fuStopEvent);
859 sourceskip.val(theElement.fxSourceType.fuEventInterval);
861 case GO4.EvIOType.GO4EV_MBS_REVSERV:
863 sourceport.val(theElement.fxSourceType.fiPort);
864 sourcetmout.val(theElement.fxSourceType.fiTimeout);
865 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
866 sourcetag.text(theElement.fxSourceType.fxTagFile);
867 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
868 sourcelast.val(theElement.fxSourceType.fuStopEvent);
869 sourceskip.val(theElement.fxSourceType.fuEventInterval);
871 case GO4.EvIOType.GO4EV_MBS_RANDOM:
874 case GO4.EvIOType.GO4EV_USER:
876 sourceport.val(theElement.fxSourceType.fiPort);
877 sourcetmout.val(theElement.fxSourceType.fiTimeout);
878 sourceargs.text(theElement.fxSourceType.fxExpression);
881 console.log(
"WARNING: unknown event source id: "+theElement.fiID);
882 case GO4.EvIOType.GO4EV_MBS_FILE:
884 sourcetag.text(theElement.fxSourceType.fxTagFile);
885 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
886 sourcelast.val(theElement.fxSourceType.fuStopEvent);
887 sourceskip.val(theElement.fxSourceType.fuEventInterval);
891 sourcesel.selectmenu(
'refresh',
true);
895 storesplit.val(theElement.fxStoreType.fiSplit);
896 storebuf.val(theElement.fxStoreType.fiBufsize / 1000);
897 storecomp.val(theElement.fxStoreType.fiCompression);
898 storetreeasf.val(theElement.fxStoreType.fiAutosavesize);
902 switch(theElement.fxStoreType.fiID)
905 case GO4.EvIOType.GO4EV_BACK:
908 case GO4.EvIOType.GO4EV_FILE:
909 storeover.prop(
'checked', theElement.fxStoreType.fbOverwrite);
915 storesel.selectmenu(
'refresh',
true);
917 editor.showStepEditor(pthis, theElement, theIndex);
929 $(
id+
" .buttonGetAnalysis")
930 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
932 if (
JSROOT.hpainter)
JSROOT.hpainter.display(editor.getItemName());
933 else console.log(
"dabc object not found!");
936 .css(
'background-image',
"url(" +
GO4.source_dir +
"icons/right.png)");
940 $(
id+
" .buttonSetAnalysis")
941 .button({text:
true, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
944 options=editor.EvaluateChanges(options);
945 console.log(
"submit analysis "+ editor.getItemName()+
", options="+options);
946 GO4.ExecuteMethod(editor,
"UpdateFromUrl",options,
function(result) {
947 console.log(result ?
"setting analyis configuration done. " :
"set analysis FAILED.");
949 editor.ClearChanges();
950 if (
JSROOT.hpainter && (typeof
JSROOT.hpainter.reload ==
'function'))
JSROOT.hpainter.reload();
955 .css(
'background-image',
"url(" +
GO4.source_dir +
"icons/left.png)");
958 $(
id+
" .buttonAnaChangeLabel")
959 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
961 .css(
'background-image',
"url(" +
GO4.source_dir +
"icons/info1.png)");
964 $(
id+
" .buttonSetStartAnalysis")
965 .button({text:
true, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
968 options=editor.EvaluateChanges(options);
970 console.log(
"submit and start analysis "+ editor.getItemName()+
", options="+options);
971 GO4.ExecuteMethod(editor,
"UpdateFromUrl",options,
function(result) {
972 console.log(result ?
"submit and start analyis configuration done. " :
"set analysis FAILED.");
974 editor.ClearChanges();
975 if (
JSROOT.hpainter && (typeof
JSROOT.hpainter.reload ==
'function'))
JSROOT.hpainter.reload();
982 .css(
'background-image',
"url(" +
GO4.source_dir +
"icons/start.png)");
985 $(
id+
" .buttonCloseAnalysis")
986 .button({text:
true, icons: { primary:
"ui-icon-closethick MyButtonStyle"}})
988 var options=
"&close";
990 console.log(
"close analysis "+ editor.getItemName()+
", options="+options);
991 GO4.ExecuteMethod(editor,
"UpdateFromUrl",options,
function(
993 console.log(result ?
"closing down analyis done. "
994 :
"set analysis FAILED.");
1002 $(
id+
" .buttonSaveAnaASF")
1003 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1005 .css(
'background-image',
"url(" +
GO4.source_dir +
"icons/filesave.png)");
1008 $(
id +
" .anaASF_form").submit(
1011 var content= $(
id +
" .anaASF_name")[0].value;
1012 content=content.trim();
1014 editor.MarkChanged(
"asfname",0);
1015 editor.stat.fxAutoFileName=content;
1016 var requestmsg =
"Really Write autosave file : "+ content;
1017 var response = confirm(requestmsg);
1019 event.preventDefault();
1023 console.log(
"Writing autosave file: "+content);
1024 var options=
"&saveasf="+content;
1025 GO4.ExecuteMethod(editor,
"UpdateFromUrl",options,
function(result) {
1026 console.log(result ?
"Writing autosave file done. " :
"Writing autosave file FAILED.");
1028 event.preventDefault();
1033 $(
id +
" .anaASF_time").spinner({
1037 stop:
function( event, ui ) {
1039 editor.MarkChanged(
"asftime",0);
1040 editor.stat.fiAutoSaveInterval=this.value;
1045 $(
id +
" .anaASF_compression").spinner({
1049 stop:
function( event, ui ) {
1050 editor.MarkChanged(
"asfcomp",0);
1051 editor.stat.fiAutoSaveCompression=this.value;
1057 $(
id+
" .buttonSaveAnaConf")
1058 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1060 .css(
'background-image',
"url(" +
GO4.source_dir +
"icons/filesave.png)");
1062 $(
id+
" .buttonLoadAnaConf")
1063 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1065 var content= $(
id +
" .anaprefs_name")[0].value;
1066 content=content.trim();
1067 var requestmsg =
"Really load analysis preferences: "+ content;
1068 var response = confirm(requestmsg);
1069 if (!response)
return;
1070 console.log(
"Loading analysis Prefs from "+content);
1071 var options=
"&loadprefs="+content;
1072 GO4.ExecuteMethod(editor,
"UpdateFromUrl",options,
function(result) {
1074 if (
JSROOT.hpainter)
JSROOT.hpainter.display(editor.getItemName());
1075 else console.log(
"dabc object not found!");
1077 console.log(
"Loading preferences " + (result ?
"done" :
"FAILED."));
1081 .css(
'background-image',
"url(" +
GO4.source_dir +
"icons/fileopen.png)");
1084 $(
id +
" .anaprefs_form").submit(
1086 event.preventDefault();
1087 var content= $(
id +
" .anaprefs_name")[0].value;
1088 content=content.trim();
1091 editor.MarkChanged(
"anaprefsname",0);
1092 editor.stat.fxConfigFileName=content;
1093 var requestmsg =
"Really save analysis preferences: "+ content;
1094 var response = confirm(requestmsg);
1095 if (!response)
return;
1096 console.log(
"Saving analysis Prefs to "+content);
1097 var options=
"&saveprefs="+content;
1098 GO4.ExecuteMethod(editor,
"UpdateFromUrl",options,
function(result) {
1099 console.log(result ?
"Saving preferences done. " :
"Saving preferences FAILED.");
1103 this.refreshEditor();
1106 GO4.AnalysisStatusEditor.prototype.drawEditor =
function(jqmain, resolve) {
1111 jqmain.load(
GO4.source_dir +
"html/analysiseditor.htm",
"",
function() {
1113 for (var i=0;i<8;i++)
1114 html+=
'<li><a href="'+ GO4.source_dir +
'html/stepeditor.htm">Step ' + i +
'</a></li>';
1116 jqmain.find(
".steptabs").html(html);
1119 pthis.setTopPainter();
1122 pthis.SetDivId(this.divid);
1123 pthis.DrawingReady();
1130 GO4.AnalysisStatusEditor.prototype.redrawObject =
function(obj ) {
1131 if (obj._typename !=
this.stat._typename)
return false;
1132 this.stat =
JSROOT.clone(obj);
1133 this.refreshEditor();
1138 GO4.AnalysisStatusEditor.prototype.RedrawPad =
function(resize) {
1139 this.refreshEditor();
1142 GO4.AnalysisStatusEditor.prototype.UpdateObject =
function(obj) {
1143 if (obj._typename !=
this.stat._typename)
return false;
1144 this.stat =
JSROOT.clone(obj);
1149 GO4.drawGo4AnalysisStatus =
function(divid, stat, option) {
1150 var status =
new GO4.AnalysisStatusEditor(divid, stat);
1151 var realid = status.get_main_id();
1152 var jqmain = $(
"#"+realid);
1153 var h = jqmain.height(), w = jqmain.width();
1154 if ((h<10) && (w>10)) jqmain.height(w*0.7);
1156 if (
JSROOT._)
return new Promise(resolve => status.drawEditor(jqmain, resolve));
1158 return status.drawEditor(jqmain);