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";
31 GO4.AnalysisStatusEditor =
function(stat) {
32 JSROOT.TBasePainter.call(
this, stat);
35 this.changes = [[
"dummy0",
"init0"],[
"dummy1",
"init1"]];
36 this.showmore= [
false,
false];
38 this.ClearShowstates();
42 GO4.AnalysisStatusEditor.prototype = Object.create(JSROOT.TBasePainter.prototype);
44 GO4.AnalysisStatusEditor.prototype.DabcCommand =
function(cmd, option, callback) {
46 if (this.GetItemName()!=
"") {
47 pre = this.GetItemName() +
"/";
50 pre +=
"exe.json\?method=";
51 var fullcom = pre + cmd + option;
53 JSROOT.NewHttpRequest(fullcom,
'text',
function(res) {
54 console.log(
"DabcCommand completed.");
59 GO4.AnalysisStatusEditor.prototype.MarkChanged =
function(key, step) {
63 for (index = 0; index < this.changes[step].length; index++) {
64 if (this.changes[step][index]== key)
return;
66 this.changes[step].push(key);
67 console.log(
"Mark changed :%s at step %d", key, step);
68 var
id =
"#"+this.divid;
70 $(
id+
" .buttonAnaChangeLabel").show();
74 GO4.AnalysisStatusEditor.prototype.ClearChanges =
function() {
76 var numsteps=this.changes.length;
77 for (step = 0; step < numsteps ; step++) {
78 var len=this.changes[step].length;
79 for (index = 0; index < len ; index++) {
80 var removed=this.changes[step].pop();
84 var
id =
"#"+this.divid;
85 $(
id+
" .buttonAnaChangeLabel").hide();
89 GO4.AnalysisStatusEditor.prototype.ClearShowstates =
function() {
91 var len=this.showmore.length;
92 for (index = 0; index < len ; index++) {
93 var removed=this.showmore.pop();
94 console.log(
"ClearShowstates removed :%s", removed);
99 GO4.AnalysisStatusEditor.prototype.EvaluateChanges =
function(optionstring) {
100 var
id =
"#"+this.divid;
103 var numsteps=this.changes.length;
104 for (step = 0; step < numsteps ; step++) {
105 var len=this.changes[step].length;
107 for (index = 0; index < len ; index++) {
109 var key=this.changes[step][index];
112 var theElement=editor.stat.fxStepArray.arr[step];
114 if(key==
"stepenabled")
116 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbProcessEnabled;
118 else if(key==
"sourceenabled")
120 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbSourceEnabled;
122 else if(key==
"storeenabled")
124 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fbStoreEnabled;
126 else if(key==
"sourcesel")
128 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiID;
130 else if(key==
"sourcename")
132 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fName;
134 else if(key==
"sourceport")
136 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiPort;
138 else if(key==
"sourcetmout")
140 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiTimeout;
142 else if(key==
"sourceretry")
144 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fiRetryCnt;
146 else if(key==
"sourcefirst")
148 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuStartEvent;
150 else if(key==
"sourcelast")
152 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuStopEvent;
154 else if(key==
"sourceskip")
156 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxSourceType.fuEventInterval;
158 else if(key==
"storesel")
160 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiID;
162 else if(key==
"storename")
164 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fName;
166 else if(key==
"storesplit")
168 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiSplit;
170 else if(key==
"storebuf")
172 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiBufsize;
174 else if(key==
"storecomp")
176 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiCompression;
178 else if(key==
"storeasf")
180 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fiAutosavesize;
182 else if(key==
"storeover")
184 stepoptions+=
"&"+key+
"_"+step+
"="+theElement.fxStoreType.fbOverwrite;
188 else if(key==
"asfname")
190 stepoptions+=
"&"+key+
"="+editor.stat.fxAutoFileName;
193 else if(key==
"asfenabled")
195 stepoptions+=
"&"+key+
"="+editor.stat.fbAutoSaveOn;
198 else if(key==
"asftime")
200 stepoptions+=
"&"+key+
"="+editor.stat.fiAutoSaveInterval;
202 else if(key==
"asfcomp")
204 stepoptions+=
"&"+key+
"="+editor.stat.fiAutoSaveCompression;
206 else if(key==
"asfoverwrite")
208 stepoptions+=
"&"+key+
"="+editor.stat.fbAutoSaveOverwrite;
210 else if(key==
"anaprefsname")
212 stepoptions+=
"&"+key+
"="+editor.stat.fxConfigFileName;
216 console.log(
"Warning: EvaluateChanges found unknown key:%s", key);
224 optionstring+=stepoptions;
226 console.log(
"Resulting option string:%s", optionstring);
237 GO4.AnalysisStatusEditor.prototype.refreshEditor =
function()
239 var
id =
"#"+this.divid;
245 this.ClearShowstates();
246 var tabelement=$(
id+
" .steptabs");
247 tabelement.tabs(
"option",
"disabled", [0, 1, 2, 3, 4, 5, 6, 7] );
248 for(var j=0; j<8;++j){
249 $(
id +
" .steptabs ul:first li:eq("+ j +
")").hide();
251 stat.fxStepArray.arr.forEach(
function(element, index, array) {
252 tabelement.tabs(
"enable",index);
253 $(
id +
" .steptabs ul:first li:eq("+index+
") a").text(element.fName);
254 $(
id +
" .steptabs ul:first li:eq("+index+
")").show();
255 editor.showmore.push(
false);
257 tabelement.tabs(
"load",index);
264 $(
id +
" .anaASF_name").val(stat.fxAutoFileName);
265 $(
id+
" .anaASF_enabled")
266 .prop(
'checked', stat.fbAutoSaveOn)
268 editor.MarkChanged(
"asfenabled",0);
269 editor.stat.fbAutoSaveOn=this.checked;
273 $(
id +
" .anaASF_time").val(stat.fiAutoSaveInterval);
274 $(
id +
" .anaASF_compression").val(stat.fiAutoSaveCompression);
276 $(
id+
" .anaASF_overwrite")
277 .prop(
'checked', stat.fbAutoSaveOverwrite)
279 editor.MarkChanged(
"asfoverwrite",0);
280 editor.stat.fbAutoSaveOverwrite= this.checked;
284 $(
id +
" .anaprefs_name").val(stat.fxConfigFileName);
288 editor.ClearChanges();
293 GO4.AnalysisStatusEditor.prototype.showStepEditor =
function(pthis, theElement, theIndex)
296 var
id =
"#"+this.divid;
298 var showmore=editor.showmore[theIndex];
300 var storetable=pthis.find(
" .step_store");
301 var sourcetable=pthis.find(
" .step_source");
302 var enablebox=pthis.find(
" .step_box_step_enab");
303 var sourcebox=pthis.find(
" .step_box_source_enab");
304 var storebox=pthis.find(
" .step_box_store_enab");
306 var sourcesel=pthis.find(
" .step_source_select");
307 var sourcemore=pthis.find(
" .step_source_expand");
308 var sourceform=pthis.find(
" .step_source_form");
309 var sourcename=pthis.find(
" .step_source_name");
310 var sourcenamelabel=pthis.find(
" .step_source_name_label");
311 var sourcetag=pthis.find(
" .step_source_tagfile");
312 var sourcetaglabel=pthis.find(
" .step_source_tagfile_label");
313 var sourceport=pthis.find(
" .step_source_port");
314 var sourceportlabel=pthis.find(
" .step_source_port_label");
315 var sourcetmout=pthis.find(
" .step_source_tmout");
316 var sourcetmoutlabel=pthis.find(
" .step_source_tmout_label");
317 var sourceretry=pthis.find(
" .step_source_retry");
318 var sourceretrylabel=pthis.find(
" .step_source_retry_label");
319 var sourceargs=pthis.find(
" .step_source_args");
320 var sourceargslabel=pthis.find(
" .step_source_args_label");
321 var sourcefirst=pthis.find(
" .step_source_firstev");
322 var sourcefirstlabel=pthis.find(
" .step_source_firstev_label");
323 var sourcelast=pthis.find(
" .step_source_lastev");
324 var sourcelastlabel=pthis.find(
" .step_source_lastev_label");
325 var sourceskip=pthis.find(
" .step_source_stepev");
326 var sourceskiplabel=pthis.find(
" .step_source_stepev_label");
328 var storesel=pthis.find(
" .step_store_select");
329 var storename=pthis.find(
" .step_store_name");
330 var storesplit=pthis.find(
" .step_store_split");
331 var storebuf=pthis.find(
" .step_store_buf");
332 var storecomp=pthis.find(
" .step_store_comp");
333 var storetreeasf=pthis.find(
" .step_store_asf");
334 var storeover=pthis.find(
" .step_store_overwrite");
337 if (theElement.fbProcessEnabled) {
338 sourcebox.prop(
'disabled',
false);
339 storebox.prop(
'disabled',
false);
340 if (theElement.fbSourceEnabled) {
345 if (theElement.fbStoreEnabled) {
351 sourcebox.prop(
'disabled',
true);
352 storebox.prop(
'disabled',
true);
363 switch(theElement.fxSourceType.fiID)
365 case GO4.EvIOType.GO4EV_FILE:
366 case GO4.EvIOType.GO4EV_MBS_RANDOM:
368 sourceportlabel.hide();
370 sourcetmoutlabel.hide();
372 sourceretrylabel.hide();
374 sourcetaglabel.hide();
376 sourcefirstlabel.hide();
378 sourcelastlabel.hide()
380 sourceskiplabel.hide();
382 sourceargslabel.hide();
384 case GO4.EvIOType.GO4EV_MBS_STREAM:
385 case GO4.EvIOType.GO4EV_MBS_TRANSPORT:
386 case GO4.EvIOType.GO4EV_MBS_EVENTSERVER:
387 case GO4.EvIOType.GO4EV_MBS_REVSERV:
391 sourceportlabel.show();
393 sourcetmoutlabel.show();
395 sourceretrylabel.show();
397 sourcefirstlabel.show();
399 sourcelastlabel.show();
401 sourceskiplabel.show();
406 sourceportlabel.hide();
408 sourcetmoutlabel.hide();
410 sourceretrylabel.hide();
412 sourcefirstlabel.hide();
414 sourcelastlabel.hide();
416 sourceskiplabel.hide();
419 sourcetaglabel.hide();
421 sourceargslabel.hide();
425 case GO4.EvIOType.GO4EV_USER:
429 sourceportlabel.show();
431 sourcetmoutlabel.show();
433 sourceargslabel.show();
438 sourceportlabel.hide();
440 sourcetmoutlabel.hide();
442 sourceargslabel.hide();
445 sourceretrylabel.hide();
447 sourcetaglabel.hide();
449 sourcefirstlabel.hide();
451 sourcelastlabel.hide();
453 sourceskiplabel.hide();
456 console.log(
"showStepEditor WARNING: unknown event source id: "+theElement.fxSourceType.fiID);
457 case GO4.EvIOType.GO4EV_MBS_FILE:
461 sourcetaglabel.show();
463 sourcefirstlabel.show();
465 sourcelastlabel.show();
467 sourceskiplabel.show();
472 sourcetaglabel.hide();
474 sourcefirstlabel.hide();
476 sourcelastlabel.hide();
478 sourceskiplabel.hide();
481 sourceportlabel.hide();
483 sourcetmoutlabel.hide();
485 sourceretrylabel.hide();
487 sourceargslabel.hide();
498 switch(theElement.fxStoreType.fiID)
501 console.log(
"showStepEditor WARNING: unknown event store id: "+theElement.fxStoreType.fiID);
502 case GO4.EvIOType.GO4EV_FILE:
503 storecomp.spinner(
"enable");
504 storetreeasf.spinner(
"enable");
505 storeover.prop(
'disabled',
false);
507 case GO4.EvIOType.GO4EV_BACK:
508 storecomp.spinner(
"disable");
509 storetreeasf.spinner(
"disable");
510 storeover.prop(
'disabled',
true);
516 sourcesel.selectmenu(
"option",
"width", sourcetable.width()*0.8);
517 sourcesel.selectmenu(
'refresh',
true);
519 storesel.selectmenu(
"option",
"width", storetable.width()*0.8);
520 storesel.selectmenu(
'refresh',
true);
523 pthis.css(
"padding",
"5px");
525 $(
id+
" .steptabs").tabs(
"refresh");
530 GO4.AnalysisStatusEditor.prototype.fillEditor =
function()
532 var
id =
"#"+this.divid;
535 $(
id +
" .steptabs").tabs({
537 activate :
function(event, ui) {
542 load:
function(event, ui) {
547 var theIndex = ui.tab.index();
550 var theElement=editor.stat.fxStepArray.arr[theIndex];
556 var storetable=pthis.find(
" .step_store");
557 var sourcetable=pthis.find(
" .step_source");
558 var enablebox=pthis.find(
" .step_box_step_enab");
559 var sourcebox=pthis.find(
" .step_box_source_enab");
560 var storebox=pthis.find(
" .step_box_store_enab");
562 var sourcesel=pthis.find(
" .step_source_select");
563 var sourcemore=pthis.find(
" .step_source_expand");
564 var sourceform=pthis.find(
" .step_source_form");
565 var sourcename=pthis.find(
" .step_source_name");
566 var sourcetag=pthis.find(
" .step_source_tagfile");
567 var sourceport=pthis.find(
" .step_source_port");
568 var sourcetmout=pthis.find(
" .step_source_tmout");
569 var sourceretry=pthis.find(
" .step_source_retry");
570 var sourceargs=pthis.find(
" .step_source_args");
571 var sourcefirst=pthis.find(
" .step_source_firstev");
572 var sourcelast=pthis.find(
" .step_source_lastev");
573 var sourceskip=pthis.find(
" .step_source_stepev");
575 var storesel=pthis.find(
" .step_store_select");
576 var storename=pthis.find(
" .step_store_name");
577 var storesplit=pthis.find(
" .step_store_split");
578 var storebuf=pthis.find(
" .step_store_buf");
579 var storecomp=pthis.find(
" .step_store_comp");
580 var storetreeasf=pthis.find(
" .step_store_asf");
581 var storeover=pthis.find(
" .step_store_overwrite");
584 enablebox.prop(
'checked', theElement.fbProcessEnabled)
587 editor.MarkChanged(
"stepenabled", theIndex);
588 theElement.fbProcessEnabled=this.checked;
589 editor.showStepEditor(pthis, theElement, theIndex);
593 sourcebox.prop(
'checked', theElement.fbSourceEnabled)
596 editor.MarkChanged(
"sourceenabled", theIndex);
597 theElement.fbSourceEnabled=this.checked;
598 editor.showStepEditor(pthis, theElement, theIndex);
602 storebox.prop(
'checked', theElement.fbStoreEnabled)
605 editor.MarkChanged(
"storeenabled", theIndex);
606 theElement.fbStoreEnabled=this.checked;
607 editor.showStepEditor(pthis, theElement, theIndex);
611 sourcesel.selectmenu({
612 change :
function(event, ui) {
613 editor.MarkChanged(
"sourcesel",theIndex);
618 switch(Number(ui.item.value))
622 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_FILE;
625 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_STREAM;
628 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_TRANSPORT;
631 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_EVENTSERVER;
634 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_REVSERV;
637 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_RANDOM;
640 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_USER;
644 theElement.fxSourceType.fiID=GO4.EvIOType.GO4EV_MBS_FILE;
650 theElement.fxSourceType.fName=sourcename.val();
651 theElement.fxSourceType.fiPort=sourceport.val();
652 theElement.fxSourceType.fiTimeout=sourcetmout.val();
653 theElement.fxSourceType.fiRetryCnt=sourceretry.val();
654 theElement.fxSourceType.fxTagFile=sourcetag.val();
655 theElement.fxSourceType.fuStartEvent=sourcefirst.val();
656 theElement.fxSourceType.fuStopEvent=sourcelast.val();
657 theElement.fxSourceType.fuEventInterval=sourceskip.val();
658 theElement.fxSourceType.fxExpression=sourceargs.val();
660 editor.showStepEditor(pthis, theElement, theIndex);
665 sourcemore.prop(
'checked', editor.showmore[theIndex]).click(
668 var doshow=$(
this).prop(
'checked');
670 editor.showmore[theIndex]=
true;
672 editor.showmore[theIndex]=
false;
674 editor.showStepEditor(pthis, theElement, theIndex);
678 sourcename.val(theElement.fxSourceType.fName);
686 event.preventDefault();
687 var content= sourcename[0].value;
688 content=content.trim();
689 editor.MarkChanged(
"sourcename",theIndex);
690 theElement.fxSourceType.fName=content;
691 console.log(
"Submitting sourcename form with: "+content);
710 stop:
function( event, ui ) {
711 editor.MarkChanged(
"sourceport",theIndex);
712 theElement.fxSourceType.fiPort=this.value;
717 sourcetmout.spinner({
721 stop:
function( event, ui ) {
722 editor.MarkChanged(
"sourcetmout",theIndex);
723 theElement.fxSourceType.fiTimeout=this.value;
729 sourceretry.spinner({
733 stop:
function( event, ui ) {
734 editor.MarkChanged(
"sourceretry",theIndex);
735 theElement.fxSourceType.fiRetryCnt=this.value;
740 sourcefirst.spinner({
744 stop:
function( event, ui ) {
745 editor.MarkChanged(
"sourcefirst",theIndex);
746 theElement.fxSourceType.fuStartEvent=this.value;
754 stop:
function( event, ui ) {
755 editor.MarkChanged(
"sourcelast",theIndex);
756 theElement.fxSourceType.fuStopEvent=this.value;
764 stop:
function( event, ui ) {
765 editor.MarkChanged(
"sourceskip",theIndex);
766 theElement.fxSourceType.fuEventInterval=this.value;
771 storesel.selectmenu({
772 change :
function(event, ui) {
773 editor.MarkChanged(
"storesel",theIndex);
776 switch(Number(ui.item.value))
781 theElement.fxStoreType.fiID=GO4.EvIOType.GO4EV_FILE;
784 theElement.fxStoreType.fiID=GO4.EvIOType.GO4EV_BACK;
787 theElement.fxStoreType.fName=storename.val();
788 theElement.fxStoreType.fiSplit=storesplit.val();
789 theElement.fxStoreType.fiBufsize=storebuf.val()* 1000.;
790 theElement.fxStoreType.fiCompression=storecomp.val();
791 theElement.fxStoreType.fiAutosavesize=storetreeasf.val();
795 editor.showStepEditor(pthis, theElement, theIndex);
802 storename.val(theElement.fxStoreType.fName)
804 editor.MarkChanged(
"storename",theIndex);
805 theElement.fxStoreType.fName=this.value.trim();
813 stop:
function( event, ui ) {
814 editor.MarkChanged(
"storesplit",theIndex);
815 theElement.fxStoreType.fiSplit=this.value;
823 stop:
function( event, ui ) {
824 editor.MarkChanged(
"storebuf",theIndex);
825 theElement.fxStoreType.fiBufsize=this.value * 1000;
833 stop:
function( event, ui ) {
834 editor.MarkChanged(
"storecomp",theIndex);
835 theElement.fxStoreType.fiCompression=this.value;
838 storetreeasf.spinner({
842 stop:
function( event, ui ) {
843 editor.MarkChanged(
"storeasf",theIndex);
844 theElement.fxStoreType.fiAutosavesize=this.value;
848 storeover.click(
function() {
849 editor.MarkChanged(
"storeover",theIndex);
850 theElement.fxStoreType.fbOverwrite=this.checked;
860 switch(theElement.fxSourceType.fiID)
862 case GO4.EvIOType.GO4EV_FILE:
865 case GO4.EvIOType.GO4EV_MBS_STREAM:
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_TRANSPORT:
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_EVENTSERVER:
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_REVSERV:
897 sourceport.val(theElement.fxSourceType.fiPort);
898 sourcetmout.val(theElement.fxSourceType.fiTimeout);
899 sourceretry.val(theElement.fxSourceType.fiRetryCnt);
900 sourcetag.text(theElement.fxSourceType.fxTagFile);
901 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
902 sourcelast.val(theElement.fxSourceType.fuStopEvent);
903 sourceskip.val(theElement.fxSourceType.fuEventInterval);
905 case GO4.EvIOType.GO4EV_MBS_RANDOM:
908 case GO4.EvIOType.GO4EV_USER:
910 sourceport.val(theElement.fxSourceType.fiPort);
911 sourcetmout.val(theElement.fxSourceType.fiTimeout);
912 sourceargs.text(theElement.fxSourceType.fxExpression);
915 console.log(
"WARNING: unknown event source id: "+theElement.fiID);
916 case GO4.EvIOType.GO4EV_MBS_FILE:
918 sourcetag.text(theElement.fxSourceType.fxTagFile);
919 sourcefirst.val(theElement.fxSourceType.fuStartEvent);
920 sourcelast.val(theElement.fxSourceType.fuStopEvent);
921 sourceskip.val(theElement.fxSourceType.fuEventInterval);
925 sourcesel.selectmenu(
'refresh',
true);
929 storesplit.val(theElement.fxStoreType.fiSplit);
930 storebuf.val(theElement.fxStoreType.fiBufsize / 1000);
931 storecomp.val(theElement.fxStoreType.fiCompression);
932 storetreeasf.val(theElement.fxStoreType.fiAutosavesize);
936 switch(theElement.fxStoreType.fiID)
939 case GO4.EvIOType.GO4EV_BACK:
942 case GO4.EvIOType.GO4EV_FILE:
943 storeover.prop(
'checked', theElement.fxStoreType.fbOverwrite);
949 storesel.selectmenu(
'refresh',
true);
951 editor.showStepEditor(pthis, theElement, theIndex);
963 $(
id+
" .buttonGetAnalysis")
964 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
966 if (JSROOT.hpainter) JSROOT.hpainter.display(editor.GetItemName());
967 else console.log(
"dabc object not found!");
970 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/right.png)");
974 $(
id+
" .buttonSetAnalysis")
975 .button({text:
true, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
978 options=editor.EvaluateChanges(options);
979 console.log(
"submit analysis "+ editor.GetItemName()+
", options="+options);
980 editor.DabcCommand(
"UpdateFromUrl",options,
function(result) {
981 console.log(result ?
"setting analyis configuration done. " :
"set analysis FAILED.");
983 editor.ClearChanges();
984 if ((JSROOT.hpainter != null) && (
'reload' in JSROOT.hpainter)) JSROOT.hpainter.reload();
989 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/left.png)");
992 $(
id+
" .buttonAnaChangeLabel")
993 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
995 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/info1.png)");
998 $(
id+
" .buttonSetStartAnalysis")
999 .button({text:
true, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1002 options=editor.EvaluateChanges(options);
1004 console.log(
"submit and start analysis "+ editor.GetItemName()+
", options="+options);
1005 editor.DabcCommand(
"UpdateFromUrl",options,
function(result) {
1006 console.log(result ?
"submit and start analyis configuration done. " :
"set analysis FAILED.");
1008 editor.ClearChanges();
1009 if ((JSROOT.hpainter != null) && (
'reload' in JSROOT.hpainter)) JSROOT.hpainter.reload();
1016 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/start.png)");
1019 $(
id+
" .buttonCloseAnalysis")
1020 .button({text:
true, icons: { primary:
"ui-icon-closethick MyButtonStyle"}}).click(
function() {
1021 var options=
"&close";
1023 console.log(
"close analysis "+ editor.GetItemName()+
", options="+options);
1024 editor.DabcCommand(
"UpdateFromUrl",options,
function(
1026 console.log(result ?
"closing down analyis done. "
1027 :
"set analysis FAILED.");
1035 $(
id+
" .buttonSaveAnaASF")
1036 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1038 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/filesave.png)");
1041 $(
id +
" .anaASF_form").submit(
1044 var content= $(
id +
" .anaASF_name")[0].value;
1045 content=content.trim();
1047 editor.MarkChanged(
"asfname",0);
1048 editor.stat.fxAutoFileName=content;
1049 var requestmsg =
"Really Write autosave file : "+ content;
1050 var response = confirm(requestmsg);
1052 event.preventDefault();
1056 console.log(
"Writing autosave file: "+content);
1057 var options=
"&saveasf="+content;
1058 editor.DabcCommand(
"UpdateFromUrl",options,
function(
1060 console.log(result ?
"Writing autosave file done. "
1061 :
"Writing autosave file FAILED.");
1063 event.preventDefault();
1068 $(
id +
" .anaASF_time").spinner({
1072 stop:
function( event, ui ) {
1074 editor.MarkChanged(
"asftime",0);
1075 editor.stat.fiAutoSaveInterval=this.value;
1080 $(
id +
" .anaASF_compression").spinner({
1084 stop:
function( event, ui ) {
1085 editor.MarkChanged(
"asfcomp",0);
1086 editor.stat.fiAutoSaveCompression=this.value;
1092 $(
id+
" .buttonSaveAnaConf")
1093 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1095 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/filesave.png)");
1097 $(
id+
" .buttonLoadAnaConf")
1098 .button({text:
false, icons: { primary:
"ui-icon-blank MyButtonStyle"}})
1100 var content= $(
id +
" .anaprefs_name")[0].value;
1101 content=content.trim();
1102 var requestmsg =
"Really load analysis preferences: "+ content;
1103 var response = confirm(requestmsg);
1104 if (!response)
return;
1105 console.log(
"Loading analysis Prefs from "+content);
1106 var options=
"&loadprefs="+content;
1107 editor.DabcCommand(
"UpdateFromUrl",options,
function(result) {
1109 if (JSROOT.hpainter) JSROOT.hpainter.display(editor.GetItemName());
1110 else console.log(
"dabc object not found!");
1112 console.log(
"Loading preferences " + (result ?
"done" :
"FAILED."));
1116 .css(
'background-image',
"url(" + GO4.source_dir +
"icons/fileopen.png)");
1119 $(
id +
" .anaprefs_form").submit(
1121 event.preventDefault();
1122 var content= $(
id +
" .anaprefs_name")[0].value;
1123 content=content.trim();
1126 editor.MarkChanged(
"anaprefsname",0);
1127 editor.stat.fxConfigFileName=content;
1128 var requestmsg =
"Really save analysis preferences: "+ content;
1129 var response = confirm(requestmsg);
1130 if (!response)
return;
1131 console.log(
"Saving analysis Prefs to "+content);
1133 var options=
"&saveprefs="+content;
1134 editor.DabcCommand(
"UpdateFromUrl",options,
function(result) {
1135 console.log(result ?
"Saving preferences done. " :
"Saving preferences FAILED.");
1139 this.refreshEditor();
1142 GO4.AnalysisStatusEditor.prototype.drawEditor =
function(divid) {
1145 $(
"#"+divid).empty();
1146 $(
"#"+divid).load(GO4.source_dir +
"html/analysiseditor.htm",
"",
function() {
1148 for (var i=0;i<8;i++)
1149 html+=
'<li><a href="'+ GO4.source_dir +
'html/stepeditor.htm">Step ' + i +
'</a></li>';
1151 $(
"#"+divid+
" .steptabs").html(html);
1152 pthis.SetDivId(divid);
1154 pthis.DrawingReady()
1160 GO4.AnalysisStatusEditor.prototype.RedrawPad =
function(resize) {
1162 this.refreshEditor();
1165 GO4.AnalysisStatusEditor.prototype.UpdateObject =
function(obj) {
1166 if (obj._typename !=
this.stat._typename)
return false;
1167 this.stat = JSROOT.clone(obj);
1171 GO4.drawGo4AnalysisStatus =
function(divid, stat, option, painter) {
1173 var h = $(
"#"+divid).height(), w = $(
"#"+divid).width();
1174 if ((h<10) && (w>10)) $(
"#"+divid).height(w*0.7);
1175 var status =
new GO4.AnalysisStatusEditor(stat);
1176 if (painter) status = JSROOT.extend(painter, status);
1177 return status.drawEditor(divid);