resize window when screen too small

This commit is contained in:
Calem@RAISOR 2024-07-26 14:21:16 -05:00
parent 3fc682f918
commit 779c4a87c9
6 changed files with 31 additions and 3 deletions

1
.gitignore vendored
View File

@ -23,6 +23,7 @@ AggSeparator
FSU2CAEN FSU2CAEN
data data
Data
*.d *.d
*.pcm *.pcm

View File

@ -7,6 +7,8 @@
#include <QDir> #include <QDir>
#include <QFileDialog> #include <QFileDialog>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QApplication>
#include <QScreen>
#define ComBoxMixed "Mixed" #define ComBoxMixed "Mixed"
// bit = 0, bit = 1 // bit = 0, bit = 1
@ -40,6 +42,12 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr
setWindowTitle("Digitizer Settings"); setWindowTitle("Digitizer Settings");
setGeometry(0, 0, 1700, 850); setGeometry(0, 0, 1700, 850);
//====== resize window if screen too small
QScreen * screen = QGuiApplication::primaryScreen();
QRect screenGeo = screen->geometry();
if( screenGeo.width() < 1700 || screenGeo.height() < 850) this->showMaximized();
tabWidget = new QTabWidget(this); tabWidget = new QTabWidget(this);
setCentralWidget(tabWidget); setCentralWidget(tabWidget);

View File

@ -6,6 +6,7 @@
#include <QGroupBox> #include <QGroupBox>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QLabel> #include <QLabel>
#include <QScreen>
QVector<QPointF> Scope::TrapezoidFilter(QVector<QPointF> data, int baseLineEndS, int riseTimeS, int flatTopS, float decayTime_ns){ QVector<QPointF> Scope::TrapezoidFilter(QVector<QPointF> data, int baseLineEndS, int riseTimeS, int flatTopS, float decayTime_ns){
DebugPrint("%s", "Scope"); DebugPrint("%s", "Scope");
@ -56,6 +57,11 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh
setGeometry(0, 0, 1000, 800); setGeometry(0, 0, 1000, 800);
setWindowFlags( this->windowFlags() & ~Qt::WindowCloseButtonHint ); setWindowFlags( this->windowFlags() & ~Qt::WindowCloseButtonHint );
//====== resize window if screen too small
QScreen * screen = QGuiApplication::primaryScreen();
QRect screenGeo = screen->geometry();
if( screenGeo.width() < 1000 || screenGeo.height() < 800) this->showMaximized();
enableSignalSlot = false; enableSignalSlot = false;
isACQStarted = false; isACQStarted = false;

View File

@ -4,6 +4,7 @@
#include <QGroupBox> #include <QGroupBox>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QLabel> #include <QLabel>
#include <QScreen>
SingleSpectra::SingleSpectra(Digitizer ** digi, unsigned int nDigi, QString rawDataPath, QMainWindow * parent) : QMainWindow(parent){ SingleSpectra::SingleSpectra(Digitizer ** digi, unsigned int nDigi, QString rawDataPath, QMainWindow * parent) : QMainWindow(parent){
DebugPrint("%s", "SingleSpectra"); DebugPrint("%s", "SingleSpectra");
@ -20,6 +21,11 @@ SingleSpectra::SingleSpectra(Digitizer ** digi, unsigned int nDigi, QString rawD
setGeometry(0, 0, 1000, 800); setGeometry(0, 0, 1000, 800);
//setWindowFlags( this->windowFlags() & ~Qt::WindowCloseButtonHint ); //setWindowFlags( this->windowFlags() & ~Qt::WindowCloseButtonHint );
//====== resize window if screen too small
QScreen * screen = QGuiApplication::primaryScreen();
QRect screenGeo = screen->geometry();
if( screenGeo.width() < 1000 || screenGeo.height() < 800) this->showMaximized();
QWidget * layoutWidget = new QWidget(this); QWidget * layoutWidget = new QWidget(this);
setCentralWidget(layoutWidget); setCentralWidget(layoutWidget);
QVBoxLayout * layout = new QVBoxLayout(layoutWidget); QVBoxLayout * layout = new QVBoxLayout(layoutWidget);

View File

@ -526,9 +526,9 @@ inline void CoincidentAnalyzer::LoadHistRange(){
int y_sn, y_ch, y_bin; int y_sn, y_ch, y_bin;
float y_min, y_max; float y_min, y_max;
float updateTime; float updateTime = 1.0;
int bkCount; int bkCount = 100;
bool isBkEvtBuild; bool isBkEvtBuild = false;
if (!filePath.isEmpty()) { if (!filePath.isEmpty()) {

View File

@ -5,6 +5,8 @@
#include "Isotope.h" #include "Isotope.h"
#include <map> #include <map>
#include <QApplication>
#include <QScreen>
namespace EncoreChMap{ namespace EncoreChMap{
@ -84,6 +86,11 @@ inline void Encore::SetUpCanvas(){
setGeometry(0, 0, 1600, 1600); setGeometry(0, 0, 1600, 1600);
//====== resize window if screen too small
QScreen * screen = QGuiApplication::primaryScreen();
QRect screenGeo = screen->geometry();
if( screenGeo.width() < 1600 || screenGeo.height() < 1600) this->showMaximized();
chkRunAnalyzer = new QCheckBox("Run Analyzer", this); chkRunAnalyzer = new QCheckBox("Run Analyzer", this);
layout->addWidget(chkRunAnalyzer, 0, 0); layout->addWidget(chkRunAnalyzer, 0, 0);