mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
small changes from the meeting
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@9 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@ -71,7 +71,7 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
|
||||
}
|
||||
|
||||
/** Save group box */
|
||||
boxSave = new QGroupBox("Save",this);
|
||||
boxSave = new QGroupBox("Save Image",this);
|
||||
boxSave->setFixedHeight(45);
|
||||
boxSave->setContentsMargins(0,8,0,0);
|
||||
layoutSave = new QHBoxLayout;
|
||||
|
@ -164,7 +164,6 @@ void qDetectorMain::SetUpDetector(){
|
||||
void qDetectorMain::Initialization(){
|
||||
/** Dockable Plot*/
|
||||
connect(dockWidgetPlot,SIGNAL(topLevelChanged(bool)),this,SLOT(ResizeMainWindow(bool)));
|
||||
connect(dockWidgetTerminal,SIGNAL(topLevelChanged(bool)),this,SLOT(SetTerminalWindowSize(bool)));
|
||||
|
||||
/** tabs */
|
||||
connect(tabs,SIGNAL(currentChanged(int)),this, SLOT(refresh(int)));//( QWidget*)));
|
||||
@ -201,6 +200,8 @@ void qDetectorMain::Initialization(){
|
||||
|
||||
heightPlotWindow = dockWidgetPlot->size().height();
|
||||
heightCentralWidget = centralwidget->size().height();
|
||||
|
||||
defaultTabColor = tabs->tabBar()->tabTextColor(DataOutput);
|
||||
}
|
||||
|
||||
|
||||
@ -241,12 +242,8 @@ void qDetectorMain::refresh(int index){
|
||||
else{
|
||||
;
|
||||
}
|
||||
for(int i=0;i<NumberOfTabs;i++){
|
||||
if(tabs->isTabEnabled(i))
|
||||
tabs->tabBar()->setTabTextColor(i,Qt::black);
|
||||
else
|
||||
tabs->tabBar()->setTabTextColor(i,Qt::gray);
|
||||
}
|
||||
for(int i=0;i<NumberOfTabs;i++)
|
||||
tabs->tabBar()->setTabTextColor(i,defaultTabColor);
|
||||
tabs->tabBar()->setTabTextColor(index,QColor(0,0,200,255));
|
||||
}
|
||||
|
||||
@ -255,15 +252,12 @@ void qDetectorMain::SetDockableMode(bool b){
|
||||
#ifdef VERBOSE
|
||||
cout<<"Setting Dockable Mode to "<<b<<endl;
|
||||
#endif
|
||||
if(b){
|
||||
if(b)
|
||||
dockWidgetPlot->setFeatures(QDockWidget::DockWidgetFloatable);
|
||||
dockWidgetTerminal->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetVerticalTitleBar);
|
||||
|
||||
}else{
|
||||
else{
|
||||
dockWidgetPlot->setFloating(false);
|
||||
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
dockWidgetTerminal->setFeatures(QDockWidget::DockWidgetVerticalTitleBar);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -368,24 +362,6 @@ void qDetectorMain::resizeEvent(QResizeEvent* event){
|
||||
|
||||
|
||||
|
||||
//prolly not needed
|
||||
void qDetectorMain::SetTerminalWindowSize(bool b){
|
||||
#ifdef VERBOSE
|
||||
cout<<"Resizing Terminal Window"<<endl;
|
||||
#endif
|
||||
/*//depends on gridlayout in qdrawterminal widget class
|
||||
if(b){
|
||||
dockWidgetTerminal->setMinimumWidth(width()/2);
|
||||
}
|
||||
|
||||
else{
|
||||
dockWidgetTerminal->setMinimumWidth(38);
|
||||
QSizePolicy sizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
dockWidgetTerminal->setSizePolicy(sizePolicy);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
void qDetectorMain::EnableTabs(){
|
||||
bool enable;
|
||||
|
@ -48,6 +48,13 @@ qTabMeasurement::~qTabMeasurement(){
|
||||
|
||||
void qTabMeasurement::SetupWidgetWindow(){
|
||||
|
||||
/** Exp Time **/
|
||||
float time = (float)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-9));
|
||||
spinExpTime->setValue(time);
|
||||
comboExpUnit->setCurrentIndex(qDefs::SECONDS);
|
||||
|
||||
lblNote->hide();
|
||||
|
||||
/** File Name **/
|
||||
dispFileName->setText(QString(myDet->getFileName().c_str()));
|
||||
/** File Index **/
|
||||
@ -241,30 +248,58 @@ void qTabMeasurement::setNumFrames(int val){
|
||||
|
||||
|
||||
void qTabMeasurement::setExposureTime(){
|
||||
int64_t exptime64;
|
||||
int64_t exptimeNS;
|
||||
/** Get the 64 bit value of timer**/
|
||||
exptime64 = qDefs::get64bTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
||||
exptimeNS = qDefs::getNSTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
||||
#ifdef VERBOSE
|
||||
cout<<"Setting acquisition time to " << exptime64 << " clocks" << endl;
|
||||
cout<<"Setting acquisition time to " << exptimeNS << " clocks" << endl;
|
||||
#endif
|
||||
myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,exptime64);
|
||||
myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,exptimeNS);
|
||||
|
||||
//float t=exptime64;
|
||||
if(lblPeriod->isEnabled()){
|
||||
int64_t acqtimeNS;
|
||||
acqtimeNS = qDefs::getNSTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
||||
if(exptimeNS>acqtimeNS) {
|
||||
lblNote->show();
|
||||
lblPeriod->setPalette(lblNote->palette());
|
||||
lblPeriod->setText("* Acquisition Period");
|
||||
}
|
||||
else {
|
||||
lblNote->hide();
|
||||
lblPeriod->setPalette(lblNumFrames->palette());
|
||||
lblPeriod->setText("Acquisition Period");
|
||||
}
|
||||
}
|
||||
//float t=exptimeNS;
|
||||
//emit acquisitionTimeChanged(t/(100E+6)); ??????????????????????
|
||||
}
|
||||
|
||||
|
||||
|
||||
void qTabMeasurement::setAcquisitionPeriod(){
|
||||
int64_t exptime64;
|
||||
int64_t acqtimeNS;
|
||||
/** Get the 64 bit value of timer**/
|
||||
exptime64 = qDefs::get64bTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
||||
acqtimeNS = qDefs::getNSTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
||||
#ifdef VERBOSE
|
||||
cout<<"Setting frame period between exposures to " << exptime64 << " clocks" << endl;
|
||||
cout<<"Setting frame period between exposures to " << acqtimeNS << " clocks" << endl;
|
||||
#endif
|
||||
myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,exptime64);
|
||||
myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,acqtimeNS);
|
||||
|
||||
//float t=exptime64;
|
||||
int64_t exptimeNS;
|
||||
exptimeNS = qDefs::getNSTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
||||
if(exptimeNS>acqtimeNS){
|
||||
lblNote->show();
|
||||
lblPeriod->setPalette(lblNote->palette());
|
||||
lblPeriod->setText("* Acquisition Period");
|
||||
}
|
||||
else {
|
||||
lblNote->hide();
|
||||
lblPeriod->setPalette(lblNumFrames->palette());
|
||||
lblPeriod->setText("Acquisition Period");
|
||||
}
|
||||
|
||||
|
||||
//float t=exptimeNS;
|
||||
//emit acquisitionTimeChanged(t/(100E+6)); ??????????????????????
|
||||
}
|
||||
|
||||
@ -283,13 +318,13 @@ void qTabMeasurement::setNumTriggers(int val){
|
||||
|
||||
|
||||
void qTabMeasurement::setDelay(){
|
||||
int64_t exptime64;
|
||||
int64_t exptimeNS;
|
||||
/** Get the 64 bit value of timer**/
|
||||
exptime64 = qDefs::get64bTime((qDefs::timeUnit)comboDelayUnit->currentIndex(),spinDelay->value());
|
||||
exptimeNS = qDefs::getNSTime((qDefs::timeUnit)comboDelayUnit->currentIndex(),spinDelay->value());
|
||||
#ifdef VERBOSE
|
||||
cout<<"Setting delay after trigger to " << exptime64 << " clocks" << endl;
|
||||
cout<<"Setting delay after trigger to " << exptimeNS << " clocks" << endl;
|
||||
#endif
|
||||
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptime64);
|
||||
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptimeNS);
|
||||
}
|
||||
|
||||
|
||||
@ -415,6 +450,24 @@ void qTabMeasurement::setTimingMode(int mode){
|
||||
#endif
|
||||
spinPeriod->setValue(time);
|
||||
comboPeriodUnit->setCurrentIndex(qDefs::SECONDS);
|
||||
|
||||
int64_t exptimeNS,acqtimeNS;
|
||||
exptimeNS = qDefs::getNSTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
||||
acqtimeNS = qDefs::getNSTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
||||
if(exptimeNS>acqtimeNS) {
|
||||
lblNote->show();
|
||||
lblPeriod->setPalette(lblNote->palette());
|
||||
lblPeriod->setText("* Acquisition Period");
|
||||
}
|
||||
else {
|
||||
lblNote->hide();
|
||||
lblPeriod->setPalette(lblNumFrames->palette());
|
||||
lblPeriod->setText("Acquisition Period");
|
||||
}
|
||||
}else {
|
||||
lblNote->hide();
|
||||
lblPeriod->setPalette(lblNumFrames->palette());
|
||||
lblPeriod->setText("Acquisition Period");
|
||||
}
|
||||
|
||||
/**Number of Triggers */
|
||||
|
Reference in New Issue
Block a user