<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>EngineForm</class>
 <widget class="QWidget" name="EngineForm">
  <property name="windowTitle">
    <string>VirtuGhan • Compute</string>
  </property>
  <property name="styleSheet">
   <string>QLineEdit, QComboBox, QDateEdit, QSpinBox, QListWidget { padding: 2px; }</string>
  </property>
  <layout class="QVBoxLayout" name="verticalLayout_root">

   <!-- Header -->
   <item>
    <layout class="QHBoxLayout" name="headerLayout">
     <item>
      <widget class="QLabel" name="titleLabel">
       <property name="text">
         <string>&lt;b&gt;VirtuGhan Compute (Derived Outputs)&lt;/b&gt;</string>
       </property>
      </widget>
     </item>
     <item>
      <spacer name="headerSpacer">
       <property name="orientation"><enum>Qt::Horizontal</enum></property>
       <property name="sizeHint" stdset="0">
        <size><width>40</width><height>20</height></size>
       </property>
      </spacer>
     </item>
     <item>
      <widget class="QPushButton" name="helpButton">
       <property name="text"><string>Help</string></property>
       <property name="toolTip"><string>Open documentation</string></property>
      </widget>
     </item>
    </layout>
   </item>

    <item>
     <widget class="QLabel" name="requiredHintLabel">
      <property name="text">
        <string>&lt;i&gt;* Required fields&lt;/i&gt;</string>
      </property>
     </widget>
    </item>

   <!-- Tabs -->
   <item>
    <widget class="QTabWidget" name="tabWidget">
     <property name="currentIndex"><number>0</number></property>

     <!-- Basics tab -->
     <widget class="QWidget" name="tabBasics">
      <attribute name="title"><string>Basics</string></attribute>
      <layout class="QVBoxLayout" name="basicsLayout" stretch="0,0,0,0,1">
       <property name="spacing"><number>2</number></property>

      <!-- Common Parameters (host only; real fields come from CommonParamsWidget) -->
      <item>
       <widget class="QGroupBox" name="groupCommon">
        <property name="title"><string>Common Parameters</string></property>
        <layout class="QVBoxLayout" name="layoutCommon">
         <property name="spacing"><number>2</number></property>
         <property name="leftMargin"><number>2</number></property>
         <property name="topMargin"><number>2</number></property>
         <property name="rightMargin"><number>2</number></property>
         <property name="bottomMargin"><number>2</number></property>
         <item>
          <widget class="QWidget" name="commonParamsContainer"/>
         </item>
        </layout>
       </widget>
      </item>

      <!-- Index Selection (Simple/Advanced mode) -->
      <item>
       <widget class="QGroupBox" name="groupIndex">
        <property name="title"><string>Index (Band Selector)</string></property>
        <layout class="QGridLayout" name="gridIndex">
         <property name="horizontalSpacing"><number>2</number></property>
         <property name="verticalSpacing"><number>2</number></property>
         <property name="leftMargin"><number>2</number></property>
         <property name="topMargin"><number>2</number></property>
         <property name="rightMargin"><number>2</number></property>
         <property name="bottomMargin"><number>2</number></property>

         <item row="0" column="0">
          <widget class="QLabel" name="labelMode">
           <property name="text"><string>Mode</string></property>
          </widget>
         </item>
         <item row="0" column="1" colspan="4">
          <layout class="QHBoxLayout" name="modeLayout">
           <property name="spacing"><number>8</number></property>
           <item>
            <widget class="QRadioButton" name="simpleModeRadio">
             <property name="text"><string>Simple (Presets)</string></property>
             <property name="checked"><bool>true</bool></property>
            </widget>
           </item>
           <item>
            <widget class="QRadioButton" name="advancedModeRadio">
             <property name="text"><string>Advanced (Manual)</string></property>
            </widget>
           </item>
           <item>
            <spacer name="modeSpacer">
             <property name="orientation"><enum>Qt::Horizontal</enum></property>
             <property name="sizeHint" stdset="0">
              <size><width>40</width><height>20</height></size>
             </property>
            </spacer>
           </item>
          </layout>
         </item>

         <item row="1" column="0">
          <widget class="QLabel" name="labelIndex">
           <property name="text"><string>Index</string></property>
           <property name="margin"><number>6</number></property>
          </widget>
         </item>
         <item row="1" column="1" colspan="4">
          <widget class="QComboBox" name="indexCombo">
           <property name="toolTip"><string>Select a preset spectral index</string></property>
          </widget>
         </item>

         <item row="2" column="0">
          <widget class="QLabel" name="labelFormulaRef">
           <property name="text"><string>Formula</string></property>
           <property name="margin"><number>6</number></property>
          </widget>
         </item>
         <item row="2" column="1" colspan="4">
          <widget class="QLabel" name="formulaReferenceLabel">
           <property name="text"><string>(formula will display here)</string></property>
           <property name="wordWrap"><bool>true</bool></property>
           <property name="toolTip"><string>Read-only formula reference for selected preset</string></property>
          </widget>
         </item>

         <item row="3" column="0">
          <widget class="QLabel" name="labelAdvancedBand1">
           <property name="text"><string>Band 1 *</string></property>
           <property name="visible"><bool>false</bool></property>
          </widget>
         </item>
         <item row="3" column="1">
          <widget class="QComboBox" name="advancedBand1Combo">
           <property name="visible"><bool>false</bool></property>
          </widget>
         </item>
         <item row="3" column="2">
          <widget class="QLabel" name="labelAdvancedBand2">
           <property name="text"><string>Band 2 *</string></property>
           <property name="visible"><bool>false</bool></property>
          </widget>
         </item>
         <item row="3" column="3" colspan="2">
          <widget class="QComboBox" name="advancedBand2Combo">
           <property name="visible"><bool>false</bool></property>
          </widget>
         </item>

         <item row="4" column="0">
          <widget class="QLabel" name="labelAdvancedFormula">
           <property name="text"><string>Formula *</string></property>
           <property name="visible"><bool>false</bool></property>
          </widget>
         </item>
         <item row="4" column="1" colspan="4">
          <widget class="QLineEdit" name="advancedFormulaEdit">
           <property name="placeholderText"><string>(band2-band1)/(band2+band1)</string></property>
           <property name="visible"><bool>false</bool></property>
          </widget>
         </item>

         <item row="5" column="0" colspan="5">
          <widget class="QLabel" name="indexTipLabel">
           <property name="text"><string>&lt;i&gt;Tip: If Band 1 and Band 2 resolutions differ, the compute module resamples; you''ll see a warning.&lt;/i&gt;</string></property>
             <property name="visible"><bool>true</bool></property>
          </widget>
         </item>

         <item row="6" column="0" colspan="5">
          <spacer name="indexStretch">
           <property name="orientation"><enum>Qt::Vertical</enum></property>
           <property name="sizeHint" stdset="0">
            <size><width>0</width><height>0</height></size>
           </property>
           <property name="sizePolicy">
            <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
          </spacer>
         </item>
        </layout>
       </widget>
      </item>

       <!-- AOI -->
       <item>
        <widget class="QGroupBox" name="groupAOI">
         <property name="title"><string>Area of Interest *</string></property>
         <layout class="QGridLayout" name="gridAOI">
          <property name="horizontalSpacing"><number>2</number></property>
          <property name="verticalSpacing"><number>2</number></property>
          <property name="leftMargin"><number>2</number></property>
          <property name="topMargin"><number>2</number></property>
          <property name="rightMargin"><number>2</number></property>
          <property name="bottomMargin"><number>2</number></property>

          <item row="0" column="0">
           <widget class="QLabel" name="labelAOIMode">
            <property name="text"><string>AOI mode</string></property>
           </widget>
          </item>
          <item row="0" column="1">
           <widget class="QComboBox" name="aoiModeCombo">
            <item><property name="text"><string>Map extent</string></property></item>
            <item><property name="text"><string>Draw polygon</string></property></item>
           </widget>
          </item>

          <item row="0" column="2">
           <widget class="QPushButton" name="aoiUseCanvasButton">
            <property name="text"><string>Use Canvas Extent</string></property>
            <property name="toolTip"><string>Capture current map canvas extent</string></property>
           </widget>
          </item>
          <item row="0" column="3">
           <widget class="QPushButton" name="aoiStartDrawButton">
            <property name="text"><string>Draw AOI</string></property>
            <property name="toolTip"><string>Draw polygon on map (right-click to finish)</string></property>
           </widget>
          </item>

          <item row="0" column="4">
           <widget class="QPushButton" name="aoiClearButton">
            <property name="text"><string>Clear</string></property>
            <property name="toolTip"><string>Clear current AOI</string></property>
           </widget>
          </item>

          <item row="1" column="0" colspan="5">
           <widget class="QLabel" name="aoiPreviewLabel">
            <property name="text"><string>&lt;i&gt;AOI: not set yet&lt;/i&gt;</string></property>
            <property name="toolTip"><string>Preview (xmin, ymin, xmax, ymax)</string></property>
           </widget>
          </item>

         </layout>
        </widget>
       </item>

       <!-- Aggregation & Options -->
       <item>
        <widget class="QGroupBox" name="groupAgg">
         <property name="title"><string>Aggregation &amp; Options</string></property>
         <layout class="QGridLayout" name="gridAgg">
          <property name="horizontalSpacing"><number>2</number></property>
          <property name="verticalSpacing"><number>2</number></property>
          <property name="leftMargin"><number>2</number></property>
          <property name="topMargin"><number>2</number></property>
          <property name="rightMargin"><number>2</number></property>
          <property name="bottomMargin"><number>2</number></property>
          <item row="0" column="0">
           <widget class="QLabel" name="labelOp"><property name="text"><string>Aggregation</string></property></widget>
          </item>
          <item row="0" column="1">
           <widget class="QComboBox" name="opCombo">
            <!-- Default to "none" (index 7) -->
            <property name="currentIndex"><number>1</number></property>
            <item><property name="text"><string>mean</string></property></item>
            <item><property name="text"><string>median</string></property></item>
            <item><property name="text"><string>max</string></property></item>
            <item><property name="text"><string>min</string></property></item>
            <item><property name="text"><string>std</string></property></item>
            <item><property name="text"><string>sum</string></property></item>
            <item><property name="text"><string>var</string></property></item>
            <item><property name="text"><string>none</string></property></item>
           </widget>
          </item>
          <item row="0" column="2">
           <widget class="QCheckBox" name="timeseriesCheck">
            <property name="text"><string>Generate timeseries</string></property>
            <property name="toolTip"><string>Create intermediate results and a GIF</string></property>
            <!-- Default unchecked -->
            <property name="checked"><bool>false</bool></property>
           </widget>
          </item>
          <item row="0" column="3">
           <widget class="QCheckBox" name="smartFilterCheck">
            <property name="text"><string>Apply smart filter</string></property>
            <property name="toolTip"><string>Reduce scenes by best-per-period</string></property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>

       <!-- Output -->
       <item>
        <widget class="QGroupBox" name="groupOutput">
         <property name="title"><string>Output</string></property>
         <layout class="QGridLayout" name="gridOutput">
          <property name="horizontalSpacing"><number>8</number></property>
          <property name="verticalSpacing"><number>2</number></property>
          <property name="leftMargin"><number>2</number></property>
          <property name="topMargin"><number>2</number></property>
          <property name="rightMargin"><number>2</number></property>
          <property name="bottomMargin"><number>2</number></property>
          <item row="0" column="0">
           <widget class="QLabel" name="labelWorkers"><property name="text"><string>Workers</string></property></widget>
          </item>
          <item row="0" column="1">
           <widget class="QSpinBox" name="workersSpin">
            <!-- Min 1, default 1 -->
            <property name="minimum"><number>1</number></property>
            <property name="maximum"><number>64</number></property>
            <property name="value"><number>1</number></property>
            <property name="toolTip"><string>Number of parallel workers</string></property>
           </widget>
          </item>
          <item row="0" column="2">
           <widget class="QLabel" name="labelOut"><property name="text"><string>Output folder</string></property></widget>
          </item>
          <item row="0" column="3" colspan="2">
           <layout class="QHBoxLayout" name="outLayout">
            <item>
             <widget class="QLineEdit" name="outputPathEdit">
              <property name="placeholderText"><string>Blank = QGIS temp</string></property>
             </widget>
            </item>
            <item>
             <widget class="QPushButton" name="outputBrowseButton">
              <property name="text"><string>Browse…</string></property>
              <property name="toolTip"><string>Select destination folder</string></property>
             </widget>
            </item>
           </layout>
          </item>
         </layout>
        </widget>
       </item>

      <!-- Run / Progress -->
      <item>
       <layout class="QVBoxLayout" name="runSectionLayout">
        <item>
         <layout class="QHBoxLayout" name="runLayout">
          <item>
           <widget class="QCheckBox" name="showSceneFootprintsCheck">
            <property name="text"><string>Show matching scene footprints on map</string></property>
              <property name="checked"><bool>false</bool></property>
           </widget>
          </item>
          <item>
           <widget class="QPushButton" name="previewScenesButton">
            <property name="text"><string>Preview Matching Scenes</string></property>
            <property name="toolTip"><string>Search matching scenes using current AOI/date/cloud filters</string></property>
           </widget>
          </item>
          <item>
           <spacer name="runSpacer">
            <property name="orientation"><enum>Qt::Horizontal</enum></property>
            <property name="sizeHint" stdset="0">
        <size><width>40</width><height>20</height></size>
            </property>
           </spacer>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="runActionLayout">
            <item>
             <widget class="QProgressBar" name="progressBar">
              <property name="minimum"><number>0</number></property>
              <property name="maximum"><number>0</number></property>
              <property name="value"><number>0</number></property>
              <property name="textVisible"><bool>false</bool></property>
              <property name="toolTip"><string>Shows while job is running</string></property>
             </widget>
            </item>
          <item>
           <spacer name="runActionSpacer">
            <property name="orientation"><enum>Qt::Horizontal</enum></property>
            <property name="sizeHint" stdset="0">
        <size><width>40</width><height>20</height></size>
            </property>
           </spacer>
          </item>
          <item>
           <widget class="QPushButton" name="resetButton">
            <property name="text"><string>Reset</string></property>
            <property name="toolTip"><string>Clear form and AOI</string></property>
           </widget>
          </item>
          <item>
           <widget class="QPushButton" name="runButton">
            <property name="text"><string>Run Compute</string></property>
            <property name="minimumHeight"><number>30</number></property>
            <property name="toolTip"><string>Start processing</string></property>
           </widget>
          </item>
         </layout>
        </item>
       </layout>
      </item>

       <!-- Log -->
       <item>
        <widget class="QGroupBox" name="groupLog">
         <property name="title"><string>Log</string></property>
         <layout class="QVBoxLayout" name="verticalLayoutLog">
          <item>
           <widget class="QPlainTextEdit" name="logText">
            <property name="readOnly"><bool>true</bool></property>
            <property name="placeholderText"><string>Status and warnings will appear here…</string></property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>

      </layout>
     </widget>

     <!-- Advanced tab (placeholder) -->
     <!-- <widget class="QWidget" name="tabAdvanced">
      <attribute name="title"><string>Advanced</string></attribute>
      <layout class="QVBoxLayout" name="advancedLayout">
       <item>
        <widget class="QLabel" name="advancedNote">
         <property name="text">
          <string>&lt;i&gt;Add advanced options later (e.g., colormap, masking).&lt;/i&gt;</string>
         </property>
        </widget>
       </item>
       <item>
        <spacer name="advSpacer">
         <property name="orientation"><enum>Qt::Vertical</enum></property>
         <property name="sizeHint" stdset="0">
          <size><width>20</width><height>40</height></size>
         </property>
        </spacer>
       </item>
      </layout>
     </widget> -->

    </widget>
   </item>

  </layout>
 </widget>
 <resources/>
 <connections/>
</ui>
