[Kst] branches/work/kst/portto4/kst/src/datasources/ascii

Brisset, Nicolas Nicolas.Brisset at eurocopter.com
Tue Oct 16 21:14:56 UTC 2012


Peter,



the speed improvement with threads sounds freaking good!!!

However when I try it I get this:

[Beschreibung: C:\Documents and Settings\g711973\Local Settings\Temp\nhnjp1ci.nx3.png]



I first tried without activating it and could honestly not see any improvement. Then I remembered it had been made optional :)

Don't you get a crash using the Kst-2.0.x-Qt5-2012.10.16-20.27 snapshot?



And a couple other things:

- first, you have a typo in the ASCII Dialog for buffer siz*e*.

- second, I really wonder whether those settings should not rather go to general settings, as they depend more on the computer than the ASCII file. @Barth: what's your opinion?



I think once this crash and the above UI question are settled, you can prepare another snapshot with printing, and we'll test it a bit before the release. But we're really close now.

Thanks soooo much for your great work the last days!



Happy Nicolas



> -----Ursprüngliche Nachricht-----

> Von: kst-bounces at kde.org [mailto:kst-bounces at kde.org] Im Auftrag von Peter

> Kümmel

> Gesendet: Dienstag, 16. Oktober 2012 22:38

> An: kde-commits at kde.org

> Cc: kst at kde.org

> Betreff: [Kst] branches/work/kst/portto4/kst/src/datasources/ascii

>

> SVN commit 1320820 by kuemmel:

>

> make usage of threads optional

>

>  M  +76 -31    asciiconfig.ui

>  M  +3 -0      asciiplugin.cpp

>  M  +2 -3      asciisource.cpp

>  M  +0 -1      asciisource.h

>  M  +9 -1      asciisourceconfig.cpp

>  M  +3 -1      asciisourceconfig.h

>

>

> --- branches/work/kst/portto4/kst/src/datasources/ascii/asciiconfig.ui

> #1320819:1320820 @@ -10,7 +10,7 @@

>      <height>600</height>

>     </rect>

>    </property>

> -  <layout class="QGridLayout" name="gridLayout">

> +  <layout class="QGridLayout" name="gridLayout"

> + columnminimumwidth="2,0,0">

>     <item row="0" column="0">

>      <widget class="QLabel" name="_labelBeginning">

>       <property name="text">

> @@ -18,35 +18,32 @@

>       </property>

>      </widget>

>     </item>

> -   <item row="1" column="0" rowspan="2">

> +   <item row="1" column="0">

>      <widget class="QPlainTextEdit" name="_showBeginning"/>

>     </item>

> -   <item row="1" column="1" rowspan="2" colspan="2">

> +   <item row="1" column="1">

>      <widget class="Line" name="verticalLine">

>       <property name="orientation">

>        <enum>Qt::Vertical</enum>

>       </property>

>      </widget>

>     </item>

> -   <item row="2" column="2">

> +   <item row="1" column="2">

>      <layout class="QVBoxLayout" name="verticalLayout">

>       <item>

>        <widget class="QGroupBox" name="headerButtonGroup">

>         <property name="title">

>          <string>Header</string>

>         </property>

> -       <layout class="QGridLayout" name="gridLayout2">

> -        <property name="topMargin">

> -         <number>3</number>

> +       <widget class="QLabel" name="textLabel1_3">

> +        <property name="geometry">

> +         <rect>

> +          <x>10</x>

> +          <y>17</y>

> +          <width>90</width>

> +          <height>16</height>

> +         </rect>

>          </property>

> -        <property name="bottomMargin">

> -         <number>3</number>

> -        </property>

> -        <property name="verticalSpacing">

> -         <number>3</number>

> -        </property>

> -        <item row="0" column="0">

> -         <widget class="QLabel" name="textLabel1_3">

>            <property name="sizePolicy">

>             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">

>              <horstretch>3</horstretch>

> @@ -63,9 +60,15 @@

>             <cstring>_startLine</cstring>

>            </property>

>           </widget>

> -        </item>

> -        <item row="0" column="2">

>           <widget class="QSpinBox" name="_startLine">

> +        <property name="geometry">

> +         <rect>

> +          <x>206</x>

> +          <y>17</y>

> +          <width>63</width>

> +          <height>20</height>

> +         </rect>

> +        </property>

>            <property name="sizePolicy">

>             <sizepolicy hsizetype="Minimum" vsizetype="Fixed">

>              <horstretch>2</horstretch>

> @@ -82,19 +85,31 @@

>             <number>1</number>

>            </property>

>           </widget>

> -        </item>

> -        <item row="1" column="0">

>           <widget class="QCheckBox" name="_readFields">

> +        <property name="geometry">

> +         <rect>

> +          <x>10</x>

> +          <y>41</y>

> +          <width>153</width>

> +          <height>17</height>

> +         </rect>

> +        </property>

>            <property name="text">

>             <string>Read field names from line:</string>

>            </property>

>           </widget>

> -        </item>

> -        <item row="1" column="2">

>           <widget class="QSpinBox" name="_fieldsLine">

>            <property name="enabled">

>             <bool>false</bool>

>            </property>

> +        <property name="geometry">

> +         <rect>

> +          <x>206</x>

> +          <y>40</y>

> +          <width>63</width>

> +          <height>20</height>

> +         </rect>

> +        </property>

>            <property name="sizePolicy">

>             <sizepolicy hsizetype="Minimum" vsizetype="Fixed">

>              <horstretch>2</horstretch>

> @@ -111,22 +126,34 @@

>             <number>1</number>

>            </property>

>           </widget>

> -        </item>

> -        <item row="2" column="0">

>           <widget class="QCheckBox" name="_readUnits">

>            <property name="enabled">

>             <bool>false</bool>

>            </property>

> +        <property name="geometry">

> +         <rect>

> +          <x>10</x>

> +          <y>64</y>

> +          <width>122</width>

> +          <height>17</height>

> +         </rect>

> +        </property>

>            <property name="text">

>             <string>Read units from line:</string>

>            </property>

>           </widget>

> -        </item>

> -        <item row="2" column="2">

>           <widget class="QSpinBox" name="_unitsLine">

>            <property name="enabled">

>             <bool>false</bool>

>            </property>

> +        <property name="geometry">

> +         <rect>

> +          <x>206</x>

> +          <y>63</y>

> +          <width>63</width>

> +          <height>20</height>

> +         </rect>

> +        </property>

>            <property name="sizePolicy">

>             <sizepolicy hsizetype="Minimum" vsizetype="Fixed">

>              <horstretch>2</horstretch>

> @@ -143,9 +170,15 @@

>             <number>1</number>

>            </property>

>           </widget>

> -        </item>

> -        <item row="3" column="2">

>           <widget class="QLabel" name="label">

> +        <property name="geometry">

> +         <rect>

> +          <x>206</x>

> +          <y>86</y>

> +          <width>114</width>

> +          <height>16</height>

> +         </rect>

> +        </property>

>            <property name="text">

>             <string> Line numbers start at 1</string>

>            </property>

> @@ -153,8 +186,6 @@

>             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>

>            </property>

>           </widget>

> -        </item>

> -       </layout>

>        </widget>

>       </item>

>       <item>

> @@ -437,16 +468,23 @@

>         </item>

>        </layout>

>       </item>

> +     <item>

> +      <widget class="QCheckBox" name="_useThreads">

> +       <property name="text">

> +        <string>Use threads for parsing Ascii data</string>

> +       </property>

> +      </widget>

> +     </item>

>      </layout>

>     </item>

> -   <item row="3" column="0" colspan="3">

> +   <item row="2" column="0" colspan="3">

>      <widget class="Line" name="line">

>       <property name="orientation">

>        <enum>Qt::Horizontal</enum>

>       </property>

>      </widget>

>     </item>

> -   <item row="4" column="0">

> +   <item row="3" column="0">

>      <widget class="QCheckBox" name="_applyDefault">

>       <property name="text">

>        <string>Apply these settings as default</string> @@ -454,6 +492,13 @@

>      </widget>

>     </item>

>    </layout>

> +  <zorder>_labelBeginning</zorder>

> +  <zorder>_showBeginning</zorder>

> +  <zorder>verticalLine</zorder>

> +  <zorder>line</zorder>

> +  <zorder>_applyDefault</zorder>

> +  <zorder>_limitFileBuffer</zorder>

> +  <zorder>_useThreads</zorder>

>   </widget>

>   <layoutdefault spacing="6" margin="11"/>

>   <resources/>

> --- branches/work/kst/portto4/kst/src/datasources/ascii/asciiplugin.cpp

> #1320819:1320820 @@ -131,6 +131,8 @@

>      config._limitFileBufferSize = size * 1024 * 1024;

>    }

>

> +  config._useThreads =_useThreads->isChecked();

> +

>    return config;

>  }

>

> @@ -172,6 +174,7 @@

>    _limitFileBufferSize->setText(QString::number(config._limitFileBufferSize /

> 1024 / 1024));

>    updateFrameBuffer(config._limitFileBuffer);

>

> +  _useThreads->setChecked(config._useThreads);

>  }

>

>

> --- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp

> #1320819:1320820 @@ -51,7 +51,6 @@

>    Kst::DataSource(store, cfg, filename, type),

>    _reader(_config),

>    _fileBuffer(),

> -  _useThreads(true),

>    is(new DataInterfaceAsciiString(*this)),

>    iv(new DataInterfaceAsciiVector(*this))  { @@ -270,7 +269,7 @@

>      }

>

>      int numThreads;

> -    if (!_useThreads) {

> +    if (!_config._useThreads) {

>        numThreads = 1;

>      } else {

>        numThreads = QThread::idealThreadCount(); @@ -292,7 +291,7 @@

>

>

>    int sRead = 0;

> -  if (_useThreads) {

> +  if (_config._useThreads) {

>      QFutureSynchronizer<int> readFutures;

>      const QVector<AsciiFileData>& data = _fileBuffer.data();

>      foreach (const AsciiFileData& chunk, data) {

> --- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.h

> #1320819:1320820 @@ -69,7 +69,6 @@

>    private:

>      AsciiDataReader _reader;

>      AsciiFileBuffer _fileBuffer;

> -    const bool _useThreads;

>

>      friend class ConfigWidgetAscii;

>      mutable AsciiSourceConfig _config;

> --- branches/work/kst/portto4/kst/src/datasources/ascii/asciisourceconfig.cpp

> #1320819:1320820 @@ -55,6 +55,8 @@  const char

> AsciiSourceConfig::Tag_limitFileBuffer[] = "limitFileBuffer";  const char

> AsciiSourceConfig::Key_limitFileBufferSize[] = "Size of limited file buffer";  const

> char AsciiSourceConfig::Tag_limitFileBufferSize[] = "limitFileBufferSize";

> +const char AsciiSourceConfig::Key_useThreads[] = "Use threads when

> +parsing Ascii data"; const char AsciiSourceConfig::Tag_useThreads[] =

> +"useThreads";

>

>  AsciiSourceConfig::AsciiSourceConfig() :

>    _delimiters(DEFAULT_COMMENT_DELIMITERS),

> @@ -72,7 +74,8 @@

>    _unitsLine(0),

>    _useDot(true),

>    _limitFileBuffer(false),

> -  _limitFileBufferSize(128)

> +  _limitFileBufferSize(128),

> +  _useThreads(false)

>  {

>  }

>

> @@ -95,6 +98,7 @@

>    _unitsLine >> cfg;

>    _limitFileBuffer >> cfg;

>    _limitFileBufferSize >> cfg;

> +  _useThreads >> cfg;

>  }

>

>

> @@ -128,6 +132,7 @@

>    _unitsLine << cfg;

>    _limitFileBuffer << cfg;

>    _limitFileBufferSize << cfg;

> +  _useThreads << cfg;

>  }

>

>

> @@ -168,6 +173,7 @@

>    _unitsLine >> s;

>    _limitFileBuffer >> s;

>    _limitFileBufferSize >> s;

> +  _useThreads >> s;

>

>    s.writeEndElement();

>  }

> @@ -190,6 +196,7 @@

>    _unitsLine << attributes;

>    _limitFileBuffer << attributes;

>    _limitFileBufferSize << attributes;

> +  _useThreads << attributes;

>  }

>

>

> @@ -215,6 +222,7 @@

>          _unitsLine << elem;

>          _limitFileBuffer << elem;

>          _limitFileBufferSize << elem;

> +        _useThreads << elem;

>        }

>      }

>      n = n.nextSibling();

> --- branches/work/kst/portto4/kst/src/datasources/ascii/asciisourceconfig.h

> #1320819:1320820 @@ -53,6 +53,8 @@

>      static const char Tag_limitFileBuffer[];

>      static const char Key_limitFileBufferSize[];

>      static const char Tag_limitFileBufferSize[];

> +    static const char Key_useThreads[];

> +    static const char Tag_useThreads[];

>

>    public:

>      AsciiSourceConfig();

> @@ -84,8 +86,8 @@

>      NamedParameter<bool, Key_useDot, Tag_useDot> _useDot;

>      NamedParameter<bool, Key_limitFileBuffer, Tag_limitFileBuffer>

> _limitFileBuffer;

>      NamedParameter<int, Key_limitFileBufferSize, Tag_limitFileBufferSize>

> _limitFileBufferSize;

> +    NamedParameter<int, Key_useThreads, Tag_useThreads> _useThreads;

>

> -

>    private:

>      void save(QSettings& cfg);

>      void read(QSettings& cfg);

> _______________________________________________

> Kst mailing list

> Kst at kde.org<mailto:Kst at kde.org>

> https://mail.kde.org/mailman/listinfo/kst

EUROCOPTER DEUTSCHLAND GmbH
Sitz der Gesellschaft / Registered Office: Donauwörth
Registergericht / Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates / Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschäftsführung / Board of Management:
Dr. Wolfgang Schoder, Vorsitzender / CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt


CONFIDENTIALITY NOTICE

This communication and the information it contains is intended for the addressee ( s ) named above and for no other persons or organizations.
It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication
or any part of it is prohibited and may be unlawful.
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication.
Thank you very much.
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses
or other material which might be introduced with this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kst/attachments/20121016/73b68442/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 9933 bytes
Desc: image001.png
URL: <http://mail.kde.org/pipermail/kst/attachments/20121016/73b68442/attachment-0001.png>


More information about the Kst mailing list