From ccc3e503ef0c5ff69a01bb5a64bf29a10810e551 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 24 May 2024 00:16:15 +0200 Subject: [PATCH] Improving form style. Adding MD duration preview scaffold --- .../include/tools/mdprep/ui/basic_form.hpp | Bin 2488 -> 3632 bytes .../tools/mdprep/ui/engine_form_gromacs.hpp | Bin 1234 -> 1444 bytes .../include/tools/mdprep/ui/form_data.hpp | Bin 1950 -> 3288 bytes .../tools/mdprep/ui/md_engine_form.hpp | Bin 3150 -> 3218 bytes lib/tool/tools/mdprep/src/mdprep.cpp | 46 ++++++++++++++---- lib/tool/tools/mdprep/src/ui/basic_form.cpp | Bin 11260 -> 17578 bytes .../mdprep/src/ui/engine_form_gromacs.cpp | Bin 1736 -> 3870 bytes lib/tool/tools/mdprep/src/ui/main_window.cpp | 16 +++++- 8 files changed, 50 insertions(+), 12 deletions(-) diff --git a/lib/tool/tools/mdprep/include/tools/mdprep/ui/basic_form.hpp b/lib/tool/tools/mdprep/include/tools/mdprep/ui/basic_form.hpp index c6369069576183da0132f2d97a4c40bce5c661c6..0d86fb82274f9564da309774578e4891671f31db 100644 GIT binary patch delta 806 zcmb7Cze_?<6h6-%?}y<~FG9uONvY-Ho9OvFH|7FD delta 179 zcmdlWvqN~oDQ#tjOolv$WQH7uQic?UR0ahG8-_w443kP@J= wT2OI_Ea&80W@%2i>dBqV#;jnO$-9}I*`eZ-|1-~=?87TGS&Q|+TmH}BMKz%6;{y<&HK$Zf7EfA*x#dCn>r!rVG@G@|L x_2IKgfk6wXD;}sX6R0N#Xr43BMv#e|B0$X`BlCcc%mKmzpoK-7KQcXJ1OS_kCzb#J delta 16 YcmZ3&eTj3zr_CyiJWQJ}FkfK=068ZHP5=M^ diff --git a/lib/tool/tools/mdprep/include/tools/mdprep/ui/form_data.hpp b/lib/tool/tools/mdprep/include/tools/mdprep/ui/form_data.hpp index 818da259d2fb83a4a2d07f182aa8c15489de001c..0f1fdfa99b4e9c915237cee516ceec1573f57bcc 100644 GIT binary patch literal 3288 zcmd5;Yfscr5S_0z@ju+a7w~~d#1KFdKuC!4kVWIS%|4;Ywu`%4h#LO7dd^ITc6ZBS zFdEZz+wHw~9_O5ydw>3zmsq-zN?SU32C3uvBxmv&&oep3^}h60!~3DUl@mFYJ^a?? zqa5IOAM;KzQpeaf)@|dhE|2Ar%;%P4_~`rv`{skzThfzEy#?8np^RjJ+)_E0tvr(H zSyzaug_(WKwOO=BOAS~UBHj%Q}$g zw0#j5OIUTL zHke-*R{0FD!AOT1Sr1V$U(eJcr@d5jt%|4GTL6L`cp&D+Uo2#DY0UnC`o2aC^lV5F zxrSyI@U-u3#e@hlN8-aVi=S9_R8wtyZG!&-tLoUE={#zru;OvD(#U~x=a`P;y`Y(# zBb&mPAxd@80{LyrVxDbTCjnJia97LmalgCDcA|*8s$Fl!jB7DcM%t>=a*bGB+4t!R zi@?W2^hVP~) zM$YcRy0u=_g>PcyTD~du8e?UE8SGi1vNH{HRTNBCcd#H&V4(@mjP(T10dB@J!p+)> zF#ZO2nn!f0{8;BB60__!kl&SNMFq4g?a#74D{J=As(5!a7qWS`mdl!DzhR#m*XWKa zqsWpgruAOEb{C2y--V`Q=qpt(M8Q`PQ>xnHjDRn>AIWQZgY86Rr#x)Q0%pIIWmsOt+hVRV^7?zx?8z6M*+Vo< z)sDw=1m>yE|0fUgT&X|ng-M#+HtEVG)T8f~^ zf=Cpd@va`R4Mxg+X}nVu)*f~i%TTd)njqfRTW!DR*>JMIdN<(tt6aCXM_F%5u+Hm> z`v-SH+b2TqiRYH$95>l_c~YA8Y*|kuHi?d(4QjB#eUZD_IARf^;BMK}F~;PTwhYBC e<65~@i=#^mH;CFW{`2!Q?ad=H?$|u(@c%F3J{YnF-dZR7dyKGLp(zXgWhCCZqdn4*t8}WusguT^4TSstr-+HuV, VTX::Tool::Mdprep::ui::MD_ENGINE_NUMBER>; - inline static const QSize PREFERRED_SIZE { 640, 720 }; + inline static const QSize PREFERRED_SIZE { 500, 720 }; QComboBox * _w_mdEngine = nullptr; VTX::Tool::Mdprep::ui::MdFieldsOrganizer _fieldOrganizer; @@ -50,20 +52,42 @@ namespace VTX::QT::Mdprep this->setWindowTitle( "Molecular Dynamics Preparation" ); setWindowState( Qt::WindowState::WindowActive ); - const QSize winsize = QSize( 640, 720 ); + const QSize winsize = PREFERRED_SIZE; resize( winsize ); - QVBoxLayout * windowLayout = new QVBoxLayout( mainWidget ); - windowLayout->setContentsMargins( 0, 0, 0, 0 ); + QVBoxLayout * qLayoutWindow = new QVBoxLayout( mainWidget ); + qLayoutWindow->setContentsMargins( 0, 0, 0, 0 ); + qLayoutWindow->addSpacerItem( new QSpacerItem( 0, 10 ) ); + + QHBoxLayout * qLayoutCentering = new QHBoxLayout; + qLayoutWindow->addLayout( qLayoutCentering ); // following content is meant to be moved eventually _w_mdEngine = new QComboBox; for ( auto & it : VTX::Tool::Mdprep::ui::mdEngineStrings() ) _w_mdEngine->addItem( QString( it ) ); _w_mdEngine->setCurrentIndex( _mdEngineCurrentIdx ); - windowLayout->addWidget( _w_mdEngine, 1 ); - _fieldOrganizer.setupUi( windowLayout ); + qLayoutCentering->addStretch( 1 ); + + QFormLayout * qLayoutFormEngine = new QFormLayout; + qLayoutCentering->addLayout( qLayoutFormEngine ); + QLabel * qLabelMdEngine = new QLabel( "Choose your MD engine" ); + { + auto font = qLabelMdEngine->font(); + font.setPointSize( font.pointSize() + 2 ); + qLabelMdEngine->setFont( font ); + font = _w_mdEngine->font(); + font.setPointSize( font.pointSize() + 2 ); + _w_mdEngine->setFont( font ); + } + qLayoutFormEngine->addRow( qLabelMdEngine, _w_mdEngine ); + + qLayoutCentering->addStretch( 1 ); + + qLayoutWindow->addSpacerItem( new QSpacerItem( 0, 10 ) ); + + _fieldOrganizer.setupUi( qLayoutWindow ); _formBasic.setupUi( _fieldOrganizer.containerParamBasic ); } void _updateFormEngine( int idx ) noexcept @@ -80,10 +104,12 @@ namespace VTX::QT::Mdprep ); _formsMd[ _mdEngineCurrentIdx ]->activate(); - const VTX::Tool::Mdprep::ui::EngineSpecificCommonFormData * engineSpecificData = nullptr; - _formsMd[ _mdEngineCurrentIdx ]->get( engineSpecificData ); - if ( engineSpecificData ) - _formBasic.update( *engineSpecificData ); + { + const VTX::Tool::Mdprep::ui::EngineSpecificCommonFormData * engineSpecificData = nullptr; + _formsMd[ _mdEngineCurrentIdx ]->get( engineSpecificData ); + if ( engineSpecificData ) + _formBasic.update( *engineSpecificData ); + } VTX::VTX_DEBUG( "info from Mdprep::MainWindow::_updateFormEngine({})", idx ); } diff --git a/lib/tool/tools/mdprep/src/ui/basic_form.cpp b/lib/tool/tools/mdprep/src/ui/basic_form.cpp index 5bc0225b53df23b46dee5aaccce38f8b25cfcba8..94286467ed27b84db1e8857b85396d05a35bc749 100644 GIT binary patch literal 17578 zcmd^{X>VJ{6^7?43-mt_Dv&sv;v_{sxJd!WOKl)=;>byhE(l~vmfcF$LMgH1`meWr zpE*1{XD%*Z(W+i?w9y_O+e>8i3uX$$8xV$dEuUr_#qw=tPQR&zzcSJEZJTC9*-=^Memv75`(Qs0J zC%W!dD);p1HU0ge-kYa>QMoe@w7rMoi3k9fP_ZH=UvMO-@7pH(>M0M5D+xh6a&HDHZ|4Wfe2wSp#t@+>>>o=ASjl8>*6zrUVo?+5Ki7Q>e4 z6n~?&yRxj4#LcxCEcCyuwYv3;2CQ~o4$JRqW%YhTW7qER5q#0`nLLSbL<{_|yW90> z`$ls+Lvv2=vi|dK)%-jK<`0HxH6Lmr24zDKoxiXbG>Z*v*Vt&W%cwajVH3AxOMBIG zk!4F~-rd5zS3cLi7uBM?!my|{4;vqfH7$ldIQY^$l&*)*ugG{J{=gqmdZ)fll)o%n zkY6S>7F@4!xP4t6n?;x`G5BaT8P<6<@WWC9zFYIC@;XFM$gDrwUQWy&qM(oJH$9Ti z+hK5lzgpCGEm$`&FJE#$+MDQSENi6>z+kq6ZquSX~rA9qRtuxm8mwNxWdhuAf zgRFb3&#~{rnu{HG#_+IoA#Ef$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9zMgZE-*@Kb ztba#knOlO;zRaz;Jn_5eZNRf{u;mEM2?`Shi)?h0FZ7OBeqFVD>-~1N)t-Up+iuJx zfM(yFYGJ-t-V?Nl&-pfQj*r7Qppwk_NUwg|rltHH^*i)dWDmcc1dqGZ==@pb&2G@O zw-nb^#nV~AU)1x)UrTw;Ep2ugrr!FSTXk-Tts$%XdgZ?4i)wRSULpq*4Y;kw$Hoip31>D(F#clM%)v8_b+eA-9FEC)wl>UV3?-8f%BOC2QmSK|yhTw2 zDCjWxkbKJKG_`3k0fouGG(~`dE{qD37pjR*R?<`fvivn`ff@uh$7oICWh|b|Yf%m) rH_Dn$zG4xwxj;yQX)}wn2_ttggEfN!LoEX@1J~q@0 diff --git a/lib/tool/tools/mdprep/src/ui/engine_form_gromacs.cpp b/lib/tool/tools/mdprep/src/ui/engine_form_gromacs.cpp index 2e2217c61f507986a067813d6484890ff5c959d9..e6313a078f23f226223d01373f8b76f69240af56 100644 GIT binary patch literal 3870 zcmc(iTW=dT5QXP;3-muMT)=3HMs@<^C28}}rk4Oo8efw3&5)&)EmU5qxWD|tPW zua&;R0ylbprn$bX`&;b2fO!|}N^D((I4e8LcDj%cQ+d-Dmy7>ozb4{=cHO-LOx4=^ zN<5GUydalv?9_g@NBW#@IOF|A#u>k14TKNjyRf&i9m}Q^Rwe#^3%@SH`?2QM!X0aF zZ0C9=dX`ejm$E;ypEQqhp38@*oYKD5+)R9-u!XF@3AQ>}@u9|H=F_UZQg^P@ALzS%RWKQTDkOU7Kx5P|)eL(FdZ<}4ypkomk2jtd zg>jy!63>P98_1ulpn+O(#nXbmHtl5k2aQhxXK>|p+>`cD#HH}gg)vZ8Rjxf~8!ClF9hVRYJ=U7dhqUczq@X2~tX)T%O!T{i1`%8b!z4mhc}0w7I7o zwNai)GhR2Wt;0Dm3Aw}wbY*c(eYcO1^6 z=&##*H|g>eEKWvFEpiINP#W_ae!KzFWAk{r^q=ONwF2@|e$M4-Qhn^cg?7K)-MD=V uxn4!oN|(2cM~&vy9sRm(mn1Xon)tL%`Txb=?7A^G&H$&TcZIwEKlBe`j%^J9 delta 43 wcmbOycY=3<$YcRVrH$7d7&m9I*s)B$z-u)54u=}E0z>uWlf21b`ZQlK06*joD*ylh diff --git a/lib/tool/tools/mdprep/src/ui/main_window.cpp b/lib/tool/tools/mdprep/src/ui/main_window.cpp index 19d79e0d8..312829d83 100644 --- a/lib/tool/tools/mdprep/src/ui/main_window.cpp +++ b/lib/tool/tools/mdprep/src/ui/main_window.cpp @@ -18,7 +18,7 @@ namespace VTX::Tool::Mdprep::ui case E_MD_ENGINE::gromacs: return { "Gromacs" }; default: break; } - return "Please provide a user string for the MD engine"; // For developers that add new MD Engine support + return "DEBUUUG"; // For developers that add new MD Engine support } namespace { @@ -36,12 +36,24 @@ namespace VTX::Tool::Mdprep::ui const std::array & mdEngineStrings() { return g_mdEngineStrings; } + namespace + { + class NoopForm + { + public: + NoopForm() = default; + void get( const VTX::Tool::Mdprep::ui::EngineSpecificCommonFormData *& ) const noexcept {} + void activate() noexcept {} + void deactivate() noexcept {} + }; + } // namespace + MdEngineForm form( const E_MD_ENGINE & p_engine, FormLayouts p_layout ) noexcept { switch ( p_engine ) { case E_MD_ENGINE::gromacs: return { EngineFormGromacs( std::move( p_layout ) ) }; - default: return { EngineFormGromacs( std::move( p_layout ) ) }; // Default is gromacs. Period. + default: return { NoopForm() }; // Default is gromacs. Period. } }