mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00

Introduced very basic c++ coding style for the class Schematic and it's parent-class QucsDoc based on https://google.github.io/styleguide/cppguide.html: -Prefix class attributes with a_ (much more better readability!) -Class member initialization via constructor member initialization list -No public class attributes (where possible with small effort) Signed-off-by: ThomasZecha <zecha@ihp-microelectronics.com>
79 lines
2.4 KiB
C++
79 lines
2.4 KiB
C++
/***************************************************************************
|
|
qucsdoc.cpp
|
|
-------------
|
|
begin : Wed Sep 3 2003
|
|
copyright : (C) 2003, 2004 by Michael Margraf
|
|
email : michael.margraf@alumni.tu-berlin.de
|
|
***************************************************************************/
|
|
|
|
/***************************************************************************
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
***************************************************************************/
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include "qucsdoc.h"
|
|
#include "qucs.h"
|
|
|
|
|
|
QucsDoc::QucsDoc(QucsApp *App_, const QString& Name_) :
|
|
a_DocName(Name_),
|
|
a_DataSet(),
|
|
a_DataDisplay(),
|
|
a_Script(),
|
|
a_SimTime(),
|
|
a_lastSaved(),
|
|
a_Scale(1.0),
|
|
a_App(App_),
|
|
a_DocChanged(false),
|
|
a_SimOpenDpl(false),
|
|
a_SimRunScript(false),
|
|
a_showBias(-1), // don't show DC bias (currently for "Schematic" only)
|
|
a_GridOn(true),
|
|
a_tmpPosX(0),
|
|
a_tmpPosY(0)
|
|
{
|
|
QFileInfo Info(a_DocName);
|
|
if(!a_DocName.isEmpty()) {
|
|
a_DocName = Info.absoluteFilePath();
|
|
QString base = Info.completeBaseName();
|
|
QString ext = Info.suffix();
|
|
|
|
if(ext == "m" || ext == "oct")
|
|
a_SimTime = "1";
|
|
|
|
a_DataSet = base + ".dat"; // name of the default dataset
|
|
a_Script = base + ".m"; // name of the default script
|
|
if(ext != "dpl")
|
|
a_DataDisplay = base + ".dpl"; // name of default data display
|
|
else {
|
|
a_DataDisplay = base + ".sch"; // name of default schematic
|
|
a_GridOn = false; // data display without grid (per default)
|
|
}
|
|
}
|
|
}
|
|
|
|
QString QucsDoc::fileSuffix (const QString& Name) {
|
|
QFileInfo Info (Name);
|
|
return Info.suffix();
|
|
}
|
|
|
|
QString QucsDoc::fileSuffix (void) {
|
|
return fileSuffix (a_DocName);
|
|
}
|
|
|
|
QString QucsDoc::fileBase (const QString& Name) {
|
|
QFileInfo Info (Name);
|
|
return Info.baseName ();
|
|
}
|
|
|
|
QString QucsDoc::fileBase (void) {
|
|
return fileBase (a_DocName);
|
|
}
|
|
|