|
wiRedPanda
Logic Circuit Simulator
|
Model → artifact conversions for the beWavedDolphin export paths. More...
Functions | |
| QString | csvText (const SignalModel *model) |
| void | exportToPdf (const SignalModel *model, const PlotType plotType, const QString &fileName) |
| bool | exportToPng (const SignalModel *model, const PlotType plotType, const QString &fileName) |
| QPixmap | renderToPixmap (const SignalModel *model, const PlotType plotType, const int cellW, const int cellH) |
| void | writeTruthTableText (QTextStream &out, const SignalModel *model, const int inputRowCount) |
Model → artifact conversions for the beWavedDolphin export paths.
No window or dialog state — every function takes a SignalModel and produces a pixmap, an image/PDF file, or text. The controller owns the file dialogs and (for the truth table) the simulation that fills the model before formatting.
| QString DolphinExporter::csvText | ( | const SignalModel * | model | ) |
Returns model encoded in the CSV-ish "rows,cols," + comma-separated values format used by the terminal (print) path.
Definition at line 103 of file DolphinExporter.cpp.
References SignalModel::value().
Referenced by BewavedDolphin::print().
| void DolphinExporter::exportToPdf | ( | const SignalModel * | model, |
| PlotType | plotType, | ||
| const QString & | fileName ) |
Renders model with plotType and writes it to fileName as a landscape A4 PDF, scaled to fit the page. Throws if the PDF device cannot be opened.
Definition at line 57 of file DolphinExporter.cpp.
References PANDACEPTION_WITH_CONTEXT, and renderToPixmap().
| bool DolphinExporter::exportToPng | ( | const SignalModel * | model, |
| PlotType | plotType, | ||
| const QString & | fileName ) |
Renders model with plotType and saves it to fileName as a PNG. Returns true on success.
Definition at line 52 of file DolphinExporter.cpp.
References renderToPixmap().
Referenced by BewavedDolphin::exportToPng().
| QPixmap DolphinExporter::renderToPixmap | ( | const SignalModel * | model, |
| PlotType | plotType, | ||
| int | cellW, | ||
| int | cellH ) |
Rasterizes model to a pixmap via a throwaway table view (the live view is untouched), using plotType for the cell rendering and cellW x cellH per cell.
Definition at line 25 of file DolphinExporter.cpp.
Referenced by exportToPdf(), and exportToPng().
| void DolphinExporter::writeTruthTableText | ( | QTextStream & | out, |
| const SignalModel * | model, | ||
| int | inputRowCount ) |
Writes model to out as the truth-table text format: inputRowCount input rows, a blank line, then the output rows, each line followed by its : "label".
Definition at line 79 of file DolphinExporter.cpp.
References SignalModel::value().
Referenced by BewavedDolphin::saveToTxt().