[Kstars-devel] UI For Memory Management

Akarsh Simha akarshsimha at gmail.com
Sat Jul 19 18:04:39 CEST 2008


Hi

Please find yet another opscatalog.ui candidate attached.

I think this is good enough, as James pointed out, because we have the
Alt + Mouse Wheel feature anyway if we wish to increase star density.

In the meanwhile, I'll work out the math required to estimate the
memory usage given the value on the 'Star Density' slider.

Should the slider be replaced by the Spin Box for the faint mag when
zoomed out that we had earlier? I don't like the Spin Box because the
numbers wouldn't make sense if we were labelling the field as 'Star
Density'.

Sliders, AFAIK, can handle only integers and integer steps. This means
that I will need to map the numbers 1 to 10 (or whatever) from the
slider to a magnitude range, by playing around with James map from
star density to magnitude limit, so that they actually correspond to
linear changes in star density. I hope this will be acceptable to
everyone.

Any suggestions on the math behind the memory usage estimates? If it
is going to be 10 values from a slider, it might be possible to
hardcode values, and these hardcoded values will be extremely
accurate. I think I should avoid hardcoded values (other than the
"basic" memory usage), lest we change things later. So I plan to work
out the memory usage by finding the average number of stars in the FOV
for the given magnitude limit, and then multiplying this by the ratio
of maximum stars per trixel to the average stars per trixel, so we
make an approximate guess of the maximum memory usage (so that the
user is safe). Of course, this assumes that he has the Tycho-2 deep
star catalog. Maybe I should implement a way of checking this.

I wish that everyone could send in their suggestions / opinions fast,
because I would like to close my GSoC project as soon as possible and
start working on other things.

Regards
Akarsh
-------------- next part --------------
<ui version="4.0" >
 <class>OpsCatalog</class>
 <widget class="QWidget" name="OpsCatalog" >
  <property name="geometry" >
   <rect>
    <x>0</x>
    <y>0</y>
    <width>531</width>
    <height>686</height>
   </rect>
  </property>
  <layout class="QVBoxLayout" >
   <item>
    <widget class="QGroupBox" name="StarBox" >
     <property name="title" >
      <string/>
     </property>
     <layout class="QHBoxLayout" >
      <item>
       <layout class="QVBoxLayout" >
        <item>
         <widget class="QCheckBox" name="kcfg_ShowStars" >
          <property name="text" >
           <string>&amp;Star Catalogs</string>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QGridLayout" >
          <property name="margin" >
           <number>0</number>
          </property>
          <property name="spacing" >
           <number>6</number>
          </property>
          <item row="0" column="1" >
           <widget class="QLabel" name="LabelStarDensity" >
            <property name="text" >
             <string>Star Density:</string>
            </property>
           </widget>
          </item>
          <item row="0" column="2" >
           <widget class="QSlider" name="kcfg_StarDensity" >
            <property name="minimum" >
             <number>0</number>
            </property>
            <property name="maximum" >
             <number>10</number>
            </property>
            <property name="singleStep" >
             <number>1</number>
            </property>
            <property name="orientation" >
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="tickPosition" >
             <enum>QSlider::NoTicks</enum>
            </property>
            <property name="tickInterval" >
             <number>1</number>
            </property>
           </widget>
          </item>
          <item row="0" column="3" >
           <widget class="QLabel" name="LabelMemUsageText" >
            <property name="text" >
             <string>Estimated Memory Usage:</string>
            </property>
           </widget>
          </item>
          <item row="0" column="4" >
           <widget class="QLabel" name="LabelMemUsage" >
            <property name="sizePolicy" >
             <sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="minimumSize" >
             <size>
              <width>50</width>
              <height>0</height>
             </size>
            </property>
            <property name="text" >
             <string/>
            </property>
           </widget>
          </item>
          <item row="0" column="0" >
           <spacer name="horizontalSpacer_2" >
            <property name="orientation" >
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="sizeType" >
             <enum>QSizePolicy::Fixed</enum>
            </property>
            <property name="sizeHint" stdset="0" >
             <size>
              <width>16</width>
              <height>20</height>
             </size>
            </property>
           </spacer>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QGridLayout" >
          <property name="margin" >
           <number>0</number>
          </property>
          <property name="spacing" >
           <number>6</number>
          </property>
          <item row="0" column="1" >
           <widget class="QCheckBox" name="kcfg_ShowStarNames" >
            <property name="text" >
             <string>Show &amp;name</string>
            </property>
           </widget>
          </item>
          <item row="1" column="1" >
           <widget class="QCheckBox" name="kcfg_ShowStarMagnitudes" >
            <property name="text" >
             <string>Show ma&amp;gnitude</string>
            </property>
           </widget>
          </item>
          <item row="0" column="0" >
           <spacer>
            <property name="orientation" >
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="sizeType" >
             <enum>QSizePolicy::Fixed</enum>
            </property>
            <property name="sizeHint" stdset="0" >
             <size>
              <width>16</width>
              <height>20</height>
             </size>
            </property>
           </spacer>
          </item>
          <item row="1" column="0" >
           <spacer>
            <property name="orientation" >
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="sizeType" >
             <enum>QSizePolicy::Fixed</enum>
            </property>
            <property name="sizeHint" stdset="0" >
             <size>
              <width>16</width>
              <height>20</height>
             </size>
            </property>
           </spacer>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" >
          <item>
           <spacer>
            <property name="orientation" >
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="sizeType" >
             <enum>QSizePolicy::Fixed</enum>
            </property>
            <property name="sizeHint" stdset="0" >
             <size>
              <width>40</width>
              <height>20</height>
             </size>
            </property>
           </spacer>
          </item>
          <item>
           <widget class="QLabel" name="LabelDensity" >
            <property name="text" >
             <string>Label density:</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QSlider" name="kcfg_StarLabelDensity" >
            <property name="maximum" >
             <number>20</number>
            </property>
            <property name="orientation" >
             <enum>Qt::Horizontal</enum>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer" >
            <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>
       </layout>
      </item>
     </layout>
    </widget>
   </item>
   <item>
    <widget class="QGroupBox" name="DeepSkyBox" >
     <property name="title" >
      <string/>
     </property>
     <layout class="QVBoxLayout" >
      <property name="spacing" >
       <number>6</number>
      </property>
      <property name="margin" >
       <number>8</number>
      </property>
      <item>
       <widget class="QCheckBox" name="kcfg_ShowDeepSky" >
        <property name="text" >
         <string>Deep-Sky Catalogs</string>
        </property>
       </widget>
      </item>
      <item>
       <layout class="QHBoxLayout" >
        <property name="spacing" >
         <number>6</number>
        </property>
        <property name="margin" >
         <number>0</number>
        </property>
        <item>
         <widget class="QListWidget" name="CatalogList" >
          <property name="verticalScrollBarPolicy" >
           <enum>Qt::ScrollBarAlwaysOn</enum>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QVBoxLayout" >
          <property name="spacing" >
           <number>6</number>
          </property>
          <property name="margin" >
           <number>0</number>
          </property>
          <item>
           <widget class="KPushButton" name="AddCatalog" >
            <property name="text" >
             <string>Import Catalog...</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="KPushButton" name="LoadCatalog" >
            <property name="text" >
             <string>Load Catalog...</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="KPushButton" name="RemoveCatalog" >
            <property name="enabled" >
             <bool>false</bool>
            </property>
            <property name="text" >
             <string>Remove Catalog...</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer>
            <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>
        </item>
       </layout>
      </item>
      <item>
       <layout class="QHBoxLayout" >
        <property name="spacing" >
         <number>6</number>
        </property>
        <property name="margin" >
         <number>0</number>
        </property>
        <item>
         <layout class="QGridLayout" >
          <property name="margin" >
           <number>0</number>
          </property>
          <property name="spacing" >
           <number>6</number>
          </property>
          <item row="1" column="0" >
           <widget class="QLabel" name="LabelMagDeepSkyZoomOut" >
            <property name="text" >
             <string>Faint limit zoomed out:</string>
            </property>
           </widget>
          </item>
          <item row="0" column="2" >
           <widget class="QLabel" name="LabelMag3" >
            <property name="text" >
             <string>mag</string>
            </property>
           </widget>
          </item>
          <item row="1" column="2" >
           <widget class="QLabel" name="LabelMag4" >
            <property name="text" >
             <string>mag</string>
            </property>
           </widget>
          </item>
          <item row="0" column="0" >
           <widget class="QLabel" name="LabelMagDeepSky" >
            <property name="text" >
             <string>Faint limit zoomed in:</string>
            </property>
           </widget>
          </item>
          <item row="0" column="1" >
           <widget class="MagnitudeSpinBox" name="kcfg_MagLimitDrawDeepSky" />
          </item>
          <item row="1" column="1" >
           <widget class="MagnitudeSpinBox" name="kcfg_MagLimitDrawDeepSkyZoomOut" />
          </item>
         </layout>
        </item>
        <item>
         <spacer>
          <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>
     </layout>
    </widget>
   </item>
  </layout>
  <zorder>StarBox</zorder>
  <zorder>DeepSkyBox</zorder>
  <zorder></zorder>
 </widget>
 <customwidgets>
  <customwidget>
   <class>KPushButton</class>
   <extends>QPushButton</extends>
   <header>kpushbutton.h</header>
  </customwidget>
  <customwidget>
   <class>MagnitudeSpinBox</class>
   <extends>KDoubleNumInput</extends>
   <header>widgets/magnitudespinbox.h</header>
  </customwidget>
 </customwidgets>
 <resources/>
 <connections/>
</ui>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.kde.org/pipermail/kstars-devel/attachments/20080719/494498e9/attachment.pgp 


More information about the Kstars-devel mailing list