Skip to content

Commit

Permalink
Removed a lot of dead code and other clean-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronErhardt committed Feb 11, 2020
1 parent 54eb7d4 commit 0d4551e
Show file tree
Hide file tree
Showing 37 changed files with 91 additions and 144 deletions.
6 changes: 0 additions & 6 deletions src/Draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@ void Draw::drawCondition(Machine* m, GTransition* t, QPainter* p, int contx,
double mx, my, condx, condy;
QString sin, sep, sout;
QString cond;
int numout;
TransitionInfo* info;
QRect bound;
QBrush br(QColor(255,255,255));
Expand All @@ -665,8 +664,6 @@ void Draw::drawCondition(Machine* m, GTransition* t, QPainter* p, int contx,
//QStringList::iterator it;
//bool first;

numout = m->getNumOutputs();

window = p->window();
p->setViewport(-contx, -conty, int(window.width()*scale),
int(window.height()*scale));
Expand Down Expand Up @@ -909,7 +906,6 @@ void Draw::drawGrid(Grid* gr, QPainter* p, int contx, int conty, double scale)

int numpointsx = float((contx+window.width())/scale-cx)/gu;
int numpointsy = float((conty+window.height())/scale-cy)/gu;
int numpoints = numpointsx*numpointsy;

while (gu*scale<6)
gu *= 2;
Expand Down Expand Up @@ -1330,7 +1326,6 @@ QRect Draw::getBoundingBox(Machine* m, QPainter* p)
else
{
double bx1, by1, bx2, by2;
double dx, dy, m;
double t=-0.0;

trans->bezierCurve(t, bx2, by2);
Expand Down Expand Up @@ -1449,7 +1444,6 @@ QRect Draw::getBoundingBox(Machine* m, QPainter* p)
else
{
double bx1, by1, bx2, by2;
double dx, dy, m;
double t=-0.0;

trans->bezierCurve(t, bx2, by2);
Expand Down
4 changes: 2 additions & 2 deletions src/ExportAHDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ void ExportAHDL::writeTransitions()
QMutableListIterator<IOInfo*> ioit(iolist);


if(machine->getNumInputs()>0)
*out << "\t\t\tIF (";
if(machine->getNumInputs()>0)
*out << "\t\t\tIF (";

first = TRUE;
for(; ioit.hasNext();)
Expand Down
6 changes: 3 additions & 3 deletions src/ExportEPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void ExportEPS::doExport()
using namespace std;

// code adapted from Umbrello
bool exportSuccessful;
//bool exportSuccessful;
QRect textrect;

//out->close();
Expand Down Expand Up @@ -81,7 +81,7 @@ void ExportEPS::doExport()
{
delete painter;
delete printer;
exportSuccessful = FALSE;
//exportSuccessful = FALSE;
}
Draw* draw = new Draw(scrollview, options);
QRect rect = draw->getBoundingBox(machine, painter);
Expand All @@ -108,7 +108,7 @@ void ExportEPS::doExport()
// modify bounding box from screen to eps resolution.
rect.setWidth( int(ceil(rect.width() * 72.0/resolution)) );
rect.setHeight( int(ceil(rect.height() * 72.0/resolution)) );
exportSuccessful = fixEPS(fileName,rect);
//exportSuccessful = fixEPS(fileName,rect);

// next painting will most probably be to a different device (i.e. the screen)
//view->forceUpdateWidgetFontMetrics(0);
Expand Down
75 changes: 35 additions & 40 deletions src/ExportKISS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,11 @@ void ExportKISS::writeTransitions()
TransitionInfo* tinfo;
IOInfo* iosingle;
IOInfo* tioinfo;
bool first;


QMutableListIterator<GState*> is(machine->getSList());

for(; is.hasNext();)
while(is.hasNext())
{
s = is.next();
if (s->isDeleted())
Expand All @@ -210,60 +209,56 @@ void ExportKISS::writeTransitions()

QMutableListIterator<GTransition*> it(s->tlist);

for(; it.hasNext();)
while(it.hasNext())
{
t = it.next();
tinfo = t->getInfo();
tioinfo = tinfo->getInputInfo();

if (!t->isDeleted() && t->getEnd())
{
// QList<IOInfo> iolist;
QList<IOInfo*> iolist;
iolist = tioinfo->getSinglesInversion();
// iolist.setAutoDelete(TRUE);
// QList<IOInfo> iolist;
QList<IOInfo*> iolist;
iolist = tioinfo->getSinglesInversion();
// iolist.setAutoDelete(TRUE);

// QListIterator<IOInfo> ioit(iolist);
QListIterator<IOInfo*> ioit(iolist);

first = TRUE;
for(; ioit.hasNext();)
{

iosingle = ioit.next();
tinfoi = iosingle->convertToBinStr();
stmp = t->getEnd();
tinfoo = tinfo->getOutputsStrBin();

if (!tinfoi.isEmpty() && stmp)
{
int slen = tinfoi.length();
int numin = machine->getNumInputs();
for(int k=slen; k<numin; k++)
*out << "0";

tinfoi.replace(QRegExp("x"), "-");
*out << tinfoi.latin1() << " "; // << "\" ";

sn2 = stmp->getStateName();
// QListIterator<IOInfo> ioit(iolist);
QListIterator<IOInfo*> ioit(iolist);

while(ioit.hasNext())
{
iosingle = ioit.next();
tinfoi = iosingle->convertToBinStr();
stmp = t->getEnd();
tinfoo = tinfo->getOutputsStrBin();

if (!tinfoi.isEmpty() && stmp)
{
int slen = tinfoi.length();
int numin = machine->getNumInputs();
for(int k=slen; k<numin; k++)
*out << "0";

tinfoi.replace(QRegExp("x"), "-");
*out << tinfoi.latin1() << " "; // << "\" ";

sn2 = stmp->getStateName();
sn2.replace(QRegExp(" "), "_");

*out << sn1.latin1() << " " << sn2.latin1() << " ";
*out << sn1.latin1() << " " << sn2.latin1() << " ";

slen = tinfoo.length();
int numout = machine->getNumOutputs();
for(int l=slen; l<numout; l++)
*out << "0";
slen = tinfoo.length();
int numout = machine->getNumOutputs();
for(int l=slen; l<numout; l++)
*out << "0";

*out << tinfoo.latin1() << endl;
*out << tinfoo.latin1() << endl;

first=FALSE;
}
}
}
}
}
}
}

}


2 changes: 0 additions & 2 deletions src/ExportPNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ void ExportPNG::doExport()
using namespace std;

// code adapted from Umbrello
bool exportSuccessful;
QRect textrect;

// out->close();
Expand All @@ -68,7 +67,6 @@ void ExportPNG::doExport()
if (!scrollview)
{
delete painter;
exportSuccessful = FALSE;
}

painter->translate(-rect.x(),-rect.y());
Expand Down
4 changes: 0 additions & 4 deletions src/ExportSCXML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ void ExportSCXML::writeTransitions()
QString tinfoi, tinfoo, sn1, sn2;
State* stmp;
TransitionInfo* tinfo;
IOInfo* iosingle;
IOInfo* tioinfo;
bool first;
QStringList tinfoo_list;
QString tinfoi_processed, tinfoo_processed;
QStringList::iterator sit;
Expand Down Expand Up @@ -109,7 +106,6 @@ void ExportSCXML::writeTransitions()
{
t = it.next();
tinfo = t->getInfo();
tioinfo = tinfo->getInputInfo();

if (!t->isDeleted() && t->getEnd())
{
Expand Down
2 changes: 0 additions & 2 deletions src/ExportSMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ void ExportSMC::writeTransitions()
QString tinfoi, tinfoo, sn1, sn2;
State* stmp;
TransitionInfo* tinfo;
IOInfo* iosingle;
IOInfo* tioinfo;
bool first;
QStringList tinfoo_list, action_list;
QString tinfoi_processed, tinfoo_processed;
QStringList::iterator sit;
Expand Down
4 changes: 2 additions & 2 deletions src/ExportSVG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void ExportSVG::doExport()
using namespace std;

// code adapted from Umbrello
bool exportSuccessful;
//bool exportSuccessful;
QRect textrect;

//out->close();
Expand Down Expand Up @@ -78,7 +78,7 @@ void ExportSVG::doExport()
if (!scrollview)
{
delete painter;
exportSuccessful = FALSE;
//exportSuccessful = FALSE;
}


Expand Down
14 changes: 2 additions & 12 deletions src/ExportTestbenchVHDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,7 @@ void ExportTestbenchVHDL::writeObserverProcess(std::ofstream*out)
int stimuli_counter;
int c;
QString bit_string;
bool io_names_t, synchronous_reset_t;


synchronous_reset_t=synchronous_reset;
io_names_t=io_names;


bool io_names_t=io_names;


if (use_std_logic)
Expand Down Expand Up @@ -1125,11 +1119,7 @@ void ExportTestbenchVHDL::writeNewObserverProcess(std::ofstream*out)
{
using namespace std;

bool io_names_t, synchronous_reset_t;


synchronous_reset_t=synchronous_reset;
io_names_t=io_names;
bool io_names_t=io_names;


*out << " stimuli_observer : PROCESS" << endl;
Expand Down
17 changes: 5 additions & 12 deletions src/ExportVHDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ void ExportVHDL::writeEntity(std::ofstream*out)

//take values into account depending on alliance value
bool io_names_t=!alliance && io_names; //true only when !alliance
bool state_encoding_t=!alliance && state_encoding;//true only when !alliance
bool synchronous_reset_t=alliance || synchronous_reset;//false only when !alliance


Expand Down Expand Up @@ -261,9 +260,7 @@ void ExportVHDL::writeArchitecture(std::ofstream*out)
const char* const bit_string=std_ulogicOrBit[use_std_logic];

//take values into account depending on alliance value
bool io_names_t=!alliance && io_names;
bool state_encoding_t=!alliance && state_encoding;
bool synchronous_reset_t=alliance || synchronous_reset;



Expand Down Expand Up @@ -354,7 +351,6 @@ void ExportVHDL::writeClockProcess(std::ofstream*out)
using namespace std;

//take values into account depending on alliance value
bool io_names_t=!alliance && io_names;
bool state_encoding_t=!alliance && state_encoding;
bool synchronous_reset_t=alliance || synchronous_reset;

Expand Down Expand Up @@ -484,7 +480,7 @@ void ExportVHDL::writeStateProcess(std::ofstream*out)
QStringList inputs_array=(machine->retranslateNames(machine->getInputNameList())).split(",");

QStringList::iterator i;
bool io_names_t, state_encoding_t, synchronous_reset_t;
bool io_names_t, state_encoding_t;
int cond_notation_t;
int numStateBits = numbits(machine->getNumStates());
//qDebug("numStateBits: %d", numStateBits);
Expand All @@ -496,14 +492,13 @@ void ExportVHDL::writeStateProcess(std::ofstream*out)
{
io_names_t=false;
state_encoding_t=false;
synchronous_reset_t=false;
cond_notation_t=0; // IF-THEN notation
}
else
{
io_names_t=io_names;
state_encoding_t=state_encoding;
synchronous_reset_t=synchronous_reset;

cond_notation_t=cond_notation;
}

Expand Down Expand Up @@ -537,7 +532,7 @@ void ExportVHDL::writeStateProcess(std::ofstream*out)
// temporary variables
if (machine->getNumInputs()>0)
*out << " VARIABLE temp_input : "<< bit_string << "_vector("<< machine->getNumInputs()-1 << " DOWNTO 0);" << endl;
if (machine->getNumMooreOutputs()>0 && !sync_look_ahead || debugStateBits)
if ((machine->getNumMooreOutputs()>0 && !sync_look_ahead) || debugStateBits)
*out << " VARIABLE temp_output : "<< bit_string << "_vector("<< debugStateBits + machine->getNumMooreOutputs()-1 << " DOWNTO 0);" << endl;
if (machine->getNumOutputs()>0)
*out << " VARIABLE temp_mealy_output : "<< bit_string << "_vector("<< machine->getNumOutputs()-1 << " DOWNTO 0);" << endl;
Expand Down Expand Up @@ -1109,16 +1104,14 @@ void ExportVHDL::writeOutputProcess(std::ofstream*out)

QString out_bit_string;



bool io_names_t;

/* MEANINGLESS STATEMENTS --> can probably be removed
if (machine->getType()==1) // Binary machine
io_names_t=false;
if (alliance && machine->getType()==0)
io_names_t=false;
else io_names_t=io_names;
*/


*out << " lookahead_output_logic: PROCESS (next_state)\n" ;
Expand Down
1 change: 0 additions & 1 deletion src/ExportVVVV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ void ExportVVVV::writeMain()
QString tinfoi, tinfoo, sn1, sn2, reset_sn;
State* stmp;
TransitionInfo* tinfo;
bool first;
QString reset_event_name, reset_action_name;

// output reset state first
Expand Down
4 changes: 2 additions & 2 deletions src/GState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ void GState::calcLoop(double x, double y, int rad, double mousex,
*/
void GState::removeTransition(GTransition* trem)
{
GState* s;
s = (GState*)trem->getEnd();
//GState* s;
//s = (GState*)trem->getEnd();

trem->select(FALSE);
trem->setDeleted();
Expand Down
2 changes: 0 additions & 2 deletions src/IOInfoASCII.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ QString IOInfoASCII::convertToHexStr() const
IOInfoBin IOInfoASCII::convertToBin(int numbits) const
{
Convert conv;
unsigned char ascii[MAX_CHARARRAY_LENGTH];
int length;
IOInfoBin result(type);
QString binstr;

Expand Down
Loading

0 comments on commit 0d4551e

Please sign in to comment.