Exemple #1
0
    def create(self):
        
        info = ""
        rows = self.ui.tableWidget.rowCount()
        if rows > 0:
            for row in range(rows):
                combobox = self.ui.tableWidget.cellWidget(row, 0)

                filename = self.ui.tableWidget.item(row, 1).text()
                layer = combobox.itemText(combobox.currentIndex())
                type = filename.split(".")[-1]

                nodes = {}
                strings = {}

                if type == "i2s":
                    try:
                        nodes, strings = fh.readDXF(self.dxf, layer)
                        fh.writeI2S(nodes, strings, filename)
                        info += " - {0} object(s) from type *.i2s converted to file \n\t{1}\n".format(len(strings), filename)
                    except Exception, e:
                        QMessageBox.critical(self.widget, "Module DXF2BK", 'Type *.i2s: ' + str(e))
                elif type == "i3s":
                    try:
                        nodes, strings = fh.readDXF(self.dxf, layer)
                        fh.writeI3S(nodes, strings, filename)
                        info += " - {0} object(s) from type *.i3s converted to file \n\t{1}\n".format(len(strings), filename)
                    except Exception, e:
                        QMessageBox.critical(self.widget, "Module DXF2BK", 'Type *.i3s: ' + str(e))
Exemple #2
0
    def writeOutput(self):
        if self.ui.checkBoxMesh.isChecked():
            fh.writeT3S(self.mesh.nodMesh, self.mesh.mesh, self.ui.lineEditMesh.text())
        if self.ui.checkBoxIP.isChecked():
            fh.writeI3S(self.mesh.nodInterp, self.mesh.proInterp, self.ui.lineEditIP.text())
        if self.ui.checkBoxLE.isChecked():
            LE = {1:mc.getNodeIDsLeft(self.mesh.proMesh)}
            fh.writeI3S(self.mesh.nodMesh, LE, self.ui.lineEditLE.text())
        if self.ui.checkBoxRE.isChecked():
            RE = {1:mc.getNodeIDsRight(self.mesh.proMesh)}
            fh.writeI3S(self.mesh.nodMesh, RE, self.ui.lineEditRE.text())
        if self.ui.checkBoxOL.isChecked():
            OL = {1:mc.getNodeIDsOutline(self.mesh.proMesh)}
            fh.writeI3S(self.mesh.nodMesh, OL, self.ui.lineEditOL.text())

        if self.ui.checkBoxWS.isChecked():
            view = """"""
            counter = -1
            content = """"""

            content += ws.lineSet.format(self.getDim(self.ui.lineEditProfiles), self.getPath(self.ui.lineEditProfiles), "0xff0000", "raw profiles")
            counter += 1
            view += ":ObjectView {0} 0\n".format(counter)

            content += ws.lineSet.format(self.getDim(self.ui.lineEditReach), self.getPath(self.ui.lineEditReach), "0xffff00", "channel reach")
            counter += 1
            view += ":ObjectView {0} 0\n".format(counter)

            if self.ui.checkBoxLBL.isChecked():
                content += ws.lineSet.format(self.getDim(self.ui.lineEditLBL), self.getPath(self.ui.lineEditLBL), "0x00ff00", "left breakline")
                counter += 1
                view += ":ObjectView {0} 0\n".format(counter)

            if self.ui.checkBoxRBL.isChecked():
                content += ws.lineSet.format(self.getDim(self.ui.lineEditRBL), self.getPath(self.ui.lineEditRBL), "0x00ff00", "right breakline")
                counter += 1
                view += ":ObjectView {0} 0\n".format(counter)

            if self.ui.checkBoxLBO.isChecked():
                content += ws.lineSet.format(self.getDim(self.ui.lineEditLBO), self.getPath(self.ui.lineEditLBO), "0x0000ff", "left boundary")
                counter += 1
                view += ":ObjectView {0} 0\n".format(counter)

            if self.ui.checkBoxRBO.isChecked():
                content += ws.lineSet.format(self.getDim(self.ui.lineEditRBO), self.getPath(self.ui.lineEditRBO), "0x0000ff", "right boundary")
                counter += 1
                view += ":ObjectView {0} 0\n".format(counter)

            content += ws.meshScalar.format(self.getPath(self.ui.lineEditMesh), "0xc0c0c0", "mesh")
            counter += 1
            view += ":ObjectView {0} 0\n".format(counter)


            if self.ui.checkBoxIP.isChecked():
                content += ws.lineSet.format(self.getDim(self.ui.lineEditIP), self.getPath(self.ui.lineEditIP), "0x8000ff", "interpolated profiles")
                counter += 1
                view += ":ObjectView {0} 1\n".format(counter)

            if self.ui.checkBoxLE.isChecked():
                content += ws.lineSet.format(self.getDim(self.ui.lineEditLE), self.getPath(self.ui.lineEditLE), "0x0080ff", "left edge")
                counter += 1
                view += ":ObjectView {0} 1\n".format(counter)

            if self.ui.checkBoxRE.isChecked():
                content += ws.lineSet.format(self.getDim(self.ui.lineEditRE), self.getPath(self.ui.lineEditRE), "0x0080ff", "right edge")
                counter += 1
                view += ":ObjectView {0} 1\n".format(counter)

            if self.ui.checkBoxOL.isChecked():
                content += ws.lineSet.format(self.getDim(self.ui.lineEditOL), self.getPath(self.ui.lineEditOL), "0x800080", "outline")
                counter += 1
                view += ":ObjectView {0} 1\n".format(counter)

            content += ws.meshScalar.format(self.getPath(self.ui.lineEditMesh), "0x808080", "mesh")
            counter += 1
            view += ":ObjectView {0} 1\n".format(counter)

            fh.writeEWS(content, view, self.ui.lineEditWS.text())