def createComponentButtonLabelElement(component):
    # when icons are available, add them into the "button"
    # path = 'components/%s/middle-size-icon.png' % name
    # img = lc.image(path=path)
    label = '%s: %s' % (component.componentname, component.__class__.__name__)
    p = lc.paragraph(text=[label])
    return p
Beispiel #2
0
 def _createPlotAndDataLink(self, id, phonons, director):
     try:
         plot = self._getDefaultDispersionPlot(id, phonons, director)
     except RuntimeError, e:
         p = lc.paragraph()  # fake plot
         p.text = [str(e)]
         l = lc.htmldocument()  # fake link
         return p, l
Beispiel #3
0
    def _electronStructure(self, director, section):
        "Electron Structure"

        # output exists
        section.add(lc.paragraph(text="Electron System", Class="qe-section"))
        table = QEGrid(lc.grid(Class="qe-table-analysis"))
        section.add(table.grid())

        table.addRow(('Total Energy:', self._pwresult.totalEnergy(True)))
        table.addRow(('Fermi Energy:', self._pwresult.fermiEnergy(True)))
        table.addRow(("Forces:", self._pwresult.forces()))
        table.addRow(("Stress (Ry/bohr^2):", self._pwresult.stress()))

        table.setColumnStyle(0, "qe-cell-param-analysis")
Beispiel #4
0
    def _summary(self, director, section):
        "System Summary"
        section.add(lc.paragraph(text="System Summary", Class="qe-section"))
        table = QEGrid(lc.grid(Class="qe-table-analysis"))
        section.add(table.grid())

        table.addRow(("Material Type:", self._pwresult.materialType()))
        table.addRow(("Lattice Type:", self._pwresult.latticeType()))
        table.addRow(
            ("Atomic Structure:", self._pwresult.atomicStructure()
             ))  # "# Atom Position (bohr) Mass (u)  Pseudo-Potentials"
        table.addRow(("Energy Cutoff:", self._pwresult.energyCutoff()))
        table.addRow(("Density Cutoff:", self._pwresult.densityCutoff()))
        if self._pwresult.materialType(
        ) == "Metal":  # Parameters specific for metals
            table.addRow(("Smearing Type:",
                          self._pwresult.smearingType()))  # For metals only
            table.addRow(("Smearing Degree:",
                          self._pwresult.smearingDegree()))  # For metals only
        table.addRow(("K points:", self._pwresult.kPoints()))

        table.setColumnStyle(0, "qe-cell-param-analysis")
Beispiel #5
0
    def p(self):
        paragraph    = lc.paragraph(text=self._text)
        if self._class:
            paragraph.Class  = self._class

        return paragraph
Beispiel #6
0
 def onbutton2(self, input=None):
     p = lc.paragraph(text=['new paragraph'])
     action = lc.select(id='doc1').append(p)
     return self.weaver.weave(action)
Beispiel #7
0
    def p(self):
        paragraph = lc.paragraph(text=self._text)
        if self._class:
            paragraph.Class = self._class

        return paragraph