Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

omgtipfactory.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007 by Tim Sutton   *
00003  *   tim@linfiniti.com   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 
00022 #include "omgtipfactory.h"
00023 #include <QTime>
00024 
00025 OmgTipFactory::OmgTipFactory() : QObject()
00026 {
00027   // Im just doing this in a simple way so 
00028   // its easy for translators...later
00029   // it its worth the time Ill move this data
00030   // into a sqlite database...
00031   OmgTip myTip;
00032   myTip.setTitle(tr("openModeller is open source"));
00033   myTip.setContent(tr("openModeller is open source software."
00034         " This means that the software source code can be freely viewed "
00035         " and modified. The GPL places a restriction that any modifications "
00036         " you make must be made available to the openModeller project, and "
00037         " that you can not create a new version of openModeller under a "
00038         " 'closed source' license. Visit <a href=\"http://openModeller.sf.net\">"
00039         " the openModeller home page (http://openModeller.sf.net)</a> for more"
00040         " information."));
00041   addGenericTip(myTip);
00042   //
00043   myTip.setTitle(tr("openModeller Publications"));
00044   myTip.setContent(tr("If you write a scientific paper or any other article"
00045         " that refers to openModeller we would love to include your work"
00046         " in the references section of "
00047         " the openModeller home page (http://openModeller.sf.net).</a>"
00048         ));
00049   addGenericTip(myTip);
00050   myTip.setTitle(tr("Become an openModeller Desktop translator"));
00051   myTip.setContent(tr("Would you like to see openModeller Desktop"
00052         " in your native language? We are looking for more translators"
00053         " and would appreciate your help! The translation process is "
00054         " fairly straight forward - instructions are available in the "
00055         " resources section of "
00056         " the openModeller home page (http://openModeller.sf.net).</a>"
00057         ));
00058   addGuiTip(myTip);
00059   myTip.setTitle(tr("openModeller Mailing lists"));
00060   myTip.setContent(tr("If you need help using openModeller Desktop"
00061         " we have a mailing list where users help each other with issues"
00062         " related to niche modelling and using openModeller Desktop."
00063         " Details on how to subscribe are in the resources section of"
00064         " the openModeller home page (http://openModeller.sf.net).</a>"
00065         ));
00066   addGuiTip(myTip);
00067   myTip.setTitle(tr("Is it 'modelling' or 'modeling'?"));
00068   myTip.setContent(tr("Both spellings are correct. For openModeller"
00069         " we use the former spelling."
00070         ));
00071   addGenericTip(myTip);
00072   myTip.setTitle(tr("How do I refer to openModeller?"));
00073   myTip.setContent(tr("openModeller is spelled with a lower case"
00074         " 'o' at the start of the word - even if its the beginning"
00075         " of a sentance. We have various subprojects of the openModeller "
00076         " project and it will help to avoid confusion if you refer to each by"
00077         " its name:"
00078         "<ul>"
00079         "<li>openModeller Library - this is the C++ library that contains"
00080         " the core logic for carrying out niche modelling"
00081         "<li>openModeller Console - these are a collection of command"
00082         " line tools that allow you to run niche models from a unix or"
00083         " DOS shell, or from a scripting environment."
00084         "<li>openModeller Web Service - The openModeller Web Service"
00085         " allows for remote execution of niche models."
00086         "<li>openModeller Desktop - the openModeller Desktop provides"
00087         " a graphical user interface for the openModeller Library. It"
00088         " also includes the capability to run models using the"
00089         " openModeller Web Service (though this is still considered"
00090         " experimental)."
00091         "</ul>"
00092         ));
00093   addGenericTip(myTip);
00094   myTip.setTitle(tr("How can I improve model execution times?"));
00095   myTip.setContent(tr("Model processing time is typically determined by"
00096         "<ul>"
00097         "<li>the algorithm you select,</li>"
00098         "<li>the number, extents and spatial resolution of your format and environmental layers,</li>" 
00099         "<li>the number of cells excluded by your mask (if any),</li>"
00100         "<li>in some cases the number of presence and absence points (e.g. distance algs),</li>"
00101         "<li>the speed of the computer the model is running on (CPU, disk access etc).</li>"
00102         "</ul>"
00103         "So if you want to improve model processing times you need to adjust "
00104         "one of these variables. One thing noticed quite commonly is that people "
00105         "use extremely high resolution datasets that often carry little "
00106         "additional information over lower resolution equivalents. For example "
00107         "interpolating widely dispersed weather station data to produce a 50cm "
00108         "raster probably carries little additional value over for example using "
00109         "10m2 pixels.<br>"
00110         "Another area of performance improvement you can look at is "
00111         "preselecting environmental variables using techniques such as Chi "
00112         "Square test. Future versions of openModeller will integrate the ability "
00113         "to do this type of preselection."
00114         ));
00115   addGenericTip(myTip);
00116   /* Template for adding more tips
00117   myTip.setTitle(tr(""));
00118   myTip.setContent(tr(""
00119         ));
00120   addGenericTip(myTip);
00121   */
00122 }
00123 
00124 OmgTipFactory::~OmgTipFactory()
00125 {
00126 
00127 }
00128 //private helper method
00129 void OmgTipFactory::addGuiTip(OmgTip theTip)
00130 {
00131   mGuiTips << theTip;
00132   mAllTips << theTip;
00133 }
00134 //private helper method
00135 void OmgTipFactory::addGenericTip(OmgTip theTip)
00136 {
00137   mGenericTips << theTip;
00138   mAllTips << theTip;
00139 }
00140 OmgTip OmgTipFactory::getTip()
00141 {
00142   srand(QTime::currentTime().msec());
00143   int myRand = rand();
00144   int myValue = static_cast<int> (myRand % mAllTips.count()); //range [0,(count-1)]
00145   OmgTip myTip = mAllTips.at(myValue);
00146   return myTip;
00147 }
00148 OmgTip OmgTipFactory::getTip(int thePosition)
00149 {
00150   OmgTip myTip = mAllTips.at(thePosition);
00151   return myTip;
00152 }
00153 OmgTip OmgTipFactory::getGenericTip()
00154 {
00155   srand(QTime::currentTime().msec());
00156   int myRand = rand();
00157   int myValue = static_cast<int> (myRand % mGenericTips.count()); //range [0,(count-1)]
00158   OmgTip myTip = mGenericTips.at(myValue);
00159   return myTip;
00160 }
00161 OmgTip OmgTipFactory::getGuiTip()
00162 {
00163   srand(QTime::currentTime().msec());
00164   int myRand = rand();
00165   int myValue = static_cast<int> (myRand % mGuiTips.count()); //range [0,(count-1)]
00166   OmgTip myTip = mGuiTips.at(myValue);
00167   return myTip;
00168 }
00169 int OmgTipFactory::randomNumber(int theMax)
00170 {
00171   return 0;
00172 }
00173 

Generated on Mon Apr 28 15:09:16 2008 for openModellerDesktop by  doxygen 1.4.1-20050210