GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4QSettings.cpp
Go to the documentation of this file.
1 // $Id: TGo4QSettings.cpp 2036 2018-01-08 15:48:49Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum f�r Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4QSettings.h"
15 
16 #include <stdlib.h>
17 
18 #include "Riostream.h"
19 #include "TSystem.h"
20 #include "RVersion.h"
21 
22 #include "TGo4Marker.h"
23 #include "TGo4Condition.h"
24 #include "TGo4MdiArea.h"
25 
26 #include <QtCore/QSettings>
27 #include <QtCore/QFile>
28 #include <QtCore/QDir>
29 #include <QFont>
30 #include <QApplication>
31 #include <QMainWindow>
32 
33 
34 const char* MainWindowDefaultState = "000000ff00000000fd00000002000000000000012500000198fc0200000001fb0000001600420072006f00770073006500720044006f0063006b0100000057000001980000007a00ffffff00000003000003d500000082fc0100000001fc00000000000003d50000007f00fffffffa000000000200000003fb00000016004c006f00670049006e0066006f0044006f0063006b0100000000ffffffff0000005300fffffffb0000001a004d006200730056006900650077006500720044006f0063006b0000000000ffffffff0000006500fffffffb0000001e0044004100420043004d006f006e00690074006f00720044006f0063006b0000000279000000ce0000000000000000000002aa0000019800000004000000040000000800000008fc0000000800000002000000040000001600460069006c00650054006f006f006c0042006100720100000000ffffffff0000000000000000000000160047006f00340054006f006f006c007300420061007201000000c8ffffffff00000000000000000000001e0041006e0061006c00790073006900730054006f006f006c004200610072010000020c0000025800000000000000000000001a0044006900760069006400650050006100640044006f0063006b0000000395000000e40000000000000000000000020000000000000002000000020000002400420072006f0077007300650072004f007000740069006f006e00730044006f0063006b01000000000000010200000000000000000000001e0044007200610077004f007000740069006f006e00730044006f0063006b01000001020000037e00000000000000000000000200000002000000240048006900730044007200610077004f007000740069006f006e00730044006f0063006b0000000000000001290000000000000000000000180047006f0034005300740079006c00650044006f0063006b0000000000000004b10000000000000000000000020000000100000020005300630061006c0065004f007000740069006f006e00730044006f0063006b0000000000000004b10000000000000000000000030000000000000003000000010000001e0043006f006d006d0061006e0064004c0069006e00650044006f0063006b0000000000000004b1000000000000000000000003000000010000001c00540072006500650056006900650077006500720044006f0063006b0000000000000004b10000000000000000";
35 
36 const char* MainWindowDefaultGeometry = "01d9d0cb00010000000000140000000c000003f0000002ba0000001800000029000003ec000002b6000000000000";
37 
39 
40 TGo4QSettings::TGo4QSettings(const QString& filename)
41 {
42  fSettFileName = filename;
43 
44  Open();
45 }
46 
48 {
49  // do not destroy QSettings - they will be automatically saved
50  // delete sett;
51 }
52 
54 {
55  if (fSettFileName.length() > 0) return fSettFileName;
56 #ifdef WIN32
57  return QString("Registry (default)");
58 #endif
59 
60  return QDir::homePath() + "/.config/GSI/go4.conf (default)";
61 }
62 
63 
65 {
66  if (fSettFileName.length()>0)
67  sett = new QSettings(fSettFileName, QSettings::NativeFormat);
68  else
69  sett = new QSettings("GSI","go4");
70 }
71 
73 {
74  delete sett;
75  Open();
76 }
77 
78 void TGo4QSettings::setBool(const QString& name, bool value)
79 {
80  sett->setValue(name, QString(value ? "true" : "false"));
81 }
82 
83 bool TGo4QSettings::getBool(const QString& name, bool def)
84 {
85  return sett->value(name, QString(def ? "true" : "false")).toString() == QString("true");
86 }
87 
88 void TGo4QSettings::setInt(const QString& name, int value)
89 {
90  sett->setValue(name, value);
91 }
92 
93 int TGo4QSettings::getInt(const QString& name, int def)
94 {
95  return sett->value(name, def).toInt();
96 }
97 
98 void TGo4QSettings::setStr(const QString& name, const QString& value)
99 {
100  sett->setValue(name, value);
101 }
102 
103 QString TGo4QSettings::getStr(const QString& name, const QString& def)
104 {
105  return sett->value(name, def).toString();
106 }
107 
108 void TGo4QSettings::setDouble(const QString& name, double value)
109 {
110  sett->setValue(name, value);
111 }
112 
113 double TGo4QSettings::getDouble(const QString& name, double def)
114 {
115  return sett->value(name, def).toDouble();
116 }
117 
118 // set of Go4 specific functions
119 
121 {
122  //writeEntry( "/Font", QApplication::font().toString() );
123 
124  setBool("/markers/Markerlabel", TGo4Marker::fgbHASLABEL);
125  setBool("/markers/Connectorline", TGo4Marker::fgbHASCONNECTOR);
126  setBool("/markers/ShowX", TGo4Marker::fgbXDRAW);
127  setBool("/markers/ShowY", TGo4Marker::fgbYDRAW);
128  setBool("/markers/ShowXbin", TGo4Marker::fgbXBINDRAW);
129  setBool("/markers/ShowYbin", TGo4Marker::fgbYBINDRAW);
130  setBool("/markers/ShowBinContent", TGo4Marker::fgbCONTDRAW);
131  setStr("/markers/LabelNumberFormat", TGo4Marker::fgxNUMFORMAT.Data());
132 
133  setBool("/conditions/Conditionlabel", TGo4Condition::fgbLABELDRAW);
134  setBool("/conditions/ShowLimits", TGo4Condition::fgbLIMITSDRAW);
135  setBool("/conditions/ShowIntegral", TGo4Condition::fgbINTDRAW);
136  setBool("/conditions/ShowXmean", TGo4Condition::fgbXMEANDRAW);
137  setBool("/conditions/ShowYmean", TGo4Condition::fgbYMEANDRAW);
138  setBool("/conditions/ShowXrms", TGo4Condition::fgbXRMSDRAW);
139  setBool("/conditions/ShowYrms", TGo4Condition::fgbYRMSDRAW);
140  setBool("/conditions/ShowXmax", TGo4Condition::fgbXMAXDRAW);
141  setBool("/conditions/ShowYmax", TGo4Condition::fgbYMAXDRAW);
142  setBool("/conditions/ShowCmax", TGo4Condition::fgbCMAXDRAW);
143  setStr("/conditions/LabelNumberFormat", TGo4Condition::fgxNUMFORMAT.Data());
144 
145 }
146 
148 {
149  // QString AppStyle = readEntry( "/Style/AppStyle", "windows");
150  // QApplication::setStyle(AppStyle);
151 
152  // QFont font;
153  // font.fromString(readEntry( "/Font", "Arial,11,-1,5,50,0,0,0,0,0"));
154  // QApplication::setFont(font, true );
155 
156  TGo4Marker::fgbHASLABEL = getBool("/markers/Markerlabel", 1);
157  TGo4Marker::fgbHASCONNECTOR = getBool("/markers/Connectorline", 1);;
158  TGo4Marker::fgbXDRAW = getBool("/markers/ShowX", 1);
159  TGo4Marker::fgbYDRAW = getBool("/markers/ShowY", 0);
160  TGo4Marker::fgbXBINDRAW = getBool("/markers/ShowXbin", 0);
161  TGo4Marker::fgbYBINDRAW = getBool("/markers/ShowYbin", 0);
162  TGo4Marker::fgbCONTDRAW = getBool("/markers/ShowBinContent", 1);
163  TGo4Marker::fgxNUMFORMAT = getStr("/markers/LabelNumberFormat", "%.4E").toLatin1().data();
164 
165  TGo4Condition::fgbLABELDRAW = getBool("/conditions/Conditionlabel", 1);
166  TGo4Condition::fgbLIMITSDRAW= getBool("/conditions/ShowLimits", 1);
167  TGo4Condition::fgbINTDRAW = getBool("/conditions/ShowIntegral", 1);
168  TGo4Condition::fgbXMEANDRAW = getBool("/conditions/ShowXmean", 1);
169  TGo4Condition::fgbYMEANDRAW = getBool("/conditions/ShowYmean", 0);
170  TGo4Condition::fgbXRMSDRAW = getBool("/conditions/ShowXrms", 1);
171  TGo4Condition::fgbYRMSDRAW = getBool("/conditions/ShowYrms", 0);
172  TGo4Condition::fgbXMAXDRAW = getBool("/conditions/ShowXmax", 1);
173  TGo4Condition::fgbYMAXDRAW = getBool("/conditions/ShowYmax", 0);
174  TGo4Condition::fgbCMAXDRAW = getBool("/conditions/ShowCmax", 1);
175  TGo4Condition::fgxNUMFORMAT = getStr("/conditions/LabelNumberFormat", "%.4E").toLatin1().data();
176 }
177 
178 
179 void TGo4QSettings::setAppFont(const QFont& font)
180 {
181  setStr("/Font", font.toString());
182 }
183 
185 {
186  QFont font;
187  font.fromString(getStr("/Font", "Arial,11,-1,5,50,0,0,0,0,0"));
188  QApplication::setFont(font);
189 }
190 
191 void TGo4QSettings::setTermFont(const QFont& font)
192 {
193  setStr("/TermFont", font.toString());
194 
195 }
197 {
198  QFont font;
199 // font.fromString(getStr("/TermFont", "Arial,11,-1,5,50,0,0,0,0,0"));
200  font.fromString(getStr("/TermFont", ""));
201  return font;
202 }
203 
204 void TGo4QSettings::setAppStyle(const QString& v)
205 {
206  setStr("/Style/AppStyle", v);
207 }
208 
210 {
211  return getStr("/Style/AppStyle", "windows");
212 }
213 
214 void TGo4QSettings::setClientName(const QString& v)
215 {
216  setStr("/ClientSetting/Name", v);
217 }
218 
220 {
221  return getStr("/ClientSetting/Name", "MyAnalysis");
222 }
223 
224 void TGo4QSettings::setClientNode(const QString& v)
225 {
226  setStr( "/ClientSetting/Node", v);
227 }
228 
230 {
231  return getStr("/ClientSetting/Node", "localhost");
232 }
233 
234 void TGo4QSettings::setClientDir(const QString& v)
235 {
236  setStr("/ClientSetting/Dir", v);
237 }
238 
240 {
241  return getStr("/ClientSetting/Dir", QDir::currentPath());
242 }
243 
245 {
246  setInt("/ClientSetting/ExeMode", mode);
247 }
248 
250 {
251  return getInt("/ClientSetting/ExeMode", 1);
252 }
253 
254 void TGo4QSettings::setClientExec(const QString& v)
255 {
256  if (getClientExeMode()==0) setStr("/ClientSetting/Exec", v);
257  else setStr("/ClientSetting/Lib", v);
258 }
259 
261 {
262  if (mode<0) mode = getClientExeMode();
263  return mode==0 ? getStr("/ClientSetting/Exec", "./MainUserAnalysis") : getStr("/ClientSetting/Lib", "libGo4UserAnalysis");
264 }
265 
266 void TGo4QSettings::setClientArgs(const QString& v)
267 {
268  setStr("/ClientSetting/Args", v);
269 }
270 
272 {
273  return getStr("/ClientSetting/Args", "");
274 }
275 
277 {
278  const char* name = "exec";
279  switch (v) {
280  case 0: name = "exec"; break;
281  case 1: name = "rsh"; break;
282  case 2: name = "ssh"; break;
283  }
284 
285  setStr( "/ClientSetting/Shell", name);
286 }
287 
289 {
290  return getStr("/ClientSetting/Shell", "exec");
291 }
292 
294 {
295  QString v = getClientShell();
296  int shellmode = 2;
297  if(v.contains("exec")) shellmode = 0; else
298  if(v.contains("rsh")) shellmode = 1; else
299  if(v.contains("ssh")) shellmode = 2;
300  return shellmode;
301 }
302 
303 
305 {
306  QString res = "qt";
307  switch(v) {
308  case 1: res = "qt"; break;
309  case 2: res = "xterm"; break;
310  case 3: res = "konsole"; break;
311  }
312  setStr("/ClientSetting/Term", res);
313 }
314 
316 {
317  return getStr("/ClientSetting/Term", "qt");
318 }
319 
321 {
322  QString v = getClientTerm();
323  int termmode = 1;
324  if(v.contains("qt")) termmode = 1; else
325  if(v.contains("xterm")) termmode = 2; else
326  if(v.contains("konsole")) termmode = 3;
327  return termmode;
328 }
329 
331 {
332  QString v = "false";
333  if (kind==1) v = "true";
334  if (kind==2) v = "http";
335  setStr("/ClientSetting/IsServer", v);
336 }
337 
339 {
340  QString v = getStr("/ClientSetting/IsServer", "false");
341  if (v == "true") return 1;
342  if (v == "http") return 2;
343  return 0;
344 }
345 
347 {
348  setInt( "/ClientSetting/ClientPort", nport);
349 }
350 
352 {
353  return getInt( "/ClientSetting/ClientPort", 5000);
354 }
355 
357 {
358  setInt( "/ClientSetting/Controller", mode);
359 }
360 
362 {
363  return getInt( "/ClientSetting/Controller", 0);
364 }
365 
367 {
368  setBool( "/ClientSetting/DefaultPass", on);
369 }
370 
372 {
373  return getBool( "/ClientSetting/DefaultPass", true);
374 }
375 
377 {
378  setInt( "/ClientSetting/Connection", mode);
379 }
380 
382 {
383  return getInt( "/ClientSetting/Connection", 0);
384 }
385 
387  {
388  return getStr( "/ClientSetting/Account", "observer");
389  }
390 
392 {
393  setStr( "/ClientSetting/Account", v);
394 }
395 
396 
397 
399 {
400  setInt( "/AnalisysTerminal/HistorySize", sz);
401 }
402 
404 {
405  return getInt( "/AnalisysTerminal/HistorySize", 100000);
406 }
407 
408 void TGo4QSettings::setHServName(const QString& v)
409 {
410  setStr( "/HistogramClient/server", v);
411 }
412 
414 {
415  return getStr( "/HistogramClient/server", "");
416 }
417 
418 void TGo4QSettings::setHServBase(const QString& v)
419 {
420  setStr( "/HistogramClient/base", v);
421 }
422 
424 {
425  return getStr( "/HistogramClient/base", "");
426 }
427 
428 void TGo4QSettings::setHServFilter(const QString& v)
429 {
430  setStr( "/HistogramClient/filter", v);
431 }
432 
434 {
435  return getStr( "/HistogramClient/filter", "*");
436 }
437 
439 {
440  setInt( "/HistogramClient/port", port);
441 }
442 
444 {
445  return getInt( "/HistogramClient/port", 6009);
446 }
447 
448 
450 {
451  setBool( "/geometry/Crosshairmode", on);
452 }
453 
455 {
456  return getBool( "/geometry/Crosshairmode", false);
457 }
458 
460 {
461  setBool( "/geometry/Superimpose", on);
462 }
463 
465 {
466  return getBool( "/geometry/Superimpose", false);
467 }
468 
470 {
471  setBool( "/geometry/Eventstatusmode", on);
472 }
473 
475 {
476  return getBool("/geometry/Eventstatusmode", false);
477 }
478 
479 void TGo4QSettings::setCanvasColor(int red, int green, int blue)
480 {
481  setInt( "/ViewPanel/BackRed", red );
482  setInt( "/ViewPanel/BackGrn", green);
483  setInt( "/ViewPanel/BackBlu", blue );
484 }
485 
486 void TGo4QSettings::getCanvasColor(int& red, int& green, int& blue)
487 {
488  red = getInt( "/ViewPanel/BackRed", 220);
489  green = getInt( "/ViewPanel/BackGrn", 220);
490  blue = getInt( "/ViewPanel/BackBlu", 220);
491 }
492 
493 
494 void TGo4QSettings::setPaletteOpt(int min, int def, int max)
495 {
496  setInt( "/ViewPanel/PaletteMin", min);
497  setInt( "/ViewPanel/PaletteDef", def);
498  setInt( "/ViewPanel/PaletteMax", max);
499 }
500 
501 void TGo4QSettings::getPaletteOpt(int& min, int& def, int& max)
502 {
503  min = getInt( "/ViewPanel/PaletteMin", 0);
504  def = getInt( "/ViewPanel/PaletteDef", 1);
505  max = getInt( "/ViewPanel/PaletteMax", 56);
506 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,5,0)
507  if (max==56) max = 112; // default values for old ROOT can be overwritten
508 #endif
509 }
510 
511 
513 {
514  setBool("/ViewPanel/CloneFlag", on);
515 }
516 
518 {
519  return getBool( "/ViewPanel/CloneFlag", true);
520 }
521 
523 {
524  setBool("/ViewPanel/DrawOnce", on);
525 }
526 
528 {
529  return getBool("/ViewPanel/DrawOnce", false);
530 }
531 
533 {
534  setBool("/ViewPanel/DrawTime", on);
535 }
536 
538 {
539  return getBool("/ViewPanel/DrawTime", true);
540 }
541 
543 {
544  setBool("/ViewPanel/DrawDate", on);
545 }
546 
548 {
549  return getBool("/ViewPanel/DrawDate");
550 }
551 
553 {
554  setBool("/ViewPanel/DrawItem", on);
555 }
556 
558 {
559  return getBool("/ViewPanel/DrawItem");
560 }
561 
563 {
564  setInt("/ViewPanel/DrawLineWidth", w);
565 }
566 
568 {
569  return getInt("/ViewPanel/DrawLineWidth", 1);
570 }
571 
573 {
574  setInt("/ViewPanel/DrawFillColor", col);
575 }
576 
578 {
579  return getInt("/ViewPanel/DrawFillColor", 0);
580 }
581 
583 {
584  setInt("/ViewPanel/DrawFillStyle", style);
585 }
587 {
588  return getInt("/ViewPanel/DrawFillStyle", 1001);
589 }
590 
591 
592 
593 void TGo4QSettings::setTH1DrawOpt(const QString& v)
594 {
595  setStr("/ViewPanel/TH1DrawOpt", v);
596 }
597 
599 {
600  return getStr("/ViewPanel/TH1DrawOpt", "hist");
601 }
602 
603 void TGo4QSettings::setTH2DrawOpt(const QString& v)
604 {
605  setStr("/ViewPanel/TH2DrawOpt", v);
606 }
607 
609 {
610  return getStr("/ViewPanel/TH2DrawOpt", "col");
611 }
612 
613 void TGo4QSettings::setTH3DrawOpt(const QString& v)
614 {
615  setStr("/ViewPanel/TH3DrawOpt", v);
616 }
617 
619 {
620  return getStr("/ViewPanel/TH3DrawOpt", "hist");
621 }
622 
623 void TGo4QSettings::setTGraphDrawOpt(const QString& v)
624 {
625  setStr("/ViewPanel/TGraphDrawOpt", v);
626 }
627 
629 {
630  return getStr("/ViewPanel/TGraphDrawOpt", "al");
631 }
632 
634 {
635  setStr("/ViewPanel/GStyleStatFormat", v);
636 
637 }
638 
640 {
641  return getStr("/ViewPanel/GStyleStatFormat", "");
642 }
643 
645 {
646  tgt->restoreState(sett->value("/MainWindow/State", QByteArray::fromHex(MainWindowDefaultState)).toByteArray());
647 
648  tgt->restoreGeometry(sett->value("/MainWindow/Geometry", QByteArray::fromHex(MainWindowDefaultGeometry)).toByteArray());
649 }
650 
652 {
653  sett->setValue("/MainWindow/State", src->saveState());
654 
655  sett->setValue("/MainWindow/Geometry", src->saveGeometry());
656 }
657 
658 void TGo4QSettings::storePanelSize(QWidget* w, const QString& kind)
659 {
660  setInt(QString("/") + kind + QString("/Width"), w->width() );
661  setInt(QString("/") + kind + QString("/Height"), w->height() );
662 }
663 
664 QSize TGo4QSettings::lastPanelSize(const QString& kind, int dfltwidth, int dfltheight)
665 {
666  QSize rect(getInt(QString("/") + kind + QString("/Width"), dfltwidth),
667  getInt(QString("/") + kind + QString("/Height"), dfltheight));
668 
669  if (rect.height() > 1.5*TGo4MdiArea::Instance()->height())
670  rect.setHeight(1.5*TGo4MdiArea::Instance()->height());
671 
672  if (rect.width() > 1.5*TGo4MdiArea::Instance()->width())
673  rect.setWidth(1.5*TGo4MdiArea::Instance()->width());
674 
675  return rect;
676 }
677 
678 void TGo4QSettings::setBrowserColumn(const char* name, int width)
679 {
680  setInt( QString("/Browser/") + name, width);
681 }
682 
683 int TGo4QSettings::getBrowserColumn(const char* name, int defwidth)
684 {
685  return getInt( QString("/Browser/") + name, defwidth);
686 }
687 
688 
690 {
691  setInt( "/HistStatsBox/OptStats", value);
692 }
693 
695 {
696  return getInt( "/HistStatsBox/OptStats", 11111111);
697 }
698 
700 {
701  setInt( "/HistStatsBox/OptStatsW", value);
702 }
703 
705 {
706  return getInt( "/HistStatsBox/OptStatsW", 0);
707 }
708 
710 {
711  setInt( "/HistStatsBox/OptStatsH", value);
712 }
713 
715 {
716  return getInt( "/HistStatsBox/OptStatsH", 0);
717 }
718 
720 {
721  setBool( "/HistStatsBox/Visible", on);
722 }
723 
725 {
726  return getBool( "/HistStatsBox/Visible", true);
727 }
728 
730 {
731  setBool( "/HistStatsBox/Errors", on);
732 }
733 
735 {
736  return getBool( "/HistStatsBox/Errors", false);
737 }
738 
739 void TGo4QSettings::setHistName(const QString& value)
740 {
741  setStr("/NewHist/Name", value);
742 }
743 
745 {
746  return getStr("/NewHist/Name", "histo1");
747 }
748 
749 void TGo4QSettings::setHistTitle(const QString& value)
750 {
751  setStr("/NewHist/Title", value);
752 }
753 
755 {
756  return getStr("/NewHist/Title", "histogram title");
757 }
758 
760 {
761  setInt( "/NewHist/HType", value);
762 }
763 
765 {
766  return getInt( "/NewHist/HType", 14);
767 }
768 
769 void TGo4QSettings::setHistAxisPars(int naxis, int npoints, double min, double max)
770 {
771  QString sname = "/NewHist/Axis";
772  switch (naxis) {
773  case 0: sname+="X_"; break;
774  case 1: sname+="Y_"; break;
775  case 2: sname+="Z_"; break;
776  default: sname+="X_"; break;
777  }
778  setInt(sname+"NPoints", npoints);
779  setDouble(sname+"Min", min);
780  setDouble(sname+"Max", max);
781 }
782 
783 void TGo4QSettings::getHistAxisPars(int naxis, int& npoints, double& min, double& max)
784 {
785  QString sname = "/NewHist/Axis";
786  switch (naxis) {
787  case 0: sname+="X_"; break;
788  case 1: sname+="Y_"; break;
789  case 2: sname+="Z_"; break;
790  default: sname+="X_"; break;
791  }
792  npoints = getInt(sname+"NPoints", 100);
793  min = getDouble(sname+"Min", 0.);
794  max = getDouble(sname+"Max", 100.);
795 }
796 
798 {
799  setBool("/preferences/FetchWhenDraw", on);
800 }
801 
803 {
804  return getBool("/preferences/FetchWhenDraw", true);
805 }
806 
808 {
809  setBool("/preferences/FetchWhenCopy", on);
810 }
811 
813 {
814  return getBool("/preferences/FetchWhenCopy", false);
815 }
816 
818 {
819  setBool("/preferences/FetchWhenSave", on);
820 }
821 
823 {
824  return getBool("/preferences/FetchWhenSave", false);
825 }
826 
828 {
829  setBool("/preferences/HideEventElement", on);
830 }
831 
833 {
834  return getBool("/preferences/HideEventElement", false);
835 }
836 
837 
839 {
840  setBool("/preferences/MoveSubwindowRubberBand", on);
841 }
842 
844 {
845  return getBool("/preferences/MoveSubwindowRubberBand", true);
846 }
847 
848 
849 void TGo4QSettings::setRemoteFileSett(const QString& hostname, const QString& filename, const QString& protocol)
850 {
851  setStr( "/OpenRemoteFile/Host", hostname);
852  setStr( "/OpenRemoteFile/File", filename);
853  setStr( "/OpenRemoteFile/Type", protocol);
854 }
855 
856 void TGo4QSettings::getRemoteFileSett(QString& hostname, QString& filename, QString& protocol)
857 {
858  hostname = getStr( "/OpenRemoteFile/Host", "machine.gsi.de");
859  filename = getStr( "/OpenRemoteFile/File", "tmp/hsimple.root");
860  protocol = getStr( "/OpenRemoteFile/Type", "root:");
861 }
862 
863 void TGo4QSettings::setPrinterSett(const QString& name, const QString& cmd)
864 {
865  setStr( "/Printer/Name", name);
866  setStr( "/Printer/Prog", cmd);
867 }
868 
869 void TGo4QSettings::getPrinterSett(QString& name, QString& cmd)
870 {
871  name = getStr( "/Printer/Name", gSystem->Getenv("PRINTER"));
872  cmd = getStr( "/Printer/Prog","lpr");
873 }
874 
875 void TGo4QSettings::setMbsMonitorNode(const QString& name)
876 {
877  setStr( "/MbsMonitor/Node", name);
878 }
879 
881 {
882  return getStr( "/MbsMonitor/Node", "r2-d2");
883 }
884 
886 {
887  setInt( "/MbsMonitor/Frequency", secs);
888 }
889 
891 {
892  return getInt( "/MbsMonitor/Frequency", 5);
893 }
894 
896 {
897  setInt( "/MbsMonitor/Bins", num);
898 }
899 
901 {
902  return getInt( "/MbsMonitor/Bins", 200);
903 }
904 
906 {
907  setBool( "/MbsMonitor/TrendOn", on);
908 }
909 
911 {
912  return getBool("/MbsMonitor/TrendOn", false);
913 }
914 
916 {
917  setBool("/MbsMonitor/ShowMore", on);
918 }
919 
921 {
922  return getBool("/MbsMonitor/ShowMore", true);
923 }
924 
926 {
927  setBool("/MbsMonitor/MonitorActive", on);
928 }
929 
931 {
932  return getBool("/MbsMonitor/MonitorActive", false);
933 }
934 
936 {
937  setBool("/MbsMonitor/BackwardsTrending", on);
938 }
939 
941 {
942  return getBool("/MbsMonitor/BackwardsTrending", true);
943 }
944 
945 void TGo4QSettings::setDabcMonitorNode(const QString& name)
946 {
947  setStr( "/DabcMonitor/Node", name);
948 }
949 
951 {
952  return getStr( "/DabcMonitor/Node", "dimDns.gsi.de");
953 }
954 
956 {
957  setInt( "/DabcMonitor/Frequency", secs);
958 }
959 
961 {
962  return getInt( "/DabcMonitor/Frequency", 5);
963 }
964 
966 {
967  setInt( "/DabcMonitor/Bins", num);
968 }
969 
971 {
972  return getInt( "/DabcMonitor/Bins", 200);
973 }
974 
976 {
977  setBool("/DabcMonitor/BackwardsTrending", on);
978 }
979 
981 {
982  return getBool("/DabcMonitor/BackwardsTrending", true);
983 }
984 
986 {
987  return sett->value("/CommandsHistoryGUI").toStringList();
988 }
989 
990 void TGo4QSettings::setCommandsHistoryGUI(const QStringList & commands)
991 {
992  sett->setValue("/CommandsHistoryGUI", commands);
993 }
994 
996 {
997  return sett->value("/CommandsHistoryAnalysis").toStringList();
998 }
999 
1000 void TGo4QSettings::setCommandsHistoryAnalysis(const QStringList & commands)
1001 {
1002  sett->setValue("/CommandsHistoryAnalysis", commands);
1003 }
1004 
1006 
1008 {
1009  QString descriptor=QString("/AnalysisMacro%1/Command").arg(id);
1010 
1011  return getStr(descriptor, "");
1012 }
1013 
1015 {
1016  QString descriptor=QString("/AnalysisMacro%1/Tip").arg(id);
1017  QString deftip=QString("Ctrl - %1").arg(id+1);
1018  return getStr(descriptor, deftip);
1019 }
1020 
1022 {
1023  QString descriptor=QString("/AnalysisMacro%1/Automode").arg(id);
1024  return getBool(descriptor, false);
1025 }
1026 
1028 {
1029  QString descriptor=QString("/AnalysisMacro%1/Automode").arg(id);
1030  setBool(descriptor, on);
1031 }
1032 
1033 
1034 void TGo4QSettings::setAnalysisMacroCommand(int id, const QString& com)
1035 {
1036  QString descriptor=QString("/AnalysisMacro%1/Command").arg(id);
1037  setStr(descriptor, com);
1038 }
1039 
1040 void TGo4QSettings::setAnalysisMacroTip(int id, const QString& com)
1041 {
1042  QString descriptor=QString("/AnalysisMacro%1/Tip").arg(id);
1043  setStr(descriptor, com);
1044 }
1045 
1047 {
1048  return getDouble("/Screen/ScaleFactor", 1.0);
1049 }
1051 {
1052  setDouble( "/Screen/ScaleFactor", factor);
1053 }
1054 
1056 {
1057  return getBool("/ViewPanel/SavePadWhiteBackground" , false);
1058 
1059 }
1060 
1062 {
1063 
1064  setBool("/ViewPanel/SavePadWhiteBackground", on);
1065 }
1066 
1068 {
1069  return getBool("/AnalisysTerminal/ShowTimestamp", false);
1070 }
1071 
1073 {
1074  setBool("/AnalisysTerminal/ShowTimestamp", on);
1075 }
1076 
1078 {
1079  return getStr( "/AnalisysTerminal/TimeFormat", "yyyy-MM-dd�hh mm:ss.zzz");
1080 }
1081 
1082 void TGo4QSettings::setTermTimeFormat(const QString& form)
1083 {
1084  setStr( "/AnalisysTerminal/TimeFormat", form);
1085 }
1086 
void setClientControllerMode(int)
void setDrawDateFlag(bool on=true)
QString getClientDir()
QString GetSettLoaction()
static Bool_t fgbXRMSDRAW
void setScreenScaleFactor(double factor)
static Bool_t fgbHASCONNECTOR
Definition: TGo4Marker.h:144
bool getSavePadWhiteBackground()
void setDabcMonitorNode(const QString &name)
QSettings * sett
Definition: TGo4QSettings.h:38
QString getAppStyle()
static Bool_t fgbYMAXDRAW
void setDouble(const QString &name, double value=0.)
QString getTGraphDrawOpt()
static Bool_t fgbLIMITSDRAW
void getRemoteFileSett(QString &hostname, QString &filename, QString &protocol)
int getClientShellMode()
void setPrinterSett(const QString &name, const QString &cmd)
QString getClientAccountName()
void setClientExeMode(int mode)
QStringList getCommandsHistoryAnalysis()
void storeMainWindowState(QMainWindow *src)
void setCommandsHistoryAnalysis(const QStringList &commands)
static Bool_t fgbCONTDRAW
Definition: TGo4Marker.h:159
QString getClientShell()
void setStatBoxErrors(bool on=true)
void setClientArgs(const QString &)
bool getStatBoxVisible()
void setTH1DrawOpt(const QString &value)
void setHideTGo4EventElement(bool on=true)
bool getDrawOnceFlag()
double getScreenScaleFactor()
void setMbsMonitorMonitorActive(bool on=true)
void setMbsMonitorTrend(bool on=true)
void setClientAccountName(const QString &)
void setAnalysisMacroTip(int id, const QString &com)
void setClientDir(const QString &)
void setFetchDataWhenCopy(bool on=true)
TGo4QSettings(const QString &filename)
void getCanvasColor(int &red, int &green, int &blue)
void setHistType(int value)
QString getClientName()
void setPadEventStatus(bool on)
QString fSettFileName
Definition: TGo4QSettings.h:41
bool getFetchDataWhenCopy()
QString getTermTimeFormat()
static TGo4MdiArea * Instance()
Definition: TGo4MdiArea.cpp:27
void setDrawFillColor(int col)
void setPaletteOpt(int min, int def, int max)
static Bool_t fgbCMAXDRAW
bool getDrawItemFlag()
void storePanelSize(QWidget *w, const QString &kind="ViewPanel")
void setHServFilter(const QString &)
static Bool_t fgbLABELDRAW
static Bool_t fgbXDRAW
Definition: TGo4Marker.h:147
static TString fgxNUMFORMAT
void setOptStat(int value)
QString getClientExec(int mode=-1)
void setStr(const QString &name, const QString &value="")
void setDabcMonitorFreq(int secs)
void setBasicSettings()
void setClientName(const QString &)
static Bool_t fgbXMEANDRAW
bool getPadCrosshair()
static Bool_t fgbYBINDRAW
Definition: TGo4Marker.h:156
void setTH3DrawOpt(const QString &value)
void setClientTermMode(int)
void setDabcMonitorBins(int num)
QString getStr(const QString &name, const QString &value="")
void setDabcMonitorBackwardsTrending(bool on=true)
QString getTH2DrawOpt()
void setSavePadWhiteBackground(bool on)
int getClientControllerMode()
void setClientShellMode(int)
void setTermHistorySize(int sz)
QString getHistName()
bool getBool(const QString &name, bool def=true)
QString getHServName()
bool getPadSuperimpose()
bool getDrawTimeFlag()
void getHistAxisPars(int naxis, int &npoints, double &min, double &max)
void setBool(const QString &name, bool value=true)
QString getHServFilter()
void setFetchDataWhenDraw(bool on=true)
void setCloneFlag(bool on=true)
void setClientPort(int)
void setClientIsServer(int kind)
void setPadCrosshair(bool on)
bool getAnalysisMacroAutomode(int id)
void setBrowserColumn(const char *name, int width)
void getBasicSettings()
bool getMbsMonitorMonitorActive()
void setHServPort(int port)
bool getTermShowTimestamp()
QString getClientArgs()
void setHistAxisPars(int naxis, int npoints, double min, double max)
double getDouble(const QString &name, double value=0.)
void setTermFont(const QFont &)
int getInt(const QString &name, int def=0)
void setAppStyle(const QString &)
void setDrawLineWidth(int w=1)
void setHistName(const QString &value)
static Bool_t fgbYMEANDRAW
bool getMbsMonitorTrend()
bool getMbsMonitorMore()
int getDabcMonitorBins()
int getClientConnectMode()
QString getAnalysisMacroCommand(int id)
virtual ~TGo4QSettings()
void setMbsMonitorNode(const QString &name)
static Bool_t fgbYDRAW
Definition: TGo4Marker.h:150
void setDrawOnceFlag(bool on=true)
TGo4QSettings * go4sett
void setAnalysisMacroCommand(int id, const QString &com)
QString getDabcMonitorNode()
bool getFetchDataWhenSave()
void setAnalysisMacroAutomode(int id, bool on)
void setHistTitle(const QString &value)
void setFetchDataWhenSave(bool on=true)
bool getPadEventStatus()
bool getStatBoxErrors()
void setRemoteFileSett(const QString &hostname, const QString &filename, const QString &protocol)
void restoreMainWindowState(QMainWindow *tgt)
QString getTH1DrawOpt()
bool getFetchDataWhenDraw()
void setMoveSubwindowRubberBand(bool on=true)
bool getMbsMonitorBackwardsTrending()
static Bool_t fgbXMAXDRAW
void setClientExec(const QString &)
QString getMbsMonitorNode()
QString getClientTerm()
static Bool_t fgbXBINDRAW
Definition: TGo4Marker.h:153
static TString fgxNUMFORMAT
Definition: TGo4Marker.h:162
void setDrawTimeFlag(bool on=true)
bool getDrawDateFlag()
const char * MainWindowDefaultGeometry
QSize lastPanelSize(const QString &kind="ViewPanel", int dfltwidth=450, int dfltheight=250)
static Bool_t fgbHASLABEL
Definition: TGo4Marker.h:141
void getPrinterSett(QString &name, QString &cmd)
void setTH2DrawOpt(const QString &value)
void setHServName(const QString &)
QStringList getCommandsHistoryGUI()
bool getClientDefaultPass()
void setClientNode(const QString &)
static Bool_t fgbYRMSDRAW
QString getTH3DrawOpt()
void getPaletteOpt(int &min, int &def, int &max)
void setTermShowTimestamp(bool on)
void setDrawFillStyle(int style)
void setDrawItemFlag(bool on=true)
void setCanvasColor(int red, int green, int blue)
bool getMoveSubwindowRubberBand()
int getBrowserColumn(const char *name, int defwidth)
void setMbsMonitorBins(int num)
QString getGStyleStatFormat()
const char * MainWindowDefaultState
void setMbsMonitorBackwardsTrending(bool on=true)
void setInt(const QString &name, int value=0)
void setClientConnectMode(int)
int getDabcMonitorFreq()
void setOptStatW(int value)
QString getAnalysisMacroTip(int id)
bool getHideTGo4EventElement()
void setHServBase(const QString &)
void setOptStatH(int value)
void setGStyleStatFormat(const QString &)
QString getHServBase()
void setClientDefaultPass(bool)
void setMbsMonitorFreq(int secs)
void setTermTimeFormat(const QString &form)
void setMbsMonitorMore(bool on=true)
QString getClientNode()
void setAppFont(const QFont &)
void setCommandsHistoryGUI(const QStringList &commands)
void setPadSuperimpose(bool on)
void setStatBoxVisible(bool on=true)
void setTGraphDrawOpt(const QString &value)
int getTermHistorySize()
QString getHistTitle()
static Bool_t fgbINTDRAW
bool getDabcMonitorBackwardsTrending()