18 #include <ROOT/TWebWindowsManager.hxx> 38 fWindow = TWebWindowsManager::Instance()->CreateWindow(
gROOT->IsBatch());
40 fWindow->SetPanelName(
"FitPanel");
42 fWindow->SetDataCallBack([
this](
unsigned connid,
const std::string &arg) {
ProcessData(connid, arg); });
75 if (arg ==
"CONN_READY") {
77 printf(
"FitPanel connection established %u\n",
fConnId);
98 if (arg ==
"CONN_CLOSED") {
99 printf(
"FitPanel connection closed\n");
104 if (arg.find(
"DOFIT:") == 0) {
106 exec.
Form(
"((ROOT::Experimental::TFitPanel *) %p)->DoFit(%s);",
this, arg.c_str() + 6);
107 printf(
"Execute %s\n", exec.
Data());
121 R__ERROR_HERE(
"ShowIn") <<
"FitPanel already bound to the canvas - change is not yet supported";
130 printf(
"DoFit %s %s\n", dname.c_str(), mname.c_str());
132 bool first_time =
false;
142 auto xaxis = std::make_shared<ROOT::Experimental::TAxisConfig>(10, 0., 10.);
144 fFitHist = std::make_shared<ROOT::Experimental::TH1D>(*xaxis.get());
std::vector< ComboBoxItem > fModelNames
std::vector< ComboBoxItem > fDataNames
void Add(std::string_view name, const std::shared_ptr< T > &ptr)
Add an existing object (rather a shared_ptr to it) to the TDirectory.
std::string fSelectModelId
std::shared_ptr< TH1D > fFitHist
!< canvas used to display results
std::string fSelectDataId
static TDirectory & Heap()
Dedicated, process-wide TDirectory.
unsigned fConnId
! connection id
static constexpr PredefinedRGB kBlue
struct ROOT::Experimental::TFitPanelModelModel, used to initialized openui5 FitPanel ...
std::shared_ptr< TWebWindow > GetWindow()
Returns TWebWindow instance, used to display FitPanel.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
std::shared_ptr< TWebWindow > fWindow
void Show(const std::string &where="")
show FitPanel in specified place
void ProcessData(unsigned connid, const std::string &arg)
process data from UI
static TString ConvertToJSON(const TObject *obj, Int_t compact=0, const char *member_name=0)
Converts object, inherited from TObject class, to JSON string Lower digit of compact parameter define...
void DoFit(const std::string &dname, const std::string &mname)
Dummy function, called when "Fit" button pressed in UI.
struct ROOT::Experimental::ComboBoxItemDescriptor for the openui5 ComboBox, used in FitPanel ...
void UseCanvas(std::shared_ptr< TCanvas > &canv)
let use canvas to display fit results
static std::shared_ptr< TCanvas > Create(const std::string &title)
#define R__ERROR_HERE(GROUP)
std::shared_ptr< TCanvas > fCanvas
!< configured display
const char * Data() const