Exemplo n.º 1
0
ConfigurationWindow::ConfigurationWindow(const configurations &config) :
  m_config(config)
{
  QGroupBox *configGroup = new QGroupBox(tr("Configuration"));


  QLabel *serverLabel = new QLabel(tr("CAE file path:"));
  caeFilePathTextEdit = new QTextEdit(QString(config.caeFilePath.c_str()));
  caeFilePathTextEdit->setEnabled(false);
  caeFilePathTextEdit->setFixedHeight(25);
  QHBoxLayout *filePathLayout = new QHBoxLayout;
  filePathLayout->addWidget(serverLabel);
  filePathLayout->addWidget(caeFilePathTextEdit);

  QLabel *abaqusBatPathLabel = new QLabel(tr("Abaqus.bat path:"));
  abaqusBatPathTextEdit = new QTextEdit(QString(config.abaqusBatPath.c_str()));
  abaqusBatPathTextEdit->setFixedHeight(25);
  QHBoxLayout *abaqusBatPathLayout = new QHBoxLayout;
  abaqusBatPathLayout->addWidget(abaqusBatPathLabel);
  abaqusBatPathLayout->addWidget(abaqusBatPathTextEdit);

  QLabel *openModelScriptPathLabel = new QLabel(tr("Prepare model script path:"));
  openModelScriptPathTextEdit = new QTextEdit(QString(config.openModelScriptPath.c_str()));
  openModelScriptPathTextEdit->setFixedHeight(25);
  QHBoxLayout *openModelScriptPathLayout = new QHBoxLayout;
  openModelScriptPathLayout->addWidget(openModelScriptPathLabel);
  openModelScriptPathLayout->addWidget(openModelScriptPathTextEdit);

  QLabel *runForGenomeScriptPathLabel = new QLabel(tr("Run for genome script path:"));
  runForGenomeScriptPathTextEdit = new QTextEdit(QString(config.runForGenomeScriptPath.c_str()));
  runForGenomeScriptPathTextEdit->setFixedHeight(25);
  QHBoxLayout *runForGenomeScriptPathLayout = new QHBoxLayout;
  runForGenomeScriptPathLayout->addWidget(runForGenomeScriptPathLabel);
  runForGenomeScriptPathLayout->addWidget(runForGenomeScriptPathTextEdit);

  QLabel *netSizeLabel = new QLabel(tr("Optimization net size:"));
  optimizationNetSizeTextEdit = new QTextEdit(QString::number(config.optimizationNetSize));
  optimizationNetSizeTextEdit->setFixedHeight(25);
  QHBoxLayout *netSizeLayout = new QHBoxLayout;
  netSizeLayout->addWidget(netSizeLabel);
  netSizeLayout->setSpacing(1);
  netSizeLayout->addWidget(optimizationNetSizeTextEdit);

  QLabel *meshSizeLabel = new QLabel(tr("Mesh size:"));
  meshSizeTextEdit = new QTextEdit(QString::number(config.meshSize));
  meshSizeTextEdit->setFixedHeight(25);
  QHBoxLayout *meshSizeLayout = new QHBoxLayout;
  meshSizeLayout->addWidget(meshSizeLabel);
  meshSizeLayout->addWidget(meshSizeTextEdit);
  meshSizeLayout->setSizeConstraint(QLayout::SetMaximumSize);

  QVBoxLayout *configLayout = new QVBoxLayout;
  configLayout->addLayout(filePathLayout);
  configLayout->addLayout(abaqusBatPathLayout);
  configLayout->addLayout(openModelScriptPathLayout);
  configLayout->addLayout(runForGenomeScriptPathLayout);
  configLayout->addLayout(netSizeLayout);
  configLayout->addLayout(meshSizeLayout);
  configGroup->setLayout(configLayout);
  configGroup->adjustSize();

  QPushButton *saveButton = new QPushButton(tr("Continue"));
  connect(saveButton, SIGNAL(clicked()), this, SLOT(saveConf()));

  QHBoxLayout *buttonsLayout = new QHBoxLayout;
  buttonsLayout->addStretch(1);
  buttonsLayout->addWidget(saveButton);

  QHBoxLayout *horizontalLayout = new QHBoxLayout;
  horizontalLayout->addWidget(configGroup);


  QVBoxLayout *mainLayout = new QVBoxLayout;
  mainLayout->addLayout(horizontalLayout);
  mainLayout->setSpacing(1);
  mainLayout->addStretch(1);
  mainLayout->addLayout(buttonsLayout);
  mainLayout->setGeometry(QRect(10,10,500,300));
  setLayout(mainLayout);

  setWindowTitle(tr("Config Dialog"));
}
Exemplo n.º 2
0
void 
QvisStripChartMgr::CreateWindowContents()
{

    stripChartTabWidget = new QvisStripChartTabWidget(central, this, 2000, 100);
    topLayout->addWidget( stripChartTabWidget);
    
    // Create the group box 
    QGroupBox *stripChartGroup = new QGroupBox(central);
    stripChartGroup->setTitle(tr("Strip Chart Information and Controls"));
    topLayout->addWidget( stripChartGroup);
    
    chartLayout =  new QGridLayout(stripChartGroup);              
    chartLayout->setMargin(10);
    chartLayout->setSpacing(10);
    
    QLabel *limitLab = new QLabel(tr("Limit Bounds"), stripChartGroup);
    chartLayout->addWidget(limitLab,0,1); 
 
    QLabel *extremaLab = new QLabel(tr("Extrema"), stripChartGroup); 
    chartLayout->addWidget(extremaLab,0,3); 
    
    QLabel *currentLab = new QLabel(tr("Current"), stripChartGroup);
    chartLayout->addWidget(currentLab,0,5); 

    minLimitEdit = new QLineEdit(stripChartGroup);
    minLimitEdit->setObjectName(STRIP_MIN_LIMIT_WIDGET_NAME);
    minLimitEdit->setEnabled(false);
    minLimitLabel = new QLabel(tr("Min"), stripChartGroup);
    minLimitLabel->setBuddy(minLimitEdit);
    chartLayout->addWidget(minLimitLabel,1,0);
    chartLayout->addWidget(minLimitEdit,1,1);
    connect(minLimitEdit,SIGNAL(textChanged(const QString&)),this,SLOT(executeMinLimitStripChart()));
    
    maxLimitEdit = new QLineEdit(stripChartGroup);
    maxLimitEdit->setObjectName(STRIP_MAX_LIMIT_WIDGET_NAME);
    maxLimitEdit->setEnabled(false); 
    maxLimitLabel = new QLabel(tr("Max"), stripChartGroup);
    maxLimitLabel->setBuddy(maxLimitEdit);
    chartLayout->addWidget(maxLimitLabel,2,0);
    chartLayout->addWidget(maxLimitEdit,2,1);
    connect(maxLimitEdit,SIGNAL(textChanged(const QString&)),this,SLOT(executeMaxLimitStripChart()));

    minEdit = new QLineEdit(stripChartGroup);
    minEdit->setObjectName(STRIP_MIN_WIDGET_NAME);
    minEdit->setEnabled(false);
    minEdit->setText("0.0");
    minLabel = new QLabel(tr("Min"), stripChartGroup);
    minLabel->setBuddy(minEdit);
    chartLayout->addWidget(minLabel,1,2);
    chartLayout->addWidget(minEdit,1,3);    


    maxEdit = new QLineEdit(stripChartGroup);
    maxEdit->setObjectName(STRIP_MIN_WIDGET_NAME);
    maxEdit->setEnabled(false);
    maxEdit->setText("0.0");
    maxLabel = new QLabel(tr("Max"), stripChartGroup);
    maxLabel->setBuddy(maxEdit);
    chartLayout->addWidget(maxLabel,2,2);
    chartLayout->addWidget(maxEdit,2,3);
        
    curEdit = new QLineEdit(stripChartGroup);
    curEdit->setObjectName(STRIP_CUR_WIDGET_NAME);
    curEdit->setEnabled(false);
    curEdit->setText("0.0");
    curLabel = new QLabel(tr("Data"), stripChartGroup);
    curLabel->setBuddy(curEdit);
    chartLayout->addWidget(curLabel,1,4);
    chartLayout->addWidget(curEdit,1,5);
    
    cycleEdit = new QLineEdit(stripChartGroup);
    cycleEdit->setObjectName(STRIP_CYCLE_WIDGET_NAME);
    cycleEdit->setEnabled(false);
    cycleEdit->setText("0.0");
    cycleLabel = new QLabel(tr("Cycle"), stripChartGroup);
    cycleLabel->setBuddy(cycleEdit);
    chartLayout->addWidget(cycleLabel,2,4);
    chartLayout->addWidget(cycleEdit,2,5);
    
    enableStripChartLimits = new QCheckBox(stripChartGroup);
    enableStripChartLimits->setText(tr("Enable Limits"));
    connect(enableStripChartLimits, SIGNAL(stateChanged(int)),
            this, SLOT(executeEnableStripChartLimits()));
    chartLayout->addWidget(enableStripChartLimits,3, 0, 1, 3);
      
    //enableLogScale = new QCheckBox(stripChartGroup);
    //enableLogScale->setText("Log Scale");
    //connect(enableLogScale,SIGNAL(stateChanged(int)),this,SLOT(executeEnableLogScale()));
    //chartLayout->addMultiCellWidget(enableLogScale,4,2,1,1);
    
    // zoom and focus buttons
    // Create the group box and generic buttons.
    QGridLayout *zoomLayout = new QGridLayout(0);
    chartLayout->addLayout(zoomLayout, 4, 0, 1, 6);
    resetButton = new QPushButton(tr("Reset"));
    resetButton->setEnabled(true);
    zoomLayout->addWidget(resetButton,0,0);
    connect(resetButton,SIGNAL(clicked()),this,SLOT(reset()));
    plusButton = new QPushButton(tr("Zoom in"));
    plusButton->setEnabled(true);
    connect(plusButton,SIGNAL(clicked()),this,SLOT(zoomIn()));
    zoomLayout->addWidget(plusButton,0,1);
    minusButton = new QPushButton(tr("Zoom out"));
    minusButton->setEnabled(true);
    connect(minusButton,SIGNAL(clicked()),this,SLOT(zoomOut()));
    zoomLayout->addWidget(minusButton,0,2);
    focusButton = new QPushButton(tr("Focus"));
    focusButton->setEnabled(true);
    connect(focusButton,SIGNAL(clicked()),this,SLOT(focus()));
    zoomLayout->addWidget(focusButton,0,3);

    stripChartGroup->adjustSize();
}
Exemplo n.º 3
0
EResumen::EResumen( QWidget *parent, tipo que )
: EVentana( parent )
{
 setObjectName( "selectorResumen" );
 setWindowTitle( "Seleccione el Resumen" );
 setAttribute( Qt::WA_DeleteOnClose );
 generar = que;
 QVBoxLayout *layoutPrincipal = new QVBoxLayout( this );
 layoutPrincipal->setMargin( 3 );
 layoutPrincipal->setSpacing( 3 );
 switch( que )
 {
  case diario:
  {
   QGroupBox *g = new QGroupBox( this );
   g->setTitle( "Elija la fecha del resumen" );
   g->setAlignment( Qt::AlignHCenter );
   g->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
   QVBoxLayout *v = new QVBoxLayout( g );
   CWfecha = new QCalendarWidget( g );
   CWfecha->setGridVisible( false );
   CWfecha->setMaximumDate( QDate::currentDate() );
   CWfecha->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
   v->addWidget( CWfecha );
   g->adjustSize();
   layoutPrincipal->addWidget( g );
   break;
  }
  case mensual:
  {
    QGroupBox *groupBox = new QGroupBox( this );
    groupBox->setObjectName(QString::fromUtf8("groupBox"));
    groupBox->setTitle( "Elija el mes para el resumen" );
    groupBox->setAlignment( Qt::AlignCenter );
    groupBox->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );

    QVBoxLayout *v = new QVBoxLayout(groupBox);
    v->setObjectName( "vLayout" );
    QHBoxLayout *h1 = new QHBoxLayout();
    h1->setObjectName("hLayout1");

    QLabel *Lmes = new QLabel(groupBox);
    Lmes->setObjectName(QString::fromUtf8("labelMes"));
    Lmes->setText( tr( "Mes:" ) );
    h1->addWidget(Lmes);

    CBMes = new QComboBox(groupBox);
    CBMes->setObjectName(QString::fromUtf8("CBMes"));
    // Inserto los meses
    QLocale locale;
    for( int i = 1; i<=12; i++ )
    {
     CBMes->insertItem( i, locale.monthName( i ) );
    }
    CBMes->setCurrentIndex( QDate::currentDate().month() );
    h1->addWidget(CBMes);


    v->addLayout(h1);

    QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
    horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));

    QLabel *Lano = new QLabel(groupBox);
    Lano->setObjectName(QString::fromUtf8("lano"));
    Lano->setText( tr( "Año:" ) );
    horizontalLayout_2->addWidget(Lano);

    SBAno = new QSpinBox(groupBox);
    SBAno->setObjectName(QString::fromUtf8("SBAno"));
    SBAno->setMaximum( QDate::currentDate().year() );
    SBAno->setSingleStep( 1 );
    SBAno->setValue( QDate::currentDate().year() );

    horizontalLayout_2->addWidget(SBAno);

    v->addLayout(horizontalLayout_2);

   layoutPrincipal->addWidget( groupBox );
   break;
  }
  case anual:
  {
   QHBoxLayout *layout = new QHBoxLayout( this );
   QLabel *etiqueta = new QLabel( this );
   etiqueta->setText( QString( "Año:" ) );
   seleccion = new QSpinBox( this );
   seleccion->setRange( 0, QDate::currentDate().year() );
   seleccion->setSingleStep( 1 );
   seleccion->setValue( QDate::currentDate().year() );
   layout->addWidget( etiqueta );
   layout->addWidget( seleccion );
   layoutPrincipal->addLayout( layout );
   break;
  }
  case semanal:
  {
   QGroupBox *g = new QGroupBox( this );
   g->setTitle( "Elija un dia de la semana para el resumen" );
   g->setAlignment( Qt::AlignHCenter );
   g->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
   QVBoxLayout *v = new QVBoxLayout( g );
   CWfecha = new QCalendarWidget( g );
   CWfecha->setGridVisible( true );
   CWfecha->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
   v->addWidget( CWfecha );
   g->adjustSize();
   layoutPrincipal->addWidget( g );
   break;
  }
  case entrefechas:
  {
    QHBoxLayout *horizontalLayout = new QHBoxLayout();
    horizontalLayout->setObjectName( "horizontalLayout" );
    horizontalLayout->setContentsMargins(0, 0, 0, 0);
    QLabel *LInicio = new QLabel(this);
    LInicio->setObjectName( "LInicio" );
    LInicio->setText( "Fecha de inicio:" );

    horizontalLayout->addWidget(LInicio);

    DEInicio = new QDateEdit(this);
    DEInicio->setObjectName( "DEInicio" );
    DEInicio->setCalendarPopup(true);

    horizontalLayout->addWidget(DEInicio);

    QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
    horizontalLayout_2->setObjectName( "horizontalLayout_2" );
    horizontalLayout_2->setContentsMargins(0, 0, 0, 0);
    QLabel *LFin = new QLabel(this);
    LFin->setObjectName( "LFin" );
    LFin->setText( "Fecha de Fin:" );

    horizontalLayout_2->addWidget(LFin);

    DEFin = new QDateEdit(this);
    DEFin->setObjectName( "DEFin" );
    DEFin->setCalendarPopup(true);
    DEFin->setMaximumDate( QDate::currentDate() );

    horizontalLayout_2->addWidget(DEFin);

    layoutPrincipal->addItem( horizontalLayout );
    layoutPrincipal->addItem( horizontalLayout_2 );
  }
 }
 QAction *ActGenerar = new QAction( "Generar Reporte", this );
 ActGenerar->setIcon( QIcon( ":/imagenes/reporte.png" ) );
 connect( ActGenerar, SIGNAL( triggered() ), this, SLOT( generarResumen() ) );
 addAction( ActGenerar );
 EActCerrar *ActCerrar = new EActCerrar( this );
 connect( ActCerrar, SIGNAL( triggered() ), this, SLOT( close() ) );
 addAction( ActCerrar );
 this->adjustSize();
}