Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/qucsdoc.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                 qucsdoc.cpp
00003                                -------------
00004     begin                : Wed Sep 3 2003
00005     copyright            : (C) 2003, 2004 by Michael Margraf
00006     email                : michael.margraf@alumni.tu-berlin.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include <QFileInfo>
00019 
00020 #include "qucsdoc.h"
00021 #include "qucs.h"
00022 
00023 
00024 QucsDoc::QucsDoc(QucsApp *App_, const QString& Name_)
00025 {
00026   App = App_;
00027 
00028   GridOn = true;
00029   DocName = Name_;
00030   QFileInfo Info(DocName);
00031   if(!DocName.isEmpty()) {
00032     DocName = Info.absFilePath();
00033     QString base = Info.baseName(true);
00034     QString ext = Info.extension(false);
00035 
00036     if(ext == "m" || ext == "oct")
00037       SimTime = "1";
00038 
00039     DataSet = base + ".dat";       // name of the default dataset
00040     Script = base + ".m";          // name of the default script
00041     if(ext != "dpl")
00042       DataDisplay = base + ".dpl"; // name of default data display
00043     else {
00044       DataDisplay = base + ".sch"; // name of default schematic
00045       GridOn = false;              // data display without grid (per default)
00046     }
00047   }
00048   SimOpenDpl = true;
00049   SimRunScript = false;
00050 
00051   DocChanged = false;
00052   showBias = -1;  // don't show DC bias (currently for "Schematic" only)
00053   Scale = 1.0;
00054 }
00055 
00056 QString QucsDoc::fileSuffix (const QString& Name) {
00057   QFileInfo Info (Name);
00058   return Info.extension (false);
00059 }
00060 
00061 QString QucsDoc::fileSuffix (void) {
00062   return fileSuffix (DocName);
00063 }
00064 
00065 QString QucsDoc::fileBase (const QString& Name) {
00066   QFileInfo Info (Name);
00067   return Info.baseName (true);
00068 }
00069 
00070 QString QucsDoc::fileBase (void) {
00071   return fileBase (DocName);
00072 }
00073 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines