[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Thu Apr 15 19:42:43 CEST 2004


CVS commit by arwalker: 

Added some default scalar values that define some (hopefully) useful physical constants.
These are deliberately orphaned so they are not saved with every kst file.


  M +27 -0     kstdoc.cpp   1.66
  M +2 -0      kstdoc.h   1.26


--- kdeextragear-2/kst/kst/kstdoc.cpp  #1.65:1.66
@@ -146,4 +146,6 @@ bool KstDoc::newDocument() {
   title = i18n("Untitled");
 
+  createScalars( );
+  
   return true;
 }
@@ -286,4 +288,6 @@ bool KstDoc::openDocument(const KURL &ur
   }
 
+  createScalars( );
+  
   modified = false;
   return true;
@@ -630,4 +634,27 @@ bool KstDoc::event(QEvent *e) {
 
 
+void KstDoc::createScalars( ) {
+  new KstScalar( i18n("CONST_MKSA_SPEED_OF_LIGHT"), 2.99792458e8 );
+  new KstScalar( i18n("CONST_MKSA_GRAVITATIONAL_CONSTANT"), 6.673e-11);
+  new KstScalar( i18n("CONST_MKSA_PLANCKS_CONSTANT_H"), 6.62606876e-34);
+  new KstScalar( i18n("CONST_MKSA_PLANCKS_CONSTANT_HBAR"), 1.05457159642e-34);
+  new KstScalar( i18n("CONST_MKSA_ASTRONOMICAL_UNIT"), 1.49597870691e11); 
+  new KstScalar( i18n("CONST_MKSA_VACUUM_PERMITTIVITY"), 8.854187817e-12);
+  new KstScalar( i18n("CONST_MKSA_VACUUM_PERMEABILITY"), 1.25663706144e-6);
+  new KstScalar( i18n("CONST_MKSA_GRAV_ACCEL"), 9.80665e0);
+  new KstScalar( i18n("CONST_MKSA_MASS_MUON"), 1.88353109e-28); 
+  new KstScalar( i18n("CONST_MKSA_MASS_PROTON"), 1.67262158e-27); 
+  new KstScalar( i18n("CONST_MKSA_MASS_NEUTRON"), 1.67492716e-27); 
+  new KstScalar( i18n("CONST_MKSA_RYDBERG"), 2.17987190389e-18);
+  new KstScalar( i18n("CONST_MKSA_BOLTZMANN"), 1.3806503e-23);
+  new KstScalar( i18n("CONST_MKSA_SOLAR_MASS"), 1.98892e30);
+  new KstScalar( i18n("CONST_MKSA_BOHR_RADIUS"), 5.291772083e-11);
+  new KstScalar( i18n("CONST_MKSA_ELECTRON_CHARGE"), 1.602176462e-19);
+  new KstScalar( i18n("CONST_MKSA_MOLAR_GAS"), 8.314472e0);
+  new KstScalar( i18n("CONST_MKSA_STANDARD_GAS_VOLUME"), 2.2710981e-2);
+  new KstScalar( i18n("CONST_PI"), 3.141592654e0); 
+}
+
+
 static int write_all(int fd, const char *buf, size_t len) {
    while (len > 0)

--- kdeextragear-2/kst/kst/kstdoc.h  #1.25:1.26
@@ -100,4 +100,6 @@ public slots:
   
 private:
+   void createScalars( );
+  
   /** the modified flag of the current document */
   bool modified;





More information about the Kst mailing list