[493] | 1 | #include "GWt_machine.h" |
---|
| 2 | |
---|
| 3 | #include <Wt/WPushButton> |
---|
| 4 | #include <Wt/WLabel> |
---|
| 5 | #include <Wt/WPanel> |
---|
| 6 | #include <Wt/WColor> |
---|
| 7 | #include <Wt/WVBoxLayout> |
---|
| 8 | #include <Wt/WHBoxLayout> |
---|
| 9 | #include <Wt/WComboBox> |
---|
| 10 | |
---|
| 11 | GWt_machine::GWt_machine(GWt_accelerator* parent,expandedMachine* mach) : |
---|
| 12 | UI_Accelerator_(parent), |
---|
| 13 | machineControler_(mach) |
---|
| 14 | { |
---|
| 15 | displayWidgetComputing(); |
---|
| 16 | } |
---|
| 17 | |
---|
| 18 | GWt_machine::~GWt_machine() |
---|
| 19 | { |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | void GWt_machine::createWidgetComputing(WContainerWidget* parent) { |
---|
| 23 | |
---|
| 24 | // suppress old detailled view if present |
---|
| 25 | parent->clear(); |
---|
| 26 | |
---|
| 27 | // add the detailled view |
---|
| 28 | WContainerWidget* wdg = new WContainerWidget(parent); |
---|
| 29 | |
---|
| 30 | wdg->setObjectName("machine"); |
---|
| 31 | wdg->addStyleClass("machinePanel"); |
---|
| 32 | Wt::WVBoxLayout* vContainerLayout = new WVBoxLayout(); |
---|
| 33 | vContainerLayout->setContentsMargins(0,0,0,0); |
---|
| 34 | Wt::WPanel *collapsiblePanel = new Wt::WPanel(wdg); |
---|
| 35 | collapsiblePanel->setTitle("Machine panel"); |
---|
| 36 | collapsiblePanel->setCollapsible(true); |
---|
| 37 | |
---|
| 38 | WContainerWidget* menu = new WContainerWidget(wdg); |
---|
| 39 | menu->addStyleClass("machineMenu"); |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | // new WLabel(sectorControler_->getName()+" ",menu); |
---|
| 43 | |
---|
| 44 | WPushButton* actionParameters = new WPushButton("",menu); |
---|
| 45 | // set tooltips |
---|
| 46 | actionParameters->setToolTip("change parameters"); |
---|
| 47 | |
---|
| 48 | // Set class for actions elements |
---|
| 49 | actionParameters->setStyleClass("Button WhiteButton parameters"); |
---|
| 50 | actionParameters->setMaximumSize(32,32); |
---|
| 51 | actionParameters->setMinimumSize(32,32); |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | menu->setWidth(20+7+7+1+1+2); |
---|
| 56 | |
---|
| 57 | vContainerLayout->addWidget(menu); |
---|
| 58 | |
---|
| 59 | // Add beamLine for this sector |
---|
| 60 | // UI_beamLine_ = new GWt_ligneFaisceau(getAccelerator()->getDataManager(),this); |
---|
| 61 | // vContainerLayout->addWidget(UI_beamLine_); |
---|
| 62 | |
---|
| 63 | // add the software panel |
---|
| 64 | cout << " GWt_machine::createWidgetComputing APPEL sofwarepanel" << endl; |
---|
| 65 | GWt_softwarePanelBis* computeWidget = new GWt_softwarePanelBis(getAccelerator()->getDataManager(),this); |
---|
| 66 | vContainerLayout->addWidget(computeWidget); |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | wdg->setLayout(vContainerLayout); |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | void GWt_machine::displayWidgetComputing() { |
---|
| 73 | createWidgetComputing(getAccelerator()->getAcceleratorComputingView()); |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | // void GWt_machine::expandMachine() { |
---|
| 77 | // cout << " coucou depuis GWt_machine::expandMachine() " << endl; |
---|
| 78 | // getAccelerator()->getDataManager()->expandMachine(); |
---|
| 79 | // cout << " GWt_machine::createWidgetComputing APPEL sofwarepanel" << endl; |
---|
| 80 | // computeWidget_ = new GWt_softwarePanelBis(getAccelerator()->getDataManager(),this); |
---|
| 81 | // vContainerLayout_->addWidget(computeWidget_); |
---|
| 82 | // } |
---|