[qet] [3960] updated dxf to qet export |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3960
Author: rdsivd
Date: 2015-05-11 21:20:40 +0200 (Mon, 11 May 2015)
Log Message:
-----------
updated dxf to qet export
Modified Paths:
--------------
branches/dxftoelmt/ImportDXF.pro
branches/dxftoelmt/src/ui/dxf_block.cpp
branches/dxftoelmt/src/ui/dxf_elmt_output.cpp
branches/dxftoelmt/src/ui/dxf_elmt_output.h
branches/dxftoelmt/src/ui/dxf_form_mainwindow.ui
branches/dxftoelmt/src/ui/dxf_insert.cpp
branches/dxftoelmt/src/ui/dxf_mainwindow.cpp
branches/dxftoelmt/src/ui/dxf_mainwindow.h
branches/dxftoelmt/src/ui/dxftoelmt.cpp
branches/dxftoelmt/src/ui/dxftoelmt.h
Modified: branches/dxftoelmt/ImportDXF.pro
===================================================================
--- branches/dxftoelmt/ImportDXF.pro 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/ImportDXF.pro 2015-05-11 19:20:40 UTC (rev 3960)
@@ -46,7 +46,7 @@
src/ui/dxf_block.cpp \
src/ui/dxf_mainwindow.cpp
-HEADERS += src/ui_mainwindow.h \
+HEADERS += \
src/ui/dxf_ltype.h \
src/ui/dxf_line.h \
src/ui/dxf_data.h \
@@ -74,7 +74,6 @@
src/ui/dxf_check_ltype.h \
src/ui/dxf_solid.h \
src/ui/dxf_block.h \
- src/ui_mainwindow.h \
src/ui/dxf_mainwindow.h
FORMS += \
Modified: branches/dxftoelmt/src/ui/dxf_block.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_block.cpp 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxf_block.cpp 2015-05-11 19:20:40 UTC (rev 3960)
@@ -89,7 +89,7 @@
Lineout.append(" hotspot_y=");
Lineout.append(QChar(34));
- Lineout.append(QString::number(center_y,'f',2));
+ Lineout.append(QString::number(-center_y,'f',2));
Lineout.append(QChar(34));
Lineout.append(" type=");
Modified: branches/dxftoelmt/src/ui/dxf_elmt_output.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_elmt_output.cpp 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxf_elmt_output.cpp 2015-05-11 19:20:40 UTC (rev 3960)
@@ -427,7 +427,7 @@
Lineout2.append(" y=");
Lineout2.append(QChar(34));
- Lineout2.append("0");
+ Lineout2.append("1");
Lineout2.append(QChar(34));
Lineout2.append(" orientation=");
@@ -470,7 +470,7 @@
Lineout2.append(" x=");
Lineout2.append(QChar(34));
- Lineout2.append("0");
+ Lineout2.append("1");
Lineout2.append(QChar(34));
Lineout2.append(">");
@@ -482,18 +482,53 @@
Lineout2.append("<terminals>");
Lineout2.append('\n');
+
+ //for (int n=10; n>0; n--) {
+ //cout << n << ", ";
+ //}
+
+ for (QET_counter1 = 1;QET_counter1<sp1;QET_counter1++)
+ {
+ if (ElementsLine1[QET_counter1].contains("terminal"))
+ {
+ Lineout2.append(" ");
+ Lineout2.append(" ");
+ Lineout2.append(" ");
+ Lineout2.append(" <");
+ Lineout2.append(ElementsLine1[QET_counter1]);
+
+ }
+ }
+
Lineout2.append(" ");
Lineout2.append(" ");
Lineout2.append(" ");
Lineout2.append("</terminals>");
Lineout2.append('\n');
+
+
+
Lineout2.append(" ");
Lineout2.append(" ");
Lineout2.append(" ");
Lineout2.append("<inputs>");
Lineout2.append('\n');
+ for (QET_counter2 = 1;QET_counter2<sp1;QET_counter2++)
+ {
+ if (ElementsLine1[QET_counter2].contains("input"))
+ {
+ Lineout2.append(" ");
+ Lineout2.append(" ");
+ Lineout2.append(" ");
+ Lineout2.append(" <");
+ Lineout2.append(ElementsLine1[QET_counter2]);
+
+ }
+ }
+
+
Lineout2.append(" ");
Lineout2.append(" ");
Lineout2.append(" ");
@@ -541,6 +576,9 @@
Lineout3.append(QChar(34));
Lineout3.append("embed://import/dxfconverter/");
Lineout3.append(ElementsLine2[5]);
+
+ QET_element=ElementsLine2[5]; // symbol name
+
Lineout3.append(".elmt");
Lineout3.append(QChar(34));
@@ -576,6 +614,19 @@
Lineout3.append("<terminals>");
Lineout3.append('\n');
+ for (QET_counter1 = 1;QET_counter1<sp1;QET_counter1++)
+ {
+ if (ElementsLine1[QET_counter1].contains("terminal"))
+ {
+ Lineout3.append(" ");
+ Lineout3.append(" ");
+ Lineout3.append(" ");
+ Lineout3.append(" <");
+ Lineout3.append(ElementsLine1[QET_counter1]);
+
+ }
+ }
+
Lineout3.append(" ");
Lineout3.append(" ");
Lineout3.append(" ");
@@ -588,6 +639,19 @@
Lineout3.append("<inputs>");
Lineout3.append('\n');
+ for (QET_counter2 = 1;QET_counter2<sp1;QET_counter2++)
+ {
+ if (ElementsLine1[QET_counter2].contains("input"))
+ {
+ Lineout3.append(" ");
+ Lineout3.append(" ");
+ Lineout3.append(" ");
+ Lineout3.append(" <");
+ Lineout3.append(ElementsLine1[QET_counter2]);
+
+ }
+ }
+
Lineout3.append(" ");
Lineout3.append(" ");
Lineout3.append(" ");
@@ -1102,10 +1166,10 @@
Lineout2.append("element");
Lineout2.append(QChar(34));
- Lineout2.append(" ic=");
- Lineout2.append(QChar(34));
- Lineout2.append("true");
- Lineout2.append(QChar(34));
+ //Lineout2.append(" ic=");
+ //Lineout2.append(QChar(34));
+ //Lineout2.append("true");
+ //Lineout2.append(QChar(34));
Lineout2.append(" orientation=");
Lineout2.append(QChar(34));
Modified: branches/dxftoelmt/src/ui/dxf_elmt_output.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_elmt_output.h 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxf_elmt_output.h 2015-05-11 19:20:40 UTC (rev 3960)
@@ -4,10 +4,12 @@
#include <QtCore>
#include "dxf_data.h"
#include <QUuid>
+#include "ui_dxf_form_mainwindow.h"
+//#include "ui_mainwindow.h"
-class dxf_elmt_output: public DXF_Data
+class dxf_elmt_output: public DXF_Data, Ui_MainWindow
{
public:
@@ -24,6 +26,7 @@
QString ResultElmt;
QString ResultElmt2;
QString Filename;
+ QString Filename1;
//QString Lineout2;
//QString Lineout3;
@@ -45,10 +48,16 @@
QString QET_x;
QString QET_y;
+ QString QET_element;
+ int QET_counter1;
+ int QET_counter2;
+
+
+
dxf_elmt_output();
int elmt(int BlockCount, int Flag, struct _Block_ACAD BlockList[2000], QString Filename1);
Modified: branches/dxftoelmt/src/ui/dxf_form_mainwindow.ui
===================================================================
--- branches/dxftoelmt/src/ui/dxf_form_mainwindow.ui 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxf_form_mainwindow.ui 2015-05-11 19:20:40 UTC (rev 3960)
@@ -27,16 +27,6 @@
<item row="4" column="3">
<widget class="QLineEdit" name="ExportFile"/>
</item>
- <item row="7" column="4">
- <widget class="QPlainTextEdit" name="ExportToQet">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
<item row="3" column="2">
<widget class="QPushButton" name="m_save_elmt_pb">
<property name="sizePolicy">
@@ -143,14 +133,30 @@
</sizepolicy>
</property>
<property name="text">
- <string> </string>
+ <string>save to qet file</string>
</property>
- <property name="flat">
+ <property name="default">
<bool>true</bool>
</property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
</widget>
</item>
- <item row="7" column="2" colspan="2">
+ <item row="8" column="0" colspan="5">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="7" column="2">
<widget class="QTextEdit" name="ExportToELMT">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
@@ -160,8 +166,21 @@
</property>
</widget>
</item>
+ <item row="7" column="3" colspan="2">
+ <widget class="QPlainTextEdit" name="ExportToQet">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <widget class="QLineEdit" name="LineCounter"/>
+ </item>
<item row="9" column="0" colspan="5">
- <widget class="QTextEdit" name="ProcesLog">
+ <widget class="QPlainTextEdit" name="ProcesLog">
<property name="enabled">
<bool>true</bool>
</property>
@@ -194,19 +213,6 @@
</property>
</widget>
</item>
- <item row="8" column="0" colspan="5">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</item>
</layout>
Modified: branches/dxftoelmt/src/ui/dxf_insert.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_insert.cpp 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxf_insert.cpp 2015-05-11 19:20:40 UTC (rev 3960)
@@ -46,7 +46,7 @@
}
x_center=QString::number ((center_x ),'f',2);
- y_center=QString::number ((center_y ),'f',2);
+ y_center=QString::number ((-center_y ),'f',2);
rotation1=QString::number ((rotation),'f',0);
Lineout=" ";
Modified: branches/dxftoelmt/src/ui/dxf_mainwindow.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_mainwindow.cpp 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxf_mainwindow.cpp 2015-05-11 19:20:40 UTC (rev 3960)
@@ -30,7 +30,8 @@
void MainWindow::loadFile()
{
- ProcesLog2="loadfile";
+ ProcesLog2="loading dxf file /n";
+ ui->ProcesLog->setPlainText(ProcesLog2);
QFileDialog dialog(this);
dialog.setNameFilter(tr("DXF files (*.dxf *.DXF)"));
@@ -41,9 +42,11 @@
m_file_path = dialog.selectedFiles().first();
m_path_dir = dialog.directory().absolutePath();
- StatusBarMessage="Read DXF file for convertion";
+ StatusBarMessage="Read DXF file for convertion /n";
+
ProcesLog2.append(StatusBarMessage);
+ ui->ProcesLog->setPlainText(ProcesLog2);
ui->statusBar->clearMessage();
ui->statusBar->showMessage(StatusBarMessage );
@@ -77,15 +80,16 @@
//Filename=ui->m_elmt_name_le->placeholderText();
StatusBarMessage="Start of DXF convertion";
+
+ ProcesLog2.append("/n");
ProcesLog2.append(StatusBarMessage);
+ ui->ProcesLog->setPlainText(ProcesLog2);
ui->statusBar->clearMessage();
ui->statusBar->showMessage(StatusBarMessage );
ui->statusBar->repaint();
- //ui->ProcesLog->setPlainText(StatusBarMessage);
-
dxfTOelmt ConvertDXF;
@@ -107,7 +111,10 @@
StatusBarMessage="End of DXF convertion";
+
+ ProcesLog2.cend();
ProcesLog2.append(StatusBarMessage);
+ ui->ProcesLog->setPlainText(ProcesLog2);
ui->statusBar->clearMessage();
ui->statusBar->showMessage(StatusBarMessage );
Modified: branches/dxftoelmt/src/ui/dxf_mainwindow.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_mainwindow.h 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxf_mainwindow.h 2015-05-11 19:20:40 UTC (rev 3960)
@@ -54,12 +54,9 @@
private:
- //Ui::MainWindow *ui;
-
-
void loadFile();
- //void createElmt();
+
QString fillElmtName();
QString m_file_path, m_path_dir;
Modified: branches/dxftoelmt/src/ui/dxftoelmt.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxftoelmt.cpp 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxftoelmt.cpp 2015-05-11 19:20:40 UTC (rev 3960)
@@ -1,4 +1,5 @@
#include "dxftoelmt.h"
+
#include <QMessageBox>
@@ -14,13 +15,18 @@
ProcesAddLog="Start convertion of dxf file /n";
+ //Ui_MainWindow->ProcesLog->appendPlainText("/n");
+ //Ui_MainWindow->ProcesLog->appendPlainText("Begin dxf file /n");
+ //ProcesLog2.append(StatusBarMessage);
+ //Ui_MainWindow.ProcesLog->setPlainText(ProcesLog2);
+ //ProcesLog->setPlainText(ProcesAddLog);
ProcesAddLog.append("----------------------------------- /n");
- QString StatusBarMessage;
+ //QString StatusBarMessage;
@@ -40,6 +46,9 @@
QTextStream in(&file);
+ ProcesAddLog.append("Opening file");
+
+
/* read fist 2 lines of input file */
ReadLine=in.readLine();
@@ -50,7 +59,7 @@
ActiveSection=0;
BlockCount=1;
-//statusBar()->showMessage(tr("Projet %1 enregistr\351 dans le repertoire: %2.").arg(title).arg (filePath), 2000);
+ //statusBar()->showMessage(tr("Projet %1 enregistr\351 dans le repertoire: %2.").arg(title).arg (filePath), 2000);
Wstatus.showMessage(QString::number(dxfLineCounter));
@@ -4993,7 +5002,7 @@
Aantal_Tekens = Line2.length();
if (Line1.contains(" 0", Qt::CaseSensitive) and Line2.contains("EOF", Qt::CaseSensitive)and Aantal_Tekens==3)
{
- StatusBarMessage="end of file";
+
ReadLine=in.readLine();
Line1=ReadLine;
ReadLine=in.readLine();
Modified: branches/dxftoelmt/src/ui/dxftoelmt.h
===================================================================
--- branches/dxftoelmt/src/ui/dxftoelmt.h 2015-05-11 19:18:56 UTC (rev 3959)
+++ branches/dxftoelmt/src/ui/dxftoelmt.h 2015-05-11 19:20:40 UTC (rev 3960)
@@ -29,11 +29,12 @@
#include "dxf_mtext.h"
#include <cmath>
+#include <ui_dxf_form_mainwindow.h>
+#include "dxf_mainwindow.h"
-
class dxfTOelmt : public DXF_Data
{
//Q_OBJECT