Files
musrfit/musredit/html/classPSubTextEdit.html
T
2026-07-31 18:47:29 +00:00

1005 lines
62 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>musredit: PSubTextEdit Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">musredit<span id="projectnumber">&#160;1.0.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',false);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-slots">Public Slots</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classPSubTextEdit-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">PSubTextEdit Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Enhanced text editor for msr file editing with block insertion support.
<a href="#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="PSubTextEdit_8h_source.html">PSubTextEdit.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for PSubTextEdit:</div>
<div class="dyncontent">
<div class="center"><img src="classPSubTextEdit__inherit__graph.png" border="0" usemap="#aPSubTextEdit_inherit__map" alt="Inheritance graph"/></div>
<map name="aPSubTextEdit_inherit__map" id="aPSubTextEdit_inherit__map">
<area shape="rect" title="Enhanced text editor for msr file editing with block insertion support." alt="" coords="10,81,112,109"/>
<area shape="rect" title=" " alt="" coords="5,5,117,33"/>
<area shape="poly" title=" " alt="" coords="64,49,64,81,58,81,58,49"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for PSubTextEdit:</div>
<div class="dyncontent">
<div class="center"><img src="classPSubTextEdit__coll__graph.png" border="0" usemap="#aPSubTextEdit_coll__map" alt="Collaboration graph"/></div>
<map name="aPSubTextEdit_coll__map" id="aPSubTextEdit_coll__map">
<area shape="rect" title="Enhanced text editor for msr file editing with block insertion support." alt="" coords="49,191,150,218"/>
<area shape="rect" title=" " alt="" coords="5,98,117,126"/>
<area shape="poly" title=" " alt="" coords="75,139,97,189,92,191,70,141"/>
<area shape="rect" href="classPAdmin.html" title="Central administration class for musredit configuration management." alt="" coords="140,98,208,126"/>
<area shape="poly" title=" " alt="" coords="156,140,112,192,108,189,152,136"/>
<area shape="rect" title=" " alt="" coords="78,5,148,33"/>
<area shape="poly" title=" " alt="" coords="132,44,168,96,163,99,128,47"/>
<area shape="rect" href="structPMsr2DataParam.html" title="Parameter structure for msr2data tool integration." alt="" coords="172,5,297,33"/>
<area shape="poly" title=" " alt="" coords="220,47,185,99,181,96,215,44"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-slots" name="pub-slots"></a>
Public Slots</h2></td></tr>
<tr class="memitem:a454c689b4a96e41bb67e6d4c10b0bcaa" id="r_a454c689b4a96e41bb67e6d4c10b0bcaa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a454c689b4a96e41bb67e6d4c10b0bcaa">insertTitle</a> ()</td></tr>
<tr class="memdesc:a454c689b4a96e41bb67e6d4c10b0bcaa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a title block via dialog. <br /></td></tr>
<tr class="separator:a454c689b4a96e41bb67e6d4c10b0bcaa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a561ceba5428d57e419c57a2167baffc0" id="r_a561ceba5428d57e419c57a2167baffc0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a561ceba5428d57e419c57a2167baffc0">insertParameterBlock</a> ()</td></tr>
<tr class="memdesc:a561ceba5428d57e419c57a2167baffc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a FITPARAMETER block via dialog. <br /></td></tr>
<tr class="separator:a561ceba5428d57e419c57a2167baffc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a8c50f9f53ac79ba9d7b39e93656ce4" id="r_a7a8c50f9f53ac79ba9d7b39e93656ce4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7a8c50f9f53ac79ba9d7b39e93656ce4">insertTheoryFunction</a> (QString name)</td></tr>
<tr class="memdesc:a7a8c50f9f53ac79ba9d7b39e93656ce4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a specific theory function. <br /></td></tr>
<tr class="separator:a7a8c50f9f53ac79ba9d7b39e93656ce4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1487e2b8a7828d305fb761027a33824f" id="r_a1487e2b8a7828d305fb761027a33824f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1487e2b8a7828d305fb761027a33824f">insertTheoryBlock</a> ()</td></tr>
<tr class="memdesc:a1487e2b8a7828d305fb761027a33824f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a THEORY block via dialog. <br /></td></tr>
<tr class="separator:a1487e2b8a7828d305fb761027a33824f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e5cd529f7870b64eae15213672845f0" id="r_a3e5cd529f7870b64eae15213672845f0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3e5cd529f7870b64eae15213672845f0">insertFunctionBlock</a> ()</td></tr>
<tr class="memdesc:a3e5cd529f7870b64eae15213672845f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a FUNCTIONS block via dialog. <br /></td></tr>
<tr class="separator:a3e5cd529f7870b64eae15213672845f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa054e387286430160b58f797c797e85" id="r_afa054e387286430160b58f797c797e85"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afa054e387286430160b58f797c797e85">insertAsymRunBlock</a> ()</td></tr>
<tr class="memdesc:afa054e387286430160b58f797c797e85"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts an asymmetry RUN block via dialog. <br /></td></tr>
<tr class="separator:afa054e387286430160b58f797c797e85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfc206694ac202c6b7b749f69254dcc2" id="r_adfc206694ac202c6b7b749f69254dcc2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adfc206694ac202c6b7b749f69254dcc2">insertSingleHistRunBlock</a> ()</td></tr>
<tr class="memdesc:adfc206694ac202c6b7b749f69254dcc2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a single histogram RUN block via dialog. <br /></td></tr>
<tr class="separator:adfc206694ac202c6b7b749f69254dcc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a564c9cb70a58b2ae2802966b0e5253ad" id="r_a564c9cb70a58b2ae2802966b0e5253ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a564c9cb70a58b2ae2802966b0e5253ad">insertNonMusrRunBlock</a> ()</td></tr>
<tr class="memdesc:a564c9cb70a58b2ae2802966b0e5253ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a non-µSR RUN block via dialog. <br /></td></tr>
<tr class="separator:a564c9cb70a58b2ae2802966b0e5253ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dc5e273b9a44e4b1a300a345a472f76" id="r_a7dc5e273b9a44e4b1a300a345a472f76"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7dc5e273b9a44e4b1a300a345a472f76">insertCommandBlock</a> ()</td></tr>
<tr class="memdesc:a7dc5e273b9a44e4b1a300a345a472f76"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a default COMMANDS block. <br /></td></tr>
<tr class="separator:a7dc5e273b9a44e4b1a300a345a472f76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27ead40e0403fc9cde5bc236d3d96aa8" id="r_a27ead40e0403fc9cde5bc236d3d96aa8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a27ead40e0403fc9cde5bc236d3d96aa8">insertFourierBlock</a> ()</td></tr>
<tr class="memdesc:a27ead40e0403fc9cde5bc236d3d96aa8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a FOURIER block via dialog. <br /></td></tr>
<tr class="separator:a27ead40e0403fc9cde5bc236d3d96aa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21c77edc782401500e77f4ac331fd3d6" id="r_a21c77edc782401500e77f4ac331fd3d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a21c77edc782401500e77f4ac331fd3d6">insertPlotBlock</a> ()</td></tr>
<tr class="memdesc:a21c77edc782401500e77f4ac331fd3d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a PLOT block via dialog. <br /></td></tr>
<tr class="separator:a21c77edc782401500e77f4ac331fd3d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63d6b4028afb9043d02317c76589e0ba" id="r_a63d6b4028afb9043d02317c76589e0ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a63d6b4028afb9043d02317c76589e0ba">insertStatisticBlock</a> ()</td></tr>
<tr class="memdesc:a63d6b4028afb9043d02317c76589e0ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot: Inserts a default STATISTIC block. <br /></td></tr>
<tr class="separator:a63d6b4028afb9043d02317c76589e0ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8251d771c2790d62e2c5e53effcb67ff" id="r_a8251d771c2790d62e2c5e53effcb67ff"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8251d771c2790d62e2c5e53effcb67ff">PSubTextEdit</a> (<a class="el" href="classPAdmin.html">PAdmin</a> *admin=0, QWidget *parent=0)</td></tr>
<tr class="memdesc:a8251d771c2790d62e2c5e53effcb67ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs the enhanced text editor. <br /></td></tr>
<tr class="separator:a8251d771c2790d62e2c5e53effcb67ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6135bd4da54f3c1ee31aece475d2fd97" id="r_a6135bd4da54f3c1ee31aece475d2fd97"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6135bd4da54f3c1ee31aece475d2fd97">~PSubTextEdit</a> ()</td></tr>
<tr class="memdesc:a6135bd4da54f3c1ee31aece475d2fd97"><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual destructor. <br /></td></tr>
<tr class="separator:a6135bd4da54f3c1ee31aece475d2fd97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5d7ff6921b71556b0128af757673bf5" id="r_aa5d7ff6921b71556b0128af757673bf5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa5d7ff6921b71556b0128af757673bf5">getFitType</a> ()</td></tr>
<tr class="memdesc:aa5d7ff6921b71556b0128af757673bf5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the fit type from the current msr file content. <br /></td></tr>
<tr class="separator:aa5d7ff6921b71556b0128af757673bf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a52083845a09e7d73d7c59eb031596072" id="r_a52083845a09e7d73d7c59eb031596072"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classPAdmin.html">PAdmin</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a52083845a09e7d73d7c59eb031596072">fAdmin</a></td></tr>
<tr class="memdesc:a52083845a09e7d73d7c59eb031596072"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to administration object with theory functions, help URLs, and configuration. <br /></td></tr>
<tr class="separator:a52083845a09e7d73d7c59eb031596072"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Enhanced text editor for msr file editing with block insertion support. </p>
<p>This class extends QPlainTextEdit to provide specialized editing capabilities for musrfit msr files. It offers dialog-based assistants for inserting the various structured blocks that comprise an msr file, reducing errors and improving workflow efficiency.</p>
<dl class="section user"><dt>MSR File Structure:</dt><dd>An msr file contains several required and optional blocks:<ul>
<li><b>Title</b>: Optional descriptive title</li>
<li><b>FITPARAMETER</b>: Fit parameters with initial values and constraints</li>
<li><b>THEORY</b>: Mathematical theory functions describing the expected signal</li>
<li><b>FUNCTIONS</b>: User-defined mathematical functions</li>
<li><b>RUN</b>: One or more run blocks specifying data files and fit configuration</li>
<li><b>COMMANDS</b>: MINUIT minimization commands</li>
<li><b>FOURIER</b>: Optional Fourier transform specifications</li>
<li><b>PLOT</b>: Plot configuration for data visualization</li>
<li><b>STATISTIC</b>: Fit results (chi-square, NDF, etc.)</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Block Insertion Features:</dt><dd>Each insertion method launches a specialized dialog that:<ul>
<li>Guides users through required and optional parameters</li>
<li>Validates input to prevent syntax errors</li>
<li>Provides context-sensitive help</li>
<li>Inserts properly formatted text at cursor position</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Run Block Types:</dt><dd>Different fit types require different run block formats:<ul>
<li><b>Asymmetry (fittype 2)</b>: Standard µSR asymmetry analysis</li>
<li><b>Single Histogram (fittype 0)</b>: Direct histogram fitting</li>
<li><b>Non-µSR (fittype 8)</b>: General x-y data fitting</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Theory Function Support:</dt><dd>The class provides access to all available theory functions from the <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> configuration, allowing quick insertion of common functions like:<ul>
<li>Exponential relaxation (simpleExp, simpleGss)</li>
<li>Oscillations (cosPol, polyKT)</li>
<li>Static Kubo-Toyabe (statKT, dynKT)</li>
<li>User-defined functions (userFcn)</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Validation and Error Handling:</dt><dd><ul>
<li>Input validation occurs during block creation</li>
<li>Invalid or incomplete data triggers warning dialogs</li>
<li>Default values are inserted for missing critical parameters</li>
<li>Users are informed about required corrections</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Workflow Integration:</dt><dd><ul>
<li>Tab-based interface allows multiple files open simultaneously</li>
<li>Each tab contains a <a class="el" href="classPSubTextEdit.html" title="Enhanced text editor for msr file editing with block insertion support.">PSubTextEdit</a> instance</li>
<li>Cursor position determines insertion point</li>
<li>Undo/redo support through QPlainTextEdit base class</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This class is used as the editor widget within each tab of musredit. </dd>
<dd>
All block insertion operations are undoable via standard edit commands. </dd>
<dd>
The class relies on <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> for theory function definitions and help URLs.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> For theory function definitions and configuration </dd>
<dd>
<a class="el" href="classPGetTitleBlockDialog.html" title="Dialog for creating and editing TITLE blocks in msr files.">PGetTitleBlockDialog</a> For title input </dd>
<dd>
<a class="el" href="classPGetParameterBlockDialog.html" title="Dialog for creating FITPARAMETER blocks in msr files.">PGetParameterBlockDialog</a> For parameter block creation </dd>
<dd>
<a class="el" href="classPGetTheoryBlockDialog.html" title="Dialog for creating THEORY blocks in msr files.">PGetTheoryBlockDialog</a> For theory block creation </dd>
<dd>
<a class="el" href="classPGetFunctionsBlockDialog.html" title="Dialog for creating FUNCTIONS blocks in msr files.">PGetFunctionsBlockDialog</a> For functions block creation </dd>
<dd>
<a class="el" href="classPGetAsymmetryRunBlockDialog.html" title="Dialog for creating asymmetry-type RUN blocks in msr files.">PGetAsymmetryRunBlockDialog</a> For asymmetry run blocks </dd>
<dd>
<a class="el" href="classPGetSingleHistoRunBlockDialog.html" title="Dialog for creating single histogram type RUN blocks in msr files.">PGetSingleHistoRunBlockDialog</a> For single histogram run blocks </dd>
<dd>
<a class="el" href="classPGetNonMusrRunBlockDialog.html" title="Dialog for creating non-muSR type RUN blocks in msr files.">PGetNonMusrRunBlockDialog</a> For non-µSR run blocks </dd>
<dd>
<a class="el" href="classPGetFourierBlockDialog.html" title="Dialog for creating FOURIER blocks in msr files.">PGetFourierBlockDialog</a> For Fourier block creation </dd>
<dd>
<a class="el" href="classPGetPlotBlockDialog.html" title="Dialog for creating PLOT blocks in msr files.">PGetPlotBlockDialog</a> For plot block creation </dd></dl>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8h_source.html#l00128">128</a> of file <a class="el" href="PSubTextEdit_8h_source.html">PSubTextEdit.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a8251d771c2790d62e2c5e53effcb67ff" name="a8251d771c2790d62e2c5e53effcb67ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8251d771c2790d62e2c5e53effcb67ff">&#9670;&#160;</a></span>PSubTextEdit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PSubTextEdit::PSubTextEdit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classPAdmin.html">PAdmin</a> *</td> <td class="paramname"><span class="paramname"><em>admin</em></span><span class="paramdefsep"> = </span><span class="paramdefval">0</span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">QWidget *</td> <td class="paramname"><span class="paramname"><em>parent</em></span><span class="paramdefsep"> = </span><span class="paramdefval">0</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs the enhanced text editor. </p>
<p>Constructor - Initializes the enhanced text editor.</p>
<p>Initializes the text editor with access to the global administration object for theory functions and configuration.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">admin</td><td>Pointer to <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> object containing theory function definitions, help URLs, and application configuration. If nullptr, block insertion features may not work properly. </td></tr>
<tr><td class="paramname">parent</td><td>Pointer to parent widget. Typically nullptr as this widget is embedded in a tab widget.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> For the global administration object</dd></dl>
<p>Constructs a <a class="el" href="classPSubTextEdit.html" title="Enhanced text editor for msr file editing with block insertion support.">PSubTextEdit</a> instance with access to the global administration object. The constructor is minimal, delegating most initialization to the QPlainTextEdit base class.</p>
<p>The administration object provides:</p><ul>
<li>Theory function definitions for block insertion</li>
<li>Help URLs for context-sensitive documentation</li>
<li>Application configuration and preferences</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">admin</td><td>Pointer to the <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> global administration object. This pointer is stored for later use by block insertion methods. If nullptr, block insertion features will not work properly as they depend on theory function definitions and help URLs. </td></tr>
<tr><td class="paramname">parent</td><td>Pointer to the parent widget. Typically nullptr as this editor is embedded in a QTabWidget where the tab widget manages widget ownership and lifetime.</td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The constructor performs no special initialization beyond storing the admin pointer. All QPlainTextEdit functionality is available immediately. </dd>
<dd>
Block insertion methods should check fAdmin for nullptr before use, though in normal operation it should never be null.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> For the global administration object </dd>
<dd>
QPlainTextEdit For base class functionality </dd></dl>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00101">101</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a6135bd4da54f3c1ee31aece475d2fd97" name="a6135bd4da54f3c1ee31aece475d2fd97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6135bd4da54f3c1ee31aece475d2fd97">&#9670;&#160;</a></span>~PSubTextEdit()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual PSubTextEdit::~PSubTextEdit </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel virtual">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Virtual destructor. </p>
<p>Default destructor. Qt's parent-child ownership handles cleanup.</p>
<dl class="section note"><dt>Note</dt><dd>Declared virtual for proper cleanup in inheritance hierarchies. </dd></dl>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8h_source.html#l00156">156</a> of file <a class="el" href="PSubTextEdit_8h_source.html">PSubTextEdit.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa5d7ff6921b71556b0128af757673bf5" name="aa5d7ff6921b71556b0128af757673bf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5d7ff6921b71556b0128af757673bf5">&#9670;&#160;</a></span>getFitType()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int PSubTextEdit::getFitType </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the fit type from the current msr file content. </p>
<p>Parses the text editor content to find and extract the fittype value. The fittype determines the analysis mode and run block format:</p><ul>
<li>0: Single histogram fit</li>
<li>2: Asymmetry fit</li>
<li>4: µSR-MnF fit</li>
<li>8: Non-µSR fit</li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>int The fittype value if found and valid, -1 otherwise.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Returns -1 if "fittype" keyword not found or value is invalid. </dd>
<dd>
Only finds the first occurrence of "fittype" in the document.</dd></dl>
<p>Parses the entire text editor content to locate the "fittype" keyword and extract its associated integer value. The fittype determines the analysis mode and affects which parameters are required in RUN blocks.</p>
<p><b>Parsing Algorithm:</b></p><ol type="1">
<li>Convert all editor text to QString</li>
<li>Search for first occurrence of "fittype" keyword</li>
<li>Skip whitespace after "fittype"</li>
<li>Extract first non-whitespace character after "fittype"</li>
<li>Convert character to integer</li>
<li>Return value if conversion succeeds</li>
</ol>
<p><b>Fittype Values:</b></p><ul>
<li><b>0</b>: Single histogram fit - fits a single detector histogram directly</li>
<li><b>2</b>: Asymmetry fit - calculates asymmetry from forward/backward histograms</li>
<li><b>4</b>: µSR-MnF fit - special mode for muon spin rotation in magnetic fields</li>
<li><b>8</b>: Non-µSR fit - general x-y data fitting for arbitrary data</li>
</ul>
<p><b>Return Value Interpretation:</b></p><ul>
<li>Valid fittype (0, 2, 4, 8): Normal operation, fittype found and parsed</li>
<li><b>-1</b>: Error condition - keyword not found or invalid value</li>
</ul>
<p><b>Usage Context:</b> This method is useful for:</p><ul>
<li>Validating msr file completeness before saving</li>
<li>Determining appropriate RUN block format for insertion</li>
<li>Conditional behavior based on analysis mode</li>
<li>Error checking during file editing</li>
</ul>
<p><b>Limitations:</b></p><ul>
<li>Only finds the first occurrence of "fittype"</li>
<li>Does not validate that fittype is in a RUN block context</li>
<li>Single-digit parsing only (assumes fittype value is 0-9)</li>
<li>Case-sensitive search for "fittype" keyword</li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>int The fittype value (0, 2, 4, or 8) if found and valid, -1 if "fittype" keyword not found, value is not numeric, or parsing fails for any reason.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This method searches the entire document on each call; it is not optimized for frequent queries. </dd>
<dd>
Only the first occurrence of "fittype" is processed; multiple RUN blocks with different fittypes will only report the first. </dd>
<dd>
The method assumes fittype appears as "fittype&lt;whitespace&gt;&lt;digit&gt;".</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#afa054e387286430160b58f797c797e85" title="Slot: Inserts an asymmetry RUN block via dialog.">insertAsymRunBlock()</a> Uses fittype 2 </dd>
<dd>
<a class="el" href="#adfc206694ac202c6b7b749f69254dcc2" title="Slot: Inserts a single histogram RUN block via dialog.">insertSingleHistRunBlock()</a> Uses fittype 0 </dd>
<dd>
<a class="el" href="#a564c9cb70a58b2ae2802966b0e5253ad" title="Slot: Inserts a non-µSR RUN block via dialog.">insertNonMusrRunBlock()</a> Uses fittype 8 </dd></dl>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00164">164</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="afa054e387286430160b58f797c797e85" name="afa054e387286430160b58f797c797e85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa054e387286430160b58f797c797e85">&#9670;&#160;</a></span>insertAsymRunBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertAsymRunBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts an asymmetry RUN block via dialog. </p>
<p>Launches <a class="el" href="classPGetAsymmetryRunBlockDialog.html" title="Dialog for creating asymmetry-type RUN blocks in msr files.">PGetAsymmetryRunBlockDialog</a> for creating a RUN block configured for asymmetry fitting (fittype 2). This is the most common µSR analysis mode with forward/backward detector histograms and asymmetry calculation.</p>
<p>Validates all required fields and provides default values for missing critical parameters with appropriate warnings.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetAsymmetryRunBlockDialog.html" title="Dialog for creating asymmetry-type RUN blocks in msr files.">PGetAsymmetryRunBlockDialog</a> For the asymmetry run block dialog</dd></dl>
<p>Starts the msr-asymmetry-run input dialog window. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00384">384</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a7dc5e273b9a44e4b1a300a345a472f76" name="a7dc5e273b9a44e4b1a300a345a472f76"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7dc5e273b9a44e4b1a300a345a472f76">&#9670;&#160;</a></span>insertCommandBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertCommandBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a default COMMANDS block. </p>
<p>Inserts a standard COMMANDS block with common MINUIT commands for batch processing:</p><ul>
<li>SET BATCH (suppress interactive prompts)</li>
<li>STRATEGY 1 (balance speed and accuracy)</li>
<li>MINIMIZE (perform minimization)</li>
<li>MINOS (commented out - for asymmetric errors)</li>
<li>SAVE (save parameters)</li>
<li>END RETURN (exit MINUIT)</li>
</ul>
<p>Users can edit the block after insertion to customize the fit strategy.</p>
<p>Inserts a standard COMMANDS block with commonly used MINUIT commands for batch fitting. This block controls the MINUIT minimizer behavior during the fit process.</p>
<p><b>Inserted Commands:</b></p>
<ul>
<li><b>SET BATCH</b>: Suppresses interactive prompts, allowing unattended execution</li>
<li><b>STRATEGY 1</b>: Balance between speed and accuracy (0=fast, 2=thorough)</li>
<li><b>MINIMIZE</b>: Executes the minimization algorithm to find best parameters</li>
<li>**#MINOS**: (Commented out) Computes asymmetric parameter errors</li>
<li><b>SAVE</b>: Saves fitted parameter values back to msr file</li>
<li><b>END RETURN</b>: Exits MINUIT and returns to musrfit</li>
</ul>
<p><b>MINUIT Strategy Levels:</b></p><ul>
<li>Strategy 0: Fast, less accurate gradient/Hessian calculations</li>
<li>Strategy 1: Default, good balance (recommended for most fits)</li>
<li>Strategy 2: Thorough, most accurate but slowest</li>
</ul>
<p><b>MINOS Command:</b> MINOS is commented out (#MINOS) by default because:</p><ul>
<li>It significantly increases fit time</li>
<li>It's only needed when asymmetric errors are important</li>
<li>Users can uncomment it when needed for publication-quality results</li>
</ul>
<p><b>Customization:</b> Users can edit the inserted block to:</p><ul>
<li>Change STRATEGY level based on fit complexity</li>
<li>Uncomment MINOS for asymmetric error calculation</li>
<li>Add additional MINUIT commands (SIMPLEX, SEEK, IMPROVE, etc.)</li>
<li>Modify convergence criteria with SET commands</li>
</ul>
<p><b>Block Structure:</b> The block is delimited by:</p><ul>
<li>Header: "###..." separator line</li>
<li>Body: "COMMANDS" keyword followed by command lines</li>
<li>Footer: "END RETURN" to exit command mode</li>
<li>Double newline for separation from next block</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This is the only insertion method that doesn't use a dialog, as COMMANDS blocks have a standard structure. </dd>
<dd>
The block is inserted at current cursor position with proper formatting and delimiters. </dd>
<dd>
All insertions are undoable via Edit → Undo.</dd></dl>
<dl class="section see"><dt>See also</dt><dd>MINUIT documentation for complete command reference </dd></dl>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00701">701</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a27ead40e0403fc9cde5bc236d3d96aa8" name="a27ead40e0403fc9cde5bc236d3d96aa8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27ead40e0403fc9cde5bc236d3d96aa8">&#9670;&#160;</a></span>insertFourierBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertFourierBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a FOURIER block via dialog. </p>
<p>Launches <a class="el" href="classPGetFourierBlockDialog.html" title="Dialog for creating FOURIER blocks in msr files.">PGetFourierBlockDialog</a> for creating the optional FOURIER block that configures Fourier transform parameters for frequency-domain analysis of µSR data.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetFourierBlockDialog.html" title="Dialog for creating FOURIER blocks in msr files.">PGetFourierBlockDialog</a> For the Fourier block dialog</dd></dl>
<p>Starts the msr-Fourier input dialog window. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00717">717</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a3e5cd529f7870b64eae15213672845f0" name="a3e5cd529f7870b64eae15213672845f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e5cd529f7870b64eae15213672845f0">&#9670;&#160;</a></span>insertFunctionBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertFunctionBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a FUNCTIONS block via dialog. </p>
<p>Launches <a class="el" href="classPGetFunctionsBlockDialog.html" title="Dialog for creating FUNCTIONS blocks in msr files.">PGetFunctionsBlockDialog</a> for creating user-defined mathematical functions that can be used in theory expressions. Functions allow complex mathematical expressions to be reused.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetFunctionsBlockDialog.html" title="Dialog for creating FUNCTIONS blocks in msr files.">PGetFunctionsBlockDialog</a> For the functions block dialog</dd></dl>
<p>Starts the msr-functions input dialog window. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00366">366</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a564c9cb70a58b2ae2802966b0e5253ad" name="a564c9cb70a58b2ae2802966b0e5253ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a564c9cb70a58b2ae2802966b0e5253ad">&#9670;&#160;</a></span>insertNonMusrRunBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertNonMusrRunBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a non-µSR RUN block via dialog. </p>
<p>Launches <a class="el" href="classPGetNonMusrRunBlockDialog.html" title="Dialog for creating non-muSR type RUN blocks in msr files.">PGetNonMusrRunBlockDialog</a> for creating a RUN block configured for general x-y data fitting (fittype 8). This mode is used for fitting arbitrary tabulated data, not specifically µSR histograms.</p>
<p>Validates all required fields and provides default values for missing critical parameters with appropriate warnings.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetNonMusrRunBlockDialog.html" title="Dialog for creating non-muSR type RUN blocks in msr files.">PGetNonMusrRunBlockDialog</a> For the non-µSR run block dialog</dd></dl>
<p>Starts the msr-nonMusr-run input dialog window. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00594">594</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a561ceba5428d57e419c57a2167baffc0" name="a561ceba5428d57e419c57a2167baffc0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a561ceba5428d57e419c57a2167baffc0">&#9670;&#160;</a></span>insertParameterBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertParameterBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a FITPARAMETER block via dialog. </p>
<p>Launches <a class="el" href="classPGetParameterBlockDialog.html" title="Dialog for creating FITPARAMETER blocks in msr files.">PGetParameterBlockDialog</a> for creating the FITPARAMETER block with initial values, constraints, and parameter naming. This block defines all parameters used in the theory functions.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetParameterBlockDialog.html" title="Dialog for creating FITPARAMETER blocks in msr files.">PGetParameterBlockDialog</a> For the parameter block dialog</dd></dl>
<p>Starts the msr-fit-parameter input dialog window. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00237">237</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a21c77edc782401500e77f4ac331fd3d6" name="a21c77edc782401500e77f4ac331fd3d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a21c77edc782401500e77f4ac331fd3d6">&#9670;&#160;</a></span>insertPlotBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertPlotBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a PLOT block via dialog. </p>
<p>Launches <a class="el" href="classPGetPlotBlockDialog.html" title="Dialog for creating PLOT blocks in msr files.">PGetPlotBlockDialog</a> for creating the PLOT block that configures data visualization options including plot ranges, what to plot (data, theory, difference), and display options.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetPlotBlockDialog.html" title="Dialog for creating PLOT blocks in msr files.">PGetPlotBlockDialog</a> For the plot block dialog</dd></dl>
<p>Starts the msr-plot input dialog window. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00734">734</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="adfc206694ac202c6b7b749f69254dcc2" name="adfc206694ac202c6b7b749f69254dcc2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adfc206694ac202c6b7b749f69254dcc2">&#9670;&#160;</a></span>insertSingleHistRunBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertSingleHistRunBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a single histogram RUN block via dialog. </p>
<p>Launches <a class="el" href="classPGetSingleHistoRunBlockDialog.html" title="Dialog for creating single histogram type RUN blocks in msr files.">PGetSingleHistoRunBlockDialog</a> for creating a RUN block configured for single histogram fitting (fittype 0). This mode fits a single histogram directly without asymmetry calculation.</p>
<p>Validates all required fields and provides default values for missing critical parameters with appropriate warnings.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetSingleHistoRunBlockDialog.html" title="Dialog for creating single histogram type RUN blocks in msr files.">PGetSingleHistoRunBlockDialog</a> For the single histogram run block dialog</dd></dl>
<p>Starts the msr-single-historgram-run input dialog window. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00489">489</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a63d6b4028afb9043d02317c76589e0ba" name="a63d6b4028afb9043d02317c76589e0ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63d6b4028afb9043d02317c76589e0ba">&#9670;&#160;</a></span>insertStatisticBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertStatisticBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a default STATISTIC block. </p>
<p>Inserts a STATISTIC block template with placeholder values for fit results. The block includes:</p><ul>
<li>Current timestamp</li>
<li>Placeholder for chi-square value</li>
<li>Placeholder for NDF (number of degrees of freedom)</li>
<li>Placeholder for chi-square/NDF ratio</li>
</ul>
<p>After fitting, musrfit will update these placeholders with actual values.</p>
<p>Inserts a STATISTIC block template with the current timestamp and placeholder values for fit results. After fitting, musrfit updates these placeholders with actual fit statistics.</p>
<p><b>Inserted Content:</b></p>
<div class="fragment"><div class="line"><span class="preprocessor">###############################################################</span></div>
<div class="line">STATISTIC --- 2025-01-15 14:23:45</div>
<div class="line">chisq = ????, NDF = ????, chisq/NDF = ????</div>
</div><!-- fragment --><p><b>Block Components:</b></p><ul>
<li><b>Separator line</b>: Visual delimiter (63 # characters)</li>
<li><b>STATISTIC keyword</b>: Identifies the block type</li>
<li><b>Timestamp</b>: Current date and time in "yyyy-MM-dd hh:mm:ss" format</li>
<li><b>Placeholder line</b>: Template for fit quality metrics</li>
</ul>
<p><b>Placeholder Values:</b></p><ul>
<li><b>chisq</b>: Chi-square value measuring fit quality (lower is better)</li>
<li><b>NDF</b>: Number of degrees of freedom (data points - parameters)</li>
<li><b>chisq/NDF</b>: Normalized chi-square (should be ~1 for good fit)</li>
</ul>
<p><b>Fit Quality Interpretation:</b></p><ul>
<li>chisq/NDF ≈ 1: Good fit, data matches theory within errors</li>
<li>chisq/NDF &lt;&lt; 1: Overestimated errors or over-fitting</li>
<li>chisq/NDF &gt;&gt; 1: Underestimated errors or poor model</li>
</ul>
<p><b>Usage Workflow:</b></p><ol type="1">
<li>User inserts STATISTIC block template (this method)</li>
<li>User completes msr file with other required blocks</li>
<li>User runs musrfit on the msr file</li>
<li>musrfit replaces "????" with actual values</li>
<li>User reviews fit statistics to assess quality</li>
</ol>
<p><b>Timestamp Purpose:</b> The timestamp records when the fit was performed, useful for:</p><ul>
<li>Tracking fit history and iterations</li>
<li>Documenting analysis workflow</li>
<li>Identifying most recent results</li>
<li>Version control and reproducibility</li>
</ul>
<p><b>Multiple STATISTIC Blocks:</b> Users can have multiple STATISTIC blocks to record fit history:</p><ul>
<li>Initial fit with default parameters</li>
<li>After parameter adjustments</li>
<li>After fixing certain parameters</li>
<li>Final publication-quality fit</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>The timestamp reflects insertion time, not fit time. musrfit updates the timestamp when it updates fit statistics. </dd>
<dd>
Placeholder "????" clearly indicates values not yet computed. </dd>
<dd>
Double newline provides separation from subsequent content. </dd>
<dd>
Insertion is undoable via Edit → Undo.</dd></dl>
<dl class="section see"><dt>See also</dt><dd>QDateTime::currentDateTime() For timestamp generation </dd>
<dd>
musrfit For the fitting application that updates placeholders </dd></dl>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00809">809</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a1487e2b8a7828d305fb761027a33824f" name="a1487e2b8a7828d305fb761027a33824f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1487e2b8a7828d305fb761027a33824f">&#9670;&#160;</a></span>insertTheoryBlock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertTheoryBlock </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a THEORY block via dialog. </p>
<p>Launches <a class="el" href="classPGetTheoryBlockDialog.html" title="Dialog for creating THEORY blocks in msr files.">PGetTheoryBlockDialog</a> which provides an interactive interface for building complex theory blocks by combining multiple theory functions with addition and multiplication operators.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetTheoryBlockDialog.html" title="Dialog for creating THEORY blocks in msr files.">PGetTheoryBlockDialog</a> For the theory block dialog</dd></dl>
<p>Starts the msr-theory input dialog window. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00348">348</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a7a8c50f9f53ac79ba9d7b39e93656ce4" name="a7a8c50f9f53ac79ba9d7b39e93656ce4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a8c50f9f53ac79ba9d7b39e93656ce4">&#9670;&#160;</a></span>insertTheoryFunction</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertTheoryFunction </td>
<td>(</td>
<td class="paramtype">QString</td> <td class="paramname"><span class="paramname"><em>name</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a specific theory function. </p>
<p>Inserts a single theory function line based on the given function name. The function is looked up in the <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> theory function registry and formatted with placeholder parameter numbers.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>Label of the theory function to insert (e.g., "simpleGss", "asymmetry", "userFcn").</td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This is typically called from a menu action triggered by the user selecting a specific theory function.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPAdmin.html#a35b908e12cae5e6591b93b24a8c4166e" title="Get a theory function definition by index.">PAdmin::getTheoryItem()</a> For theory function definitions</dd></dl>
<p>Looks up the specified theory function by name in the <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> theory registry, formats it with placeholder parameters, and inserts it at the current cursor position.</p>
<p><b>Function Lookup Process:</b></p><ol type="1">
<li>Search <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> theory registry for function matching given label</li>
<li>If not found, silently return (no insertion)</li>
<li>If found, retrieve <a class="el" href="structPTheory.html" title="Structure holding information about a musrfit theory function.">PTheory</a> definition</li>
<li>Format function line with name, parameters, and comment</li>
</ol>
<p><b>Formatted Output:</b> Standard functions: </p><div class="fragment"><div class="line">functionName 1 2 3 (comment describing parameters)</div>
</div><!-- fragment --><p>User-defined functions (userFcn): </p><div class="fragment"><div class="line">userFcn libMyLibrary.so TMyFunction 1 2 (parameters)</div>
</div><!-- fragment --><p><b>Parameter Placeholders:</b> Numbers (1, 2, 3, ...) are placeholder parameter indices that users must replace with actual FITPARAMETER references or map variables before the msr file can be used for fitting.</p>
<p><b>User Function Special Handling:</b> The "userFcn" theory function requires library and function names, so placeholder values "libMyLibrary.so" and "TMyFunction" are inserted for the user to replace with actual names.</p>
<p><b>Insertion Behavior:</b></p><ul>
<li>Text inserted at current cursor position</li>
<li>Trailing newline for proper block separation</li>
<li>Existing text unaffected</li>
<li>Operation is undoable</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>Label of the theory function to insert. Must match a label in the <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> theory registry (e.g., "simpleGss", "asymmetry", "cosPol", "userFcn").</td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>If name not found in registry, method returns silently without error message or user feedback. </dd>
<dd>
Parameter numbers start at 1 (not 0) to match musrfit conventions. </dd>
<dd>
The comment from <a class="el" href="structPTheory.html" title="Structure holding information about a musrfit theory function.">PTheory</a> provides parameter descriptions to guide users in understanding what each parameter represents.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPAdmin.html#a35b908e12cae5e6591b93b24a8c4166e" title="Get a theory function definition by index.">PAdmin::getTheoryItem()</a> For retrieving theory function definitions </dd>
<dd>
<a class="el" href="structPTheory.html" title="Structure holding information about a musrfit theory function.">PTheory</a> For theory function structure definition </dd>
<dd>
<a class="el" href="#a1487e2b8a7828d305fb761027a33824f" title="Slot: Inserts a THEORY block via dialog.">insertTheoryBlock()</a> For interactive theory block building </dd></dl>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00305">305</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<a id="a454c689b4a96e41bb67e6d4c10b0bcaa" name="a454c689b4a96e41bb67e6d4c10b0bcaa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a454c689b4a96e41bb67e6d4c10b0bcaa">&#9670;&#160;</a></span>insertTitle</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PSubTextEdit::insertTitle </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot: Inserts a title block via dialog. </p>
<p>Launches <a class="el" href="classPGetTitleBlockDialog.html" title="Dialog for creating and editing TITLE blocks in msr files.">PGetTitleBlockDialog</a> for entering or editing the optional msr file title. If accepted, inserts the title text at the current cursor position.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetTitleBlockDialog.html" title="Dialog for creating and editing TITLE blocks in msr files.">PGetTitleBlockDialog</a> For the title input dialog</dd></dl>
<p>Launches <a class="el" href="classPGetTitleBlockDialog.html" title="Dialog for creating and editing TITLE blocks in msr files.">PGetTitleBlockDialog</a> to gather title input from the user. If the dialog is accepted, inserts the entered title at the current cursor position with a trailing newline.</p>
<p><b>Dialog Workflow:</b></p><ol type="1">
<li>Create <a class="el" href="classPGetTitleBlockDialog.html" title="Dialog for creating and editing TITLE blocks in msr files.">PGetTitleBlockDialog</a> with help URL from <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a></li>
<li>Display dialog modally (blocks until user responds)</li>
<li>If user accepts: retrieve title and insert into text editor</li>
<li>If user cancels: perform no action</li>
</ol>
<p><b>Insertion Behavior:</b></p><ul>
<li>Text is inserted at current cursor position</li>
<li>Trailing newline separates title from subsequent blocks</li>
<li>Existing text is not affected</li>
<li>Insertion is undoable via Edit → Undo</li>
</ul>
<p><b>Help Integration:</b> The dialog receives a help URL retrieved from <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> using the "title" key. This provides context-sensitive documentation about title block format and best practices.</p>
<dl class="section note"><dt>Note</dt><dd>Uses std::unique_ptr for automatic dialog cleanup. </dd>
<dd>
Null check on dialog pointer is defensive programming; in normal operation, make_unique should not return nullptr. </dd>
<dd>
The comment about hard-coded URLs is outdated; URLs are retrieved from <a class="el" href="classPAdmin.html" title="Central administration class for musredit configuration management.">PAdmin</a> configuration.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPGetTitleBlockDialog.html" title="Dialog for creating and editing TITLE blocks in msr files.">PGetTitleBlockDialog</a> For the title input dialog implementation </dd>
<dd>
<a class="el" href="classPAdmin.html#a0bca245a58808529e0ec7a36e3e420a5" title="Get the help URL for a specific documentation section.">PAdmin::getHelpUrl()</a> For help URL retrieval </dd>
<dd>
insertPlainText() Qt method for text insertion </dd></dl>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8cpp_source.html#l00219">219</a> of file <a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a52083845a09e7d73d7c59eb031596072" name="a52083845a09e7d73d7c59eb031596072"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52083845a09e7d73d7c59eb031596072">&#9670;&#160;</a></span>fAdmin</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classPAdmin.html">PAdmin</a>* PSubTextEdit::fAdmin</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to administration object with theory functions, help URLs, and configuration. </p>
<p class="definition">Definition at line <a class="el" href="PSubTextEdit_8h_source.html#l00333">333</a> of file <a class="el" href="PSubTextEdit_8h_source.html">PSubTextEdit.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/workspace/LMU/musrfit/src/musredit_qt6/musredit/<a class="el" href="PSubTextEdit_8h_source.html">PSubTextEdit.h</a></li>
<li>/workspace/LMU/musrfit/src/musredit_qt6/musredit/<a class="el" href="PSubTextEdit_8cpp_source.html">PSubTextEdit.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2
</small></address>
</div><!-- doc-content -->
</body>
</html>