Reports package

Submodules

Reports.ReportHtml module

class Reports.ReportHtml.ReportHtml(snare, fileName, imgDir)

Bases: Reports.ReportObject.ReportObject

The PDF report object handles the generation of the analyses images,

appendAnalyze(widget, channel, sel, imgDir)
exportHtml()

Reports.ReportManager module

class Reports.ReportManager.ReportManager(snare)

Bases: PyQt5.QtWidgets.QWidget

createReport()

Open a filedialog to select the output file and start the generation.

deselectAll()

Emits signal triggered by pressing in report menu ‘Deselect all’.

deselectAllReports
generateHtml()

Handles the generation and export of the selected analyses to HTML. Iterate trough all selected analyses (in first layer through all channels and second layer through all activated selections = analyses) and generate the image in a subfolder defined with ‘imgDirRel’. After each generation an analyse html block is generated and appended to an page string. In exportHtml the html blocks are summed up and exported in one .html file.

generatePdf()

Handles the generation and export of the selected analyses to PDF. Iterate trough all selected analyses (in first layer through all channels and second layer through all activated selections = analyses) and generate the image in a predefined tmp dir (self.dirtmp). After generateImage an html string is appended to a page depending list. After completly exported the PDF, the tmp dir is cleared.

generatePng()

Handles the generation and export of the selected analyses to PNG.Depending if one analyse is selected or several, it exports the file either to the user input filename or to dynamically generated filenames. Iterating trough all selected analyses (in first layer through all channels and second layer through all activated selections = analyses) and generate the image in a subfolder defined with ‘imgDirRel’. After each generation an analyse html block is generated and appended to an page string. In exportHtml the html blocks are summed up and exported in one .html file.

numOfReports()

Returns the amoungh of activated reports. :return: Len of activated reports. :rtype: int

selectAll()

Emits signal triggered by pressing in report menu ‘Select all’.

selectAllReports
state(state, channel, selNo)

Toogle the state of the activated analyse widgets in a 2D list. :param state: Bool wheather report is activated or deactivated for widget. :type state: bool :param channel: channel object :type channel: Obj :param selNo: Sel No :type selNo: str

Reports.ReportObject module

class Reports.ReportObject.ReportObject(snare, fileName, imgDir)

Bases: object

ReportObject is the base class for the PDF and HTML export objects. It handles the generation of the analyses images and the html code assembling (like header, footer, analyse widget block).

appendAnalyze(widget, channel, sel, imgDir=False, width=550)

Appending the analyse to a html page string. self.pages stores the html page strings.

Parameters:
  • widget (QWidget) – AnalyzeWidget object
  • channel (Obj) – channel object
  • sel (str) – Sel No
  • imgDir (str) – Optional parameter to set the image path to a non absolute path (in case of HTML export)
  • width (int) – Optional parameter to set the analyse image width in the html code.
appendFooter()

Append the widget header to the current html page.

appendHeader()

Create the page header in a new html page string.

appendTitle(channel)

Append the widget title to the html page. :param channel: channel object :type channel: Obj

deleteImages()

Delete all generated images.

generateImage(widget, channelObj, selNo)

Generate an png file from AnalyseWidget. Image path is composed of self.imgDir and an id string. :param widget: AnalyzeWidget object :type widget: QWidget :param channelObj: channel object :type channelObj: Obj :param sel: Sel No :type sel: str

Reports.ReportPdf module

class Reports.ReportPdf.ReportPdf(snare, fileName, imgDir)

Bases: Reports.ReportObject.ReportObject

The PDF report object handles the generation of the analyses images and the PDF painting.

PaintPage(page)

Paint given page to PDF print device.

appendAnalyze(widget, channel, sel)

Modify appendAnalyze method from baseclass to create new pdf pages every 3rd widget per channel. :param widget: AnalyzeWidget object :type widget: QWidget :param channel: channel object :type channel: Obj :param sel: Sel No :type sel: str

finishPaint()

Stop the QPrinter painting.

newPage()

Print new page.

startPaint()

Set the QPrinter device and starts the painting of the PDF file.

Module contents